-
Notifications
You must be signed in to change notification settings - Fork 320
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
NumPy 2.0 compatibility #2153
Comments
Per the latest announcement numpy 2.0 will come out in 3.5 weeks. Flopy 3.7 is planned tomorrow to coincide with MF6.5.0, but optional dependencies have not all released np2 support. I see two paths:
|
@wpbonelli I think we should pin to <2 for 3.7.0 and do another release later |
NumPy 2.0 came out today. Netcdf4-python has made a numpy2-compatible release (1.7.0) but there are some issues with the package. Seems like they are working on a fix, after which I think we can proceed at any time. Should we make a new release promptly? We have a number of bugfixes and a couple new features since 3.7.0. I guess np2 support could also be considered a feature, so by semver this would be 3.8.0. If others agree I can remove the pin and get the ball rolling when netcdf4 is ready. |
Checking test_uzf_negative_iuzfopt with NumPy 2.0 (xref #2153), this test failed. The test criteria originally had several issues, including confusing extpd as pet. These issues are fixed in this PR to properly compare expected array values.
…20.3 (#2237) This PR resolves several deprecation warnings from NumPy 2.0 (xref #2153): * np.in1d() → np.isin() * "a16" → "S16" to describe 16-length string of bytes * The numpy.core.records module is private, so use numpy.rec instead, which seems to work with older versions This also bumps the minimum version of numpy from 1.15.0 to 1.20.3, since this is the minimum for pandas 2.0.0, thus the minimum versions were incompatible.
I like the idea of making a new release that supports numpy 2.0. We will likely have others as this all settles in, but my opinion is to keep moving it forward. |
Opening this (somewhat belatedly) to track support for NumPy 2.0, due out soon. The maintainers recommend downstream projects make a compatible release before 2.0 drops. We have already made some progress updating API usages. The biggest consideration is our runtime dependencies on projects which depend on numpy (checks indicate whether the project has released 2.0 support)
Core requirements (pandas and mpl) are already covered. If 2.0 is imminent before all our optional dependencies support it, we will need to decide whether to release immediately or wait, but it sounds like at least a month remaining, so with luck it won't come to that.
Tasks:
ruff
rule NPY201, all looks goodThe text was updated successfully, but these errors were encountered: