Preserve ndarray
-like magnitudes or reject them from the start
#479
Labels
numpy
Numpy related bug/enhancement
ndarray
-like magnitudes or reject them from the start
#479
I am trying to use a
xarray.DataArray
magnitude with apint
quantity. It appears to work, but doesn't really, becauseQuantity.__getattr__
forces it to convert tonumpy.ndarray
. This leads to conversion at very unexpected behaviour:I think pint should either accept magnitudes that behave like
numpy.ndarray
but don't subclass it (such asxarray.DataArray
), or reject them when the object is constructed. I don't see how converting it in the middle of attribute lookup can do any good…The text was updated successfully, but these errors were encountered: