Skip to content

Commit

Permalink
add dashed line, to now / created time
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Dec 20, 2024
1 parent 84bb047 commit d446e4b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/pvsite_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ def pvsite_forecast_page():
endtime = endtime.astimezone(pytz.utc)

if created is not None:
created = timezone_selected.localize(created)
created = created.astimezone(pytz.utc)
created_utc = timezone_selected.localize(created)
created_utc = created_utc.astimezone(pytz.utc)
else:
created_utc = None

# great ml model names for this site

Expand Down Expand Up @@ -200,7 +202,7 @@ class Models:
session=session,
site_uuids=[site_selection_uuid],
start_utc=starttime,
created_by=created,
created_by=created_utc,
forecast_horizon_minutes=forecast_horizon,
day_ahead_hours=day_ahead_hours,
day_ahead_timezone_delta_hours=day_ahead_timezone_delta_hours,
Expand Down Expand Up @@ -297,6 +299,18 @@ class Models:
)
)

# if showing latest add a now line
if forecast_type == "Latest":

fig.add_shape(
dict(
type="line",
x0=created,
y0=0,
x1=created,
y1=capacity,
line=dict(color="red", width=2, dash='dash')))

st.plotly_chart(fig, theme="streamlit")

# download data,
Expand Down

0 comments on commit d446e4b

Please sign in to comment.