From 9f8e0515c3a1aef6aef793f1e9661f6eba5e859f Mon Sep 17 00:00:00 2001 From: Philipp Glaum Date: Fri, 16 Aug 2024 09:32:16 +0200 Subject: [PATCH] fix bug in simplyfy network --- scripts/simplify_network.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/simplify_network.py b/scripts/simplify_network.py index 66a5d1190..9db3435bf 100644 --- a/scripts/simplify_network.py +++ b/scripts/simplify_network.py @@ -301,7 +301,7 @@ def simplify_links( # Only span graph over the DC link components G = n.graph(branch_components=["Link"]) - def split_links(nodes, added_supernodes=None): + def split_links(nodes, added_supernodes): nodes = frozenset(nodes) seen = set() @@ -363,7 +363,9 @@ def split_links(nodes, added_supernodes=None): added_supernodes.append(node_corsica) for lbl in labels.value_counts().loc[lambda s: s > 2].index: - for b, buses, links in split_links(labels.index[labels == lbl]): + for b, buses, links in split_links( + labels.index[labels == lbl], added_supernodes + ): if len(buses) <= 2: continue