Skip to content

Commit

Permalink
Simplify definition of dc_as_links flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ekatef committed Jul 9, 2023
1 parent e44cdb1 commit 29dc7d6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/simplify_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ def simplify_links(n, costs, config, output, aggregation_strategies=dict()):
pass
return n, n.buses.index.to_series()

dc_as_links = not n.links.loc[n.links.carrier == "DC"].empty
dc_as_lines = not n.lines.loc[n.lines.carrier == "DC"].empty
dc_as_links = not (n.lines.carrier == "DC").any()

# Determine connected link components, ignore all links but DC
adjacency_matrix = n.adjacency_matrix(
Expand Down Expand Up @@ -400,7 +399,7 @@ def split_links(nodes):
lengths * n.links.loc[all_links, "underwater_fraction"]
).sum() / lengths.sum()
# HVDC part is represented as "Line" component
elif dc_as_lines:
else:
p_max_pu = config["lines"].get("p_max_pu", 1.0)
lengths = n.lines.loc[all_dc_lines, "length"]
length = lengths.sum() / len(lengths) if len(lengths) > 0 else 0
Expand Down

0 comments on commit 29dc7d6

Please sign in to comment.