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
# TODO: Fix this when astropy supports array namespaces
CuPy issues in test_combiner #911 failures of the form TypeError: unsupported operand type(s) for <<: 'ndarray' and 'IrreducibleUnit' in scaling-related combiner tests — a CuPy array being shifted into a Quantity.
The related TODO about CCDData arithmetic being numpy-based:
# TODO: Workaround for the fact that CCDData currently uses numpy
Task
Define one strategy for units with non-numpy data — the current wrapper approach (_CCDDataWrapperForArrayAPI keeps units beside the data rather than wrapping it) seems right, but it needs to cover the combiner scaling paths too. Audit every place a Quantity is constructed from image data and route it through the same mechanism. Track astropy's own array-API plans for units in #940.
Found during a review of the array API implementation from #885; follow-up to #909 / #911.
Problem
astropy.units.Quantityis numpy-backed, so any path that attaches units to image data pulls the data out of the user's array library.Evidence:
The workaround in
flat_correct, which strips and re-applies units manually to avoid Quantity:ccdproc/ccdproc/core.py
Line 991 in 9d25eee
CuPy issues in
test_combiner#911 failures of the formTypeError: unsupported operand type(s) for <<: 'ndarray' and 'IrreducibleUnit'in scaling-related combiner tests — a CuPy array being shifted into a Quantity.The related TODO about
CCDDataarithmetic being numpy-based:ccdproc/ccdproc/core.py
Line 1016 in 9d25eee
Task
Define one strategy for units with non-numpy data — the current wrapper approach (
_CCDDataWrapperForArrayAPIkeeps units beside the data rather than wrapping it) seems right, but it needs to cover the combiner scaling paths too. Audit every place aQuantityis constructed from image data and route it through the same mechanism. Track astropy's own array-API plans for units in #940.Found during a review of the array API implementation from #885; follow-up to #909 / #911.