networkx / nx-parallel

A networkx backend that uses joblib to run graph algorithms in parallel.
BSD 3-Clause "New" or "Revised" License
23 stars 20 forks source link

[ENH, BUG] : added `time_tournament_is_strongly_connected` benchmark, renamed `tournament_is_strongly_connected` to `is_strongly_connected` #32

Closed Schefflera-Arboricola closed 5 months ago

Schefflera-Arboricola commented 8 months ago

Please do "Squash and merge" while merging this PR

  1. added time_tournament_is_strongly_connected benchmark
  2. renamed tournament_is_strongly_connected to is_strongly_connected in tournament.py and then assigned tournament_is_strongly_connected = is_strongly_connected in Dispatcher class, like how it's done in the main networkx repo(origin https://github.com/networkx/nx-parallel/pull/27)
>>> import nx_parallel as nxp
>>> import networkx as nx
>>> G = nx.tournament.random_tournament(50, seed=42)
>>> nx.tournament.is_strongly_connected(G)
True

Before :

>>> nxp.tournament.is_strongly_connected(G)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'nx_parallel.algorithms.tournament' has no attribute 'is_strongly_connected'

After :

>>> nxp.tournament.is_strongly_connected(G)
True
Schefflera-Arboricola commented 6 months ago

The failed test should pass after a re-run. fixed @ https://github.com/networkx/networkx/pull/7264