ddsapi 0.6b4__tar.gz → 0.7__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
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: ddsapi
3
- Version: 0.6b4
3
+ Version: 0.7
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: netCDF4>=1.5.3
22
- Requires-Dist: scipy>=1.5.2
23
- Requires-Dist: requests>=2.23.0
24
- Requires-Dist: xarray>=0.16.0
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
- self.url = config.url
357
- self.key = config.key
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
- result.download(_target)
706
- self.cache.add_to_cache(
707
- dataset_id=dataset_id,
708
- product_id=product_id,
709
- request=request,
710
- target=result.get_files(), overwrite=False)
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
1
+ Metadata-Version: 2.2
2
2
  Name: ddsapi
3
- Version: 0.6b4
3
+ Version: 0.7
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: netCDF4>=1.5.3
22
- Requires-Dist: scipy>=1.5.2
23
- Requires-Dist: requests>=2.23.0
24
- Requires-Dist: xarray>=0.16.0
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.6b4",
20
+ version="0.7",
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
- "netCDF4>=1.5.3",
33
- "scipy>=1.5.2",
34
- "requests>=2.23.0",
35
- "xarray>=0.16.0",
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",
@@ -1,4 +0,0 @@
1
- netCDF4>=1.5.3
2
- scipy>=1.5.2
3
- requests>=2.23.0
4
- xarray>=0.16.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes