stjames 0.0.43__py3-none-any.whl → 0.0.45__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/constraint.py +38 -4
- stjames/correction.py +3 -0
- stjames/method.py +20 -31
- stjames/molecule.py +7 -7
- stjames/settings.py +129 -122
- stjames/types.py +2 -0
- stjames/workflows/__init__.py +1 -0
- stjames/workflows/bde.py +18 -25
- stjames/workflows/conformer_search.py +345 -0
- stjames/workflows/electronic_properties.py +86 -0
- stjames/workflows/molecular_dynamics.py +12 -3
- stjames/workflows/multistage_opt.py +91 -14
- stjames/workflows/redox_potential.py +68 -4
- stjames/workflows/spin_states.py +2 -14
- stjames/workflows/workflow.py +18 -22
- {stjames-0.0.43.dist-info → stjames-0.0.45.dist-info}/METADATA +1 -1
- {stjames-0.0.43.dist-info → stjames-0.0.45.dist-info}/RECORD +20 -18
- {stjames-0.0.43.dist-info → stjames-0.0.45.dist-info}/WHEEL +1 -1
- {stjames-0.0.43.dist-info → stjames-0.0.45.dist-info}/LICENSE +0 -0
- {stjames-0.0.43.dist-info → stjames-0.0.45.dist-info}/top_level.txt +0 -0
|
@@ -1,19 +1,56 @@
|
|
|
1
|
-
from typing import Any
|
|
1
|
+
from typing import Any, TypeVar
|
|
2
|
+
|
|
3
|
+
from pydantic import ValidationInfo, field_validator, model_validator
|
|
2
4
|
|
|
3
5
|
from ..mode import Mode
|
|
4
6
|
from ..solvent import Solvent
|
|
5
7
|
from ..types import UUID
|
|
8
|
+
from .multistage_opt import MultiStageOptMixin
|
|
6
9
|
from .workflow import Workflow
|
|
7
10
|
|
|
11
|
+
_T = TypeVar("_T")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class RedoxPotentialWorkflow(Workflow, MultiStageOptMixin):
|
|
15
|
+
"""
|
|
16
|
+
Workflow for computing spin states of molecules.
|
|
17
|
+
|
|
18
|
+
Uses the modes from MultiStageOptSettings.
|
|
19
|
+
|
|
20
|
+
Inherited
|
|
21
|
+
:param initial_molecule: Molecule of interest
|
|
22
|
+
:param mode: Mode for workflow
|
|
23
|
+
:param multistage_opt_settings: set by mode unless mode=MANUAL (ignores additional settings if set)
|
|
24
|
+
:param xtb_preopt: pre-optimize with xtb (sets based on mode when None)
|
|
25
|
+
:param constraints: constraints to add
|
|
26
|
+
:param transition_state: whether this is a transition state
|
|
27
|
+
:param frequencies: whether to calculate frequencies
|
|
28
|
+
|
|
29
|
+
Overridden:
|
|
30
|
+
:param mso_mode: Mode for MultiStageOptSettings
|
|
31
|
+
:param solvent: solvent to use for optimization
|
|
32
|
+
|
|
33
|
+
New:
|
|
34
|
+
:param reduction: whether or not to calculate the reduction half-reaction
|
|
35
|
+
:param oxidation: whether or not to calculate the oxidation half-reaction
|
|
36
|
+
:param neutral_molecule: UUID of the calculation for the neutral molecule
|
|
37
|
+
:param anion_molecule: UUID of the calculation for the anion molecule
|
|
38
|
+
:param cation_molecule: UUID of the calculation for the cation molecule
|
|
39
|
+
:param reduction_potential: the final potential, in V
|
|
40
|
+
:param oxidation_potential: the final potential, in V
|
|
41
|
+
|
|
42
|
+
Legacy:
|
|
43
|
+
:param redox_type: one of "reduction" or "oxidation"
|
|
44
|
+
:param redox_potential: the corresponding potential, in V
|
|
45
|
+
"""
|
|
8
46
|
|
|
9
|
-
class RedoxPotentialWorkflow(Workflow):
|
|
10
|
-
mode: Mode = Mode.RAPID
|
|
11
47
|
solvent: Solvent = Solvent.ACETONITRILE
|
|
48
|
+
|
|
12
49
|
reduction: bool = True
|
|
13
50
|
oxidation: bool = True
|
|
14
51
|
|
|
15
52
|
# legacy values - remove in future release!
|
|
16
|
-
redox_type:
|
|
53
|
+
redox_type: str | None = None
|
|
17
54
|
redox_potential: float | None = None
|
|
18
55
|
|
|
19
56
|
# uuids
|
|
@@ -24,6 +61,33 @@ class RedoxPotentialWorkflow(Workflow):
|
|
|
24
61
|
reduction_potential: float | None = None
|
|
25
62
|
oxidation_potential: float | None = None
|
|
26
63
|
|
|
64
|
+
@field_validator("solvent", mode="before")
|
|
65
|
+
@classmethod
|
|
66
|
+
def only_mecn_please(cls, val: Solvent | None) -> Solvent:
|
|
67
|
+
"""Only MeCN please!"""
|
|
68
|
+
if val != Solvent.ACETONITRILE:
|
|
69
|
+
raise ValueError("Only acetonitrile permitted!")
|
|
70
|
+
|
|
71
|
+
return val
|
|
72
|
+
|
|
73
|
+
@field_validator("constraints", "transition_state")
|
|
74
|
+
@classmethod
|
|
75
|
+
def turned_off(cls, value: _T, info: ValidationInfo) -> _T:
|
|
76
|
+
if value:
|
|
77
|
+
raise ValueError(f"{info.field_name} not supported in redox potential workflows.")
|
|
78
|
+
|
|
79
|
+
return value
|
|
80
|
+
|
|
81
|
+
@model_validator(mode="before")
|
|
82
|
+
@classmethod
|
|
83
|
+
def set_mode_and_mso_mode(cls, values: dict[str, Any]) -> dict[str, Any]:
|
|
84
|
+
"""Set the MultiStageOptSettings mode to match current redox potential mode, and select mode if `Auto`."""
|
|
85
|
+
if ("mode" not in values) or (values["mode"] == Mode.AUTO):
|
|
86
|
+
values["mode"] = Mode.RAPID
|
|
87
|
+
|
|
88
|
+
values["mso_mode"] = values["mode"]
|
|
89
|
+
return values
|
|
90
|
+
|
|
27
91
|
def model_post_init(self, __context: Any) -> None:
|
|
28
92
|
"""Keep back-compatible with old schema."""
|
|
29
93
|
if self.redox_type == "oxidation":
|
stjames/workflows/spin_states.py
CHANGED
|
@@ -49,8 +49,9 @@ class SpinStatesWorkflow(Workflow, MultiStageOptMixin):
|
|
|
49
49
|
|
|
50
50
|
Inherited
|
|
51
51
|
:param initial_molecule: Molecule of interest
|
|
52
|
+
:param mode: Mode for workflow
|
|
52
53
|
:param multistage_opt_settings: set by mode unless mode=MANUAL (ignores additional settings if set)
|
|
53
|
-
:param solvent: solvent to use
|
|
54
|
+
:param solvent: solvent to use for optimization
|
|
54
55
|
:param xtb_preopt: pre-optimize with xtb (sets based on mode when None)
|
|
55
56
|
:param constraints: constraints to add
|
|
56
57
|
:param transition_state: whether this is a transition state
|
|
@@ -60,7 +61,6 @@ class SpinStatesWorkflow(Workflow, MultiStageOptMixin):
|
|
|
60
61
|
:param mso_mode: Mode for MultiStageOptSettings
|
|
61
62
|
|
|
62
63
|
New:
|
|
63
|
-
:param mode: Mode for workflow
|
|
64
64
|
:param states: multiplicities of the spin state targetted
|
|
65
65
|
:param spin_states: resulting spin states data
|
|
66
66
|
|
|
@@ -72,16 +72,12 @@ class SpinStatesWorkflow(Workflow, MultiStageOptMixin):
|
|
|
72
72
|
'<SpinStatesWorkflow [1, 3, 5] RAPID>'
|
|
73
73
|
"""
|
|
74
74
|
|
|
75
|
-
mode: Mode
|
|
76
75
|
mso_mode: Mode = _sentinel_mso_mode # type: ignore [assignment]
|
|
77
76
|
states: list[PositiveInt]
|
|
78
77
|
|
|
79
78
|
# Results
|
|
80
79
|
spin_states: list[SpinState] = Field(default_factory=list)
|
|
81
80
|
|
|
82
|
-
def __str__(self) -> str:
|
|
83
|
-
return repr(self)
|
|
84
|
-
|
|
85
81
|
def __repr__(self) -> str:
|
|
86
82
|
if self.mode != Mode.MANUAL:
|
|
87
83
|
return f"<{type(self).__name__} {self.states} {self.mode.name}>"
|
|
@@ -121,14 +117,6 @@ class SpinStatesWorkflow(Workflow, MultiStageOptMixin):
|
|
|
121
117
|
values["mso_mode"] = values["mode"]
|
|
122
118
|
return values
|
|
123
119
|
|
|
124
|
-
@field_validator("mode")
|
|
125
|
-
@classmethod
|
|
126
|
-
def set_mode_auto(cls, mode: Mode) -> Mode:
|
|
127
|
-
if mode == Mode.AUTO:
|
|
128
|
-
return Mode.RAPID
|
|
129
|
-
|
|
130
|
-
return mode
|
|
131
|
-
|
|
132
120
|
@field_validator("spin_states")
|
|
133
121
|
@classmethod
|
|
134
122
|
def validate_spin_states(cls, spin_states: list[SpinState]) -> list[SpinState]:
|
stjames/workflows/workflow.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from pydantic import
|
|
1
|
+
from pydantic import field_validator
|
|
2
2
|
|
|
3
3
|
from ..base import Base
|
|
4
4
|
from ..message import Message
|
|
@@ -8,30 +8,17 @@ from ..types import UUID
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class Workflow(Base):
|
|
11
|
-
"""All workflows should have these properties."""
|
|
12
|
-
|
|
13
|
-
initial_molecule: Molecule
|
|
14
|
-
messages: list[Message] = []
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class DBCalculation(Base):
|
|
18
|
-
"""Encodes a calculation that's in the database. This isn't terribly useful by itself."""
|
|
19
|
-
|
|
20
|
-
uuid: UUID
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class WorkflowInput(BaseModel):
|
|
24
11
|
"""
|
|
25
|
-
|
|
12
|
+
Base class for Workflows.
|
|
26
13
|
|
|
27
14
|
:param initial_molecule: Molecule of interest
|
|
28
|
-
:param mode: Mode
|
|
15
|
+
:param mode: Mode to use
|
|
16
|
+
:param messages: messages to display
|
|
29
17
|
"""
|
|
30
18
|
|
|
31
|
-
model_config = ConfigDict(extra="forbid")
|
|
32
|
-
|
|
33
19
|
initial_molecule: Molecule
|
|
34
|
-
mode: Mode
|
|
20
|
+
mode: Mode = Mode.AUTO
|
|
21
|
+
messages: list[Message] = []
|
|
35
22
|
|
|
36
23
|
def __str__(self) -> str:
|
|
37
24
|
return repr(self)
|
|
@@ -39,8 +26,17 @@ class WorkflowInput(BaseModel):
|
|
|
39
26
|
def __repr__(self) -> str:
|
|
40
27
|
return f"<{type(self).__name__} {self.mode.name}>"
|
|
41
28
|
|
|
29
|
+
@field_validator("mode")
|
|
30
|
+
@classmethod
|
|
31
|
+
def set_mode_auto(cls, mode: Mode) -> Mode:
|
|
32
|
+
"""Set the mode to RAPID if AUTO is selected."""
|
|
33
|
+
if mode == Mode.AUTO:
|
|
34
|
+
return Mode.RAPID
|
|
35
|
+
|
|
36
|
+
return mode
|
|
42
37
|
|
|
43
|
-
class WorkflowResults(BaseModel):
|
|
44
|
-
"""Results of a workflow."""
|
|
45
38
|
|
|
46
|
-
|
|
39
|
+
class DBCalculation(Base):
|
|
40
|
+
"""Encodes a calculation that's in the database. This isn't terribly useful by itself."""
|
|
41
|
+
|
|
42
|
+
uuid: UUID
|
|
@@ -4,25 +4,25 @@ stjames/atom.py,sha256=w7q-x9xpBw4sJ1WGrWt65WAaStxhz-m7dugXCYEOpq4,2064
|
|
|
4
4
|
stjames/base.py,sha256=9PvUjBeVSkmA3TaruaB0uvjFMbWYTGKXECISNGAj_AU,1201
|
|
5
5
|
stjames/basis_set.py,sha256=wI3M2q9uPf9jhKpAi4E2DrsyKzloDGLRjAlk7krdYgc,949
|
|
6
6
|
stjames/calculation.py,sha256=O2LwwQ_cOLmDOGXTHA9J71YbUZXigUSbvbLA-fSVm3w,915
|
|
7
|
-
stjames/constraint.py,sha256=
|
|
8
|
-
stjames/correction.py,sha256=
|
|
7
|
+
stjames/constraint.py,sha256=aD4JkNIyya5uh016R68WLYLd0AK6msgki7Q1kAKGzRs,2203
|
|
8
|
+
stjames/correction.py,sha256=ZVErCcj4TPyZeKrdvXVjHa0tFynsCaoy96QZUVxWFM8,413
|
|
9
9
|
stjames/diis_settings.py,sha256=QHc7L-hktkbOWBYr29byTdqL8lWJzKJiY9XW8ha4Qzo,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=a6QQff-0YsutkOTuOcGrdDW76x9ZexiNLdKzzoE1Vcw,1698
|
|
14
14
|
stjames/mode.py,sha256=xw46Cc7f3eTS8i35qECi-8DocAlANhayK3w4akD4HBU,496
|
|
15
|
-
stjames/molecule.py,sha256=
|
|
15
|
+
stjames/molecule.py,sha256=v8NikFHfwOahXSo4VKGSqeHKI2HIoRdNjGE0GkZgNS4,10554
|
|
16
16
|
stjames/opt_settings.py,sha256=gxXGtjy9l-Q5Wen9eO6T6HHRCuS8rfOofdVQIJj0JcI,550
|
|
17
17
|
stjames/periodic_cell.py,sha256=JDCyynpamggTNi_HnTnnotRbeSMBfYc-srhD-IwUnrg,996
|
|
18
18
|
stjames/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
stjames/scf_settings.py,sha256=xMMCQ0hVB4nNFSiWesNQZUa_aLsozSZGYWweAPPDGBg,2356
|
|
20
|
-
stjames/settings.py,sha256
|
|
20
|
+
stjames/settings.py,sha256=tfgEYns6WdsheQ6wpR6uyI8O4s2iTqyH7YWtNQ36k74,8666
|
|
21
21
|
stjames/solvent.py,sha256=u037tmu-9oa21s-WEDZ7VC7nuNVjkqR2ML4JWjWSME4,1158
|
|
22
22
|
stjames/status.py,sha256=wTKNcNxStoEHrxxgr_zTyN90NITa3rxMQZzOgrCifEw,332
|
|
23
23
|
stjames/task.py,sha256=OLINRqe66o7t8arffilwmggrF_7TH0L79u6DhGruxV8,329
|
|
24
24
|
stjames/thermochem_settings.py,sha256=ZTLz31v8Ltutde5Nfm0vH5YahWjcfFWfr_R856KffxE,517
|
|
25
|
-
stjames/types.py,sha256=
|
|
25
|
+
stjames/types.py,sha256=CPKR0g_kdFejMjGdKBjtuJRQqfmAZ-uIaSuGR1vBzCQ,245
|
|
26
26
|
stjames/data/__init__.py,sha256=O59Ksp7AIqwOELCWymfCx7YeBzwNOGCMlGQi7tNLqiE,24
|
|
27
27
|
stjames/data/bragg_radii.json,sha256=hhbn-xyZNSdmnULIjN2Cvq-_BGIZIqG243Ls_mey61w,1350
|
|
28
28
|
stjames/data/elements.py,sha256=9BW01LZlyJ0H5s7Q26vUmjZIST41fwOYYrGvmPd7q0w,858
|
|
@@ -30,23 +30,25 @@ stjames/data/isotopes.json,sha256=5ba8QnLrHD_Ypv2xekv2cIRwYrX3MQ19-1FOFtt0RuU,83
|
|
|
30
30
|
stjames/data/nist_isotopes.json,sha256=d5DNk1dX0iB1waEYIRR6JMHuA7AuYwSBEgBvb4EKyhM,14300
|
|
31
31
|
stjames/data/read_nist_isotopes.py,sha256=y10FNjW43QpC45qib7VHsIghEwT7GG5rsNwHdc9osRI,3309
|
|
32
32
|
stjames/data/symbol_element.json,sha256=vl_buFusTqBd-muYQtMLtTDLy2OtBI6KkBeqkaWRQrg,1186
|
|
33
|
-
stjames/workflows/__init__.py,sha256=
|
|
33
|
+
stjames/workflows/__init__.py,sha256=JwcKWrXtrYKJfe6tPbVy6JKSwYxeEaiJWFDL3cVDXf8,363
|
|
34
34
|
stjames/workflows/admet.py,sha256=V8noO0Eb7h2bDFSnj6Pxv4ILm0lGxyVRCi13hE0zmEQ,149
|
|
35
35
|
stjames/workflows/basic_calculation.py,sha256=q48bpab7ZqmRTR4PsGC6bWkuxqkVdJRM8gysevTYXP0,212
|
|
36
|
-
stjames/workflows/bde.py,sha256=
|
|
36
|
+
stjames/workflows/bde.py,sha256=QAcG-ifw_BSyPspOH4EsLNqc3M3b2Xeu4-I2cj-SqoE,9697
|
|
37
37
|
stjames/workflows/conformer.py,sha256=YYwL3l7OaVeea4N9-ihghwa_ieKY6hia9LNbiTraMb0,2732
|
|
38
|
+
stjames/workflows/conformer_search.py,sha256=PjFvotJ3BEMQqsirRxwH7wOIsnV12VuyXQCIyC2NSKE,12485
|
|
38
39
|
stjames/workflows/descriptors.py,sha256=jQ3RuMi7xk799JZ_AL1ARL3yQfWLG03L_VVsK4KIMeY,281
|
|
40
|
+
stjames/workflows/electronic_properties.py,sha256=y4tQl1r6K-Wt_sTjrVyQkq0zukeFQ4KlBrSZgIBZp6Y,3100
|
|
39
41
|
stjames/workflows/fukui.py,sha256=F5tw5jTqBimo_GiXuThhRpoxauZE5YadZjObLFDCba8,348
|
|
40
|
-
stjames/workflows/molecular_dynamics.py,sha256=
|
|
41
|
-
stjames/workflows/multistage_opt.py,sha256=
|
|
42
|
+
stjames/workflows/molecular_dynamics.py,sha256=Y3xUJaCO0A4VHvhEHlqJWu2IrEfruCRTqfnC6SdJu18,2194
|
|
43
|
+
stjames/workflows/multistage_opt.py,sha256=gUHtsl3DRvtaZ13_L8CCzAKwridVRnY-0QBNAN0Fq4g,12964
|
|
42
44
|
stjames/workflows/pka.py,sha256=zpR90Yv2L-D56o2mGArM8027DWpnFFnay31UR9Xh5Nc,774
|
|
43
|
-
stjames/workflows/redox_potential.py,sha256=
|
|
45
|
+
stjames/workflows/redox_potential.py,sha256=Jteftsi9SLu2Z4Cq5XpKn9kwn0z3Hkbyfx4Y1p8rCsw,3651
|
|
44
46
|
stjames/workflows/scan.py,sha256=hL4Hco3Ns0dntjh2G2HhhWmED1mbt0gA_hsglPQ5Vjg,814
|
|
45
|
-
stjames/workflows/spin_states.py,sha256=
|
|
47
|
+
stjames/workflows/spin_states.py,sha256=VcCRr7dV-zpazHTkVWb9qds7_4QpTe-Hz_ECdUG9S_Y,4623
|
|
46
48
|
stjames/workflows/tautomer.py,sha256=kZSCHo2Q7LzqtQjF_WyyxjECkndG49T9QOM12hsUkx8,421
|
|
47
|
-
stjames/workflows/workflow.py,sha256=
|
|
48
|
-
stjames-0.0.
|
|
49
|
-
stjames-0.0.
|
|
50
|
-
stjames-0.0.
|
|
51
|
-
stjames-0.0.
|
|
52
|
-
stjames-0.0.
|
|
49
|
+
stjames/workflows/workflow.py,sha256=tIu5naADYgYS7kdW8quvGEWHWosBcrIdcD7L86v-uMQ,976
|
|
50
|
+
stjames-0.0.45.dist-info/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
|
|
51
|
+
stjames-0.0.45.dist-info/METADATA,sha256=cXN2IrU7jfMFtL93PeemKYzPCGNGZgV7MlQQSOnJL2A,1628
|
|
52
|
+
stjames-0.0.45.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
53
|
+
stjames-0.0.45.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
|
|
54
|
+
stjames-0.0.45.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|