_p = _g.new_edge_property('int')
for _e in _g.edges() : _p[_e] = 0
_g.set_edge_filter(_p)
print _g
[Flavien(a)localhost Downloads]$ python bug.py
<Graph object, directed, with 2 vertices and 1 edge at 0x256b990>
Traceback (most recent call last):
File "bug.py", line 11, in <module>
print _g
File "/usr/lib/python2.7/site-packages/graph_tool/__init__.py", line
1272, in __repr__
n = self.num_vertices()
File "/usr/lib/python2.7/site-packages/graph_tool/__init__.py", line
2048, in num_vertices
return self.__graph.GetNumberOfVertices()
RuntimeError: Vertex filter is active but edge filter is not. This is a bug.
Well done! I do not have the bug with a bool property instead of int :
[Flavien(a)localhost tmp]$ python bug.py
<Graph object, directed, with 2 vertices and 1 edge at 0x191d910>
<Graph object, directed, with 2 vertices and 0 edges, edges filtered by
(<PropertyMap object with key type 'Edge' and value type 'bool', for Graph
0x191d910, at 0x191d710>, False), vertices filtered by (<PropertyMap object
with key type 'Vertex' and value type 'bool', for Graph 0x191d910, at
0x191d8d0>, False) at 0x191d910>