On Fri, 28 Apr 2006, Travis Oliphant wrote:
The scalar math module is complete and ready to be tested. It should speed up code that relies heavily on scalar arithmetic by by-passing the ufunc machinery.
It needs lots of testing to be sure that it is doing the "right" thing. To enable scalarmath you need to
import numpy.core.scalarmath
After numpy compiles on the 64 Bit machine I tried: import numpy import numpy.core.scalarmath numpy.test(1) The only failure is ====================================================================== FAIL: check_basic (numpy.lib.tests.test_function_base.test_prod) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/numpy/lib/tests/test_function_base.py", line 149, in check_basic assert_equal(prod(a),26400) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/numpy/testing/utils.py", line 128, in assert_equal assert desired == actual, msg AssertionError: Items are not equal: DESIRED: 26400 ACTUAL: 26400L ---------------------------------------------------------------------- Ran 363 tests in 0.246s Not sure if this is more a bug of assert_equal? Testing scipy with `import numpy.core.scalarmath` before leads to quite a few errors, many of them related to sparse, see below for an exerpt, and a couple of others. Best, Arnd ====================================================================== ERROR: check_eye (scipy.sparse.tests.test_sparse.test_construct_utils) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/tests/test_sparse.py", line 626, in check_eye a = speye(2, 3 ) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 2810, in speye return spdiags(diags, k, n, m) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 2792, in spdiags return csc_matrix((a, rowa, ptra), dims=(M, N)) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 574, in __init__ self._check() File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 590, in _check raise ValueError, "nzmax must not be less than nnz" ValueError: nzmax must not be less than nnz ====================================================================== ERROR: check_identity (scipy.sparse.tests.test_sparse.test_construct_utils) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/tests/test_sparse.py", line 621, in check_identity a = spidentity(3) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 2800, in spidentity return spdiags( diags, 0, n, n ) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 2792, in spdiags return csc_matrix((a, rowa, ptra), dims=(M, N)) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 574, in __init__ self._check() File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 590, in _check raise ValueError, "nzmax must not be less than nnz" ValueError: nzmax must not be less than nnz ====================================================================== ERROR: check_add (scipy.sparse.tests.test_sparse.test_csc) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/tests/test_sparse.py", line 33, in setUp self.datsp = self.spmatrix(self.dat) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 574, in __init__ self._check() File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 590, in _check raise ValueError, "nzmax must not be less than nnz" ValueError: nzmax must not be less than nnz ====================================================================== ERROR: Check whether adding a dense matrix to a sparse matrix works ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/tests/test_sparse.py", line 33, in setUp self.datsp = self.spmatrix(self.dat) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 574, in __init__ self._check() File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 590, in _check raise ValueError, "nzmax must not be less than nnz" ValueError: nzmax must not be less than nnz ====================================================================== ERROR: Check whether the copy=True and copy=False keywords work ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/tests/test_sparse.py", line 33, in setUp self.datsp = self.spmatrix(self.dat) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 574, in __init__ self._check() File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 590, in _check raise ValueError, "nzmax must not be less than nnz" ValueError: nzmax must not be less than nnz [....] ====================================================================== ERROR: Solve: single precision ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/linsolve/umfpack/tests/test_umfpack.py", line 67, in setUp self.a = spdiags([[1, 2, 3, 4, 5], [6, 5, 8, 9, 10]], [0, 1], 5, 5) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 2792, in spdiags return csc_matrix((a, rowa, ptra), dims=(M, N)) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 574, in __init__ self._check() File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/sparse/sparse.py", line 590, in _check raise ValueError, "nzmax must not be less than nnz" ValueError: nzmax must not be less than nnz ====================================================================== ERROR: check_exact (scipy.stats.tests.test_morestats.test_ansari) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/stats/tests/test_morestats.py", line 79, in check_exact W,pval = stats.ansari([1,2,3,4],[15,5,20,8,10,12]) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/stats/morestats.py", line 591, in ansari pval = 2.0*sum(a1[:cind+1])/total TypeError: unsupported operand type(s) for *: 'float' and 'float32scalar' ====================================================================== FAIL: check_simple_complex (scipy.linalg.tests.test_decomp.test_eigvals) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/linalg/tests/test_decomp.py", line 53, in check_simple_complex assert_array_almost_equal(w,exact_w) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/numpy/testing/utils.py", line 231, in assert_array_almost_equal assert cond,\ AssertionError: Arrays are not almost equal (mismatch 66.6666666667%): Array 1: [ 9.2983779e+00 +6.5630282e-01j -5.5210285e-16 -1.7300711e-16j -2.9837791e-01 +3.4369718e-01j] Array 2: [ 1.+0.0705825j 0.+0.j 1.-1.1518855j] ====================================================================== FAIL: check_definition (scipy.fftpack.tests.test_basic.test_ifft) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/fftpack/tests/test_basic.py", line 183, in check_definition assert_array_almost_equal(y,y1) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/numpy/testing/utils.py", line 231, in assert_array_almost_equal assert cond,\ AssertionError: Arrays are not almost equal (mismatch 100.0%): Array 1: [ 2.5 +0.375j 0.0883883+0.0883883j -0.125 -0.5j 0.0883883-0.0883883j -0.5 -0.375j -0.0883883-0.0... Array 2: [ 1.+0.15j 1.+1.j 1.+4.j 1.-1.j 1.+0.75j 1.+1.j 1.-0.5714286j 1.-1.j ] ====================================================================== FAIL: check_definition (scipy.fftpack.tests.test_basic.test_irfft) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/fftpack/tests/test_basic.py", line 340, in check_definition assert_array_almost_equal(y,y1) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/numpy/testing/utils.py", line 231, in assert_array_almost_equal assert cond,\ AssertionError: Arrays are not almost equal (mismatch 100.0%): Array 1: [ 2.625 -1.6856602 -0.375 -1.1856602 0.625 0.4356602 -0.375 0.9356602] Array 2: [ 1. 1. 1. 1. 1. 1. 1. 1.] ====================================================================== FAIL: check_h1vp (scipy.special.tests.test_basic.test_h1vp) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/special/tests/test_basic.py", line 1118, in check_h1vp assert_almost_equal(h1,h1real,8) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/numpy/testing/utils.py", line 148, in assert_almost_equal assert round(abs(desired - actual),decimal) == 0, msg AssertionError: Items are not equal: DESIRED: (0.49812630170362004+63.055272295669909j) ACTUAL: (1+126.58490844594492j) ====================================================================== FAIL: check_h2vp (scipy.special.tests.test_basic.test_h2vp) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/special/tests/test_basic.py", line 1125, in check_h2vp assert_almost_equal(h2,h2real,8) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/numpy/testing/utils.py", line 148, in assert_almost_equal assert round(abs(desired - actual),decimal) == 0, msg AssertionError: Items are not equal: DESIRED: (0.49812630170362004-63.055272295669909j) ACTUAL: (1-126.58490844594492j) ====================================================================== FAIL: check_nils (scipy.linalg.tests.test_matfuncs.test_signm) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/linalg/tests/test_matfuncs.py", line 42, in check_nils assert_array_almost_equal(r,cr) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/numpy/testing/utils.py", line 231, in assert_array_almost_equal assert cond,\ AssertionError: Arrays are not almost equal (mismatch 100.0%): Array 1: [[ 20.728 -6.576 29.592 32.88 -6.576] [ -5.808 2.936 -8.712 -9.68 1.936] [ -6.24 2.08 -8.36 -10.4 ... Array 2: [[ 11.9493333 -2.2453333 15.3173333 21.6533333 -2.2453333] [ -3.8426667 0.4986667 -4.5906667 -7.1866667 0.498... ====================================================================== FAIL: check_bad (scipy.linalg.tests.test_matfuncs.test_sqrtm) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/scipy/linalg/tests/test_matfuncs.py", line 99, in check_bad assert_array_almost_equal(dot(esa,esa),a) File "/home/abaecker/BUILDS3/BuildDir/inst_numpy/lib/python2.4/site-packages/numpy/testing/utils.py", line 231, in assert_array_almost_equal assert cond,\ AssertionError: Arrays are not almost equal (mismatch 100.0%): Array 1: [[ nan +nanj nan +n... Array 2: [[ 1. 0. 0. 1. ] [ 0. 0.03125 0. 0. ] [ 0. 0. 0.03125 0. ] [ ... ---------------------------------------------------------------------- Ran 1119 tests in 1.151s FAILED (failures=7, errors=82)