-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
test_simulation.py fails with the latest version of numpy #478
Comments
Actually, it would be nice to compare Quantities with a special util function that would validate the units of its arguments. One version of such a function is implemented in Astropy's module tests/helpers.py: assert_quantity_allclose |
I think the right approach should be to use astropy's assert_quantity_allclose. One would have to test if that solution is compatible with different versions of numpy and astropy. |
But units still should be added to the tests.
|
So we have two options. Strip the result of its unit or add the unit to the Misha [email protected] schrieb am So., 7. Feb. 2016 21:08:
|
Thank you for pointing out numpy's @wkerzendorf @unoebauer What do you think? |
I made PR #479 to use |
Should the issue be closed now? |
Yes - closing it now. |
@yeganer @unoebauer @wkerzendorf
In PR #471 the following (a few of them actually) asset statement was added to test_simulation.py:
It is calculated like this: absolute(
a
-b
) <= (atol
+rtol
* absolute(b
))The problem here is that t_rad is a Quantity while simulation_compare_data['test1/t_rad'] is just a numpy array. And if somehow works with numpy v 1.9.0, with v 1.10 it fails. An error is raised in the
__array_prepare__
method that is overridden in Astropy:The text was updated successfully, but these errors were encountered: