Skip to content
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 failing unit test in Python 3.13 #288

Merged
merged 7 commits into from
Jan 31, 2025

Conversation

mcara
Copy link
Member

@mcara mcara commented Jan 30, 2025

Fixes #285

CC: @braingram

@mcara mcara added the bug label Jan 30, 2025
@mcara mcara self-assigned this Jan 30, 2025
@mcara mcara requested a review from a team as a code owner January 30, 2025 02:35
@braingram
Copy link
Contributor

I cherry picked e1d446d onto #287 so the wheel building would be attempted (which runs the unit tests) with python 3.13 and the change in this PR. Unfortunately the unit test failed in the same way as reported in the issue:
https://github.com/spacetelescope/spherical_geometry/actions/runs/13044906258/job/36393793180?pr=287

Also, I think the CI disabled itself due to inactivity in this repo. I don't have permissions to re-enable it. Do you?
https://github.com/spacetelescope/spherical_geometry/actions/workflows/spherical_geometry.yml

@mcara
Copy link
Member Author

mcara commented Jan 30, 2025

@mcara
Copy link
Member Author

mcara commented Jan 30, 2025

Unfortunately I started regression tests before reading your comment. In my local testing at some moment I switched to numpy 1.26.3 and it made no difference (test was still failing). After this fix all tests were passing. I forgot to test with numpy 2.2.0. I will investigate.

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.25%. Comparing base (0f5f0a3) to head (c46e72b).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #288   +/-   ##
=======================================
  Coverage   80.25%   80.25%           
=======================================
  Files           5        5           
  Lines        1013     1013           
=======================================
  Hits          813      813           
  Misses        200      200           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mcara mcara requested a review from perrygreenfield January 30, 2025 06:12
@mcara
Copy link
Member Author

mcara commented Jan 30, 2025

@braingram Try again. I think it should work now but I can't get regression test run past sonar scan.

@braingram
Copy link
Contributor

@braingram Try again. I think it should work now but I can't get regression test run past sonar scan.

Oof, sonar scan is blocked by spacetelescope/jwst#9112 You can use the branch for that PR if you're impatient like me :)


v = great_circle_arc.length(a, b)

assert np.all(np.logical_not(np.isfinite(v)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To check I'm understanding. Previously providing np.nan to length resulted in ValueError: Out of domain for acos and with this PR it doesn't raise an exception and instead returns np.nan?

Where is length used and will this change in behavior have consequences?

@pllim pllim added the Build wheels Build wheels on PR label Jan 30, 2025
@mcara
Copy link
Member Author

mcara commented Jan 30, 2025

Another attempt to run regression tests: https://github.com/spacetelescope/RegressionTests/actions/runs/13061746792

Copy link
Contributor

@braingram braingram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and testing locally this fixes the python 3.13 failure.

To be safe let's wait till the regtests pass then I'll update the 3.13 PR.

Thanks for finding the fix!

@mcara
Copy link
Member Author

mcara commented Jan 31, 2025

Regressiuon tests have numerous failures but they do not appear to be related to this PR but rather to pmap context change and other changes (most non-pmap failing tests are related to MIRI MRS). I tried running another test with jwst_1323.pmap but now tests appear to error instead of failing. If this PR were to affect JWST pipeline, I would expect to see failures in all imaging modes (and not only for MIRI MRS) which I do not see in the regression tests. In fact, I think the failures are similar to failures in other un-related regression tests, e.g., https://github.com/spacetelescope/RegressionTests/actions/runs/13061224788

So, ... merging this

@mcara mcara merged commit ffc607c into spacetelescope:master Jan 31, 2025
25 checks passed
@mcara mcara mentioned this pull request Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Build wheels Build wheels on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_math_util_length_domain fails on CPython 3.13
3 participants