-
Notifications
You must be signed in to change notification settings - Fork 664
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
made test_dres_convergence less likely to fail #1932
Conversation
… CStochasticProximityEmbedding() in spe.c
Simply repeating the test 10 times on failure is certainly not an ideal solution, it simply decreases the likelihood of random failures. Maybe someone else comes up with a better idea. |
To the solution is to switch out the RNG into something we can reliably seed ourselves. This can be done by porting the c extensions into cython. Then using the numpy rng can always use the same seed. That will make the tests reproducible. |
@kain88-de Porting the C extensions to Cython sounds quite cumbersome and probably overkill to me... However, regarding the option of setting a seed externally: Even though the implementation of |
You can rerun with different seeds if you like. But that is overkill IMHO. For tests using fixed seeds is OK because we want to reliable setup the same environment for a test.
Well yeah maybe. But random numbers make all of this a bit more complicated when one wants to do them right. I prefer to give users a consistent interface to any RNG within mdanalysis and the easiest way to achieve this is to go with the numpy rng's. This also allows to run the analysis with multiple processes and give each process it's own correctly seeded RNG. |
@kain88-de Sounds convincing. I agree that having a consistent PRNG interface throughout the code should be the way to go. The current state of the How would you like proceed with this? I'd suggest using this PR as a band-aid and open a separate issue regarding PRNG interfaces. |
make the seed an argument to the function. Then we can provide one for testing. This will make the tests more reproducible instead of just rerunning them and hoping it will work out. |
@kain88-de what you're proposing is the better solution for this, but this PR fixes the problem with false negatives on PRs nicely, we should merge |
Fixes #1931
Changes made in this Pull Request:
MDAnalysisTests.analysis.test_encore.TestEncore.test_dres_convergence
fails, aRuntimeWarning
is thrown and the test is repeated 10 times.printf(...)
inCStochasticProximityEmbedding()
PR Checklist