spacetelescope / stdatamodels

https://stdatamodels.readthedocs.io
Other
5 stars 25 forks source link

JP-3664: Numpy 2.0 exposed implicit type promotion #319

Closed tapastro closed 2 months ago

tapastro commented 3 months ago

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

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 66.18%. Comparing base (84279cf) to head (55ce7e8). Report is 5 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #319 +/- ## ======================================= Coverage 66.18% 66.18% ======================================= Files 100 100 Lines 5397 5397 ======================================= Hits 3572 3572 Misses 1825 1825 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

braingram commented 3 months ago

I also suggest we leave https://github.com/spacetelescope/jwst/issues/8580 open as this PR doesn't fully address all the numpy 2.0 issues with jwst.

tapastro commented 3 months ago

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.

tapastro commented 3 months ago

Started a regression test run here:

EDIT: make that https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1674/

tapastro commented 2 months ago

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/