Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zamg",
"version": "0.4.0",
"version": "0.4.1",
"private": true,
"description": "Asynchronous Python client for GeoSphere Austria (ZAMG) weather data.",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "zamg"
version = "0.4.0"
version = "0.4.1"
description = "Asynchronous Python client for GeoSphere Austria (ZAMG) weather data."
authors = ["Daniel Gangl <killer007@gmx.at>"]
maintainers = ["Daniel Gangl <killer007@gmx.at>"]
Expand Down
2 changes: 1 addition & 1 deletion src/zamg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Asynchronous Python client for GeoSphere Austria weather data."""

__version__ = "0.3.6"
__version__ = "0.4.1"
Comment thread
killer0071234 marked this conversation as resolved.

from .exceptions import (
ZamgApiError,
Expand Down
12 changes: 10 additions & 2 deletions src/zamg/zamg.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ def __init__(
def get_forecast_current(
self,
forecast_data: dict | None = None,
parameters: tuple[str, ...] = ("t2m", "rh2m", "u10m", "v10m", "tcc", "rr_acc"),
parameters: tuple[str, ...] = (
"t2m",
"rh2m",
"u10m",
"v10m",
"tcc",
"sy",
"rr_acc",
),
) -> dict:
"""Return selected forecast parameters for the current/next timestamp.

Expand Down Expand Up @@ -472,7 +480,7 @@ async def get_forecast(

async with async_timeout.timeout(self.request_timeout):
forecast_params = (
self.forecast_parameters or "t2m,rr_acc,u10m,v10m,tcc,rh2m"
self.forecast_parameters or "t2m,rr_acc,u10m,v10m,tcc,sy,rh2m"
)
if lat_lon is None:
Comment thread
killer0071234 marked this conversation as resolved.
station_lat, station_lon = self.get_station_location
Expand Down
10 changes: 10 additions & 0 deletions tests/test_zamg.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ async def test_get_forecast_uses_station_location(aresponses) -> None:
"u10m": {"data": [0.0]},
"v10m": {"data": [0.0]},
"tcc": {"data": [0.0]},
"sy": {"data": [0.0]},
Comment thread
killer0071234 marked this conversation as resolved.
"rr_acc": {"data": [0.0]},
}
}
Expand Down Expand Up @@ -424,6 +425,7 @@ def test_get_forecast_current() -> None:
"u10m": {"data": [1.0, 2.0, 3.0]},
"v10m": {"data": [4.0, 5.0, 6.0]},
"tcc": {"data": [0.1, 0.2, 0.3]},
"sy": {"data": [1.0, 2.0, 3.0]},
Comment thread
killer0071234 marked this conversation as resolved.
"rr_acc": {"data": [0.5, 0.9, 1.4]},
}
}
Expand All @@ -439,6 +441,8 @@ def test_get_forecast_current() -> None:
assert result["u10m"] == 2.0
assert result["v10m"] == 5.0
assert result["rain"] == 0.4
assert result["tcc"] == 0.2
assert result["sy"] == 2.0


@pytest.mark.asyncio
Expand Down Expand Up @@ -467,6 +471,7 @@ async def test_get_forecast_trims_past_data() -> None:
"u10m": {"data": [1.0, 2.0, 3.0]},
"v10m": {"data": [4.0, 5.0, 6.0]},
"tcc": {"data": [0.1, 0.2, 0.3]},
"sy": {"data": [1.0, 2.0, 3.0]},
"rr_acc": {"data": [0.5, 0.9, 1.4]},
}
}
Expand All @@ -490,6 +495,11 @@ async def test_get_forecast_trims_past_data() -> None:
19.4,
24.1,
]
assert result["features"][0]["properties"]["parameters"]["tcc"]["data"] == [
0.2,
0.3,
]
assert result["features"][0]["properties"]["parameters"]["sy"]["data"] == [2.0, 3.0]


@pytest.fixture
Expand Down