Commit 1eb7786d authored by Tiago Peixoto's avatar Tiago Peixoto

Correct documentation for purge_vertices()/edges()

parent 097bb6f5
......@@ -151,10 +151,9 @@
.. warning::
The purge functions below irreversibly remove the filtered
vertices or edges from the graph, and return it to an
unfiltered state. Note that, contrary to the functions above,
these are :math:`O(V)` and :math:`O(E)` operations,
respectively.
vertices or edges from the graph. Note that, contrary to the
functions above, these are :math:`O(V)` and :math:`O(E)`
operations, respectively.
.. automethod:: purge_vertices
.. automethod:: purge_edges
......
......@@ -2198,9 +2198,8 @@ class Graph(object):
self.__filter_state["edge_filter"] = (None, False)
def purge_vertices(self, in_place=False):
"""Remove all vertices of the graph which are currently being filtered
out, and return it to the unfiltered state. This operation is not
reversible.
"""Remove all vertices of the graph which are currently being filtered out. This
operation is not reversible.
If the option ``in_place == True`` is given, the algorithm will remove
the filtered vertices and re-index all property maps which are tied with
......@@ -2213,6 +2212,12 @@ class Graph(object):
with an :math:`O(N + E)` complexity. This is the default behaviour if no
option is given.
.. note :
The graph will remain in a filtered state after this operation, since
there might be edge filters present. To return the graph to an
unfiltered state, use :meth:`~graph_tool.Graph.clear_filters`.
"""
if in_place:
old_indexes = self.vertex_index.copy("int64_t")
......@@ -2250,8 +2255,16 @@ class Graph(object):
self.set_edge_filter(efilt[0], efilt[1])
def purge_edges(self):
"""Remove all edges of the graph which are currently being filtered out,
and return it to the unfiltered state. This operation is not reversible."""
"""Remove all edges of the graph which are currently being filtered out. This
operation is not reversible.
.. note :
The graph will remain in a filtered state after this operation, since
there might be vertex filters present. To return the graph to an
unfiltered state, use :meth:`~graph_tool.Graph.clear_filters`.
"""
self.__graph.PurgeEdges()
self.set_edge_filter(None)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment