-
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
is_compatible_with edge cases #1190
Comments
5 tasks
jules-ch
added a commit
to jules-ch/pint
that referenced
this issue
Oct 15, 2020
Make is_compatible_with function with dimensionless types & string parsing errors. is_compatible_with was not consistent with dimensionless types when switching arguments. String processing was not allowing strings with any magnitude. - Updated registry.py managing dimensionless types & discarding types not managed by pint. - Updated unit.py using parse_expression instead of parse_units.
jules-ch
added a commit
to jules-ch/pint
that referenced
this issue
Oct 16, 2020
Make is_compatible_with function with dimensionless types & string parsing errors. is_compatible_with was not consistent with dimensionless types when switching arguments. String processing was not allowing strings with any magnitude. - Updated registry.py managing dimensionless types & discarding types not managed by pint. - Updated unit.py using parse_expression instead of parse_units.
jules-ch
added a commit
to jules-ch/pint
that referenced
this issue
Oct 16, 2020
Make is_compatible_with function with dimensionless types & string parsing errors. is_compatible_with was not consistent with dimensionless types when switching arguments. String processing was not allowing strings with any magnitude. - Updated registry.py managing dimensionless types & discarding types not managed by pint. - Updated unit.py using parse_expression instead of parse_units.
jules-ch
added a commit
to jules-ch/pint
that referenced
this issue
Oct 16, 2020
Make is_compatible_with function with dimensionless types & string parsing errors. is_compatible_with was not consistent with dimensionless types when switching arguments. String processing was not allowing strings with any magnitude. - Updated registry.py managing dimensionless types & discarding types not managed by pint. - Updated unit.py using parse_expression instead of parse_units.
jules-ch
added a commit
to jules-ch/pint
that referenced
this issue
Oct 28, 2020
…types & string parsing errors. is_compatible_with was not consistent with dimensionless types when switching arguments. String processing was not allowing strings with any magnitude. - Updated registry.py managing dimensionless types & discarding types not managed by pint. - Updated unit.py using parse_expression instead of parse_units.
jules-ch
added a commit
to jules-ch/pint
that referenced
this issue
Oct 28, 2020
…types & string parsing errors. is_compatible_with was not consistent with dimensionless types when switching arguments. String processing was not allowing strings with any magnitude. - Updated registry.py managing dimensionless types & discarding types not managed by pint. - Updated unit.py using parse_expression instead of parse_units.
I think this is fixed, right @jules-ch ? |
I need to rebase #1191 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Following on
is_compatible_with
, I found several edge cases.Working with dimensionless with first argument :
With string as arguments:
For this error, we need to use parse_expression on
Unit.is_compatible_with
&Quantity.is_compatible_with
instead ofparse_units
.I've rewrited the function like so:
Not sure if we should throw an error on types that can't be casted to Quantity or return simply False.
@keewis if you want to chime in
The text was updated successfully, but these errors were encountered: