cloudnet-api-client 0.12.4__tar.gz → 0.12.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.
Files changed (31) hide show
  1. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/CHANGELOG.md +5 -0
  2. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/PKG-INFO +1 -1
  3. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/cloudnet_api_client/client.py +6 -5
  4. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/cloudnet_api_client/containers.py +10 -3
  5. cloudnet_api_client-0.12.5/cloudnet_api_client/version.py +1 -0
  6. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/tests/test_client.py +5 -3
  7. cloudnet_api_client-0.12.4/cloudnet_api_client/version.py +0 -1
  8. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/.github/dataportal.env +0 -0
  9. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/.github/db.env +0 -0
  10. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/.github/docker-compose.yml +0 -0
  11. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/.github/initdb.d/init-dbs.sh +0 -0
  12. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/.github/ss.env +0 -0
  13. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/.github/workflows/publish.yml +0 -0
  14. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/.github/workflows/test.yml +0 -0
  15. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/.gitignore +0 -0
  16. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/.pre-commit-config.yaml +0 -0
  17. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/LICENSE +0 -0
  18. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/README.md +0 -0
  19. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/cloudnet_api_client/__init__.py +0 -0
  20. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/cloudnet_api_client/dl.py +0 -0
  21. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/cloudnet_api_client/py.typed +0 -0
  22. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/cloudnet_api_client/utils.py +0 -0
  23. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/pyproject.toml +0 -0
  24. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/tests/data/20140205_hyytiala_classification.nc +0 -0
  25. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/tests/data/20250801_Magurele_CHM170137_000.nc +0 -0
  26. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/tests/data/20250803_JOYCE_WST_01m.dat +0 -0
  27. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/tests/data/20250808_Granada_CHM170119_0045_000.nc +0 -0
  28. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/tests/data/20250808_hyytiala_iwc-Z-T-method.nc +0 -0
  29. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/tests/data/20250814_bucharest_classification.nc +0 -0
  30. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/tests/data/20250821_limassol_parsivel_41582c49.nc +0 -0
  31. {cloudnet_api_client-0.12.4 → cloudnet_api_client-0.12.5}/tests/data/20250822_leipzig-lim_ecmwf-open.nc +0 -0
@@ -5,6 +5,11 @@ 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.5 – 2025-09-03
9
+
10
+ - Add "mobile" site type
11
+ - Split `Location` to `MeanLocation` and `RawLocation`
12
+
8
13
  ## 0.12.4 – 2025-08-26
9
14
 
10
15
  - Add `software` attribute to `ProductMetadata`
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudnet-api-client
3
- Version: 0.12.4
3
+ Version: 0.12.5
4
4
  Summary: Cloudnet API client
5
5
  Author-email: Simo Tukiainen <simo.tukiainen@fmi.fi>
6
6
  License-File: LICENSE
@@ -24,10 +24,11 @@ from cloudnet_api_client.containers import (
24
24
  ExtendedProduct,
25
25
  ExtendedProductMetadata,
26
26
  Instrument,
27
- Location,
27
+ MeanLocation,
28
28
  Model,
29
29
  Product,
30
30
  ProductMetadata,
31
+ RawLocation,
31
32
  RawMetadata,
32
33
  RawModelMetadata,
33
34
  Site,
@@ -277,12 +278,12 @@ class APIClient:
277
278
 
278
279
  def moving_site_mean_location(
279
280
  self, site_id: str, date: datetime.date | str
280
- ) -> Location:
281
+ ) -> MeanLocation:
281
282
  if not isinstance(date, datetime.date):
282
283
  date = datetime.date.fromisoformat(date)
283
284
  payload = {"date": date}
284
285
  res = self._get(f"sites/{site_id}/locations", params=payload)[0]
285
- return Location(
286
+ return MeanLocation(
286
287
  time=date,
287
288
  latitude=res["latitude"],
288
289
  longitude=res["longitude"],
@@ -290,13 +291,13 @@ class APIClient:
290
291
 
291
292
  def moving_site_locations(
292
293
  self, site_id: str, date: datetime.date | str
293
- ) -> list[Location]:
294
+ ) -> list[RawLocation]:
294
295
  if not isinstance(date, datetime.date):
295
296
  date = datetime.date.fromisoformat(date)
296
297
  payload = {"date": date, "raw": "1"}
297
298
  locations = self._get(f"sites/{site_id}/locations", params=payload)
298
299
  return [
299
- Location(
300
+ RawLocation(
300
301
  time=_parse_datetime(location["date"]),
301
302
  latitude=location["latitude"],
302
303
  longitude=location["longitude"],
@@ -3,15 +3,22 @@ import uuid
3
3
  from dataclasses import dataclass
4
4
  from typing import Literal
5
5
 
6
- SITE_TYPE = Literal["cloudnet", "model", "hidden", "campaign"]
6
+ SITE_TYPE = Literal["cloudnet", "model", "hidden", "campaign", "mobile"]
7
7
  PRODUCT_TYPE = Literal["instrument", "geophysical", "evaluation", "model"]
8
8
  STATUS = Literal["created", "uploaded", "processed", "invalid"]
9
9
  TIMELINESS = Literal["rrt", "nrt", "scheduled"]
10
10
 
11
11
 
12
12
  @dataclass(frozen=True, slots=True)
13
- class Location:
14
- time: datetime.datetime | datetime.date
13
+ class MeanLocation:
14
+ time: datetime.date
15
+ latitude: float
16
+ longitude: float
17
+
18
+
19
+ @dataclass(frozen=True, slots=True)
20
+ class RawLocation:
21
+ time: datetime.datetime
15
22
  latitude: float
16
23
  longitude: float
17
24
 
@@ -0,0 +1 @@
1
+ __version__ = "0.12.5"
@@ -13,10 +13,11 @@ from cloudnet_api_client.containers import (
13
13
  ExtendedInstrument,
14
14
  ExtendedProduct,
15
15
  Instrument,
16
- Location,
16
+ MeanLocation,
17
17
  Model,
18
18
  Product,
19
19
  ProductMetadata,
20
+ RawLocation,
20
21
  RawMetadata,
21
22
  Site,
22
23
  VersionMetadata,
@@ -128,7 +129,7 @@ class TestSites:
128
129
 
129
130
  def test_moving_site_mean_location(self, client: APIClient):
130
131
  location = client.moving_site_mean_location("boaty", "2022-01-01")
131
- assert isinstance(location, Location)
132
+ assert isinstance(location, MeanLocation)
132
133
  assert location.time == datetime.date(2022, 1, 1)
133
134
  assert round(location.latitude) == 60
134
135
  assert round(location.longitude) == 25
@@ -136,7 +137,8 @@ class TestSites:
136
137
  def test_moving_site_locations(self, client: APIClient):
137
138
  locations = client.moving_site_locations("boaty", "2022-01-01")
138
139
  assert isinstance(locations, list)
139
- assert all(isinstance(loc, Location) for loc in locations)
140
+ assert all(isinstance(loc, RawLocation) for loc in locations)
141
+ assert all(loc.time.date().isoformat() == "2022-01-01" for loc in locations)
140
142
 
141
143
  def test_invalid_site_id(self, client: APIClient):
142
144
  with pytest.raises(CloudnetAPIError):
@@ -1 +0,0 @@
1
- __version__ = "0.12.4"