ecmwf-datastores-client 0.2.0__py3-none-any.whl → 0.3.0__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.
Potentially problematic release.
This version of ecmwf-datastores-client might be problematic. Click here for more details.
- ecmwf/datastores/client.py +19 -2
- ecmwf/datastores/processing.py +8 -1
- ecmwf/datastores/version.py +1 -1
- {ecmwf_datastores_client-0.2.0.dist-info → ecmwf_datastores_client-0.3.0.dist-info}/METADATA +1 -1
- {ecmwf_datastores_client-0.2.0.dist-info → ecmwf_datastores_client-0.3.0.dist-info}/RECORD +8 -8
- {ecmwf_datastores_client-0.2.0.dist-info → ecmwf_datastores_client-0.3.0.dist-info}/WHEEL +0 -0
- {ecmwf_datastores_client-0.2.0.dist-info → ecmwf_datastores_client-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {ecmwf_datastores_client-0.2.0.dist-info → ecmwf_datastores_client-0.3.0.dist-info}/top_level.txt +0 -0
ecmwf/datastores/client.py
CHANGED
|
@@ -28,6 +28,8 @@ from ecmwf.datastores.catalogue import Catalogue
|
|
|
28
28
|
from ecmwf.datastores.processing import Processing, RequestKwargs
|
|
29
29
|
from ecmwf.datastores.profile import Profile
|
|
30
30
|
|
|
31
|
+
T_STATUS = Literal["accepted", "running", "successful", "failed", "rejected"]
|
|
32
|
+
|
|
31
33
|
|
|
32
34
|
@attrs.define(slots=False)
|
|
33
35
|
class Client:
|
|
@@ -179,6 +181,21 @@ class Client:
|
|
|
179
181
|
"""
|
|
180
182
|
return self._profile_api.check_authentication()
|
|
181
183
|
|
|
184
|
+
def delete(self, *request_ids: str) -> dict[str, Any]:
|
|
185
|
+
"""Delete requests.
|
|
186
|
+
|
|
187
|
+
Parameters
|
|
188
|
+
----------
|
|
189
|
+
*request_ids: str
|
|
190
|
+
Request IDs.
|
|
191
|
+
|
|
192
|
+
Returns
|
|
193
|
+
-------
|
|
194
|
+
dict[str,Any]
|
|
195
|
+
Content of the response.
|
|
196
|
+
"""
|
|
197
|
+
return self._retrieve_api.delete(*request_ids)
|
|
198
|
+
|
|
182
199
|
def download_results(self, request_id: str, target: str | None = None) -> str:
|
|
183
200
|
"""Download the results of a request.
|
|
184
201
|
|
|
@@ -259,7 +276,7 @@ class Client:
|
|
|
259
276
|
self,
|
|
260
277
|
limit: int | None = None,
|
|
261
278
|
sortby: Literal[None, "created", "-created"] = None,
|
|
262
|
-
status:
|
|
279
|
+
status: None | T_STATUS | list[T_STATUS] = None,
|
|
263
280
|
) -> datastores.Jobs:
|
|
264
281
|
"""Retrieve submitted jobs.
|
|
265
282
|
|
|
@@ -269,7 +286,7 @@ class Client:
|
|
|
269
286
|
Number of jobs per page.
|
|
270
287
|
sortby: {None, 'created', '-created'}
|
|
271
288
|
Field to sort results by.
|
|
272
|
-
status:
|
|
289
|
+
status: None or {'accepted', 'running', 'successful', 'failed', 'rejected'} or list
|
|
273
290
|
Status of the results.
|
|
274
291
|
|
|
275
292
|
Returns
|
ecmwf/datastores/processing.py
CHANGED
|
@@ -467,7 +467,7 @@ class Remote:
|
|
|
467
467
|
return True
|
|
468
468
|
if status in ("accepted", "running"):
|
|
469
469
|
return False
|
|
470
|
-
if status
|
|
470
|
+
if status in ("failed", "rejected"):
|
|
471
471
|
results = self._make_results(wait=False)
|
|
472
472
|
raise ProcessingFailedError(error_json_to_message(results._json_dict))
|
|
473
473
|
if status in ("dismissed", "deleted"):
|
|
@@ -705,6 +705,13 @@ class Processing:
|
|
|
705
705
|
log_callback=self.log_callback,
|
|
706
706
|
)
|
|
707
707
|
|
|
708
|
+
def delete(self, *job_ids: str) -> dict[str, Any]:
|
|
709
|
+
url = f"{self.url}/jobs/delete"
|
|
710
|
+
response = ApiResponse.from_request(
|
|
711
|
+
"post", url, json={"job_ids": job_ids}, **self._request_kwargs
|
|
712
|
+
)
|
|
713
|
+
return response._json_dict
|
|
714
|
+
|
|
708
715
|
def get_processes(self, **params: Any) -> Processes:
|
|
709
716
|
url = f"{self.url}/processes"
|
|
710
717
|
return Processes.from_request("get", url, params=params, **self._request_kwargs)
|
ecmwf/datastores/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# Do not change! Do not track in version control!
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.3.0"
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
ecmwf/datastores/__init__.py,sha256=RQ5WNfEjLQ1qlZxyvGv3S6zPcFO35UcgN4iiz_Uh06I,1243
|
|
2
2
|
ecmwf/datastores/catalogue.py,sha256=I-ON4lxI13Y5dR7joU1qeQrWTxYBQMFGYoOrLa2oLic,6257
|
|
3
|
-
ecmwf/datastores/client.py,sha256=
|
|
3
|
+
ecmwf/datastores/client.py,sha256=bCXSb1q3T-kX7csOshi4z6qU54s8JrczPVbEPxa_UiA,13053
|
|
4
4
|
ecmwf/datastores/config.py,sha256=45C4nvgk-uGucCAnN3bUtr_zv-_dm8IN_P5xl7LPqfs,1497
|
|
5
5
|
ecmwf/datastores/legacy_client.py,sha256=UEkQNg9IA_zNnpZrc4I9O2X2h39NsaxYM0xpL2OKghA,9491
|
|
6
|
-
ecmwf/datastores/processing.py,sha256=
|
|
6
|
+
ecmwf/datastores/processing.py,sha256=C6nMsPCQGVWGN0gCHU59Q2C1QfbGGwEbOscv0GgqLaw,22093
|
|
7
7
|
ecmwf/datastores/profile.py,sha256=VjT6GSoSZZyaDHXZh0SQbrzxSX3Ug2DOWhq7VIu-QX8,2974
|
|
8
8
|
ecmwf/datastores/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
ecmwf/datastores/utils.py,sha256=fc6wma5qRpgAsX3dOmg0aoIc-qjWG6NY9PSHaWR8CpE,320
|
|
10
|
-
ecmwf/datastores/version.py,sha256=
|
|
11
|
-
ecmwf_datastores_client-0.
|
|
12
|
-
ecmwf_datastores_client-0.
|
|
13
|
-
ecmwf_datastores_client-0.
|
|
14
|
-
ecmwf_datastores_client-0.
|
|
15
|
-
ecmwf_datastores_client-0.
|
|
10
|
+
ecmwf/datastores/version.py,sha256=3h8WahDhaqqG0csM7Cbye1f4Rwme9vn3Dz_DYKtqceo,72
|
|
11
|
+
ecmwf_datastores_client-0.3.0.dist-info/licenses/LICENSE,sha256=e2Qp4JUZeHZZSYCADyp1B3siZB5aQE5MRCYRx7vqlNI,11346
|
|
12
|
+
ecmwf_datastores_client-0.3.0.dist-info/METADATA,sha256=ulKbZeg6q4nUICkZ_A2P2tWSB-eekToBmUnim-HzJHk,21463
|
|
13
|
+
ecmwf_datastores_client-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
ecmwf_datastores_client-0.3.0.dist-info/top_level.txt,sha256=gvA9-Z3hRaFzijz-mf8v2t84s25ptpWeqhyuUomJoJk,6
|
|
15
|
+
ecmwf_datastores_client-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
{ecmwf_datastores_client-0.2.0.dist-info → ecmwf_datastores_client-0.3.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{ecmwf_datastores_client-0.2.0.dist-info → ecmwf_datastores_client-0.3.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|