Skip to content

Commit

Permalink
Fix VACF docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xhgchen committed Aug 25, 2023
1 parent 19cd76b commit b478c4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/source/api/velocityautocorr.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VelocityAutocorr
================
Velocity Autocorrelation Function
=================================

.. automodule:: transport_analysis.velocityautocorr
:members:
17 changes: 11 additions & 6 deletions transport_analysis/velocityautocorr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
VelocityAutocorr --- :mod:`transport_analysis.analysis.VelocityAutocorr`
========================================================================
Velocity Autocorrelation Function --- :mod:`transport_analysis.velocityautocorr`
================================================================================
This module offers a class to efficiently calculate a velocity
autocorrelation function (VACF). Averaging over all atoms in the atom group
Expand All @@ -20,7 +20,11 @@
:data:`~MDAnalysis.tests.datafiles.TRJ_NCBOX` from the MDAnalysis test suite.
To get started, execute ::
>>> import transport_analysis as ta
# imports
>>> import MDAnalysis as mda
>>> from transport_analysis.velocityautocorr import VelocityAutocorr
# test data for this example
>>> from MDAnalysis.tests.datafiles import PRM_NCBOX, TRJ_NCBOX
We will calculate the VACF of an atom group of all water atoms in
Expand All @@ -32,10 +36,11 @@
We can run the calculation using any variable of choice such as
``wat_vacf`` and access our results using ``wat_vacf.results.timeseries``:
>>> wat_vacf = ta.VelocityAutocorr(ag).run()
>>> wat_vacf = VelocityAutocorr(ag).run()
>>> wat_vacf.results.timeseries
[275.62075467 -18.42008255 -23.94383428 41.41415381 -2.3164344
-35.66393559 -22.66874897 -3.97575003 6.57888933 -5.29065096]
array([275.62075467, -18.42008255, -23.94383428, 41.41415381,
-2.3164344 , -35.66393559, -22.66874897, -3.97575003,
6.57888933, -5.29065096])
Notice that this example data is insufficient to provide a well-defined VACF.
When working with real data, ensure that the frames are captured frequently
Expand Down

0 comments on commit b478c4b

Please sign in to comment.