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

JP-3697: Jump Step Refactor #330

Closed

Conversation

kmacdonald-stsci
Copy link
Collaborator

Resolves JP-3697

Closes #

This PR refactors STCAL focusing on readability, memory consumption, and limiting scope of variables. This refactor reduced jump step memory reduction. The resident size of memory is reduced by more than 2GB, with the memory consumption spike due to numpy.nanmedian completely eliminated, and the heap size reduced by 1GB.

The interface has been simplified with classes. Large functions have been logically broken into smaller functions for readability and scope limiting. Code duplications have been eliminated. Dead code and duplicated variable definitions have been eliminated.

The twopoint_difference.py still needs to be refactored.

All CI tests pass.

All CI tests in the corresponding JWST PR pass, as do all '-k jump' regression tests.

Tasks

  • update or add relevant tests
  • update relevant docstrings and / or docs/ page
  • Does this PR change any API used downstream? (if not, label with no-changelog-entry-needed)
    • write news fragment(s) in changes/: echo "changed something" > changes/<PR#>.<changetype>.rst (see below for change types)
    • run regression tests with this branch installed ("git+https://github.com/<fork>/stcal@<branch>")
news fragment change types...
  • changes/<PR#>.apichange.rst: change to public API
  • changes/<PR#>.bugfix.rst: fixes an issue
  • changes/<PR#>.general.rst: infrastructure or miscellaneous change

…de management easier.

Adding initial creation of JumpData class.

Adding default values to class instantiation.

Updating tests to work with the new interface.

Updating all tests.  Still need to clean up code and add docstrings.

Removing unneeded paramter.

Removing unneeded parameters.

Refactoring code to use the JumpData class.

Adding parameters to JumpData.

Updating jump CI tests to match the refactoring using the JumpData.

Updating find_faint_extended function to use the RampData class.

Updating jump tests to conform with refactor.

Removing unneeded comments.

Refactored the multiprocessing and two point difference.

Regactored the multiprocessing.

Refactored out dqflags parameter and the multiprocessing function.

Updating the TwoPointParams class to remove the dqflags parameter.

Refactoring median calculations of first differences.

Expanding comments and identifying areas for refactor.

Refactoring find_faint_extended.

Refactoring find_faing_extended.

Refactoring find_crs.

Adding print information for a JumpData instance.

Prepping for rebase.
…the jump step parameters because it is not used.
Copy link

codecov bot commented Dec 31, 2024

Codecov Report

Attention: Patch coverage is 76.25133% with 223 lines in your changes missing coverage. Please review.

Project coverage is 84.54%. Comparing base (35726e9) to head (32dafd1).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/stcal/jump/jump_class.py 39.18% 135 Missing ⚠️
src/stcal/jump/twopoint_difference.py 84.72% 33 Missing ⚠️
tests/test_jump.py 88.27% 32 Missing ⚠️
src/stcal/jump/jump.py 89.91% 23 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #330       +/-   ##
===========================================
+ Coverage   29.57%   84.54%   +54.96%     
===========================================
  Files          36       49       +13     
  Lines        7949     9321     +1372     
===========================================
+ Hits         2351     7880     +5529     
+ Misses       5598     1441     -4157     

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

@kmacdonald-stsci
Copy link
Collaborator Author

I need to update test_twopoint_difference.py. I'll change it's name to test_jump_twopoint_difference.py, so no future developer updating the jump step will miss these tests.

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.

1 participant