-
Notifications
You must be signed in to change notification settings - Fork 667
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
mandate tests for additions to MDAnalysis.analysis and introduction of analysis.legacy #743
Comments
I like this, with the twist that we should just require a regression test on each function/method. I can't remember who said this (@dotsdl probably?), but we could(?) move analysis/vis into their own repo, but still package it all together as one package (so |
Sounds sensible. I guess my MDAnalysis.visualization stuff won't be subject On 27 February 2016 at 11:32, Richard Gowers [email protected]
|
It might be possible just to assert that a matplotlib object gets returned On Wed, 9 Mar 2016 15:57 Tyler Reddy, [email protected] wrote:
|
prettyplotlib compares to some baseline images to test the plotting routines. But other then that I'm also not sure what to do to test images. |
That's true. Although the streamline code does do some mathematics before producing the image so I could at least provide tests for that, or the data before it is plotted. I think any tests would likely just prevent regression / changing of behaviour rather than proving that the code is correct, but that is likely better than the current state (no tests). I'll make a note of this... |
Since matplotlib figures are just python objects (they're only made into images when you do |
Added @richardjgowers 's suggestion to require regression tests (at a minimum). |
Quick comments on the discussion:
Do we have any other voices? Or can we consider this proposal, consisting of P1 and P2, consider accepted? (GitHub does not have proper voting but you can use the thumbs up/down emoticons on the top comment.) |
I'm for both solutions. @orbeckst should we just count the like to your post that people agree with P1 and P2 |
Rather than play around with a legacy submodule and stubs, couldn't we just write the regression tests for each? It'd probably be a similar amount of work either way. If anything isn't well documented enough to write tests for, get rid of it anyway. |
Having regression tests for everything is clearly the preferred solution. However, I hate to throw away code because at some point someone put quite a bit of thought into it and it can still be useful. In any case, it doesn't really look too daunting: Analysis modules with no associated tests
Analysis modules with incomplete testing
... but we can simply look at coverage to figure out where we need more tests. Modules with difficult dependenciesThe following modules require 3rd party code, sometimes not even free: |
I consider P1 and P2 accepted. I won't set up The next steps here are to
|
Updated the wiki page Style Guide: Tests and sent email to the developer list tests are now required for all of MDAnalysis.analysis. |
- created new MDAnalysis.analysis.legacy package - directory - docs - x3dna is now considered legacy code (no/minimal testing, no maintenance) - see #906 for reasons (mainly because the x3dna license does not allow us to just install it for testing on travis, or rather, licensing and access to x3dna is unknown/too complicated) - closes #906 - see #743 on background for legacy code and also https://github.com/MDAnalysis/mdanalysis/wiki/Style-Guide#tests-for-mdanalysisanalysis - added stub with deprecation warning: until release 1.0, MDAnalysis.analysis.x3dna is still accessible - added test case that the stub is there
* moved analysis.x3dna to analysis.legacy.x3dna - created new MDAnalysis.analysis.legacy package - directory - docs - x3dna is now considered legacy code (no/minimal testing, no maintenance) - see #906 for reasons (mainly because the x3dna license does not allow us to just install it for testing on travis, or rather, licensing and access to x3dna is unknown/too complicated) - closes #906 - see #743 on background for legacy code and also https://github.com/MDAnalysis/mdanalysis/wiki/Style-Guide#tests-for-mdanalysisanalysis - added stub with deprecation warning: until release 1.0, MDAnalysis.analysis.x3dna is still accessible - added test case that the stub is there * updated CHANGELOG - legacy module (#743) - x3dna is now legacy code (#906) - updated upcoming release number to 0.16.0 [skip ci] * Removed legacy submodule from coverage
* moved analysis.x3dna to analysis.legacy.x3dna - created new MDAnalysis.analysis.legacy package - directory - docs - x3dna is now considered legacy code (no/minimal testing, no maintenance) - see MDAnalysis#906 for reasons (mainly because the x3dna license does not allow us to just install it for testing on travis, or rather, licensing and access to x3dna is unknown/too complicated) - closes MDAnalysis#906 - see MDAnalysis#743 on background for legacy code and also https://github.com/MDAnalysis/mdanalysis/wiki/Style-Guide#tests-for-mdanalysisanalysis - added stub with deprecation warning: until release 1.0, MDAnalysis.analysis.x3dna is still accessible - added test case that the stub is there * updated CHANGELOG - legacy module (MDAnalysis#743) - x3dna is now legacy code (MDAnalysis#906) - updated upcoming release number to 0.16.0 [skip ci] * Removed legacy submodule from coverage
tl;dr: Spring cleaning for
MDAnalysis.analysis
.With recent discussions about the analysis module (#666, #719) and the feeling that we need to get it up to the same standards as the core, I think an important step is better tests and identifying to the user code that is not well maintained (it's sad having to admit that we have under-maintained code but this is a fact in open source and we simply have a responsibility towards our users).
MDAnalysis.analysis.legacy
module for unmaintained code: P2What say ye, @MDAnalysis/coredevs ?
(P1) Mandatory tests for new analysis code
I propose to require new code for
MDAnalysis.analysis
to come with unit tests. Currently, the Style Guide only encourages unit tests.Tests for analysis classes and functions should at a minimum perform regression tests, i.e., run on input and compare to values generated when when the code was added so that we know when the output changes in the future. (Even better are tests that test for absolute correctness of results but regression tests are the minimum requirement.)
If we adopt (P1), the Style Guide will be changed to reflect this policy and new analysis code will not be merged until tests are provided and pass.
(P2)
MDAnalysis.analysis.legacy
for unmaintained codeI am also proposing that any code in
MDAnalysis.analysis
that does not have substantial testing (at least 70% coverage... we can debate this number!) will be moved to a specialMDAnalysis.analysis.legacy
module that will come with its own warning that this is essentially unmaintained functionality that is still provided because there's no alternative. Legacy packages that receive sufficient upgrades can come back to the normalMDAnalysis.analysis
name space.If we adopt P2 then modules can be moved to
legacy
as soon as we decide on its creation but until release 1.0 we leave stubs in place so that no old code breaks (and issue deprecation warnings for the import). Once 1.0 is released, the stubs will be removed and the modules will only be available fromlegacy
.History
The text was updated successfully, but these errors were encountered: