From e23dcd7aaa502bd3c696edab5e4f7380dadf591f Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Mon, 19 Aug 2024 17:49:02 +0200 Subject: [PATCH] Drop duplicate HV buses for eHv clustering busmap When scn_extension is selected, some HV buses are connected to more than one eHV bus. This leads to duplicated indices in the path matrix. To avoid this, each HV bus is only considered once using transformers.bus1.unique(). --- etrago/cluster/spatial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etrago/cluster/spatial.py b/etrago/cluster/spatial.py index 36b33e04..96124b32 100755 --- a/etrago/cluster/spatial.py +++ b/etrago/cluster/spatial.py @@ -429,7 +429,7 @@ def busmap_by_shortest_path(network, fromlvl, tolvl, cpu_cores=4): lines_plus_dc["carrier"] = "AC" # temporary end points, later replaced by bus1 pendant - t_buses = transformer[mask].bus0 + t_buses = transformer[mask].bus0.unique() # create all possible pathways ppaths = list(product(s_buses, t_buses))