Skip to content

Commit

Permalink
Merge pull request #678 from davide-f/fix_clustering_LT
Browse files Browse the repository at this point in the history
Update cluster_network to avoid adding deleted links in clustered net…
  • Loading branch information
fneum authored Jun 9, 2023
2 parents 80eadcf + 176bebd commit 778f850
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/cluster_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,10 @@ def clustering_for_n_clusters(
n.links.eval("underwater_fraction * length").div(nc.links.length).dropna()
)
nc.links["capital_cost"] = nc.links["capital_cost"].add(
(nc.links.length - n.links.length).clip(lower=0).mul(extended_link_costs),
(nc.links.length - n.links.length)
.clip(lower=0)
.mul(extended_link_costs)
.dropna(),
fill_value=0,
)

Expand Down

0 comments on commit 778f850

Please sign in to comment.