Something like this may work for you:# Setup your boolean property map, which should give you an empty array of zerosv_mask = g.new_vertex_property('bool')# Assign values to the mask property map array from another property map array# In this case where a certain property map is <= to a value# Note use of the .a to directly access the arrays -> shortcut for get_array() methodv_mask.a = v_propMap.a <= val# Then activate your filterg.set_vertex_filter(v_mask)# Remember to de-activate prior to running other operations on the whole graphg.set_vertex_filter(None)# Remember to clear or recreate your mask prior to new assignments# This is what I use -> requires 'import numpy'v_mask.a = numpy.zeros_like(v_mask.a)There may be other methods that work better, but this has so far worked nicely for me.GarethOn 7 Jul 2014, at 08:45, Giuseppe Profiti <gamma2@users.sourceforge.net> wrote:With filters, you can either directly select a boolean property or apply a function. For example, if you have a property representing the temperature of nodes, you can select all nodes above a specific value and so on.Giuseppe_______________________________________________2014-07-07 9:32 GMT+02:00 Flavien Lambert <petit.lepton@gmail.com>:
Thanks a lot! To be sure to understand, in the XML file, a property must be defined as a boolean on the nodes and set as either 0 or 1, right?
On 7 July 2014 15:18, Giuseppe Profiti <gamma2@users.sourceforge.net> wrote:Hi Flavien,you may use filters as explained hereBest,Giuseppe2014-07-07 8:06 GMT+02:00 Flavien Lambert <petit.lepton@gmail.com>:
_______________________________________________F.Thanks,Hi all,I was wondering if there is a clever way to extract the list of vertices with a given value of a property or if you have to run a loop on the vertices on build the list by hand (I searched on the documentation but did not find it...).
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
_______________________________________________
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
_______________________________________________
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool
_______________________________________________
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool