Skip to content

Commit

Permalink
fix: failing unit tests, redundant / incomplete joblib param propogat…
Browse files Browse the repository at this point in the history
…ion from ParallelConfig
  • Loading branch information
dPys committed Oct 17, 2024
1 parent 66a680f commit 427e5e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions _nx_parallel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get_info():
},
},
"betweenness_centrality": {
"url": "https://github.com/networkx/nx-parallel/blob/main/nx_parallel/algorithms/centrality/betweenness.py#L20",
"url": "https://github.com/networkx/nx-parallel/blob/main/nx_parallel/algorithms/centrality/betweenness.py#L19",
"additional_docs": "The parallel computation is implemented by dividing the nodes into chunks and computing betweenness centrality for each chunk concurrently.",
"additional_parameters": {
'get_chunks : str, function (default = "chunks")': "A function that takes in a list of all the nodes as input and returns an iterable `node_chunks`. The default chunking is done by slicing the `nodes` into `n_jobs` number of chunks."
Expand All @@ -98,7 +98,7 @@ def get_info():
},
},
"edge_betweenness_centrality": {
"url": "https://github.com/networkx/nx-parallel/blob/main/nx_parallel/algorithms/centrality/betweenness.py#L96",
"url": "https://github.com/networkx/nx-parallel/blob/main/nx_parallel/algorithms/centrality/betweenness.py#L100",
"additional_docs": "The parallel computation is implemented by dividing the nodes into chunks and computing edge betweenness centrality for each chunk concurrently.",
"additional_parameters": {
'get_chunks : str, function (default = "chunks")': "A function that takes in a list of all the nodes as input and returns an iterable `node_chunks`. The default chunking is done by slicing the `nodes` into `n_jobs` number of chunks."
Expand Down
2 changes: 0 additions & 2 deletions nx_parallel/interface.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from functools import wraps
from operator import attrgetter
import networkx as nx
from nx_parallel import algorithms
from nx_parallel.utils.chunk import execute_parallel

__all__ = ["BackendInterface", "ParallelGraph"]

Expand Down
5 changes: 3 additions & 2 deletions nx_parallel/tests/test_get_chunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ def iterator_func(G):
H, process_func, iterator_func, get_chunks=random_chunking
)
if isinstance(c1, types.GeneratorType):
c1, c2 = list(c1), list(
c2
c1, c2 = (
list(c1),
list(c2),
) # Convert generators to lists for comparison
if func in chk_dict_vals:
for i in range(len(G.nodes)):
Expand Down

0 comments on commit 427e5e7

Please sign in to comment.