Changeset 7771:ec73cd1b51a4 in orange


Ignore:
Timestamp:
03/22/11 17:32:08 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
cec8f1027aa94c7dd7196ec97517bb4ac959054e
Message:

Call new underscore case functions.

Location:
orange/doc/Orange/rst/code
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orange/doc/Orange/rst/code/network-constructor.py

    r7768 r7771  
    1212 
    1313# read all edges and plot a line 
    14 for u, v in net.getEdges(): 
     14for u, v in net.get_edges(): 
    1515    x1, y1 = net.coors[0][u], net.coors[1][u] 
    1616    x2, y2 = net.coors[0][v], net.coors[1][v] 
  • orange/doc/Orange/rst/code/network-graph-analysis.py

    r7768 r7771  
    99net = Orange.network.Network.read("combination.net") 
    1010 
    11 components = net.getConnectedComponents() 
     11components = net.get_connected_components() 
    1212print "Connected components" 
    1313print components 
    1414print 
    1515 
    16 distribution = net.getDegreeDistribution() 
     16distribution = net.get_degree_distribution() 
    1717print "Degree distribution" 
    1818print distribution 
    1919print 
    2020 
    21 degrees = net.getDegrees() 
     21degrees = net.get_degrees() 
    2222print "Degrees" 
    2323print degrees 
    2424print 
    2525 
    26 hubs = net.getHubs(3) 
     26hubs = net.get_hubs(3) 
    2727print "Hubs" 
    2828print hubs 
    2929print 
    3030 
    31 path = net.getShortestPaths(0, 2) 
     31path = net.get_shortest_paths(0, 2) 
    3232print "Shortest path" 
    3333print path 
    3434print 
    3535 
    36 distance = net.getDistance(0, 2) 
     36distance = net.get_distance(0, 2) 
    3737print "Distance" 
    3838print distance 
    3939print 
    4040 
    41 diameter = net.getDiameter() 
     41diameter = net.get_diameter() 
    4242print "Diameter" 
    4343print diameter 
    4444print 
    4545 
    46 subnet = Orange.network.Network(net.getSubGraph([0, 1, 2, 3])) 
     46subnet = Orange.network.Network(net.get_sub_graph([0, 1, 2, 3])) 
    4747subNetOptimization = Orange.network.NetworkOptimization(subnet) 
    48 subNetOptimization.fruchtermanReingold(100, 1000) 
     48subNetOptimization.fruchterman_reingold(100, 1000) 
    4949 
    5050# read all edges in subnetwork and plot a line 
  • orange/doc/Orange/rst/code/network-graph-obj.py

    r7448 r7771  
    1414#graph["Age", "Height"] = orange 
    1515graph["Gender", "Height"] = [1, 2, 3] 
    16 print graph.getEdges() 
     16print graph.get_edges() 
    1717 
    1818print graph[1, 2] 
     
    3232    print 'graph["Gender", "Height"] failed' 
    3333 
    34 print graph.getNeighbours("Age") 
     34print graph.get_neighbours("Age") 
    3535graph.returnIndices = 1 
    36 print graph.getNeighbours("Age") 
     36print graph.get_neighbours("Age") 
    3737 
    3838 
     
    4343print graph[4, 1] 
    4444 
    45 print graph.edgeExists(4, 1) 
    46 print graph.edgeExists(4, 2) 
    47 print graph.edgeExists(4, 1, 1) 
    48 print graph.edgeExists(4, 1, 2) 
     45print graph.edge_exists(4, 1) 
     46print graph.edge_exists(4, 2) 
     47print graph.edge_exists(4, 1, 1) 
     48print graph.edge_exists(4, 1, 2) 
    4949 
    5050e = graph[4, 1] 
     
    5353e[1] = None 
    5454e[2] = 3 
    55 print graph.edgeExists(4, 1, 1) 
    56 print graph.edgeExists(4, 1, 2) 
     55print graph.edge_exists(4, 1, 1) 
     56print graph.edge_exists(4, 1, 2) 
    5757print e 
    5858graph[4, 1]=None 
  • orange/doc/Orange/rst/code/network-optimization.py

    r7768 r7771  
    1515 
    1616# optimize verices layout with one of included algorithms 
    17 networkOptimization.fruchtermanReingold(100, 1000) 
     17networkOptimization.radial_fruchterman_reingold(100, 1000) 
    1818 
    1919# read all edges and plot a line 
    20 for u, v in net.getEdges(): 
     20for u, v in net.get_edges(): 
    2121    x1, y1 = net.coors[0][u], net.coors[1][u] 
    2222    x2, y2 = net.coors[0][v], net.coors[1][v] 
  • orange/doc/Orange/rst/code/network-read.py

    r7768 r7771  
    77 
    88# read all edges and plot a line 
    9 for u, v in net.getEdges(): 
     9for u, v in net.get_edges(): 
    1010    x1, y1 = net.coors[0][u], net.coors[1][u] 
    1111    x2, y2 = net.coors[0][v], net.coors[1][v] 
Note: See TracChangeset for help on using the changeset viewer.