Ticket #12982: trac_12982.reviewer.patch

File trac_12982.reviewer.patch, 5.8 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 1337827744 25200
    # Node ID b13b2b869abd0c77273b4d78d832d2c6507d44a7
    # Parent  2ef269c738f4d46c2ae845c419472f52807ebfe4
    Formatting, fix duplicate doctests
    
    diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
    a b  
    43434343
    43444344        return g
    43454345
    4346     def McGeeGraph(self, embedding = 2):
     4346    def McGeeGraph(self, embedding=2):
    43474347        r"""
    43484348        Returns the McGee Graph.
    43494349
    4350         See the :wikipedia:`Wikipedia page on the McGee Graph <McGee_graph>`.
     4350        See the :wikipedia:`Wikipedia page on the McGee Graph
     4351        <McGee_graph>`.
    43514352
    43524353        INPUT:
    43534354
    4354         - ``embedding`` -- two embeddings are available, and can be selected by
    4355           setting ``embedding`` to 1 or 2.
     4355        - ``embedding`` -- two embeddings are available, and can be
     4356          selected by setting ``embedding`` to 1 or 2.
    43564357
    43574358        EXAMPLES::
    43584359
     
    43664367            sage: g.diameter()
    43674368            4
    43684369            sage: g.show()
    4369             sage: graphs.McGeeGraph(embedding=2).show()
     4370            sage: graphs.McGeeGraph(embedding=1).show()
    43704371
    43714372        TESTS::
    43724373
     
    43814382             -15, -25, 21, 31, -51, -25, 23, 9, -17, 51, 35, -29, 21, -51,
    43824383             -39, 33, -9, -51, 51, -47, -33, 19, 51, -21, 29, 21, -31, -39]
    43834384
    4384         g = graphs.LCFGraph(24, [12,7,-7], 8)
     4385        g = graphs.LCFGraph(24, [12, 7, -7], 8)
    43854386        g.name('McGee graph')
    43864387
    43874388        if embedding == 1:
     
    43934394                 [5, 4, 11, 10, 17, 16, 23, 22],
    43944395                 [3, 12, 9, 18, 15, 0, 21, 6]]
    43954396
    4396             _circle_embedding(g,o[0], radius = 1.5)
    4397             _circle_embedding(g,o[1], radius = 3, shift = -.5)
    4398             _circle_embedding(g,o[2], radius = 2.25, shift = .5)
     4397            _circle_embedding(g, o[0], radius=1.5)
     4398            _circle_embedding(g, o[1], radius=3, shift=-.5)
     4399            _circle_embedding(g, o[2], radius=2.25, shift=.5)
    43994400
    44004401            return g
     4402
    44014403        else:
    44024404            raise ValueError("The value of embedding must be 1 or 2.")
    44034405
    4404 
    44054406    def MoebiusKantorGraph(self):
    44064407        """
    44074408        Returns a Moebius-Kantor Graph.
     
    46064607       
    46074608        return gg
    46084609
    4609     def NauruGraph(self, embedding = 2):
     4610    def NauruGraph(self, embedding=2):
    46104611        """
    46114612        Returns the Nauru Graph.
    46124613
    4613         See the :wikipedia:`Wikipedia page on the Nauru Graph <Nauru_graph>`.
     4614        See the :wikipedia:`Wikipedia page on the Nauru Graph
     4615        <Nauru_graph>`.
    46144616
    46154617        INPUT:
    46164618
     
    46294631            sage: g.diameter()
    46304632            4
    46314633            sage: g.show()
    4632             sage: graphs.NauruGraph(embedding=2).show()
     4634            sage: graphs.NauruGraph(embedding=1).show()
    46334635
    46344636        TESTS::
    46354637
     
    46374639            Traceback (most recent call last):
    46384640            ...
    46394641            ValueError: The value of embedding must be 1 or 2.
    4640             sage: graphs.NauruGraph(embedding=1).is_isomorphic(graphs.NauruGraph())
     4642            sage: graphs.NauruGraph(embedding=1).is_isomorphic(g)
    46414643            True
    46424644        """
    46434645
    46444646        if embedding == 1:
    4645             g = graphs.LCFGraph(24, [5,-9,7,-7,9,-5], 4)
     4647            g = graphs.LCFGraph(24, [5, -9, 7, -7, 9, -5], 4)
    46464648            g.name('Nauru Graph')
    46474649            return g
    46484650        elif embedding == 2:
    4649             g = graphs.GeneralizedPetersenGraph(12,5)
     4651            g = graphs.GeneralizedPetersenGraph(12, 5)
    46504652            g.name("Nauru Graph")
    46514653            return g
    46524654        else:
     
    48194821
    48204822    def Tutte12Cage(self):
    48214823        r"""
    4822         Returns Tutte's 12-Cage
     4824        Returns Tutte's 12-Cage.
    48234825
    48244826        See the :wikipedia:`Wikipedia page on the Tutte 12-Cage
    48254827        <Tutte_12-cage>`.
     
    48684870            sage: g.diameter()
    48694871            4
    48704872            sage: g.show()
    4871             sage: graphs.TutteCoxeterGraph(embedding = 1).show()
     4873            sage: graphs.TutteCoxeterGraph(embedding=1).show()
    48724874
    48734875        TESTS::
    48744876
    4875             sage: graphs.TutteCoxeterGraph(embedding = 3)
     4877            sage: graphs.TutteCoxeterGraph(embedding=3)
    48764878            Traceback (most recent call last):
    48774879            ...
    48784880            ValueError: The value of embedding must be 1 or 2.
    48794881        """
    48804882
    4881         g = graphs.LCFGraph(30, [-13,-9,7,-7,9,13], 5)
     4883        g = graphs.LCFGraph(30, [-13, -9, 7, -7, 9, 13], 5)
    48824884        g.name("Tutte-Coxeter graph")
    48834885
    48844886        if embedding == 1:
     
    48914893                5: [10, 14, 24, 20, 16]
    48924894                }
    48934895
    4894             _circle_embedding(g,d[0], center = (-1,1), radius = .25)
    4895             _circle_embedding(g,d[1], center = (1,1), radius = .25)
    4896             _circle_embedding(g,d[2], center = (-.8,0), radius = .25, shift = 2.5)
    4897             _circle_embedding(g,d[3], center = (1.2,0), radius = .25)
    4898             _circle_embedding(g,d[4], center = (-1,-1), radius = .25, shift = 2)
    4899             _circle_embedding(g,d[5], center = (1,-1), radius = .25)
     4896            _circle_embedding(g, d[0], center=(-1, 1), radius=.25)
     4897            _circle_embedding(g, d[1], center=(1, 1), radius=.25)
     4898            _circle_embedding(g, d[2], center=(-.8, 0), radius=.25, shift=2.5)
     4899            _circle_embedding(g, d[3], center=(1.2, 0), radius=.25)
     4900            _circle_embedding(g, d[4], center=(-1, -1), radius=.25, shift=2)
     4901            _circle_embedding(g, d[5], center=(1, -1), radius=.25)
    49004902
    49014903            return g
    49024904
     
    49064908        else:
    49074909            raise ValueError("The value of embedding must be 1 or 2.")
    49084910
    4909 
    4910 
    4911 
    49124911    def WagnerGraph(self):
    49134912        """
    49144913        Returns the Wagner Graph.
    49154914
    4916         See the :wikipedia:`Wikipedia page on the Wagner Graph <Wagner_graph>`.
     4915        See the :wikipedia:`Wikipedia page on the Wagner Graph
     4916        <Wagner_graph>`.
    49174917
    49184918        EXAMPLES::
    49194919