Skip to content

Conversation

@melanieclarke
Copy link
Collaborator

@melanieclarke melanieclarke commented Sep 17, 2025

Resolves JP-4122

Fix a crash in the master background step for NIRSpec MOS data. When the input background spectra contain no valid flux values, the step issues a warning message. The warning was introduced in #9625 to address some failures in WFSS mode, so was tested with WFSS data. The crash comes from an attempt to log the group_id for the spectrum, which is an attribute that exists for WFSS spectra but not for MOS spectra.

The fix here is to modify the log message to record group_id only if it's present in the datamodel. I added a unit test for this edge case with non-WFSS data.

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
Copy link
Collaborator Author

melanieclarke commented Sep 17, 2025

Regression tests:
https://github.com/spacetelescope/RegressionTests/actions/runs/17806941595

Failures are all unrelated. I'll run again when tests on main are clear.

@codecov
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.41%. Comparing base (f1db9d7) to head (6cce887).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9848      +/-   ##
==========================================
+ Coverage   84.15%   85.41%   +1.25%     
==========================================
  Files         366      366              
  Lines       37800    37812      +12     
==========================================
+ Hits        31812    32297     +485     
+ Misses       5988     5515     -473     

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

@melanieclarke melanieclarke marked this pull request as ready for review September 17, 2025 20:23
@melanieclarke melanieclarke requested review from a team as code owners September 17, 2025 20:23
Copy link
Collaborator

@emolter emolter left a comment

Choose a reason for hiding this comment

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

The fix looks fine to me, pending clean regtests. I assume you checked the original data that caused the failure?

@melanieclarke
Copy link
Collaborator Author

The fix looks fine to me, pending clean regtests. I assume you checked the original data that caused the failure?

Yes -- the test data is jw03788-o007_20250917t012349_spec2_00004_asn.json. With this change, the master_background_mos step warns for three background spectra with no valid flux values but continues processing with the remaining 14 valid spectra.

@melanieclarke melanieclarke enabled auto-merge (squash) September 19, 2025 18:22
@melanieclarke melanieclarke merged commit 6e205e1 into spacetelescope:main Sep 19, 2025
24 checks passed
@melanieclarke melanieclarke deleted the jp-4122 branch September 19, 2025 18:57
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