Skip to content

Commit

Permalink
changed all_pairs def
Browse files Browse the repository at this point in the history
  • Loading branch information
Schefflera-Arboricola committed Feb 7, 2024
1 parent e9c6c06 commit 5bc797e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions nx_parallel/algorithms/approximation/connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ def _calculate_all_pairs_node_connectivity_subset(chunk):

pairs = list(iter_func(nbunch, 2))

all_pairs = {}
for u, v in pairs:
all_pairs.setdefault(u, {})[v] = None
if not directed:
all_pairs.setdefault(v, {})[u] = None
all_pairs = {u: {v: None for v in nbunch if v != u} for u in nbunch}

total_cores = nxp.cpu_count()
num_in_chunk = max(len(pairs) // total_cores, 1)
Expand Down

0 comments on commit 5bc797e

Please sign in to comment.