-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix Numpy 1.25 deprecations #10308
Fix Numpy 1.25 deprecations #10308
Conversation
Most of the effects we see are because of the removal of various aliases (`np.product` being a common one), but the new warning on implicit conversion of size-1 arrays to scalars that was initially found in parts of c463b3c has reared its head again too.
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 5311917846
💛 - Coveralls |
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, and I did a quick check (because it would slip my mind otherwise and CI wouldn't catch it because we're testing with 1.24.x) and nothing here looks like it would require raising our minimum numpy version of 1.17.
lhs = math.sin(angle / 2) | ||
|
||
def objective(phi): | ||
rhs = 2 * math.sin(phi / 2) ** 2 | ||
rhs *= math.sqrt(1 - math.sin(phi / 2) ** 4) | ||
lhs = math.sin(angle / 2) | ||
return rhs - lhs | ||
sin_sq = np.sin(phi / 2) ** 2 | ||
return 2 * sin_sq * np.sqrt(1 - sin_sq**2) - lhs |
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.
I assume this was the place with the implicit scalar conversion was emitting a deprecation warning because of the switch from math.sin()
and math.sqrt()
to np.sin()
and np.sqrt()`.
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.
This is one of them, yeah. I didn't realise I'd screwed with the implementation as much as that - I think I was thinking about reducing the increased overhead from switching back to Numpy dispatchers. I don't know enough about the internals of how Scipy's fsolve
to know for sure what's safe as a return value, but it definitely puts in arrays.
Most of the effects we see are because of the removal of various aliases (`np.product` being a common one), but the new warning on implicit conversion of size-1 arrays to scalars that was initially found in parts of c463b3c has reared its head again too. (cherry picked from commit 364d6fd) Co-authored-by: Jake Lishman <[email protected]>
Summary
Most of the effects we see are because of the removal of various aliases (
np.product
being a common one), but the new warning on implicit conversion of size-1 arrays to scalars that was initially found in parts of c463b3c has reared its head again too.Details and comments
This is not a complete resolution of #10305 because of larger issues with correctness of the
Isometry
code triggered by Numpy 1.25. It should fix all the new deprecation warnings, though.