Skip to content

mandate tests for additions to MDAnalysis.analysis and introduction of analysis.legacy  #743

@orbeckst

Description

@orbeckst

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).

  • Mandatory tests for new analysis code: P1
  • MDAnalysis.analysis.legacy module for unmaintained code: P2

What 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 code

I 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 special MDAnalysis.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 normal MDAnalysis.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 from legacy.

History

  • 2016-02-26 initial proposal
  • 2016-03-12 added @richardjgowers 's suggestion to require regression tests at a minimum
  • 2016-03-24 P1 and P2 accepted

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions