rowan-python 2.0.1__py3-none-any.whl → 2.0.3__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.
- rowan/rowan_rdkit/chem_utils.py +20 -20
- rowan/utils.py +3 -3
- rowan/workflow.py +11 -11
- {rowan_python-2.0.1.dist-info → rowan_python-2.0.3.dist-info}/METADATA +1 -1
- {rowan_python-2.0.1.dist-info → rowan_python-2.0.3.dist-info}/RECORD +7 -7
- {rowan_python-2.0.1.dist-info → rowan_python-2.0.3.dist-info}/WHEEL +0 -0
- {rowan_python-2.0.1.dist-info → rowan_python-2.0.3.dist-info}/licenses/LICENSE +0 -0
rowan/rowan_rdkit/chem_utils.py
CHANGED
|
@@ -97,24 +97,24 @@ apply_nest_asyncio()
|
|
|
97
97
|
def _get_rdkit_mol_from_uuid(calculation_uuid: str) -> RdkitMol:
|
|
98
98
|
stjames_mol_dict = rowan.retrieve_calculation_molecules(calculation_uuid)[-1]
|
|
99
99
|
|
|
100
|
-
return Chem.MolFromXYZBlock(stjames.Molecule(**stjames_mol_dict).to_xyz())
|
|
100
|
+
return Chem.MolFromXYZBlock(stjames.Molecule(**stjames_mol_dict).to_xyz())
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
def _embed_rdkit_mol(rdkm: RdkitMol) -> RdkitMol:
|
|
104
104
|
try:
|
|
105
|
-
AllChem.SanitizeMol(rdkm)
|
|
105
|
+
AllChem.SanitizeMol(rdkm) # type: ignore [attr-defined]
|
|
106
106
|
except Exception as e:
|
|
107
107
|
raise ValueError("Molecule could not be generated -- invalid chemistry!") from e
|
|
108
108
|
|
|
109
|
-
rdkm = AllChem.AddHs(rdkm)
|
|
109
|
+
rdkm = AllChem.AddHs(rdkm) # type: ignore [attr-defined]
|
|
110
110
|
try:
|
|
111
|
-
assert AllChem.EmbedMolecule(rdkm, maxAttempts=200) >= 0
|
|
111
|
+
assert AllChem.EmbedMolecule(rdkm, maxAttempts=200) >= 0 # type: ignore [attr-defined]
|
|
112
112
|
except AssertionError as e:
|
|
113
|
-
status1 = AllChem.EmbedMolecule(rdkm, maxAttempts=200, useRandomCoords=True)
|
|
113
|
+
status1 = AllChem.EmbedMolecule(rdkm, maxAttempts=200, useRandomCoords=True) # type: ignore [attr-defined]
|
|
114
114
|
if status1 < 0:
|
|
115
115
|
raise ValueError("Cannot embed molecule!") from e
|
|
116
116
|
try:
|
|
117
|
-
assert AllChem.MMFFOptimizeMolecule(rdkm, maxIters=200) >= 0 # type: ignore
|
|
117
|
+
assert AllChem.MMFFOptimizeMolecule(rdkm, maxIters=200) >= 0 # type: ignore [attr-defined]
|
|
118
118
|
except AssertionError:
|
|
119
119
|
pass
|
|
120
120
|
|
|
@@ -477,9 +477,9 @@ async def _single_energy(
|
|
|
477
477
|
get_api_key()
|
|
478
478
|
method = stjames.Method(method)
|
|
479
479
|
|
|
480
|
-
if mol.GetNumConformers() == 0:
|
|
480
|
+
if mol.GetNumConformers() == 0:
|
|
481
481
|
mol = _embed_rdkit_mol(mol)
|
|
482
|
-
if mol.GetNumConformers() == 0:
|
|
482
|
+
if mol.GetNumConformers() == 0:
|
|
483
483
|
raise NoConformersError("This molecule has no conformers")
|
|
484
484
|
|
|
485
485
|
if method not in FAST_METHODS:
|
|
@@ -489,7 +489,7 @@ async def _single_energy(
|
|
|
489
489
|
|
|
490
490
|
workflow_uuids = []
|
|
491
491
|
for conformer in mol.GetConformers():
|
|
492
|
-
cid = conformer.GetId()
|
|
492
|
+
cid = conformer.GetId()
|
|
493
493
|
stjames_mol = _rdkit_to_stjames(mol, cid)
|
|
494
494
|
post = rowan.submit_workflow(
|
|
495
495
|
name=name,
|
|
@@ -623,9 +623,9 @@ async def _single_optimize(
|
|
|
623
623
|
get_api_key()
|
|
624
624
|
method = stjames.Method(method)
|
|
625
625
|
|
|
626
|
-
if mol.GetNumConformers() == 0:
|
|
626
|
+
if mol.GetNumConformers() == 0:
|
|
627
627
|
mol = _embed_rdkit_mol(mol)
|
|
628
|
-
if mol.GetNumConformers() == 0:
|
|
628
|
+
if mol.GetNumConformers() == 0:
|
|
629
629
|
raise NoConformersError("This molecule has no conformers")
|
|
630
630
|
|
|
631
631
|
if method not in FAST_METHODS:
|
|
@@ -637,7 +637,7 @@ async def _single_optimize(
|
|
|
637
637
|
|
|
638
638
|
workflow_uuids = []
|
|
639
639
|
for conformer in mol.GetConformers():
|
|
640
|
-
cid = conformer.GetId()
|
|
640
|
+
cid = conformer.GetId()
|
|
641
641
|
stjames_mol = _rdkit_to_stjames(mol, cid)
|
|
642
642
|
|
|
643
643
|
post = rowan.submit_workflow(
|
|
@@ -677,7 +677,7 @@ async def _single_optimize(
|
|
|
677
677
|
energies = [cacluation[-1]["energy"] for cacluation in calculations]
|
|
678
678
|
|
|
679
679
|
for i, conformer in enumerate(optimized_mol.GetConformers()):
|
|
680
|
-
conformer.SetPositions(np.array(optimized_positions[i]))
|
|
680
|
+
conformer.SetPositions(np.array(optimized_positions[i]))
|
|
681
681
|
|
|
682
682
|
return {
|
|
683
683
|
"molecule": mol,
|
|
@@ -796,9 +796,9 @@ async def _single_conformers(
|
|
|
796
796
|
get_api_key()
|
|
797
797
|
method = stjames.Method(method)
|
|
798
798
|
|
|
799
|
-
if mol.GetNumConformers() == 0:
|
|
799
|
+
if mol.GetNumConformers() == 0:
|
|
800
800
|
mol = _embed_rdkit_mol(mol)
|
|
801
|
-
if mol.GetNumConformers() == 0:
|
|
801
|
+
if mol.GetNumConformers() == 0:
|
|
802
802
|
raise NoConformersError("This molecule has no conformers")
|
|
803
803
|
|
|
804
804
|
if method not in FAST_METHODS:
|
|
@@ -858,12 +858,12 @@ async def _single_conformers(
|
|
|
858
858
|
lowest_n_uuids = [item[1][0] for item in sorted_data[:num_conformers]]
|
|
859
859
|
lowest_energies = [item[0] for item in sorted_data[:num_conformers]]
|
|
860
860
|
|
|
861
|
-
AllChem.EmbedMultipleConfs(mol, numConfs=num_conformers)
|
|
861
|
+
AllChem.EmbedMultipleConfs(mol, numConfs=num_conformers) # type: ignore [attr-defined]
|
|
862
862
|
|
|
863
863
|
for i, conformer in enumerate(mol.GetConformers()):
|
|
864
864
|
atoms = rowan.retrieve_calculation_molecules(lowest_n_uuids[i])[-1]["atoms"]
|
|
865
865
|
pos = [atom["position"] for atom in atoms]
|
|
866
|
-
conformer.SetPositions(np.array(pos))
|
|
866
|
+
conformer.SetPositions(np.array(pos))
|
|
867
867
|
|
|
868
868
|
return {
|
|
869
869
|
"molecule": mol,
|
|
@@ -959,9 +959,9 @@ async def _single_charges(
|
|
|
959
959
|
get_api_key()
|
|
960
960
|
method = stjames.Method(method)
|
|
961
961
|
|
|
962
|
-
if mol.GetNumConformers() == 0:
|
|
962
|
+
if mol.GetNumConformers() == 0:
|
|
963
963
|
mol = _embed_rdkit_mol(mol)
|
|
964
|
-
if mol.GetNumConformers() == 0:
|
|
964
|
+
if mol.GetNumConformers() == 0:
|
|
965
965
|
raise NoConformersError("This molecule has no conformers")
|
|
966
966
|
|
|
967
967
|
if method not in FAST_METHODS:
|
|
@@ -971,7 +971,7 @@ async def _single_charges(
|
|
|
971
971
|
|
|
972
972
|
workflow_uuids = []
|
|
973
973
|
for conformer in mol.GetConformers():
|
|
974
|
-
cid = conformer.GetId()
|
|
974
|
+
cid = conformer.GetId()
|
|
975
975
|
|
|
976
976
|
post = rowan.submit_workflow(
|
|
977
977
|
name=name,
|
rowan/utils.py
CHANGED
|
@@ -19,10 +19,10 @@ def get_api_key() -> str:
|
|
|
19
19
|
|
|
20
20
|
:return: The API key.
|
|
21
21
|
"""
|
|
22
|
-
if (
|
|
23
|
-
return api_key
|
|
24
|
-
elif hasattr(rowan, "api_key"):
|
|
22
|
+
if hasattr(rowan, "api_key") and rowan.api_key:
|
|
25
23
|
return rowan.api_key
|
|
24
|
+
elif (api_key := os.environ.get("ROWAN_API_KEY")) is not None:
|
|
25
|
+
return api_key
|
|
26
26
|
|
|
27
27
|
raise ValueError(
|
|
28
28
|
"No API key provided. You can set your API key using 'rowan.api_key = <API-KEY>',"
|
rowan/workflow.py
CHANGED
|
@@ -52,7 +52,7 @@ class Workflow(BaseModel):
|
|
|
52
52
|
starred: bool
|
|
53
53
|
public: bool
|
|
54
54
|
workflow_type: str = Field(alias="object_type")
|
|
55
|
-
data: dict[str, Any] = Field(default=
|
|
55
|
+
data: dict[str, Any] | None = Field(default=None, alias="object_data")
|
|
56
56
|
email_when_complete: bool
|
|
57
57
|
max_credits: int | None = None
|
|
58
58
|
elapsed: float | None = None
|
|
@@ -416,7 +416,7 @@ def submit_conformer_search_workflow(
|
|
|
416
416
|
conf_gen_mode: str = "rapid",
|
|
417
417
|
final_method: stjames.Method | str = "aimnet2_wb97md3",
|
|
418
418
|
solvent: str | None = None,
|
|
419
|
-
|
|
419
|
+
transition_state: bool = False,
|
|
420
420
|
name: str = "Conformer Search Workflow",
|
|
421
421
|
folder_uuid: str | None = None,
|
|
422
422
|
max_credits: int | None = None,
|
|
@@ -433,7 +433,7 @@ def submit_conformer_search_workflow(
|
|
|
433
433
|
for options.
|
|
434
434
|
:param solvent: The solvent to use for the final optimization. See [the list of available solvents](https://github.com/rowansci/stjames-public/blob/master/stjames/solvent.py)
|
|
435
435
|
for valid values. Be aware that not all methods support solvents.
|
|
436
|
-
:param
|
|
436
|
+
:param transition_state: Whether to optimize the transition state.
|
|
437
437
|
:param name: The name of the workflow.
|
|
438
438
|
:param folder_uuid: The UUID of the folder to place the workflow in.
|
|
439
439
|
:param max_credits: The maximum number of credits to use for the workflow.
|
|
@@ -457,7 +457,7 @@ def submit_conformer_search_workflow(
|
|
|
457
457
|
tasks=["optimize"],
|
|
458
458
|
mode=stjames.Mode.AUTO,
|
|
459
459
|
solvent_settings={"solvent": solvent, "model": solvent_model} if solvent else None,
|
|
460
|
-
opt_settings={"transition_state":
|
|
460
|
+
opt_settings={"transition_state": transition_state, "constraints": []},
|
|
461
461
|
)
|
|
462
462
|
|
|
463
463
|
msos = stjames.MultiStageOptSettings(
|
|
@@ -471,7 +471,7 @@ def submit_conformer_search_workflow(
|
|
|
471
471
|
"conf_gen_mode": conf_gen_mode,
|
|
472
472
|
"mso_mode": "manual",
|
|
473
473
|
"solvent": solvent,
|
|
474
|
-
"
|
|
474
|
+
"transition_state": transition_state,
|
|
475
475
|
}
|
|
476
476
|
|
|
477
477
|
data = {
|
|
@@ -644,7 +644,7 @@ def submit_fukui_workflow(
|
|
|
644
644
|
optimization_method: str = "gfn2_xtb",
|
|
645
645
|
fukui_method: str = "gfn1_xtb",
|
|
646
646
|
solvent_settings: dict[str, str] | None = None,
|
|
647
|
-
name: str = "
|
|
647
|
+
name: str = "Fukui Workflow",
|
|
648
648
|
folder_uuid: str | None = None,
|
|
649
649
|
max_credits: int | None = None,
|
|
650
650
|
) -> Workflow:
|
|
@@ -652,9 +652,9 @@ def submit_fukui_workflow(
|
|
|
652
652
|
Submits a fukui workflow to the API.
|
|
653
653
|
|
|
654
654
|
:param initial_molecule: The molecule to calculate the fukui indices of.
|
|
655
|
-
:optimization_method: The method to use for the optimization.
|
|
656
|
-
:fukui_method: The method to use for the fukui calculation.
|
|
657
|
-
:solvent_settings: The solvent settings to use for the fukui calculation.
|
|
655
|
+
:param optimization_method: The method to use for the optimization.
|
|
656
|
+
:param fukui_method: The method to use for the fukui calculation.
|
|
657
|
+
:param solvent_settings: The solvent settings to use for the fukui calculation.
|
|
658
658
|
:param name: The name of the workflow.
|
|
659
659
|
:param folder_uuid: The UUID of the folder to place the workflow in.
|
|
660
660
|
:param max_credits: The maximum number of credits to use for the workflow.
|
|
@@ -670,9 +670,9 @@ def submit_fukui_workflow(
|
|
|
670
670
|
fukui_settings = stjames.Settings(method=fukui_method, solvent_settings=solvent_settings)
|
|
671
671
|
|
|
672
672
|
workflow_data = {
|
|
673
|
-
"opt_settings": optimization_settings,
|
|
673
|
+
"opt_settings": optimization_settings.model_dump(),
|
|
674
674
|
"opt_engine": stjames.Method(optimization_method).default_engine(),
|
|
675
|
-
"fukui_settings": fukui_settings,
|
|
675
|
+
"fukui_settings": fukui_settings.model_dump(),
|
|
676
676
|
"fukui_engine": stjames.Method(fukui_method).default_engine(),
|
|
677
677
|
}
|
|
678
678
|
|
|
@@ -4,11 +4,11 @@ rowan/folder.py,sha256=n9WkjHMweQLtVcWUvCttOrmezvUdbFxam_eDEMzLF_A,6791
|
|
|
4
4
|
rowan/protein.py,sha256=TOCsN50RaYh3Ja4GBxzH6R7qUk-Y9Xv7y1WU3buPFis,7778
|
|
5
5
|
rowan/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
rowan/user.py,sha256=Dl--NPUPATKCs2VmILsW8HnLiunG0Lxr0n6mKuHm21U,3891
|
|
7
|
-
rowan/utils.py,sha256=
|
|
8
|
-
rowan/workflow.py,sha256=
|
|
7
|
+
rowan/utils.py,sha256=907lV0fEP6BnjOWyisd3Uh8Mk5JuQMOX9QEjGi_mdew,3314
|
|
8
|
+
rowan/workflow.py,sha256=LwU1iaweXseQENOHYAOQqvjNkwITZn82JHeSr4xZiTc,39505
|
|
9
9
|
rowan/rowan_rdkit/__init__.py,sha256=EATX2VRzywzKxqkpCUMTf7RNQLkWsfi5VcCNDW6EIiw,503
|
|
10
|
-
rowan/rowan_rdkit/chem_utils.py,sha256=
|
|
11
|
-
rowan_python-2.0.
|
|
12
|
-
rowan_python-2.0.
|
|
13
|
-
rowan_python-2.0.
|
|
14
|
-
rowan_python-2.0.
|
|
10
|
+
rowan/rowan_rdkit/chem_utils.py,sha256=i7-EmAcmvHYtc9NiZblLY_k2DoQKofAZo5KT2qtkUCI,34775
|
|
11
|
+
rowan_python-2.0.3.dist-info/METADATA,sha256=-RDgaRghr3pWuUCJp7GTdGzoo1PnggTEsb8uIVrz8mU,1598
|
|
12
|
+
rowan_python-2.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
13
|
+
rowan_python-2.0.3.dist-info/licenses/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
|
|
14
|
+
rowan_python-2.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|