Skip to content

Commit

Permalink
Update metric_utilities.py
Browse files Browse the repository at this point in the history
more formatting...
  • Loading branch information
barneydobson committed Mar 11, 2024
1 parent bdcbd8b commit 4cf2675
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions swmmanywhere/metric_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""
from collections import defaultdict
from inspect import signature
from typing import Callable
from typing import Callable, Optional

import cytoolz.curried as tlz
import geopandas as gpd
Expand Down Expand Up @@ -214,7 +214,7 @@ def nc_compare(G1, G2, funcname, **kw):

def edge_betweenness_centrality(G: nx.Graph,
normalized: bool = True,
weight: str = "weight",
weight: Optional[str] = "weight",
njobs: int = -1):
"""Parallel betweenness centrality function."""
njobs = joblib.cpu_count(True) if njobs == -1 else njobs
Expand All @@ -229,7 +229,7 @@ def edge_betweenness_centrality(G: nx.Graph,
)

# Merge the betweenness centrality results
bt_c = defaultdict(float)
bt_c: dict[int, float] = defaultdict(float)
for bt in bt_sc:
for n, v in bt.items():
bt_c[n] += v
Expand Down

0 comments on commit 4cf2675

Please sign in to comment.