Skip to content
This repository was archived by the owner on Jan 31, 2024. It is now read-only.

Commit 34e5ba0

Browse files
Try to tweak docstring format for nicer HTML
1 parent a84c55c commit 34e5ba0

File tree

1 file changed

+45
-58
lines changed

1 file changed

+45
-58
lines changed

Diff for: ipi/engine/atoms.py

+45-58
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
"""Contains the classes which deal with the atoms.
22
3-
Copyright (C) 2013, Joshua More and Michele Ceriotti
4-
5-
This program is free software: you can redistribute it and/or modify
6-
it under the terms of the GNU General Public License as published by
7-
the Free Software Foundation, either version 3 of the License, or
8-
(at your option) any later version.
9-
10-
This program is distributed in the hope that it will be useful,
11-
but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
GNU General Public License for more details.
14-
15-
You should have received a copy of the GNU General Public License
16-
along with this program. If not, see <http.//www.gnu.org/licenses/>.
17-
18-
193
Used for holding information about the atoms, including their positions, masses
204
momenta and kinetic energy. Has separate classes for accessing the global
215
arrays of atoms and for individual atoms.
@@ -37,33 +21,33 @@ class Atom(dobject):
3721
This is actually only an interface to the Atoms class, i.e. only stores
3822
views of the large arrays which contain all the coordinates.
3923
40-
Attributes:
41-
kin: The kinetic energy of the atom.
42-
kstress: The contribution of the atom to the kinetic stress tensor.
24+
**Depend objects**
4325
44-
Depend objects:
45-
p: The three components of the momentum of the atom.
46-
q: The three components of the position of the atom.
47-
m: The mass of the atom.
48-
name: The name of the atom.
49-
m3: An array of 3 elements with each element being the mass of the atom.
50-
Used when each degree of freedom needs to be divided by the mass.
26+
:p: The three components of the momentum of the atom.
27+
:q: The three components of the position of the atom.
28+
:m: The mass of the atom.
29+
:name: The name of the atom.
30+
:m3: An array of 3 elements with each element being the mass of the atom.
31+
Used when each degree of freedom needs to be divided by the mass.
5132
"""
5233

5334
def __init__(self, system, index):
5435
"""Initialises Atom.
5536
56-
Args:
57-
system: An Atoms object containing the required atom.
58-
index: An integer giving the index of the required atom in the atoms
59-
list. Note that indices start from 0.
37+
Arguments
38+
39+
`system`
40+
An Atoms object containing the required atom.
41+
`index`
42+
An integer giving the index of the required atom in the atoms
43+
list. Note that indices start from 0.
6044
"""
6145

62-
dset(self,"p",system.p[3*index:3*index+3])
63-
dset(self,"q",system.q[3*index:3*index+3])
64-
dset(self,"m",system.m[index:index+1])
65-
dset(self,"name",system.names[index:index+1])
66-
dset(self,"m3",system.m3[3*index:3*index+3])
46+
dset(self, "p", system.p[3*index:3*index+3])
47+
dset(self, "q", system.q[3*index:3*index+3])
48+
dset(self, "m", system.m[index:index+1])
49+
dset(self, "name", system.names[index:index+1])
50+
dset(self, "m3", system.m3[3*index:3*index+3])
6751

6852
@property
6953
def kin(self):
@@ -92,26 +76,28 @@ class Atoms(dobject):
9276
and a convenience-access is provided through a list of Atom objects.
9377
9478
Attributes:
95-
natoms: The number of atoms.
79+
80+
* **natoms** The number of atoms.
9681
9782
Depend objects:
98-
p: An array giving the components of the atom positions.
99-
q: An array giving the components of the atom momenta.
100-
m: An array giving the atom masses.
101-
names: An array giving the atom names.
102-
m3: An array of 3*n elements where each element of m has been copied
103-
three times. Used when each degree of freedom needs to be divided
104-
by the mass.
105-
M: The total mass of all the atoms.
106-
kin: The total kinetic energy of the atoms. Depends on p and m3.
107-
kstress: The contribution of the atoms to the kinetic stress tensor.
108-
Depends on px, py, pz and m.
109-
qx: An array giving the x components of the positions.
110-
qy: An array giving the y components of the positions.
111-
qz: An array giving the z components of the positions.
112-
px: An array giving the x components of the momenta.
113-
py: An array giving the y components of the momenta.
114-
pz: An array giving the z components of the momenta.
83+
84+
* **p** An array giving the components of the atom positions.
85+
* **q** An array giving the components of the atom momenta.
86+
* **m** An array giving the atom masses.
87+
* **names** An array giving the atom names.
88+
* **m3** An array of 3*n elements where each element of m has been copied
89+
three times. Used when each degree of freedom needs to be divided
90+
by the mass.
91+
* **M** The total mass of all the atoms.
92+
* **kin** The total kinetic energy of the atoms. Depends on p and m3.
93+
* **kstress** The contribution of the atoms to the kinetic stress tensor.
94+
Depends on px, py, pz and m.
95+
* **qx** An array giving the x components of the positions.
96+
* **qy** An array giving the y components of the positions.
97+
* **qz** An array giving the z components of the positions.
98+
* **px** An array giving the x components of the momenta.
99+
* **py** An array giving the y components of the momenta.
100+
* **pz** An array giving the z components of the momenta.
115101
"""
116102

117103

@@ -122,11 +108,12 @@ def __init__(self, natoms, _prebind=None):
122108
and so slices of the global position and momentum arrays must be used in
123109
the initialisation so that they always agree with each other.
124110
125-
Args:
126-
natoms: An integer giving the number of atoms.
127-
_prebind: An optional tuple of four elements; a depend_array of length
128-
3*natoms for the positions, another for the momenta, a depend_array
129-
of length natoms for the masses and another for the names.
111+
Arguments:
112+
113+
* **natoms** An integer giving the number of atoms.
114+
* **_prebind** An optional tuple of four elements; a depend_array of length
115+
3*natoms for the positions, another for the momenta, a depend_array
116+
of length natoms for the masses and another for the names.
130117
"""
131118

132119
self.natoms = natoms

0 commit comments

Comments
 (0)