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

Removing numpy.array_api import #407

Closed
rgommers opened this issue Mar 1, 2024 · 1 comment · Fixed by #410
Closed

Removing numpy.array_api import #407

rgommers opened this issue Mar 1, 2024 · 1 comment · Fixed by #410

Comments

@rgommers
Copy link

rgommers commented Mar 1, 2024

Hi, I noticed through code search that there are a few comments in this repo that reference numpy.array_api and (more importantly) one import:

from numpy.array_api._typing import Dtype

I wanted to give you a heads up that in NumPy 2.0 that import will break. Because we'll have support for the array API standard in the main numpy namespace, the numpy.array_api submodule is being removed (see numpy/numpy#25911).

For testing purposes, https://github.com/data-apis/array-api-strict can be used. The Dtype type annotation you're using is probably best vendored: https://github.com/numpy/numpy/blob/maintenance/1.26.x/numpy/array_api/_typing.py#L55-L66

@tomwhite
Copy link
Member

tomwhite commented Mar 1, 2024

Thanks for the heads up @rgommers!

That code and all the other places with comments referencing numpy.array_api are all concerned with dtype functions. Now that we are using Array API compliant backend array libraries (see https://github.com/cubed-dev/cubed/blob/main/cubed/backend_array_api.py) we should delegate these functions to the backend library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants