Skip to content
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

Failed galpy tests #308

Closed
swfu opened this issue Jul 13, 2017 · 3 comments
Closed

Failed galpy tests #308

swfu opened this issue Jul 13, 2017 · 3 comments

Comments

@swfu
Copy link

swfu commented Jul 13, 2017

When I run pytest -v tests/ in the galpy-master file, I get the following output:

https://pastebin.com/MC6HNWSB

I don't have nemo installed, so it's not surprising that nemo-specific tests failed; but there are also other functions that don't pass... For reference, I am running Python 2.7, Numpy 1.21.1, Scipy 0.19.0, and Astropy 2.0.

jobovy added a commit that referenced this issue Jul 13, 2017
…sun (different in different astropy versions; see #308)
jobovy added a commit that referenced this issue Jul 13, 2017
…of the 0.025% change in Msun in astropyv2 (see #308)
@jobovy
Copy link
Owner

jobovy commented Jul 13, 2017

Thanks for the output. There are a few things going wrong here:

  • Many of the tests fail because of how warnings are run through the astropy module. I remember struggling with the same issue a while ago, but I don't remember how I got rid of it (I don't get this on my computer, and the travis builds also work fine). However, it seems likely related to how I've implemented the warnings. I've pushed a possible fix to the branch fixwarnings. Please download this new branch and see whether that fixes this issue (I can't test this, because I can't recreate the issue).

  • Two of the tests fails because the value of 1 solar mass has changed in astropy v2 by about 0.025% (and the test (tests/test_potential.py::test_NFW_virialquantities_diffrovo and tests/test_galpypaper.py::test_units). This should also be fixed in the new branch.

  • All of the tests in test_quantity fail because these should be run first, and if you do pytest -v tests/ then they are not run first. The reason they should run first is that they need to change the default configuration of galpy.

It would be best to run each test file separately, then at least the test_quantity.py issue would go away. You can't run all the tests at the same time currently, because different files need different configurations and this is not possible in one test session. One way to do it would be to run

pytest -v tests/ --ignore=test_nemo.py --ignore=test_quantity.py
pytest -v tests/test_quantity.py

which first runs all tests except for test_quantity and then runs test_quantity separately.

@swfu
Copy link
Author

swfu commented Jul 13, 2017

Hi Dr. Bovy,

I downloaded the new branch and ran the tests in there. test_quantity works fine now if I run it alone. When I ran pytest -v tests/ --ignore=test_nemo.py --ignore=test_quantity.py, there were some failures under test_orbit.py. Running test_orbit.py on its own also produces failures, and not the exact same ones as the previous command.

Here is the output from pytest -v tests/ --ignore=test_nemo.py --ignore=test_quantity.py (the command didn't seem to exclude the two specified files): https://pastebin.com/P0M5SZ9j

Here is the output from pytest -v tests/testorbit.py: https://pastebin.com/KKT8qcfg

@jobovy
Copy link
Owner

jobovy commented Jul 13, 2017

Okay, I guess that should have been

pytest -v tests/ --ignore=tests/test_nemo.py --ignore=tests/test_quantity.py

Seems like the warnings are still the problem. I don't really see how you can still get the same error, so please make sure that you actually installed the new branch and aren't using a previous version anymore. I've tried to replicate your setup, but I cannot reproduce this warnings error, so it must be due to some detailed part of your setup. Anyway, if you are able to use the code without triggering this error, everything should be fine (it's just an error in how warnings are handled).

The other tests that fail (test_fixedstepsize and the test_*_sigint ones) often fail because they depend on how long the code runs (which is varies from machine to machine). Nothing to worry about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants