1. 14 Dec, 2007 1 commit
    • Tiago Peixoto's avatar
      Add support for running arbitrary C++ code from python · 866bb994
      Tiago Peixoto authored
      It is now possible to run arbitrary "inline" C++ code from python, using
      scipy.weave, as such:
      
              g = graph_tool.Graph()
              g.load("foo.xml")
              value = 2.0
              g.run_action('cout << num_vertices(g) << " " << value << endl;',
                           ["value"]);
      
      The code gets compiled the first time, and is reused after that. Python
      local and global variables can be passed to C++, as shown above, by
      specifying a list of passed variables as the second argument.
      866bb994
  2. 13 Dec, 2007 1 commit
  3. 06 Dec, 2007 2 commits
    • Tiago Peixoto's avatar
      Fix edit_{vertex|edge|graph}_property() · db440664
      Tiago Peixoto authored
      The graph object passed to the edit function is now a instance of the
      Graph class which wraps GraphInterface, not a GraphInterface instance.
      db440664
    • Tiago Peixoto's avatar
      Implement lazy loading of graphs · de0a0a8e
      Tiago Peixoto authored
      Graphs can now be loaded "lazily" with the lazy_load() function, which
      works just like load(), but doesn't actually load the graph, which is
      delayed until the graph is accessed for the first time, e.g.
      
          import graph_tool
      
          g = graph_tool.Graph()
          g.lazy_load("example.xml")
      
          g.number_of_vertices()  # <- the graph is only loaded here
      de0a0a8e
  4. 03 Dec, 2007 6 commits
  5. 30 Nov, 2007 2 commits
    • Tiago Peixoto's avatar
      Merge branch 'rewiring' · d0cf197c
      Tiago Peixoto authored
      Improve formatting of src/graph/graph_rewiring.cc (line breaks at column
      80, typedefs, trailing whitespace removal, etc)
      
      Conflicts:
      
      	src/graph-tool
      	src/graph/graph_bind.cc
      d0cf197c
    • 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
  6. 28 Nov, 2007 1 commit
  7. 26 Nov, 2007 3 commits
  8. 20 Nov, 2007 1 commit
    • Tiago Peixoto's avatar
      Complete re-factoring of python module and command line tool · 8b32d7fc
      Tiago Peixoto authored
      The program was split in two parts:
      
          1. A python module, graph_tool.py, which encapsulates the graph
             manipulation under a Graph class. Now the following can be done:
      
                    import graph_tool
                    g1 = graph_tool.Graph()
                    g2 = graph_tool.Graph()
                    g1.load("foo.xml")
                    g2.load("bar.xml")
                    print g1.number_of_vertices(), g2.number_of_vertices()
      
          2. A standalone command line tool, graph-tool, which imports
             graph_tool.py, and exposes the Graph methods as command line
             options.
      
      The whole command line engine was thus (once again) entirely
      rewritten. It is now Crack-Free™, and simply mirrors the methods of the
      Graph class as command line options, using, for this, the beauty of
      function decorators. It classifies now, I believe, as Pythonic™.
      8b32d7fc
  9. 11 Nov, 2007 1 commit
  10. 10 Nov, 2007 2 commits
  11. 05 Nov, 2007 1 commit
    • Ale Abdo's avatar
      Correlated random rewiring functional · 0b15235f
      Ale Abdo authored
      Several changes in the random rewiring code, making it fully
      functional for the correlated case.
      The reshuffling operations lag in efficiency, even though already
      the algorithm runs in little time.
      0b15235f
  12. 04 Nov, 2007 4 commits
  13. 27 Oct, 2007 1 commit
  14. 24 Oct, 2007 7 commits
  15. 23 Oct, 2007 4 commits
  16. 15 Oct, 2007 1 commit
  17. 12 Oct, 2007 2 commits
    • Ale Abdo's avatar
      Implements extended_clustering for directed graphs, based on the fraction of... · 622cc24e
      Ale Abdo authored
      Implements extended_clustering for directed graphs, based on the fraction of possible directed cycles (out-in edges combination).
      The old behavior is still present since it was equivalent to treating the directed graph as undirected (use --undirected option).
      622cc24e
    • Tiago Peixoto's avatar
      Added --purge-edges and --purge-vertices option · 23e319bf
      Tiago Peixoto authored
          
      Filtered vertices and edges can be permanently removed from the graph
      with --purge-vertices and --purge-edges, respectively. The edge or
      vertex filter is automatically removed, afterwards. This is useful if
      maximum speed is necessary, and saving and reloading the graph without
      filtering is not desired.
          
      (this commit also removes some trailing whitespaces)
      23e319bf