Why litre dimensionality is length and not volume? #1975
-
I'm working on setting a feature to check the dimensionality of some units of measure, but I get length as the dimensionality for litre, ml as well. Why is that? Should it be volume? How could I get volume as unit of measure for it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
import pint
ureg = pint.UnitRegistry()
x = 3 * ureg('mL')
x.dimensionality gives |
Beta Was this translation helpful? Give feedback.
-
Have a play with #1967 It needs reviewing and feedback. import pint
ureg = pint.UnitRegistry()
x = 3 * ureg('mL')
x.compatible_kinds()
{'[volume]'}
Could you expand on this? Understanding how you intend to use this could help make test cases. |
Beta Was this translation helpful? Give feedback.
gives
<UnitsContainer({'[length]': 3})>
, which says the dimensionality is length**3, which implies volume?