put code into functions

This commit is contained in:
Vighnesh Birodkar
2015-01-27 21:33:22 +05:30
parent b11ae90fd0
commit 3466a68a6f
2 changed files with 18 additions and 11 deletions
+7 -2
View File
@@ -164,8 +164,13 @@ class RAG(nx.Graph):
"""
return self.max_id + 1
def _add_node(self, u):
super(RAG, self).add_node(u)
def _add_node_silent(self, n):
"""Add node `n` without updating the maximum node id.
This is a convenience method used internally.
.. seealso:: :func:`networkx.Graph.add_node`."""
super(RAG, self).add_node(n)
def _add_edge_filter(values, graph):