#12341: Empty (full) cremona database in Sage 4.8 causes tests to fail
-----------------------------------+----------------------------------------
       Reporter:  swenson          |         Owner:  cremona     
           Type:  defect           |        Status:  needs_review
       Priority:  critical         |     Milestone:  sage-5.4    
      Component:  elliptic curves  |    Resolution:              
       Keywords:                   |   Work issues:              
Report Upstream:  N/A              |     Reviewers:  John Cremona
        Authors:  R. Andrew Ohana  |     Merged in:              
   Dependencies:                   |      Stopgaps:              
-----------------------------------+----------------------------------------

Old description:

> I am on Ubuntu 11.10, and noticed that a fresh install of Sage 4.8 fails
> a bunch of tests because the full cremona database is an empty file by
> default.
>
> {{{
> [swenson@harry 10:18:14] sage-4.8 :) $ ./sage -t /home/swenson/sage-
> src/sage-4.8/devel/sage-main/sage/misc/functional.py
> (hg)-[default]-
> sage -t  "devel/sage-main/sage/misc/functional.py"
> #0: simplify_sum(expr='sum(q^k,k,0,inf))
> #1: simplify_sum(expr=a*'sum(q^k,k,0,inf))
> **********************************************************************
> File "/home/swenson/sage-src/sage-4.8/devel/sage-
> main/sage/misc/functional.py", line 1360:
>     sage: regulator(EllipticCurve('11a'))
> Exception raised:
>     Traceback (most recent call last):
>       File "/home/swenson/sage-src/sage-4.8/local/bin/ncadoctest.py",
> line 1231, in run_one_test
>         self.run_one_example(test, example, filename, compileflags)
>       File "/home/swenson/sage-src/sage-4.8/local/bin/sagedoctest.py",
> line 38, in run_one_example
>         OrigDocTestRunner.run_one_example(self, test, example, filename,
> compileflags)
>       File "/home/swenson/sage-src/sage-4.8/local/bin/ncadoctest.py",
> line 1172, in run_one_example
>         compileflags, 1) in test.globs
>       File "<doctest __main__.example_54[3]>", line 1, in <module>
>         regulator(EllipticCurve('11a'))###line 1360:
>     sage: regulator(EllipticCurve('11a'))
>       File "/home/swenson/sage-src/sage-4.8/local/lib/python/site-
> packages/sage/schemes/elliptic_curves/constructor.py", line 295, in
> EllipticCurve
>         return ell_rational_field.EllipticCurve_rational_field(x)
>       File "/home/swenson/sage-src/sage-4.8/local/lib/python/site-
> packages/sage/schemes/elliptic_curves/ell_rational_field.py", line 198,
> in __init__
>         X = sage.databases.cremona.CremonaDatabase()[label]
>       File "/home/swenson/sage-src/sage-4.8/local/lib/python/site-
> packages/sage/databases/cremona.py", line 1363, in CremonaDatabase
>         _db = LargeCremonaDatabase(name)
>       File "/home/swenson/sage-src/sage-4.8/local/lib/python/site-
> packages/sage/databases/cremona.py", line 1119, in __init__
>         + 'not appear to be a valid SQL Cremona database.')
>     RuntimeError: Database at /home/swenson/sage-
> src/sage-4.8/data//cremona/cremona.db does not appear to be a valid SQL
> Cremona database.
> **********************************************************************
> 1 items had failures:
>    1 of   5 in __main__.example_54
> ***Test Failed*** 1 failures.
> For whitespace errors, see the file
> /home/swenson/.sage//tmp/functional_29532.py
>          [4.3 s]
>
> ----------------------------------------------------------------------
> The following tests failed:
>

>         sage -t  "devel/sage-main/sage/misc/functional.py"
> Total time for all tests: 4.3 seconds
> [swenson@harry 10:18:22] sage-4.8 :( $ rm /home/swenson/sage-
> src/sage-4.8/data/cremona/cremona.db
> (hg)-[default]-
> [swenson@harry 10:18:25] sage-4.8 :) $ ./sage -t /home/swenson/sage-
> src/sage-4.8/devel/sage-main/sage/misc/functional.py
> (hg)-[default]-
> sage -t  "devel/sage-main/sage/misc/functional.py"
>          [4.3 s]
>
> ----------------------------------------------------------------------
> All tests passed!
> Total time for all tests: 4.3 seconds
> }}}
>
> ----
>
> See comment:14 for an explanation of the issues causing this.
>
> ----
>
> Apply attachment:trac12341.patch to the Sage Library.

New description:

 I am on Ubuntu 11.10, and noticed that a fresh install of Sage 4.8 fails a
 bunch of tests because the full cremona database is an empty file by
 default.

 {{{
 [swenson@harry 10:18:14] sage-4.8 :) $ ./sage -t /home/swenson/sage-
 src/sage-4.8/devel/sage-main/sage/misc/functional.py
 (hg)-[default]-
 sage -t  "devel/sage-main/sage/misc/functional.py"
 #0: simplify_sum(expr='sum(q^k,k,0,inf))
 #1: simplify_sum(expr=a*'sum(q^k,k,0,inf))
 **********************************************************************
 File "/home/swenson/sage-src/sage-4.8/devel/sage-
 main/sage/misc/functional.py", line 1360:
     sage: regulator(EllipticCurve('11a'))
 Exception raised:
     Traceback (most recent call last):
       File "/home/swenson/sage-src/sage-4.8/local/bin/ncadoctest.py", line
 1231, in run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File "/home/swenson/sage-src/sage-4.8/local/bin/sagedoctest.py",
 line 38, in run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File "/home/swenson/sage-src/sage-4.8/local/bin/ncadoctest.py", line
 1172, in run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_54[3]>", line 1, in <module>
         regulator(EllipticCurve('11a'))###line 1360:
     sage: regulator(EllipticCurve('11a'))
       File "/home/swenson/sage-src/sage-4.8/local/lib/python/site-
 packages/sage/schemes/elliptic_curves/constructor.py", line 295, in
 EllipticCurve
         return ell_rational_field.EllipticCurve_rational_field(x)
       File "/home/swenson/sage-src/sage-4.8/local/lib/python/site-
 packages/sage/schemes/elliptic_curves/ell_rational_field.py", line 198, in
 __init__
         X = sage.databases.cremona.CremonaDatabase()[label]
       File "/home/swenson/sage-src/sage-4.8/local/lib/python/site-
 packages/sage/databases/cremona.py", line 1363, in CremonaDatabase
         _db = LargeCremonaDatabase(name)
       File "/home/swenson/sage-src/sage-4.8/local/lib/python/site-
 packages/sage/databases/cremona.py", line 1119, in __init__
         + 'not appear to be a valid SQL Cremona database.')
     RuntimeError: Database at /home/swenson/sage-
 src/sage-4.8/data//cremona/cremona.db does not appear to be a valid SQL
 Cremona database.
 **********************************************************************
 1 items had failures:
    1 of   5 in __main__.example_54
 ***Test Failed*** 1 failures.
 For whitespace errors, see the file
 /home/swenson/.sage//tmp/functional_29532.py
          [4.3 s]

 ----------------------------------------------------------------------
 The following tests failed:


         sage -t  "devel/sage-main/sage/misc/functional.py"
 Total time for all tests: 4.3 seconds
 [swenson@harry 10:18:22] sage-4.8 :( $ rm /home/swenson/sage-
 src/sage-4.8/data/cremona/cremona.db
 (hg)-[default]-
 [swenson@harry 10:18:25] sage-4.8 :) $ ./sage -t /home/swenson/sage-
 src/sage-4.8/devel/sage-main/sage/misc/functional.py
 (hg)-[default]-
 sage -t  "devel/sage-main/sage/misc/functional.py"
          [4.3 s]

 ----------------------------------------------------------------------
 All tests passed!
 Total time for all tests: 4.3 seconds
 }}}

 ----

 See comment:14 for an explanation of the issues causing this.

 ----

 Apply attachment:trac_12341.patch to the Sage Library.

--

Comment (by cremona):

 The second patch (which includes the changes in the previous one)
 addresses the cases where there is a tag #optional in the code but no
 indication of which optional pakage is required, for the elliptic_curves
 directory only.

 With sage-5.4.beta1 with no optional spkgs installed, all tests pass if
 -optional is not given, while if -optional is given then there are two
 failures in elliptic_curve/, both due to {{{database_cremona_ellcurve}}
 not being installed.  After installing that one optional spkg, all these
 pass.  That is as it should be.

 Since I added to the patch it needs a second referee.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12341#comment:15>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to