Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SurvivalProbabilty Docs #4248

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The rules for this file:
* release numbers follow "Semantic Versioning" http://semver.org

------------------------------------------------------------------------------
??/??/?? IAlibay, hmacdope, pillose
??/??/?? IAlibay, hmacdope, pillose, jaclark5

* 2.7.0

Expand All @@ -23,6 +23,8 @@ Fixes
Enhancements

Changes
* Update documentation for SurvivalProbabilty to be more clear
(Issue #4247)
* Cython DEF statments have been replaced with compile time integer constants
as DEF is deprecated as of Cython>=3.0 (Issue #4237, PR #4246)

Expand Down
19 changes: 12 additions & 7 deletions package/MDAnalysis/analysis/waterdynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,15 +885,17 @@ def run(self, **kwargs):

class SurvivalProbability(object):
r"""
Survival Probability (SP) gives the probability for a group of particles to remain in a certain region.
The SP is given by:
Survival Probability (SP) gives the probability for a group of particles to remain
in a certain region. The SP is given by:

.. math::
P(\tau) = \frac1T \sum_{t=1}^T \frac{N(t,t+\tau)}{N(t)}
P(\tau) = \langle \frac{ N(t, t + \tau )} { N(t) }\rangle

where :math:`T` is the maximum time of simulation, :math:`\tau` is the
timestep, :math:`N(t)` the number of particles at time :math:`t`, and
:math:`N(t, t+\tau)` is the number of particles at every frame from :math:`t` to `\tau`.
where :math:`\tau` is the timestep, :math:`N(t)` the number of particles at time
:math:`t`, and :math:`N(t, t+\tau)` is the number of particles at every frame from
:math:`t` to :math:`t + \tau`. The angular brackets represent an average over all time
origins, :math:`t`. See :func:`MDAnalysis.lib.correlations.autocorrelation` for
technical details.


Parameters
Expand All @@ -902,7 +904,8 @@ class SurvivalProbability(object):
Universe object
select : str
Selection string; any selection is allowed. With this selection you
define the region/zone where to analyze, e.g.: "resname SOL and around 5 (resid 10)". See `SP-examples`_.
define the region/zone where to analyze, e.g.: "resname SOL and around 5
(resid 10)". See `SP-examples`_.
verbose : Boolean, optional
When True, prints progress and comments to the console.

Expand All @@ -928,6 +931,8 @@ class SurvivalProbability(object):
The `stop` keyword as passed to :meth:`SurvivalProbability.run` has now
changed behaviour and will act in an `exclusive` manner (instead of it's
previous `inclusive` behaviour),
.. versionchanged:: 2.7.0
Updated docs to align with discrete autocorrelation function.
hmacdope marked this conversation as resolved.
Show resolved Hide resolved
"""

def __init__(self, universe, select, verbose=False):
Expand Down