-
Notifications
You must be signed in to change notification settings - Fork 0
/
old_script.py
78 lines (65 loc) · 1.54 KB
/
old_script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# %%
import requests
from requests.api import patch
import importlib
# from escalateclient.escalateclient import ESCALATEClient
import escalateclient
importlib.reload(escalateclient)
escalate = escalateclient.escalateclient.ESCALATEClient(
"http://localhost:8000", "vshekar", "copperhead123"
)
# %%
# escalate.get_experiment_template("Workflow 1")
escalate.get_experiment_instance()
# %%
uuid = "24fd8829-6e08-4c2b-b402-9b3cb54e2869"
data = escalate.get(endpoint="parameter", data={"uuid": uuid})
# %%
print(data)
data = data[0]
# %%
# escalate.post()
data["parameter_val_actual"]["value"] = 600
# %%
a = escalate.put(endpoint="parameter", resource_id=data["uuid"], data=data)
# %%
r = requests.api.put(
f"http://localhost:8000/api/parameter/{uuid}/",
json=data,
headers=escalate._token_header,
)
# %%
patch_data = {"parameter_val_actual": data["parameter_val_actual"]}
# %%
patch_data
# %%
escalate.patch(endpoint="parameter", resource_id=data["uuid"], data=data)
# %%
r = requests.api.get(
f"http://localhost:8000/api/parameter/{uuid}/", headers=escalate._token_header
)
# %%
r = requests.api.patch(
f"http://localhost:8000/api/parameter/{uuid}/",
json=patch_data,
headers=escalate._token_header,
)
# %%
from rdkit import Chem
Chem.MolFromSmiles("[Fe]=[Se]")
# %%
import chemspipy
cs = chemspipy.ChemSpider("cOHebJpGjeDR8srEggRT0byrZnVESyCG")
# %%
res = cs.search("benzene")
# %%
print(res)
# %%
from pubchempy import get_compounds
res = get_compounds("FeSe", "name")
# %%
for c in res:
print(c.molecular_formula)
# %%
res
# %%