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
Traceback (most recent call last):
File "/home/doron/repos/lab-ion-trap-simulations/./t.py", line 17, in <module>
ureg.kilogram / da
~~~~~~~~~~~~~~^~~~
File "/nix/store/bb54xf04qx1j3hskjcyjwzhbnkhi666m-python3-3.12.8-env/lib/python3.12/site-packages/pint/facets/plain/unit.py", line 167, in __truediv__
return self._REGISTRY.Quantity(1 / other, self._units)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/bb54xf04qx1j3hskjcyjwzhbnkhi666m-python3-3.12.8-env/lib/python3.12/site-packages/pint/facets/plain/quantity.py", line 190, in __new__
raise TypeError(f"PlainQuantity cannot wrap upcast type {type(value)}")
TypeError: PlainQuantity cannot wrap upcast type <class 'xarray.core.dataarray.DataArray'>
Whereas:
da**-1*ureg.kilogramureg.kilogram*1/da1*ureg.kilogram/daureg.kilogram*da# Different meaning of course
Don't fail. This issue was originally posted at xarray-contrib/pint-xarray#289 but I got convinced that the fix for it should be done here and not there, as pint explicitly puts xarray.DataArray (and probably xarray.Dataset as well) in the "upcast types" list.
The text was updated successfully, but these errors were encountered:
So taking first steps with pint-xarray, I tried to do this:
And was surprised to find out it fails with:
Whereas:
Don't fail. This issue was originally posted at xarray-contrib/pint-xarray#289 but I got convinced that the fix for it should be done here and not there, as
pint
explicitly putsxarray.DataArray
(and probablyxarray.Dataset
as well) in the "upcast types" list.The text was updated successfully, but these errors were encountered: