-
Notifications
You must be signed in to change notification settings - Fork 48
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: Power override for zero power #204
Conversation
With this PR if you take a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment the Unit object happily goes to the zeroth power (I've added a test for this, though). The unit calculation internally is completely fine (and always has been); sympy handles the 0th power gracefully.
The base issue here is that we have the _ones_like ufunc mapped to _preserve_units (which makes sense,
Line 512 in e86c050
_ones_like: _preserve_units, |
I've moved around the comments as requested.
Thanks for clearing up where the issue was and updating the tests and comments! |
Implements a fix to #203.
Comments welcome as this could be seen as quite a dirty fix, as we're taking away ufunc dispatch from numpy.