You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
array-api-strict: subtract_overscan and cosmicray_lacosmic(gain_apply=True) fail on integer data #1034
On array-api-strict, two ccdproc functions fail on integer data (uint16, int32 and so on). array-api-strict refuses the implicit integer → floating promotion that NumPy, dask and JAX do. The cause in both cases is ccdproc's own arithmetic, not a host round trip.
subtract_overscan, with or without model=:
median=False calls xp.mean on the integer overscan: TypeError: Only floating-point dtypes are allowed in mean.
median=True gets a float64 median, then fails at ccd.data - oscan: TypeError: array_api_strict.uint16 and array_api_strict.float64 cannot be type promoted together.
cosmicray_lacosmic with gain_apply=True, on an integer CCDData that has an uncertainty. The uncertainty is scaled with _ccd.multiply(gain_value), which multiplies the integer data by a floating 0-d array as well: TypeError: array_api_strict.uint16 and array_api_strict.float32 cannot be type promoted together (float64 in place of float32 on main before Keep the floating dtype of the input in the host round trips #1032).
Reproducer, run on array-api-strict device1 (the same happens on the default device):
History: found while working on #1023 (PR #1032), and present on main. PR #1032 pins the subtract_overscan mean path and the cosmicray_lacosmic case with non-strict backend_xfail markers; the subtract_overscan median path has no test. #1013 (subtract_dark(scale=True) promoting float32 on NumPy) is a related dtype problem from the same kind of 0-d float64 operand, but it is a different bug. Summary noted on #971.
Activity
Point the strict integer xfails at the new issue astropy#1034