Skip to content

Commit

Permalink
327 update dm (#329)
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

* role back model changes
  • Loading branch information
peterdudfield authored Mar 13, 2024
1 parent c29f1a9 commit adb9f1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pydantic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ def convert_location_sql_to_many_datetime_many_generation(

# loop over locations and gsp yields to create a dictionary of gsp generation by datetime
for location in locations:
gsp_id = location.gsp_id
gsp_id = str(location.gsp_id)
for gsp_yield in location.gsp_yields:
datetime_utc = gsp_yield.datetime_utc
solar_generation_kw = round(gsp_yield.solar_generation_kw, 2)
solar_generation_kw = str(round(gsp_yield.solar_generation_kw, 2))

# if the datetime object is not in the dictionary, add it
if gsp_yield.datetime_utc not in many_gsp_generation:
Expand Down Expand Up @@ -134,7 +134,7 @@ def convert_forecasts_to_many_datetime_many_generation(

# loop over locations and gsp yields to create a dictionary of gsp generation by datetime
for forecast in forecasts:
gsp_id = forecast.location.gsp_id
gsp_id = str(forecast.location.gsp_id)
if historic:
forecast_values = forecast.forecast_values_latest
else:
Expand Down

0 comments on commit adb9f1a

Please sign in to comment.