modflowpy / flopy

A Python package to create, run, and post-process MODFLOW-based models.
https://flopy.readthedocs.io
Other
507 stars 307 forks source link

NumPy 2.0 compatibility #2153

Closed wpbonelli closed 3 months ago

wpbonelli commented 5 months ago

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:

wpbonelli commented 3 months ago

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:

jdhughes-usgs commented 3 months ago

@wpbonelli I think we should pin to <2 for 3.7.0 and do another release later

wpbonelli commented 3 months ago

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.

langevin-usgs commented 3 months ago

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.

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.