parse_pattern doesn´t parse compound units
When using parse_pattern with compound units in the pattern (e.g. 'meter per second'), it won´t parse.
Example:
>>> input = '44 mpsec'
>>> pattern = '{meter per second} mpsec´ //Tried also 'meter / second' but didn´t work either.
>>> ureg.parse_pattern(input_string=input, pattern=pattern)
>>> [] //Would expect <Quantity(44, 'meter / second')> here
With a single unit in the pattern (like 'meter') it does work fine
Hello, this is because you are missing the underscore characters associated with the unit definition
It works with:
>>> input = '44 mpsec'
>>> pattern = '{meter_per_second} mpsec'
>>> ureg.parse_pattern(input_string=input, pattern=pattern)
[44.0 <Unit('meter_per_second')>]
Greetings
perhaps we should add some regex to parse_pattern so it replaces " per " with " / "?
@yerkoescalona Ok, that was not very obvious (i was already looking for the unit definitions in the code, but i couldn´t find them, maybe we could put a description of all unit definitions somewhere in the documentation?)
At the top of the tutorial
https://pint.readthedocs.io/en/stable/getting/tutorial.html
If no parameters are given to the constructor, the UnitRegistry is populated with the default list of units and prefixes.
Can we consider this issue closed or do we need better docs ?