diff --git a/etrago/appl.py b/etrago/appl.py index cdf3f3ad..48bd6f40 100644 --- a/etrago/appl.py +++ b/etrago/appl.py @@ -103,7 +103,8 @@ "generator_noise": 789456, # apply generator noise, False or seed number "extra_functionality": {}, # Choose function name or {} # Spatial Complexity: - "network_clustering_ehv": False, # clustering of HV buses to EHV buses + "delete_dispensable_ac_buses": False, # bool. Find and delete unnecesary buses + "network_clustering_ehv": True, # clustering of HV buses to EHV buses "network_clustering": { "active": True, # choose if clustering is activated "method": "kmedoids-dijkstra", # choose clustering method: kmeans or kmedoids-dijkstra @@ -379,6 +380,11 @@ def run_etrago(args, json_path): Limit overall energy production country-wise for each generator by carrier. Set upper/lower limit in p.u. + delete_dispensable_ac_buses: bool + Choose if unnecessary buses should be identified and deleted from the + grid. This buses have no load or generation attached. Additionally, + they are just connected to two other buses. + Default: False. network_clustering_ehv : bool Choose if you want to cluster the full HV/EHV dataset down to only the EHV buses. In that case, all HV buses are assigned to their closest EHV diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index c3f29dee..d7671fc7 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -127,8 +127,16 @@ def buses_grid_linked(network, voltage_level): mask = ( network.buses.index.isin(network.lines.bus0) | (network.buses.index.isin(network.lines.bus1)) - | (network.buses.index.isin(network.links.loc[network.links.carrier=="DC", "bus0"])) - | (network.buses.index.isin(network.links.loc[network.links.carrier=="DC", "bus1"])) + | ( + network.buses.index.isin( + network.links.loc[network.links.carrier == "DC", "bus0"] + ) + ) + | ( + network.buses.index.isin( + network.links.loc[network.links.carrier == "DC", "bus1"] + ) + ) ) & (network.buses.v_nom.isin(voltage_level)) df = network.buses[mask] @@ -1081,6 +1089,8 @@ def delete_dispensable_ac_buses(etrago): None. """ + if etrago.args["delete_dispensable_ac_buses"] == False: + return def delete_buses(delete_buses, network): drop_buses = delete_buses.index.to_list()