Opened 10 years ago

Closed 8 years ago

#6315 closed defect (fixed)

optional doctest failure -- caused by mistakes in lectures on number theory rst book

Reported by: was Owned by: tbd
Priority: major Milestone: sage-4.7.2
Component: packages: optional Keywords: sd32
Cc: Merged in: sage-4.7.2.alpha3
Authors: Mariah Lenox, William Stein Reviewers: Marco Streng
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by leif)

sage -t -long --optional devel/sage/doc/en/bordeaux_2008/birds_other.rst
**********************************************************************
File "/scratch/wstein/build/sage-4.0.2.alpha3/devel/sage-main/doc/en/bordeaux_2008/birds_other.rst", line 243:
    sage: magma.eval(s)     #optional - magma
Exception raised:
    Traceback (most recent call last):
      File "/scratch/wstein/build/sage-4.0.2.alpha3/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/scratch/wstein/build/sage-4.0.2.alpha3/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/scratch/wstein/build/sage-4.0.2.alpha3/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_6[12]>", line 1, in <module>
        magma.eval(s)     #optional - magma###line 243:
    sage: magma.eval(s)     #optional - magma
      File "/scratch/wstein/build/sage-4.0.2.alpha3/local/lib/python2.5/site-packages/sage/interfaces/magma.py", line 471, in eval
        raise RuntimeError, "Error evaluating Magma code.\nIN:%s\nOUT:%s"%(x, ans)
    RuntimeError: Error evaluating Magma code.
    IN:time v := [_sage_[3] * _sage_[4] for _ in [1..10^5]];
    OUT:
    >> time v := [_sage_[3] * _sage_[4] for _ in [1..10^5]];
                                        ^
    User error: bad syntax
**********************************************************************
File "/scratch/wstein/build/sage-4.0.2.alpha3/devel/sage-main/doc/en/bordeaux_2008/birds_other.rst", line 265:
    sage: magma.eval(s) #optional - magma
Expected:
    'Time: 1.480'
Got:
    'Time: 0.210'
**********************************************************************
2 items had failures:
   1 of  14 in __main__.example_6
   1 of   9 in __main__.example_7
***Test Failed*** 2 failures.
For whitespace errors, see the file /home/wstein/build/sage-4.0.2.alpha3/tmp/.doctest_birds_other.py

Apply

  1. trac_6315.patch
  2. trac_6315-part2.patch

to the Sage library.

Attachments (2)

trac_6315.patch (1020 bytes) - added by mariah 8 years ago.
trac_6315-part2.patch (2.3 KB) - added by was 8 years ago.

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by mariah

comment:1 follow-up: Changed 8 years ago by mariah

  • Authors set to Mariah Lenox
  • Milestone changed from sage-4.7 to sage-4.7.1
  • Report Upstream set to N/A
  • Status changed from new to needs_info

trac_6315.patch fixes the "bad syntax" error. However I do not know what to do about the difference between the Expected time and the Got time. Timings will be dependent on the computer system. With the patch, I currently get:

eno% ./sage -t -long --optional devel/sage/doc/en/bordeaux_2008/birds_other.rst
sage -t -long --optional "devel/sage/doc/en/bordeaux_2008/birds_other.rst"
**********************************************************************
File "/home/mariah/sage/sage-4.7.rc4-x86_64-Linux-core2-fc-work-magma/devel/sage/doc/en/bordeaux_2008/birds_other.rst", line 244:
    sage: magma.eval(s)     #optional - magma
Expected:
    'Time: 17.120'
Got:
    'Time: 3.560'
**********************************************************************
File "/home/mariah/sage/sage-4.7.rc4-x86_64-Linux-core2-fc-work-magma/devel/sage/doc/en/bordeaux_2008/birds_other.rst", line 266:
    sage: magma.eval(s) #optional - magma
Expected:
    'Time: 1.480'
Got:
    'Time: 0.200'
**********************************************************************
2 items had failures:

William - what do you want done?

comment:2 in reply to: ↑ 1 ; follow-up: Changed 8 years ago by mstreng

Replying to mariah:

[...] I do not know what to do about the difference between the Expected time and the Got time. Timings will be dependent on the computer system.

Why not just append ", random output" to "#optional - magma"? That way, the output is ignored, just like the timings in this rst file that don't use magma.

Are the authors of the book aware of this error?

Changed 8 years ago by was

comment:3 in reply to: ↑ 2 Changed 8 years ago by was

  • Status changed from needs_info to needs_review

Replying to mstreng:

Are the authors of the book aware of this error?

The authors "= me" is aware now. I've posted a part2 patch that puts ...'s in for the timings, explains that the doctest is showing the reader *how* to compare timings with Magma (which is good to know how to do easily), and remarks that in fact the timings may change over time.

comment:4 Changed 8 years ago by was

  • Authors changed from Mariah Lenox to Mariah Lenox, William Stein

comment:5 Changed 8 years ago by mstreng

  • Reviewers set to Marco Streng
  • Status changed from needs_review to positive_review

comment:6 Changed 8 years ago by was

  • Keywords sd32 added

comment:7 Changed 8 years ago by leif

  • Description modified (diff)

comment:8 Changed 8 years ago by leif

  • Merged in set to sage-4.7.2.alpha3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.