-
-
Notifications
You must be signed in to change notification settings - Fork 12k
ENH: __array_function__ support for np.fft and np.linalg
#12117
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
810508e to
40a5588
Compare
hameerabbasi
left a comment
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 one (particularly linalg) in particular will be useful for PyData/Sparse long term. Thanks for this.
I see that ignoring None is a theme here, so I'm going to ignore it completely in future reviews. I'm sure you carefully considered the pros and cons of such an approach.
mhvk
left a comment
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.
Apart from my suggestion to make an exception for fft to the rule that every function has its own dispatcher, this looks good.
| return norm is not None | ||
|
|
||
|
|
||
| def _fft_dispatcher(a, n=None, axis=None, norm=None): |
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.
As far as I can see, in this whole file, there are only two signatures: (a, n, axis, norm), and (a, s, axes, norm) - I think in such a well-constructed file, it is a lot clearer to define the two signatures once and use them throughout.
| integer_types = integer_types + (integer,) | ||
|
|
||
|
|
||
| def _fftshift_dispatcher(x, axes=None): |
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.
I would again suggest just using a single dispatcher.
|
This looks to be still under discussion. Ping when ready. |
|
Remove WIP from title when ready. |
|
Yeah, I got a little carried away with copy & paste here. This should be much less repetitive now. |
|
Well, for |
__array_function__ support for np.fft and np.linalg
xref #12028