summaryrefslogtreecommitdiff
path: root/networkx/classes/function.py
diff options
context:
space:
mode:
authorMridul Seth <seth.mridul@gmail.com>2022-06-21 18:08:58 +0400
committerGitHub <noreply@github.com>2022-06-21 17:08:58 +0300
commitbc29f29698b4683286954dddaea64cd108d60f93 (patch)
treea4e68e41d1949b250eb22fff8c15f3fc82ac1779 /networkx/classes/function.py
parent3135c6691073dff15f35316c39a30afd3f0e3cca (diff)
downloadnetworkx-bc29f29698b4683286954dddaea64cd108d60f93.tar.gz
Remove deprecated function nx.info (#5759)
* Remove deprecated function nx.info * remove functions from TOC * replace print(nx.info(G)) with print(G) in example Co-authored-by: Dan Schult <dschult@colgate.edu> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Diffstat (limited to 'networkx/classes/function.py')
-rw-r--r--networkx/classes/function.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/networkx/classes/function.py b/networkx/classes/function.py
index 7707ec4c..27e5bc6f 100644
--- a/networkx/classes/function.py
+++ b/networkx/classes/function.py
@@ -18,7 +18,6 @@ __all__ = [
"number_of_edges",
"density",
"is_directed",
- "info",
"freeze",
"is_frozen",
"subgraph",
@@ -552,51 +551,6 @@ def create_empty_copy(G, with_data=True):
return H
-def info(G, n=None):
- """Return a summary of information for the graph G or a single node n.
-
- The summary includes the number of nodes and edges, or neighbours for a single
- node.
-
- Parameters
- ----------
- G : Networkx graph
- A graph
- n : node (any hashable)
- A node in the graph G
-
- Returns
- -------
- info : str
- A string containing the short summary
-
- Raises
- ------
- NetworkXError
- If n is not in the graph G
-
- .. deprecated:: 2.7
- ``info`` is deprecated and will be removed in NetworkX 3.0.
- """
- import warnings
-
- warnings.warn(
- ("info is deprecated and will be removed in version 3.0.\n"),
- DeprecationWarning,
- stacklevel=2,
- )
- if n is None:
- return str(G)
- if n not in G:
- raise nx.NetworkXError(f"node {n} not in graph")
- info = "" # append this all to a string
- info += f"Node {n} has the following properties:\n"
- info += f"Degree: {G.degree(n)}\n"
- info += "Neighbors: "
- info += " ".join(str(nbr) for nbr in G.neighbors(n))
- return info
-
-
def set_node_attributes(G, values, name=None):
"""Sets node attributes from a given value or dictionary of values.