From c2111a36841d5e43b6beae1fd667996d35646e30 Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Tue, 11 Oct 2022 15:24:14 -0500 Subject: Allow dispatcher decorator without a name - Name is taken from the decorated function - Raise error if backend doesn't implement a decorated function which is called - Check for duplicate names for dispatching algorithms --- networkx/algorithms/tournament.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'networkx/algorithms/tournament.py') diff --git a/networkx/algorithms/tournament.py b/networkx/algorithms/tournament.py index 60d09f31..a57c3592 100644 --- a/networkx/algorithms/tournament.py +++ b/networkx/algorithms/tournament.py @@ -61,7 +61,7 @@ def index_satisfying(iterable, condition): raise ValueError("iterable must be non-empty") from err -@nx.dispatch("is_tournament") +@nx.dispatch @not_implemented_for("undirected") @not_implemented_for("multigraph") def is_tournament(G): @@ -180,7 +180,7 @@ def random_tournament(n, seed=None): return nx.DiGraph(edges) -@nx.dispatch("score_sequence") +@nx.dispatch @not_implemented_for("undirected") @not_implemented_for("multigraph") def score_sequence(G): @@ -210,7 +210,7 @@ def score_sequence(G): return sorted(d for v, d in G.out_degree()) -@nx.dispatch("tournament_matrix") +@nx.dispatch @not_implemented_for("undirected") @not_implemented_for("multigraph") def tournament_matrix(G): -- cgit v1.2.1