rowan-python 0.0.3__tar.gz → 0.0.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rowan-python
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: Rowan Python Library
5
5
  Author-email: Corin Wagen <corin@rowansci.com>
6
6
  Project-URL: Homepage, https://github.com/rowansci/rowan-client
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "rowan-python"
3
- version = "0.0.3"
3
+ version = "0.0.5"
4
4
  description = "Rowan Python Library"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
@@ -59,7 +59,7 @@ class Client:
59
59
  },
60
60
  )
61
61
 
62
- elif type in ["pka", "conformers", "tautomers"]:
62
+ else:
63
63
  response = client.post(
64
64
  f"{API_URL}/workflow",
65
65
  headers=self.headers,
@@ -97,33 +97,42 @@ class Client:
97
97
  response_dict = response.json()
98
98
  status = response_dict["status"]
99
99
 
100
- elif type in ["pka", "conformers", "tautomers"]:
100
+ else:
101
101
  response = client.get(f"{API_URL}/workflow/{calc_uuid}", headers=self.headers)
102
102
  response.raise_for_status()
103
103
  response_dict = response.json()
104
104
  status = response_dict["object_status"]
105
105
 
106
- else:
107
- raise ValueError(f"Unknown type ``{type}``!")
108
-
109
106
  return status in [2, 3, 4]
110
107
 
111
108
  def get(self, calc_uuid: str, type: str = "calculation") -> dict:
112
109
  with httpx.Client() as client:
113
110
  if type == "calculation":
114
- response = client.get(f"{API_URL}/calculation/{calc_uuid}/stjames", headers=self.headers)
111
+ stj_response = client.get(f"{API_URL}/calculation/{calc_uuid}/stjames", headers=self.headers)
112
+ stj_response.raise_for_status()
113
+ stj_dict = stj_response.json()
114
+
115
+ response = client.get(f"{API_URL}/calculation/{calc_uuid}", headers=self.headers)
115
116
  response.raise_for_status()
116
117
  response_dict = response.json()
118
+
119
+ # reformat
120
+ del response_dict["settings"]
121
+ response_dict["data"] = stj_dict
122
+
117
123
  return response_dict
118
124
 
119
- elif type in ["pka", "conformers", "tautomers"]:
125
+ else:
120
126
  response = client.get(f"{API_URL}/workflow/{calc_uuid}", headers=self.headers)
121
127
  response.raise_for_status()
122
128
  response_dict = response.json()
123
- return response_dict["object_data"]
124
129
 
125
- else:
126
- raise ValueError(f"Unknown type ``{type}``!")
130
+ # reformat
131
+ response_dict["data"] = response_dict["object_data"]
132
+ del response_dict["object_data"]
133
+ del response_dict["status"]
134
+
135
+ return response_dict
127
136
 
128
137
  def stop(self, calc_uuid: str, type: str = "calculation") -> None:
129
138
  with httpx.Client() as client:
@@ -131,22 +140,16 @@ class Client:
131
140
  response = client.post(f"{API_URL}/calculation/{calc_uuid}/stop", headers=self.headers)
132
141
  response.raise_for_status()
133
142
 
134
- elif type in ["pka", "conformers", "tautomers"]:
143
+ else:
135
144
  response = client.post(f"{API_URL}/workflow/{calc_uuid}/stop", headers=self.headers)
136
145
  response.raise_for_status()
137
146
 
138
- else:
139
- raise ValueError(f"Unknown type ``{type}``!")
140
-
141
147
  def delete(self, calc_uuid: str, type: str = "calculation") -> None:
142
148
  with httpx.Client() as client:
143
149
  if type == "calculation":
144
150
  response = client.delete(f"{API_URL}/calculation/{calc_uuid}", headers=self.headers)
145
151
  response.raise_for_status()
146
152
 
147
- elif type in ["pka", "conformers", "tautomers"]:
153
+ else:
148
154
  response = client.delete(f"{API_URL}/folder/{calc_uuid}", headers=self.headers)
149
155
  response.raise_for_status()
150
-
151
- else:
152
- raise ValueError(f"Unknown type ``{type}``!")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rowan-python
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: Rowan Python Library
5
5
  Author-email: Corin Wagen <corin@rowansci.com>
6
6
  Project-URL: Homepage, https://github.com/rowansci/rowan-client
File without changes
File without changes
File without changes