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
Calling to_compact on a celsius magnitude of absolute value smaller than
1 doesn't work properly.
For example, the following throws a pint.errors.DimensionalityError
exception:
from pint import Quantity
Quantity(0.1, "degree_Celsius").to_compact()
However, if right afterwards you re-run the to_compact line again, then
it does not throw exception, but instead returns
<Quantity(273250.0, 'millidegree_Celsius')>,
which is numerically incorrect (that's milliKelvin?).
So calling to_compact for 0.1 degrees celsius either raises exception
(the first time), or returns an incorrect answer (the second time). It
would seem this bug doesn't happen if the magnitude is ≥1 in absolute
value, e.g. 1 and -2.5 and 5.8 are all ok, but 0.1 and 0.999
fail.
using Pint 0.23 installed from pip on Linux.
The text was updated successfully, but these errors were encountered:
Calling
to_compact
on a celsius magnitude of absolute value smaller than1 doesn't work properly.
For example, the following throws a pint.errors.DimensionalityError
exception:
However, if right afterwards you re-run the
to_compact
line again, thenit does not throw exception, but instead returns
which is numerically incorrect (that's milliKelvin?).
So calling
to_compact
for 0.1 degrees celsius either raises exception(the first time), or returns an incorrect answer (the second time). It
would seem this bug doesn't happen if the magnitude is ≥1 in absolute
value, e.g.
1
and-2.5
and5.8
are all ok, but0.1
and0.999
fail.
using Pint 0.23 installed from pip on Linux.
The text was updated successfully, but these errors were encountered: