rowan-python 2.0.0__py3-none-any.whl → 2.0.1__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/__init__.py CHANGED
@@ -1,10 +1,8 @@
1
1
  # ruff: noqa
2
-
3
- from . import utils
4
-
5
2
  from . import constants
6
3
 
7
4
  from .folder import *
8
5
  from .workflow import *
9
6
  from .protein import *
10
7
  from .user import *
8
+ from .utils import *
rowan/workflow.py CHANGED
@@ -68,7 +68,7 @@ class Workflow(BaseModel):
68
68
  """
69
69
  Loads workflow data from the database and updates the current instance.
70
70
 
71
- :param in_place: Whether to update the current instance in-place.
71
+ :param in_place: Whether to update the current instance in-place.
72
72
  :return: The updated instance (self).
73
73
  :raises HTTPError: If the API request fails.
74
74
  """
@@ -217,7 +217,7 @@ class Workflow(BaseModel):
217
217
 
218
218
 
219
219
  def submit_workflow(
220
- workflow_type: str,
220
+ workflow_type: stjames.WORKFLOW_NAME,
221
221
  workflow_data: dict[str, Any] | None = None,
222
222
  initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol | None = None,
223
223
  initial_smiles: str | None = None,
@@ -241,6 +241,11 @@ def submit_workflow(
241
241
  :raises ValueError: If neither `initial_smiles` nor a valid `initial_molecule` is provided.
242
242
  :raises HTTPError: If the API request fails.
243
243
  """
244
+ if workflow_type not in stjames.WORKFLOW_MAPPING:
245
+ raise ValueError(
246
+ "Invalid workflow type. Must be one of:\n " + "\n ".join(stjames.WORKFLOW_MAPPING)
247
+ )
248
+
244
249
  data = {
245
250
  "name": name,
246
251
  "folder_uuid": folder_uuid,
@@ -300,7 +305,7 @@ def list_workflows(
300
305
  public: bool | None = None,
301
306
  starred: bool | None = None,
302
307
  status: int | None = None,
303
- workflow_type: str | None = None,
308
+ workflow_type: stjames.WORKFLOW_NAME | None = None,
304
309
  page: int = 0,
305
310
  size: int = 10,
306
311
  ) -> list[Workflow]:
@@ -828,6 +833,56 @@ def submit_scan_workflow(
828
833
  return Workflow(**response.json())
829
834
 
830
835
 
836
+ def submit_macropka_workflow(
837
+ initial_smiles: str,
838
+ min_pH: int = 0,
839
+ max_pH: int = 14,
840
+ min_charge: int = -2,
841
+ max_charge: int = 2,
842
+ compute_solvation_energy: bool = True,
843
+ name: str = "Macropka Workflow",
844
+ folder_uuid: str | None = None,
845
+ max_credits: int | None = None,
846
+ ) -> Workflow:
847
+ """
848
+ Submits a macropka workflow to the API.
849
+
850
+ :param initial_smiles: The molecule used in the macropka workflow.
851
+ :param min_pH: The minimum pH to use in the macropka workflow.
852
+ :param max_pH: The maximum pH to use in the macropka workflow.
853
+ :param min_charge: The minimum charge to use in the macropka workflow.
854
+ :param max_charge: The maximum charge to use in the macropka workflow.
855
+ :param compute_solvation_energy: Whether to compute the solvation energy.
856
+ :param name: The name of the workflow.
857
+ :param folder_uuid: The UUID of the folder to store the workflow in.
858
+ :param max_credits: The maximum number of credits to use for the workflow.
859
+ :return: A Workflow object representing the submitted workflow.
860
+ :raises requests.HTTPError: if the request to the API fails.
861
+ """
862
+
863
+ workflow_data = {
864
+ "min_pH": min_pH,
865
+ "max_pH": max_pH,
866
+ "min_charge": min_charge,
867
+ "max_charge": max_charge,
868
+ "compute_solvation_energy": compute_solvation_energy,
869
+ }
870
+
871
+ data = {
872
+ "name": name,
873
+ "folder_uuid": folder_uuid,
874
+ "workflow_type": "macropka",
875
+ "workflow_data": workflow_data,
876
+ "initial_smiles": initial_smiles,
877
+ "max_credits": max_credits,
878
+ }
879
+
880
+ with api_client() as client:
881
+ response = client.post("/workflow", json=data)
882
+ response.raise_for_status()
883
+ return Workflow(**response.json())
884
+
885
+
831
886
  def submit_irc_workflow(
832
887
  initial_molecule: dict[str, Any] | StJamesMolecule | RdkitMol | None = None,
833
888
  method: stjames.Method | str = "uma_m_omol",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rowan-python
3
- Version: 2.0.0
3
+ Version: 2.0.1
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
@@ -1,14 +1,14 @@
1
- rowan/__init__.py,sha256=KiUTRLxIjUZ__oJLeOzS28SfNPFLe5Y9PBIydjSkZFI,149
1
+ rowan/__init__.py,sha256=KWt0ConmoDkmFZUk1lKO7eXFwRbaVU0oLLnYvOafLVc,148
2
2
  rowan/constants.py,sha256=ZZvv3L0b2y3dMGlWGeaRmx40J5tBrpxNxvJgjP1TNjg,37
3
3
  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
7
  rowan/utils.py,sha256=SyKvrvlgZ2BKZKRKziZdVZvV_Y4Hld77Bris0lerA9o,3296
8
- rowan/workflow.py,sha256=Iq6ySvOxOJf30gIH9RtQMSRux9wgEVR0ctpMtjjgI8s,37488
8
+ rowan/workflow.py,sha256=2TbNFkd91crmWmUgXfmeD8HD4Yv90GMdfPlKeAzYiDk,39467
9
9
  rowan/rowan_rdkit/__init__.py,sha256=EATX2VRzywzKxqkpCUMTf7RNQLkWsfi5VcCNDW6EIiw,503
10
10
  rowan/rowan_rdkit/chem_utils.py,sha256=1WAczzwNzIlghgP7eT2l2LhWW4yUpND5XC475q2lXaA,35044
11
- rowan_python-2.0.0.dist-info/METADATA,sha256=JdaZgAaitRmoHQ0Gl-jR7XyIGdXrw0-ktUNsKCw4ITA,1598
12
- rowan_python-2.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
- rowan_python-2.0.0.dist-info/licenses/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
14
- rowan_python-2.0.0.dist-info/RECORD,,
11
+ rowan_python-2.0.1.dist-info/METADATA,sha256=fGZm8-J4yLkXIBZPFYvgarnzE3aYpwp-sQEyzZMshtw,1598
12
+ rowan_python-2.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
+ rowan_python-2.0.1.dist-info/licenses/LICENSE,sha256=i7ehYBS-6gGmbTcgU4mgk28pyOx2kScJ0kcx8n7bWLM,1084
14
+ rowan_python-2.0.1.dist-info/RECORD,,