Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

327 update dm #329

Merged
merged 5 commits into from
Mar 13, 2024
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 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
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
Loading