Skip to content

Commit 714e48e

Browse files
committed
more sphinx things
1 parent 345ae5c commit 714e48e

14 files changed

+708
-475
lines changed

comp_output.py

+50-39
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@ def obj_to_dict(obj, skip_attrs=None):
3636
class CompOutput:
3737
"""
3838
Attributes:
39-
geometry the last Geometry
40-
opts list of Geometry for each optimization steps
41-
frequency Frequency object
42-
archive a string containing the archive entry
43-
energy, enthalpy, free_energy, grimme_g,
44-
mass, temperature, rotational_temperature,
45-
multiplicity, charge, rotational_symmetry_number
46-
error, error_msg, finished,
47-
gradient, E_ZPVE, ZPVE
39+
40+
* geometry the last Geometry
41+
* opts list of Geometry for each optimization steps
42+
* frequency Frequency object
43+
* archive a string containing the archive entry
44+
* energy, enthalpy, free_energy, grimme_g,
45+
* mass, temperature, rotational_temperature,
46+
* multiplicity, charge, rotational_symmetry_number
47+
* error, error_msg, finished,
48+
* gradient, E_ZPVE, ZPVE
4849
"""
4950

5051
ELECTRONIC_ENERGY = "NRG"
@@ -159,21 +160,27 @@ def boltzmann_weights(
159160
v0=100,
160161
):
161162
"""
162-
returns boltzmann weights
163-
thermo_cos - list of CompOutput instances for thermochem corrections
164-
nrg_cos - list of CompOutput to take the electronic energy from
165-
order should correspond to thermo_cos
166-
if not given, the energies from thermo_cos are used
167-
weighting - type of energy to use for weighting
163+
:param list(CompOutput) thermo_cos: list of CompOutput
164+
instances for thermochem corrections
165+
:param list(CompOutput) nrg_cos: list of CompOutput to
166+
take the electronic energy from order should correspond
167+
to thermo_cos if not given, the energies from thermo_cos
168+
are used
169+
:param str weighting:type of energy to use for weighting
168170
can be:
169-
"NRG"
170-
"ZPE"
171-
"ENTHALPY"
172-
"QHARM"
173-
"QRRHO"
174-
"RRHO"
175-
temperature - temperature in K
176-
v0 - parameter for quasi free energy corrections
171+
172+
* "NRG"
173+
* "ZPE"
174+
* "ENTHALPY"
175+
* "QHARM"
176+
* "QRRHO"
177+
* "RRHO"
178+
179+
:param float temperature: temperature in K
180+
:param float v0: parameter for quasi free energy corrections
181+
182+
:returns: boltzmann weights
183+
:rtype: np.ndarray
177184
"""
178185
if not nrg_cos:
179186
nrg_cos = thermo_cos
@@ -254,18 +261,18 @@ def therm_corr(self, temperature=None, v0=100, method="RRHO", pressure=1):
254261
for the specified cutoff frequency and temperature
255262
in that order (Hartrees for corrections, Eh/K for entropy)
256263
257-
temperature: float, temperature in K- None will use self.temperature
258-
pressure: float, pressure in atm
259-
v0: float, cutoff/damping parameter for quasi G corrections
260-
method: str - type of quasi treatment:
261-
RRHO - no quasi treatment
262-
QRRHO - Grimme's quasi-RRHO
263-
see Grimme, S. (2012), Supramolecular Binding Thermodynamics by
264-
Dispersion‐Corrected Density Functional Theory. Chem. Eur. J.,
265-
18: 9955-9964. (DOI: 10.1002/chem.201200497) for details
266-
QHARM - Truhlar's quasi-harmonic
267-
see J. Phys. Chem. B 2011, 115, 49, 14556–14562
268-
(DOI: 10.1021/jp205508z) for details
264+
:param float temperature: temperature in K- None will use self.temperature
265+
:param float pressure: pressure in atm
266+
:param float v0: float, cutoff/damping parameter for quasi G corrections
267+
:param str method: type of free energy\:
268+
* RRHO - no quasi treatment
269+
* QRRHO - Grimme's quasi-RRHO
270+
see Grimme, S. (2012), Supramolecular Binding Thermodynamics by
271+
Dispersion‐Corrected Density Functional Theory. Chem. Eur. J.,
272+
18: 9955-9964. (DOI: 10.1002/chem.201200497) for details
273+
* QHARM - Truhlar's quasi-harmonic
274+
see J. Phys. Chem. B 2011, 115, 49, 14556–14562
275+
(DOI: 10.1021/jp205508z) for details
269276
"""
270277
if self.frequency is None:
271278
msg = "Vibrational frequencies not found, "
@@ -398,10 +405,11 @@ def therm_corr(self, temperature=None, v0=100, method="RRHO", pressure=1):
398405
def calc_G_corr(self, temperature=None, v0=0, method="RRHO", **kwargs):
399406
"""
400407
returns quasi rrho free energy correction (Eh)
401-
temperature: float, temperature; default is self.temperature
402-
v0: float, parameter for quasi-rrho or quasi-harmonic entropy
403-
method: str (RRHO, QRRHO, QHARM) method for treating entropy
404-
see CompOutput.therm_corr for references
408+
409+
:param float temperature: temperature; default is self.temperature
410+
:param float v0: parameter for quasi-rrho or quasi-harmonic entropy
411+
:param str method: (RRHO, QRRHO, QHARM) method for treating entropy
412+
see CompOutput.therm_corr for references
405413
"""
406414
Ecorr, Hcorr, Stot = self.therm_corr(temperature, v0, method, **kwargs)
407415
T = temperature if temperature is not None else self.temperature
@@ -412,6 +420,7 @@ def calc_G_corr(self, temperature=None, v0=0, method="RRHO", **kwargs):
412420
def calc_Grimme_G(self, temperature=None, v0=100, **kwargs):
413421
"""
414422
returns quasi rrho free energy (Eh)
423+
415424
see Grimme, S. (2012), Supramolecular Binding Thermodynamics by
416425
Dispersion‐Corrected Density Functional Theory. Chem. Eur. J.,
417426
18: 9955-9964. (DOI: 10.1002/chem.201200497) for details
@@ -538,8 +547,10 @@ def follow(self, reverse=False, step=0.1):
538547
def compute_rot_temps(self):
539548
"""
540549
sets self's 'rotational_temperature' attribute by using self.geometry
550+
541551
not recommended b/c atoms should be specific isotopes, but this uses
542552
average atomic weights
553+
543554
exists because older versions of ORCA don't print rotational temperatures
544555
"""
545556
COM = self.geometry.COM(mass_weight=True)

component.py

+52-37
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@
2626

2727
class Component(Geometry):
2828
"""
29+
class for parts of a Geometry (e.g. ligands)
2930
Attributes:
30-
:name: str
31-
:comment: str
32-
:atoms: list(Atom)
33-
:other: dict()
34-
:substituents: list(Substituent) substituents detected
35-
:backbone: list(Atom) the backbone atoms
36-
:key_atoms: list(Atom) the atoms used for mapping
31+
32+
* name str
33+
* comment str
34+
* atoms list(Atom)
35+
* other dict()
36+
* substituents list(Substituent) substituents detected
37+
* backbone list(Atom) the backbone atoms
38+
* key_atoms list(Atom) the atoms used for mapping
39+
3740
"""
3841

3942
AARON_LIBS = os.path.join(AARONLIB, "Ligands")
@@ -132,6 +135,7 @@ def list(
132135
denticity=None,
133136
include_ext=False,
134137
):
138+
"""returns a list of ligand names in the library"""
135139
names = []
136140
for lib in [cls.AARON_LIBS, cls.BUILTIN]:
137141
if not os.path.exists(lib):
@@ -219,11 +223,13 @@ def c2_symmetric(self, to_center=None, tolerance=0.1):
219223
def sterimol(self, to_center=None, bisect_L=False, **kwargs):
220224
"""
221225
calculate ligand sterimol parameters for the ligand
222-
to_center - atom the ligand is coordinated to
223-
bisect_L - L axis will bisect (or analogous for higher denticity
224-
ligands) the L-M-L angle
225-
Default - center to centroid of key atoms
226-
**kwargs - arguments passed to Geometry.sterimol
226+
227+
:param Atom to_center: atom the ligand is coordinated to
228+
:param bool bisect_L: L axis will bisect (or analogous for higher denticity
229+
ligands) the L-M-L angle
230+
231+
Default - center to centroid of key atoms
232+
:param kwargs: - arguments passed to Geometry.sterimol
227233
"""
228234
if to_center is not None:
229235
center = self.find(to_center)
@@ -318,7 +324,7 @@ def detect_backbone(self, to_center=None):
318324
Detects backbone and substituents attached to backbone
319325
Will tag atoms as 'backbone' or by substituent name
320326
321-
:to_center: the atoms connected to the metal/active center
327+
:param list(Atom) to_center: the atoms connected to the metal/active center
322328
"""
323329
# we must remove any tags already made
324330
for a in self.atoms:
@@ -428,8 +434,9 @@ def capped_backbone(self, to_center=None, as_copy=True):
428434
def minimize_sub_torsion(self, geom=None, **kwargs):
429435
"""
430436
rotates substituents to minimize LJ potential
431-
geom: calculate LJ potential between self and another geometry-like
432-
object, instead of just within self
437+
438+
:param None|Geometry geom: calculate LJ potential between self and another geometry-like
439+
object, instead of just within self
433440
"""
434441
if geom is None:
435442
geom = self
@@ -458,24 +465,31 @@ def cone_angle(
458465
):
459466
"""
460467
returns cone angle in degrees
461-
center - Atom() that this component is coordinating
462-
used as the apex of the cone
463-
method (str) can be:
464-
'Tolman' - Tolman cone angle for unsymmetric ligands
465-
See J. Am. Chem. Soc. 1974, 96, 1, 53–60 (DOI: 10.1021/ja00808a009)
466-
NOTE: this does not make assumptions about the geometry
467-
NOTE: only works with monodentate and bidentate ligands
468-
'exact' - cone angle from Allen et. al.
469-
See Bilbrey, J.A., Kazez, A.H., Locklin, J. and Allen, W.D.
470-
(2013), Exact ligand cone angles. J. Comput. Chem., 34:
471-
1189-1197. (DOI: 10.1002/jcc.23217)
472-
return_cones - return cone apex, center of base, and base radius list
473-
the sides of the cones will be 5 angstroms long
474-
for Tolman cone angles, multiple cones will be returned, one for
475-
each substituent coming off the coordinating atom
476-
radii: 'bondi' - Bondi vdW radii
477-
'umn' - vdW radii from Mantina, Chamberlin, Valero, Cramer, and Truhlar
478-
dict() with elements as keys and radii as values
468+
469+
:param Atom center: that this component is coordinating
470+
used as the apex of the cone
471+
:param str method: can be:
472+
* 'Tolman' - Tolman cone angle for unsymmetric ligands
473+
474+
See J. Am. Chem. Soc. 1974, 96, 1, 53–60 (DOI: 10.1021/ja00808a009)
475+
476+
:NOTE: this does not make assumptions about the geometry
477+
478+
:NOTE: only works with monodentate and bidentate ligands
479+
* 'exact' - cone angle from Allen et. al.
480+
481+
See Bilbrey, J.A., Kazez, A.H., Locklin, J. and Allen, W.D.
482+
(2013), Exact ligand cone angles. J. Comput. Chem., 34:
483+
1189-1197. (DOI: 10.1002/jcc.23217)
484+
:param bool return_cones: return cone apex, center of base, and base radius list
485+
the sides of the cones will be 5 angstroms long
486+
487+
for Tolman cone angles, multiple cones will be returned, one for
488+
each substituent coming off the coordinating atom
489+
:param str|dict radii:
490+
* 'bondi' - Bondi vdW radii
491+
* 'umn' - vdW radii from Mantina, Chamberlin, Valero, Cramer, and Truhlar
492+
* dict() with elements as keys and radii as values
479493
"""
480494
if method.lower() == "tolman":
481495
CITATION = "doi:10.1021/ja00808a009"
@@ -907,11 +921,12 @@ def solid_angle(
907921
):
908922
"""
909923
calculate the solid angle of a ligand
910-
center - atoms or point to denote the center of the sphere
911-
radii - "umn", "bondi", or a dictionary with elements as
924+
925+
:param Atom center: atoms or point to denote the center of the sphere
926+
:param str|dict radii: "umn", "bondi", or a dictionary with elements as
912927
the keys and radii as the values
913-
grid - number of points in lebedev grid
914-
return_solid_cone - return solid ligand cone angle (degrees)
928+
:param int grid: number of points in lebedev grid
929+
:param bool return_solid_cone: return solid ligand cone angle (degrees)
915930
instead of solid angle (steradians)
916931
"""
917932
# we calculate the solid angle by projecting each atom's

config.py

+28-12
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,14 @@
8585
class Config(configparser.ConfigParser):
8686
"""
8787
Reads configuration information from INI files found at:
88+
8889
$QCHASM/AaronTools/config.ini
8990
$AARONLIB/config.ini
9091
./config.ini or /path/to/file supplied during initialization
92+
9193
Access to configuration information available using dictionary notation.
9294
eg: self[`section_name`][`option_name`] returns `option_value`
95+
9396
See help(configparser.ConfigParser) for more information
9497
"""
9598

@@ -216,8 +219,10 @@ def __init__(
216219
def get(self, section, option, *, junk="_ ", max_junk=1, **kwargs):
217220
"""
218221
see ConfigParser.get for details
222+
219223
junk are characters that are not important in the option name
220224
max_junk - number of allowed junk characters
225+
221226
e.g. junk="_" with max_junk=1 when looking for
222227
'empirical dispersion' will match 'empirical_dispersion'
223228
"""
@@ -397,8 +402,11 @@ def _parse_changes(self):
397402
def parse_functions(self):
398403
"""
399404
Evaluates functions supplied in configuration file
405+
400406
Functions indicated by "%{...}"
407+
401408
Pulls in values of options indicated by $option_name
409+
402410
Eg:
403411
ppn = 4
404412
memory = %{ $ppn * 2 }GB --> memory = 8GB
@@ -493,20 +501,25 @@ def _read_config(self, infile, quiet, skip_user_default):
493501
def get_other_kwargs(self, section="Theory"):
494502
"""
495503
Returns dict() that can be unpacked and passed to Geometry.write along with a theory
504+
496505
Example:
497-
[Theory]
498-
route = pop NBORead
499-
opt MaxCycle=1000, NoEigenTest
500-
end_of_file = $nbo RESONANCE NBOSUM E2PERT=0.0 NLMO BNDIDX $end
506+
507+
[Theory]
508+
route = pop NBORead
509+
opt MaxCycle=1000, NoEigenTest
510+
end_of_file = $nbo RESONANCE NBOSUM E2PERT=0.0 NLMO BNDIDX $end
501511
502512
this adds opt(MaxCycle=1000,NoEigenTest) pop=NBORead to the route with any other
503513
pop or opt options being added by the job type
504514
505515
'two-layer' options can also be specified as a python dictionary
516+
506517
the following is equivalent to the above example:
507-
[Theory]
508-
route = {"pop":["NBORead"], "opt":["MaxCycle=1000", NoEigenTest"]}
509-
end_of_file = $nbo RESONANCE NBOSUM E2PERT=0.0 NLMO BNDIDX $end
518+
519+
[Theory]
520+
route = {"pop":["NBORead"], "opt":["MaxCycle=1000", NoEigenTest"]}
521+
end_of_file = $nbo RESONANCE NBOSUM E2PERT=0.0 NLMO BNDIDX $end
522+
510523
"""
511524
# these need to be dicts
512525
two_layer = [
@@ -1060,6 +1073,7 @@ def _parse_includes(self, section=None):
10601073
"""
10611074
Moves option values from subsections into parent section
10621075
Eg:
1076+
10631077
[HPC]
10641078
include = Wheeler
10651079
ppn = 12
@@ -1107,11 +1121,13 @@ def _parse_includes(self, section=None):
11071121
def as_dict(self, spec=None, skip=None):
11081122
"""
11091123
Forms a metadata spec dictionary from configuration info
1110-
:spec: (dict) if given, append key/vals to that dict
1111-
:skip: (list) skip storing stuff according to (section, option) or attrs
1112-
section, option, and attrs are strings that can be regex (full match only)
1113-
eg: skip=[("Job", ".*"), "conformer"] will skip everything in the Job
1114-
section and the Config.conformer attribute
1124+
1125+
:param dict spec: if given, append key/vals to that dict
1126+
:param list skip: skip storing stuff according to (section, option) or attrs
1127+
section, option, and attrs are strings that can be regex (full match only)
1128+
1129+
eg: skip=[("Job", ".*"), "conformer"] will skip everything in the Job
1130+
section and the Config.conformer attribute
11151131
"""
11161132
if spec is None:
11171133
spec = {}

0 commit comments

Comments
 (0)