Skip to content

Commit

Permalink
added self
Browse files Browse the repository at this point in the history
  • Loading branch information
Schefflera-Arboricola committed Feb 2, 2024
1 parent f88c1fe commit 00e7aa0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions benchmarks/benchmarks/bench_node_chunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ class ChunkBenchmarks(Benchmark):
params = [(chunking), (num_nodes), (edge_prob)]
param_names = ["chunking", "num_nodes", "edge_prob"]

def time_betweenness_centrality_chunking(chunking, num_nodes, edge_prob):
def time_betweenness_centrality_chunking(self, chunking, num_nodes, edge_prob):
G = get_cached_gnp_random_graph(num_nodes, edge_prob)
if chunking:
_ = nxp.betweenness_centrality_chunk(G)
else:
_ = nxp.betweenness_centrality_no_chunk(G)

def time_all_pairs_bellman_ford_path_chunking(chunking, num_nodes, edge_prob):
def time_all_pairs_bellman_ford_path_chunking(self, chunking, num_nodes, edge_prob):
G = get_cached_gnp_random_graph(num_nodes, edge_prob, is_weighted=True)
if chunking:
_ = dict(nxp.all_pairs_bellman_ford_path_chunk(G))
else:
_ = dict(nxp.all_pairs_bellman_ford_path_no_chunk(G))

def time_local_efficiency_chunking(chunking, num_nodes, edge_prob):
def time_local_efficiency_chunking(self, chunking, num_nodes, edge_prob):
G = get_cached_gnp_random_graph(num_nodes, edge_prob)
if chunking:
_ = nxp.local_efficiency_chunk(G)
else:
_ = nxp.local_efficiency_no_chunk(G)

def time_number_of_isolates_chunking(chunking, num_nodes, edge_prob):
def time_number_of_isolates_chunking(self, chunking, num_nodes, edge_prob):
G = get_cached_gnp_random_graph(num_nodes, edge_prob)
if chunking:
_ = nxp.number_of_isolates_chunk(G)
else:
_ = nxp.number_of_isolates_no_chunk(G)

def time_closeness_vitality_chunking(chunking, num_nodes, edge_prob):
def time_closeness_vitality_chunking(self, chunking, num_nodes, edge_prob):
G = get_cached_gnp_random_graph(num_nodes, edge_prob)
if chunking:
_ = nxp.closeness_vitality_chunk(G)
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benchmarks/bench_node_chunks_tournament.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
class TournamentChunkBenchmark(Benchmark):
params = [(chunking), (num_nodes)]
param_names = ["chunking", "num_nodes"]
def time_tournament_is_reachable_chunking(chunking, num_nodes):
def time_tournament_is_reachable_chunking(self, chunking, num_nodes):
G = nx.tournament.random_tournament(num_nodes, seed=42)
if chunking:
_ = nxp.tournament.is_reachable_chunk(G, 1, num_nodes)
else:
_ = nxp.tournament.is_reachable_no_chunk(G, 1, num_nodes)

def time_tournament_is_strongly_connected_chunking(chunking, num_nodes):
def time_tournament_is_strongly_connected_chunking(self, chunking, num_nodes):
G = nx.tournament.random_tournament(num_nodes, seed=42)
if chunking:
_ = nxp.tournament.is_strongly_connected_chunk(G)
Expand Down

0 comments on commit 00e7aa0

Please sign in to comment.