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

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

Closed
williamstein opened this issue May 25, 2012 · 13 comments

Comments

@williamstein
Copy link
Contributor

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

@williamstein williamstein added this to the sage-5.1 milestone May 25, 2012
@williamstein williamstein self-assigned this May 25, 2012
@williamstein
Copy link
Contributor Author

Changed keywords from none to sd40.5

@williamstein
Copy link
Contributor Author

Attachment: trac_13011.patch.gz

@williamstein
Copy link
Contributor Author

comment:2

I have Mathematica 8 on my laptop if you want to see this work.

@williamstein
Copy link
Contributor Author

comment:3

Note -- in the patch I fixed a very serious bug with ".N()" that was introduced into Sage a year or two ago.

@mwhansen
Copy link
Contributor

Author: William Stein

@mwhansen
Copy link
Contributor

comment:4

You need to mark the N() tests as optional, otherwise looks good.

@mwhansen
Copy link
Contributor

Reviewer: Mike Hansen

@williamstein
Copy link
Contributor Author

comment:6

Attachment: trac_13011-part2.patch.gz

@vbraun

This comment has been minimized.

@vbraun
Copy link
Member

vbraun commented May 28, 2012

comment:7

Let's Get That Money!

@vbraun
Copy link
Member

vbraun commented May 28, 2012

Changed reviewer from Mike Hansen to Mike Hansen, Volker Braun

@jdemeyer
Copy link

Merged: sage-5.1.beta5

@fchapoton

This comment has been minimized.

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

5 participants