From 10db3515885313885c44d6656f6b914722d5184e Mon Sep 17 00:00:00 2001 From: Aditya Kamath Date: Thu, 25 Feb 2021 20:27:35 -0500 Subject: [PATCH] updates to fix doc fail --- package/MDAnalysis/analysis/density.py | 29 +++++++++++--------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/package/MDAnalysis/analysis/density.py b/package/MDAnalysis/analysis/density.py index 17e152257eb..41de7476c29 100644 --- a/package/MDAnalysis/analysis/density.py +++ b/package/MDAnalysis/analysis/density.py @@ -107,7 +107,7 @@ After the analysis (see the :meth:`~DensityAnalysis.run` method), the resulting density is stored in the :attr:`density` attribute as a :class:`Density` instance. - .. automethod:: _prepare, _set_user_grid + .. automethod:: _set_user_grid Density object @@ -217,6 +217,14 @@ class DensityAnalysis(AnalysisBase): A :class:`Density` instance containing a physical density of units :math:`Angstrom^{-3}`. + Raises + ------ + ValueError + if AtomGroup is empty and no user defined grid is provided + UserWarning + if AtomGroup is empty and a user defined grid is provided + + See Also -------- pmda.density.DensityAnalysis for a parallel version @@ -231,7 +239,7 @@ class DensityAnalysis(AnalysisBase): :class:`DensityAnalysis` will fail when the :class:`AtomGroup` instance does not contain any selection of atoms, even when `updating` is set to - True. In such a situation, user defined box limits can be provided to + ``True``. In such a situation, user defined box limits can be provided to generate a `Density`. Although, it remains the user's responsibility to ensure that the provided grid limits encompass atoms to be selected on all trajectory frames. @@ -391,19 +399,6 @@ def __init__(self, atomgroup, delta=1.0, self._zdim = zdim def _prepare(self): - r"""Function to prepare Density - - Raises - ------ - ValueError - if AtomGroup is empty and no user defined grid is provided - UserWarning - if AtomGroup is empty and a user defined grid is provided - - .. versionadded:: 1.0.0 - .. versionchanged:: 2.0.0 - Now a method of :class:`DensityAnalysis`. - """ coord = self._atomgroup.positions if self._gridcenter is not None: # Issue 2372: padding is ignored, defaults to 2.0 therefore warn @@ -424,8 +419,8 @@ def _prepare(self): "positions you wish to capture.") warnings.warn(msg) logger.warning(msg) - smin = self._gridcenter - smax = self._gridcenter + smin = self._gridcenter #assigns limits to be later - + smax = self._gridcenter #overwritten by _set_user_grid # Overwrite smin/smax with user defined values smin, smax = self._set_user_grid(self._gridcenter, self._xdim, self._ydim, self._zdim, smin,