-
Notifications
You must be signed in to change notification settings - Fork 470
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
more trouble with force_ndarray_like=True
#1327
Comments
this can be fixed by: diff --git a/pint/quantity.py b/pint/quantity.py
index cbe181f..8704971 100644
--- a/pint/quantity.py
+++ b/pint/quantity.py
@@ -1486,7 +1486,7 @@ class Quantity(PrettyIPython, SharedRegistryObject):
raise DimensionalityError(other._units, "dimensionless")
else:
exponent = _to_magnitude(
- other, self.force_ndarray, self.force_ndarray_like
+ other, force_ndarray=False, force_ndarray_like=False
)
units = new_self._units ** exponent not sure if I'm missing something? The test suite at least doesn't fail. |
4 tasks
Good catch. Following my comment #60 (comment), IMO I think we need to constraint exponent type in |
I would support that, but we have to make sure not to break the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apparently,
force_ndarray_like=True
results inq._units
containingnumpy
scalar values, which causes unit conversions to fail:I'm pretty sure this is unrelated to #1301 (although they share a common cause:
numpy.int64(1) ** -2
raises) because this also fails if I go back to the release commit of0.17
.The text was updated successfully, but these errors were encountered: