Skip to content

Commit

Permalink
fix bug in simplyfy network (#1222)
Browse files Browse the repository at this point in the history
  • Loading branch information
p-glaum authored Aug 16, 2024
1 parent 55cca6a commit 8480d62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/simplify_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 8480d62

Please sign in to comment.