rowan-python 2.1.11__py3-none-any.whl → 2.1.12__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/folder.py CHANGED
@@ -58,7 +58,6 @@ class Folder(BaseModel):
58
58
 
59
59
  return self
60
60
 
61
-
62
61
  def update(
63
62
  self,
64
63
  name: str | None = None,
@@ -121,6 +120,7 @@ class Folder(BaseModel):
121
120
  """
122
121
  print_folder_tree(self.uuid, max_depth, show_uuids)
123
122
 
123
+
124
124
  def retrieve_folder(uuid: str) -> Folder:
125
125
  """
126
126
  Retrieves a folder from the API by UUID. Folder UUID can be found in the folder's URL.
@@ -208,6 +208,7 @@ def create_folder(
208
208
  folder_data = response.json()
209
209
  return Folder(**folder_data)
210
210
 
211
+
211
212
  def print_folder_tree(uuid: str, max_depth: int = 10, show_uuids: bool = False) -> None:
212
213
  """
213
214
  Retrieves a folder tree from the API.
rowan/workflow.py CHANGED
@@ -242,8 +242,9 @@ class Workflow(BaseModel):
242
242
  with open(path / f"{self.name}-msa.tar.gz", "wb") as f:
243
243
  f.write(response.content)
244
244
 
245
- def download_dcd_files(self, replicates: list[int],
246
- name: str | None = None, path: Path | None = None) -> None:
245
+ def download_dcd_files(
246
+ self, replicates: list[int], name: str | None = None, path: Path | None = None
247
+ ) -> None:
247
248
  """
248
249
  Downloads DCD trajectory files for specified replicates
249
250
 
@@ -262,9 +263,7 @@ class Workflow(BaseModel):
262
263
  path.mkdir(parents=True, exist_ok=True)
263
264
 
264
265
  with api_client() as client:
265
- response = client.post(
266
- f"/trajectory/{self.uuid}/trajectory_dcds", json=replicates
267
- )
266
+ response = client.post(f"/trajectory/{self.uuid}/trajectory_dcds", json=replicates)
268
267
  response.raise_for_status()
269
268
 
270
269
  file_path = path / f"{name or self.name}.tar.gz"
@@ -423,6 +422,7 @@ def retrieve_workflows(uuids: list[str]) -> list[Workflow]:
423
422
  response.raise_for_status()
424
423
  return [Workflow(**workflow_data) for workflow_data in response.json()]
425
424
 
425
+
426
426
  def batch_poll_status(uuids: list[str]) -> list[Workflow]:
427
427
  """
428
428
  Polls the status of a list of workflows.
@@ -1606,3 +1606,71 @@ def submit_msa_workflow(
1606
1606
  response = client.post("/workflow", json=data)
1607
1607
  response.raise_for_status()
1608
1608
  return Workflow(**response.json())
1609
+
1610
+
1611
+ def submit_admet_workflow(
1612
+ initial_smiles: str,
1613
+ name: str = "ADMET Workflow",
1614
+ folder_uuid: str | None = None,
1615
+ max_credits: int | None = None,
1616
+ ) -> Workflow:
1617
+ """
1618
+ Submits an ADMET workflow to the API.
1619
+
1620
+ :param initial_smiles: The molecule used in the workflow.
1621
+ :param name: The name of the workflow.
1622
+ :param folder_uuid: The UUID of the folder to store the workflow in.
1623
+ :param max_credits: The maximum number of credits to use for the workflow.
1624
+ :return: A Workflow object representing the submitted workflow.
1625
+ :raises requests.HTTPError: if the request to the API fails.
1626
+ """
1627
+
1628
+ workflow = stjames.ADMETWorkflow(initial_smiles=initial_smiles)
1629
+
1630
+ data = {
1631
+ "name": name,
1632
+ "folder_uuid": folder_uuid,
1633
+ "workflow_type": "admet",
1634
+ "workflow_data": workflow.model_dump(),
1635
+ "initial_smiles": initial_smiles,
1636
+ "max_credits": max_credits,
1637
+ }
1638
+
1639
+ with api_client() as client:
1640
+ response = client.post("/workflow", json=data)
1641
+ response.raise_for_status()
1642
+ return Workflow(**response.json())
1643
+
1644
+
1645
+ def submit_membrane_permeability_workflow(
1646
+ initial_smiles: str,
1647
+ name: str = "ADMET Workflow",
1648
+ folder_uuid: str | None = None,
1649
+ max_credits: int | None = None,
1650
+ ) -> Workflow:
1651
+ """
1652
+ Submits a membrane permeability workflow to the API.
1653
+
1654
+ :param initial_smiles: The molecule used in the workflow.
1655
+ :param name: The name of the workflow.
1656
+ :param folder_uuid: The UUID of the folder to store the workflow in.
1657
+ :param max_credits: The maximum number of credits to use for the workflow.
1658
+ :return: A Workflow object representing the submitted workflow.
1659
+ :raises requests.HTTPError: if the request to the API fails.
1660
+ """
1661
+
1662
+ workflow = stjames.MembranePermeabilityWorkflow(initial_smiles=initial_smiles)
1663
+
1664
+ data = {
1665
+ "name": name,
1666
+ "folder_uuid": folder_uuid,
1667
+ "workflow_type": "membrane_permeability",
1668
+ "workflow_data": workflow.model_dump(),
1669
+ "initial_smiles": initial_smiles,
1670
+ "max_credits": max_credits,
1671
+ }
1672
+
1673
+ with api_client() as client:
1674
+ response = client.post("/workflow", json=data)
1675
+ response.raise_for_status()
1676
+ return Workflow(**response.json())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rowan-python
3
- Version: 2.1.11
3
+ Version: 2.1.12
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
@@ -11,7 +11,7 @@ Requires-Dist: httpx
11
11
  Requires-Dist: nest-asyncio
12
12
  Requires-Dist: rdkit
13
13
  Requires-Dist: setuptools
14
- Requires-Dist: stjames>=0.0.128
14
+ Requires-Dist: stjames>=0.0.137
15
15
  Description-Content-Type: text/markdown
16
16
 
17
17
  # Rowan Python Library
@@ -1,15 +1,15 @@
1
1
  rowan/__init__.py,sha256=2rz6dW0l9DzawiFi6S0WSv8XlZq1CoTBKJrsJ1uesvk,171
2
2
  rowan/constants.py,sha256=emCH4m9OL2Hm5E-6mJGM_FgzrK_JrZT-FiKJ6pMNQ4Y,84
3
- rowan/folder.py,sha256=MF3SU7uG6Hl2SJLFxbPmbhosS-pPEHwbTyummaaRdzM,7509
3
+ rowan/folder.py,sha256=IAda7apRsow_qhausWlAGWKkD9cRvPmt-DkXwqOOM20,7510
4
4
  rowan/project.py,sha256=ALPPkMa_cg7w5OkXno1cs6acCofw8AOUYRSeWgr3L0o,3774
5
5
  rowan/protein.py,sha256=mFSVCr-08bSikXBUtJtSWzjKcVAuBmTeRckn7JUHYSE,8810
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=5nNhsKCo2AxryyL85vZX2AbDCZju4ENA3DlLaaOT30I,61451
9
+ rowan/workflow.py,sha256=Y9H1qXCjTd-E-LehtlbpEp5l7a0__TKE7nYqY5XwUI8,63669
10
10
  rowan/rowan_rdkit/__init__.py,sha256=EATX2VRzywzKxqkpCUMTf7RNQLkWsfi5VcCNDW6EIiw,503
11
11
  rowan/rowan_rdkit/chem_utils.py,sha256=sKCzul2e0ldVYTBImhTwso7ddNgPKmvS-OmvCEjVJH0,34788
12
- rowan_python-2.1.11.dist-info/METADATA,sha256=4Cs9-dQFzabaW1Eemwjqq3absuWc3DNYomL9AQHdbGU,1601
13
- rowan_python-2.1.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- rowan_python-2.1.11.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
- rowan_python-2.1.11.dist-info/RECORD,,
12
+ rowan_python-2.1.12.dist-info/METADATA,sha256=IdwxdzM7GqpuqU9lF9_69NKeGldpBq-FOW00C4tZaqg,1601
13
+ rowan_python-2.1.12.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
+ rowan_python-2.1.12.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
+ rowan_python-2.1.12.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any