#10183: long doctests wrongly tagged "# long" instead of "#long time"
-----------------------+----------------------------------------------------
   Reporter:  cremona  |       Owner:  mvngu           
       Type:  defect   |      Status:  needs_review    
   Priority:  minor    |   Milestone:  sage-4.6.1      
  Component:  doctest  |    Keywords:  doctest long tag
     Author:           |    Upstream:  N/A             
   Reviewer:           |      Merged:                  
Work_issues:           |  
-----------------------+----------------------------------------------------

Comment(by benjaminfjones):

 The patch here looks good, similar to trac #10182. I tested the timings
 before and after, log files are attached (didn't know if this is
 appropriate here or not, but figured I'd include them anyway). There was
 an error testing schemes/elliptic_curves/ell_rational_field.py with "sage
 -t" which doesn't occur with "sage -t --long" that I'm puzzled about. Here
 is the error:

 {{{
 sage -t  "devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py"
   ***   Warning: new stack size = 1003360 (0.957 Mbytes).
   ***   Warning: new stack size = 1003360 (0.957 Mbytes).
 **********************************************************************
 File
 
"/Users/jonesbe/sage/sage-4.6/devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py",
 line 1447:
     sage: E.simon_two_descent ()
 Expected:
     (1, 1, [])
 Got:
     (3, 3, [(1 : 0 : 1), (0 : 2 : 1), (2 : -1 : 1)])
 **********************************************************************
 1 items had failures:
    1 of  31 in __main__.example_28
 ***Test Failed*** 1 failures.
 For whitespace errors, see the file
 /Users/jonesbe/.sage//tmp/.doctest_ell_rational_field.py
          [39.4 s]
 }}}

 The test in question is:
 {{{
 sage: E = EllipticCurve([1, -1, 0, -751055859, -7922219731979])     # long
 time (0.6 seconds)
 sage: set_random_seed(0)
 sage: E.simon_two_descent ()
 }}}

 When I run these commands in an interactive sage session I get the
 "expected" answer:
 {{{
 sage: E = EllipticCurve([1, -1, 0, -751055859, -7922219731979])     # long
 time (0.6 seconds)
 sage: set_random_seed(0)
 sage: E.simon_two_descent ()
 (1, 1, [])
 }}}

 but when the test gets done as part of "sage -t" the result is different
 (see above). When the test is done with "sage -t --long" there is no
 deviation from the expected answer.

 Looks to me like what's going on is that with "sage -t" the line tagged "#
 long time" is not executed, so the calculation
 {{{
 sage: set_random_seed(0)
 sage: E.simon_two_descent ()
 }}}

 applies to the previously defined Elliptic curve (on line 1435) where the
 following test is performed:
 {{{
 sage: E = EllipticCurve('5077a1')
 sage: set_random_seed(0)
 sage: E.simon_two_descent()
 (3, 3, [(1 : 0 : 1), (0 : 2 : 1), (2 : -1 : 1)])
 }}}
 The output here is what sage is complaining is not equal to the expected
 output in the present test.

 So... I guess the whole three line block lines 1445 - 1447 should be
 tagged "# long time".

 Other than this problem, the patch produces expected timing differences.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10183#comment:2>
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