rowan-python 2.1.6__py3-none-any.whl → 2.1.7__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/workflow.py CHANGED
@@ -5,6 +5,7 @@ from typing import Any, Literal, Self, TypeAlias
5
5
  import stjames
6
6
  from pydantic import BaseModel, Field
7
7
  from rdkit import Chem
8
+ from stjames.optimization.freezing_string_method import FSMSettings
8
9
 
9
10
  from .protein import Protein
10
11
  from .utils import api_client
@@ -285,16 +286,21 @@ def retrieve_workflow(uuid: str) -> Workflow:
285
286
  return Workflow(**response.json())
286
287
 
287
288
 
288
- def retrieve_calculation_molecules(uuid: str) -> list[dict[str, Any]]:
289
+ def retrieve_calculation_molecules(
290
+ uuid: str, return_frequencies: bool = False
291
+ ) -> list[dict[str, Any]]:
289
292
  """
290
293
  Retrieves a list of molecules from a calculation.
291
294
 
292
295
  :param uuid: The UUID of the calculation to retrieve molecules from.
296
+ :param return_frequencies: Whether to return the frequencies of the molecules.
293
297
  :return: A list of dictionaries representing the molecules in the calculation.
294
298
  :raises HTTPError: If the API request fails.
295
299
  """
296
300
  with api_client() as client:
297
- response = client.get(f"/calculation/{uuid}/molecules")
301
+ response = client.get(
302
+ f"/calculation/{uuid}/molecules", params={"return_frequencies": return_frequencies}
303
+ )
298
304
  response.raise_for_status()
299
305
  return response.json()
300
306
 
@@ -352,9 +358,10 @@ def list_workflows(
352
358
  def submit_basic_calculation_workflow(
353
359
  initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol,
354
360
  method: stjames.Method | str = "uma_m_omol",
361
+ basis_set: stjames.BasisSet | str | None = None,
355
362
  tasks: list[str] | None = None,
356
363
  mode: str = "auto",
357
- engine: str = "omol25",
364
+ engine: str | None = None,
358
365
  name: str = "Basic Calculation Workflow",
359
366
  folder_uuid: str | None = None,
360
367
  max_credits: int | None = None,
@@ -364,7 +371,7 @@ def submit_basic_calculation_workflow(
364
371
 
365
372
  :param initial_molecule: The molecule to perform the calculation on.
366
373
  :param method: The method to use for the calculation.
367
- See [list of available methods](https://github.com/rowansci/stjames-public/blob/master/stjames/method.py)
374
+ :param basis_set: The basis_set to use (if any).
368
375
  for options.
369
376
  :param tasks: A list of tasks to perform for the calculation.
370
377
  :param mode: The mode to run the calculation in. See [list of available modes](https://github.com/rowansci/stjames-public/blob/master/stjames/mode.py)
@@ -391,6 +398,7 @@ def submit_basic_calculation_workflow(
391
398
  initial_molecule=initial_molecule,
392
399
  settings=stjames.Settings(
393
400
  method=method,
401
+ basis_set=basis_set,
394
402
  tasks=tasks,
395
403
  mode=mode,
396
404
  ),
@@ -792,7 +800,7 @@ def submit_descriptors_workflow(
792
800
  def submit_scan_workflow(
793
801
  initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol,
794
802
  scan_settings: stjames.ScanSettings | dict[str, Any] | None = None,
795
- calculation_engine: str = "omol25",
803
+ calculation_engine: str | None = None,
796
804
  calculation_method: stjames.Method | str = "uma_m_omol",
797
805
  wavefront_propagation: bool = True,
798
806
  name: str = "Scan Workflow",
@@ -835,7 +843,7 @@ def submit_scan_workflow(
835
843
  initial_molecule=initial_molecule,
836
844
  scan_settings=scan_settings,
837
845
  calc_settings=calc_settings,
838
- calc_engine=calculation_engine,
846
+ calc_engine=calculation_engine or calculation_method.default_engine(),
839
847
  wavefront_propagation=wavefront_propagation,
840
848
  )
841
849
 
@@ -911,7 +919,6 @@ def submit_macropka_workflow(
911
919
  def submit_irc_workflow(
912
920
  initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol | None = None,
913
921
  method: stjames.Method | str = "uma_m_omol",
914
- engine: str = "omol25",
915
922
  preopt: bool = True,
916
923
  step_size: float = 0.05,
917
924
  max_irc_steps: int = 30,
@@ -926,7 +933,6 @@ def submit_irc_workflow(
926
933
  :param method: The computational method to use for the IRC calculation.
927
934
  See [list of available methods](https://github.com/rowansci/stjames-public/blob/master/stjames/method.py)
928
935
  for options.
929
- :param engine: The computational engine to use for the calculation. See [list of available engines](https://github.com/rowansci/stjames-public/blob/master/stjames/engine.py)
930
936
  :param preopt: Whether to perform a pre-optimization of the molecule.
931
937
  :param step_size: The step size to use for the IRC calculation.
932
938
  :param max_irc_steps: The maximum number of IRC steps to perform.
@@ -953,12 +959,12 @@ def submit_irc_workflow(
953
959
  corrections=[],
954
960
  mode="auto",
955
961
  ),
956
- engine=engine,
957
962
  preopt=preopt,
958
963
  step_size=step_size,
959
964
  max_irc_steps=max_irc_steps,
960
965
  mode="manual",
961
966
  )
967
+
962
968
  data = {
963
969
  "name": name,
964
970
  "folder_uuid": folder_uuid,
@@ -1229,3 +1235,51 @@ def submit_strain_workflow(
1229
1235
  response = client.post("/workflow", json=data)
1230
1236
  response.raise_for_status()
1231
1237
  return Workflow(**response.json())
1238
+
1239
+
1240
+ def submit_double_ended_ts_search_workflow(
1241
+ reactant: dict[str, Any] | StJamesMolecule,
1242
+ product: dict[str, Any] | StJamesMolecule,
1243
+ calculation_settings: stjames.Settings | dict[str, Any] | None = None,
1244
+ search_settings: FSMSettings | dict[str, Any] | None = None,
1245
+ optimize_inputs: bool = False,
1246
+ optimize_ts: bool = True,
1247
+ name: str = "Double-Ended TS Search Workflow",
1248
+ folder_uuid: str | None = None,
1249
+ max_credits: int | None = None,
1250
+ ) -> Workflow:
1251
+ """
1252
+ Submits a double-ended transition state search workflow to the API.
1253
+
1254
+ :param reactant: reactant Molecule.
1255
+ :param product: product Molecule.
1256
+ :param calculation_settings: Settings to use for calculations.
1257
+ :param search_settings: settings to use for the transition state search.
1258
+ :param optimize_inputs: Whether to optimize the reactant and product before the search.
1259
+ :param optimize_ts: Whether to optimize the found transition state.
1260
+ :param name: name of the workflow.
1261
+ :param folder_uuid: The UUID of the folder to place the workflow in.
1262
+ :param max_credits: The maximum number of credits to use for the workflow.
1263
+ :return: Workflow object representing the submitted workflow.
1264
+ """
1265
+ workflow = stjames.DoubleEndedTSSearchWorkflow(
1266
+ reactant=reactant,
1267
+ product=product,
1268
+ calculation_settings=calculation_settings,
1269
+ search_settings=search_settings,
1270
+ optimize_inputs=optimize_inputs,
1271
+ optimize_ts=optimize_ts,
1272
+ )
1273
+ data = {
1274
+ "name": name,
1275
+ "folder_uuid": folder_uuid,
1276
+ "workflow_type": "double_ended_ts_search",
1277
+ "workflow_data": workflow.model_dump(),
1278
+ "initial_molecule": reactant if isinstance(reactant, dict) else reactant.model_dump(),
1279
+ "max_credits": max_credits,
1280
+ }
1281
+
1282
+ with api_client() as client:
1283
+ response = client.post("/workflow", json=data)
1284
+ response.raise_for_status()
1285
+ return Workflow(**response.json())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rowan-python
3
- Version: 2.1.6
3
+ Version: 2.1.7
4
4
  Summary: Rowan Python Library
5
5
  Project-URL: Homepage, https://github.com/rowansci/rowan-client
6
6
  Project-URL: Bug Tracker, https://github.com/rowansci/rowan-client/issues
@@ -6,10 +6,10 @@ rowan/protein.py,sha256=bMemvLZua_pnTrYOxHFZ4jFlRH9KgpYvtjj5M2__28k,8026
6
6
  rowan/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  rowan/user.py,sha256=Dl--NPUPATKCs2VmILsW8HnLiunG0Lxr0n6mKuHm21U,3891
8
8
  rowan/utils.py,sha256=64II-cPOe_SFJK302Bm8hP62d_3_CgnTVYCbn3zKT7U,3334
9
- rowan/workflow.py,sha256=EGcqPv2K-CCt8t_FSVAGTaI7QCM4BJdY--kN4PHvhOo,46749
9
+ rowan/workflow.py,sha256=ec4ygHqsyldHn6-gpyPwzHfsGcQXRZOauIjdHtdzJuE,48826
10
10
  rowan/rowan_rdkit/__init__.py,sha256=EATX2VRzywzKxqkpCUMTf7RNQLkWsfi5VcCNDW6EIiw,503
11
11
  rowan/rowan_rdkit/chem_utils.py,sha256=i7-EmAcmvHYtc9NiZblLY_k2DoQKofAZo5KT2qtkUCI,34775
12
- rowan_python-2.1.6.dist-info/METADATA,sha256=rNw5EUh2Dz3xfBKUtFHtIPykxSVegqydghdhhq-q3XI,1599
13
- rowan_python-2.1.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- rowan_python-2.1.6.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
- rowan_python-2.1.6.dist-info/RECORD,,
12
+ rowan_python-2.1.7.dist-info/METADATA,sha256=XWltMwFRX9VyDOTy7rUE86IDXL8xBakq-SCcJpDBOPo,1599
13
+ rowan_python-2.1.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
+ rowan_python-2.1.7.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
+ rowan_python-2.1.7.dist-info/RECORD,,