[SciPy-dev] newscipy, 64Bit, det problem

Arnd Baecker arnd.baecker at web.de
Sat Oct 29 16:41:52 CDT 2005


Hi,

as previously reported I get on the opteron
(In [11]: scipy.__core_version__  Out[11]: '0.4.3.1385'
 In [12]: scipy.__scipy_version__ Out[12]: '0.4.2_1402' ):

======================================================================
FAIL: check_simple (scipy.linalg.basic.test_basic.test_det)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/abaecker/BUILDS2/Build_55/inst_scipy_newcore/lib/python2.4/site-pa
ckages/scipy/linalg/tests/test_basic.py", line 273, in check_simple
    assert_almost_equal(a_det,-2.0)
  File
"/home/abaecker/BUILDS2/Build_55//inst_scipy_newcore/lib/python2.4/site-p
ackages/scipy/test/testing.py", line 649, in assert_almost_equal
    assert round(abs(desired - actual),decimal) == 0, msg
AssertionError:
Items are not equal:
DESIRED: -2.0
ACTUAL: -0.0

The corresponding test routine is

test_det
    def check_simple(self):
        a = [[1,2],[3,4]]
        a_det = det(a)
        assert_almost_equal(a_det,-2.0)

Testing this line by line gives for:

from scipy import *
a = [[1,2],[3,4]]
print type(a)
linalg.det(a)

the following:

In [3]: a = [[1,2],[3,4]]
In [4]: print type(a)
<type 'list'>
In [5]: linalg.det(a)
Out[5]: -0.0



Interestingly the following gives the expected answer

from scipy import *
a = zeros( (2,2))
a[0,0]=1
a[0,1]=2
a[1,0]=3
a[1,1]=4
print type(a)
linalg.det(a)

In [7]: print type(a)
<type 'scipy.ndarray'>
In [8]: linalg.det(a)
Out[8]: -2.0

Travis, does this help you in some way to understand
what is going on?
(Seems to be some list->array conversion problem ...)

I'd guess that some of the other failures are of the same
reason. Also note that the above works with newscipy on my laptop

In [2]: a = [[1,2],[3,4]]
In [3]: print type(a)
<type 'list'>
In [4]: linalg.det(a)
Out[4]: -2.0

Best, Arnd




More information about the Scipy-dev mailing list