-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
DEP: deprecate passing a generator to stack functions #12280
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
Conversation
Fixes numpygh-12263 We can't support generators with dispatch for ``__array_function__``.
Does this fix the pandas/scipy issues with NumPy HEAD? |
I think the warning is a bit too technical and would be cryptic to many users (including me if I didn't know what the issues was). A gist of the issue would be sufficient in my opinion. Users who are utilizing
|
b2bd14a
to
0064021
Compare
SciPy has already merged the compensating changes that remove generator usage in this context so that our CI remains "green." I restarted the buggy shippable builds here |
Why |
'such as list or tuple. Support for non-sequence ' | ||
'iterables such as generators is deprecated as of ' | ||
'NumPy 1.16 and will raise an error in the future.', | ||
FutureWarning, stacklevel=stacklevel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This raises an interesting point - is wrapping everything in array_function_dispatch
going to make all our warnings be emitted within the __array_function__
dispatcher?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, yes.
In general: warnings about changed functions arguments/signatures should go in the dispatcher, since they are relevant whether you are using NumPy or not. Warnings about changed function behavior should remain in the implementations.
But I guess I'm still used to the old policy: "Changed in version 3.7: Previously DeprecationWarning and FutureWarning were distinguished based on whether a feature was being removed entirely or changing its behaviour. They are now distinguished based on their intended audience and the way they’re handled by the default warnings filters." I was thinking of this as a behavior change, but I suppose that isn't exactly true -- we will be raising an error instead. Do we have a NumPy specific policy about when we use |
Sounds like |
Sounds like we need to document the use of DeprecationWarning someplace. |
Thanks Stephan. |
Fixes #12263
We can't support generators with dispatch for
__array_function__
.