-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
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.
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.
@@ -101,6 +102,11 @@ def _unitary(norm): | |||
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.
@@ -19,6 +20,11 @@ | |||
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