Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
1eb7786d
Commit
1eb7786d
authored
Apr 30, 2015
by
Tiago Peixoto
Browse files
Correct documentation for purge_vertices()/edges()
parent
097bb6f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
doc/graph_tool.rst
doc/graph_tool.rst
+3
-4
src/graph_tool/__init__.py
src/graph_tool/__init__.py
+18
-5
No files found.
doc/graph_tool.rst
View file @
1eb7786d
...
...
@@ -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
...
...
src/graph_tool/__init__.py
View file @
1eb7786d
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment