-
Notifications
You must be signed in to change notification settings - Fork 651
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
TST: test_streamplot_2D faster #4221
TST: test_streamplot_2D faster #4221
Conversation
* speed up `test_streamplot_2D()` because it has been reported to take ~20 seconds on a regular basis in CI in MDAnalysisgh-4209 * we don't really need to plot the output, which was taking most of the time, and instead we can just check the data structures that MDAnalysis returns (this may be a better test by some definitions anyway...); I suppose we could also spot check a few values in the arrays if we wanted as well * locally, that single test seems to run in 0.39 s on this branch vs. 4.7 s on `develop`
with open(plot_outpath, 'rb'): | ||
pass | ||
assert u1.shape == (5, 5) | ||
assert v1.shape == (5, 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe spot checking values here might make sense--to be fair, we weren't doing that before either though
Linter Bot Results:Hi @tylerjereddy! Thanks for making this PR. We linted your code and found the following: Some issues were found with the formatting of your code.
Please have a look at the Please note: The |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## develop #4221 +/- ##
===========================================
- Coverage 93.62% 93.62% -0.01%
===========================================
Files 193 193
Lines 25295 25295
Branches 4063 4063
===========================================
- Hits 23683 23682 -1
Misses 1096 1096
- Partials 516 517 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! If you want to add a few value spot checks that'd be great, otherwise it at least doesn't regress the amount of testing we do.
Just the one think about using pytest.approx for single float value checks.
pass | ||
assert u1.shape == (5, 5) | ||
assert v1.shape == (5, 5) | ||
assert_allclose(avg, 0.965194167) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these single value checks? If so could we use pytest.approx instead (it is much faster last I checked)?
* use `pytest.approx` for single value comparisons * `u1` and `v1` are now checked more thoroughly for their actual floating point values
I revised to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
speed up
test_streamplot_2D()
because it has been reported to take ~20 seconds on a regular basisin CI in [CI] Tests timing out occasionally #4209
we don't really need to plot the output, which was taking most of the time, and instead we can just check the data structures that MDAnalysis returns (this may be a better test by some definitions anyway...); I suppose we could also spot check a few values in the arrays if we wanted as well
locally, that single test seems to run in 0.39 s on this branch vs. 4.7 s on
develop
Developers certificate of origin
📚 Documentation preview 📚: https://mdanalysis--4221.org.readthedocs.build/en/4221/