-
Notifications
You must be signed in to change notification settings - Fork 31
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
problems with ChiantiPy and pytesting #247
Comments
This is a really good point and indeed the tests may be a bit too aspirational! I just tested things that I would expect to work from the 'principle of least surprise'. Any test that is expected to fail I can just test for the particular exception instead or the test case can be removed. One things that I have noticed is that the test of cd <CHIANTIPY> # Here I run the tests from the project root folder
pytest ChiantiPy/core/tests/test_spectrum_api.py::test_spectrum_container_length_compatibility[1-1-1-container_type0-spectrum]
pytest ChiantiPy/core/tests/test_spectrum_api.py::test_spectrum_container_length_compatibility[1-1-1-container_type0-ipymspectrum] has one succeeding and the other one failing. |
If a value is expected or required to be a scalar I guess you can cast it to a density = float(density) the same way that you use |
I suspect that the problem with ipymspectrum is that you need to start ipcluster |
also saw a warning the ipyparallel was not installed on your machine. |
Hi Ken, If when you run this pytest -v -k "ipymspectrum" # Run all the tests with ipymspectrum you see this message at the end of the result
I think it means that My environmentSome ipcluster start –n=4
pytest -v -k "test_spectrum_container_length_compatibility[5-5-5-container_type0-ipymspectrum]" The test passes, so my configuration seems to be okay. My current resultsBelow is a cropped version of the test output from running pytest -v -k "not -mspectrum" test_spectrum_api.py::test_spectrum_container_length_compatibility
Notice how not all my
This indicates that the API is different between |
still going through the various tests. One thing I just realized was the ipymspectrum must be run in a Jupyter environment. |
for the spectrum tests, the 1-1-5 tests failed. That is because it does not make sense to have more emission-measures than temperatures or densities. |
with the new core/test/test_spectrum_api.py, pytest is finding a lot of errors.
the main problem is that the tests are trying to use the ChiantiPy methods in ways that were unanticipated, mainly because I never explicitly stated how the constraints on the sizes of temperature, density and emission measure, especially how they would act in different methods.
So, I need to put some sort of statement into the docs and in the mean time I will try to sort things out.
One of the questions is whether to make the test more appropriate to the way things are or to adapt the methods to these unanticipated ways of calling things.
One example of this is the fact that the radiative losses (radLoss), especially the free-free and free-bound continuum, do not depend too much on density so that the specification of the density was not anticipated.
The text was updated successfully, but these errors were encountered: