#10952: better numerical accuracy testing
---------------------------+------------------------------------------------
Reporter: robertwb | Owner: mvngu
Type: enhancement | Status: needs_work
Priority: major | Milestone:
Component: doctest | Keywords:
Work_issues: | Upstream: N/A
Reviewer: Jason Grout | Author: Robert Bradshaw
Merged: | Dependencies:
---------------------------+------------------------------------------------
Changes (by mariah):
* status: needs_review => needs_work
Comment:
I applied 10952-tol-bin.patch in the local/bin directory of a
skynet/taurus (x86_64-Linux-nehalem) build of sage-4.7.rc2. I next did
'sage -b'. I then modified a doctest to include the lines in
the ticket description
{{{
sage: print "The answers are", 1.5, 2, 1e-12 # tol 1e-3
The answers are 1.499999 2.0001 0
}}}
I then did 'sage -b' again. When I run the doctest, I get
{{{
% ./sage -t -long -force_lib "devel/sage/sage/symbolic/units.py"
sage -t -long -force_lib "devel/sage/sage/symbolic/units.py"
**********************************************************************
File "/home/mariah/sage/sage-4.7.rc2-x86_64-Linux-nehalem-fc-
review-10952/devel/sage/sage/symbolic/units.py", line 13:
sage: print "The answers are", 1.5, 2, 1e-12 # tol 1e-3
Exception raised:
Traceback (most recent call last):
File "/home/mariah/sage/sage-4.7.rc2-x86_64-Linux-nehalem-fc-
review-10952/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/mariah/sage/sage-4.7.rc2-x86_64-Linux-nehalem-fc-
review-10952/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/mariah/sage/sage-4.7.rc2-x86_64-Linux-nehalem-fc-
review-10952/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_0[6]>", line 1
res = print "The answers are", RealNumber('1.5'), Integer(2),
RealNumber('1e-12') # tol 1e-3###line 13:
sage: print "The answers are", 1.5, 2, 1e-12 # tol 1e-3
^
SyntaxError: invalid syntax
**********************************************************************
}}}
Note that if I put the lines
{{{
sage: RDF(pi) # abs tol 1e-5
3.14159
}}}
in the doctest, then the doctest passes.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10952#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.