-
Notifications
You must be signed in to change notification settings - Fork 4
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
Investigate numpy 2.0.0 support #657
Comments
Python 3.8 is end of life (EOL) in 3 months and 3 weeks (31 Oct 2024, 5 years old at that point), so dropping that seems a good thing. |
I did some quick static analysis based on https://docs.astral.sh/ruff/rules/numpy2-deprecation/, with: [lint]
select = ["NPY"] Which gives me:
So the code here should already work on both pre and post NumPy 2. Looking at the dependencies, they should also all have NumPy 2 compatible releases out now. I just had to double check MeshKernel, but doing the same check there didn't highlight any issues either. So perhaps hydrolib can just stop enforcing |
Thanks @visr for this analysis As stated, this requires either of these:
Both are not a big effort, but at the moment there is no time to do or discuss these options. However, it will be looked at during the next sprint I believe. Is it ok to wait a bit or are you running into issues now? |
Ok I'm not a poetry user, I thought that issue just affected your ability to test the numpy compat, but it affects declaring the numpy compat. I ran into it now in a project, but since the D-Hydro related feature is not a direct requirement we'll just remove hydrolib support, so it isn't an issue. |
The However, when doing that, poetry locks numpy on 2.0.2 since that is the latest version available for python 3.9. When installing this numpy version on python 3.12 together with netcdf4==1.7.1.post2 (the latest), this results in edit: the netcdf issue seems to be resolved in Unidata/netcdf4-python#1355, so just await a new release should do the trick. Might be wise to define that as a minimal version for 3.13 and maybe also for 3.12. |
Is your feature request related to a problem? Please describe.
Numpy 2.0.0 was released on 16 June 2024. HYDROLIB-core enforces
numpy<2.0.0
via the pyproject.toml, so it will not be installed. However it is good to be future proof and test if everything still works when also allowing numpy 2.0.0 and above.Describe the solution you'd like
A quick investigation at least, preferably resulting in support for
numpy>=2
Additional information
Poetry is always blocking these types of tests. In fixing #599 we saw that poetry thinks that all python versions must be able to install the same numpy version for some reason. It seems very likely that supporting numpy 2 is only neatly possible after dropping python 3.8 support.
when running the tests with numpy>=2.0, there are several test failing:
Related issue: Unidata/netcdf4-python#1354
The text was updated successfully, but these errors were encountered: