-
Notifications
You must be signed in to change notification settings - Fork 478
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
deg2rad unexpected behavior #650
Comments
We have not discussed this as using deg2red and similar is unnecessary with Pint. I open to suggestions in terms on expected behaviour and implementantion. |
For expected behavior, I would think that
I think this last one is correct because degrees are dimensionless, so if the argument for this function is dimensionless, we should assume it's degrees (that is, we should assume the caller got it right because we don't have ground to think they're wrong). For implementation, it looks like you already have a special case for radians:
Maybe there should also be a special case for degrees? |
Revisit after #905 |
This issue was left unchanged by #905, but it has been made easier to fix. With that in mind, is @AllenDowney's proposed expected behavior what Pint should go with? |
The wrapped version of
np.deg2rad
does not do what I expect if the argument is a dimensionless Quantity.Expected: I think a dimensionless argument should be assumed to be in degrees, since that's the normal behavior of this function given a simple number (not a Pint Quantity).
Actual: It treats the argument as if it is in radians:
Example:
The result is 45 radians, not 0.78 radians, as I expected.
Is the current behavior as intended?
The text was updated successfully, but these errors were encountered: