Skip to content

Commit

Permalink
hbon analysis: doc fixes
Browse files Browse the repository at this point in the history
Apparently, napoleon does not like a single Notes and See Also section, need to
use reST.

Also named the 1-based indices "idx" in the docs.
  • Loading branch information
orbeckst committed May 10, 2017
1 parent f158420 commit 28dc1dd
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions package/MDAnalysis/analysis/hbonds/hbond_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
results = [
[ # frame 1
[ # hbond 1
<donor index (1-based)>, <acceptor index (1-based)>, <donor index (0-based)>,
<donor idx (1-based)>, <acceptor idx (1-based)>, <donor index (0-based)>,
<acceptor index (0-based)>, <donor string>, <acceptor string>,
<distance>, <angle>
],
[ # hbond 2
<donor index (1-based)>, <acceptor index (1-based)>, <donor index (0-based)>,
<donor idx (1-based)>, <acceptor idx (1-based)>, <donor index (0-based)>,
<acceptor index (0-based)>, <donor string>, <acceptor string>,
<distance>, <angle>
],
Expand Down Expand Up @@ -286,7 +286,7 @@ class HydrogenBondAnalysis_OtherFF(HydrogenBondAnalysis):
.. Note::
The *index* is a 1-based index. To get the :attr:`Atom.index` (the
Each index variable named *idx* is a 1-based index. To get the :attr:`Atom.index` (the
0-based index typically used in MDAnalysis simply subtract 1. For
instance, to find an atom in :attr:`Universe.atoms` by *index* one
would use ``u.atoms[idx_zero]``. The 1-based index is deprecated and
Expand Down Expand Up @@ -1001,12 +1001,12 @@ def timeseries(self):
results = [
[ # frame 1
[ # hbond 1
<donor index (1-based)>, <acceptor index (1-based)>, <donor index (0-based)>,
<donor idx (1-based)>, <acceptor idx (1-based)>, <donor index (0-based)>,
<acceptor index (0-based)>, <donor string>, <acceptor string>,
<distance>, <angle>
],
[ # hbond 2
<donor index (1-based)>, <acceptor index (1-based)>, <donor index (0-based)>,
<donor idx (1-based)>, <acceptor idx (1-based)>, <donor index (0-based)>,
<acceptor index (0-based)>, <donor string>, <acceptor string>,
<distance>, <angle>
],
Expand All @@ -1022,25 +1022,24 @@ def timeseries(self):
:attr:`~HydrogenBondAnalysis.timesteps`.
Note
----
The *index* is a 1-based index. To get the :attr:`Atom.index` (the
0-based index typically used in MDAnalysis simply subtract 1. For
instance, to find an atom in :attr:`Universe.atoms` by *index* one
would use ``u.atoms[index-1]``.
.. note::
Each index variable named *idx* is a 1-based index. To get the :attr:`Atom.index` (the
0-based index typically used in MDAnalysis simply subtract 1. For
instance, to find an atom in :attr:`Universe.atoms` by *index* one
would use ``u.atoms[index-1]``.
The :attr:`timeseries` is a managed attribute and it is generated from
the underlying data in :attr:`_timeseries` every time the attribute is
accessed. It is therefore costly to call and if :attr:`timeseries` is
needed repeatedly it is recommended that you assign to a variable::
The :attr:`timeseries` is a managed attribute and it is generated
from the underlying data in :attr:`_timeseries` every time the
attribute is accessed. It is therefore costly to call and if
:attr:`timeseries` is needed repeatedly it is recommended that you
assign to a variable::
h = HydrogenBondAnalysis(u)
h.run()
timeseries = h.timeseries
h = HydrogenBondAnalysis(u)
h.run()
timeseries = h.timeseries
See Also
--------
HydrogenBondAnalysis.table : structured array of the data
.. SeeAlso::
:attr:`table` : structured array of the data
.. versionchanged:: 0.16.1
Expand Down

0 comments on commit 28dc1dd

Please sign in to comment.