Commits

Santiago Payà Miralta  committed ac42bf6

Little bugs.

  • Participants
  • Parent commits af8b96f

Comments (0)

Files changed (2)

 	<projects>
 	</projects>
 	<buildSpec>
+		<buildCommand>
+			<name>org.python.pydev.PyDevBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
+		<nature>org.python.pydev.pythonNature</nature>
 	</natures>
 </projectDescription>

File genet_networkx.py

 sys.path.append('/home/santiago/workspace/geneta')
 ##
 
-import geneta
+import genet
 import pylab as P
 import networkx as NX
 
 #
 G0 = NX.XGraph(name='Geometric', multiedges=True, selfloops=True)
 
-for e in geneta.EL00:
+for e in genet.EL00:
     G0.add_edges_from([(e.idnA.id, e.idnB.id, e.id)])
 
 # May be there are isolated nodes.
-for n in geneta.NL00:
+for n in genet.NL00:
     print n.id
     G0.add_node(n.id)
 
 NX.draw_networkx(G0, pos)
 P.show()
 
-P.savefig("geneta_L0.png")
-print "Wrote geneta_L0.png"
+P.savefig("genet_L0.png")
+print "Wrote genet_L0.png"
 
 ################################################################################
 # Level 1
 #
 G101 = NX.XGraph(name='Infrastructure', multiedges=True, selfloops=True)
 
-for e in geneta.EL01:
+for e in genet.EL01:
     print e.idnA.id, e.idnB.id, e.id
     G101.add_edge(e.idnA.id, e.idnB.id, e.id)
 
 # May be there are isolated nodes.
-for n in geneta.NL01:
+for n in genet.NL01:
     print n.id
     G101.add_node(n.id)
 
 NX.draw_networkx(G101, pos)
 P.show()
 
-P.savefig("geneta_L101.png")
-print "Wrote geneta_L101.png"
+P.savefig("genet_L101.png")
+print "Wrote genet_L101.png"
 
 ################################################################################
 # Fancy draw & DOT
 #
 G102 = NX.XGraph(name='Infrastructure', multiedges=True, selfloops=True)
 
-for e in geneta.EL01:
+for e in genet.EL01:
     print e.idnA.id, e.idnB.id, e.id
     G102.add_edges_from([(e.idnA.id, e.idnB.id, e)])
 
 # May be there are isolated nodes.
-for n in geneta.NL01:
+for n in genet.NL01:
     print n.id
     G102.add_node(n.id)
 
                         font_size=12)
 P.show()
 
-P.savefig("geneta_L102.png")
-print "Wrote geneta_L102.png"
+P.savefig("genet_L102.png")
+print "Wrote genet_L102.png"
 
 """
 With the dot file can do in the system:
 $ neato -Tpng file.dot > file.png
 $ eog file.png
 """
-NX.write_dot(G102,"geneta_L102.dot")
-print "Wrote geneta_L102.dot"
+NX.write_dot(G102,"genet_L102.dot")
+print "Wrote genet_L102.dot"
 
 ################################################################################
 # Paths
 """
 G103 = NX.XGraph(name='Infrastructure', multiedges=False, selfloops=True)
 
-for e in geneta.EL01:
+for e in genet.EL01:
     # When creating the graph with edges (dont worry about isolated nodes)
     # the information passed is the edges' weight. 
     print e.idnA.id, e.idnB.id, e.id