-
Notifications
You must be signed in to change notification settings - Fork 468
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
TypeError when calling to_base_units()
for temperature.
#1950
Comments
biagiodistefano
added a commit
to biagiodistefano/pint
that referenced
this issue
Mar 9, 2024
biagiodistefano
added a commit
to biagiodistefano/pint
that referenced
this issue
Mar 9, 2024
5 tasks
you need to use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Causes:
Same with
"°F"
.Ideas
In ScaleConverter,
scale: float
, but the methodto_reference()
acceptsvalue: Magnitude
, andMagnitude = Union[Scalar, Array]
,Scalar: TypeAlias = Union[float, int, Decimal, Fraction]
.My suggestion would be: instead of using self.offset for the operations in the methods, use a typecasted version of it that matches
value
's type.If you find this okay, I will make a PR as soon as I have time.
For now the workaround is to just pass float instead of decimal when working with temperature units.
EDIT:
scale-> offsetThe text was updated successfully, but these errors were encountered: