Skip to content

Commit

Permalink
Further Updates to Overview page to replace existing single page view
Browse files Browse the repository at this point in the history
  • Loading branch information
pclemow committed Aug 20, 2024
1 parent d1096c2 commit f30aab1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
10 changes: 4 additions & 6 deletions app/figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ def generate_dsr_commands_fig(df: pd.DataFrame) -> px.line:
)
return dsr_commands_fig


@figure("EV Charging Demand")
@axes(ylabel="MW", yrange=[-0.5, 4.5])
def generate_ev_demand_fig(df: pd.DataFrame) -> px.line:
Expand All @@ -797,12 +798,8 @@ def generate_ev_demand_fig(df: pd.DataFrame) -> px.line:
"Time",
]
].copy()
figure_data["Planned"] = (
df["Expected Ev Charging Power"]
)
figure_data["Actual"] = (
df["Real Ev Charging Power"]
)
figure_data["Planned"] = df["Expected Ev Charging Power"]
figure_data["Actual"] = df["Real Ev Charging Power"]
ev_demand_fig = px.line(
figure_data,
x="Time",
Expand All @@ -818,6 +815,7 @@ def generate_ev_demand_fig(df: pd.DataFrame) -> px.line:
)
return ev_demand_fig


def sainte_lague_algorithm(votes: list[int], seats: int) -> list[int]:
"""Saint-Lague algorithm for proportional representation in voting.
Expand Down
16 changes: 13 additions & 3 deletions app/pages/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
generate_agent_activity_breakdown_fig,
generate_balancing_market_fig,
generate_dsr_commands_fig,
generate_ev_demand_fig,
generate_energy_deficit_fig,
generate_ev_charging_breakdown_fig,
generate_ev_demand_fig,
generate_intraday_market_sys_fig,
generate_map_fig,
generate_total_dem_fig,
Expand Down Expand Up @@ -148,14 +148,24 @@
)
def update_figures(
n_intervals: int,
) -> tuple[go.Figure, px.line, px.line, go.Figure, go.Figure, px.line, px.line, go.Figure, go.Figure]:
) -> tuple[
go.Figure,
px.line,
px.line,
go.Figure,
go.Figure,
px.line,
px.line,
go.Figure,
go.Figure,
]:
"""Function to update the plots in this page.
Args:
n_intervals (int): The number of times this page has updated.
indexes by 1 every interval.
Returns: # TODO check this
Returns:
tuple[px.line,
px.line,
px.line,
Expand Down

0 comments on commit f30aab1

Please sign in to comment.