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

support a more recent (>=1.23) version of numpy? #205

Closed
moustakas opened this issue Feb 29, 2024 · 6 comments
Closed

support a more recent (>=1.23) version of numpy? #205

moustakas opened this issue Feb 29, 2024 · 6 comments

Comments

@moustakas
Copy link
Member

I am working with a student and @jdbuhler on building a JAX version of FastSpecFit. JAX requires numpy>=1.23 but desiutil (a FastSpecFit dependency) requires numpy<1.23--
https://github.com/desihub/desiutil/blob/main/setup.cfg#L36

Would it be possible to relax this numpy version cap via the appropriate code changes (which I would be willing to help with, since this is a blocking factor for our work)?

@moustakas
Copy link
Member Author

This ticket is possibly related to #198, since it looks like distutils was deprecated in 1.23.0--
https://numpy.org/doc/stable/release/1.23.0-notes.html#deprecations

@weaverba137
Copy link
Member

I think #198 arose from unit tests of numpy>=1.23, but we can test again on a branch.

@sbailey
Copy link
Contributor

sbailey commented Feb 29, 2024

I also recently tripped across this. #187 has the context for why we pinned to numpy<1.23. The issue is that astropy 5.0.x uses numpy.asscalar, which was dropped by numpy 1.23. So if you are using an old-ish astropy (5.0.x) then you also need an old-ish number (<1.23). But desiutil likely also works with the combination of a newer astropy + newer numpy, but I don't know how to express that double-dependency constraint for pip install / setup.cfg purposes.

It would likely work to install the astropy/numpy dependencies yourself to the versions you need, and then install desiutil with pip install --no-deps .... I don't know the version of astropy 5.x that is compatible with numpy >=1.23.

@weaverba137
Copy link
Member

I agree with Stephen's suggestion. I don't think there's anything intrinsic to desiutil that requires numpy<1.23, except that the pipeline was using astropy==5.0 for a while and that does not work with 1.23. However astropy==5.0.8 does seem to work.

Basically desiutil tests a narrow range of versions around what the pipeline is using. Outside of that, the test matrix starts to explode.

We already know that numpy 2.0 will cause issues, but we're also way behind on numpy<2.0. We're orbiting around numpy 1.22-1.23, meanwhile, numpy 1.26 is the current version.

And of course, we haven't really done much testing on Python 3.11, which is already not the most recent version.

@weaverba137
Copy link
Member

Note that #207 tests more recent versions of numpy, so we can now say that desiutil supports numpy >= 1.23. HOWEVER we are not supporting Python >= 3.11 at this time. Since Jura was run with Python 3.10, that's OK for now.

If there are still concerns about the range of versions supported, please comment. Otherwise I will consider #207 as having closed this issue.

@weaverba137
Copy link
Member

Closed by #207.

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

3 participants