-
Notifications
You must be signed in to change notification settings - Fork 476
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
Bug in Angle Dimensionality #2047
Comments
Do you have a physical example or use case in mind ? This comes from the opinionated choice to treat angle as dimensionless: Difficult to treat this, I'd say. what would you have expected there ? |
It is just a matter of convention, but conversion for steradian are correct when dealing with degrees squared: >>> test = 180**2/math.pi**2 * ureg('deg')**2
>>> test.to("sr")
<Quantity(1.0, 'steradian')> |
Related #1288 |
Thanks for taking the time to respond. This occurrence actually happened due to a bug in some code where a pint.Quantity of unit degrees was multiplied by ureg('deg') a second time. The problem is that I tried to implement a check to make sure dimensionality was correct (using I think an error of some sort would be useful here (for example, when attempting to convert a non-radian angular dimension of an nth power to a root of itself). Could that be accommodated for angles? I know it's a niche issue, but pint has been fantastic at avoiding this kind of problem elsewhere. |
possibly a warning yes, I had a similar idea here: |
I noticed an issue with regards to angle dimensionality. For one, when working with degrees to some exponent,
n
, pint does not distinguishdegrees ** n
fromdegrees
. Furthermore, I can convert todegrees
fromdegrees ** n
, but this changes the numbers in a way that is obfuscated.Then I get:
The last output has converted
<Quantity(25.0, 'degree')>
to a radian equivalent, which was not the intent.The text was updated successfully, but these errors were encountered: