8000 Fix tests with scipy 1.15 by antonio-rojas · Pull Request #39261 · sagemath/sage · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 1 commit into from
Jan 18, 2025
Merged

Fix tests with scipy 1.15 #39261

merged 1 commit into from
Jan 18, 2025

Conversation

antonio-rojas
Copy link
Contributor

Increase numerical tolerance in one test, and replace usage of deprecated sph_harm in another one

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
Copy link
Member

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

?

Copy link
Contributor Author

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)

Copy link
Member

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.

Copy link
Contributor

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...

Copy link
github-actions bot commented Jan 4, 2025

Documentation preview for this PR (built with commit de24001; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 5, 2025
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
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 7, 2025
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
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 9, 2025
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
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 10, 2025
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
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 12, 2025
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
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 16, 2025
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
@vbraun vbraun merged commit 545f5bf into sagemath:develop Jan 18, 2025
23 of 26 checks passed
@antonio-rojas antonio-rojas deleted the scipy-1.15 branch January 18, 2025 11:41
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.

4 participants
0