Skip to content

Commit

Permalink
mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NormannK committed Jan 13, 2025
1 parent dc26b79 commit 86d5f6b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/akkudoktoreos/utils/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _save_group_to_pdf(self, group: list[Callable[[], None]]) -> None:
def create_line_chart_date(
self,
start_date: pendulum.DateTime,
y_list: list[list[Optional[float]]],
y_list: list[Union[np.ndarray, list[Optional[float]], list[float]]],
ylabel: str,
xlabel: Optional[str] = None,
title: Optional[str] = None,
Expand Down Expand Up @@ -149,8 +149,8 @@ def chart() -> None:
# Auto-format the x-axis for readability

# Move major tick labels further down to avoid collision with minor tick labels
for label in plt.gca().get_xticklabels(which="major"):
label.set_y(-0.04)
for plt_label in plt.gca().get_xticklabels(which="major"):
plt_label.set_y(-0.04)

# Add labels, title, and legend
if xlabel:
Expand Down Expand Up @@ -414,15 +414,19 @@ def prepare_visualize(
print(parameters.ems.gesamtlast)
report.create_line_chart_date(
next_full_hour_date, # start_date
[parameters.ems.gesamtlast],
[
parameters.ems.gesamtlast,
],
title="Load Profile",
# xlabel="Hours", # not enough space
ylabel="Load (Wh)",
labels=["Total Load (Wh)"],
)
report.create_line_chart_date(
next_full_hour_date, # start_date
[parameters.ems.pv_prognose_wh],
[
parameters.ems.pv_prognose_wh,
],
title="PV Forecast",
# xlabel="Hours", # not enough space
ylabel="PV Generation (Wh)",
Expand All @@ -439,7 +443,9 @@ def prepare_visualize(
if parameters.temperature_forecast:
report.create_line_chart_date(
next_full_hour_date, # start_date
[parameters.temperature_forecast],
[
parameters.temperature_forecast,
],
title="Temperature Forecast",
# xlabel="Hours", # not enough space
ylabel="°C",
Expand Down

0 comments on commit 86d5f6b

Please sign in to comment.