Changeset 10495:d72cef4f468b in orange for Orange/OrangeWidgets/OWNxHist.py
 Timestamp:
 03/12/12 15:16:12 (2 years ago)
 Branch:
 default
 rebase_source:
 96b9129e9d7e511c7d6241e7d6b4f17e0b81997c
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Orange/OrangeWidgets/OWNxHist.py
r10046 r10495 256 256 self.graph_matrix = matrix 257 257 258 self.pconnected = self.graph.number_of_nodes() 259 self.nedges = self.graph.number_of_edges() 258 if self.graph is None: 259 self.pconnected = 0 260 self.nedges = 0 261 else: 262 self.pconnected = self.graph.number_of_nodes() 263 self.nedges = self.graph.number_of_edges() 260 264 if hasattr(self, "infoa"): 261 265 self.infoa.setText("Matrix size: %d" % self.matrix.dim) 262 266 if hasattr(self, "infob"): 263 self.infob.setText("Graph nodes: %d (%3.1f%%)" % (self.pconnected, self.pconnected / float(self.matrix.dim) * 100)) 267 self.infob.setText("Graph nodes: %d (%3.1f%%)" % (self.pconnected, 268 self.pconnected / float(self.matrix.dim) * 100)) 264 269 if hasattr(self, "infoc"): 265 self.infoc.setText("Graph edges: %d (%.2f edges/node)" % (self.nedges, self.nedges / float(self.pconnected))) 270 self.infoc.setText("Graph edges: %d (%.2f edges/node)" % ( 271 self.nedges, self.nedges / float(self.pconnected) 272 if self.pconnected else 0)) 266 273 267 274 #print 'self.graph:',self.graph+
Note: See TracChangeset
for help on using the changeset viewer.