diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index 7ddf805b..59668453 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -306,11 +306,11 @@ if __name__ == "__main__": # segments with package tsam time_seg_config = snakemake.params.snapshots.get("segmentation", False) - time_seg_wildcard = get_opt(opts, r"^\d+seg$")[:-3] + time_seg_wildcard = get_opt(opts, r"^\d+seg$") time_seg = time_seg_wildcard or time_seg_config if time_seg: solver_name = snakemake.config["solving"]["solver"]["name"] - n = apply_time_segmentation(n, time_seg, solver_name) + n = apply_time_segmentation(n, time_seg.replace("seg",""), solver_name) Co2L_config = snakemake.params.co2limit_enable Co2L_wildcard, co2limit_wildcard = find_opt(opts, "Co2L") diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 08bb51d5..963a85a9 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -599,10 +599,10 @@ def extra_functionality(n, snapshots): add_operational_reserve_margin(n, snapshots, config) EQ_config = constraints.get("EQ", False) - EQ_wildcard = get_opt(opts, r"^EQ+[0-9]*\.?[0-9]+(c|)")[2:] + EQ_wildcard = get_opt(opts, r"^EQ+[0-9]*\.?[0-9]+(c|)") EQ_o = EQ_wildcard or EQ_config if EQ_o: - add_EQ_constraints(n, EQ_o) + add_EQ_constraints(n, EQ_o.replace("EQ","")) add_battery_constraints(n) add_pipe_retrofit_constraint(n)