Skip to content

v0.3.3: compat with numpy 1.24+ oob int cast rules#6

Merged
5tefan merged 4 commits intomainfrom
stefan/numpy2compat
Apr 9, 2025
Merged

v0.3.3: compat with numpy 1.24+ oob int cast rules#6
5tefan merged 4 commits intomainfrom
stefan/numpy2compat

Conversation

@5tefan
Copy link
Owner

@5tefan 5tefan commented Apr 9, 2025

Summary

Numpy 1.24+ changed out-of-bounds int overflow handling to fail instead of succeed silently. ncflag used the np.uint8(-1) == np.iinfo(np.uint8).max trick to handle unmasked flags on the same code path as masked flags. The oob cast now fails at some point on numpy 2.0+.

Changed to use np.invert(np.zeros_like(x)) instead.

Ref: https://numpy.org/devdocs/release/1.24.0-notes.html#conversion-of-out-of-bound-python-integers

5tefan and others added 4 commits April 8, 2025 23:09
* gha: upgrade

* gha: upgrade: drop python 3.7

* gha: upgrade: no info, micromamba already does that

* gha: upgrade: isort and ruff check

* gha: upgrade: isort and ruff check
@5tefan 5tefan merged commit 9be1588 into main Apr 9, 2025
4 checks passed
@5tefan 5tefan deleted the stefan/numpy2compat branch April 9, 2025 05:35
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.

1 participant