stjames 0.0.103__py3-none-any.whl → 0.0.104__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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.103
3
+ Version: 0.0.104
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,7 +49,7 @@ 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
@@ -64,8 +64,8 @@ stjames/workflows/solubility.py,sha256=DhsOxThAslWihpvOKJINNeMiBWSEzRsdqBlfgo2Pw
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.104.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
68
+ stjames-0.0.104.dist-info/METADATA,sha256=QxRGE9VE23ySAMwV5fF1-76H1oupQDGabT8aTMdUz7k,1725
69
+ stjames-0.0.104.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
+ stjames-0.0.104.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
71
+ stjames-0.0.104.dist-info/RECORD,,