• Tiago Peixoto's avatar
    Further improvements of the python interface · 1a0e9b5f
    Tiago Peixoto authored
    Property maps can now be obtained as such:
    
             weight = g.edge_properties['weight']
             print weight[v] # v is a Vertex object
             weight[v] = 2.0
             # and so on...
    
    The list of properties is obtained from g.vertex_properties,
    g.edge_properties and g.graph_properties, which can be read as
    dictionaries. The last can be set also, as such:
    
             g.graph_properties = {foo:"bar", baz:42}
    
    Functions to add and remove vertices or adges were also added
    (add_{vertex|edge}, remove_{vertex|edgge}).
    
    Vertex and Edge types can also now be printed for convenience, as such:
    
           for v in g.vertices():
               print v
           for e in g.edges():
               print e
    
    which results, for example, in:
    0
    1
    2
    3
    4
    5
    6
    (0,1)
    (1,2)
    (2,6)
    (3,4)
    (4,5)
    (4,2)
    (5,6)
    (6,1)
    
    (this also adds the forgotten graph_tool.py file, which was previously
    on .gitignore)
    1a0e9b5f
graph_filtering.hh 13.7 KB