mdanalysis icon indicating copy to clipboard operation
mdanalysis copied to clipboard

Add an `AnalysisCollection` class

Open PicoCentauri opened this issue 1 year ago • 18 comments

Fixes #3569

The AnalysisCollection follows the discussion of #3569 resetting the timestep object for each analysis by default. If requested the user can set the reset_timestep variable to False allowing altering the timestep object.

Within this PR I moved the run method from AnalysisBase to AnalysisCollection to avoid code a lot of duplication. These changes interface of Github might make this a bit difficult to follow. The core changes the run method only that instead of running the _prepare, _single_frame and _conclude methods only once it is looped over all provided analysis instances.

Changes made in this Pull Request:

  • Add an AnalysisCollection class to perform multiple analyses on the same trajectory
  • Use assert_equal in test_base.py

PR Checklist

  • [x] Tests?
  • [x] Docs?
  • [x] CHANGELOG updated?
  • [x] Issue raised/referenced?

Disclaimer: This PR was written with inspiration of OpenAI's ChatGPT.

PicoCentauri avatar Jan 30 '23 10:01 PicoCentauri