diff --git a/requirements.txt b/requirements.txt index 2ea7900..e39de05 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ uvicorn[standard] pydantic numpy requests -nowcasting_datamodel==1.5.18 +nowcasting_datamodel==1.5.36 sqlalchemy psycopg2-binary geopandas diff --git a/src/pydantic_models.py b/src/pydantic_models.py index 7f812f8..74a0978 100644 --- a/src/pydantic_models.py +++ b/src/pydantic_models.py @@ -54,7 +54,7 @@ class GSPYieldGroupByDatetime(EnhancedBaseModel): """gsp yields for one a singel datetime""" datetime_utc: datetime = Field(..., description="The timestamp of the gsp yield") - generation_kw_by_gsp_id: Dict[str, str] = Field( + generation_kw_by_gsp_id: Dict[int, float] = Field( ..., description="List of generations by gsp_id. Key is gsp_id, value is generation_kw. " "We keep this as a dictionary to keep the size of the file small ", @@ -65,7 +65,7 @@ class OneDatetimeManyForecastValues(EnhancedBaseModel): """One datetime with many forecast values""" datetime_utc: datetime = Field(..., description="The timestamp of the gsp yield") - forecast_values: Dict[str, float] = Field( + forecast_values: Dict[int, float] = Field( ..., description="List of forecasts by gsp_id. Key is gsp_id, value is generation_kw. " "We keep this as a dictionary to keep the size of the file small ", diff --git a/src/tests/test_gsp.py b/src/tests/test_gsp.py index 9a6b411..36e5ba3 100644 --- a/src/tests/test_gsp.py +++ b/src/tests/test_gsp.py @@ -246,7 +246,7 @@ def test_read_latest_all_gsp_historic_compact(db_session, api_client): assert len(r) > 50 assert len(r[0].forecast_values) == 9 # dont get the national - assert r[0].forecast_values["1"] <= 13000 + assert r[0].forecast_values[1] <= 13000 @freeze_time("2022-01-01")