-
Notifications
You must be signed in to change notification settings - Fork 32
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
Weight threshold part duex #319
Weight threshold part duex #319
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #319 +/- ##
==========================================
+ Coverage 86.39% 86.68% +0.28%
==========================================
Files 49 49
Lines 8902 8937 +35
==========================================
+ Hits 7691 7747 +56
+ Misses 1211 1190 -21 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
…hreshold sigma_clip call" (spacetelescope#315)" This reverts commit 63d5280, reversing changes made to 5299646.
f16d1e9
to
38289f1
Compare
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.
Looks good to me!
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.
Looks good. I re-ran the memory usage profiling that I used for the original PR and it shows that the memory savings are indeed working as intended.
Regtests started for okifying. Once these finish I'll merge then okify: |
This is "take 2" of #312
At the moment this PR will create small numerical differences in the output of
compute_weight_threshold
but I'm convinced that the current behavior on main is incorrect and a by-product of related numpy bugs:A minimal example is:
Produces:
The second line is similar to what's occuring on main where a mean of a masked array of float32 values is producing a float64 that is incorrect (given the precision). The third line is similar to what is produced with this PR.
One added benefit is this PR appears to reduce the memory usage lower than #312 (as seen by the
0.9
vs1.9
multiplier in the memory usage test). I believe this is due to providing a non-masked array to sigma clip to avoid the allocation here:https://github.com/astropy/astropy/blob/3bd8b404bf558561da469128d570280f3b65e57f/astropy/stats/sigma_clipping.py#L400-L401
Further optimizations might require changes to sigma clip (which appears to create an array copy for
_compute_bounds
:Regression tests running:
Romancal: https://github.com/spacetelescope/RegressionTests/actions/runs/11956099949
JWST: https://github.com/spacetelescope/RegressionTests/actions/runs/11956106816
(these are expected to have a few minor differences)
Tasks
docs/
pageno-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)"git+https://github.com/<fork>/stcal@<branch>"
)jwst
regression testromancal
regression testnews fragment change types...
changes/<PR#>.apichange.rst
: change to public APIchanges/<PR#>.bugfix.rst
: fixes an issuechanges/<PR#>.general.rst
: infrastructure or miscellaneous change