ddsapi 0.6b4__tar.gz → 0.6b5__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.
- {ddsapi-0.6b4 → ddsapi-0.6b5}/PKG-INFO +13 -6
- {ddsapi-0.6b4 → ddsapi-0.6b5}/ddsapi/api.py +22 -9
- {ddsapi-0.6b4 → ddsapi-0.6b5}/ddsapi.egg-info/PKG-INFO +13 -6
- ddsapi-0.6b5/ddsapi.egg-info/requires.txt +1 -0
- {ddsapi-0.6b4 → ddsapi-0.6b5}/setup.py +7 -5
- ddsapi-0.6b4/ddsapi.egg-info/requires.txt +0 -4
- {ddsapi-0.6b4 → ddsapi-0.6b5}/LICENSE +0 -0
- {ddsapi-0.6b4 → ddsapi-0.6b5}/README.md +0 -0
- {ddsapi-0.6b4 → ddsapi-0.6b5}/ddsapi/__init__.py +0 -0
- {ddsapi-0.6b4 → ddsapi-0.6b5}/ddsapi/cache.py +0 -0
- {ddsapi-0.6b4 → ddsapi-0.6b5}/ddsapi.egg-info/SOURCES.txt +0 -0
- {ddsapi-0.6b4 → ddsapi-0.6b5}/ddsapi.egg-info/dependency_links.txt +0 -0
- {ddsapi-0.6b4 → ddsapi-0.6b5}/ddsapi.egg-info/top_level.txt +0 -0
- {ddsapi-0.6b4 → ddsapi-0.6b5}/setup.cfg +0 -0
- {ddsapi-0.6b4 → ddsapi-0.6b5}/tests/__init__.py +0 -0
- {ddsapi-0.6b4 → ddsapi-0.6b5}/tests/test_config.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: ddsapi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6b5
|
|
4
4
|
Summary: Python Client to access and download data from CMCC Data Delivery System (DDS)
|
|
5
5
|
Home-page: https://github.com/CMCC-Foundation/ddsapi-client/
|
|
6
6
|
Author: CMCC Data Delivery System Team
|
|
@@ -18,10 +18,17 @@ Classifier: Topic :: Scientific/Engineering :: Hydrology
|
|
|
18
18
|
Requires-Python: >=3.7
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
Requires-Dist: geokube==0.2.7.1
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: description-content-type
|
|
27
|
+
Dynamic: home-page
|
|
28
|
+
Dynamic: license
|
|
29
|
+
Dynamic: requires-dist
|
|
30
|
+
Dynamic: requires-python
|
|
31
|
+
Dynamic: summary
|
|
25
32
|
|
|
26
33
|
# DDSAPI-Client
|
|
27
34
|
Python Client to access and download data from [CMCC Data Delivery System (DDS)](https://dds.cmcc.it)
|
|
@@ -30,6 +30,7 @@ import shutil
|
|
|
30
30
|
from typing import Any, Union, Iterable
|
|
31
31
|
import urllib3
|
|
32
32
|
import xarray as xr
|
|
33
|
+
from geokube import open_datacube
|
|
33
34
|
|
|
34
35
|
from .cache import CacheManager
|
|
35
36
|
|
|
@@ -353,8 +354,14 @@ class Client:
|
|
|
353
354
|
level=level, format="%(asctime)s %(levelname)s %(message)s"
|
|
354
355
|
)
|
|
355
356
|
config = Config()
|
|
356
|
-
|
|
357
|
-
|
|
357
|
+
if url is None:
|
|
358
|
+
self.url = config.url
|
|
359
|
+
else:
|
|
360
|
+
self.url = url
|
|
361
|
+
if key is None:
|
|
362
|
+
self.key = config.key
|
|
363
|
+
else:
|
|
364
|
+
self.key = key
|
|
358
365
|
self.verify = config.verify
|
|
359
366
|
self.cache: CacheManager = CacheManager(
|
|
360
367
|
cache_dir=config.cachedir,
|
|
@@ -636,12 +643,14 @@ class Client:
|
|
|
636
643
|
assert dataset_id, "'dataset_id' cannot be 'None'"
|
|
637
644
|
assert product_id, "'product_id' cannot be 'None'"
|
|
638
645
|
session = self.session
|
|
646
|
+
streaming = False
|
|
639
647
|
if "format" not in request:
|
|
640
648
|
request["temp_file"] = target
|
|
641
649
|
cached_target = self.cache.maybe_get_from_cache(dataset_id=dataset_id, product_id=product_id, request=request)
|
|
642
650
|
if cached_target:
|
|
643
651
|
return cached_target
|
|
644
|
-
|
|
652
|
+
if request["format"] == "zarr":
|
|
653
|
+
streaming = True
|
|
645
654
|
jreply = self._submit(
|
|
646
655
|
f"{self.url}/datasets/{dataset_id}/{product_id}/execute",
|
|
647
656
|
request,
|
|
@@ -702,12 +711,16 @@ class Client:
|
|
|
702
711
|
else:
|
|
703
712
|
_target = target
|
|
704
713
|
try:
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
714
|
+
if not streaming:
|
|
715
|
+
result.download(_target)
|
|
716
|
+
self.cache.add_to_cache(
|
|
717
|
+
dataset_id=dataset_id,
|
|
718
|
+
product_id=product_id,
|
|
719
|
+
request=request,
|
|
720
|
+
target=result.get_files(), overwrite=False)
|
|
721
|
+
else:
|
|
722
|
+
self.info(f"Opening zarr in streaming.... {result._download_url}")
|
|
723
|
+
return xr.open_dataset(result._download_url, decode_coords='all', engine="zarr")
|
|
711
724
|
except RuntimeError as err:
|
|
712
725
|
self.logger.error(str(err))
|
|
713
726
|
return
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: ddsapi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6b5
|
|
4
4
|
Summary: Python Client to access and download data from CMCC Data Delivery System (DDS)
|
|
5
5
|
Home-page: https://github.com/CMCC-Foundation/ddsapi-client/
|
|
6
6
|
Author: CMCC Data Delivery System Team
|
|
@@ -18,10 +18,17 @@ Classifier: Topic :: Scientific/Engineering :: Hydrology
|
|
|
18
18
|
Requires-Python: >=3.7
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
Requires-Dist: geokube==0.2.7.1
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: description-content-type
|
|
27
|
+
Dynamic: home-page
|
|
28
|
+
Dynamic: license
|
|
29
|
+
Dynamic: requires-dist
|
|
30
|
+
Dynamic: requires-python
|
|
31
|
+
Dynamic: summary
|
|
25
32
|
|
|
26
33
|
# DDSAPI-Client
|
|
27
34
|
Python Client to access and download data from [CMCC Data Delivery System (DDS)](https://dds.cmcc.it)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
geokube==0.2.7.1
|
|
@@ -17,7 +17,7 @@ with open("README.md", "r") as f:
|
|
|
17
17
|
|
|
18
18
|
setuptools.setup(
|
|
19
19
|
name="ddsapi",
|
|
20
|
-
version="0.
|
|
20
|
+
version="0.6b5",
|
|
21
21
|
author="CMCC Data Delivery System Team",
|
|
22
22
|
author_email="dds-support@cmcc.it",
|
|
23
23
|
description=(
|
|
@@ -29,10 +29,12 @@ setuptools.setup(
|
|
|
29
29
|
url="https://github.com/CMCC-Foundation/ddsapi-client/",
|
|
30
30
|
packages=setuptools.find_packages(),
|
|
31
31
|
install_requires=[
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
32
|
+
"geokube==0.2.7.1"
|
|
33
|
+
#"netCDF4>=1.5.3",
|
|
34
|
+
#"scipy>=1.5.2",
|
|
35
|
+
#"requests>=2.23.0",
|
|
36
|
+
#"xarray==2022.10.0",
|
|
37
|
+
#"numpy==1.26.0"
|
|
36
38
|
],
|
|
37
39
|
classifiers=[
|
|
38
40
|
"Development Status :: 4 - Beta",
|
|
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
|