stjames 0.0.46__py3-none-any.whl → 0.0.48__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of stjames might be problematic. Click here for more details.
- stjames/base.py +1 -1
- stjames/method.py +17 -4
- stjames/pdb.py +197 -0
- stjames/settings.py +6 -4
- stjames/workflows/__init__.py +3 -0
- stjames/workflows/conformer_search.py +40 -0
- stjames/workflows/electronic_properties.py +18 -5
- stjames/workflows/hydrogen_bond_basicity.py +21 -0
- stjames/workflows/molecular_dynamics.py +8 -2
- stjames/workflows/multistage_opt.py +26 -0
- stjames/workflows/scan.py +1 -1
- {stjames-0.0.46.dist-info → stjames-0.0.48.dist-info}/METADATA +3 -2
- {stjames-0.0.46.dist-info → stjames-0.0.48.dist-info}/RECORD +16 -14
- {stjames-0.0.46.dist-info → stjames-0.0.48.dist-info}/WHEEL +1 -1
- {stjames-0.0.46.dist-info → stjames-0.0.48.dist-info}/LICENSE +0 -0
- {stjames-0.0.46.dist-info → stjames-0.0.48.dist-info}/top_level.txt +0 -0
stjames/base.py
CHANGED
|
@@ -12,7 +12,7 @@ class Base(pydantic.BaseModel):
|
|
|
12
12
|
@classmethod
|
|
13
13
|
def coerce_numpy(cls, val: _T) -> _T | list[Any]:
|
|
14
14
|
if isinstance(val, np.ndarray):
|
|
15
|
-
return val.tolist() # type: ignore [no-any-return, unused-ignore]
|
|
15
|
+
return val.tolist() # type: ignore [no-any-return, unused-ignore, return-value]
|
|
16
16
|
|
|
17
17
|
return val
|
|
18
18
|
|
stjames/method.py
CHANGED
|
@@ -32,8 +32,10 @@ class Method(LowercaseStrEnum):
|
|
|
32
32
|
|
|
33
33
|
AIMNET2_WB97MD3 = "aimnet2_wb97md3"
|
|
34
34
|
MACE_MP_0 = "mace_mp_0"
|
|
35
|
+
MACE_MP_0B2_L = "mace_mp_0b2_l"
|
|
35
36
|
OCP24_S = "ocp24_s"
|
|
36
37
|
OCP24_L = "ocp24_l"
|
|
38
|
+
ORB_V2 = "orb_v2"
|
|
37
39
|
|
|
38
40
|
GFN_FF = "gfn_ff"
|
|
39
41
|
GFN0_XTB = "gfn0_xtb"
|
|
@@ -43,9 +45,17 @@ class Method(LowercaseStrEnum):
|
|
|
43
45
|
# this was going to be removed, but Jonathon wrote such a nice basis set test... it's off the front end.
|
|
44
46
|
BP86 = "bp86"
|
|
45
47
|
|
|
48
|
+
OFF_SAGE_2_2_1 = "off_sage_2_2_1"
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
|
|
51
|
+
PrepackagedNNPMethod = Literal[Method.AIMNET2_WB97MD3, Method.OCP24_S, Method.OCP24_L]
|
|
52
|
+
PREPACKAGED_NNP_METHODS = [Method.AIMNET2_WB97MD3, Method.OCP24_S, Method.OCP24_L]
|
|
53
|
+
|
|
54
|
+
CorrectableNNPMethod = Literal[Method.MACE_MP_0B2_L, Method.ORB_V2]
|
|
55
|
+
CORRECTABLE_NNP_METHODS = [Method.MACE_MP_0B2_L, Method.ORB_V2]
|
|
56
|
+
|
|
57
|
+
NNPMethod = PrepackagedNNPMethod | CorrectableNNPMethod
|
|
58
|
+
NNP_METHODS = [*PREPACKAGED_NNP_METHODS, *CORRECTABLE_NNP_METHODS]
|
|
49
59
|
|
|
50
60
|
XTBMethod = Literal[Method.GFN_FF, Method.GFN0_XTB, Method.GFN1_XTB, Method.GFN2_XTB]
|
|
51
61
|
XTB_METHODS = [Method.GFN_FF, Method.GFN0_XTB, Method.GFN1_XTB, Method.GFN2_XTB]
|
|
@@ -53,8 +63,11 @@ XTB_METHODS = [Method.GFN_FF, Method.GFN0_XTB, Method.GFN1_XTB, Method.GFN2_XTB]
|
|
|
53
63
|
CompositeMethod = Literal[Method.HF3C, Method.B973C, Method.R2SCAN3C, Method.WB97X3C]
|
|
54
64
|
COMPOSITE_METHODS = [Method.HF3C, Method.B973C, Method.R2SCAN3C, Method.WB97X3C]
|
|
55
65
|
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
FFMethod = Literal[Method.OFF_SAGE_2_2_1]
|
|
67
|
+
FF_METHODS = [Method.OFF_SAGE_2_2_1]
|
|
68
|
+
|
|
69
|
+
PrepackagedMethod = XTBMethod | CompositeMethod | PrepackagedNNPMethod | FFMethod
|
|
70
|
+
PREPACKAGED_METHODS = [*XTB_METHODS, *COMPOSITE_METHODS, *PREPACKAGED_NNP_METHODS, *FF_METHODS]
|
|
58
71
|
|
|
59
72
|
MethodWithCorrection = Literal[Method.WB97XD3, Method.WB97XV, Method.WB97MV, Method.WB97MD3BJ, Method.DSDBLYPD3BJ]
|
|
60
73
|
METHODS_WITH_CORRECTION = [Method.WB97XD3, Method.WB97XV, Method.WB97MV, Method.WB97MD3BJ, Method.DSDBLYPD3BJ, Method.B97D3BJ]
|
stjames/pdb.py
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
from datetime import date
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Any, Literal
|
|
4
|
+
|
|
5
|
+
import atomium # type: ignore [import-untyped]
|
|
6
|
+
from atomium.pdb import pdb_dict_to_data_dict, pdb_string_to_pdb_dict # type: ignore [import-untyped]
|
|
7
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
8
|
+
|
|
9
|
+
from stjames.types import Matrix3x3, Vector3D
|
|
10
|
+
|
|
11
|
+
# Mostly for testing purposes
|
|
12
|
+
EXTRA: Literal["allow", "ignore", "forbid"] = "allow"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class PDBAtom(BaseModel):
|
|
16
|
+
"""An atom within a residue."""
|
|
17
|
+
|
|
18
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
19
|
+
|
|
20
|
+
x: float
|
|
21
|
+
y: float
|
|
22
|
+
z: float
|
|
23
|
+
element: str
|
|
24
|
+
name: str
|
|
25
|
+
charge: float
|
|
26
|
+
occupancy: float
|
|
27
|
+
alt_loc: str | None
|
|
28
|
+
anisotropy: list[float]
|
|
29
|
+
bvalue: float
|
|
30
|
+
is_hetatm: bool
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class PDBWater(BaseModel):
|
|
34
|
+
"""A water molecule."""
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
37
|
+
|
|
38
|
+
name: str | None
|
|
39
|
+
full_name: str | None
|
|
40
|
+
atoms: dict[int, PDBAtom] = {}
|
|
41
|
+
internal_id: str | None
|
|
42
|
+
polymer: str
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class PDBResidue(BaseModel):
|
|
46
|
+
"""A structure."""
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
49
|
+
|
|
50
|
+
name: str | None
|
|
51
|
+
full_name: str | None = None
|
|
52
|
+
atoms: dict[int, PDBAtom] = {}
|
|
53
|
+
number: int
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class PDBPolymer(BaseModel):
|
|
57
|
+
"""A polymer chain."""
|
|
58
|
+
|
|
59
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
60
|
+
|
|
61
|
+
internal_id: str
|
|
62
|
+
helices: list[list[str]] = []
|
|
63
|
+
residues: dict[str, PDBResidue] = {}
|
|
64
|
+
sequence: str | None
|
|
65
|
+
strands: list[list[str]] = []
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class PDBNonPolymer(BaseModel):
|
|
69
|
+
"""Non-polymeric molecules/atoms (e.g. ions and ligands)."""
|
|
70
|
+
|
|
71
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
72
|
+
|
|
73
|
+
name: str
|
|
74
|
+
full_name: str | None = None
|
|
75
|
+
atoms: dict[int, PDBAtom]
|
|
76
|
+
internal_id: str
|
|
77
|
+
polymer: str
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class PDBModel(BaseModel):
|
|
81
|
+
"""Structure data."""
|
|
82
|
+
|
|
83
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
84
|
+
|
|
85
|
+
polymer: dict[str, PDBPolymer] = {}
|
|
86
|
+
non_polymer: dict[str, PDBNonPolymer] = Field(alias="non-polymer", default_factory=dict)
|
|
87
|
+
branched: dict[str, Any] = {}
|
|
88
|
+
water: dict[str, PDBWater] = {}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class PDBTransformations(BaseModel):
|
|
92
|
+
"""Transformations applied to the structure."""
|
|
93
|
+
|
|
94
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
95
|
+
|
|
96
|
+
chains: list[str]
|
|
97
|
+
matrix: Matrix3x3
|
|
98
|
+
vector: Vector3D
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class PDBAssembly(BaseModel):
|
|
102
|
+
"""How the structure was assembled."""
|
|
103
|
+
|
|
104
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
105
|
+
|
|
106
|
+
transformations: list[PDBTransformations]
|
|
107
|
+
software: str | None
|
|
108
|
+
buried_surface_area: float | None
|
|
109
|
+
surface_area: float | None
|
|
110
|
+
delta_energy: float | None
|
|
111
|
+
id: int
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class PDBCrystallography(BaseModel):
|
|
115
|
+
"""Crystallography related information."""
|
|
116
|
+
|
|
117
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
118
|
+
|
|
119
|
+
space_group: str | None = None
|
|
120
|
+
unit_cell: list[float] | None = None
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class PDBGeometry(BaseModel):
|
|
124
|
+
"""Details of the geometry."""
|
|
125
|
+
|
|
126
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
127
|
+
|
|
128
|
+
assemblies: list[PDBAssembly] = []
|
|
129
|
+
crystallography: PDBCrystallography = Field(default_factory=PDBCrystallography)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class PDBQuality(BaseModel):
|
|
133
|
+
"""Quality metrics."""
|
|
134
|
+
|
|
135
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
136
|
+
|
|
137
|
+
resolution: float | None = None
|
|
138
|
+
rfree: float | None = None
|
|
139
|
+
rvalue: float | None = None
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class PDBMissingResidue(BaseModel):
|
|
143
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
144
|
+
|
|
145
|
+
name: str
|
|
146
|
+
id: str
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class PDBExperiment(BaseModel):
|
|
150
|
+
"""Details of the experiment."""
|
|
151
|
+
|
|
152
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
153
|
+
|
|
154
|
+
expression_system: str | None
|
|
155
|
+
missing_residues: list[PDBMissingResidue] = []
|
|
156
|
+
source_organism: str | None
|
|
157
|
+
technique: str | None
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
class PDBDescription(BaseModel):
|
|
161
|
+
"""A description of the molecule."""
|
|
162
|
+
|
|
163
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
164
|
+
|
|
165
|
+
code: str | None
|
|
166
|
+
title: str | None
|
|
167
|
+
authors: list[str] = []
|
|
168
|
+
classification: str | None
|
|
169
|
+
deposition_date: date | None
|
|
170
|
+
keywords: list[str] = []
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class PDB(BaseModel):
|
|
174
|
+
"""A PDB formatted file."""
|
|
175
|
+
|
|
176
|
+
model_config = ConfigDict(extra=EXTRA)
|
|
177
|
+
|
|
178
|
+
description: PDBDescription
|
|
179
|
+
experiment: PDBExperiment
|
|
180
|
+
geometry: PDBGeometry
|
|
181
|
+
models: list[PDBModel] = []
|
|
182
|
+
quality: PDBQuality = Field(default_factory=PDBQuality)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def read_pdb(path: Path | str) -> PDB:
|
|
186
|
+
"""Read a pdb located at path."""
|
|
187
|
+
return PDB.model_validate(atomium.open(str(path), data_dict=True))
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def fetch_pdb(code: str) -> PDB:
|
|
191
|
+
"""Fetch a pdb from the Protein Data Bank."""
|
|
192
|
+
return PDB.model_validate(atomium.fetch(code, data_dict=True))
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def pdb_from_string(pdb: str) -> PDB:
|
|
196
|
+
"""Read a PDB from a string."""
|
|
197
|
+
return PDB.model_validate(pdb_dict_to_data_dict(pdb_string_to_pdb_dict(pdb)))
|
stjames/settings.py
CHANGED
|
@@ -5,7 +5,7 @@ from pydantic import computed_field, field_validator, model_validator
|
|
|
5
5
|
from .base import Base, UniqueList
|
|
6
6
|
from .basis_set import BasisSet
|
|
7
7
|
from .correction import Correction
|
|
8
|
-
from .method import METHODS_WITH_CORRECTION, PREPACKAGED_METHODS, Method
|
|
8
|
+
from .method import CORRECTABLE_NNP_METHODS, METHODS_WITH_CORRECTION, PREPACKAGED_METHODS, Method
|
|
9
9
|
from .mode import Mode
|
|
10
10
|
from .opt_settings import OptimizationSettings
|
|
11
11
|
from .scf_settings import SCFSettings
|
|
@@ -38,12 +38,14 @@ class Settings(Base):
|
|
|
38
38
|
def level_of_theory(self) -> str:
|
|
39
39
|
corrections = list(filter(lambda x: x not in (None, ""), self.corrections))
|
|
40
40
|
|
|
41
|
-
if self.method in
|
|
41
|
+
if self.method in CORRECTABLE_NNP_METHODS:
|
|
42
|
+
method = self.method.value if not corrections else f"{self.method.value}-{'-'.join(c.value for c in corrections)}"
|
|
43
|
+
elif self.method in PREPACKAGED_METHODS or self.basis_set is None:
|
|
42
44
|
method = self.method.value
|
|
43
|
-
elif self.method in METHODS_WITH_CORRECTION or
|
|
45
|
+
elif self.method in METHODS_WITH_CORRECTION or not corrections:
|
|
44
46
|
method = f"{self.method.value}/{self.basis_set.name.lower()}"
|
|
45
47
|
else:
|
|
46
|
-
method = f"{self.method.value}-{'-'.join(
|
|
48
|
+
method = f"{self.method.value}-{'-'.join(c.value for c in corrections)}/{self.basis_set.name.lower()}"
|
|
47
49
|
|
|
48
50
|
if self.solvent_settings is not None:
|
|
49
51
|
method += f"/{self.solvent_settings.model.value}({self.solvent_settings.solvent.value})"
|
stjames/workflows/__init__.py
CHANGED
|
@@ -9,6 +9,7 @@ from .conformer_search import *
|
|
|
9
9
|
from .descriptors import *
|
|
10
10
|
from .electronic_properties import *
|
|
11
11
|
from .fukui import *
|
|
12
|
+
from .hydrogen_bond_basicity import *
|
|
12
13
|
from .molecular_dynamics import *
|
|
13
14
|
from .multistage_opt import *
|
|
14
15
|
from .pka import *
|
|
@@ -27,6 +28,7 @@ WORKFLOW_NAME = Literal[
|
|
|
27
28
|
"descriptors",
|
|
28
29
|
"electronic_properties",
|
|
29
30
|
"fukui",
|
|
31
|
+
"hydrogen_bond_basicity",
|
|
30
32
|
"molecular_dynamics",
|
|
31
33
|
"multistage_opt",
|
|
32
34
|
"pka",
|
|
@@ -45,6 +47,7 @@ WORKFLOW_MAPPING: dict[str, Workflow] = {
|
|
|
45
47
|
"descriptors": DescriptorsWorkflow, # type: ignore [dict-item]
|
|
46
48
|
"electronic_properties": ElectronicPropertiesWorkflow, # type: ignore [dict-item]
|
|
47
49
|
"fukui": FukuiIndexWorkflow, # type: ignore [dict-item]
|
|
50
|
+
"hydrogen_bond_basicity": HydrogenBondBasicityWorkflow, # type: ignore [dict-item]
|
|
48
51
|
"molecular_dynamics": MolecularDynamicsWorkflow, # type: ignore [dict-item]
|
|
49
52
|
"multistage_opt": MultiStageOptWorkflow, # type: ignore [dict-item]
|
|
50
53
|
"pka": pKaWorkflow, # type: ignore [dict-item]
|
|
@@ -9,6 +9,7 @@ from ..base import LowercaseStrEnum
|
|
|
9
9
|
from ..constraint import Constraint
|
|
10
10
|
from ..method import Method, XTBMethod
|
|
11
11
|
from ..mode import Mode
|
|
12
|
+
from ..task import Task
|
|
12
13
|
from ..types import UUID
|
|
13
14
|
from .multistage_opt import MultiStageOptMixin
|
|
14
15
|
from .workflow import Workflow
|
|
@@ -322,6 +323,45 @@ class ConformerSearchMixin(ConformerGenMixin, MultiStageOptMixin):
|
|
|
322
323
|
"""Return a string representation of the ConformerSearch workflow."""
|
|
323
324
|
return f"<{type(self).__name__} {self.conf_gen_mode.name} {self.mso_mode.name}>"
|
|
324
325
|
|
|
326
|
+
@model_validator(mode="after")
|
|
327
|
+
def deduplicate(self) -> Self:
|
|
328
|
+
"""
|
|
329
|
+
Deduplicate optimizations between conf_gen and multistage_opt.
|
|
330
|
+
|
|
331
|
+
Also affects Manual Mode.
|
|
332
|
+
"""
|
|
333
|
+
cgs = self.conf_gen_settings
|
|
334
|
+
msos = self.multistage_opt_settings
|
|
335
|
+
|
|
336
|
+
if self.transition_state or not msos.optimization_settings:
|
|
337
|
+
return self
|
|
338
|
+
|
|
339
|
+
first_opt = msos.optimization_settings[0]
|
|
340
|
+
if cgs.conf_opt_method != first_opt.method or "optimize" not in first_opt.tasks:
|
|
341
|
+
return self
|
|
342
|
+
|
|
343
|
+
first_opt.tasks.remove(Task.OPTIMIZE)
|
|
344
|
+
if msos.singlepoint_settings or len(msos.optimization_settings) > 1:
|
|
345
|
+
if (not first_opt.tasks) or first_opt.tasks == ["singlepoint"]:
|
|
346
|
+
msos.optimization_settings = msos.optimization_settings[1:]
|
|
347
|
+
|
|
348
|
+
return self
|
|
349
|
+
|
|
350
|
+
@model_validator(mode="after")
|
|
351
|
+
def remove_ts_constraints(self) -> Self:
|
|
352
|
+
"""
|
|
353
|
+
Remove constraints from optimization if a TS.
|
|
354
|
+
|
|
355
|
+
Also affects Manual Mode.
|
|
356
|
+
"""
|
|
357
|
+
msos = self.multistage_opt_settings
|
|
358
|
+
if msos.transition_state and msos.constraints:
|
|
359
|
+
msos.constraints = []
|
|
360
|
+
for opt_set in msos.optimization_settings:
|
|
361
|
+
opt_set.opt_settings.constraints = []
|
|
362
|
+
|
|
363
|
+
return self
|
|
364
|
+
|
|
325
365
|
|
|
326
366
|
class ConformerSearchWorkflow(ConformerSearchMixin, Workflow):
|
|
327
367
|
"""
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
from
|
|
1
|
+
from typing import Annotated, Callable
|
|
2
|
+
|
|
3
|
+
from pydantic import AfterValidator, NonNegativeFloat, NonNegativeInt
|
|
2
4
|
|
|
3
5
|
from ..base import Base
|
|
4
6
|
from ..settings import Settings
|
|
@@ -6,11 +8,22 @@ from ..types import UUID, FloatPerAtom, Matrix3x3, Vector3D
|
|
|
6
8
|
from .workflow import Workflow
|
|
7
9
|
|
|
8
10
|
|
|
11
|
+
def round_float(round_to: int) -> Callable[[float], float]:
|
|
12
|
+
"""Return a function that rounds a float to a given number of decimal places."""
|
|
13
|
+
|
|
14
|
+
def inner_round(v: float) -> float:
|
|
15
|
+
return round(v, round_to)
|
|
16
|
+
|
|
17
|
+
return inner_round
|
|
18
|
+
|
|
19
|
+
|
|
9
20
|
class PropertyCubePoint(Base):
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
"""A point in a cube file, all values rounded to 6 decimal places."""
|
|
22
|
+
|
|
23
|
+
x: Annotated[float, AfterValidator(round_float(3))]
|
|
24
|
+
y: Annotated[float, AfterValidator(round_float(3))]
|
|
25
|
+
z: Annotated[float, AfterValidator(round_float(3))]
|
|
26
|
+
val: Annotated[float, AfterValidator(round_float(6))]
|
|
14
27
|
|
|
15
28
|
|
|
16
29
|
class PropertyCube(Base):
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from ..base import Base
|
|
2
|
+
from ..types import UUID
|
|
3
|
+
from .workflow import Workflow
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class HydrogenBondAcceptorSite(Base):
|
|
7
|
+
atom_idx: int # zero-indexed
|
|
8
|
+
pkbhx: float
|
|
9
|
+
position: tuple[float, float, float]
|
|
10
|
+
name: str | None = None
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class HydrogenBondBasicityWorkflow(Workflow):
|
|
14
|
+
do_csearch: bool = True
|
|
15
|
+
do_optimization: bool = True
|
|
16
|
+
|
|
17
|
+
# UUID of optimization
|
|
18
|
+
optimization: UUID | None = None
|
|
19
|
+
|
|
20
|
+
# hydrogen-bond-acceptor sites
|
|
21
|
+
hba_sites: list[HydrogenBondAcceptorSite] = [] # noqa: RUF012
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from typing import Self
|
|
2
2
|
|
|
3
|
-
from pydantic import PositiveFloat, PositiveInt, model_validator
|
|
3
|
+
from pydantic import PositiveFloat, PositiveInt, computed_field, model_validator
|
|
4
4
|
|
|
5
5
|
from ..base import Base, LowercaseStrEnum
|
|
6
6
|
from ..constraint import PairwiseHarmonicConstraint, SphericalHarmonicConstraint
|
|
@@ -29,7 +29,13 @@ class Frame(Base):
|
|
|
29
29
|
pressure: float
|
|
30
30
|
temperature: float
|
|
31
31
|
volume: float
|
|
32
|
-
|
|
32
|
+
potential_energy: float # kcal/mol
|
|
33
|
+
kinetic_energy: float # kcal/mol
|
|
34
|
+
|
|
35
|
+
@computed_field # type: ignore[misc, prop-decorator, unused-ignore]
|
|
36
|
+
@property
|
|
37
|
+
def energy(self) -> float:
|
|
38
|
+
return self.potential_energy + self.kinetic_energy
|
|
33
39
|
|
|
34
40
|
|
|
35
41
|
class MolecularDynamicsSettings(Base):
|
|
@@ -331,3 +331,29 @@ def build_mso_settings(
|
|
|
331
331
|
transition_state=transition_state,
|
|
332
332
|
frequencies=frequencies,
|
|
333
333
|
)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
def multi_stage_opt_settings_from_workflow(msow: MultiStageOptWorkflow) -> MultiStageOptSettings:
|
|
337
|
+
"""
|
|
338
|
+
Helper function to convert a MultiStageOptWorkflow to MultiStageOptSettings.
|
|
339
|
+
|
|
340
|
+
:param msow: MultiStageOptWorkflow
|
|
341
|
+
:returns: MultiStageOptSettings
|
|
342
|
+
|
|
343
|
+
>>> from stjames.molecule import Atom, Molecule
|
|
344
|
+
>>> He = Molecule(charge=0, multiplicity=1, atoms=[Atom(atomic_number=2, position=[0, 0, 0])])
|
|
345
|
+
>>> msos = multi_stage_opt_settings_from_workflow(
|
|
346
|
+
... MultiStageOptWorkflow(initial_molecule=He, mode=Mode.RAPID, solvent="water")
|
|
347
|
+
... )
|
|
348
|
+
>>> print(msos)
|
|
349
|
+
<MultiStageOptSettings RAPID>
|
|
350
|
+
>>> msos.level_of_theory
|
|
351
|
+
'r2scan_3c/cpcm(water)//gfn2_xtb'
|
|
352
|
+
>>> msos.solvent
|
|
353
|
+
<Solvent.WATER: 'water'>
|
|
354
|
+
>>> msos.xtb_preopt
|
|
355
|
+
False
|
|
356
|
+
"""
|
|
357
|
+
data = dict(msow)
|
|
358
|
+
del data["calculations"]
|
|
359
|
+
return MultiStageOptSettings.construct(**data)
|
stjames/workflows/scan.py
CHANGED
|
@@ -23,7 +23,7 @@ class ScanSettings(Base):
|
|
|
23
23
|
num: int
|
|
24
24
|
|
|
25
25
|
def vals(self) -> NDArray[np.float64]:
|
|
26
|
-
return np.linspace(self.start, self.stop, self.num)
|
|
26
|
+
return np.linspace(self.start, self.stop, self.num) # type: ignore [return-value, unused-ignore]
|
|
27
27
|
|
|
28
28
|
class Config:
|
|
29
29
|
from_attributes = True
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: stjames
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.48
|
|
4
4
|
Summary: standardized JSON atom/molecule encoding scheme
|
|
5
5
|
Author-email: Corin Wagen <corin@rowansci.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/rowansci/stjames
|
|
@@ -8,6 +8,7 @@ Project-URL: Bug Tracker, https://github.com/rowansci/stjames/issues
|
|
|
8
8
|
Requires-Python: >=3.11
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
|
+
Requires-Dist: atomium<2,>=1
|
|
11
12
|
Requires-Dist: pydantic>=2.4
|
|
12
13
|
Requires-Dist: numpy
|
|
13
14
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
stjames/__init__.py,sha256=LkWCylP4VeXyQL0iu5w6yeYK1UHjcUH55hwWXTy4mQQ,576
|
|
2
2
|
stjames/_deprecated_solvent_settings.py,sha256=gj5j9p3zakIwSTK5_ndqBXJx--IzjZNxZ75z-wipLOo,450
|
|
3
3
|
stjames/atom.py,sha256=w7q-x9xpBw4sJ1WGrWt65WAaStxhz-m7dugXCYEOpq4,2064
|
|
4
|
-
stjames/base.py,sha256=
|
|
4
|
+
stjames/base.py,sha256=hroQjvC8G88UiK520i1TDqnOlgw_ihmzevQGTO5yeUY,1215
|
|
5
5
|
stjames/basis_set.py,sha256=wI3M2q9uPf9jhKpAi4E2DrsyKzloDGLRjAlk7krdYgc,949
|
|
6
6
|
stjames/calculation.py,sha256=O2LwwQ_cOLmDOGXTHA9J71YbUZXigUSbvbLA-fSVm3w,915
|
|
7
7
|
stjames/constraint.py,sha256=B6oV0rYjmAWr8gpi5f03gRy_uuqjUURVDVwoez5Cfbg,2442
|
|
@@ -10,14 +10,15 @@ stjames/diis_settings.py,sha256=4m1EQQWBlpHhMnWopix8qOqJv7QCluvdnV9jSKJDFtE,552
|
|
|
10
10
|
stjames/grid_settings.py,sha256=WrSNGc-8_f87YBZYt9Hh7RbhM4MweADoVzwBMcSqcsE,640
|
|
11
11
|
stjames/int_settings.py,sha256=5HXp8opt5ZyY1UpmfaK7NVloWVLM5jkG0elEEqpVLUo,896
|
|
12
12
|
stjames/message.py,sha256=Rq6QqmHZKecWxYH8fVyXmuoCCPZv8YinvgykSeorXSU,216
|
|
13
|
-
stjames/method.py,sha256=
|
|
13
|
+
stjames/method.py,sha256=dWlDoB5xxWqPg6pdQyEeLG7aPsg4cux9ckfaA6GVsD0,2280
|
|
14
14
|
stjames/mode.py,sha256=xw46Cc7f3eTS8i35qECi-8DocAlANhayK3w4akD4HBU,496
|
|
15
15
|
stjames/molecule.py,sha256=v8NikFHfwOahXSo4VKGSqeHKI2HIoRdNjGE0GkZgNS4,10554
|
|
16
16
|
stjames/opt_settings.py,sha256=gxXGtjy9l-Q5Wen9eO6T6HHRCuS8rfOofdVQIJj0JcI,550
|
|
17
|
+
stjames/pdb.py,sha256=goigN-UO72y-nnHmNF4HWp8K_ZYfJorg6TCqWpsNQIU,4519
|
|
17
18
|
stjames/periodic_cell.py,sha256=JDCyynpamggTNi_HnTnnotRbeSMBfYc-srhD-IwUnrg,996
|
|
18
19
|
stjames/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
20
|
stjames/scf_settings.py,sha256=WotVgVrayQ_8PUHP39zVtG7iLT9PV41lpzruttFACP8,2356
|
|
20
|
-
stjames/settings.py,sha256=
|
|
21
|
+
stjames/settings.py,sha256=LNTWHsEfH7Cb87K5BwvgGHBSBedESb7LBn6Dt-oEsV4,8863
|
|
21
22
|
stjames/solvent.py,sha256=u037tmu-9oa21s-WEDZ7VC7nuNVjkqR2ML4JWjWSME4,1158
|
|
22
23
|
stjames/status.py,sha256=wTKNcNxStoEHrxxgr_zTyN90NITa3rxMQZzOgrCifEw,332
|
|
23
24
|
stjames/task.py,sha256=OLINRqe66o7t8arffilwmggrF_7TH0L79u6DhGruxV8,329
|
|
@@ -30,25 +31,26 @@ stjames/data/isotopes.json,sha256=5ba8QnLrHD_Ypv2xekv2cIRwYrX3MQ19-1FOFtt0RuU,83
|
|
|
30
31
|
stjames/data/nist_isotopes.json,sha256=d5DNk1dX0iB1waEYIRR6JMHuA7AuYwSBEgBvb4EKyhM,14300
|
|
31
32
|
stjames/data/read_nist_isotopes.py,sha256=y10FNjW43QpC45qib7VHsIghEwT7GG5rsNwHdc9osRI,3309
|
|
32
33
|
stjames/data/symbol_element.json,sha256=vl_buFusTqBd-muYQtMLtTDLy2OtBI6KkBeqkaWRQrg,1186
|
|
33
|
-
stjames/workflows/__init__.py,sha256=
|
|
34
|
+
stjames/workflows/__init__.py,sha256=XQ89vfQxqz2cWmwcOMp_GKZFQ-RDm8B1s8PqAeQTK3g,1999
|
|
34
35
|
stjames/workflows/admet.py,sha256=V8noO0Eb7h2bDFSnj6Pxv4ILm0lGxyVRCi13hE0zmEQ,149
|
|
35
36
|
stjames/workflows/basic_calculation.py,sha256=q48bpab7ZqmRTR4PsGC6bWkuxqkVdJRM8gysevTYXP0,212
|
|
36
37
|
stjames/workflows/bde.py,sha256=iNrBiAUJA-VaAB-eFddApUO2xIc5PyPYXNtC2stQ_OU,9667
|
|
37
38
|
stjames/workflows/conformer.py,sha256=YYwL3l7OaVeea4N9-ihghwa_ieKY6hia9LNbiTraMb0,2732
|
|
38
|
-
stjames/workflows/conformer_search.py,sha256=
|
|
39
|
+
stjames/workflows/conformer_search.py,sha256=y64WpdVZcrUit9ub-yWwJ0zNK8ofPlcjOG4K6pV6UEM,14241
|
|
39
40
|
stjames/workflows/descriptors.py,sha256=lRRCsGzad3nIg0wI1090ffaXB0FVh0nRRb2lNxCY0kI,281
|
|
40
|
-
stjames/workflows/electronic_properties.py,sha256=
|
|
41
|
+
stjames/workflows/electronic_properties.py,sha256=0PqS04CfLM4pzx67Ph3JJTrzc1LCwDTT5E8x4_wW-g8,3888
|
|
41
42
|
stjames/workflows/fukui.py,sha256=CsJ3_gvzqEqcxwYN7bnNIa37F3KlLm7obsU77TGmDgo,348
|
|
42
|
-
stjames/workflows/
|
|
43
|
-
stjames/workflows/
|
|
43
|
+
stjames/workflows/hydrogen_bond_basicity.py,sha256=Luvov2DlDvZN06W-mU6YaN7wcIrTLwzdoWww-jNE3x4,517
|
|
44
|
+
stjames/workflows/molecular_dynamics.py,sha256=4HmYETU1VT2BA4-PqAayRZLjnj1WuYxd5bqpIyH9g5k,2465
|
|
45
|
+
stjames/workflows/multistage_opt.py,sha256=0ou-UYMGIrewZIg3QZIgwS_eweYdsh2pRplxgRCqLcE,13572
|
|
44
46
|
stjames/workflows/pka.py,sha256=zpR90Yv2L-D56o2mGArM8027DWpnFFnay31UR9Xh5Nc,774
|
|
45
47
|
stjames/workflows/redox_potential.py,sha256=e7WOyTIC_1NPfh7amvW7YzqQezcswX9YaXT-qPiePAo,3651
|
|
46
|
-
stjames/workflows/scan.py,sha256=
|
|
48
|
+
stjames/workflows/scan.py,sha256=cQ29DKlLCH7_6_1TFATnaM3ac9G1asUoRoDDlQYAfG0,860
|
|
47
49
|
stjames/workflows/spin_states.py,sha256=TXHqB7ClTkkCy1Yfcsv99v2woAhT8oG1-uaF20-oMbQ,4592
|
|
48
50
|
stjames/workflows/tautomer.py,sha256=owZOOfGlohxlaOG1pGpx7dVPvas8ZEnl_9Ms5F0Kpms,421
|
|
49
51
|
stjames/workflows/workflow.py,sha256=tIu5naADYgYS7kdW8quvGEWHWosBcrIdcD7L86v-uMQ,976
|
|
50
|
-
stjames-0.0.
|
|
51
|
-
stjames-0.0.
|
|
52
|
-
stjames-0.0.
|
|
53
|
-
stjames-0.0.
|
|
54
|
-
stjames-0.0.
|
|
52
|
+
stjames-0.0.48.dist-info/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
|
|
53
|
+
stjames-0.0.48.dist-info/METADATA,sha256=21oLXoox7mtDp4kQfNijfCbF1rYO4mFo9ZU3VG5U51M,1656
|
|
54
|
+
stjames-0.0.48.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
55
|
+
stjames-0.0.48.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
|
|
56
|
+
stjames-0.0.48.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|