@@ -64,14 +64,16 @@ def aggregate_by_keywords(opex_comp_agg, groups):
6464
6565 from _helpers import mock_snakemake
6666
67- snakemake = mock_snakemake (
68- "regret_plots" ,
69- )
67+ snakemake = mock_snakemake (
68+ "regret_plots" ,
69+ sensitivity = "gas_price_60" ,
70+ )
7071
7172 configure_logging (snakemake )
7273 config = snakemake .config
7374 planning_horizons = snakemake .params .planning_horizons
74- scenarios = ["HighDemand" , "LowDemand" ]
75+ scenarios = snakemake .params .scenarios
76+ decisions = ["decision_" + d for d in scenarios ]
7577 tech_colors = snakemake .params .plotting ["tech_colors" ]
7678
7779 # Nested dict: networks[year][scenario][decision] = Network
@@ -81,7 +83,7 @@ def aggregate_by_keywords(opex_comp_agg, groups):
8183 parts = fn .split (os .sep )
8284
8385 # scenario is the folder name 2 levels up
84- scenario = parts [- 3 ]
86+ scenario = parts [- 4 ]
8587 if scenario not in scenarios :
8688 raise ValueError (
8789 f"Unexpected scenario '{ scenario } ' in { fn } . Allowed: { scenarios } "
@@ -111,12 +113,10 @@ def aggregate_by_keywords(opex_comp_agg, groups):
111113 # Plot electricity price duration curves
112114
113115 fig , ax = plt .subplots (
114- figsize = (10 , 5 * len (planning_horizons )), nrows = len (planning_horizons ), ncols = 1
116+ figsize = (4 * len ( scenarios ) , 5 * len (planning_horizons )), nrows = len (planning_horizons ), ncols = 1
115117 )
116118 ax = ax .flatten ()
117119
118- decisions = ["decision_HighDemand" , "decision_LowDemand" ]
119-
120120 for i , year in enumerate (planning_horizons ):
121121 for scenario , decision in itertools .product (scenarios , decisions ):
122122 n = networks [year ][scenario ][decision ]
@@ -164,7 +164,7 @@ def aggregate_by_keywords(opex_comp_agg, groups):
164164 }
165165
166166 fig , axes = plt .subplots (
167- nrows = len (planning_horizons ), ncols = 1 , figsize = (12 , 6 * len (planning_horizons ))
167+ nrows = len (planning_horizons ), ncols = 1 , figsize = (6 * len ( scenarios ) , 6 * len (planning_horizons ))
168168 )
169169 axes = axes .flatten ()
170170
0 commit comments