-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parse_pattern doesn´t parse compound units #2003
Comments
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 |
@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
|
When using
parse_pattern
with compound units in the pattern (e.g. 'meter per second'), it won´t parse.Example:
With a single unit in the pattern (like 'meter') it does work fine
The text was updated successfully, but these errors were encountered: