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

Supporting NumPy 2.0 #950

Merged
merged 2 commits into from
Apr 10, 2024
Merged

Supporting NumPy 2.0 #950

merged 2 commits into from
Apr 10, 2024

Conversation

qiyunzhu
Copy link
Contributor

@qiyunzhu qiyunzhu commented Apr 5, 2024

See here. To test whether this patch will work, we need to wait until h5py 3.11.0 is released. At present, it will say:

  File "biom/_filter.pyx", line 1, in init biom._filter
    # -----------------------------------------------------------------------------
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

@qiyunzhu qiyunzhu changed the title added numpy-2.0 support Supporting NumPy 2.0 Apr 5, 2024
@wasade
Copy link
Member

wasade commented Apr 10, 2024

Thanks! I looked at a few of the CI runs, and they looked to be using numpy 1.0. Is there a standard practice for updating CI to test both numpy 1 and 2? If not, can that be added? At the moment, I don't see an indication that we pass tests with 2.0, and this seems like an important distinction to be defensive about in CI

@qiyunzhu
Copy link
Contributor Author

@wasade NumPy 2.0 hasn't been released yet, but one can install it by pip install numpy --pre or pip install numpy==2.0.0rc1. I have played around it and found some ways to set up a local test environment. It is feasible that we add this to CI. However, I think that an easier way is that we wait until NumPy 2.0 and relevant dependencies (like Pandas and h5py) in their compatible versions are released. This will make the CI much simpler.

@qiyunzhu
Copy link
Contributor Author

Looks like h5py 3.11.0 was just released. This is the main unblocker. Now we need to wait for the release of Pandas 2.2.2.

@wasade
Copy link
Member

wasade commented Apr 10, 2024

Okay, thanks! So I think then this PR is "draft" NumPy 2.0 support but we cannot encode as such in CI. Could a changelog note be added along those lines, nothing likely 2.0 support but not yet part of our testing matrix?

@qiyunzhu
Copy link
Contributor Author

@wasade Sounds good! Changelog updated.

@wasade
Copy link
Member

wasade commented Apr 10, 2024

Thanks!

@wasade wasade merged commit d00f947 into biocore:master Apr 10, 2024
36 checks passed
@qiyunzhu qiyunzhu deleted the np2 branch April 10, 2024 20:25
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.

2 participants