summaryrefslogtreecommitdiff
path: root/networkx/algorithms/traversal
diff options
context:
space:
mode:
authorDan Schult <dschult@colgate.edu>2017-06-13 20:46:33 -0400
committerGitHub <noreply@github.com>2017-06-13 20:46:33 -0400
commit2e29c4e6bffad2d58d8260240b2ced15b57aa6c9 (patch)
treed8624b875239815b6fa0fe3f9e135d5ab5043b42 /networkx/algorithms/traversal
parentac4a90421ca7a2e20fea7906e5870594e84e7eea (diff)
downloadnetworkx-2e29c4e6bffad2d58d8260240b2ced15b57aa6c9.tar.gz
Add graph view classes for nodes/edge/degrees (#2458)
* Dont assume iterators for nodes/edges/degrees (prep for views) * Add graph view classes for nodes/edges/degree * Add right set operations (not present in python3.3 KeysView * Add nodes before adding edges so python36 tests work By only adding edges, the nodes were added in order (0,1,3,2) and with the ordered nature of python3.6 dicts the tests failed. Could also fix by using nodelist on each call to to_convert_... * weighted graph convert tests testing empty graphs The edge iterator was exhausted for source before being used for dest * allow DegreeView to include case of nbunch * Make node/edge/degree properties of Graph * View contains fix and Viewers can return self. More tests * Add more tests including one for #2347 * Add nbunch tests and pep8 * Rename to EdgeView and EdgeDataView * docs tweaks and pep8 * fix up nodeDataView contains. Add and clean up tests. * Tweaks to improve speed for nodes and edges. * improve views dependence on ABCs, remove len from dataviews * First pass on docs in views.py * Change property to lazy attribute
Diffstat (limited to 'networkx/algorithms/traversal')
-rw-r--r--networkx/algorithms/traversal/edgedfs.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/networkx/algorithms/traversal/edgedfs.py b/networkx/algorithms/traversal/edgedfs.py
index 2099e02d..f86ea41c 100644
--- a/networkx/algorithms/traversal/edgedfs.py
+++ b/networkx/algorithms/traversal/edgedfs.py
@@ -167,7 +167,7 @@ def edge_dfs(G, source=None, orientation='original'):
while stack:
current_node = stack[-1]
if current_node not in visited_nodes:
- edges[current_node] = out_edges(current_node, **kwds)
+ edges[current_node] = iter(out_edges(current_node, **kwds))
visited_nodes.add(current_node)
try: