Skip to content

several optional tests fail in the sage/mathematica interface with mathematica 8.0 #13011

@williamstein

Description

@williamstein

On OS X 10.7 with the newest version of Mathematica (8.0), several optional tests fail, probably due to changes in mathematica. Fix this, since with the optional tests, we aim at having the tests work in the latest released version (since that is stable).

blastoff:interfaces wstein$ sage -t -optional mathematica.py 
sage -t -optional "devel/sage-main/sage/interfaces/mathematica.py"
**********************************************************************
File "/Users/wstein/sage/build/sage-5.0/devel/sage-main/sage/interfaces/mathematica.py", line 128:
    sage: sys.Solve('{x, y}')               # optional - mathematica
Expected:
    {{y -> -1, x -> 0}, {y -> 11, x -> 6}}
Got:
    {{x -> 0, y -> -1}, {x -> 6, y -> 11}}
**********************************************************************
File "/Users/wstein/sage/build/sage-5.0/devel/sage-main/sage/interfaces/mathematica.py", line 152:
    sage: v.Solve(['x', 'y'])               # optional - mathematica
Expected:
    {{y -> -1, x -> 0}, {y -> 11, x -> 6}}
Got:
    {{x -> 0, y -> -1}, {x -> 6, y -> 11}}
**********************************************************************
File "/Users/wstein/sage/build/sage-5.0/devel/sage-main/sage/interfaces/mathematica.py", line 270:
    sage: print n                   # optional - mathematica
Expected:
                  1.5707963267948966192313216916397514420985846996876
Got:
    1.5707963267949
**********************************************************************
File "/Users/wstein/sage/build/sage-5.0/devel/sage-main/sage/interfaces/mathematica.py", line 315:
    sage: math_bessel_K(2,I)                      # optional - mathematica
Exception raised:
    Traceback (most recent call last):
      File "/Users/wstein/sage/build/sage-5.0/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/Users/wstein/sage/build/sage-5.0/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/Users/wstein/sage/build/sage-5.0/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 315:
    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 634, in sage.structure.element.Element.numerical_approx (sage/structure/element.c:4983)
      File "/Users/wstein/sage/build/sage-5.0/local/lib/python/site-packages/sage/misc/functional.py", line 1286, in numerical_approx
        return sage.rings.complex_field.ComplexField(prec)(x)
      File "/Users/wstein/sage/build/sage-5.0/local/lib/python/site-packages/sage/rings/complex_field.py", line 277, in __call__
        return Parent.__call__(self, x)
      File "parent.pyx", line 1058, in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7941)
      File "coerce_maps.pyx", line 82, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3345)
      File "coerce_maps.pyx", line 77, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3248)
      File "/Users/wstein/sage/build/sage-5.0/local/lib/python/site-packages/sage/rings/complex_field.py", line 308, in _element_constructor_
        return complex_number.ComplexNumber(self, x)
      File "complex_number.pyx", line 165, in sage.rings.complex_number.ComplexNumber.__init__ (sage/rings/complex_number.c:3464)
    TypeError: unable to coerce to a ComplexNumber: <class 'sage.interfaces.mathematica.MathematicaElement'>
**********************************************************************
1 items had failures:
   4 of  85 in __main__.example_0
***Test Failed*** 4 failures.
For whitespace errors, see the file /Users/wstein/.sage//tmp/mathematica_95798.py
 [5.1 s]
 
----------------------------------------------------------------------
The following tests failed:


sage -t -optional "devel/sage-main/sage/interfaces/mathematica.py"
Total time for all tests: 5.1 seconds
blastoff:interfaces wstein$ 

Apply

Component: interfaces

Keywords: sd40.5

Author: William Stein

Reviewer: Mike Hansen, Volker Braun

Merged: sage-5.1.beta5

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions