Skip to content

Commit 28d606a

Browse files
Merge pull request #371 from killer0071234/forecast-symbols-v1
Forecast symbols v1
2 parents 1242701 + 971d2b8 commit 28d606a

5 files changed

Lines changed: 23 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zamg",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"private": true,
55
"description": "Asynchronous Python client for GeoSphere Austria (ZAMG) weather data.",
66
"scripts": {

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "zamg"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
description = "Asynchronous Python client for GeoSphere Austria (ZAMG) weather data."
55
authors = ["Daniel Gangl <killer007@gmx.at>"]
66
maintainers = ["Daniel Gangl <killer007@gmx.at>"]

src/zamg/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Asynchronous Python client for GeoSphere Austria weather data."""
22

3-
__version__ = "0.3.6"
3+
__version__ = "0.4.1"
44

55
from .exceptions import (
66
ZamgApiError,

src/zamg/zamg.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,15 @@ def __init__(
7777
def get_forecast_current(
7878
self,
7979
forecast_data: dict | None = None,
80-
parameters: tuple[str, ...] = ("t2m", "rh2m", "u10m", "v10m", "tcc", "rr_acc"),
80+
parameters: tuple[str, ...] = (
81+
"t2m",
82+
"rh2m",
83+
"u10m",
84+
"v10m",
85+
"tcc",
86+
"sy",
87+
"rr_acc",
88+
),
8189
) -> dict:
8290
"""Return selected forecast parameters for the current/next timestamp.
8391
@@ -472,7 +480,7 @@ async def get_forecast(
472480

473481
async with async_timeout.timeout(self.request_timeout):
474482
forecast_params = (
475-
self.forecast_parameters or "t2m,rr_acc,u10m,v10m,tcc,rh2m"
483+
self.forecast_parameters or "t2m,rr_acc,u10m,v10m,tcc,sy,rh2m"
476484
)
477485
if lat_lon is None:
478486
station_lat, station_lon = self.get_station_location

tests/test_zamg.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ async def test_get_forecast_uses_station_location(aresponses) -> None:
359359
"u10m": {"data": [0.0]},
360360
"v10m": {"data": [0.0]},
361361
"tcc": {"data": [0.0]},
362+
"sy": {"data": [0.0]},
362363
"rr_acc": {"data": [0.0]},
363364
}
364365
}
@@ -424,6 +425,7 @@ def test_get_forecast_current() -> None:
424425
"u10m": {"data": [1.0, 2.0, 3.0]},
425426
"v10m": {"data": [4.0, 5.0, 6.0]},
426427
"tcc": {"data": [0.1, 0.2, 0.3]},
428+
"sy": {"data": [1.0, 2.0, 3.0]},
427429
"rr_acc": {"data": [0.5, 0.9, 1.4]},
428430
}
429431
}
@@ -439,6 +441,8 @@ def test_get_forecast_current() -> None:
439441
assert result["u10m"] == 2.0
440442
assert result["v10m"] == 5.0
441443
assert result["rain"] == 0.4
444+
assert result["tcc"] == 0.2
445+
assert result["sy"] == 2.0
442446

443447

444448
@pytest.mark.asyncio
@@ -467,6 +471,7 @@ async def test_get_forecast_trims_past_data() -> None:
467471
"u10m": {"data": [1.0, 2.0, 3.0]},
468472
"v10m": {"data": [4.0, 5.0, 6.0]},
469473
"tcc": {"data": [0.1, 0.2, 0.3]},
474+
"sy": {"data": [1.0, 2.0, 3.0]},
470475
"rr_acc": {"data": [0.5, 0.9, 1.4]},
471476
}
472477
}
@@ -490,6 +495,11 @@ async def test_get_forecast_trims_past_data() -> None:
490495
19.4,
491496
24.1,
492497
]
498+
assert result["features"][0]["properties"]["parameters"]["tcc"]["data"] == [
499+
0.2,
500+
0.3,
501+
]
502+
assert result["features"][0]["properties"]["parameters"]["sy"]["data"] == [2.0, 3.0]
493503

494504

495505
@pytest.fixture

0 commit comments

Comments
 (0)