Skip to content

Commit 9452fc3

Browse files
committed
Save some dispatch_plot mods for future reference
1 parent a9c4e39 commit 9452fc3

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

viz/dispatch_plot.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,21 @@ def get_plotting_data(
460460

461461
# Split storage into charging and discharging and aggregate storage charging
462462
# Assume any dispatch that is negative is storage charging
463+
# TODO: this doesn't work if there are other negative dispatch values (
464+
# e.g., negative capacity factors for certain technologies)
463465
df["Storage_Charging"] = 0
464466
stor_techs = df.columns[(df < 0).any()]
467+
# stor_techs = ["Battery"]
465468
for tech in stor_techs:
466469
df["Storage_Charging"] += -df[tech].clip(upper=0)
467470
df[tech] = df[tech].clip(lower=0)
468471

472+
# df["Flex_Load_Charging"] = 0
473+
# flex_load_techs = ["Flexible_Load"]
474+
# for tech in flex_load_techs:
475+
# df["Flex_Load_Charging"] += -df[tech].clip(upper=0)
476+
# df[tech] = df[tech].clip(lower=0)
477+
469478
# Add variable curtailment (if any)
470479
curtailment_variable = get_variable_curtailment_results(
471480
c=c,
@@ -607,7 +616,12 @@ def create_plot(
607616
# treated as lines instead)
608617
# Note: the order of this list determines the order of the 'Load + ...'
609618
# lines
610-
items_treated_as_load_plus_lines = ["Storage_Charging", "Exports", "Market_Sales"]
619+
items_treated_as_load_plus_lines = [
620+
# "Flex_Load_Charging",
621+
"Storage_Charging",
622+
"Exports",
623+
"Market_Sales",
624+
]
611625
line_cols_storage_sum_track = [
612626
"Load",
613627
] + items_treated_as_load_plus_lines
@@ -629,7 +643,7 @@ def create_plot(
629643

630644
# Set up the figure
631645
plot = figure(
632-
min_width=800,
646+
min_width=1200,
633647
min_height=500,
634648
tools=["pan", "reset", "zoom_in", "zoom_out", "save", "help"],
635649
title=title,
@@ -661,7 +675,7 @@ def create_plot(
661675

662676
# Add 'Load + ...' lines
663677
active_items = []
664-
for i in ["Storage_Charging", "Exports", "Market_Sales"]:
678+
for i in items_treated_as_load_plus_lines:
665679
if i not in df.columns:
666680
inactive = True
667681
else:

0 commit comments

Comments
 (0)