stjames 0.0.103__py3-none-any.whl → 0.0.105__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.

@@ -1,14 +1,38 @@
1
1
  """Ion mobility workflow."""
2
2
 
3
- from typing import Annotated
3
+ from typing import Annotated, Self
4
4
 
5
- from pydantic import AfterValidator
5
+ from pydantic import AfterValidator, computed_field, model_validator
6
6
 
7
- from ..base import round_optional_float
7
+ from ..base import Base, round_optional_float
8
+ from ..data import ELEMENT_SYMBOL
8
9
  from ..types import UUID, round_list
9
10
  from .workflow import MoleculeWorkflow
10
11
 
11
12
 
13
+ class IonMobilityForcefieldElement(Base):
14
+ """
15
+ A single atom specification for the ion-mobility forcefield.
16
+
17
+ :param name: the name of the element (e.g. "Hydrogen")
18
+ :param atomic_number: the element's atomic number
19
+ :param mass: the mass of the element in Daltons (e.g. 1.00794)
20
+ :param sigma: the sigma Lennard-Jones parameter, in Å
21
+ :param epsilon: the epsilon Lennard-Jones parameter, in kcal/mol
22
+ """
23
+
24
+ name: str
25
+ atomic_number: int
26
+ mass: float
27
+ sigma: float
28
+ epsilon: float
29
+
30
+ @computed_field # type: ignore[misc, prop-decorator, unused-ignore]
31
+ @property
32
+ def symbol(self) -> str:
33
+ return ELEMENT_SYMBOL[self.atomic_number]
34
+
35
+
12
36
  class IonMobilityWorkflow(MoleculeWorkflow):
13
37
  """
14
38
  Workflow for calculating hydrogen bond basicity.
@@ -22,6 +46,8 @@ class IonMobilityWorkflow(MoleculeWorkflow):
22
46
  :param temperature: the temperature, in Kelvin
23
47
  :param do_csearch: whether to perform a conformational search
24
48
  :param do_optimization: whether to perform an optimization
49
+ :param forcefield: the forcefield used to describe atom–gas interactions.
50
+ if None, the default forcefield will be used.
25
51
 
26
52
  Results:
27
53
  :param conformers: the UUIDs of the conformers
@@ -37,6 +63,8 @@ class IonMobilityWorkflow(MoleculeWorkflow):
37
63
  do_csearch: bool = True
38
64
  do_optimization: bool = True
39
65
 
66
+ forcefield: list[IonMobilityForcefieldElement] | None = None
67
+
40
68
  conformers: list[UUID] = []
41
69
 
42
70
  conformer_ccs: Annotated[list[float], AfterValidator(round_list(3))] = []
@@ -45,3 +73,13 @@ class IonMobilityWorkflow(MoleculeWorkflow):
45
73
 
46
74
  average_ccs: Annotated[float | None, AfterValidator(round_optional_float(3))] = None
47
75
  average_ccs_stdev: Annotated[float | None, AfterValidator(round_optional_float(3))] = None
76
+
77
+ @model_validator(mode="after")
78
+ def check_supported_atoms(self) -> Self:
79
+ """Validate that user-supplied forcefields have correct atoms."""
80
+ if self.forcefield is not None:
81
+ supported_atoms = set(e.atomic_number for e in self.forcefield)
82
+ if not all(z in supported_atoms for z in self.initial_molecule.atomic_numbers):
83
+ raise ValueError("Provided forcefield does not support all elements in input structure!")
84
+
85
+ return self
stjames/workflows/nmr.py CHANGED
@@ -9,7 +9,7 @@ from ..mode import Mode
9
9
  from ..settings import Settings
10
10
  from ..solvent import Solvent
11
11
  from ..types import UUID, round_list
12
- from .conformer_search import ConformerGenSettings, iMTDSettings
12
+ from .conformer_search import ConformerGenSettingsUnion, iMTDSettings
13
13
  from .multistage_opt import MultiStageOptSettings
14
14
  from .workflow import MoleculeWorkflow
15
15
 
@@ -58,7 +58,7 @@ class NMRSpectroscopyWorkflow(MoleculeWorkflow):
58
58
  nmr_method: NMRMethod = NMRMethod.MAGNETZERO
59
59
  solvent: Solvent = Solvent.CHLOROFORM
60
60
 
61
- conf_gen_settings: ConformerGenSettings | None = iMTDSettings(mode="careful")
61
+ conf_gen_settings: ConformerGenSettingsUnion | None = iMTDSettings(mode="careful")
62
62
  multistage_opt_settings: MultiStageOptSettings | None = MultiStageOptSettings(
63
63
  mode=Mode.MANUAL,
64
64
  optimization_settings=[Settings(method="aimnet2_wb97md3", tasks=["optimize"])],
@@ -41,6 +41,7 @@ class SolubilityWorkflow(SMILESWorkflow):
41
41
 
42
42
  Inputs:
43
43
  :param initial_smiles: SMILES string of the molecule
44
+ :param solubility_method: model used for solubility prediction
44
45
  :param solvents: list of solvent SMILES strings
45
46
  :param temperatures: temperatures in K
46
47
 
@@ -48,8 +49,8 @@ class SolubilityWorkflow(SMILESWorkflow):
48
49
  :param solubilities: {solvent: SolubilityResult}
49
50
  """
50
51
 
51
- solubility_method: SolubilityMethod = SolubilityMethod.FASTSOLV
52
52
  initial_smiles: str
53
+ solubility_method: SolubilityMethod = SolubilityMethod.FASTSOLV
53
54
  solvents: list[str] = ["O"]
54
55
  temperatures: list[float] = [298.15]
55
56
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.103
3
+ Version: 0.0.105
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
@@ -49,23 +49,23 @@ stjames/workflows/double_ended_ts_search.py,sha256=ovJgEVFc6c3mijCE3TKAY70YvqNmA
49
49
  stjames/workflows/electronic_properties.py,sha256=GT3-NC7w-dbcOJ-3AzJ7LgzH6frTbiH2Iyb9BCa-SvY,4112
50
50
  stjames/workflows/fukui.py,sha256=095GDGSSEc5PDD1aoKM8J7icgR5tfwS5Bs9XxFQHge4,2387
51
51
  stjames/workflows/hydrogen_bond_basicity.py,sha256=q9eXty68ZyCmrB6G_8bfeOT8Ui_IQquRPu6z-3rNreQ,1589
52
- stjames/workflows/ion_mobility.py,sha256=rvvAt4ZD-Npl0tHL7TEuaS3XKjHiMkSZVzyJoivdyps,1665
52
+ stjames/workflows/ion_mobility.py,sha256=5vUjEYCnF9sN3dTqqEgWAq0jAfdoFvkLubemoXE8DLc,3125
53
53
  stjames/workflows/irc.py,sha256=ZP7icylW8rgo_Uh7h3bmyumn0ru1IyF-61nP5Jnmq3M,3402
54
54
  stjames/workflows/macropka.py,sha256=Krj0xXuB-u57Kqlf4bbRiHDUWCpliFr6YPiYqPmYaWk,3803
55
55
  stjames/workflows/molecular_dynamics.py,sha256=HqWNxxPSAphfI0DdbTERFkq8UeBjEvhnA_ETv0xw_RY,3522
56
56
  stjames/workflows/multistage_opt.py,sha256=UN-4WLsT2WEjO5KqDPrcCkb708Co-ZScHx3g2bto768,16597
57
- stjames/workflows/nmr.py,sha256=2314qzkAFt-Wu6IDC2AI7eedYocqcCxIy9uZWkHMz_Q,2671
57
+ stjames/workflows/nmr.py,sha256=1QEF4SB6dWIr-jzLEZ7V972UnRUOTufOJSHwIGyV3dM,2681
58
58
  stjames/workflows/pka.py,sha256=j3vBh2YM3nJzJ1XJKPsmYahRCeaU9n3P-G-u9_moaFw,2065
59
59
  stjames/workflows/pose_analysis_md.py,sha256=ES0XlzaLpTjhLrNvcB0zFZa1b1ZHXekN72EbLsx0Skw,4723
60
60
  stjames/workflows/protein_cofolding.py,sha256=ZjHER5DsO2vgCpgqttcNIU8xISN5B4DdqdrTxLKFsKY,2998
61
61
  stjames/workflows/redox_potential.py,sha256=7S18t9Y3eynSnA3lZbRlvLfdbgeBopdiigLzt1zxg5c,3871
62
62
  stjames/workflows/scan.py,sha256=DXQBpa2t2PowAtOwmdgpxaSLq--fEShljzAGSb8Nf5U,2993
63
- stjames/workflows/solubility.py,sha256=DhsOxThAslWihpvOKJINNeMiBWSEzRsdqBlfgo2PwX4,2961
63
+ stjames/workflows/solubility.py,sha256=lfCVvJjqEaddLUpK6WBxjB7u12Sci-K95A5_qIMkIRM,3028
64
64
  stjames/workflows/spin_states.py,sha256=0degmE-frovgoXweshZyjfjqL7nkbaFoO9YoJhvQnaI,4748
65
65
  stjames/workflows/tautomer.py,sha256=7eYKziGPg8Km6lfowTzSkgJfJ4SHUPrAmnTf8Bi-SB0,1164
66
66
  stjames/workflows/workflow.py,sha256=OE05pt2ZOd8TzTOlBngXCVg9wv_553ZR60VNRPlq0f8,1953
67
- stjames-0.0.103.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
68
- stjames-0.0.103.dist-info/METADATA,sha256=ncWtuaR7uYzpmbJ89kySb8O5pJwKJDFX9jBQ5OXl9GY,1725
69
- stjames-0.0.103.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
- stjames-0.0.103.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
71
- stjames-0.0.103.dist-info/RECORD,,
67
+ stjames-0.0.105.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
68
+ stjames-0.0.105.dist-info/METADATA,sha256=H8v2QtQVxJf93AM44xzVNicBeQUgxtKRtIT9T2Llb38,1725
69
+ stjames-0.0.105.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
+ stjames-0.0.105.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
71
+ stjames-0.0.105.dist-info/RECORD,,