stjames 0.0.27__py3-none-any.whl → 0.0.29__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/__init__.py CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  from .calculation import *
4
4
  from .molecule import *
5
+ from .workflows import *
5
6
 
6
7
  from .scf_settings import *
7
8
  from .int_settings import *
stjames/base.py CHANGED
@@ -1,7 +1,8 @@
1
- import pydantic
2
1
  from enum import Enum
2
+ from typing import Annotated, Any, Hashable, TypeVar
3
+
3
4
  import numpy as np
4
- from typing import Any, Annotated, TypeVar, Hashable
5
+ import pydantic
5
6
 
6
7
 
7
8
  class Base(pydantic.BaseModel):
stjames/calculation.py CHANGED
@@ -1,7 +1,7 @@
1
1
  from typing import Optional
2
2
 
3
- from .molecule import Molecule
4
3
  from .base import Base, LowercaseStrEnum
4
+ from .molecule import Molecule
5
5
  from .settings import Settings
6
6
  from .status import Status
7
7
 
stjames/molecule.py CHANGED
@@ -54,28 +54,28 @@ class Molecule(Base):
54
54
  return [a.atomic_number for a in self.atoms]
55
55
 
56
56
  @property
57
- def sum_energy_zpe(self) -> float | None:
57
+ def sum_energy_zpe(self) -> Optional[float]:
58
58
  if (self.energy is None) or (self.zero_point_energy is None):
59
59
  return None
60
60
  else:
61
61
  return self.energy + self.zero_point_energy
62
62
 
63
63
  @property
64
- def sum_energy_thermal_corr(self) -> float | None:
64
+ def sum_energy_thermal_corr(self) -> Optional[float]:
65
65
  if (self.energy is None) or (self.thermal_energy_corr is None):
66
66
  return None
67
67
  else:
68
68
  return self.energy + self.thermal_energy_corr
69
69
 
70
70
  @property
71
- def sum_energy_enthalpy(self) -> float | None:
71
+ def sum_energy_enthalpy(self) -> Optional[float]:
72
72
  if (self.energy is None) or (self.thermal_enthalpy_corr is None):
73
73
  return None
74
74
  else:
75
75
  return self.energy + self.thermal_enthalpy_corr
76
76
 
77
77
  @property
78
- def sum_energy_free_energy(self) -> float | None:
78
+ def sum_energy_free_energy(self) -> Optional[float]:
79
79
  if (self.energy is None) or (self.thermal_free_energy_corr is None):
80
80
  return None
81
81
  else:
stjames/scf_settings.py CHANGED
@@ -1,10 +1,11 @@
1
- from typing import Optional, Any
1
+ from typing import Any, Optional
2
+
2
3
  import pydantic
3
4
 
4
5
  from .base import Base, LowercaseStrEnum
5
- from .int_settings import IntSettings
6
- from .grid_settings import GridSettings
7
6
  from .diis_settings import DIISSettings
7
+ from .grid_settings import GridSettings
8
+ from .int_settings import IntSettings
8
9
 
9
10
 
10
11
  class SCFInitMethod(LowercaseStrEnum):
stjames/settings.py CHANGED
@@ -1,17 +1,34 @@
1
- import pydantic
2
1
  from typing import Any, Optional
3
2
 
4
- from .modes import Mode
5
- from .methods import Method
6
- from .tasks import Task
3
+ import pydantic
4
+
7
5
  from .base import Base, UniqueList
8
- from .corrections import Correction
9
- from .scf_settings import SCFSettings
10
6
  from .basis_set import BasisSet
7
+ from .corrections import Correction
8
+ from .methods import Method
9
+ from .modes import Mode
11
10
  from .opt_settings import OptimizationSettings
12
- from .thermochem_settings import ThermochemistrySettings
11
+ from .scf_settings import SCFSettings
13
12
  from .solvent_settings import SolventSettings
13
+ from .tasks import Task
14
+ from .thermochem_settings import ThermochemistrySettings
14
15
 
16
+ PREPACKAGED_METHODS = [
17
+ Method.HF3C,
18
+ Method.B973C,
19
+ Method.AIMNET2_WB97MD3,
20
+ Method.AIMNET2_B973C,
21
+ Method.GFN2_XTB,
22
+ Method.GFN1_XTB
23
+ ]
24
+
25
+ METHODS_WITH_CORRECTION = [
26
+ Method.B97D3,
27
+ Method.WB97XD,
28
+ Method.WB97XD3,
29
+ Method.WB97XV,
30
+ Method.WB97MV,
31
+ ]
15
32
 
16
33
  class Settings(Base):
17
34
  method: Method = Method.HARTREE_FOCK
@@ -31,9 +48,10 @@ class Settings(Base):
31
48
  @pydantic.computed_field
32
49
  @property
33
50
  def level_of_theory(self) -> str:
34
- # prepackaged methods
35
- if self.method in [Method.HF3C, Method.B973C, Method.AIMNET2_WB97MD3, Method.AIMNET2_B973C, Method.GFN2_XTB, Method.GFN1_XTB] or self.basis_set is None:
51
+ if self.method in PREPACKAGED_METHODS or self.basis_set is None:
36
52
  method = self.method.value
53
+ elif self.method in METHODS_WITH_CORRECTION:
54
+ method = f"{self.method.value}/{self.basis_set.name.lower()}"
37
55
  else:
38
56
  corrections = list(filter(lambda x: x not in (None, ""), self.corrections))
39
57
  method = f"{self.method.value}-{'-'.join([c.value for c in corrections])}/{self.basis_set.name.lower()}"
@@ -60,7 +78,7 @@ class Settings(Base):
60
78
 
61
79
  @pydantic.field_validator("basis_set", mode="before")
62
80
  @classmethod
63
- def parse_basis_set(cls, v: Any) -> BasisSet | None:
81
+ def parse_basis_set(cls, v: Any) -> Optional[BasisSet]:
64
82
  """Turn a string into a ``BasisSet`` object. (This is a little crude.)"""
65
83
  if isinstance(v, BasisSet):
66
84
  return None if v.name is None else v
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stjames
3
- Version: 0.0.27
3
+ Version: 0.0.29
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,24 +1,24 @@
1
- stjames/__init__.py,sha256=yQF57YFNAXtZ7vqG89cRf1Pk4hKRCYlaTNzX4JkhHoo,471
1
+ stjames/__init__.py,sha256=AwqS7pMA9gAOkHUTjMbvQwztcSIHhGfXhC5dOEG-XG0,496
2
2
  stjames/_deprecated_solvent_settings.py,sha256=ALUZeQoxDS11EvZexT1J2SDAlLTiXe-x4jV8tenDqMc,445
3
- stjames/base.py,sha256=ww8aRYBC1w1mga90QVOSdtQO8Dh3mPFn4oP0woQ_9qQ,1069
3
+ stjames/base.py,sha256=cZNJq0TSRJk7aKVIl7fzRG6IYQeJ0ihWPi9eJxTiQfI,1070
4
4
  stjames/basis_set.py,sha256=4Su3K3Y7G-4S8WHWOQE94d6hxoN6L_MkQUz3qoFqcB0,1014
5
- stjames/calculation.py,sha256=iZ6dua78hWM7CsvtpHXs5Tmts-BAkB-iI1Fi7yvfqVo,786
5
+ stjames/calculation.py,sha256=6xnoKLn6tr1QaactTWsdu8Ciqdu8oa-hmB2y9RIrJTI,786
6
6
  stjames/corrections.py,sha256=_pNG3qSylfx0iyUxqwx9HPU0m032YwP6wSPCjbJrD94,358
7
7
  stjames/diis_settings.py,sha256=QHc7L-hktkbOWBYr29byTdqL8lWJzKJiY9XW8ha4Qzo,552
8
8
  stjames/grid_settings.py,sha256=WrSNGc-8_f87YBZYt9Hh7RbhM4MweADoVzwBMcSqcsE,640
9
9
  stjames/int_settings.py,sha256=5HXp8opt5ZyY1UpmfaK7NVloWVLM5jkG0elEEqpVLUo,896
10
10
  stjames/methods.py,sha256=e7A3XH808JglgfCzISKyRKAxGDj7BQdcQQtgtTlgfNk,843
11
11
  stjames/modes.py,sha256=xw46Cc7f3eTS8i35qECi-8DocAlANhayK3w4akD4HBU,496
12
- stjames/molecule.py,sha256=CfZCvmyqs6UHy4ZM_PPtKDdIIW05qxZ5EJcjhXECSQw,2903
12
+ stjames/molecule.py,sha256=y-NidMubuA9IsSruUKavyBndbf5hYodjihna9uBjkOc,2915
13
13
  stjames/opt_settings.py,sha256=RwXikvwW6fTODK3FK8Xvyqy4DY-qMVtZHndWirBxujk,735
14
- stjames/scf_settings.py,sha256=e31f1mWRmcFkMnc-loQak_2037L-l4AYpnl-glchrCc,2388
15
- stjames/settings.py,sha256=0qZSiSN5R-ckhQDYD6FJf8HcVZwCQSVO5WAmcpAtR6A,8163
14
+ stjames/scf_settings.py,sha256=blJ5Mo2znF_H05gBCPZXTrDwCZuVzUJ_OIcmYGc0Eg0,2389
15
+ stjames/settings.py,sha256=wGX66Ca3ShpBndGD6dGpcbb6PiJuLy5RkNX2kNXy-yo,8458
16
16
  stjames/solvent_settings.py,sha256=3ssY-vQCCa071srfJbwCYEKDpWos8Mgvmg_dTpAnbJw,1104
17
17
  stjames/status.py,sha256=wTKNcNxStoEHrxxgr_zTyN90NITa3rxMQZzOgrCifEw,332
18
18
  stjames/tasks.py,sha256=TTl-iTdvDNCZTdPsyS6bYmxzY0ez9PgYlL62fztayXQ,307
19
19
  stjames/thermochem_settings.py,sha256=ZTLz31v8Ltutde5Nfm0vH5YahWjcfFWfr_R856KffxE,517
20
- stjames-0.0.27.dist-info/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
21
- stjames-0.0.27.dist-info/METADATA,sha256=NKV9N70SLXdze-pl0ML4tPOSc5eKV71Q0NqYGtrQuDM,1605
22
- stjames-0.0.27.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
23
- stjames-0.0.27.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
24
- stjames-0.0.27.dist-info/RECORD,,
20
+ stjames-0.0.29.dist-info/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
21
+ stjames-0.0.29.dist-info/METADATA,sha256=7HJMT_ko4b1_9E6-dqkXBz89mV9cd6d_yKoGPlGXVAI,1605
22
+ stjames-0.0.29.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
23
+ stjames-0.0.29.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
24
+ stjames-0.0.29.dist-info/RECORD,,