Ticket #9223: trac_9223-reviewer.patch

File trac_9223-reviewer.patch, 5.7 KB (added by John Cremona, 12 years ago)

Apply after previous patch

  • sage/databases/cremona.py

    # HG changeset patch
    # User John Cremona <john.cremona@gmail.com>
    # Date 1276362453 -3600
    # Node ID b93c00a1f60cb8542aba997c59755ba1e0ae3df1
    # Parent  34e0e3323800c307b213eaaa07c83f3873274fec
    #9223 reviewer patch
    
    diff -r 34e0e3323800 -r b93c00a1f60c sage/databases/cremona.py
    a b  
    55easy-to-use format. The unique instance of the class
    66CremonaDatabase() gives access to the database.
    77
    8 If the full CremonaDatabase isn't installed, a mini-version is
    9 included by default with Sage.  It contains Weierstrass
    10 equations, rank, and torsion for curves up to conductor 10000.
     8If the optional full CremonaDatabase is not installed, a mini-version
     9is included by default with Sage.  It contains Weierstrass equations,
     10rank, and torsion for curves up to conductor 10000.
    1111
    12 The large database includes all curves of conductor up to 130,000
    13 (!). It also includes data related to the BSD conjecture and
    14 modular degrees for all of these curves, and generators for the
    15 Mordell-Weil groups. To install it type the following in Sage:
     12The large database includes all curves of conductor up to 130,000. It
     13also includes data related to the BSD conjecture and modular degrees
     14for all of these curves, and generators for the Mordell-Weil
     15groups. To install it type the following in Sage:
     16
    1617!sage -i database_cremona_ellcurve
     18
     19This causes the latest version of the database to be downloaded from
     20the internet.  You can also install it from a local copy of the
     21database spkg file, using a command of the form
     22
     23!sage -i database_cremona_ellcurve-20071019.spkg
     24
    1725"""
    1826
    1927#*****************************************************************************
     
    3846import sage.schemes.elliptic_curves.constructor as elliptic
    3947import sage.databases.db   # very important that this be fully qualified
    4048from sage.misc.package import optional_packages
     49from sage.misc.all import xsrange
    4150import sage.misc.misc
    4251
    4352import re
     
    151160    Returns the *old* Cremona letter code corresponding to an integer.
    152161    integer.
    153162
    154     For example,
     163    For example::
    155164   
    156     ::
    157165        1  --> A
     166
    158167        26 --> Z
     168
    159169        27 --> AA
     170
    160171        52 --> ZZ
     172
    161173        53 --> AAA
     174
    162175        etc.
    163176
    164177    INPUT:
     
    367380        TESTS::
    368381
    369382            sage: it = CremonaDatabase().__iter__()
    370             sage: it.next()
    371             Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
    372             sage: it.next()
    373             Elliptic Curve defined by y^2 + y = x^3 - x^2 - 7820*x - 263580 over Rational Field
     383            sage: it.next().label()
     384            '11a1'
     385            sage: it.next().label()
     386            '11a2'
     387            sage: it.next().label()
     388            '11a3'
     389            sage: it.next().label()
     390            '14a1'
     391            sage: skip = [it.next() for _ in range(100)]
     392            sage: it.next().label()
     393            '45a3'
    374394        """
    375         return self.iter([11, self.largest_conductor()+1])
     395        return self.iter(xsrange(11,self.largest_conductor()+1))
    376396   
    377397    def __getitem__(self, N):
    378398        """
     
    665685
    666686    def iter(self, conductors):
    667687        """
    668         Returns an iterator through all curves with conductor between Nmin
    669         and Nmax-1, inclusive, in the database.
     688        Return an iterator through all curves in the database with given conductors.
    670689       
    671690        INPUT:
    672691       
     
    750769               
    751770    def iter_optimal(self, conductors):
    752771        """
    753         Returns an iterator through all optimal curves with conductor
    754         between Nmin and Nmax-1 in the database.
     772        Return an iterator through all optimal curves in the database with given conductors.
    755773       
    756774        INPUT:
    757775
     
    785803
    786804    def list(self, conductors):
    787805        """
    788         Returns a list of all curves with conductor between Nmin and
    789         Nmax-1, inclusive, in the database.
     806        Returns a list of all curves with given conductors.
    790807       
    791808        INPUT:
    792809       
     
    809826       
    810827    def list_optimal(self, conductors):
    811828        """
    812         Returns a list of all optimal curves with conductor between
    813         Nmin and Nmax-1, inclusive, in the database.
     829        Returns a list of all optimal curves with given conductors.
    814830       
    815831        INPUT:
    816832               
     
    864880
    865881    def smallest_conductor(self):
    866882        """
    867         The smallest conductor for which the database is complete. (Always
    868         1.)
     883        The smallest conductor for which the database is complete: always 1.
    869884       
    870885        OUTPUT:
    871886       
    872887        -  ``int`` - smallest conductor
     888
     889        .. note::
     890
     891           This always returns the integer 1, since that is the
     892           smallest conductor for which the database is complete,
     893           although there are no elliptic curves of conductor 1.  The
     894           smallest conductor of a curve in the database is 11.
    873895       
    874896        EXAMPLES::
    875897       
     
    882904        """
    883905        Return the range of conductors that are covered by the database.
    884906       
    885         OUTPUT:
    886        
    887         -  ``int`` - smallest cond
    888        
    889         -  ``int`` - largest conductor plus one
     907        OUTPUT: tuple of ints (N1,N2+1) where N1 is the smallest and
     908        N2 the largest conductor for which the database is complete.
    890909       
    891910        EXAMPLES::
    892911       
     
    12101229    Weierstrass equations, rank and torsion of elliptic curves of
    12111230    conductor up to 10000 and nothing else.
    12121231
    1213     TESTS::
     1232    TESTS:
    12141233
    12151234    Many of the following only work if the large Cremona database is
    12161235    installed.  Given only the mini version, we expect them to fail