You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frompintimportUnitRegistryureg=UnitRegistry()
@ureg.wraps("=A/B", ("=A", "=B"))deff(x, y):
returnx/yprint(f(np.array([1.]) *ureg.angstrom, np.array([2.]) *ureg.second)) # This one worksprint(f(np.array([1]) *ureg.angstrom, np.array([2]) *ureg.second)) # This one raises an error
Here's the error message: ValueError: Integers to negative integer powers are not allowed. It's not impossible to understand what it means, but since numpy automatically converts it to a float, I think pint should also support it.
I'm using version 0.24.4
The text was updated successfully, but these errors were encountered:
It looks like an edge case, but I guess it's an error coming from
pint
, so I raise it here.What obviously works
Output:
[0.5]
What raises an error
Here's the error message:
ValueError: Integers to negative integer powers are not allowed.
It's not impossible to understand what it means, but sincenumpy
automatically converts it to a float, I thinkpint
should also support it.I'm using version 0.24.4
The text was updated successfully, but these errors were encountered: