cloudnet-api-client 0.12.0__tar.gz → 0.12.2__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.
Files changed (31) hide show
  1. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/CHANGELOG.md +8 -0
  2. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/PKG-INFO +1 -1
  3. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/cloudnet_api_client/client.py +5 -7
  4. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/cloudnet_api_client/containers.py +1 -1
  5. cloudnet_api_client-0.12.2/cloudnet_api_client/version.py +1 -0
  6. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/tests/test_client.py +2 -0
  7. cloudnet_api_client-0.12.0/cloudnet_api_client/version.py +0 -1
  8. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/.github/dataportal.env +0 -0
  9. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/.github/db.env +0 -0
  10. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/.github/docker-compose.yml +0 -0
  11. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/.github/initdb.d/init-dbs.sh +0 -0
  12. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/.github/ss.env +0 -0
  13. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/.github/workflows/publish.yml +0 -0
  14. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/.github/workflows/test.yml +0 -0
  15. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/.gitignore +0 -0
  16. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/.pre-commit-config.yaml +0 -0
  17. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/LICENSE +0 -0
  18. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/README.md +0 -0
  19. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/cloudnet_api_client/__init__.py +0 -0
  20. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/cloudnet_api_client/dl.py +0 -0
  21. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/cloudnet_api_client/py.typed +0 -0
  22. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/cloudnet_api_client/utils.py +0 -0
  23. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/pyproject.toml +0 -0
  24. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/tests/data/20140205_hyytiala_classification.nc +0 -0
  25. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/tests/data/20250801_Magurele_CHM170137_000.nc +0 -0
  26. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/tests/data/20250803_JOYCE_WST_01m.dat +0 -0
  27. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/tests/data/20250808_Granada_CHM170119_0045_000.nc +0 -0
  28. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/tests/data/20250808_hyytiala_iwc-Z-T-method.nc +0 -0
  29. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/tests/data/20250814_bucharest_classification.nc +0 -0
  30. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/tests/data/20250821_limassol_parsivel_41582c49.nc +0 -0
  31. {cloudnet_api_client-0.12.0 → cloudnet_api_client-0.12.2}/tests/data/20250822_leipzig-lim_ecmwf-open.nc +0 -0
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 0.12.2 – 2025-08-25
9
+
10
+ - Fix product type filter bug
11
+
12
+ ## 0.12.1 – 2025-08-25
13
+
14
+ - Fix tag subset filters
15
+
8
16
  ## 0.12.0 – 2025-08-25
9
17
 
10
18
  - Adjust routes and responses
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudnet-api-client
3
- Version: 0.12.0
3
+ Version: 0.12.2
4
4
  Summary: Cloudnet API client
5
5
  Author-email: Simo Tukiainen <simo.tukiainen@fmi.fi>
6
6
  License-File: LICENSE
@@ -60,7 +60,7 @@ class APIClient:
60
60
  self,
61
61
  type: SITE_TYPE | list[SITE_TYPE] | None = None,
62
62
  ) -> list[Site]:
63
- validate_type(type, SITE_TYPE)
63
+ type = validate_type(type, SITE_TYPE)
64
64
  res = self._get("sites", {"type": type})
65
65
  return _build_objects(res, Site)
66
66
 
@@ -71,7 +71,7 @@ class APIClient:
71
71
  def products(
72
72
  self, type: PRODUCT_TYPE | list[PRODUCT_TYPE] | None = None
73
73
  ) -> list[Product]:
74
- validate_type(type, PRODUCT_TYPE)
74
+ type = validate_type(type, PRODUCT_TYPE)
75
75
  data = self._get("products")
76
76
  if type is not None:
77
77
  data = [obj for obj in data if any(t in obj["type"] for t in type)]
@@ -373,16 +373,13 @@ class APIClient:
373
373
  metadata = [
374
374
  m
375
375
  for m in metadata
376
- if isinstance(m, RawMetadata)
377
- and m.tags
378
- and include_tag_subset.issubset(m.tags)
376
+ if isinstance(m, RawMetadata) and include_tag_subset.issubset(m.tags)
379
377
  ]
380
378
  if exclude_tag_subset:
381
379
  metadata = [
382
380
  m
383
381
  for m in metadata
384
382
  if isinstance(m, RawMetadata)
385
- and m.tags
386
383
  and not exclude_tag_subset.issubset(m.tags)
387
384
  ]
388
385
  return metadata
@@ -677,7 +674,7 @@ def _check_params(params: dict, ignore: tuple = ()) -> None:
677
674
  raise TypeError("At least one of the parameters must be set.")
678
675
 
679
676
 
680
- def validate_type(type, values) -> None:
677
+ def validate_type(type, values) -> list | None:
681
678
  if type is not None:
682
679
  if not isinstance(type, str | list):
683
680
  raise ValueError(f"Invalid type: {type}")
@@ -685,3 +682,4 @@ def validate_type(type, values) -> None:
685
682
  for t in type:
686
683
  if t not in get_args(values):
687
684
  raise ValueError(f"Invalid type: {t}")
685
+ return type
@@ -91,7 +91,7 @@ class Metadata:
91
91
  class RawMetadata(Metadata):
92
92
  status: STATUS
93
93
  instrument: Instrument
94
- tags: frozenset[str] | None
94
+ tags: frozenset[str]
95
95
 
96
96
 
97
97
  @dataclass(frozen=True, slots=True)
@@ -0,0 +1 @@
1
+ __version__ = "0.12.2"
@@ -153,10 +153,12 @@ class TestProducts:
153
153
 
154
154
  def test_products_route_with_type_filter(self, client: APIClient):
155
155
  products = client.products("instrument")
156
+ assert len(products) > 5
156
157
  assert all(product.type == {"instrument"} for product in products)
157
158
 
158
159
  def test_products_route_with_type_filter_combo(self, client: APIClient):
159
160
  products = client.products(["instrument", "geophysical"])
161
+ assert len(products) > 5
160
162
  assert all(
161
163
  product.type in [{"instrument"}, {"geophysical"}] for product in products
162
164
  )
@@ -1 +0,0 @@
1
- __version__ = "0.12.0"