From 8480d62d33bef82aee9f8300d56c1c2427451bc8 Mon Sep 17 00:00:00 2001 From: Philipp Glaum <95913147+p-glaum@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:16:52 +0200 Subject: [PATCH] fix bug in simplyfy network (#1222) --- 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 66a5d119..9db3435b 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 simplify_links( 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