# HG changeset patch
# User Keshav Kini <keshav.kini@gmail.com>
# Date 1338482449 25200
# Node ID a517232cedb5462cee96fdcb4c2bfadf6e473613
# Parent abeb132b3e5e29e221d14602b5cd39fe083eb9ee
Check for pos=None in _*_embedding; use list comprehension
diff git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
a

b


1614  1614  "HB`CQCp[WFQGgIQgkJQ{rLbc{Nc@APsdLRt@PSt\\WUtt_Wn") 
1615  1615  
1616  1616  if from_string: 
1617   g = graph.Graph(string, pos={}, loops=False, multiedges=False) 
 1617  g = graph.Graph(string) 
1618  1618  else: 
1619  1619  
1620  1620  # The following construction is due to version 3 of the ATLAS of 
… 
… 

1641  1641  gap.eval("G := Group([g1,g2]);") 
1642  1642  edges = gap('Orbit(G,[1,5],OnSets)') 
1643  1643  
1644   edge_list = [] 
1645   for u, v in edges: 
1646   edge_list.append((int(u),int(v))) 
1647   
1648   g = graph.Graph(edge_list, pos={}) 
 1644  g = graph([(int(u), int(v)) for u, v in edges]) 
1649  1645  g.relabel() 
1650  1646  
1651  1647  _circle_embedding(g, range(100)) 
… 
… 

8945  8941  c_x, c_y = center 
8946  8942  n = len(vertices) 
8947  8943  d = g.get_pos() 
 8944  if d is None: 
 8945  d = {} 
8948  8946  
8949  8947  for i,v in enumerate(vertices): 
8950  8948  i += shift 
… 
… 

8977  8975  dy = (last[1]  first[1])/n 
8978  8976  
8979  8977  d = g.get_pos() 
 8978  if d is None: 
 8979  d = {} 
 8980  
8980  8981  for v in vertices: 
8981  8982  d[v] = (fx, fy) 
8982  8983  fx += dx 