From bf937316256f7cc5c7773b84abaa0ba730b85f14 Mon Sep 17 00:00:00 2001 From: Cloudac7 <812556867@qq.com> Date: Wed, 8 Nov 2023 11:13:20 +0800 Subject: [PATCH] doc: format docstring as well as doc for selections --- package/MDAnalysis/core/groups.py | 34 +++++++++--------- .../source/documentation_pages/selections.rst | 35 ++++++++----------- 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/package/MDAnalysis/core/groups.py b/package/MDAnalysis/core/groups.py index 6d588f3d33d..70d826d7675 100644 --- a/package/MDAnalysis/core/groups.py +++ b/package/MDAnalysis/core/groups.py @@ -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. diff --git a/package/doc/sphinx/source/documentation_pages/selections.rst b/package/doc/sphinx/source/documentation_pages/selections.rst index 400d612640a..196446bc9df 100644 --- a/package/doc/sphinx/source/documentation_pages/selections.rst +++ b/package/doc/sphinx/source/documentation_pages/selections.rst @@ -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