-
Notifications
You must be signed in to change notification settings - Fork 475
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
numpy: matrix multiplication by left give wrong results #39
Comments
Thanks again for the report. I am looking for a good solution for this. |
Any news on this ?? I discovered that maybe this affects other operations also, like comparisons. |
I have a working solution for #37 and #39 that involves refactoring everything so that Quantity dervies from several numpy classes. Briefly: class Quantity(np.matrixlib.defmatrix.matrix, np.ma.core.MaskedArray, np.ndarray): I find this extremely ugly, but seems to be the only thing that works. The problem is related to the fact that matrix and masked array take preference in spite of the the array priority. |
It has other implications besides being ugly ?? You could push the fix as a temporary and refactor in the future, maybe create a enhancement issue for that. |
I'm having the same issue doing numpy matrix operations while using Pint... any news on this fix? |
I have just pushed something I was working on to a temporary branch named I would like to emphasize that this is very preliminary work. We still do not know if this is the right approach or even if it is a good approach. Therefore we cannot promise that I will become part of |
Thanks Hernan, I'll check it out Sent from my iPhone
|
Review once that #905 is implemented |
Based on https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.matrix.html, NumPy matrices should no longer be used, instead, regular arrays should be used. So, can this be closed as wontfix due to upstream deprecation? |
Agreed! |
Hi, this is a issue related to #37 , multiplication by left don't work with a numpy matrix, as matrices are not commutative for multiplication. It don't fail, it give wrong results.
https://gist.github.com/canesin/6115159
The text was updated successfully, but these errors were encountered: