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

Not longer compatible with numpy 2.0 #56

Closed
ChrisBarker-NOAA opened this issue Jul 13, 2024 · 1 comment
Closed

Not longer compatible with numpy 2.0 #56

ChrisBarker-NOAA opened this issue Jul 13, 2024 · 1 comment

Comments

@ChrisBarker-NOAA
Copy link

ChrisBarker-NOAA commented Jul 13, 2024

So far, I've hit the fact that np.array_api no longer exists:

"""
NumPy 1.22.0 was the first version to include support for the array API standard, via a separate numpy.array_api submodule. This module was marked as experimental (it emitted a warning on import) and removed in NumPy 2.0 because full support was included in the main namespace.
"""

So I put in this stanza in the tests:

if np.__version__ < '2.0.0':  # not a robust way to check version!
    with warnings.catch_warnings():
        warnings.simplefilter("ignore")
        import numpy.array_api as xp
else:
    xp = np

but hit some other snags:

E   AttributeError: module 'numpy' has no attribute '_dtypes'. Did you mean: 'dtypes'?

For now, I'm going to go back to <2.0 -- but hopefully I'll be able to clean this up later, if someone doesn't beat me to it.

(maybe numpy should be pinned to <2 for now?)

@ianna
Copy link
Collaborator

ianna commented Sep 13, 2024

fixed in #60

@ianna ianna closed this as completed Sep 13, 2024
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

No branches or pull requests

2 participants