-
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
Using np.linalg.inv with unyt_array has no effect on units #69
Comments
So I doubt there's anything we can do about making We could also define a wrapper around |
Every function that accepts arrays or array-like objects in NumPy's public APIs will support NEP 18. That includes |
That's good news. I suppose we just have to wait until the numpy release that implements |
Description
Using the
numpy.linalg.inv()
to calculate the inverse of a matrix, doesn't affect units.What I Did
Here is what happens when you take the inverse of an
unyt_array
:numpy
correctly carries out the inverting operation, but the units remain the same where they should now be the reciprocal of the original units ('inch**2/lbf'
in this case). As of now, the only work around I can think of is to create a newunyt_array
with the inverted value of the original one and the reciprocal of the original's units.The text was updated successfully, but these errors were encountered: