-
Notifications
You must be signed in to change notification settings - Fork 653
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
modernize testing code #3743
Comments
i want to work on this issue |
We always welcome contributions. Just submit a PR that references this issue. We will then discuss there. When you start the work, please also introduce you on the developer mailing list. Btw, we don’t “reserve” work, we just look at the first PR that addresses the issue. Details of our policy are in our GSOC FAQ on our wiki. |
I tried converting more tests to use if a != approx(b):
# print the custom error message here and fail the test for those tests. |
Does
work? |
hello, i want to work on this project. |
Hello @Ranit-Bandyopadhyay , if no-body else is working on an issue as evidenced by a linked PR, just go ahead an submit a PR. See also our GSOC FAQ https://github.com/MDAnalysis/mdanalysis/wiki/GSoC-FAQ#can-i-claim-an-issue-to-work-on . |
Hi, I would like to work on this Issue. it would be great could you please assign this issue to me |
@chandra20500 , see what I said above and read the link to the FAQ: we do not reserve or assign issues. We just evaluate work presented. |
can u tell me the link of testing code |
@utkarsh147-del you can find the link by reading the User Guide |
Hello, so I made a couple of changes to the |
I'm developing a reader for the GROMOS11 trajectory format, as that would enable the research group I'm working with to use MDAnalysis (Issue #4291). When preparing the necessary pytests, I found the documentation/userguide to ask for the use of assert_almost_equal(). In the pytests for the GROMOS reader, I compare the read-in position of one atom with the numeric exact position of the input file. As soon as the read-in positions are saved in the Timestep instance (ts.positions), they are converted to np.float32. The conversion causes a loss of precision in the 5th decimal, which would be acceptable for me. This numeric error is caught by assert_almost_equal(), failing the tests. I use both assert_almost_equal and assert_allclose without further arguments. Is it valid to use assert_allclose as recommend here, even through the documentation requests otherwise? If yes, I would ask to also change the documentation (https://userguide.mdanalysis.org/2.6.0/testing.html). |
@JoStoe use |
i love to contribute in this project can you please assign me the issue |
Hi @man0045, great to hear you want to contribute to MDAnalysis! However, we do bot assign issues. If no-body else is working on an issue (as evidenced by a linked PR), you can work on it an submit a PR. |
Hi, maintainers I have made raised a PR for the above.
Changes
Should I do the same for rest of the files in the project. |
Is your feature request related to a problem?
The testing code uses pytest and relies on numpy.testing. It contains some deprecated testing constructs such as
assert_almost_equal()
,assert_array_almost_equal()
and some sub-optimal tests (such as testing single floats with an array assertion).Describe the solution you'd like
Update the testing code, following current best practices, such as
numpy.testing.assert_allclose()
instead ofassert_almost_equal()
orassert_array_almost_equal()
for more consistent floating point comparisonspytest.approx()
(see Nuclinfo Major Pair and Minor Pair overhaul #3735 (comment))Please add additional best practices here or in the comments.
Describe alternatives you've considered
We don't have to do anything right now because everything is working.
How to work on this issue
You can open issues for individual points above, you don't have to work on all of them. If you create a new issue, mention this issue number in the issue text so that it gets linked.
Find occurrences of the constructs that you want to change in the code, e.g.,
Figure out how to change the code to get an equivalent result by learning about the different arguments that the old and the new function take and how they affect the assertion. Then pick one example and implement your solution. See if it works. Improve your example until it works. Only then start converting more of the test files. Get feedback from other developers.
The text was updated successfully, but these errors were encountered: