stjames 0.0.28__py3-none-any.whl → 0.0.30__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 *
@@ -10,12 +11,12 @@ from .diis_settings import *
10
11
  from .solvent_settings import *
11
12
  from .thermochem_settings import *
12
13
  from .grid_settings import *
13
- from .solvent_settings import *
14
14
  from .settings import *
15
15
 
16
- from .methods import *
16
+ from .method import *
17
17
  from .basis_set import *
18
- from .tasks import *
19
- from .corrections import *
20
- from .modes import *
18
+ from .task import *
19
+ from .correction import *
20
+ from .solvent import *
21
+ from .mode import *
21
22
  from .status 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/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,16 +1,27 @@
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 .correction import Correction
8
+ from .method import Method
9
+ from .mode import Mode
11
10
  from .opt_settings import OptimizationSettings
11
+ from .scf_settings import SCFSettings
12
+ from .solvent import SolventSettings
13
+ from .task import Task
12
14
  from .thermochem_settings import ThermochemistrySettings
13
- from .solvent_settings import SolventSettings
15
+
16
+ PREPACKAGED_METHODS = [Method.HF3C, Method.B973C, Method.AIMNET2_WB97MD3, Method.AIMNET2_B973C, Method.GFN2_XTB, Method.GFN1_XTB]
17
+
18
+ METHODS_WITH_CORRECTION = [
19
+ Method.B97D3,
20
+ Method.WB97XD,
21
+ Method.WB97XD3,
22
+ Method.WB97XV,
23
+ Method.WB97MV,
24
+ ]
14
25
 
15
26
 
16
27
  class Settings(Base):
@@ -31,9 +42,10 @@ class Settings(Base):
31
42
  @pydantic.computed_field
32
43
  @property
33
44
  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:
45
+ if self.method in PREPACKAGED_METHODS or self.basis_set is None:
36
46
  method = self.method.value
47
+ elif self.method in METHODS_WITH_CORRECTION:
48
+ method = f"{self.method.value}/{self.basis_set.name.lower()}"
37
49
  else:
38
50
  corrections = list(filter(lambda x: x not in (None, ""), self.corrections))
39
51
  method = f"{self.method.value}-{'-'.join([c.value for c in corrections])}/{self.basis_set.name.lower()}"
@@ -0,0 +1,8 @@
1
+ # ruff: noqa
2
+
3
+ from .pka import *
4
+ from .conformer import *
5
+ from .tautomer import *
6
+ from .redox_potential import *
7
+ from .scan import *
8
+ from .fukui import *
@@ -0,0 +1,90 @@
1
+ from typing import Any, Optional
2
+
3
+ from ..base import Base
4
+ from ..method import Method
5
+ from ..mode import Mode
6
+ from ..solvent import Solvent
7
+ from .workflow import Workflow
8
+
9
+
10
+ class ConformerSettings(Base):
11
+ num_confs_considered: int = 100
12
+ num_confs_taken: int = 50
13
+ rmsd_cutoff: float = 0.1
14
+
15
+ final_method: Method = Method.AIMNET2_WB97MD3
16
+ solvent: Optional[Solvent] = Solvent.WATER
17
+ max_energy: float = 5
18
+
19
+
20
+ class RdkitConformerSettings(ConformerSettings):
21
+ csearch_program: str = "rdkit"
22
+
23
+ num_initial_confs: int = 100
24
+ max_mmff_energy: float = 10
25
+ max_mmff_iterations: int = 500
26
+ num_confs_considered: float = 10
27
+ num_confs_taken: float = 3
28
+ rmsd_cutoff: float = 0.1
29
+
30
+
31
+ class CrestConformerSettings(ConformerSettings):
32
+ csearch_program: str = "crest"
33
+
34
+ flags: str = "--quick --ewin 10"
35
+ gfn: int | str = "ff"
36
+
37
+
38
+ class Conformer(Base):
39
+ energy: float
40
+ weight: Optional[float] = None
41
+
42
+ # uuid, optionally
43
+ uuid: Optional[str] = None
44
+
45
+
46
+ class ConformerWorkflow(Workflow):
47
+ settings: ConformerSettings = ConformerSettings()
48
+ conformers: list[Conformer] = []
49
+
50
+ def model_post_init(self, __context: Any) -> None:
51
+ self.settings = csearch_settings_by_mode(self.mode)
52
+
53
+
54
+ def csearch_settings_by_mode(mode: Mode) -> ConformerSettings:
55
+ if mode == Mode.METICULOUS:
56
+ return CrestConformerSettings(
57
+ gfn=2,
58
+ flags="--ewin 15",
59
+ max_energy=10,
60
+ num_confs_considered=500,
61
+ num_confs_taken=150,
62
+ )
63
+
64
+ elif mode == Mode.CAREFUL:
65
+ return CrestConformerSettings(
66
+ gfn="ff",
67
+ flags="--quick --ewin 10",
68
+ num_confs_considered=150,
69
+ num_confs_taken=50,
70
+ )
71
+
72
+ elif mode == Mode.RAPID:
73
+ return RdkitConformerSettings(
74
+ num_initial_confs=300,
75
+ max_mmff_energy=15,
76
+ num_confs_considered=100,
77
+ num_confs_taken=50,
78
+ )
79
+
80
+ elif mode == Mode.RECKLESS:
81
+ return RdkitConformerSettings(
82
+ num_initial_confs=200,
83
+ max_mmff_energy=10,
84
+ num_confs_considered=50,
85
+ num_confs_taken=20,
86
+ rmsd_cutoff=0.25,
87
+ )
88
+
89
+ else:
90
+ raise ValueError(f"invalid mode ``{mode.value}`` for conformer settings")
@@ -0,0 +1,13 @@
1
+ from typing import Optional
2
+
3
+ from .workflow import Workflow
4
+
5
+
6
+ class FukuiIndexWorkflow(Workflow):
7
+ # uuid of optimization
8
+ optimization: Optional[str] = None
9
+
10
+ global_electrophilicity_index: Optional[float] = None
11
+ fukui_positive: Optional[list[float]] = None
12
+ fukui_negative: Optional[list[float]] = None
13
+ fukui_zero: Optional[list[float]] = None
@@ -0,0 +1,27 @@
1
+ from typing import Optional
2
+
3
+ from ..base import Base
4
+ from .workflow import DBCalculation, Workflow
5
+
6
+
7
+ class pKaMicrostate(Base):
8
+ atom_index: int
9
+ structures: list[DBCalculation] = []
10
+ delta_G: float
11
+ pKa: float
12
+
13
+
14
+ class pKaWorkflow(Workflow):
15
+ pka_range: tuple[float, float] = (2, 12)
16
+ deprotonate_elements: list[int] = [7, 8, 16]
17
+ deprotonate_atoms: list[int] = []
18
+ protonate_elements: list[int] = [7]
19
+ protonate_atoms: list[int] = []
20
+
21
+ reasonableness_buffer: float = 5
22
+
23
+ structures: list[DBCalculation] = []
24
+ conjugate_acids: list[pKaMicrostate] = []
25
+ conjugate_bases: list[pKaMicrostate] = []
26
+ strongest_acid: Optional[float] = None
27
+ strongest_base: Optional[float] = None
@@ -0,0 +1,18 @@
1
+ from typing import Optional
2
+
3
+ from ..solvent import Solvent
4
+ from .workflow import Workflow
5
+
6
+
7
+ class RedoxPotentialWorkflow(Workflow):
8
+ solvent: Solvent = Solvent.ACETONITRILE
9
+ reduction: bool = True
10
+ oxidation: bool = True
11
+
12
+ # uuids
13
+ neutral_molecule: Optional[str] = None
14
+ anion_molecule: Optional[str] = None
15
+ cation_molecule: Optional[str] = None
16
+
17
+ reduction_potential: Optional[float] = None
18
+ oxidation_potential: Optional[float] = None
@@ -0,0 +1,38 @@
1
+ from typing import Optional
2
+
3
+ import numpy as np
4
+
5
+ from ..base import Base
6
+ from ..molecule import Molecule
7
+ from ..settings import Settings
8
+ from .workflow import Workflow
9
+
10
+
11
+ class ScanPoint(Base):
12
+ index: int
13
+ molecule: Molecule
14
+ energy: Optional[float] = None
15
+ uuid: Optional[str] = None
16
+
17
+
18
+ class ScanSettings(Base):
19
+ type: str # "bond", "angle", "dihedral" - make Enum later
20
+ atoms: list[int]
21
+ start: float
22
+ stop: float
23
+ num: int
24
+
25
+ def vals(self) -> np.ndarray:
26
+ return np.linspace(self.start, self.stop, self.num)
27
+
28
+ class Config:
29
+ from_attributes = True
30
+
31
+
32
+ class ScanWorkflow(Workflow):
33
+ scan_settings: ScanSettings
34
+ calc_settings: Settings
35
+ engine: str
36
+
37
+ # uuids of scan points
38
+ scan_points: list[str] = []
@@ -0,0 +1,19 @@
1
+ from typing import Optional
2
+
3
+ from ..base import Base
4
+ from .conformer import ConformerSettings
5
+ from .workflow import DBCalculation, Workflow
6
+
7
+
8
+ class Tautomer(Base):
9
+ energy: float
10
+ weight: Optional[float] = None
11
+ predicted_relative_energy: Optional[float] = None
12
+
13
+ # uuids, optionally
14
+ structures: list[DBCalculation] = []
15
+
16
+
17
+ class TautomerWorkflow(Workflow):
18
+ settings: ConformerSettings
19
+ tautomers: list[Tautomer] = []
@@ -0,0 +1,16 @@
1
+ from ..base import Base
2
+ from ..mode import Mode
3
+ from ..molecule import Molecule
4
+
5
+
6
+ class Workflow(Base):
7
+ """All workflows should have these properties."""
8
+
9
+ initial_molecule: Molecule
10
+ mode: Mode
11
+
12
+
13
+ class DBCalculation(Base):
14
+ """Encodes a calculation that's in the database. This isn't terribly useful by itself."""
15
+
16
+ uuid: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stjames
3
- Version: 0.0.28
3
+ Version: 0.0.30
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
@@ -0,0 +1,32 @@
1
+ stjames/__init__.py,sha256=Sao-GvUNIEW8e28ayqpOEVv59qHsKpkJlNIeK-1tnPo,483
2
+ stjames/_deprecated_solvent_settings.py,sha256=ALUZeQoxDS11EvZexT1J2SDAlLTiXe-x4jV8tenDqMc,445
3
+ stjames/base.py,sha256=cZNJq0TSRJk7aKVIl7fzRG6IYQeJ0ihWPi9eJxTiQfI,1070
4
+ stjames/basis_set.py,sha256=4Su3K3Y7G-4S8WHWOQE94d6hxoN6L_MkQUz3qoFqcB0,1014
5
+ stjames/calculation.py,sha256=6xnoKLn6tr1QaactTWsdu8Ciqdu8oa-hmB2y9RIrJTI,786
6
+ stjames/correction.py,sha256=_pNG3qSylfx0iyUxqwx9HPU0m032YwP6wSPCjbJrD94,358
7
+ stjames/diis_settings.py,sha256=QHc7L-hktkbOWBYr29byTdqL8lWJzKJiY9XW8ha4Qzo,552
8
+ stjames/grid_settings.py,sha256=WrSNGc-8_f87YBZYt9Hh7RbhM4MweADoVzwBMcSqcsE,640
9
+ stjames/int_settings.py,sha256=5HXp8opt5ZyY1UpmfaK7NVloWVLM5jkG0elEEqpVLUo,896
10
+ stjames/method.py,sha256=e7A3XH808JglgfCzISKyRKAxGDj7BQdcQQtgtTlgfNk,843
11
+ stjames/mode.py,sha256=xw46Cc7f3eTS8i35qECi-8DocAlANhayK3w4akD4HBU,496
12
+ stjames/molecule.py,sha256=y-NidMubuA9IsSruUKavyBndbf5hYodjihna9uBjkOc,2915
13
+ stjames/opt_settings.py,sha256=RwXikvwW6fTODK3FK8Xvyqy4DY-qMVtZHndWirBxujk,735
14
+ stjames/scf_settings.py,sha256=blJ5Mo2znF_H05gBCPZXTrDwCZuVzUJ_OIcmYGc0Eg0,2389
15
+ stjames/settings.py,sha256=xw5m9Zq4L-oUoV53MMmn9t-KmzlZoFVJSRmac8f2Sfw,8420
16
+ stjames/solvent.py,sha256=3ssY-vQCCa071srfJbwCYEKDpWos8Mgvmg_dTpAnbJw,1104
17
+ stjames/status.py,sha256=wTKNcNxStoEHrxxgr_zTyN90NITa3rxMQZzOgrCifEw,332
18
+ stjames/task.py,sha256=TTl-iTdvDNCZTdPsyS6bYmxzY0ez9PgYlL62fztayXQ,307
19
+ stjames/thermochem_settings.py,sha256=ZTLz31v8Ltutde5Nfm0vH5YahWjcfFWfr_R856KffxE,517
20
+ stjames/workflows/__init__.py,sha256=TibQzeD3X3YGq9TaAzPlBMxU7zskFoa8PwPUam4TcZY,154
21
+ stjames/workflows/conformer.py,sha256=mFqvzsLGiKWNrL0uSqxPgRPJZKKHPjIkK0MbdTqgnro,2297
22
+ stjames/workflows/fukui.py,sha256=FAabgLi_ig6Zp_jiTkuveP0wAObwv68liuumr85rb0g,366
23
+ stjames/workflows/pka.py,sha256=oMNH_s0cdCPq8wFX5o8_5KBWXdCakW9IS1RqmI1Ezmo,720
24
+ stjames/workflows/redox_potential.py,sha256=CCbN9VV30TkcyNQYlI319E8dyHdkzj3dZfBxXpJwJdA,466
25
+ stjames/workflows/scan.py,sha256=qy4Y4nc_1kPXR-4_uGtmnzrQ5i9fVEnoeeiMvwpufJs,768
26
+ stjames/workflows/tautomer.py,sha256=dJaBueUKKxnsj7A-N8ifBL97-Ecd56fPBe-uM9E5pHY,440
27
+ stjames/workflows/workflow.py,sha256=Va1UdKScmJHZ_yfAcMY2KNO1g4eHI3ZBzEPvnLOFR8A,343
28
+ stjames-0.0.30.dist-info/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
29
+ stjames-0.0.30.dist-info/METADATA,sha256=KY3dFIVnkWMkOUwxSkE5_Bdj_QfaQi_yrT13FzHyllI,1605
30
+ stjames-0.0.30.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
31
+ stjames-0.0.30.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
32
+ stjames-0.0.30.dist-info/RECORD,,
@@ -1,24 +0,0 @@
1
- stjames/__init__.py,sha256=yQF57YFNAXtZ7vqG89cRf1Pk4hKRCYlaTNzX4JkhHoo,471
2
- stjames/_deprecated_solvent_settings.py,sha256=ALUZeQoxDS11EvZexT1J2SDAlLTiXe-x4jV8tenDqMc,445
3
- stjames/base.py,sha256=ww8aRYBC1w1mga90QVOSdtQO8Dh3mPFn4oP0woQ_9qQ,1069
4
- stjames/basis_set.py,sha256=4Su3K3Y7G-4S8WHWOQE94d6hxoN6L_MkQUz3qoFqcB0,1014
5
- stjames/calculation.py,sha256=iZ6dua78hWM7CsvtpHXs5Tmts-BAkB-iI1Fi7yvfqVo,786
6
- stjames/corrections.py,sha256=_pNG3qSylfx0iyUxqwx9HPU0m032YwP6wSPCjbJrD94,358
7
- stjames/diis_settings.py,sha256=QHc7L-hktkbOWBYr29byTdqL8lWJzKJiY9XW8ha4Qzo,552
8
- stjames/grid_settings.py,sha256=WrSNGc-8_f87YBZYt9Hh7RbhM4MweADoVzwBMcSqcsE,640
9
- stjames/int_settings.py,sha256=5HXp8opt5ZyY1UpmfaK7NVloWVLM5jkG0elEEqpVLUo,896
10
- stjames/methods.py,sha256=e7A3XH808JglgfCzISKyRKAxGDj7BQdcQQtgtTlgfNk,843
11
- stjames/modes.py,sha256=xw46Cc7f3eTS8i35qECi-8DocAlANhayK3w4akD4HBU,496
12
- stjames/molecule.py,sha256=y-NidMubuA9IsSruUKavyBndbf5hYodjihna9uBjkOc,2915
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=KMIpPmgZ1_EUQ2PZsvyi3uiwxUaWWNk6jF6sQvlxNPY,8166
16
- stjames/solvent_settings.py,sha256=3ssY-vQCCa071srfJbwCYEKDpWos8Mgvmg_dTpAnbJw,1104
17
- stjames/status.py,sha256=wTKNcNxStoEHrxxgr_zTyN90NITa3rxMQZzOgrCifEw,332
18
- stjames/tasks.py,sha256=TTl-iTdvDNCZTdPsyS6bYmxzY0ez9PgYlL62fztayXQ,307
19
- stjames/thermochem_settings.py,sha256=ZTLz31v8Ltutde5Nfm0vH5YahWjcfFWfr_R856KffxE,517
20
- stjames-0.0.28.dist-info/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
21
- stjames-0.0.28.dist-info/METADATA,sha256=DjJ6SiJV2TYYq5XTxJn0L1RHrf8cXkxf_Q_eEFbX6xU,1605
22
- stjames-0.0.28.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
23
- stjames-0.0.28.dist-info/top_level.txt,sha256=FYCwxl6quhYOAgG-mnPQcCK8vsVM7B8rIUrO-WrQ_PI,8
24
- stjames-0.0.28.dist-info/RECORD,,
File without changes
File without changes
File without changes
File without changes
File without changes