-
Notifications
You must be signed in to change notification settings - Fork 1k
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 Behaviour Changes #7856
Comments
This was referenced Jun 17, 2024
Merged
The current temporary fix is to disable Numpy 2.0 in requirements.txt and then we'll work on compatibility fixes. There are other issues beyond the raised here in terms of deterministic behaviour and accuracy and seen in tests when run with Numpy 2.0 and some fixes I tried. |
ziw-liu
added a commit
to mehta-lab/VisCy
that referenced
this issue
Jul 18, 2024
mattersoflight
pushed a commit
to mehta-lab/VisCy
that referenced
this issue
Jul 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Numpy 2.0 was just released with some behavioural changes which are showing up as bugs. One that is seen in this trace:
The underlying issue is that the
MAX_SEED
value is 2**32 which is an overflow value for uint32. It is stored as a Pythonint
but when used as the right hand side of modulus in this expression where_seed
is a uint32 of any value, the exception shown above is raised. In Numpy before 2.0, the expression would silently produce a int64 result.To Reproduce
Steps to reproduce the behavior:
np.uint32(1)%(np.iinfo(np.uint32).max+1)
Expected behavior
No exception should be raise for this operations if the MAX_SEED value is set correctly. The result from the expression should be a uint32.
Environment
Ensuring you use the relevant python executable, please paste the output of:
Additional context
This was encountered when doing a PR on the
gen-ai-dev
branch. @virginiafdezThe text was updated successfully, but these errors were encountered: