From 0cb1fa618a4699827c03a4e307a5f3d4dae82a94 Mon Sep 17 00:00:00 2001 From: CarlosEpia Date: Mon, 22 Apr 2024 07:31:54 +0200 Subject: [PATCH] rename cluster_interest_area --- etrago/appl.py | 15 ++++----------- etrago/cluster/electrical.py | 6 +++--- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/etrago/appl.py b/etrago/appl.py index 026fd4ef..0a50b98c 100644 --- a/etrago/appl.py +++ b/etrago/appl.py @@ -117,9 +117,9 @@ "network_clustering": { "active": True, # choose if clustering is activated "method": "kmedoids-dijkstra", # choose clustering method: kmeans or kmedoids-dijkstra - "n_clusters_AC": 30, # total number of resulting AC nodes (DE+foreign) + "n_clusters_AC": 30, # total number of resulting AC nodes (DE+foreign-interest_area) "cluster_foreign_AC": False, # take foreign AC buses into account, True or False - "cluster_interest_area": False, # False or number of buses. + "n_cluster_interest_area": False, # False or number of buses. "method_gas": "kmedoids-dijkstra", # choose clustering method: kmeans or kmedoids-dijkstra "n_clusters_gas": 14, # total number of resulting CH4 nodes (DE+foreign) "cluster_foreign_gas": False, # take foreign CH4 buses into account, True or False @@ -454,15 +454,8 @@ def run_etrago(args, json_path): as well and included in number of clusters specified through ``'n_clusters_AC'``. Default: False. - * "interest_area": False, list, string - Area of especial interest that will be not clustered. It is by - default set to false. When an interest_area is provided, the given - value for n_clusters_AC will mean the total of AC buses outside the - area.The area can be provided in two ways: list of - nuts names e.G. ["Cuxhaven", "Bremerhaven", "Bremen"] or a string - with a path to a shape file (.shp). - Default: False. - * "cluster_interest_area": False, int + + * "n_cluster_interest_area": False, int Number of buses to cluster all the electrical buses in the area of interest. Method provided in the arg "method" is used. If it is set to False, the area of interest is not clustered. diff --git a/etrago/cluster/electrical.py b/etrago/cluster/electrical.py index b096d1e3..2bbd8070 100755 --- a/etrago/cluster/electrical.py +++ b/etrago/cluster/electrical.py @@ -936,7 +936,7 @@ def include_busmap_area(etrago, busmap, medoid_idx, network_area, weight_area): if not etrago.args["interest_area"]: return busmap, medoid_idx - if not args["cluster_interest_area"]: + if not args["n_cluster_interest_area"]: for bus in network_area.buses.index: busmap[bus] = bus return busmap, medoid_idx @@ -946,7 +946,7 @@ def include_busmap_area(etrago, busmap, medoid_idx, network_area, weight_area): etrago, network_area, weight_area, - args["cluster_interest_area"], + args["n_cluster_interest_area"], ) busmap_area = ( busmap_area.astype(int) + busmap.apply(int).max() + 1 @@ -958,7 +958,7 @@ def include_busmap_area(etrago, busmap, medoid_idx, network_area, weight_area): network_area.buses, network_area.lines, weight_area, - args["cluster_interest_area"], + args["n_cluster_interest_area"], ) medoid_idx_area.index = (