Skip to content

Commit

Permalink
updates to fix doc fail
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-kamath committed Feb 26, 2021
1 parent 5a2b371 commit 10db351
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions package/MDAnalysis/analysis/density.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 10db351

Please sign in to comment.