-
Notifications
You must be signed in to change notification settings - Fork 37
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
Small: Fix NumPy 2.0 test script breakage #1116
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for figuring this out.
remaining_size = np.product(vShape[1:]) | ||
remaining_size = np.prod(vShape[1:]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glad to see that the numpy gods thought this was a necessary change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, does prod
work for older versions of numpy or will this break the test suite when not using the newer numpy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the change should be backwards compatible: https://stackoverflow.com/questions/49863633/numpy-product-vs-numpy-prod-vs-ndarray-prod.
PR Summary
This fixes the test script breakage due to NumPy 2.0 API changes (https://numpy.org/devdocs/numpy_2_0_migration_guide.html#numpy-2-0-migration-guide)
PR Checklist