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

Numpy 2.0 compatibility #1160

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Numpy 2.0 compatibility #1160

wants to merge 7 commits into from

Conversation

maxnoe
Copy link
Contributor

@maxnoe maxnoe commented Apr 18, 2024

No description provided.

@maxnoe
Copy link
Contributor Author

maxnoe commented Apr 18, 2024

Python 3.9 builds are failing because the new version of blosc2 that supports numpy 2.0 is requiring python >=3.10

@maxnoe
Copy link
Contributor Author

maxnoe commented Apr 18, 2024

https://scientific-python.org/specs/spec-0000/ says to drop python 3.9 support in Q4 2023, @avalentino should we simply also drop 3.9 here?

@avalentino
Copy link
Member

https://scientific-python.org/specs/spec-0000/ says to drop python 3.9 support in Q4 2023, @avalentino should we simply also drop 3.9 here?

OK for me, thanks

@maxnoe maxnoe marked this pull request as ready for review April 18, 2024 10:53
@maxnoe
Copy link
Contributor Author

maxnoe commented Apr 18, 2024

Ok, we are down to only a handful of failures under 2.0 now

@maxnoe
Copy link
Contributor Author

maxnoe commented Apr 18, 2024

The change is due to the type promotion changes in numpy 2.0, the tests expect in16, but according to the new rules, the values are promoted to int64.

@avalentino Do we need to keep the old behavior or is it fine to adapt the tests to check for int64 if running under numpy 2.0?

@avalentino
Copy link
Member

@avalentino Do we need to keep the old behavior or is it fine to adapt the tests to check for int64 if running under numpy 2.0?

I would need to check on a chase by case basis.
As a preliminary consideration I would say that for all the test involving the expression evaluator it should be fine to follow the numpy2 convention (when run with numpy2).
@FrancescAlted do you agree? What was the approach in numexpr?

@maxnoe
Copy link
Contributor Author

maxnoe commented Apr 19, 2024

Actually, it's a bit different: the expected type changed, but pytables didn't. So the question would be: do we change the pytest expression engine rules to follow the new type promotions of bumpy 2.0

@FrancescAlted
Copy link
Member

@avalentino Do we need to keep the old behavior or is it fine to adapt the tests to check for int64 if running under numpy 2.0?

I would need to check on a chase by case basis. As a preliminary consideration I would say that for all the test involving the expression evaluator it should be fine to follow the numpy2 convention (when run with numpy2). @FrancescAlted do you agree? What was the approach in numexpr?

IMO, the NumPy team did a good job in changing promotion rules for 2.0 only when it was common sense, so our approach for numexpr was to follow the new conventions. I also think that PyTables should adopt the new conventions and note that in the release notes.

@avalentino
Copy link
Member

Thanks @FrancescAlted

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.

None yet

3 participants