Skip to content

Commit

Permalink
doc: format docstring as well as doc for selections
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudac7 committed Nov 8, 2023
1 parent 14161b5 commit 036eea5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 37 deletions.
34 changes: 17 additions & 17 deletions package/MDAnalysis/core/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -3111,24 +3111,24 @@ def select_atoms(self, sel, *othersel, periodic=True, rtol=1e-05,
radius 5, external radius 10 centered on the COG. In z, the
cylinder extends from 10 above the COG to 8 below. Positive
values for *zMin*, or negative ones for *zMax*, are allowed.
box *dimensions* *d1_min* *d1_max* (*d2_min* *d2_max*) (*d3_min* *d3_max*) *selection*
Select all atoms within a box region centered
box *dimensions* *dN_min* *dN_max* *selection*
Select all atoms within a box region centered
on the center of geometry (COG) of a given selection.
*dimensions* Specifies which dimension(s) to apply
the box selection on. Can be ``x``, ``y``, ``z``,
or any combination like ``xy``, ``yz``, ``zx``, ``xyz``
(up to 3 characters). *d\*_min*, *d\*_max* are the minimum and
maximum bounds along the first specified dimension.
Positive values are above/right/front of the COG,
negatives are below/left/behind. Should be specified
for each dimension. *selection* specifies the selection
to center the box on. e.g. ``box x -5 10 protein``
selects a 15 Angstrom box along x centered
on the COG of protein, extending 5 Angstroms
below to 10 Angstroms above. ``box yz -8 10 -10 6 protein``
selects a box with y extending 8 below to 10 above the COG,
and z extending 10 below to 6 above.
``box xyz -5 10 -8 6 -7 9 protein`` selects
*dimensions* Specifies which dimension(s) to apply
the box selection on. Can be ``x``, ``y``, ``z``,
or any combination like ``xy``, ``yz``, ``zx``, ``xyz``
(up to 3 characters). *dN_min*, *dN_max* are the minimum and
maximum bounds along the first specified dimension.
Positive values are above/right/front of the COG,
negatives are below/left/behind, and should be specified
for each dimension. *selection* specifies the selection
to center the box on. e.g. ``box x -5 10 protein``
selects a 15 Angstrom box along x centered
on the COG of protein, extending 5 Angstroms
below to 10 Angstroms above. ``box yz -8 10 -10 6 protein``
selects a box with y extending 8 below to 10 above the COG,
and z extending 10 below to 6 above.
``box xyz -5 10 -8 6 -7 9 protein`` selects
a 3D box with x -5 to 10, y -8 to 6, and z -7 to 9 relative
to the protein COG.
Expand Down
35 changes: 15 additions & 20 deletions package/doc/sphinx/source/documentation_pages/selections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -277,26 +277,21 @@ cyzone *externalRadius* *zMax* *zMin* *selection*
relative to the COG of *selection*, instead of absolute z-values
in the box.

box *dimensions* *d1_min* *d1_max* (*d2_min* *d2_max*) (*d3_min* *d3_max*) *selection*
Select all atoms within a box region centered
on the center of geometry (COG) of a given selection.
*dimensions* Specifies which dimension(s) to apply
the box selection on. Can be ``x``, ``y``, ``z``,
or any combination like ``xy``, ``yz``, ``zx``, ``xyz``
(up to 3 characters). *d\*_min*, *d\*_max* are the minimum and
maximum bounds along the first specified dimension.
Positive values are above/right/front of the COG,
negatives are below/left/behind. Should be specified
for each dimension. *selection* specifies the selection
to center the box on. e.g. ``box x -5 10 protein``
selects a 15 Angstrom box along x centered
on the COG of protein, extending 5 Angstroms
below to 10 Angstroms above. ``box yz -8 10 -10 6 protein``
selects a box with y extending 8 below to 10 above the COG,
and z extending 10 below to 6 above.
``box xyz -5 10 -8 6 -7 9 protein`` selects
a 3D box with x -5 to 10, y -8 to 6, and z -7 to 9 relative
to the protein COG.
box *dimensions* *dN_min* *dN_max* *selection*
Select all atoms within a box region centered on the center of
geometry (COG) of a given selection. *dimensions* Specifies
which dimension(s) to apply the box selection on. Can be ``x``,
``y``, ``z``, or any combination like ``xy``, ``yz``, ``zx``, ``xyz``
(up to 3 characters). *dN_min*, *dN_max* are the minimum and maximum
bounds along the first specified dimension. Positive values are
above/right/front of the COG, negatives are below/left/behind.
Should be specified for each dimension. *selection* specifies the selection
to center the box on. e.g. ``box x -5 10 protein`` selects a 15 Angstrom
box along x centered on the COG of protein, extending 5 Angstroms below to
10 Angstroms above. ``box yz -8 10 -10 6 protein`` selects a box with
y extending 8 below to 10 above the COG, and z extending 10 below to 6 above.
``box xyz -5 10 -8 6 -7 9 protein`` selects a 3D box with x -5 to 10,
y -8 to 6, and z -7 to 9 relative to the protein COG.

point *x* *y* *z* *distance*
selects all atoms within a cutoff of a point in space, make sure
Expand Down

0 comments on commit 036eea5

Please sign in to comment.