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-3678: Ensure C extension works with multiprocessing #268

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

kmacdonald-stsci
Copy link
Collaborator

@kmacdonald-stsci kmacdonald-stsci commented Jul 2, 2024

Resolves JP-3678

Closes #8618

This PR addresses an error in multiprocessing with the selection of the OLS_C algorithm. The C extension flag was not properly passed to the sliced data when prepared for multiprocessing, so the old python code ran, even the the C extension was selected. The C extension selection is now properly passed to the sliced data, so the C extension will be run when multiprocessing is selected.

Checklist

  • added entry in CHANGES.rst (either in Bug Fixes or Changes to API)
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)

… C extension gets properly set for multiprocessing.
@kmacdonald-stsci kmacdonald-stsci requested a review from a team as a code owner July 2, 2024 17:38
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Project coverage is 83.76%. Comparing base (5772579) to head (8c92688).
Report is 180 commits behind head on main.

Files with missing lines Patch % Lines
src/stcal/ramp_fitting/ols_fit.py 57.14% 3 Missing ⚠️
src/stcal/ramp_fitting/ramp_fit.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #268      +/-   ##
==========================================
- Coverage   83.79%   83.76%   -0.03%     
==========================================
  Files          35       35              
  Lines        6998     7004       +6     
==========================================
+ Hits         5864     5867       +3     
- Misses       1134     1137       +3     

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

@kmacdonald-stsci
Copy link
Collaborator Author

Copy link
Contributor

@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- confirmed based on runtime that it's now using the C algorithm when it's meant to, even with multiprocessing on.

Copy link
Contributor

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

Just a few suggestions for the new log messages. Otherwise, looks good!

src/stcal/ramp_fitting/ols_fit.py Outdated Show resolved Hide resolved
image_info, integ_info, opt_info = ols_slope_fitter(
ramp_data, gain_2d, readnoise_2d, weighting, save_opt)

log.info("Returning from C extension")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
log.info("Returning from C extension")
log.debug("Returning from C extension")

src/stcal/ramp_fitting/ols_fit.py Outdated Show resolved Hide resolved
src/stcal/ramp_fitting/ols_fit.py Outdated Show resolved Hide resolved
Copy link
Contributor

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

Looks good to me now. Thanks!

@melanieclarke
Copy link
Contributor

I forgot to mention - I looked at the regression tests that failed and they are unrelated. These three tests seem to intermittently fail fairly often (test_nirspec_missing_msa_fail, test_nirspec_missing_msa_nofail, and test_duplicate_names).

@nden
Copy link
Collaborator

nden commented Jul 3, 2024

I started another test run - the previous one did not pick up the correct commit and did not test the changes in this PR.
https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1579/

Failures are unrelated.

@nden nden merged commit 8a36bf4 into spacetelescope:main Jul 5, 2024
22 of 25 checks passed
@kmacdonald-stsci kmacdonald-stsci deleted the jp_3678 branch July 8, 2024 13:31
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