Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@melanieclarke
Copy link
Collaborator

@melanieclarke melanieclarke commented Jun 26, 2025

Resolves JP-4050

Fix for a crash encountered in cube_build with new-style slice-map-based WCS for NIRSpec IFU.

The issue is that cube_build is looking for a single number, the distance between two slices in slicer coordinates, but it is calculating the value from all valid x and y within the range of two slice bounding boxes + a margin. For G235H, the bounding boxes for the slices checked overlap a little, so there is not a single value returned, but several, corresponding to the unique slice values for multiple slices. Since the code expects only a single value, it crashes.

The fix is to check the slicer value at the center of the slice instead of all pixels in range, which should return a single valid value every time.

Tasks

  • If you have a specific reviewer in mind, tag them.
  • add a build milestone, i.e. Build 12.0 (use the latest build if not sure)
  • Does this PR change user-facing code / API? (if not, label with no-changelog-entry-needed)
    • write news fragment(s) in changes/: echo "changed something" > changes/<PR#>.<changetype>.rst (see changelog readme for instructions)
    • update or add relevant tests
    • update relevant docstrings and / or docs/ page
    • start a regression test and include a link to the running job (click here for instructions)
      • Do truth files need to be updated ("okified")?
        • after the reviewer has approved these changes, run okify_regtests to update the truth files
  • if a JIRA ticket exists, make sure it is resolved properly

@melanieclarke melanieclarke added this to the Build 12.0 milestone Jun 26, 2025
@melanieclarke melanieclarke requested a review from jemorrison June 26, 2025 19:34
@melanieclarke
Copy link
Collaborator Author

@melanieclarke melanieclarke requested a review from drlaw1558 June 26, 2025 19:39
@codecov
Copy link

codecov bot commented Jun 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.48%. Comparing base (c9ff47f) to head (e870874).
⚠️ Report is 430 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9606      +/-   ##
==========================================
- Coverage   80.46%   79.48%   -0.99%     
==========================================
  Files         368      368              
  Lines       37281    37225      -56     
==========================================
- Hits        29997    29587     -410     
- Misses       7284     7638     +354     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@drlaw1558 drlaw1558 left a comment

Choose a reason for hiding this comment

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

LG2M, and confirmed that this fixes the issue locally for me.

@tapastro
Copy link
Contributor

Is this a rare issue with NIRSpec IFU data, or should it have been seen in our tests? We should consider assessing test coverage in 12.1.

@tapastro tapastro marked this pull request as ready for review June 27, 2025 13:17
@tapastro tapastro requested review from a team as code owners June 27, 2025 13:17
@tapastro tapastro merged commit 7b9b00d into spacetelescope:main Jun 27, 2025
28 of 29 checks passed
@melanieclarke
Copy link
Collaborator Author

Is this a rare issue with NIRSpec IFU data, or should it have been seen in our tests? We should consider assessing test coverage in 12.1.

I think it was grating dependent, and we did not happen to test the WCS change on this grating, either in our regression tests or in the local tests Chris and I independently ran. I'm not sure it would be helpful to have regression tests for all possible grating combinations, but I should have considered testing the change on a wider range of gratings myself, during development.

@tapastro
Copy link
Contributor

@meeseeksdev backport to release/1.19.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants