rowan-python 1.1.8__tar.gz → 1.1.9__tar.gz
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_python-1.1.8 → rowan_python-1.1.9}/PKG-INFO +1 -1
- {rowan_python-1.1.8 → rowan_python-1.1.9}/pyproject.toml +1 -1
- {rowan_python-1.1.8 → rowan_python-1.1.9}/rowan/__init__.py +1 -0
- rowan_python-1.1.9/rowan/protein.py +63 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/.github/workflows/python-publish.yml +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/.gitignore +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/LICENSE +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/README.md +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/examples/run.py +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/pixi.lock +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/rowan/calculation.py +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/rowan/client.py +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/rowan/constants.py +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/rowan/folder.py +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/rowan/rowan_rdkit/__init__.py +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/rowan/rowan_rdkit/chem_utils.py +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/rowan/utils.py +0 -0
- {rowan_python-1.1.8 → rowan_python-1.1.9}/rowan/workflow.py +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import stjames
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from .utils import api_client
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Protein:
|
|
9
|
+
@classmethod
|
|
10
|
+
def retrieve(cls, uuid: stjames.UUID) -> dict:
|
|
11
|
+
with api_client() as client:
|
|
12
|
+
response = client.get(f"/protein/{uuid}")
|
|
13
|
+
response.raise_for_status()
|
|
14
|
+
return response.json()
|
|
15
|
+
|
|
16
|
+
@classmethod
|
|
17
|
+
def update(
|
|
18
|
+
cls,
|
|
19
|
+
uuid: stjames.UUID,
|
|
20
|
+
name: Optional[str] = None,
|
|
21
|
+
data: Optional[dict] = None,
|
|
22
|
+
public: Optional[bool] = None,
|
|
23
|
+
pocket: Optional[list[list[float]]] = None,
|
|
24
|
+
) -> None:
|
|
25
|
+
old_data = cls.retrieve(uuid)
|
|
26
|
+
|
|
27
|
+
new_data = {}
|
|
28
|
+
new_data["name"] = name if name is not None else old_data["name"]
|
|
29
|
+
new_data["data"] = data if data is not None else old_data["data"]
|
|
30
|
+
new_data["public"] = public if public is not None else old_data["public"]
|
|
31
|
+
new_data["pocket"] = pocket if pocket is not None else old_data["pocket"]
|
|
32
|
+
|
|
33
|
+
with api_client() as client:
|
|
34
|
+
response = client.post(f"/protein/{uuid}", json=new_data)
|
|
35
|
+
response.raise_for_status()
|
|
36
|
+
return response.json()
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def delete(cls, uuid: stjames.UUID) -> None:
|
|
40
|
+
with api_client() as client:
|
|
41
|
+
response = client.delete(f"/protein/{uuid}")
|
|
42
|
+
response.raise_for_status()
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def list(
|
|
46
|
+
cls,
|
|
47
|
+
ancestor_uuid: Optional[stjames.UUID] = None,
|
|
48
|
+
name_contains: Optional[str] = None,
|
|
49
|
+
page: int = 0,
|
|
50
|
+
size: int = 20,
|
|
51
|
+
):
|
|
52
|
+
params = {"page": page, "size": size}
|
|
53
|
+
|
|
54
|
+
if ancestor_uuid is not None:
|
|
55
|
+
params["ancestor_uuid"] = ancestor_uuid
|
|
56
|
+
|
|
57
|
+
if name_contains is not None:
|
|
58
|
+
params["name_contains"] = name_contains
|
|
59
|
+
|
|
60
|
+
with api_client() as client:
|
|
61
|
+
response = client.get("/protein", params=params)
|
|
62
|
+
response.raise_for_status()
|
|
63
|
+
return response.json()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|