diff options
author | Jim Kitchen <jim22k@gmail.com> | 2022-10-11 15:24:14 -0500 |
---|---|---|
committer | Mridul Seth <git@mriduls.com> | 2022-10-12 12:05:14 +0400 |
commit | c2111a36841d5e43b6beae1fd667996d35646e30 (patch) | |
tree | 38fa5e1316ca45a9906169ceb7ac21bfc52a612e /networkx/algorithms/isolate.py | |
parent | 71434d674cf8ec6c3007dd41b78ee6f407e9b4eb (diff) | |
download | networkx-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/isolate.py')
-rw-r--r-- | networkx/algorithms/isolate.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/networkx/algorithms/isolate.py b/networkx/algorithms/isolate.py index d59a46c4..0a077177 100644 --- a/networkx/algorithms/isolate.py +++ b/networkx/algorithms/isolate.py @@ -6,7 +6,7 @@ import networkx as nx __all__ = ["is_isolate", "isolates", "number_of_isolates"] -@nx.dispatch("is_isolate") +@nx.dispatch def is_isolate(G, n): """Determines whether a node is an isolate. @@ -39,7 +39,7 @@ def is_isolate(G, n): return G.degree(n) == 0 -@nx.dispatch("isolates") +@nx.dispatch def isolates(G): """Iterator over isolates in the graph. @@ -85,7 +85,7 @@ def isolates(G): return (n for n, d in G.degree() if d == 0) -@nx.dispatch("number_of_isolates") +@nx.dispatch def number_of_isolates(G): """Returns the number of isolates in the graph. |