From ba13f0d8c8cad711c82820c144ffdb7f761ef6dd Mon Sep 17 00:00:00 2001 From: mroberto166 <50059706+mroberto166@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:25:57 +0200 Subject: [PATCH] feat(models): enable ensemble statistics for EPT2_HRRR and EPT2_EUROPA Co-authored-by: Cursor --- src/jua/weather/_model_meta.py | 2 ++ tests/functional/test_forecasts.py | 2 +- tests/weather/test_hrrr_europa_meta.py | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 tests/weather/test_hrrr_europa_meta.py diff --git a/src/jua/weather/_model_meta.py b/src/jua/weather/_model_meta.py index f0bd2cc..7fc58cc 100644 --- a/src/jua/weather/_model_meta.py +++ b/src/jua/weather/_model_meta.py @@ -141,6 +141,7 @@ class ModelMetaInfo: _MODEL_META_INFO[Models.EPT2_HRRR] = ModelMetaInfo( has_grid_access=True, full_forecasted_hours=48, + has_statistics=True, num_lats=3600, num_lons=7200, forecasts_per_day=24, @@ -169,6 +170,7 @@ class ModelMetaInfo: _MODEL_META_INFO[Models.EPT2_EUROPA] = ModelMetaInfo( has_grid_access=True, full_forecasted_hours=48, + has_statistics=True, forecasts_per_day=24, temporal_resolution=TemporalResolution(base=1), ) diff --git a/tests/functional/test_forecasts.py b/tests/functional/test_forecasts.py index 62a200e..75fb465 100644 --- a/tests/functional/test_forecasts.py +++ b/tests/functional/test_forecasts.py @@ -180,7 +180,7 @@ def test_latest_forecast(client: JuaClient, model: Models): ) -@pytest.mark.parametrize("model", [Models.EPT2_E]) +@pytest.mark.parametrize("model", [Models.EPT2_E, Models.EPT2_HRRR, Models.EPT2_EUROPA]) def test_latest_forecast_with_stats(client: JuaClient, model: Models): """Test retrieving the latest forecast with statistics. diff --git a/tests/weather/test_hrrr_europa_meta.py b/tests/weather/test_hrrr_europa_meta.py new file mode 100644 index 0000000..1ab6e44 --- /dev/null +++ b/tests/weather/test_hrrr_europa_meta.py @@ -0,0 +1,21 @@ +"""Regression tests for EPT2 HRRR / Europa ensemble metadata. + +Both regional models expose ensemble statistics through the forecast API, so +``has_statistics`` must stay enabled — otherwise ``get_forecasts(..., statistics=...)`` +is rejected client-side before the request is sent. +""" + +from jua.weather._model_meta import get_model_meta_info +from jua.weather.models import Models + + +def test_ept2_hrrr_has_ensemble_statistics() -> None: + meta = get_model_meta_info(Models.EPT2_HRRR) + assert meta.has_grid_access is True + assert meta.has_statistics is True + + +def test_ept2_europa_has_ensemble_statistics() -> None: + meta = get_model_meta_info(Models.EPT2_EUROPA) + assert meta.has_grid_access is True + assert meta.has_statistics is True