-
Notifications
You must be signed in to change notification settings - Fork 468
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
np.testing.assert_equal does not work with quantity lists #1272
Comments
There's some helper functions in the testsuite
|
I was also starting to look into this. Any idea what triggered this? |
It looks like numpy fails to recognize the object as array-like, and so doesn't invoke all() appropriately. I see there has been discussion of this for a while (#1128). The error I get is below:
|
Yes, but you mentioned that is working before. That is what surprised me. |
looking at the code of I think for testing it would be good to expose |
Ah! Apologies, not working with pint, but working with regular arrays of dimensionless numbers. |
Ahh, ok. Then as mentioned by @andrewgsavage and @keewis mentions we should expose and document |
following |
True (see https://github.com/numpy/numpy/blob/v1.20.0/numpy/testing/_private/utils.py#L936 ) My recomendation is tha we double check the implementation of |
When creating a list of quantities from a numpy array, numpy's built-in test methods for array comparison no longer work. This is breaking a lot of my test suite now that I am trying to incorporate pint's unit capabilities into my packages. Is there an easy way around this, or am I just going to have to write a wrapper function and swap it out for numpy's?
The text was updated successfully, but these errors were encountered: