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-3121: initial Code to Implement C-Extensions for Ramp Fit #156

Merged
merged 31 commits into from
May 20, 2024

Conversation

kmacdonald-stsci
Copy link
Collaborator

@kmacdonald-stsci kmacdonald-stsci commented Mar 29, 2023

Resolves JP-3121

The C implementation of ramp fitting is complete, with the exception of the special handling for CHARGELOSS processing of read noise.

All CI tests pass in both STCAL and JWST, with minor changes in JWST CI tests. The JWST tests must be written to enforce type for data arrays. I will open a corresponding JWST PR to account for this.

By default ramp fitting still runs the python code. In ols_fit.py, there is a boolean variable that acts as a switch to run the python code or C code. It is use_c here:

If you want to run the C code, set this variable to True.

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)

setup.py Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
src/stcal/ramp_fitting/src/slope_fitter.c Outdated Show resolved Hide resolved
@zacharyburnett
Copy link
Collaborator

zacharyburnett commented Oct 5, 2023

The Linux build is failing, but not the MacOS ones:
image

@kmacdonald-stsci
Copy link
Collaborator Author

The Linux build is failing, but not the MacOS ones: image

I'll take a look. Feel free to do as much review as you like. I've basically been the only one to look at this, so would appreciate any eyes.

@kmacdonald-stsci
Copy link
Collaborator Author

kmacdonald-stsci commented Dec 14, 2023

@nden
Copy link
Collaborator

nden commented Dec 18, 2023

I see build errors in the logs. Is the code building correctly?

Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Attention: Patch coverage is 46.46018% with 121 lines in your changes missing coverage. Please review.

Project coverage is 83.73%. Comparing base (af5aefb) to head (9a44330).
Report is 48 commits behind head on main.

Files Patch % Lines
src/stcal/ramp_fitting/ramp_fit_class.py 7.69% 72 Missing ⚠️
src/stcal/ramp_fitting/ols_fit.py 39.65% 35 Missing ⚠️
tests/test_ramp_fitting.py 86.95% 9 Missing ⚠️
setup.py 0.00% 3 Missing ⚠️
src/stcal/ramp_fitting/ramp_fit.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
- Coverage   85.18%   83.73%   -1.46%     
==========================================
  Files          35       35              
  Lines        6797     6990     +193     
==========================================
+ Hits         5790     5853      +63     
- Misses       1007     1137     +130     

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

@kmacdonald-stsci
Copy link
Collaborator Author

I see build errors in the logs. Is the code building correctly?

I changed the code according to the errors in the log. They didn't cause build problems locally, so didn't know they would cause problems on Jenkins.

I have started a new regression test run and it appears to have built correctly: https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1105/

@hbushouse
Copy link
Collaborator

Is it safe to assume that the CI test "test_downstream / py311-jwst-cov-xdist" errors are due to the fact that the changes in this PR need corresponding changes in jwst in order to run properly?

Copy link
Collaborator

@hbushouse hbushouse left a comment

Choose a reason for hiding this comment

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

Need to verify whether all issues related to print statements have been resolved. Also, I would suggest leaving the timing calculation in place, at least for now, but turn the reporting of times into debug level log messages, so that we can gather timing info while testing.

Comment on lines 699 to 700
# XXX start python time
p_start = time.time()

This comment was marked as resolved.

def endianness_handler(ramp_data, gain_2d, readnoise_2d):
"""
Check all arrays for endianness against the system endianness, so when used by the C
extension, the endianness is correct.

This comment was marked as resolved.

@kmacdonald-stsci
Copy link
Collaborator Author

Is it safe to assume that the CI test "test_downstream / py311-jwst-cov-xdist" errors are due to the fact that the changes in this PR need corresponding changes in jwst in order to run properly?

Yes. I have a JP-3121 for JWST, as well. I have a PR open for JWST for this: spacetelescope/jwst#8355

I will rebase and make sure everything for that JWST PR is good to go.

@hbushouse hbushouse merged commit 3cc52f1 into spacetelescope:main May 20, 2024
22 of 25 checks passed
@nden
Copy link
Collaborator

nden commented May 20, 2024

🎉 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants