Skip to content

Commit

Permalink
proofread
Browse files Browse the repository at this point in the history
  • Loading branch information
PicoCentauri committed Jan 30, 2023
1 parent a6d9ef2 commit a0acb3e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Fixes
(Issue #3336)

Enhancements
* Add a `AnalayisCollection` class to perform multiple analysis on the same
* Add an `AnalayisCollection` class to perform multiple analysis on the same
trajectory (#3569, PR #4017).
* Add pickling support for Atom, Residue, Segment, ResidueGroup
and SegmentGroup. (PR #3953)
Expand Down
38 changes: 21 additions & 17 deletions package/MDAnalysis/analysis/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ class AnalysisCollection(object):
The class assumes that each analysis is a child of
:class:`MDAnalysis.analysis.base.AnalysisBase`. Additionally,
the trajectory of all ``analysis_objects`` must be same.
the trajectory of all ``analysis_objects`` must be the same.
By default it is ensured that all analyisis objects use the
By default, it is ensured that all analysis objects use the
*same original* timestep and not an altered one from a previous analysis
object. This behaviour can be changed with the ``reset_timestep`` parameter
object. This behavior can be changed with the ``reset_timestep`` parameter
of the :meth:`MDAnalysis.analysis.base.AnalysisCollection.run` method.
Parameters
Expand All @@ -245,7 +245,7 @@ class AnalysisCollection(object):
Raises
------
AttributeError
If the provided ``analysis_objects`` do not have the same trajectory.
If all the provided ``analysis_objects`` do not have the same trajectory.
AttributeError
If an ``analysis_object`` is not a child of
:class:`MDAnalysis.analysis.base.AnalysisBase`.
Expand All @@ -269,17 +269,19 @@ class AnalysisCollection(object):
rdf_OO = InterRDF(ag_O, ag_O)
rdf_OH = InterRDF(ag_H, ag_H)
# Create collection for common trajectory
# Create a collection for common trajectory
collection = AnalysisCollection(rdf_OO, rdf_OH)
# Run the collected analysis
collection.run(start=0, end=100, step=10)
# Results are stored in indivial objects
# Results are stored in individual objects
print(rdf_OO.results)
print(rdf_OH.results)
.. versionadded:: 2.5.0
"""

def __init__(self, *analysis_objects):
Expand Down Expand Up @@ -314,13 +316,13 @@ def run(
step : int, optional
number of frames to skip between each analysed frame
frames : array_like, optional
array of integers or booleans to slice trajectory; ``frames`` can
only be used *instead* of ``start``, ``stop``, and ``step``. Setting
*both* `frames` and at least one of ``start``, ``stop``, ``step`` to a
non-default value will raise a :exc:``ValueError``.
array of integers or booleans to slice trajectory; `frames` can
only be used *instead* of `start`, `stop`, and `step`. Setting
*both* `frames` and at least one of `start`, `stop`, `step` to a
non-default value will raise a :exc:`ValueError`.
verbose : bool, optional
Turn on verbosity
reset_timestep : bool
reset_timestep : bool, optional
Reset the timestep object after for each ``analysis_object``.
Setting this to ``False`` can be useful if an ``analysis_object``
is performing a trajectory manipulation which is also useful for the
Expand Down Expand Up @@ -490,8 +492,10 @@ def _setup_frames(self, trajectory, start=None, stop=None, step=None,
step : int, optional
number of frames to skip between each analysed frame
frames : array_like, optional
array of integers or booleans to slice trajectory; cannot be
combined with `start`, `stop`, `step`
array of integers or booleans to slice trajectory; `frames` can
only be used *instead* of `start`, `stop`, and `step`. Setting
*both* `frames` and at least one of `start`, `stop`, `step` to a
non-default value will raise a :exc:`ValueError`.
.. versionadded:: 2.2.0
Expand Down Expand Up @@ -559,10 +563,10 @@ def run(self, start=None, stop=None, step=None, frames=None,
step : int, optional
number of frames to skip between each analysed frame
frames : array_like, optional
array of integers or booleans to slice trajectory; ``frames`` can
only be used *instead* of ``start``, ``stop``, and ``step``. Setting
*both* `frames` and at least one of ``start``, ``stop``, ``step`` to a
non-default value will raise a :exc:``ValueError``.
array of integers or booleans to slice trajectory; `frames` can
only be used *instead* of `start`, `stop`, and `step`. Setting
*both* `frames` and at least one of `start`, `stop`, `step` to a
non-default value will raise a :exc:`ValueError`.
.. versionadded:: 2.2.0
Expand Down
3 changes: 0 additions & 3 deletions testsuite/MDAnalysisTests/analysis/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ def _single_frame(self):
else:
assert_allclose(ana_2.ref_pos, ana_1.ref_pos + 10)

def test_no_trajectory_manipulation(self):
pass

def test_inconsistent_trajectory(self, universe):
v = mda.Universe(TPR, XTC)

Expand Down

0 comments on commit a0acb3e

Please sign in to comment.