diff --git a/config/config.default.yaml b/config/config.default.yaml index ad220b41..d3b45fda 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -621,14 +621,10 @@ clustering: exclude_carriers: [] aggregation_strategies: generators: - p_nom_max: sum # use "min" for more conservative assumptions - p_nom_min: sum - p_min_pu: mean - marginal_cost: mean + p_nom_max: weighted_min committable: any ramp_limit_up: max ramp_limit_down: max - efficiency: mean solving: #tmpdir: "path/to/tmp" @@ -775,6 +771,8 @@ plotting: H2: "Hydrogen Storage" lines: "Transmission Lines" ror: "Run of River" + ac: "AC" + dc: "DC" tech_colors: # wind diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 28d63278..0a2827f4 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -499,13 +499,6 @@ if __name__ == "__main__": Nyears, ).at["HVAC overhead", "capital_cost"] - def consense(x): - v = x.iat[0] - assert ( - x == v - ).all() or x.isnull().all(), "The `potential` configuration option must agree for all renewable carriers, for now!" - return v - custom_busmap = params.custom_busmap if custom_busmap: custom_busmap = pd.read_csv( diff --git a/scripts/plot_statistics.py b/scripts/plot_statistics.py index 7a2875d8..5739207c 100644 --- a/scripts/plot_statistics.py +++ b/scripts/plot_statistics.py @@ -36,7 +36,11 @@ if __name__ == "__main__": # %% def rename_index(ds): - return ds.set_axis(ds.index.map(lambda x: f"{x[1]}\n({x[0].lower()})")) + specific = ds.index.map(lambda x: f"{x[1]}\n({x[0].lower()})") + generic = ds.index.get_level_values("carrier") + duplicated = generic.duplicated(keep=False) + index = specific.where(duplicated, generic) + return ds.set_axis(index) def plot_static_per_carrier(ds, ax, drop_zero=True): if drop_zero: diff --git a/scripts/simplify_network.py b/scripts/simplify_network.py index 99964c65..c87d6672 100644 --- a/scripts/simplify_network.py +++ b/scripts/simplify_network.py @@ -256,8 +256,12 @@ def _aggregate_and_move_components( _, generator_strategies = get_aggregation_strategies(aggregation_strategies) carriers = set(n.generators.carrier) - set(exclude_carriers) - generators, generators_pnl = aggregategenerators( - n, busmap, carriers=carriers, custom_strategies=generator_strategies + generators, generators_pnl = aggregateoneport( + n, + busmap, + "Generator", + carriers=carriers, + custom_strategies=generator_strategies, ) replace_components(n, "Generator", generators, generators_pnl) @@ -602,14 +606,16 @@ if __name__ == "__main__": # some entries in n.buses are not updated in previous functions, therefore can be wrong. as they are not needed # and are lost when clustering (for example with the simpl wildcard), we remove them for consistency: - buses_c = { + remove = [ "symbol", "tags", "under_construction", "substation_lv", "substation_off", - }.intersection(n.buses.columns) - n.buses = n.buses.drop(buses_c, axis=1) + "geometry", + ] + n.buses.drop(remove, axis=1, inplace=True, errors="ignore") + n.lines.drop(remove, axis=1, errors="ignore", inplace=True) update_p_nom_max(n)