-
Notifications
You must be signed in to change notification settings - Fork 31
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
Issue-168: Updating Usage of 'np.where' Function #169
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #169 +/- ##
==========================================
+ Coverage 74.78% 75.10% +0.31%
==========================================
Files 29 29
Lines 5700 5664 -36
==========================================
- Hits 4263 4254 -9
+ Misses 1437 1410 -27
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
I took a brief look at other uses last week but never finished updating the branch to a point where I could open a PR:
https://github.com/braingram/stcal/tree/no_where
I see some uses in this PR that I missed in my branch and also some other uses in my branch which are not in this PR.
The changes included in this PR appear to address the bulk of the uses of np.where
. Thanks!
Was the test added to increase coverage? I'm not familiar enough with ramp fitting to review the test.
Also, a bit off-topic but while looking at the contribution of these lines of code to the runtime of ramp fitting. I noticed that roughly 40% of a test call to ols_ramp_fit_single
was spent on these two lines of code:
https://github.com/spacetelescope/stcal/blob/main/src/stcal/ramp_fitting/ols_fit.py#L1657-L1658
which appears to be iterating through all pixels. I opened a separate issue #170 for that to discuss if this can be converted to a vector operation or in another way optimized. I wanted to bring it up here in case there is an easy fix.
The added test was to increase code coverage and add a case that needs testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code updates look good to me. Needs a regression test run and resolution of conflicts.
Has anyone done a test a against Roman?
Updating the change log. Correcting style check failures. Updating the change log with the correct PR number.
557ef77
to
66b10ff
Compare
@PaulHuwe can you (or your designee) run a Roman regtest against this PR branch? |
I think I set this up correctly to run the Roman devdeps regtest with the source branch for this PR: |
There were a number of failures, with only 1 in the ramp_fitting step itself. It appears to be an unrelated error that is common to all the failures. Should we call this a success? |
I would call this a success but @PaulHuwe might know more about the existing failures which all appear to be unit related. The previous devdeps run (started by timer with no overrides) had 19 failures: The run that used the source branch for this PR had 15 failures. All of these appear to match failures from the previous run: |
Not that is matters, as this was already merged, but the RomanCAL test repo files are presently being updated, as the latest release required remaking of files. |
Closes #168
This PR addresses the usage of
np.where
and removes it where possible for performance reasons in the ramp fitting step.Checklist
CHANGES.rst
(either inBug Fixes
orChanges to API
)