Skip to content

Commit

Permalink
fix for no forecast date
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Nov 14, 2024
1 parent 7d8e195 commit 39f756d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pvsite_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ def pvsite_forecast_page():
{"forecast_datetime": xs[name], f"forecast_power_kw_{name}": ys[name]}
)
df_forecast = df_forecast.merge(temp, on="forecast_datetime", how="outer")
if len(ml_models) == 0:
df_forecast = pd.DataFrame(columns=["forecast_datetime"])
df_generation = pd.DataFrame({"generation_datetime": xx, "generation_power_kw": yy})
df_forecast.set_index("forecast_datetime", inplace=True)
df_generation.set_index("generation_datetime", inplace=True)
Expand Down

0 comments on commit 39f756d

Please sign in to comment.