Skip to content

Conversation

@stscirij
Copy link
Contributor

@stscirij stscirij commented Apr 28, 2025

Addresses JP-3986

This PR adds some unit tests to the persistence step

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

@stscirij stscirij requested a review from a team as a code owner April 28, 2025 22:54
@stscirij stscirij requested a review from a team as a code owner April 28, 2025 23:49
@codecov
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.92%. Comparing base (eb19846) to head (d3a7047).
⚠️ Report is 686 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9419      +/-   ##
==========================================
+ Coverage   77.39%   77.92%   +0.53%     
==========================================
  Files         362      362              
  Lines       36220    36279      +59     
==========================================
+ Hits        28031    28269     +238     
+ Misses       8189     8010     -179     

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

@stscirij
Copy link
Contributor Author

@emolter emolter added this to the Build 12.0 milestone May 1, 2025
emolter
emolter previously requested changes May 1, 2025
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 codecov report for this PR shows the unit test coverage for persistence.py increasing from 7% to 27%. This is good progress, but 27% is still very low compared to other modules - the repository average is somewhere around 75%.

There are still a large number of methods that don't have any coverage: compute_decay, delta_fcn_capture, predict_saturation_capture, predict_ramp_capture, predict_capture, get_decay_param, get_capture_param, compute_slope, get_parameters, do_all. See https://app.codecov.io/gh/spacetelescope/jwst/pull/9419/blob/jwst/persistence/persistence.py.

@melanieclarke
Copy link
Collaborator

The codecov report for this PR shows the unit test coverage for persistence.py increasing from 7% to 27%. This is good progress, but 27% is still very low compared to other modules - the repository average is somewhere around 75%.

I think it would probably help a lot to get at least one unit test that runs the whole step on synthetic input. That should exercise the most code with the least effort.

@stscirij stscirij force-pushed the jp-3986_add_persistence_tests branch from d3b6224 to 877c5e2 Compare May 1, 2025 14:08
@emolter
Copy link
Collaborator

emolter commented May 1, 2025

The new test brings persistence.py up to 80%: https://app.codecov.io/gh/spacetelescope/jwst/pull/9419/blob/jwst/persistence/persistence.py

It may be worth checking whether some options could be toggled on and off with a test parametrization as some additional low-hanging fruit. But I certainly won't be the one to hold up this PR since this is now above the repository average.

Not sure how to dismiss my own review... do I need maintainers privileges?

@melanieclarke melanieclarke dismissed emolter’s stale review May 5, 2025 13:11

Comments addressed

Copy link
Collaborator

@melanieclarke melanieclarke left a comment

Choose a reason for hiding this comment

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

This is a huge improvement in test coverage - between the unit tests and the new regtest, this module will be covered at 84%. Thanks for addressing this technical debt!

It looks like there are a couple minor comments still to address - a question from Pey Lian about the testing precision, and a request to remove the change log - but I think this is is looking good.

@stscirij stscirij force-pushed the jp-3986_add_persistence_tests branch from f63e1a6 to 6cc8373 Compare May 5, 2025 16:32
Copy link
Collaborator

@melanieclarke melanieclarke left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@melanieclarke melanieclarke enabled auto-merge May 5, 2025 17:28
@melanieclarke melanieclarke merged commit 4b9766a into spacetelescope:main May 5, 2025
19 checks passed
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.

4 participants