Why litre dimensionality is length and not volume? #1975
Answered
by
dopplershift
lipemorais
asked this question in
Q&A
-
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.
Answered by
dopplershift
Apr 29, 2024
Replies: 2 comments 1 reply
-
import pint
ureg = pint.UnitRegistry()
x = 3 * ureg('mL')
x.dimensionality gives |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lipemorais
-
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gives
<UnitsContainer({'[length]': 3})>
, which says the dimensionality is length**3, which implies volume?