stjames 0.0.87__tar.gz → 0.0.89__tar.gz

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.

Files changed (80) hide show
  1. {stjames-0.0.87/stjames.egg-info → stjames-0.0.89}/PKG-INFO +1 -1
  2. {stjames-0.0.87 → stjames-0.0.89}/pyproject.toml +1 -1
  3. {stjames-0.0.87 → stjames-0.0.89}/stjames/method.py +3 -0
  4. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/bde.py +31 -4
  5. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/multistage_opt.py +0 -1
  6. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/pose_analysis_md.py +4 -3
  7. {stjames-0.0.87 → stjames-0.0.89/stjames.egg-info}/PKG-INFO +1 -1
  8. {stjames-0.0.87 → stjames-0.0.89}/LICENSE +0 -0
  9. {stjames-0.0.87 → stjames-0.0.89}/README.md +0 -0
  10. {stjames-0.0.87 → stjames-0.0.89}/setup.cfg +0 -0
  11. {stjames-0.0.87 → stjames-0.0.89}/stjames/__init__.py +0 -0
  12. {stjames-0.0.87 → stjames-0.0.89}/stjames/_deprecated_solvent_settings.py +0 -0
  13. {stjames-0.0.87 → stjames-0.0.89}/stjames/atom.py +0 -0
  14. {stjames-0.0.87 → stjames-0.0.89}/stjames/atomium_stjames/__init__.py +0 -0
  15. {stjames-0.0.87 → stjames-0.0.89}/stjames/atomium_stjames/data.py +0 -0
  16. {stjames-0.0.87 → stjames-0.0.89}/stjames/atomium_stjames/mmcif.py +0 -0
  17. {stjames-0.0.87 → stjames-0.0.89}/stjames/atomium_stjames/pdb.py +0 -0
  18. {stjames-0.0.87 → stjames-0.0.89}/stjames/atomium_stjames/utilities.py +0 -0
  19. {stjames-0.0.87 → stjames-0.0.89}/stjames/base.py +0 -0
  20. {stjames-0.0.87 → stjames-0.0.89}/stjames/basis_set.py +0 -0
  21. {stjames-0.0.87 → stjames-0.0.89}/stjames/calculation.py +0 -0
  22. {stjames-0.0.87 → stjames-0.0.89}/stjames/compute_settings.py +0 -0
  23. {stjames-0.0.87 → stjames-0.0.89}/stjames/constraint.py +0 -0
  24. {stjames-0.0.87 → stjames-0.0.89}/stjames/correction.py +0 -0
  25. {stjames-0.0.87 → stjames-0.0.89}/stjames/data/__init__.py +0 -0
  26. {stjames-0.0.87 → stjames-0.0.89}/stjames/data/bragg_radii.json +0 -0
  27. {stjames-0.0.87 → stjames-0.0.89}/stjames/data/elements.py +0 -0
  28. {stjames-0.0.87 → stjames-0.0.89}/stjames/data/isotopes.json +0 -0
  29. {stjames-0.0.87 → stjames-0.0.89}/stjames/data/nist_isotopes.json +0 -0
  30. {stjames-0.0.87 → stjames-0.0.89}/stjames/data/read_nist_isotopes.py +0 -0
  31. {stjames-0.0.87 → stjames-0.0.89}/stjames/data/symbol_element.json +0 -0
  32. {stjames-0.0.87 → stjames-0.0.89}/stjames/diis_settings.py +0 -0
  33. {stjames-0.0.87 → stjames-0.0.89}/stjames/grid_settings.py +0 -0
  34. {stjames-0.0.87 → stjames-0.0.89}/stjames/int_settings.py +0 -0
  35. {stjames-0.0.87 → stjames-0.0.89}/stjames/message.py +0 -0
  36. {stjames-0.0.87 → stjames-0.0.89}/stjames/mode.py +0 -0
  37. {stjames-0.0.87 → stjames-0.0.89}/stjames/molecule.py +0 -0
  38. {stjames-0.0.87 → stjames-0.0.89}/stjames/opt_settings.py +0 -0
  39. {stjames-0.0.87 → stjames-0.0.89}/stjames/pdb.py +0 -0
  40. {stjames-0.0.87 → stjames-0.0.89}/stjames/periodic_cell.py +0 -0
  41. {stjames-0.0.87 → stjames-0.0.89}/stjames/py.typed +0 -0
  42. {stjames-0.0.87 → stjames-0.0.89}/stjames/scf_settings.py +0 -0
  43. {stjames-0.0.87 → stjames-0.0.89}/stjames/settings.py +0 -0
  44. {stjames-0.0.87 → stjames-0.0.89}/stjames/solvent.py +0 -0
  45. {stjames-0.0.87 → stjames-0.0.89}/stjames/status.py +0 -0
  46. {stjames-0.0.87 → stjames-0.0.89}/stjames/task.py +0 -0
  47. {stjames-0.0.87 → stjames-0.0.89}/stjames/thermochem_settings.py +0 -0
  48. {stjames-0.0.87 → stjames-0.0.89}/stjames/types.py +0 -0
  49. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/__init__.py +0 -0
  50. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/admet.py +0 -0
  51. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/basic_calculation.py +0 -0
  52. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/conformer.py +0 -0
  53. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/conformer_search.py +0 -0
  54. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/descriptors.py +0 -0
  55. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/docking.py +0 -0
  56. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/electronic_properties.py +0 -0
  57. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/fukui.py +0 -0
  58. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/hydrogen_bond_basicity.py +0 -0
  59. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/ion_mobility.py +0 -0
  60. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/irc.py +0 -0
  61. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/macropka.py +0 -0
  62. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/molecular_dynamics.py +0 -0
  63. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/pka.py +0 -0
  64. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/protein_cofolding.py +0 -0
  65. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/redox_potential.py +0 -0
  66. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/scan.py +0 -0
  67. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/solubility.py +0 -0
  68. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/spin_states.py +0 -0
  69. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/tautomer.py +0 -0
  70. {stjames-0.0.87 → stjames-0.0.89}/stjames/workflows/workflow.py +0 -0
  71. {stjames-0.0.87 → stjames-0.0.89}/stjames.egg-info/SOURCES.txt +0 -0
  72. {stjames-0.0.87 → stjames-0.0.89}/stjames.egg-info/dependency_links.txt +0 -0
  73. {stjames-0.0.87 → stjames-0.0.89}/stjames.egg-info/requires.txt +0 -0
  74. {stjames-0.0.87 → stjames-0.0.89}/stjames.egg-info/top_level.txt +0 -0
  75. {stjames-0.0.87 → stjames-0.0.89}/tests/test_constraints.py +0 -0
  76. {stjames-0.0.87 → stjames-0.0.89}/tests/test_from_extxyz.py +0 -0
  77. {stjames-0.0.87 → stjames-0.0.89}/tests/test_molecule.py +0 -0
  78. {stjames-0.0.87 → stjames-0.0.89}/tests/test_pdb.py +0 -0
  79. {stjames-0.0.87 → stjames-0.0.89}/tests/test_rounding.py +0 -0
  80. {stjames-0.0.87 → stjames-0.0.89}/tests/test_settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.87
3
+ Version: 0.0.89
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stjames"
3
- version = "0.0.87"
3
+ version = "0.0.89"
4
4
  description = "standardized JSON atom/molecule encoding scheme"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -36,6 +36,7 @@ class Method(LowercaseStrEnum):
36
36
  OCP24_S = "ocp24_s"
37
37
  OCP24_L = "ocp24_l"
38
38
  OMOL25_CONSERVING_S = "omol25_conserving_s"
39
+ UMA_M_OMOL = "uma_m_omol"
39
40
  ORB_V2 = "orb_v2"
40
41
  ORB_V3_CONSERVATIVE_INF_OMAT = "orb_v3_conservative_inf_omat"
41
42
 
@@ -62,6 +63,7 @@ PrepackagedNNPMethod = Literal[
62
63
  Method.OCP24_S,
63
64
  Method.OCP24_L,
64
65
  Method.OMOL25_CONSERVING_S,
66
+ Method.UMA_M_OMOL,
65
67
  Method.RM1,
66
68
  Method.ORB_V3_CONSERVATIVE_INF_OMAT,
67
69
  Method.EGRET_1,
@@ -74,6 +76,7 @@ PREPACKAGED_NNP_METHODS = [
74
76
  Method.OCP24_S,
75
77
  Method.OCP24_L,
76
78
  Method.OMOL25_CONSERVING_S,
79
+ Method.UMA_M_OMOL,
77
80
  Method.RM1,
78
81
  Method.ORB_V3_CONSERVATIVE_INF_OMAT,
79
82
  Method.EGRET_1,
@@ -6,10 +6,11 @@ from typing import Annotated, Any, Iterable, Self, TypeVar
6
6
  from pydantic import AfterValidator, BaseModel, Field, PositiveInt, ValidationInfo, field_validator, model_validator
7
7
 
8
8
  from ..base import round_optional_float
9
+ from ..method import Method
9
10
  from ..mode import Mode
10
11
  from ..molecule import Molecule
11
12
  from ..types import UUID
12
- from .multistage_opt import MultiStageOptMixin
13
+ from .multistage_opt import MultiStageOptMixin, mso_settings_from_method_string
13
14
  from .workflow import MoleculeWorkflow
14
15
 
15
16
  # the id of a mutable object may change, thus using object()
@@ -57,13 +58,13 @@ class BDEWorkflow(MoleculeWorkflow, MultiStageOptMixin):
57
58
 
58
59
  Inherited:
59
60
  :param initial_molecule: Molecule of interest
60
- :param mode: Mode for workflow
61
61
  :param multistage_opt_settings: set by mode unless mode=MANUAL (ignores additional settings if set)
62
62
  :param solvent: solvent to use for singlepoint
63
63
  :param xtb_preopt: pre-optimize with xtb (sets based on mode when None)
64
64
  :param frequencies: whether to calculate frequencies
65
65
 
66
66
  Overridden:
67
+ :param mode: Mode for workflow or method string from BDE_METHODS
67
68
  :param mso_mode: Mode for MultiStageOptSettings
68
69
 
69
70
  Turned off:
@@ -81,6 +82,7 @@ class BDEWorkflow(MoleculeWorkflow, MultiStageOptMixin):
81
82
  :param bdes: BDE results
82
83
  """
83
84
 
85
+ mode: Mode | str # type: ignore [assignment]
84
86
  mso_mode: Mode = _sentinel_mso_mode # type: ignore [assignment]
85
87
  optimize_fragments: bool = None # type: ignore [assignment]
86
88
 
@@ -95,6 +97,13 @@ class BDEWorkflow(MoleculeWorkflow, MultiStageOptMixin):
95
97
  optimization_energy: float | None = None
96
98
  bdes: list[BDE] = Field(default_factory=list)
97
99
 
100
+ def __repr__(self) -> str:
101
+ if self.mode != Mode.MANUAL:
102
+ name = self.mode.name if isinstance(self.mode, Mode) else self.mode
103
+ return f"<{type(self).__name__} {name}>"
104
+
105
+ return f"<{type(self).__name__} {self.level_of_theory}>"
106
+
98
107
  def __str__(self) -> str:
99
108
  r"""
100
109
  Return a string representation of the BDE workflow.
@@ -104,7 +113,8 @@ class BDEWorkflow(MoleculeWorkflow, MultiStageOptMixin):
104
113
  (1,)
105
114
  (2,)
106
115
  """
107
- return f"{type(self).__name__} {self.mode.name}\n" + "\n".join(map(str, self.fragment_indices))
116
+ name = self.mode.name if isinstance(self.mode, Mode) else self.mode
117
+ return f"{type(self).__name__} {name}\n" + "\n".join(map(str, self.fragment_indices))
108
118
 
109
119
  @property
110
120
  def level_of_theory(self) -> str:
@@ -142,7 +152,14 @@ class BDEWorkflow(MoleculeWorkflow, MultiStageOptMixin):
142
152
  @classmethod
143
153
  def set_mso_mode(cls, values: dict[str, Any]) -> dict[str, Any]:
144
154
  """Set the MultiStageOptSettings mode to match current BDE mode."""
145
- values["mso_mode"] = values["mode"]
155
+ mode = values["mode"].upper()
156
+ if mode in BDE_METHODS:
157
+ values["mso_mode"] = Mode.MANUAL
158
+ values["multistage_opt_settings"] = mso_settings_from_method_string(mode)
159
+ else:
160
+ values["mode"] = Mode(mode)
161
+ values["mso_mode"] = values["mode"]
162
+
146
163
  return values
147
164
 
148
165
  @model_validator(mode="after")
@@ -158,6 +175,8 @@ class BDEWorkflow(MoleculeWorkflow, MultiStageOptMixin):
158
175
  case Mode.RAPID | Mode.CAREFUL | Mode.METICULOUS:
159
176
  # Default on
160
177
  self.optimize_fragments = self.optimize_fragments or self.optimize_fragments is None
178
+ case m if m in BDE_METHODS:
179
+ self.optimize_fragments = True
161
180
  case _:
162
181
  raise NotImplementedError(f"{self.mode} not implemented.")
163
182
 
@@ -260,3 +279,11 @@ def find_AB_bonds(molecule: Molecule, a: int, b: int, distance_max: float) -> It
260
279
  atomic_number_indices(molecule, b),
261
280
  ),
262
281
  )
282
+
283
+
284
+ BDE_METHODS = {
285
+ f"{Method.G_XTB.name}",
286
+ f"{Method.G_XTB.name}//{Method.GFN2_XTB.name}",
287
+ f"{Method.R2SCAN3C.name}//{Method.GFN2_XTB.name}",
288
+ f"{Method.OMOL25_CONSERVING_S.name}",
289
+ }
@@ -271,7 +271,6 @@ class MultiStageOptMixin(BaseModel):
271
271
  def mso_settings_from_method_string(
272
272
  methods: str,
273
273
  solvent: Solvent | None = None,
274
- use_solvent_for_opt: bool = False,
275
274
  constraints: list[Constraint] | None = None,
276
275
  transition_state: bool = False,
277
276
  frequencies: bool = False,
@@ -86,7 +86,7 @@ class PoseAnalysisMolecularDynamicsWorkflow(MoleculeWorkflow):
86
86
  constrain_hydrogens: bool = True
87
87
  nonbonded_cutoff: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 8.0
88
88
 
89
- protein_prune_cutoff: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 9.0
89
+ protein_prune_cutoff: Annotated[PositiveFloat, AfterValidator(round_float(3))] | None = None
90
90
  protein_restraint_cutoff: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 7.0
91
91
  protein_restraint_constant: Annotated[PositiveFloat, AfterValidator(round_float(3))] = 100
92
92
 
@@ -100,6 +100,7 @@ class PoseAnalysisMolecularDynamicsWorkflow(MoleculeWorkflow):
100
100
  @model_validator(mode="after")
101
101
  def check_cutoff_sanity(self) -> Self:
102
102
  """Check if protein is provided."""
103
- if self.protein_prune_cutoff < self.protein_restraint_cutoff:
104
- raise ValueError("Pruning cutoff must be larger than restraint cutoff")
103
+ if self.protein_prune_cutoff is not None:
104
+ if self.protein_prune_cutoff < self.protein_restraint_cutoff:
105
+ raise ValueError("Pruning cutoff must be larger than restraint cutoff")
105
106
  return self
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.87
3
+ Version: 0.0.89
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes