summaryrefslogtreecommitdiff
path: root/networkx/algorithms/regular.py
diff options
context:
space:
mode:
authorJim Kitchen <jim22k@gmail.com>2022-10-11 15:24:14 -0500
committerMridul Seth <git@mriduls.com>2022-10-12 12:05:14 +0400
commitc2111a36841d5e43b6beae1fd667996d35646e30 (patch)
tree38fa5e1316ca45a9906169ceb7ac21bfc52a612e /networkx/algorithms/regular.py
parent71434d674cf8ec6c3007dd41b78ee6f407e9b4eb (diff)
downloadnetworkx-nx-sparse.tar.gz
Allow dispatcher decorator without a namenx-sparse
- 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
Diffstat (limited to 'networkx/algorithms/regular.py')
-rw-r--r--networkx/algorithms/regular.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/networkx/algorithms/regular.py b/networkx/algorithms/regular.py
index 89b98742..7c0b2709 100644
--- a/networkx/algorithms/regular.py
+++ b/networkx/algorithms/regular.py
@@ -5,7 +5,7 @@ from networkx.utils import not_implemented_for
__all__ = ["is_regular", "is_k_regular", "k_factor"]
-@nx.dispatch("is_regular")
+@nx.dispatch
def is_regular(G):
"""Determines whether the graph ``G`` is a regular graph.
@@ -41,7 +41,7 @@ def is_regular(G):
return in_regular and out_regular
-@nx.dispatch("is_k_regular")
+@nx.dispatch
@not_implemented_for("directed")
def is_k_regular(G, k):
"""Determines whether the graph ``G`` is a k-regular graph.