diff --git a/package/MDAnalysis/__init__.py b/package/MDAnalysis/__init__.py index adc43cc3a54..312fca0588f 100644 --- a/package/MDAnalysis/__init__.py +++ b/package/MDAnalysis/__init__.py @@ -113,7 +113,9 @@ 9.72062 .... -.. SeeAlso:: :class:`MDAnalysis.core.universe.Universe` for details +See Also +-------- +See :class:`MDAnalysis.core.universe.Universe` for details Examples diff --git a/package/MDAnalysis/auxiliary/XVG.py b/package/MDAnalysis/auxiliary/XVG.py index c3fc80114fb..abd2f2ddd9b 100644 --- a/package/MDAnalysis/auxiliary/XVG.py +++ b/package/MDAnalysis/auxiliary/XVG.py @@ -226,9 +226,13 @@ def _go_to_step(self, i): Parameters ---------- - i : int + i: int Step number (0-indexed) to move to + Returns + ------- + :class:`XVGStep` + Raises ------ ValueError diff --git a/package/MDAnalysis/coordinates/CRD.py b/package/MDAnalysis/coordinates/CRD.py index 652fd8e3774..52d0ba95b36 100644 --- a/package/MDAnalysis/coordinates/CRD.py +++ b/package/MDAnalysis/coordinates/CRD.py @@ -98,11 +98,14 @@ def _read_first_frame(self): def Writer(self, filename, **kwargs): """Returns a CRDWriter for *filename*. - :Arguments: - *filename* - filename of the output CRD file - - :Returns: :class:`CRDWriter` + Parameters + ---------- + filename: str + filename of the output CRD file + + Returns + ------- + :class:`CRDWriter` """ return CRDWriter(filename, **kwargs) diff --git a/package/MDAnalysis/coordinates/DCD.py b/package/MDAnalysis/coordinates/DCD.py index 9e2446bfec9..062207a5495 100644 --- a/package/MDAnalysis/coordinates/DCD.py +++ b/package/MDAnalysis/coordinates/DCD.py @@ -51,8 +51,10 @@ :class:`MDAnalysis.coordinates.LAMMPS.DCDReader` for NAMD trajectories. -.. SeeAlso:: The :mod:`MDAnalysis.coordinates.LAMMPS` module provides - a more flexible DCD reader/writer. +See Also +-------- +The :mod:`MDAnalysis.coordinates.LAMMPS` module provides a more flexible DCD +reader/writer. The classes in this module are the reference implementations for the Trajectory API. @@ -209,29 +211,31 @@ def __init__(self, filename, n_atoms, start=0, step=1, remarks="Created by DCDWriter", convert_units=None): """Create a new DCDWriter - :Arguments: - *filename* - name of output file - *n_atoms* - number of atoms in dcd file - *start* - starting timestep - *step* - skip between subsequent timesteps (indicate that *step* MD - integrator steps (!) make up one trajectory frame); default is 1. - *delta* - timestep (MD integrator time step (!), in AKMA units); default is - 20.45482949774598 (corresponding to 1 ps). - *remarks* - comments to annotate dcd file - *dt* - **Override** *step* and *delta* so that the DCD records that *dt* ps - lie between two frames. (It sets *step* = 1 and *delta* = ``AKMA(dt)``.) - The default is ``None``, in which case *step* and *delta* are used. - *convert_units* - units are converted to the MDAnalysis base format; ``None`` selects - the value of :data:`MDAnalysis.core.flags` ['convert_lengths']. - (see :ref:`flags-label`) + Parameters + ---------- + filename: str + name of output file + n_atoms: int + number of atoms in dcd file + start: int + starting timestep + step: int + skip between subsequent timesteps (indicate that *step* MD + integrator steps (!) make up one trajectory frame); default is 1. + delta: float + timestep (MD integrator time step (!), in AKMA units); default is + 20.45482949774598 (corresponding to 1 ps). + remarks: str + comments to annotate dcd file + dt: float + **Override** *step* and *delta* so that the DCD records that + *dt* ps lie between two frames. (It sets *step* = 1 and + *delta* = ``AKMA(dt)``.) The default is ``None``, in which case + *step* and *delta* are used. + convert_units: bool + units are converted to the MDAnalysis base format; ``None`` selects + the value of :data:`MDAnalysis.core.flags` ['convert_lengths']. + (see :ref:`flags-label`) .. Note:: @@ -336,7 +340,9 @@ def write_next_timestep(self, ts=None): def convert_dimensions_to_unitcell(self, ts, _ts_order=Timestep._ts_order): """Read dimensions from timestep *ts* and return appropriate native unitcell. - .. SeeAlso:: :attr:`Timestep.dimensions` + See Also + -------- + :attr:`Timestep.dimensions` """ # unitcell is A,B,C,alpha,beta,gamma - convert to order expected by low level DCD routines lengths, angles = ts.dimensions[:3], ts.dimensions[3:] @@ -510,23 +516,24 @@ def timeseries(self, asel=None, start=None, stop=None, step=None, skip=None, format='afc'): """Return a subset of coordinate data for an AtomGroup - :Arguments: - *asel* - :class:`~MDAnalysis.core.groups.AtomGroup` object - Defaults to None, in which case the full set of coordinate data - is returned. - *start*, *stop*, *step* - A range of the trajectory to access, with start being inclusive - and stop being exclusive. - *format* - the order/shape of the return data array, corresponding - to (a)tom, (f)rame, (c)oordinates all six combinations - of 'a', 'f', 'c' are allowed ie "fac" - return array - where the shape is (frame, number of atoms, - coordinates) - :Deprecated: - *skip* - Skip has been deprecated in favor of the standard keyword step. + Parameters + ---------- + asel: :class:`~MDAnalysis.core.groups.AtomGroup` + The :class:`~MDAnalysis.core.groups.AtomGroup` to read the + coordinates from. Defaults to None, in which case the full set of + coordinate data is returned. + start, stop, step: int + A range of the trajectory to access, with start being inclusive + and stop being exclusive. + format: str + the order/shape of the return data array, corresponding + to (a)tom, (f)rame, (c)oordinates all six combinations + of 'a', 'f', 'c' are allowed ie "fac" - return array + where the shape is (frame, number of atoms, + coordinates) + + .. deprecated:: 0.016.0 + *skip* has been deprecated in favor of the standard keyword step. """ if skip is not None: step = skip @@ -553,15 +560,15 @@ def timeseries(self, asel=None, start=None, stop=None, step=None, skip=None, def correl(self, timeseries, start=None, stop=None, step=None, skip=None): """Populate a TimeseriesCollection object with timeseries computed from the trajectory - :Arguments: - *timeseries* - :class:`MDAnalysis.core.Timeseries.TimeseriesCollection` - *start, stop, step* - A subset of the trajectory to use, with start being inclusive - and stop being exclusive. - :Deprecated: - *skip* - Skip has been deprecated in favor of the standard keyword step. + Parameters + ---------- + timeseries: :class:`MDAnalysis.core.Timeseries.TimeseriesCollection` + start, stop, step: int + A subset of the trajectory to use, with start being inclusive and + stop being exclusive. + + .. deprecated:: 0.16.0 + *skip* has been deprecated in favor of the standard keyword step. """ if skip is not None: step = skip @@ -590,26 +597,28 @@ def Writer(self, filename, **kwargs): All values can be changed through keyword arguments. - :Arguments: - *filename* - filename of the output DCD trajectory - :Keywords: - *n_atoms* - number of atoms - *start* - number of the first recorded MD step - *step* - indicate that *step* MD steps (!) make up one trajectory frame - *delta* - MD integrator time step (!), in AKMA units - *dt* - **Override** *step* and *delta* so that the DCD records that *dt* ps - lie between two frames. (It sets *step* = 1 and *delta* = ``AKMA(dt)``.) - The default is ``None``, in which case *step* and *delta* are used. - *remarks* - string that is stored in the DCD header [XXX -- max length?] - - :Returns: :class:`DCDWriter` + Parameters + ---------- + filename: str + filename of the output DCD trajectory + n_atoms: int + number of atoms + start: int + number of the first recorded MD step + step: int + indicate that *step* MD steps (!) make up one trajectory frame + delta: float + MD integrator time step (!), in AKMA units + dt: float + **Override** *step* and *delta* so that the DCD records that + *dt* ps lie between two frames. (It sets *step* = 1 and + *delta* = ``AKMA(dt)``.) The default is ``None``, in which case + *step* and *delta* are used. *remarks* string that is stored in + the DCD header + + Returns + ------- + :class:`DCDWriter` .. Note:: @@ -617,7 +626,9 @@ def Writer(self, filename, **kwargs): according to the CHARMM format. The time between two frames would be *delta* * *step* ! - .. SeeAlso:: :class:`DCDWriter` has detailed argument description + See Also + -------- + :class:`DCDWriter` has detailed argument description """ n_atoms = kwargs.pop('n_atoms', self.n_atoms) kwargs.setdefault('start', self.start_timestep) diff --git a/package/MDAnalysis/coordinates/GRO.py b/package/MDAnalysis/coordinates/GRO.py index 56f8cc41f09..d0fdaad405f 100644 --- a/package/MDAnalysis/coordinates/GRO.py +++ b/package/MDAnalysis/coordinates/GRO.py @@ -189,11 +189,14 @@ def _read_first_frame(self): def Writer(self, filename, **kwargs): """Returns a CRDWriter for *filename*. - :Arguments: - *filename* + Parameters + ---------- + filename: str filename of the output GRO file - :Returns: :class:`GROWriter` + Returns + ------- + :class:`GROWriter` """ return GROWriter(filename, **kwargs) @@ -240,9 +243,13 @@ class GROWriter(base.WriterBase): def __init__(self, filename, convert_units=None, **kwargs): """Set up a GROWriter with a precision of 3 decimal places. - :Arguments: - *filename* - output filename + Parameters + ---------- + filename: str + output filename + convert_units: bool + units are converted to the MDAnalysis base format; ``None`` selects + the value of :data:`MDAnalysis.core.flags` ['convert_lengths'] """ self.filename = util.filename(filename, ext='gro') @@ -253,13 +260,13 @@ def __init__(self, filename, convert_units=None, **kwargs): def write(self, selection, frame=None): """Write selection at current trajectory frame to file. - :Arguments: - selection - MDAnalysis AtomGroup (selection or Universe.atoms) - or also Universe - :Keywords: - frame - optionally move to frame number *frame* + Parameters + ---------- + selection: + The :class:`~MDAnalysis.core.groups.AtomGroup` or :class:`Universe` + to write + frame: int + optionally move to frame number *frame* The GRO format only allows 5 digits for resid and atom number. If these number become larger than 99,999 then this diff --git a/package/MDAnalysis/coordinates/MOL2.py b/package/MDAnalysis/coordinates/MOL2.py index e32dbb08ab1..ce61834f81f 100644 --- a/package/MDAnalysis/coordinates/MOL2.py +++ b/package/MDAnalysis/coordinates/MOL2.py @@ -242,12 +242,13 @@ def __init__(self, filename, n_atoms=None, convert_units=None): """Create a new MOL2Writer - :Arguments: - *filename* - name of output file - *convert_units* - units are converted to the MDAnalysis base format; ``None`` selects - the value of :data:`MDAnalysis.core.flags` ['convert_lengths'] + Parameters + ---------- + filename: str + name of output file + convert_units: bool + units are converted to the MDAnalysis base format; ``None`` selects + the value of :data:`MDAnalysis.core.flags` ['convert_lengths'] """ self.filename = filename if convert_units is None: diff --git a/package/MDAnalysis/coordinates/PDB.py b/package/MDAnalysis/coordinates/PDB.py index 5035ca9c836..7a86668f662 100644 --- a/package/MDAnalysis/coordinates/PDB.py +++ b/package/MDAnalysis/coordinates/PDB.py @@ -217,10 +217,6 @@ class PDBReader(base.ReaderBase): ============= ============ =========== ============================================= - .. SeeAlso:: :class:`PDBWriter`; :class:`PDBReader` - implements a larger subset of the header records, - which are accessible as :attr:`PDBReader.metadata`. - .. versionchanged:: 0.11.0 * Frames now 0-based instead of 1-based * New :attr:`title` (list with all TITLE lines). @@ -315,11 +311,14 @@ def __init__(self, filename, **kwargs): def Writer(self, filename, **kwargs): """Returns a PDBWriter for *filename*. - :Arguments: - *filename* - filename of the output PDB file + Parameters + ---------- + filename: str + filename of the output PDB file - :Returns: :class:`PDBWriter` + Returns + ------- + :class:`PDBWriter` """ kwargs.setdefault('multiframe', self.n_frames > 1) @@ -412,10 +411,11 @@ class PDBWriter(base.WriterBase): .. _ENDMDL: http://www.wwpdb.org/documentation/format32/sect9.html#ENDMDL .. _CONECT: http://www.wwpdb.org/documentation/format32/sect10.html#CONECT - .. SeeAlso:: - This class is identical to :class:`MultiPDBWriter` with the one - exception that it defaults to writing single-frame PDB files as if - *multiframe* = ``False`` was selected. + See Also + -------- + This class is identical to :class:`MultiPDBWriter` with the one + exception that it defaults to writing single-frame PDB files as if + *multiframe* = ``False`` was selected. .. versionchanged:: 0.7.5 Initial support for multi-frame PDB files. @@ -492,23 +492,24 @@ def __init__(self, filename, bonds="conect", n_atoms=None, start=0, step=1, convert_units=None, multiframe=None): """Create a new PDBWriter - :Arguments: - *filename* - name of output file - *start* - starting timestep - *step* - skip between subsequent timesteps - *remarks* - comments to annotate pdb file (added to the TITLE record); note that - any remarks from the trajectory that serves as input are - written to REMARK records with lines longer than :attr:`remark_max_length` (66 - characters) being wrapped. - *convert_units* - units are converted to the MDAnalysis base format; ``None`` selects - the value of :data:`MDAnalysis.core.flags` ['convert_lengths'] - *bonds* - write bonds to the PDB file as CONECT_ records [``False``] + Parameters + ---------- + filename: str + name of output file + start: int + starting timestep + step: int + skip between subsequent timesteps + remarks: str + comments to annotate pdb file (added to the TITLE record); note + that any remarks from the trajectory that serves as input are + written to REMARK records with lines longer than + :attr:`remark_max_length` (66 characters) being wrapped. + convert_units: bool + units are converted to the MDAnalysis base format; ``None`` selects + the value of :data:`MDAnalysis.core.flags` ['convert_lengths'] + bonds: `None`, "connect", or "all" + write bonds to the PDB file as CONECT_ records .. Note:: @@ -519,10 +520,10 @@ def __init__(self, filename, bonds="conect", n_atoms=None, start=0, step=1, the new PDB file and therefore a :exc:`NotImplementedError` is raised.) - *multiframe* - ``False``: write a single frame to the file; ``True``: create a - multi frame PDB file in which frames are written as MODEL_ ... ENDMDL_ - records. If ``None``, then the class default is chosen. [``None``] + multiframe: bool + ``False``: write a single frame to the file; ``True``: create a + multi frame PDB file in which frames are written as MODEL_ ... ENDMDL_ + records. If ``None``, then the class default is chosen. [``None``] .. _CONECT: http://www.wwpdb.org/documentation/format32/sect10.html#CONECT .. _MODEL: http://www.wwpdb.org/documentation/format32/sect9.html#MODEL @@ -711,10 +712,11 @@ def write(self, obj): used as the PDB chainID (but see :meth:`~PDBWriter.ATOM` for details). - :Arguments: - *obj* - :class:`~MDAnalysis.core.groups.AtomGroup` or - :class:`~MDAnalysis.core.universe.Universe` + Parameters + ---------- + obj + The :class:`~MDAnalysis.core.groups.AtomGroup` or + :class:`~MDAnalysis.core.universe.Universe` to write. """ self._update_frame(obj) @@ -1026,7 +1028,9 @@ class ExtendedPDBReader(PDBReader): insertion code in the PDB standard). PDB files in this format are written by popular programs such as VMD_. - .. SeeAlso:: :class:`PDBReader` + See Also + -------- + :class:`PDBReader` .. _PDB standard: http://www.wwpdb.org/documentation/format32/sect9.html .. _VMD: http://www.ks.uiuc.edu/Research/vmd/ @@ -1054,10 +1058,11 @@ class MultiPDBWriter(PDBWriter): .. _CONECT: http://www.wwpdb.org/documentation/format32/sect10.html#CONECT - .. SeeAlso:: - This class is identical to :class:`PDBWriter` with the one - exception that it defaults to writing multi-frame PDB files instead of - single frames. + See Also + -------- + This class is identical to :class:`PDBWriter` with the one + exception that it defaults to writing multi-frame PDB files instead of + single frames. .. versionadded:: 0.7.6 diff --git a/package/MDAnalysis/coordinates/PQR.py b/package/MDAnalysis/coordinates/PQR.py index 6050f2d97c4..bd664c7d368 100644 --- a/package/MDAnalysis/coordinates/PQR.py +++ b/package/MDAnalysis/coordinates/PQR.py @@ -142,11 +142,14 @@ def _read_first_frame(self): def Writer(self, filename, **kwargs): """Returns a PQRWriter for *filename*. - :Arguments: - *filename* - filename of the output PQR file + Parameters + ---------- + filename: str + filename of the output PQR file - :Returns: :class:`PQRWriter` + Returns + ------- + :class:`PQRWriter` """ return PQRWriter(filename, **kwargs) diff --git a/package/MDAnalysis/coordinates/TRJ.py b/package/MDAnalysis/coordinates/TRJ.py index 973fd723c0e..c74c3c8fbef 100644 --- a/package/MDAnalysis/coordinates/TRJ.py +++ b/package/MDAnalysis/coordinates/TRJ.py @@ -408,7 +408,9 @@ class NCDFReader(base.ReaderBase): .. _AMBER NETCDF format: http://ambermd.org/netcdf/nctraj.html - .. SeeAlso:: :class:`NCDFWriter` + See Also + -------- + :class:`NCDFWriter` .. versionadded: 0.7.6 .. versionchanged:: 0.10.0 @@ -570,18 +572,20 @@ def Writer(self, filename, **kwargs): All values can be changed through keyword arguments. - :Arguments: - *filename* - filename of the output NCDF trajectory - :Keywords: - *n_atoms* - number of atoms - *dt* - length of one timestep in picoseconds - *remarks* - string that is stored in the title field - - :Returns: :class:`NCDFWriter` + Parameters + ---------- + filename: str + filename of the output NCDF trajectory + n_atoms: int + number of atoms + dt: float + length of one timestep in picoseconds + remarks: str + string that is stored in the title field + + Returns + ------- + :class:`NCDFWriter` """ n_atoms = kwargs.pop('n_atoms', self.n_atoms) kwargs.setdefault('remarks', self.remarks) @@ -604,7 +608,9 @@ class NCDFWriter(base.WriterBase): .. _AMBER NETCDF format: http://ambermd.org/netcdf/nctraj.html - .. SeeAlso:: :class:`NCDFReader` + See Also + -------- + :class:`NCDFReader` .. versionadded: 0.7.6 @@ -635,30 +641,29 @@ def __init__(self, **kwargs): """Create a new NCDFWriter - :Arguments: - *filename* + Parameters + ---------- + filename: str name of output file - *n_atoms* + n_atoms: int number of atoms in trajectory file - - :Keywords: - *start* + start: int starting timestep - *step* + step: int skip between subsequent timesteps - *dt* + dt: float timestep - *convert_units* + convert_units: bool ``True``: units are converted to the AMBER base format; ``None`` selects the value of :data:`MDAnalysis.core.flags` ['convert_lengths'] (see :ref:`flags-label`). - *zlib* + zlib: bool compress data [``False``] - *cmplevel* + cmplevel: int compression level (1-9) [1] - *velocities* + velocities: bool Write velocities into the trajectory [``False``] - *forces* + forces: bool Write forces into the trajectory [``False``] """ self.filename = filename diff --git a/package/MDAnalysis/coordinates/TRZ.py b/package/MDAnalysis/coordinates/TRZ.py index 0e6ecb1bd96..a9d71c8798c 100644 --- a/package/MDAnalysis/coordinates/TRZ.py +++ b/package/MDAnalysis/coordinates/TRZ.py @@ -150,12 +150,13 @@ class TRZReader(base.ReaderBase): def __init__(self, trzfilename, n_atoms=None, **kwargs): """Creates a TRZ Reader - :Arguments: - *trzfilename* + Parameters + ---------- + trzfilename: str name of input file - *n_atoms* - number of atoms in trajectory, must taken from topology file! - *convert_units* + n_atoms: int + number of atoms in trajectory, must be taken from topology file! + convert_units: bool converts units to MDAnalysis defaults """ super(TRZReader, self).__init__(trzfilename, **kwargs) @@ -441,20 +442,19 @@ class TRZWriter(base.WriterBase): def __init__(self, filename, n_atoms, title='TRZ', convert_units=None): """Create a TRZWriter - :Arguments: - *filename* - name of output file - *n_atoms* - number of atoms in trajectory - - :Keywords: - *title* - title of the trajectory; the title must be 80 characters or shorter, - a longer title raises a ValueError exception. - *convert_units* - units are converted to the MDAnalysis base format; ``None`` selects - the value of :data:`MDAnalysis.core.flags` ['convert_lengths']. - (see :ref:`flags-label`) + Parameters + ---------- + filename: str + name of output file + n_atoms: int + number of atoms in trajectory + title: str + title of the trajectory; the title must be 80 characters or + shorter, a longer title raises a ValueError exception. + convert_units: bool + units are converted to the MDAnalysis base format; ``None`` selects + the value of :data:`MDAnalysis.core.flags` ['convert_lengths']. + (see :ref:`flags-label`) """ self.filename = filename if n_atoms is None: diff --git a/package/MDAnalysis/coordinates/XYZ.py b/package/MDAnalysis/coordinates/XYZ.py index 33a03ab8ae0..1f39ad2a2f8 100644 --- a/package/MDAnalysis/coordinates/XYZ.py +++ b/package/MDAnalysis/coordinates/XYZ.py @@ -184,10 +184,11 @@ def write(self, obj): to the value of the *atoms* keyword supplied to the :class:`XYZWriter` constructor. - :Arguments: - *obj* - :class:`~MDAnalysis.core.groups.AtomGroup` or - :class:`~MDAnalysis.core.universe.Universe` + Parameters + ---------- + obj: + The :class:`~MDAnalysis.core.groups.AtomGroup` or + :class:`~MDAnalysis.core.universe.Universe` to write. """ # prepare the Timestep and extract atom names if possible # (The way it is written it should be possible to write diff --git a/package/MDAnalysis/coordinates/base.py b/package/MDAnalysis/coordinates/base.py index 813e52e8d1c..a577ddce95b 100644 --- a/package/MDAnalysis/coordinates/base.py +++ b/package/MDAnalysis/coordinates/base.py @@ -710,8 +710,9 @@ def triclinic_dimensions(self): array([ 15. , 15.81138802, 16.58312416, 67.58049774, 72.45159912, 71.56504822], dtype=float32) - .. SeeAlso:: - :func:`MDAnalysis.lib.mdamath.triclinic_vectors` + See Also + -------- + :func:`MDAnalysis.lib.mdamath.triclinic_vectors` .. versionadded:: 0.11.0 """ @@ -1060,7 +1061,9 @@ class ProtoReader(six.with_metaclass(_Readermeta, IOBase)): :mod:`MDAnalysis.coordinates.__init__` for the required attributes and methods. - .. SeeAlso:: :class:`ReaderBase` + See Also + -------- + :class:`ReaderBase` .. versionchanged:: 0.11.0 Frames now 0-based instead of 1-based @@ -1146,7 +1149,9 @@ def OtherWriter(self, filename, **kwargs): Sets the default keywords *start*, *step* and *dt* (if available). *n_atoms* is always set from :attr:`Reader.n_atoms`. - .. SeeAlso:: :meth:`Reader.Writer` and :func:`MDAnalysis.Writer` + See Also + -------- + :meth:`Reader.Writer`, :func:`MDAnalysis.Writer` """ kwargs['n_atoms'] = self.n_atoms # essential kwargs.setdefault('start', self.frame) @@ -1618,7 +1623,9 @@ class ReaderBase(ProtoReader): :mod:`MDAnalysis.coordinates.__init__` for the required attributes and methods. - .. SeeAlso:: :class:`ProtoReader` + See Also + -------- + :class:`ProtoReader` .. versionchanged:: 0.11.0 Most of the base Reader class definitions were offloaded to @@ -1745,12 +1752,16 @@ def has_valid_coordinates(self, criteria, x): min < x <= max - :Arguments: - *criteria* - dictionary containing the *max* and *min* values in native units - *x* - :class:`np.ndarray` of ``(x, y, z)`` coordinates of atoms selected to be written out. - :Returns: boolean + Parameters + ---------- + criteria: dict + dictionary containing the *max* and *min* values in native units + *x* :class:`np.ndarray` of ``(x, y, z)`` coordinates of atoms + selected to be written out. + + Returns + ------- + bool """ x = np.ravel(x) return np.all(criteria["min"] < x) and np.all(x <= criteria["max"]) diff --git a/package/MDAnalysis/coordinates/core.py b/package/MDAnalysis/coordinates/core.py index d50924daa06..cc261b4f8e6 100644 --- a/package/MDAnalysis/coordinates/core.py +++ b/package/MDAnalysis/coordinates/core.py @@ -67,11 +67,17 @@ def reader(filename, **kwargs): ------- A Reader object - .. SeeAlso:: For trajectory formats: :class:`~DCD.DCDReader`, - :class:`~XTC.XTCReader`, :class:`~TRR.TRRReader`, - :class:`~XYZ.XYZReader`. For single frame formats: - :class:`~CRD.CRDReader`, and - :class:`~PDB.PDBReader`, :class:`~GRO.GROReader`, + See Also + -------- + For trajectory formats: + * :class:`~DCD.DCDReader`, + * :class:`~XTC.XTCReader`, + * :class:`~TRR.TRRReader`, + * :class:`~XYZ.XYZReader`. + For single frame formats: + * :class:`~CRD.CRDReader`, + * :class:`~PDB.PDBReader`, + * :class:`~GRO.GROReader`. .. deprecated:: 0.15.0 The "permissive" flag is not used anymore (and effectively diff --git a/package/MDAnalysis/core/__init__.py b/package/MDAnalysis/core/__init__.py index 5c221c67cf6..1a1c15226f9 100644 --- a/package/MDAnalysis/core/__init__.py +++ b/package/MDAnalysis/core/__init__.py @@ -188,16 +188,17 @@ def __init__(self, name, default, mapping=None, doc=None): newflag = Flag(name,default,mapping,doc) - :Arguments: - *name* + Parameters + ---------- + name: str name of the flag, must be a legal python name - *default* + default default value - *mapping* + mapping: dict dict that maps allowed input values to canonical values; if ``None`` then no argument checking will be performed and all values are directly set. - *doc* + doc: str doc string; may contain string interpolation mappings for:: %%(name)s name of the flag diff --git a/package/MDAnalysis/core/groups.py b/package/MDAnalysis/core/groups.py index d3d57539947..79da1509e9e 100644 --- a/package/MDAnalysis/core/groups.py +++ b/package/MDAnalysis/core/groups.py @@ -1477,7 +1477,9 @@ class AtomGroup(GroupBase): AtomGroup instances are always bound to a :class:`MDAnalysis.core.universe.Universe`. They cannot exist in isolation. - .. SeeAlso:: :class:`MDAnalysis.core.universe.Universe` + See Also + -------- + :class:`MDAnalysis.core.universe.Universe` """ def __getitem__(self, item): diff --git a/package/MDAnalysis/core/selection.py b/package/MDAnalysis/core/selection.py index 3f049693462..c142e0d5519 100644 --- a/package/MDAnalysis/core/selection.py +++ b/package/MDAnalysis/core/selection.py @@ -821,7 +821,9 @@ class ProteinSelection(Selection): * still missing: Amber N- and C-terminal residue names - .. SeeAlso:: :func:`MDAnalysis.lib.util.convert_aa_code` + See Also + -------- + :func:`MDAnalysis.lib.util.convert_aa_code` """ token = 'protein' diff --git a/package/MDAnalysis/core/universe.py b/package/MDAnalysis/core/universe.py index eaf13aee934..fabf25b50cc 100644 --- a/package/MDAnalysis/core/universe.py +++ b/package/MDAnalysis/core/universe.py @@ -848,7 +848,9 @@ def as_Universe(*args, **kwargs): as_Universe(PSF, DCD, **kwargs) --> Universe(PSF, DCD, **kwargs) as_Universe(*args, **kwargs) --> Universe(*args, **kwargs) - :Returns: an instance of :class:`~MDAnalysis.core.groups.Universe` + Returns + ------- + :class:`~MDAnalysis.core.groups.Universe` """ if len(args) == 0: raise TypeError("as_Universe() takes at least one argument (%d given)" % len(args)) @@ -870,9 +872,12 @@ def Merge(*args): ------- universe : :class:`Universe` - :Raises: :exc:`ValueError` for too few arguments or if an AtomGroup is - empty and :exc:`TypeError` if arguments are not - :class:`AtomGroup` instances. + Raises + ------ + ValueError + Too few arguments or an AtomGroup is empty and + TypeError + Arguments are not :class:`AtomGroup` instances. Notes ----- diff --git a/package/MDAnalysis/lib/mdamath.py b/package/MDAnalysis/lib/mdamath.py index 329956ba24e..cc5d68765d2 100644 --- a/package/MDAnalysis/lib/mdamath.py +++ b/package/MDAnalysis/lib/mdamath.py @@ -163,7 +163,9 @@ def triclinic_box(x, y, z): * beta = angle(x,z) * gamma = angle(x,y) - .. SeeAlso:: Definition of angles: http://en.wikipedia.org/wiki/Lattice_constant + See Also + -------- + Definition of angles: http://en.wikipedia.org/wiki/Lattice_constant """ A, B, C = [norm(v) for v in (x, y, z)] alpha = _angle(y, z) @@ -183,13 +185,17 @@ def triclinic_vectors(dimensions): .. _code by Tsjerk Wassenaar: http://www.mail-archive.com/gmx-users@gromacs.org/msg28032.html - :Arguments: - *dimensions* + Parameters + ---------- + dimensions: list of floats list of box lengths and angles (in degrees) such as [A,B,C,alpha,beta,gamma] - :Returns: numpy 3x3 array B, with B[0] = first box vector, - B[1] = second vector, B[2] third box vector. + Returns + ------- + numpy.array + numpy 3x3 array B, with B[0] = first box vector, + B[1] = second vector, B[2] third box vector. .. note:: @@ -228,13 +234,17 @@ def box_volume(dimensions): The volume is computed as `det(x1,x2,x2)` where the xi are the triclinic box vectors from :func:`triclinic_vectors`. - :Arguments: - *dimensions* - list of box lengths and angles (in degrees) such as - [A,B,C,alpha,beta,gamma] + Parameters + ---------- + dimensions: list of floats + list of box lengths and angles (in degrees) such as + [A,B,C,alpha,beta,gamma] - :Returns: numpy 3x3 array B, with B[0] = first box vector, - B[1] = second vector, B[2] third box vector. + Returns + ------- + numpy.array + numpy 3x3 array B, with B[0] = first box vector, + B[1] = second vector, B[2] third box vector. """ return np.linalg.det(triclinic_vectors(dimensions)) @@ -242,10 +252,12 @@ def box_volume(dimensions): def _is_contiguous(atomgroup, atom): """Walk through atomgroup, starting with atom. - :Returns: - ``True`` if all of *atomgroup* is accessible through walking + Returns + ------- + bool + ``True`` if all of *atomgroup* is accessible through walking along bonds. - ``False`` otherwise. + ``False`` otherwise. """ seen = set([atom]) walked = set() @@ -270,29 +282,28 @@ def _is_contiguous(atomgroup, atom): def make_whole(atomgroup, reference_atom=None): """Move all atoms in a single molecule so that bonds don't split over images - :Arguments: - *atomgroup* + Atoms are modified in place. + + Parameters + ---------- + atomgroup The :class:`MDAnalysis.core.groups.AtomGroup` to work with. The positions of this are modified in place. All these atoms must belong in the same molecule or fragment. - - :Keywords: - *reference_atom* + reference_atom: :class:`~MDAnalysis.core.groups.Atom` The atom around which all other atoms will be moved. Defaults to atom 0 in the atomgroup. - :Returns: - ``None``. Atom positions are modified in place - - :Raises: - `NoDataError` - if there are no bonds present. - (See :func:`~MDAnalysis.topology.core.guess_bonds`) + Raises + ------ + NoDataError + There are no bonds present. + (See :func:`~MDAnalysis.topology.core.guess_bonds`) - `ValueError` - if the algorithm fails to work. This is usually - caused by the atomgroup not being a single fragment. - (ie the molecule can't be traversed by following bonds) + ValueError + The algorithm fails to work. This is usually + caused by the atomgroup not being a single fragment. + (ie the molecule can't be traversed by following bonds) This function is most useful when atoms have been packed into the primary unit cell, causing breaks mid molecule, with the molecule then appearing @@ -309,25 +320,26 @@ def make_whole(atomgroup, reference_atom=None): | | | | +-----------+ +-----------+ - Usage:: + Example + ------- - from MDAnalysis.util.mdamath import make_whole + from MDAnalysis.util.mdamath import make_whole - # This algorithm requires bonds, these can be guessed! - u = mda.Universe(......, guess_bonds=True) + # This algorithm requires bonds, these can be guessed! + u = mda.Universe(......, guess_bonds=True) - # MDAnalysis can split molecules into their fragments - # based on bonding information. - # Note that this function will only handle a single fragment - # at a time, necessitating a loop. - for frag in u.fragments: + # MDAnalysis can split molecules into their fragments + # based on bonding information. + # Note that this function will only handle a single fragment + # at a time, necessitating a loop. + for frag in u.fragments: make_whole(frag) Alternatively, to keep a single atom in place as the anchor:: - # This will mean that atomgroup[10] will NOT get moved, - # and all other atoms will move (if necessary). - make_whole(atomgroup, reference_atom=atomgroup[10]) + # This will mean that atomgroup[10] will NOT get moved, + # and all other atoms will move (if necessary). + make_whole(atomgroup, reference_atom=atomgroup[10]) .. Note:: diff --git a/package/MDAnalysis/lib/qcprot.pyx b/package/MDAnalysis/lib/qcprot.pyx index 885cb3c5365..282111469e1 100644 --- a/package/MDAnalysis/lib/qcprot.pyx +++ b/package/MDAnalysis/lib/qcprot.pyx @@ -93,9 +93,10 @@ matrix [Liu2010]_. A full description of the method, along with the original C implementation can be found at http://theobald.brandeis.edu/qcp/ -.. SeeAlso:: The :func:`CalcRMSDRotationalMatrix` function is used in - :mod:`MDAnalysis.analysis.align` and - :mod:`MDAnalysis.analysis.rmsd`. +See Also +-------- +The :func:`CalcRMSDRotationalMatrix` function is used in +:mod:`MDAnalysis.analysis.align` and :mod:`MDAnalysis.analysis.rmsd`. .. versionchanged:: 0.16.0 Call signatures were changed to directly interface with MDAnalysis diff --git a/package/MDAnalysis/lib/util.py b/package/MDAnalysis/lib/util.py index 4b80a15ec60..cc4285bd931 100644 --- a/package/MDAnalysis/lib/util.py +++ b/package/MDAnalysis/lib/util.py @@ -193,16 +193,17 @@ def callable(obj): def filename(name, ext=None, keep=False): """Return a new name that has suffix attached; replaces other extensions. - :Arguments: - *name* - filename; extension is replaced unless keep=True; - *name* can also be a :class:`NamedStream` (and its - :attr:`NamedStream.name` will be changed accordingly) - *ext* - extension - *keep* - - ``False``: replace existing extension with *ext*; - - ``True``: keep old extension if one existed + Parameters + ---------- + name: str or :class:`NamedStream` + filename; extension is replaced unless keep=True; + *name* can also be a :class:`NamedStream` (and its + :attr:`NamedStream.name` will be changed accordingly) + ext: None or str + extension to use in the new filename + keep: bool + - ``False``: replace existing extension with *ext*; + - ``True``: keep old extension if one existed .. versionchanged:: 0.9.0 Also permits :class:`NamedStream` to pass through. @@ -236,15 +237,17 @@ def openany(datasource, mode='r', reset=True): compressed files) to open file objects to sockets and strings---as long as they have a file-like interface. - :Arguments: - *datasource* + Parameters + ---------- + datasource: a file or a stream - *mode* + mode: str 'r' or 'w' - *reset* + reset: bool try to read (*mode* 'r') the stream from the start [``True``] - .. rubric:: Examples + Examples + -------- Open a gzipped file and process it line by line:: @@ -258,7 +261,9 @@ def openany(datasource, mode='r', reset=True): with openany(urllib2.urlopen("http://www.MDAnalysis.org/")) as html: print(html.read()) - .. SeeAlso:: :func:`anyopen` + See Also + -------- + :func:`anyopen` """ stream = anyopen(datasource, mode=mode, reset=reset) try: @@ -296,19 +301,24 @@ def anyopen(datasource, mode='r', reset=True): If possible, the attribute ``stream.name`` is set to the filename or "" if no filename could be associated with the *datasource*. - :Arguments: - *datasource* + Parameters + ---------- + datasource a file (from :class:`file` or :func:`open`) or a stream (e.g. from :func:`urllib2.urlopen` or :class:`cStringIO.StringIO`) - *mode* - 'r' or 'w' or 'a', more complicated modes ('r+', 'w+' are not supported because - only the first letter is looked at) [``'r'``] - *reset* - try to read (*mode* 'r') the stream from the start [``True``] + mode: str + 'r' or 'w' or 'a', more complicated modes ('r+', 'w+' are not supported + because only the first letter is looked at) + reset: bool + try to read (*mode* 'r') the stream from the start - :Returns: tuple ``stream`` which is a file-like object + Returns + ------- + file-like object - .. SeeAlso:: :func:`openany` to be used with the :keyword:`with` statement. + See Also + -------- + :func:`openany`: to be used with the :keyword:`with` statement. .. versionchanged:: 0.9.0 Only returns the ``stream`` and tries to set ``stream.name = filename`` instead of the previous @@ -446,13 +456,18 @@ def isstream(obj): - ``read()``, ``readline()``, ``readlines()`` - ``write()``, ``writeline()``, ``writelines()`` - .. SeeAlso:: :mod:`io` + See Also + -------- + :mod:`io` - :Arguments: - *obj* - stream or string + Parameters + ---------- + obj: stream or string - :Returns: ``True`` is *obj* is a stream, ``False`` otherwise + Returns + ------- + bool + ``True`` is *obj* is a stream, ``False`` otherwise .. versionadded:: 0.9.0 """ @@ -675,7 +690,10 @@ def seek(self, offset, whence=os.SEEK_SET): - :data:`io.SEEK_END` or 2 – end of the stream; *offset* is usually negative - :Returns: the new absolute position. + Returns + ------- + int + the new absolute position. """ try: return self.stream.seek(offset, whence) # file.seek: no kw @@ -806,7 +824,10 @@ def realpath(*args): def get_ext(filename): """Return the lower-cased extension of *filename* without a leading dot. - :Returns: root, ext + Returns + ------- + root: str + ext: str """ root, ext = os.path.splitext(filename) if ext.startswith(os.extsep): @@ -850,8 +871,9 @@ def guess_format(filename): *filename* can also be a stream, in which case *filename.name* is looked at for a hint to the format - :Raises: - *ValueError* + Raises + ------ + ValueError .. versionadded:: 0.11.0 Moved into lib.util @@ -919,12 +941,13 @@ class FixedcolumnEntry(object): def __init__(self, start, stop, typespecifier): """ - :Arguments: - *start* + Parameters + ---------- + start: int first column - *stop* + stop: int last column + 1 - *typespecifier* + typespecifier: str 'I': int, 'F': float, 'E': float, 'A': stripped string The start/stop arguments follow standard Python convention in that @@ -994,11 +1017,19 @@ def read(self, line): Values are converted to Python types according to the format specifier. - :Returns: list of entries with appropriate types - :Raises: :exc:`ValueError` if any of the conversions cannot be made - (e.g. space for an int) + Returns + ------- + list + list of entries with appropriate types + + Raises + ------ + ValueError + Any of the conversions cannot be made (e.g. space for an int) - .. SeeAlso:: :meth:`FORTRANReader.number_of_matches` + See Also + -------- + :meth:`FORTRANReader.number_of_matches` """ return [e.read(line) for e in self.entries] @@ -1019,10 +1050,15 @@ def parse_FORTRAN_format(self, edit_descriptor): parse_FORTRAN_format(edit_descriptor) --> dict - :Returns: dict with totallength (in chars), repeat, length, - format, decimals - :Raises: :exc:`ValueError` if the *edit_descriptor* is not recognized - and cannot be parsed + Returns + ------- + dict + dict with totallength (in chars), repeat, length, format, decimals + + Raises + ------ + ValueError + The *edit_descriptor* is not recognized and cannot be parsed .. Note:: @@ -1116,7 +1152,9 @@ def fixedwidth_bins(delta, xmin, xmax): def convert_aa_code(x): """Converts between 3-letter and 1-letter amino acid codes. - .. SeeAlso:: Data are defined in :data:`amino_acid_codes` and :data:`inverse_aa_codes`. + See Also + -------- + Data are defined in :data:`amino_acid_codes` and :data:`inverse_aa_codes`. """ if len(x) == 1: d = amino_acid_codes @@ -1157,14 +1195,20 @@ def parse_residue(residue): - "4GB300:H6O" --> ("4GB", 300, "H6O") - "4GB300" --> ("4GB", 300, None) - :Argument: The *residue* must contain a 1-letter or 3-letter or - 4-letter residue string, a number (the resid) and - optionally an atom identifier, which must be separate - from the residue with a colon (":"). White space is - allowed in between. + Parameters + ---------- + residue: str + The *residue* must contain a 1-letter or 3-letter or + 4-letter residue string, a number (the resid) and + optionally an atom identifier, which must be separate + from the residue with a colon (":"). White space is + allowed in between. - :Returns: `(3-letter aa string, resid, atomname)`; known 1-letter - aa codes are converted to 3-letter codes + Returns + ------- + tuple + `(3-letter aa string, resid, atomname)`; known 1-letter + aa codes are converted to 3-letter codes """ # XXX: use _translate_residue() .... diff --git a/package/MDAnalysis/topology/ExtendedPDBParser.py b/package/MDAnalysis/topology/ExtendedPDBParser.py index 96490833c2e..33951184c01 100644 --- a/package/MDAnalysis/topology/ExtendedPDBParser.py +++ b/package/MDAnalysis/topology/ExtendedPDBParser.py @@ -37,11 +37,11 @@ least 100,000 residues then you need to use a different file format that can handle such residue numbers. -.. SeeAlso:: - - * :mod:`MDAnalysis.topology.PDBParser` - * :class:`MDAnalysis.coordinates.PDB.ExtendedPDBReader` - * :class:`MDAnalysis.core.universe.Universe` +See Also +-------- +* :mod:`MDAnalysis.topology.PDBParser` +* :class:`MDAnalysis.coordinates.PDB.ExtendedPDBReader` +* :class:`MDAnalysis.core.universe.Universe` Classes ------- @@ -74,7 +74,9 @@ class ExtendedPDBParser(PDBParser.PDBParser): - resnames - segids - .. SeeAlso:: :class:`MDAnalysis.coordinates.PDB.ExtendedPDBReader` + See Also + -------- + :class:`MDAnalysis.coordinates.PDB.ExtendedPDBReader` .. versionadded:: 0.8 """ diff --git a/package/MDAnalysis/topology/GROParser.py b/package/MDAnalysis/topology/GROParser.py index eac0cd29e7b..b0f6c9b65ad 100644 --- a/package/MDAnalysis/topology/GROParser.py +++ b/package/MDAnalysis/topology/GROParser.py @@ -29,7 +29,9 @@ Atom types and masses are guessed. -.. SeeAlso:: :mod:`MDAnalysis.coordinates.GRO` +See Also +-------- +:mod:`MDAnalysis.coordinates.GRO` Classes ------- diff --git a/package/MDAnalysis/topology/PDBParser.py b/package/MDAnalysis/topology/PDBParser.py index 7878b42f548..042652f78df 100644 --- a/package/MDAnalysis/topology/PDBParser.py +++ b/package/MDAnalysis/topology/PDBParser.py @@ -40,11 +40,11 @@ The parser processes atoms and their names. Masses are guessed and set to 0 if unknown. Partial charges are not set. -.. SeeAlso:: - - * :mod:`MDAnalysis.topology.ExtendedPDBParser` - * :class:`MDAnalysis.coordinates.PDB.PDBReader` - * :class:`MDAnalysis.core.universe.Universe` +See Also +-------- +* :mod:`MDAnalysis.topology.ExtendedPDBParser` +* :class:`MDAnalysis.coordinates.PDB.PDBReader` +* :class:`MDAnalysis.core.universe.Universe` Classes ------- diff --git a/package/MDAnalysis/topology/PDBQTParser.py b/package/MDAnalysis/topology/PDBQTParser.py index d1438a91721..13d861e11cb 100644 --- a/package/MDAnalysis/topology/PDBQTParser.py +++ b/package/MDAnalysis/topology/PDBQTParser.py @@ -34,7 +34,9 @@ .. Note:: Only reads atoms and their names; connectivity is not deduced. Masses are guessed and set to 0 if unknown. -.. SeeAlso:: `MDAnalysis.coordinates.PDBQT` +See Also +-------- +`MDAnalysis.coordinates.PDBQT` .. _PDBQT: http://autodock.scripps.edu/faqs-help/faq/what-is-the-format-of-a-pdbqt-file diff --git a/package/MDAnalysis/topology/PQRParser.py b/package/MDAnalysis/topology/PQRParser.py index 1828a00b9c8..222db5136dd 100644 --- a/package/MDAnalysis/topology/PQRParser.py +++ b/package/MDAnalysis/topology/PQRParser.py @@ -27,7 +27,9 @@ Read atoms with charges from a PQR_ file (as written by PDB2PQR_). No connectivity is deduced. -.. SeeAlso:: The file format is described in :mod:`MDAnalysis.coordinates.PQR`. +See Also +-------- +The file format is described in :mod:`MDAnalysis.coordinates.PQR`. .. _PQR: http://www.poissonboltzmann.org/file-formats/biomolecular-structurw/pqr .. _APBS: http://www.poissonboltzmann.org/apbs diff --git a/package/MDAnalysis/topology/PrimitivePDBParser.py b/package/MDAnalysis/topology/PrimitivePDBParser.py index 278c02308e0..725ea4e8d7f 100644 --- a/package/MDAnalysis/topology/PrimitivePDBParser.py +++ b/package/MDAnalysis/topology/PrimitivePDBParser.py @@ -34,11 +34,11 @@ :mod:`~MDAnalysis.topology.ExtendedPDBParser`) that can handle residue numbers up to 99,999. -.. SeeAlso:: - - * :mod:`MDAnalysis.topology.ExtendedPDBParser` - * :class:`MDAnalysis.coordinates.PDB.PDBReader` - * :class:`MDAnalysis.core.universe.Universe` +See Also +-------- +* :mod:`MDAnalysis.topology.ExtendedPDBParser` +* :class:`MDAnalysis.coordinates.PDB.PDBReader` +* :class:`MDAnalysis.core.universe.Universe` Classes ------- diff --git a/package/MDAnalysis/topology/TPRParser.py b/package/MDAnalysis/topology/TPRParser.py index f2eae75326e..5e295c41097 100644 --- a/package/MDAnalysis/topology/TPRParser.py +++ b/package/MDAnalysis/topology/TPRParser.py @@ -92,7 +92,9 @@ :members: :inherited-members: -.. SeeAlso:: :mod:`MDAnalysis.topology.tpr` +See Also +-------- +:mod:`MDAnalysis.topology.tpr` Development notes ----------------- diff --git a/package/MDAnalysis/topology/__init__.py b/package/MDAnalysis/topology/__init__.py index bd3fce295d8..1b582f06f6b 100644 --- a/package/MDAnalysis/topology/__init__.py +++ b/package/MDAnalysis/topology/__init__.py @@ -156,7 +156,9 @@ parsing coordinates from a TPR file is currently not implemented in :mod:`~MDAnalysis.topology.TPRParser`. -.. SeeAlso:: :ref:`Coordinates` with the :ref:`Supported coordinate formats` +See Also +-------- +:ref:`Coordinates` with the :ref:`Supported coordinate formats` .. _HOOMD XML: http://codeblue.umich.edu/hoomd-blue/doc/page_xml_file_format.html .. _Macromolecular Transmission Format (MMTF): https://mmtf.rcsb.org/ diff --git a/package/MDAnalysis/topology/core.py b/package/MDAnalysis/topology/core.py index 4bb80397182..a1590851025 100644 --- a/package/MDAnalysis/topology/core.py +++ b/package/MDAnalysis/topology/core.py @@ -26,9 +26,11 @@ The various topology parsers make use of functions and classes in this module. They are mostly of use to developers. -.. SeeAlso:: :mod:`MDAnalysis.topology.tables` for some hard-coded atom - information that is used by functions such as :func:`guess_atom_type` and - :func:`guess_atom_mass`. +See Also +-------- +:mod:`MDAnalysis.topology.tables` for some hard-coded atom +information that is used by functions such as :func:`guess_atom_type` and +:func:`guess_atom_mass`. """ diff --git a/package/MDAnalysis/topology/guessers.py b/package/MDAnalysis/topology/guessers.py index db2353bc064..1bb06a7fb6b 100644 --- a/package/MDAnalysis/topology/guessers.py +++ b/package/MDAnalysis/topology/guessers.py @@ -79,8 +79,9 @@ def guess_atom_type(atomname): At the moment, this function simply returns the element, as guessed by :func:`guess_atom_element`. - .. SeeAlso:: :func:`guess_atom_element` and - :mod:`MDAnalysis.topology.tables` + See Also + -------- + :func:`guess_atom_element`, :mod:`MDAnalysis.topology.tables` """ return guess_atom_element(atomname) @@ -96,8 +97,10 @@ def guess_atom_element(atomname): .. Warning: The translation table is incomplete. This will probably result in some mistakes, but it still better than nothing! - .. SeeAlso:: :func:`guess_atom_type` and - :mod:`MDAnalysis.topology.tables` (where the data are stored) + See Also + -------- + :func:`guess_atom_type` and :mod:`MDAnalysis.topology.tables` (where the + data are stored) """ if atomname == '': return '' @@ -240,11 +243,15 @@ def guess_angles(bonds): Works by assuming that if atoms 1 & 2 are bonded, and 2 & 3 are bonded, then (1,2,3) must be an angle. - :Returns: - List of tuples defining the angles. - Suitable for use in u._topology + Returns + ------- + list of tupples + List of tuples defining the angles. + Suitable for use in u._topology - .. seeAlso:: :meth:`guess_bonds` + See Also + -------- + :meth:`guess_bonds` .. versionadded 0.9.0 """ @@ -270,9 +277,11 @@ def guess_dihedrals(angles): Works by assuming that if (1,2,3) is an angle, and 3 & 4 are bonded, then (1,2,3,4) must be a dihedral. - :Returns: - List of tuples defining the dihedrals. - Suitable for use in u._topology + Returns + ------- + list of tuples + List of tuples defining the dihedrals. + Suitable for use in u._topology .. versionadded 0.9.0 """ @@ -304,9 +313,10 @@ def guess_improper_dihedrals(angles): ie the improper dihedral is the angle between the planes formed by (1, 2, 3) and (1, 3, 4) - :Returns: - List of tuples defining the improper dihedrals. - Suitable for use in u._topology + Returns + ------- + List of tuples defining the improper dihedrals. + Suitable for use in u._topology .. versionadded 0.9.0 """ diff --git a/package/MDAnalysis/units.py b/package/MDAnalysis/units.py index 0e01c1b181e..34dff82a7cd 100644 --- a/package/MDAnalysis/units.py +++ b/package/MDAnalysis/units.py @@ -112,7 +112,9 @@ from `rho/rho0 = n/(N_A * M**-1) / rho0` where `[n] = 1/Volume`, `[rho] = mass/Volume` -.. SeeAlso:: Maybe we should simply use Quantities_ or :mod:`scipy.constants`? +See Also +-------- +Maybe we should simply use Quantities_ or :mod:`scipy.constants`? .. _Quantities: http://packages.python.org/quantities/ @@ -344,11 +346,16 @@ def get_conversion_factor(unit_type, u1, u2): def convert(x, u1, u2): """Convert value *x* in unit *u1* to new value in *u2*. - :Returns: Converted value. + Returns + ------- + float + Converted value. - :Raises: :Exc:`ValueError` if the units are not known or if - one attempts to convert between incompatible - units. + Raises + ------ + ValueError + The units are not known or if one attempts to convert between + incompatible units. """ try: ut1 = unit_types[u1]