Merge pull request #678 from davide-f/fix_clustering_LT

Update cluster_network to avoid adding deleted links in clustered net…
This commit is contained in:
Fabian Neumann 2023-06-09 17:54:23 +02:00 committed by GitHub
commit 778f850a9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
)