-
-
Notifications
You must be signed in to change notification settings - Fork 628
Fix tests with scipy 1.15 #39261
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 tests with scipy 1.15 #39261
Conversation
Increase numerical tolerance in one test, and replace usage of deprecated `sph_harm` in another one
....: sph_harm(1, 1, pi.n(), (pi/2).n()) # abs tol 1e-14 # needs scipy sage.symbolic | ||
....: else: | ||
....: from scipy.special import sph_harm_y # needs scipy | ||
....: sph_harm_y(1, 1, (pi/2).n(), pi.n()).item() # abs tol 1e-9 # needs scipy sage.symbolic |
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.
Instead of importing scipy.version
, what about using a very pythonic way of doing thing like
try:
from scipy.special import sph_harm_y
sph_harm_y(1, 1, (pi/2).n(), pi.n()).item() # abs tol 1e-9
except ImportError:
from scipy.special import sph_harm
sph_harm(1, 1, pi.n(), (pi/2).n()) # abs tol 1e-14
?
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.
not sure, IMO this is easier to keep track of for future cleanups (when sage requires scipy>=1.15)
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.
Sounds like a fairly good argument.
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 agree...
It would be useful to have tags for different program versions to avoid having to use conditionals in the doctests (just like "32-bit" and "64-bit" labels). This is not only doctest but also documentation, and it looks kind of ugly. With labels, perhaps the manual could show only the version that matches currently installed software or something like that...
Documentation preview for this PR (built with commit de24001; changes) is ready! 🎉 |
sagemathgh-39261: Fix tests with scipy 1.15 Increase numerical tolerance in one test, and replace usage of deprecated `sph_harm` in another one URL: sagemath#39261 Reported by: Antonio Rojas Reviewer(s): Antonio Rojas, François Bissey, Gonzalo Tornaría
sagemathgh-39261: Fix tests with scipy 1.15 Increase numerical tolerance in one test, and replace usage of deprecated `sph_harm` in another one URL: sagemath#39261 Reported by: Antonio Rojas Reviewer(s): Antonio Rojas, François Bissey, Gonzalo Tornaría
sagemathgh-39261: Fix tests with scipy 1.15 Increase numerical tolerance in one test, and replace usage of deprecated `sph_harm` in another one URL: sagemath#39261 Reported by: Antonio Rojas Reviewer(s): Antonio Rojas, François Bissey, Gonzalo Tornaría
sagemathgh-39261: Fix tests with scipy 1.15 Increase numerical tolerance in one test, and replace usage of deprecated `sph_harm` in another one URL: sagemath#39261 Reported by: Antonio Rojas Reviewer(s): Antonio Rojas, François Bissey, Gonzalo Tornaría
sagemathgh-39261: Fix tests with scipy 1.15 Increase numerical tolerance in one test, and replace usage of deprecated `sph_harm` in another one URL: sagemath#39261 Reported by: Antonio Rojas Reviewer(s): Antonio Rojas, François Bissey, Gonzalo Tornaría
sagemathgh-39261: Fix tests with scipy 1.15 Increase numerical tolerance in one test, and replace usage of deprecated `sph_harm` in another one URL: sagemath#39261 Reported by: Antonio Rojas Reviewer(s): Antonio Rojas, François Bissey, Gonzalo Tornaría
Increase numerical tolerance in one test, and replace usage of deprecated
sph_harm
in another one