Skip to content

Commit

Permalink
nowcasting_datamodel==1.5.34 (#328)
Browse files Browse the repository at this point in the history
* nowcasting_datamodel==1.5.34

* pydantic==2.3

* nowcasting_datamodel==1.5.36, and update pydantic models

* fix test
  • Loading branch information
peterdudfield authored Mar 13, 2024
1 parent 02cd8fe commit accad6d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ uvicorn[standard]
pydantic
numpy
requests
nowcasting_datamodel==1.5.18
nowcasting_datamodel==1.5.36
sqlalchemy
psycopg2-binary
geopandas
Expand Down
4 changes: 2 additions & 2 deletions src/pydantic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ",
Expand All @@ -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 ",
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_gsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit accad6d

Please sign in to comment.