Ticket #13058: trac_13058-no-pos.patch

File trac_13058-no-pos.patch, 1.5 KB (added by kini, 7 years ago)

apply to $SAGE_ROOT/devel/sage

  • sage/graphs/graph_generators.py

    # 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  
    16141614                  "HB`CQCp[WFQGgIQgkJQ{rLbc{Nc@APsdLRt@PSt\\WUtt_Wn")
    16151615
    16161616        if from_string:
    1617             g = graph.Graph(string, pos={}, loops=False, multiedges=False)
     1617            g = graph.Graph(string)
    16181618        else:
    16191619
    16201620            # The following construction is due to version 3 of the ATLAS of
     
    16411641            gap.eval("G := Group([g1,g2]);")
    16421642            edges = gap('Orbit(G,[1,5],OnSets)')
    16431643
    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])
    16491645            g.relabel()
    16501646
    16511647        _circle_embedding(g, range(100))
     
    89458941    c_x, c_y = center
    89468942    n = len(vertices)
    89478943    d = g.get_pos()
     8944    if d is None:
     8945        d = {}
    89488946
    89498947    for i,v in enumerate(vertices):
    89508948        i += shift
     
    89778975    dy = (last[1] - first[1])/n
    89788976
    89798977    d = g.get_pos()
     8978    if d is None:
     8979        d = {}
     8980
    89808981    for v in vertices:
    89818982        d[v] = (fx, fy)
    89828983        fx += dx