Skip to content

Commit

Permalink
MAINT : style fix - 2 (#40)
Browse files Browse the repository at this point in the history
* style fix

* style fix

* style fix
  • Loading branch information
Schefflera-Arboricola authored Jan 31, 2024
1 parent 4852fc8 commit 516501e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ jobs:
NETWORKX_TEST_BACKEND=parallel \
NETWORKX_FALLBACK_TO_NX=True \
python -m pytest --pyargs networkx
6 changes: 3 additions & 3 deletions nx_parallel/algorithms/efficiency_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@


def local_efficiency(G):
"""The parallel computation is implemented by dividing the
nodes into chunks and then computing and adding global efficiencies of all node
in all chunks, in parallel, and then adding all these sums and dividing by the
"""The parallel computation is implemented by dividing the
nodes into chunks and then computing and adding global efficiencies of all node
in all chunks, in parallel, and then adding all these sums and dividing by the
total number of nodes at the end.
networkx.local_efficiency : https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.efficiency_measures.local_efficiency.html#local-efficiency
Expand Down
4 changes: 2 additions & 2 deletions nx_parallel/algorithms/shortest_paths/weighted.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@


def all_pairs_bellman_ford_path(G, weight="weight"):
"""The parallel computation is implemented by computing the
"""The parallel computation is implemented by computing the
shortest paths for each node concurrently.
networkx.all_pairs_bellman_ford_path : https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.weighted.all_pairs_bellman_ford_path.html#all-pairs-bellman-ford-path
"""

def _calculate_shortest_paths_subset(source):
return (source, single_source_bellman_ford_path(G, source, weight=weight))

Expand Down
6 changes: 3 additions & 3 deletions nx_parallel/algorithms/tournament.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

def is_reachable(G, s, t):
"""The function parallelizes the calculation of two
neighborhoods of vertices in `G` and checks closure conditions for each
neighborhood subset in parallel.
neighborhoods of vertices in `G` and checks closure conditions for each
neighborhood subset in parallel.
networkx.tournament.is_reachable : https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.tournament.is_reachable.html#networkx.algorithms.tournament.is_reachable
"""
Expand Down Expand Up @@ -53,7 +53,7 @@ def check_closure_subset(chunk):

def tournament_is_strongly_connected(G):
"""The parallel computation is implemented by dividing the
nodes into chunks and then checking whether each node is reachable from each
nodes into chunks and then checking whether each node is reachable from each
other node in parallel.
networkx.tournament.is_strongly_connected : https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.tournament.is_strongly_connected.html#networkx.algorithms.tournament.is_strongly_connected
Expand Down
6 changes: 3 additions & 3 deletions nx_parallel/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


class ParallelGraph:
"""A wrapper class for networkx.Graph, networkx.DiGraph, networkx.MultiGraph,
"""A wrapper class for networkx.Graph, networkx.DiGraph, networkx.MultiGraph,
and networkx.MultiDiGraph."""

__networkx_backend__ = "parallel"
Expand Down Expand Up @@ -64,14 +64,14 @@ def convert_from_nx(
*,
weight=None, # For nx.__version__ <= 3.1
):
"""Convert a networkx.Graph, networkx.DiGraph, networkx.MultiGraph,
"""Convert a networkx.Graph, networkx.DiGraph, networkx.MultiGraph,
or networkx.MultiDiGraph to a ParallelGraph."""
if isinstance(graph, ParallelGraph):
return graph
return ParallelGraph(graph)

@staticmethod
def convert_to_nx(result, *, name=None):
"""Convert a ParallelGraph to a networkx.Graph, networkx.DiGraph,
"""Convert a ParallelGraph to a networkx.Graph, networkx.DiGraph,
networkx.MultiGraph, or networkx.MultiDiGraph."""
return result

0 comments on commit 516501e

Please sign in to comment.