Skip to content
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

Don't wrap NumPy 2.0 at all #126

Merged
merged 7 commits into from
Mar 29, 2024
Merged

Don't wrap NumPy 2.0 at all #126

merged 7 commits into from
Mar 29, 2024

Conversation

asmeurer
Copy link
Member

This also adds a use_compat flag to array_namespace. If None, it does the default behavior. If True or False it forces the use or
non-use of the compat wrapper.

Tests will fail here until data-apis/array-api-strict#24 is released.

If None, it does the default behavior. If True or False it forces the use or
non-use of the compat wrapper.

This commit also changes it so that NumPy 2.0 does not return the wrapper
library at all by default (when use_compat=None), since it is completely array
API compatible on its own.
NumPy 2.0 no longer uses the wrapper code at all (unless explicitly requested
with array_namespace(use_compat=True), but this is not really supported).
@asmeurer
Copy link
Member Author

Note that I'm still running the test suite against numpy 2.0, as I want to make sure that if at any point in the future wrapping becomes necessary again that I am made aware of that.

@asmeurer
Copy link
Member Author

This is ready to go.

Once we start supporting 2023.12, we'll probably have to add a wrapper again, if just for the new inspection APIs. My guess is that if/when that happens we'll want to have a separate wrapper namespace for NumPy 2.0 because the rest of the NumPy 1.26 wrapper functions are pointless to use with 2.0. Maybe at that point we can reuse whatever solution I come up with for data-apis/array-api-strict#8 to streamline this.

@asmeurer asmeurer merged commit 490a3e1 into data-apis:main Mar 29, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant