#8495: Regression: Many mathematica doctests now fail
------------------------------------------+---------------------------------
Reporter: flawrence | Owner: flawrence
Type: defect | Status: needs_work
Priority: major | Milestone: sage-4.7
Component: interfaces | Keywords:
Author: Felix Lawrence | Upstream: N/A
Reviewer: Mike Hansen, Burcin Erocal | Merged:
Work_issues: |
------------------------------------------+---------------------------------
Changes (by drkirkby):
* status: needs_review => needs_work
Comment:
For me at least, on !OpenSolaris with Mathematica 7.0.1, this is a
definite improvement, as it reduced the number of failures in
{{{devel/sage/sage/interfaces/mathematica.py}}} from 17 to 2.
== Prior to adding the patch ==
{{{
<snip out lots of failures>
4 items had failures:
5 of 84 in __main__.example_0
4 of 6 in __main__.example_1
4 of 19 in __main__.example_12
4 of 6 in __main__.example_2
***Test Failed*** 17 failures.
For whitespace errors, see the file
/export/home/drkirkby/.sage//tmp/.doctest_mathematica.py
[5.4 s]
----------------------------------------------------------------------
The following tests failed:
sage -t -optional "devel/sage/sage/interfaces/mathematica.py"
Total time for all tests: 5.4 seconds
}}}
== After adding the patch ==
After applying the patch, the number of failures is reduced to 2.
{{{
sage-4.6.2.rc1$ ./sage -t -optional devel/sage/sage/interfaces/
sage -t -optional "devel/sage/sage/interfaces/mathematica.py"
**********************************************************************
File
"/export/home/drkirkby/3/sage-4.6.2.rc1/devel/sage/sage/interfaces/mathematica.py",
line 270:
sage: print n # optional - mathematica
Expected:
1.5707963267948966192313216916397514420985846996876
Got:
1.5707963267949
**********************************************************************
File
"/export/home/drkirkby/3/sage-4.6.2.rc1/devel/sage/sage/interfaces/mathematica.py",
line 311:
sage: math_bessel_K(2,I) # optional - mathematica
Exception raised:
Traceback (most recent call last):
File
"/export/home/drkirkby/3/sage-4.6.2.rc1/local/bin/ncadoctest.py", line
1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File
"/export/home/drkirkby/3/sage-4.6.2.rc1/local/bin/sagedoctest.py", line
38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File
"/export/home/drkirkby/3/sage-4.6.2.rc1/local/bin/ncadoctest.py", line
1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_0[75]>", line 1, in <module>
math_bessel_K(Integer(2),I) # optional -
mathematica###line 311:
sage: math_bessel_K(2,I) # optional - mathematica
File "<doctest __main__.example_0[74]>", line 2, in math_bessel_K
return mathematica(nu).BesselK(x).N(Integer(20))
File "element.pyx", line 617, in
sage.structure.element.Element.numerical_approx
(sage/structure/element.c:4658)
File "/export/home/drkirkby/3/sage-4.6.2.rc1/local/lib/python/site-
packages/sage/misc/functional.py", line 1265, in numerical_approx
return sage.rings.complex_field.ComplexField(prec)(x)
File "/export/home/drkirkby/3/sage-4.6.2.rc1/local/lib/python/site-
packages/sage/rings/complex_field.py", line 279, in __call__
return Parent.__call__(self, x)
File "parent.pyx", line 915, in
sage.structure.parent.Parent.__call__ (sage/structure/parent.c:6668)
File "coerce_maps.pyx", line 82, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3119)
File "coerce_maps.pyx", line 77, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3022)
File "/export/home/drkirkby/3/sage-4.6.2.rc1/local/lib/python/site-
packages/sage/rings/complex_field.py", line 310, in _element_constructor_
return complex_number.ComplexNumber(self, x)
File "complex_number.pyx", line 162, in
sage.rings.complex_number.ComplexNumber.__init__
(sage/rings/complex_number.c:3995)
TypeError: unable to coerce to a ComplexNumber: <class
'sage.interfaces.mathematica.MathematicaElement'>
**********************************************************************
1 items had failures:
2 of 84 in __main__.example_0
***Test Failed*** 2 failures.
For whitespace errors, see the file
/export/home/drkirkby/.sage//tmp/.doctest_mathematica.py
[5.2 s]
----------------------------------------------------------------------
The following tests failed:
sage -t -optional "devel/sage/sage/interfaces/mathematica.py"
Total time for all tests: 5.2 seconds
}}}
== Mathematica session on the sage machine computing Pi/2 ==
{{{
drkirkby@hawk:~$ math
Mathematica 7.0 for Sun Solaris x86 (64-bit)
Copyright 1988-2009 Wolfram Research, Inc.
In[1]:= n=Pi/2
Pi
Out[1]= --
2
In[2]:= N[n,50]
Out[2]= 1.5707963267948966192313216916397514420985846996876
}}}
== Sage session on the same machine computing pi/2 with the Mathematica
interface ==
{{{
sage: x = mathematica(pi/2)
sage: print x
Pi
--
2
sage: loads(dumps(x)) == x
True
sage: n = x.N(50)
sage: print n
1.5707963267949
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8495#comment:14>
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.