Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
williamstein opened this issue Jun 16, 2009 · 10 comments

Comments

@williamstein
Copy link
Contributor

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. attachment: trac_6315.patch
  2. attachment: trac_6315-part2.patch
    to the Sage library.

Component: packages: optional

Keywords: sd32

Author: Mariah Lenox, William Stein

Reviewer: Marco Streng

Merged: sage-4.7.2.alpha3

Issue created by migration from https://trac.sagemath.org/ticket/6315

@sagetrac-mariah
Copy link
Mannequin

sagetrac-mariah mannequin commented May 25, 2011

Attachment: trac_6315.patch.gz

@sagetrac-mariah
Copy link
Mannequin

sagetrac-mariah mannequin commented May 25, 2011

comment:1

attachment: 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?

@sagetrac-mariah
Copy link
Mannequin

sagetrac-mariah mannequin commented May 25, 2011

Author: Mariah Lenox

@sagetrac-mariah sagetrac-mariah mannequin added the s: needs info label May 25, 2011
@sagetrac-mariah sagetrac-mariah mannequin modified the milestones: sage-4.7, sage-4.7.1 May 25, 2011
@mstreng
Copy link

mstreng commented Jun 29, 2011

comment:2

Replying to @sagetrac-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?

@williamstein
Copy link
Contributor Author

comment:3

Attachment: trac_6315-part2.patch.gz

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.

@williamstein
Copy link
Contributor Author

Changed author from Mariah Lenox to Mariah Lenox, William Stein

@mstreng
Copy link

mstreng commented Aug 23, 2011

Reviewer: Marco Streng

@williamstein
Copy link
Contributor Author

Changed keywords from none to sd32

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 12, 2011

Merged: sage-4.7.2.alpha3

@nexttime nexttime mannequin removed the s: positive review label Sep 12, 2011
@nexttime nexttime mannequin closed this as completed Sep 12, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants