-
Notifications
You must be signed in to change notification settings - Fork 25
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-3664: Numpy 2.0 exposed implicit type promotion #319
JP-3664: Numpy 2.0 exposed implicit type promotion #319
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #319 +/- ##
=======================================
Coverage 66.18% 66.18%
=======================================
Files 100 100
Lines 5397 5397
=======================================
Hits 3572 3572
Misses 1825 1825 ☔ 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.
Thanks! The changes look good to me (although a regtest run to be safe seems worthwhile).
I tested saving an irs2 model (with uint8 for OUTPUT and ODD_EVEN) and loading with the new schema. The data is safely cast to uint16 on load (in numpy <2 and 2.1).
I also suggest we leave spacetelescope/jwst#8580 open as this PR doesn't fully address all the numpy 2.0 issues with jwst. |
Agreed on keeping the issue open, and I'll get a regtest run soon. I have an stcal PR out as well, and I suppose I'll need a JWST PR to get the numpy upper limit out of the way. |
Started a regression test run here: EDIT: make that https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1674/ |
71befb9
to
e3b53d6
Compare
Last set of regtests were failing due to a day of Jenkins issues. Started a new set against jwst/master to check for compatibility issues with numpy<2: https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1691/ |
e3b53d6
to
55ce7e8
Compare
Partially addresses JP-3664
Closes jwst/#8578
Partially addresses jwst/#8580
This PR addresses a bug exposed by testing numpy 2.0 - the irs2 datamodel specifies arrays to be of type uint8, but operations in refpix promoted them to uint16 implicitly in numpy<2.0. Numpy 2.0 does not implicitly type promote in this case, leading to an integer overflow. This PR updates the specified array datatype to uint16.
Checklist
CHANGES.rst
(either inBug Fixes
orChanges to API
)