Skip to content

DOC: vectorize with signature doesn't pre-call function #29335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danra
Copy link
Contributor

@danra danra commented Jul 7, 2025

Aligns doc with the implementation

@danra
Copy link
Contributor Author

danra commented Jul 28, 2025

Could someone please take a look?
This is a change to the docs to match what the function is actually doing AFAICS.

@@ -2332,7 +2332,7 @@ class vectorize:

cache : bool, optional
If `True`, then cache the first function call that determines the number
of outputs if `otypes` is not provided.
of outputs if `otypes` and `signature` are not provided.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where in the code does signature come into play? I took a cursory look and it seemed only otypes is involved in the cache. In any case, perhaps:

If True, then cache the number of outputs from a function call in order to speed up subsequent calls. Effective only if otypes is not provided (or Effective only if neither otypes nor signature are provided).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here:

if self.signature is not None:

The cache-related logic isn't even reached if signature is provided.

About the wording, could we tackle that separately?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so the change seems correct.

could we tackle that separately?

@rkern wrote the original docstring, maybe he has an opinion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did? I don't really know any of the details now, at least; I don't really use vectorize and am unfamiliar with the caching functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy