Skip to content

Commit 345ae5c

Browse files
committed
put the type hints in the wrong spot for sphinx
1 parent baab28e commit 345ae5c

File tree

9 files changed

+217
-211
lines changed

9 files changed

+217
-211
lines changed

atoms.py

+30-30
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,20 @@ def get(cls, a1, a2):
7575
class Atom:
7676
"""
7777
Attributes:
78-
79-
* element str
80-
* coords np.array(float)
81-
* flag bool true if frozen, false if relaxed
82-
* name str form of \d+(\.\d+)*
83-
* tags set
84-
* charge float
85-
* connected set(Atom)
86-
* constraint set(Atom) for determining constrained bonds
87-
* _rank
88-
* _radii float for calculating if bonded
89-
* _connectivity int max connections without hypervalence
90-
* _saturation int max connections without hypervalence or charges
91-
78+
79+
* element str
80+
* coords np.array(float)
81+
* flag bool true if frozen, false if relaxed
82+
* name str form of \d+(\.\d+)*
83+
* tags set
84+
* charge float
85+
* connected set(Atom)
86+
* constraint set(Atom) for determining constrained bonds
87+
* _rank
88+
* _radii float for calculating if bonded
89+
* _connectivity int max connections without hypervalence
90+
* _saturation int max connections without hypervalence or charges
91+
9292
"""
9393

9494
LOG = None
@@ -99,13 +99,13 @@ def __init__(
9999
self, element="", coords=None, flag=False, name="", tags=None, charge=None, mass=None
100100
):
101101
"""
102-
:param element str: element symbol
103-
:param coords np.ndarray: position
104-
:param flag: whether atom is frozen
105-
:param name str: name of atom
106-
:param tags list: misc. data
107-
:param charge float: partial charge of atom
108-
:param mass float: mass of atom
102+
:param str element: element symbol
103+
:param np.ndarray coords: position
104+
:param bool flag: whether atom is frozen
105+
:param str name: atom name
106+
:param list tags: misc. data
107+
:param float charge: partial charge of atom
108+
:param float mass: mass of atom
109109
"""
110110

111111
super().__setattr__("_hashed", False)
@@ -316,12 +316,12 @@ def get_invariant(self):
316316
"""
317317
gets initial invariant, which is formulated using:
318318
319-
# number of non-hydrogen connections (\d{1}): nconn
320-
# sum of bond order of non-hydrogen bonds * 10 (\d{2}): nB
321-
# atomic number (\d{3}): z
322-
# sign of charge (\d{1}) (not used)
323-
# absolute charge (\d{1}) (not used)
324-
# number of attached hydrogens (\d{1}): nH
319+
#. number of non-hydrogen connections (\d{1}): nconn
320+
#. sum of bond order of non-hydrogen bonds * 10 (\d{2}): nB
321+
#. atomic number (\d{3}): z
322+
#. sign of charge (\d{1}) (not used)
323+
#. absolute charge (\d{1}) (not used)
324+
#. number of attached hydrogens (\d{1}): nH
325325
"""
326326
heavy = set([x for x in self.connected if x.element != "H"])
327327
# number of non-hydrogen connections:
@@ -1009,9 +1009,9 @@ def new_shape(old_shape, new_connectivity, bond_change):
10091009
returns the name of the expected vsepr geometry when the number of bonds
10101010
changes by +/- 1
10111011
1012-
:param old_shape str: vsepr geometry name
1013-
:param new_connectivity int: connectivity (see Atom._connectivity)
1014-
:param bond_change int: +1 or -1, indicating that the number of bonds is changing by 1
1012+
:param str old_shape: vsepr geometry name
1013+
:param int new_connectivity: connectivity (see Atom._connectivity)
1014+
:param int bond_change: +1 or -1, indicating that the number of bonds is changing by 1
10151015
10161016
"""
10171017
if old_shape == "point":

geometry.py

+107-107
Large diffs are not rendered by default.

theory/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
* PSI4_COMMENT: list(str)
2020
* PSI4_MOLECULE: dict(str:list(str)) e.g. {'symmetry': ['c1']}
2121
* PSI4_COORDINATES: dict() with keys:
22-
'coords' - array of coordinates with one item for each atom
23-
'variables' - list of name (str), value (float), is_angstrom (bool) tuples
24-
this is ignored if using a SAPTMethod with a low-spin combination
25-
of monomers
22+
'coords' - array of coordinates with one item for each atom
23+
'variables' - list of name (str), value (float), is_angstrom (bool) tuples
24+
this is ignored if using a SAPTMethod with a low-spin combination
25+
of monomers
2626
* PSI4_JOB: dict(optimize/frequencies/etc: list(str $METHOD replaced w/ method))
2727
* PSI4_OPTKING: dict(setting_name: [value])
2828
@@ -53,7 +53,7 @@
5353
5454
* XTB_CONTROL_BLOCKS: dict - stuff in xcontrol file
5555
* XTB_COMMAND_LINE: dict(str:list) - command line stuff, values should be
56-
emtpy lists if the command line flag (key) has no arguments
56+
emtpy lists if the command line flag (key) has no arguments
5757
5858
:CREST:
5959

theory/basis.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@ class Basis:
3636
* elements - same as initialization keyword
3737
* aux_type - same as initialization keyword
3838
* elements - list of element symbols for elements this basis applies to
39-
updated with Basis.refresh_elements
40-
Basis.refresh_elements is called when writing an input file
39+
updated with Basis.refresh_elements
40+
41+
Basis.refresh_elements is called when writing an input file
4142
* ele_selection - list of finders used to determine which elements this basis applies to
4243
* not_anys - list of finders used to determine which elements this basis does not apply to
4344
* ONIOM-only attributes:
4445
* oniom_layer - same as initialization keyword
4546
* atom_selection - list of finders used to determine which atoms this basis applies to
4647
* atoms - list of atoms this basis applies to
47-
updated with Bases.refresh_atoms
48+
updated with Bases.refresh_atoms
4849
* default_notany_atoms - finder for atoms that are not in the given layer
4950
"""
5051

@@ -54,23 +55,23 @@ class Basis:
5455

5556
def __init__(self, name, elements=None, aux_type=None, user_defined=False, oniom_layer=None, atoms=None):
5657
"""
57-
:param name str: basis set base name (e.g. 6-31G)
58-
:param elements list(str): list of element symbols or finders to determine the basis set applies to
58+
:param str name: basis set base name (e.g. 6-31G)
59+
:param list(str) elements: list of element symbols or finders to determine the basis set applies to
5960
elements may also be 'tm' or 'all' to indicate any transition metal and
6061
all elements, respectively
6162
elements may start with '!' to exclude that element from the basis
6263
for example, elements='!H' will apply to default elements, minus H
63-
:param aux_type str|None:
64+
:param str|None aux_type:
6465
6566
* ORCA: one of BasisSet.ORCA_AUX
6667
* Psi4: one of BasisSet.PSI4_AUX
67-
:param user_defined str|bool: path to file containing basis info from basissetexchange.org
68+
:param str|bool user_defined: path to file containing basis info from basissetexchange.org
6869
or similar
6970
False for builtin basis sets
7071
7172
ONIOM-only:
7273
73-
:param oniom_layer str|None: must be 'H', 'M', or 'L' if not None
74+
:param str|None oniom_layer: must be 'H', 'M', or 'L' if not None
7475
:param atoms: list of finders or 'tm' to determine what atoms the basis set applies to
7576
"""
7677
self.name = name
@@ -266,8 +267,8 @@ def sanity_check_basis(name, program):
266267
checks the basis set name against a list of basis sets
267268
that are built-in to the specified program
268269
269-
:param name str: keyword of basis set (e.g. def2SVP)
270-
:param program str: program name (gaussian, psi4, etc.)
270+
:param str name: keyword of basis set (e.g. def2SVP)
271+
:param str program: program name (gaussian, psi4, etc.)
271272
"""
272273
import os.path
273274
from difflib import SequenceMatcher as seqmatch
@@ -1262,7 +1263,7 @@ def get_orca_basis_info(self):
12621263

12631264
def get_psi4_basis_info(self, sapt=False):
12641265
"""
1265-
:param sapt bool: use df_basis_sapt instead of df_basis_scf for jk basis
1266+
:param bool sapt: use df_basis_sapt instead of df_basis_scf for jk basis
12661267
12671268
:returns: dict for get_psi4_header
12681269
"""

theory/grid.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class IntegrationGrid:
1919

2020
def __init__(self, name):
2121
"""
22-
:param name str: Gaussian keyword (e.g. SuperFineGrid),
22+
:param str name: Gaussian keyword (e.g. SuperFineGrid),
2323
ORCA keyword (e.g. Grid7),
2424
or "(radial, angular)"
2525

theory/implicit_solvent.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ class ImplicitSolvent:
526526

527527
def __init__(self, solvent_model, solvent):
528528
"""
529-
:param solvent_model str: implicit solvent model (e.g. PCM)
530-
:param solvent str: solvent name (e.g. water)
529+
:param str solvent_model: implicit solvent model (e.g. PCM)
530+
:param str solvent: solvent name (e.g. water)
531531
"""
532532
self.solvent_model = solvent_model
533533
self.solvent = solvent

theory/job_types.py

+34-33
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,23 @@ def job_from_string(name, **kwargs):
2929
"""
3030
get a job name given a simple name
3131
32-
:param name str:
32+
:param str name:
3333
3434
* "opt" or "conf" with ".ts", ".transition_state", ".change", and ".con" extensions
35+
3536
* .ts and .transition_state indicate a transition state optimization
3637
* .con indicates a constrained optimization - "constraints" should
37-
be in kwargs and the value should be a dictionary conformable with
38-
the keyword of OptimizationJob
38+
be in kwargs and the value should be a dictionary conformable with
39+
the keyword of OptimizationJob
40+
3941
* "freq" with ".num" extensions
42+
4043
* .num indicates a numerical frequnecy, as does kwargs["numerical"] = True
41-
kwargs can also have a "temperature" key
44+
kwargs can also have a "temperature" key
45+
4246
* "sp" or "energy" or "single-point"
4347
* "force" or "gradient" with a ".num" extension
48+
4449
* .num indicates a numerical frequnecy, as does kwargs["numerical"] = True
4550
4651
:returns: job types for the given string
@@ -149,11 +154,11 @@ def resolve_error(error, theory, exec_type, geometry=None):
149154
raises NotImplementedError if this job type has no fix for
150155
the error code
151156
152-
:param error str: error code (e.g. SCF_CONV; see fileIO ERROR)
153-
:param theory Theory: Theory instance used when the error happened
154-
:param exec_type str: software program (i.e. gaussian, orca, etc.)
157+
:param str error: error code (e.g. SCF_CONV; see fileIO ERROR)
158+
:param Theory theory: Theory instance used when the error happened
159+
:param str exec_type: software program (i.e. gaussian, orca, etc.)
155160
156-
:param geometry Geometry: (optional) structure might be adjusted slightly if
161+
:param Geometry geometry: (optional) structure might be adjusted slightly if
157162
there are close contacts
158163
"""
159164

@@ -247,37 +252,34 @@ def __init__(
247252
geometry=None,
248253
):
249254
"""
250-
:param transition_state bool: request a transition state optimization
251-
:param constraints dict: keys are
255+
:param bool transition_state: request a transition state optimization
256+
:param dict constraints: keys are
252257
253258
**available for ORCA, Gaussian, and Psi4**
254259
255260
* 'atoms' - atom identifiers/finders - atoms to constrain
256-
* 'bonds' - list(atom idenifiers/finders) - distances to constrain
257-
each atom identifier in the list should result in exactly 2 atoms
258-
* 'angles' - list(atom idenifiers/finders) - 1-3 angles to constrain
259-
each atom identifier should result in exactly 3 atoms
260-
* 'torsions' - list(atom identifiers/finders) - constrained dihedral angles
261-
each atom identifier should result in exactly 4 atoms
261+
* 'bonds' - list(atom idenifiers/finders) - distances to constrain each atom identifier
262+
in the list should result in exactly 2 atoms
263+
* 'angles' - list(atom idenifiers/finders) - 1-3 angles to constrain each atom identifier
264+
should result in exactly 3 atoms
265+
* 'torsions' - list(atom identifiers/finders) - constrained dihedral angles each atom
266+
identifier should result in exactly 4 atoms
262267
263268
264269
**available for Gaussian and Psi4**
265270
266-
* 'x' - list(atom identifiers/finders) - constrain the x coordinate of
267-
these atoms.
268-
Similarly, 'y' and 'z' are also accepted.
271+
* 'x' - list(atom identifiers/finders) - constrain the x coordinate of these atoms. Similarly, 'y' and 'z' are also accepted.
269272
* 'xgroup' - list(tuple(list(atom idenifiers), x_val, hold)) -
270-
constrain the x coordinate of these atoms to be the same
273+
constrain the x coordinate of these atoms to be the same
271274
272275
* x_val - set x-coordinate to this value
273-
* hold - hold this value constant during the optimization
274-
if 'hold' is omitted, the value will not be held
275-
constant during the optimization
276+
* hold - hold this value constant during the optimization if 'hold' is omitted,
277+
the value will not be held constant during the optimization
276278
277-
e.g. 'xgroup':[("1-6", 0, False), ("13-24", 3.25, False)]
279+
e.g. 'xgroup':[("1-6", 0, False), ("13-24", 3.25, False)]
278280
279-
this will keep atoms 1-6 and 13-24 in parallel planes, while also
280-
allowing those planes to move
281+
this will keep atoms 1-6 and 13-24 in parallel planes, while also
282+
allowing those planes to move
281283
282284
* 'ygroup' and 'zgroup' are also available, with analagous options
283285
@@ -286,7 +288,7 @@ def __init__(
286288
for Gaussian, 'bonds', 'angles', and 'torsions' constraints cannot be mixed
287289
with 'x', 'y', 'z', 'xgroup', 'ygroup', or 'zgroup' constraints
288290
289-
:param geometry Geometry: will be set when using an AaronTools FileWriter"""
291+
:param Geometry geometry: will be set when using an AaronTools FileWriter"""
290292
super().__init__()
291293

292294
self.transition_state = transition_state
@@ -1265,18 +1267,17 @@ def __init__(
12651267
geometry=None,
12661268
):
12671269
"""
1268-
:param constraints dict:
1270+
:param dict constraints:
1271+
12691272
valid keys are:
12701273
12711274
* 'atoms' - atom identifiers/finders - atoms to constrain
1272-
* 'bonds' - list(atom idenifiers/finders) - distances to constrain
1273-
each atom identifier in the list should result in exactly 2 atoms
1274-
* 'angles' - list(atom idenifiers/finders) - 1-3 angles to constrain
1275-
each atom identifier should result in exactly 3 atoms
1275+
* 'bonds' - list(atom idenifiers/finders) - distances to constrain each atom identifier in the list should result in exactly 2 atoms
1276+
* 'angles' - list(atom idenifiers/finders) - 1-3 angles to constrain each atom identifier should result in exactly 3 atoms
12761277
* 'torsions' - list(atom identifiers/finders) - constrained dihedral angles
12771278
each atom identifier should result in exactly 4 atoms
12781279
1279-
:param geometry Geometry: will be set when using an AaronTools FileWriter
1280+
:param Geometry geometry: will be set when using an AaronTools FileWriter
12801281
"""
12811282
self.constraints = constraints
12821283
self.geometry = geometry

theory/method.py

+12-8
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,19 @@
3131
class Method:
3232
"""functional object
3333
used to ensure the proper keyword is used
34+
3435
e.g.
3536
using Functional('PBE0') will use PBE1PBE in a gaussian input file"""
3637

3738
LOG = None
3839

3940
def __init__(self, name, is_semiempirical=False, is_oniom=False, oniom_layer=None, is_mm=False):
4041
"""
41-
name: str, functional name
42-
is_semiempirical: bool, basis set is not required
43-
is_oniom: bool, oniom_layer must be in kwargs, is_mm must be in kwargs
44-
oniom_layer: str, oniom layer method describes, must be "H", "M", or "L"
45-
is_mm: bool, basis set is not required
42+
:param str name: functional name
43+
:param bool is_semiempirical: basis set is not required
44+
:param bool is_oniom: oniom_layer must be in kwargs, is_mm must be in kwargs
45+
:param str oniom_layer: oniom layer method describes, must be "H", "M", or "L"
46+
:param bool is_mm: basis set is not required
4647
"""
4748
self.name = name
4849
self.is_semiempirical = is_semiempirical
@@ -73,8 +74,9 @@ def __eq__(self, other):
7374
def sanity_check_method(name, program):
7475
"""
7576
check to see if method is available in the specified program
76-
name - str, name of method
77-
program, str, gaussian, orca, psi4, or qchem
77+
78+
:param str name: name of method
79+
:param str program: program name (gaussian, orca, psi4, or qchem)
7880
"""
7981
import os.path
8082
from difflib import SequenceMatcher as seqmatch
@@ -267,8 +269,10 @@ class SAPTMethod(Method):
267269
"""
268270
method used to differentiate between regular methods and sapt
269271
methods because the molecule will need to be split into monomers
272+
270273
if using a sapt method, the geometry given to Theory or Geometry.write
271-
should have a 'components' attribute with each monomer being a coordinate
274+
should have a 'components' attribute with each monomer being a component
275+
272276
the charge and multiplicity given to Theory should be a list, with the first
273277
item in each list being the overall charge/multiplicity and the subsequent items
274278
being the charge/multiplicity of the monomers (components)

0 commit comments

Comments
 (0)