Skip to content
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

Open
rbreslavsky opened this issue Aug 20, 2024 · 0 comments
Open

Bug in Angle Dimensionality #2047

rbreslavsky opened this issue Aug 20, 2024 · 0 comments

Comments

@rbreslavsky
Copy link

I noticed an issue with regards to angle dimensionality. For one, when working with degrees to some exponent, n, pint does not distinguish degrees ** n from degrees. Furthermore, I can convert to degrees from degrees ** n, but this changes the numbers in a way that is obfuscated.

import pint

ureg = pint.UnitRegistry()

test = 5.0 * ureg('deg')
test_squared = test ** 2

Then I get:

In: test_squared
Out: <Quantity(25.0, 'degree ** 2')>

In: test_squared.is_compatible_with('deg')
Out: True

In: test_squared.to('deg')
Out: <Quantity(0.436332313, 'degree')>

The last output has converted <Quantity(25.0, 'degree')> to a radian equivalent, which was not the intent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant