summaryrefslogtreecommitdiff
path: root/networkx/algorithms/components/connected.py
diff options
context:
space:
mode:
authorDan Schult <dschult@colgate.edu>2019-10-09 21:51:15 -0400
committerJarrod Millman <jarrod.millman@gmail.com>2019-10-12 09:26:31 -0700
commit6b1ce03f485076d39994e8d624bbf6ca82466eb9 (patch)
tree1adf49f272ca1bdd7af2fea90343eddb3c70fb92 /networkx/algorithms/components/connected.py
parent9febd6b09b4618129b68a70cecda98d5d8226503 (diff)
downloadnetworkx-6b1ce03f485076d39994e8d624bbf6ca82466eb9.tar.gz
Remove deprecated functions and methods. add to release notes.
Diffstat (limited to 'networkx/algorithms/components/connected.py')
-rw-r--r--networkx/algorithms/components/connected.py20
1 files changed, 3 insertions, 17 deletions
diff --git a/networkx/algorithms/components/connected.py b/networkx/algorithms/components/connected.py
index 1728ccb9..16b6d693 100644
--- a/networkx/algorithms/components/connected.py
+++ b/networkx/algorithms/components/connected.py
@@ -18,7 +18,6 @@ from ...utils import arbitrary_element
__all__ = [
'number_connected_components',
'connected_components',
- 'connected_component_subgraphs',
'is_connected',
'node_connected_component',
]
@@ -57,6 +56,9 @@ def connected_components(G):
>>> largest_cc = max(nx.connected_components(G), key=len)
+ To create the induced subgraph of each component use:
+ >>> S = [G.subgraph(c).copy() for c in connected_components(G)]
+
See Also
--------
strongly_connected_components
@@ -75,22 +77,6 @@ def connected_components(G):
seen.update(c)
-@not_implemented_for('directed')
-def connected_component_subgraphs(G, copy=True):
- """DEPRECATED: Use ``(G.subgraph(c) for c in connected_components(G))``
-
- Or ``(G.subgraph(c).copy() for c in connected_components(G))``
- """
- msg = "connected_component_subgraphs is deprecated and will be removed" \
- "in 2.2. Use (G.subgraph(c).copy() for c in connected_components(G))"
- _warnings.warn(msg, DeprecationWarning)
- for c in connected_components(G):
- if copy:
- yield G.subgraph(c).copy()
- else:
- yield G.subgraph(c)
-
-
def number_connected_components(G):
"""Returns the number of connected components.