Dear all, I do not understand the behavior of the following code (this is

not a minimal example, I tried to reproduce the problem on a minimal

example but I could not...). I do not get why, when I purge the vertices

and edges after filtering, the properties of the vertices are not

consistent.

Thanks for your help,

Flavien.

_graph = gt.Graph(_originalGraph)

_bus = _graph.new_vertex_property('bool')

_bus.a = True

_trainVertices = [_v for _v in _graph.vertices() if _name[_v][:3] == 'stn']for _v in _trainVertices :

_bus[_v] = Falseprint 'original graph #', _graph

print 'train number # ', len([_v for _v in _graph.vertices() if

_name[_v][:3] == 'stn']), '\n'_graph.set_vertex_filter(_bus)

print 'filtered graph #', _graph

print 'train number #', len([_v for _v in _graph.vertices() if

_name[_v][:3] == 'stn']), '\n'_graph.purge_vertices()

_graph.purge_edges()

print 'purged graph #', _graph

print 'train number #', len([_v for _v in _graph.vertices() if

_name[_v][:3] == 'stn']), '\n'

original graph # <Graph object, directed, with 2775 vertices and 9341

edges at 0x313be50>

attachment.html (2.44 KB)