-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
ENH: Add array API standard v2022.12 support to numpy.array_api #23881
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
Updates from the v2022.12 version of the spec: - Add __complex__. - __float__, __int__, and __bool__ are now more lenient in what dtypes they can operate on. - Support complex scalars and dtypes in all operators (except those that should not operate on complex numbers). - Disallow integer scalars that are out of the bounds of the array dtype. - Update the tests accordingly.
This is a new function in the v2022.12 version of the array API standard which is used for determining if a given dtype is part of a set of given dtype categories. This will also eventually be added to the main NumPy namespace, but for now only exists in numpy.array_api as a purely strict version.
OK, not sure what happened with the draft status, but this is ready to review. It would also be nice to include #23789 in the 1.25 release as well. |
Actually, let me see how hard it is to add the |
The reason I'm hesitant is that we currently don't have any coverage of the fft extension in the array API test suite. As far as I know the standard fft API is identical to I guess the biggest question is whether this is something that SciPy (or others?) will need soon for their own adding of array API support. @rgommers @tupui @tylerjereddy do you have any thoughts on how important it will be for SciPy's array API work for If it's not critical, I would suggest omitting it for now, and adding it later this year when we have full fft support in the test suite. But if it is indeed something that will be important for SciPy, I can add basic wrappers, with minimal testing. At any rate, everything else here is ready for review. |
Based on #23880 (comment) I'm not going to implement fft stuff here. |
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
Thanks @asmeurer for updating this. |
Thank you Matti. If you or someone could merge #23789 too that would be great. I've already reviewed it and it's ready to go as far as I'm concerned. |
Fixes #23880