[SciPy-dev] OS X: Things missing from scipy namespace; fft issues

Tom Loredo loredo at astro.cornell.edu
Sat Jan 7 15:06:23 CST 2006


Hi folks,

I've installed the current SVN numpy and scipy.  I also just installed
both the last numarray release, and numarray from CVS, both with the
same errors.  This is on OS X.

It seems some imports are missing.  If I import scipy, basic numpy
stuff that was always imported into scipy's namespace is missing.
Thus I get AttributeError exceptions if I try to use anything like
scipy.zeros, scipy.arange, scipy.pi, scipy.cos, scipy.sin... you
get the idea.  

Numarray's last suite of tests gets 16 failures in 17 tests.  This
suite tests conversion between scipy and numarray.  The errors
are due to AttributeErrors as I've just described; in particular,
numarray tries to use scipy.array and scipy.zeros a lot and raises 
an exception every time.

There is also a problem with scipy's fft tests.  The errors are
copied below.  A problem can be verified "by hand" by fft/ifft
of a short sin(x) sequence; the real part of the inverse doesn't 
match the original.

I presume these problems are OS X specific, or someone else would've
seen them.  I do have FFTW2 installed.  I recall a similar problem
appearing back in December that was quickly fixed.  Perhaps that
will jog someone's memory about it.  Let me know if there is
something I may have screwed up in the install, but an essentially
identical install process with scipy_core and scipy last week
didn't have these issues.

I did upgrade from MacPython 2.4.1 to ActivePython 2.4.2 since then.

-Tom

FSkipping check_djbfft (failed to import FFT)
..F..F..FF.FSkipping check_djbfft (failed to import FFT)
..Skipping check_djbfft (failed to import FFT: No module named FFT)

======================================================================
FAIL: check_definition (scipy.fftpack.basic.test_basic.test_fft)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/tests/
test_basic.py", line 98, in check_definition
    assert_array_almost_equal(y,y1)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 
183, in assert_array_almost_equal
    assert cond,\
AssertionError: 
Arrays are not almost equal (mismatch 100.0%):
        Array 1: [ 20.+0.j   0.+0.j  -4.+4.j   0.+0.j  -4.+0.j   0.-0.j  -4.-4.j   0.-0.j]
        Array 2: [ 20.       +3.j         -0.7071068+0.7071068j  -7.       +4.j
  -0.7071068-0.7071068j  -4.       -3.j          0.707106...


======================================================================
FAIL: check_definition (scipy.fftpack.basic.test_basic.test_fftn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/tests/
test_basic.py", line 425, in check_definition
    assert_array_almost_equal(y,direct_dftn(x))
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 
183, in assert_array_almost_equal
    assert cond,\
AssertionError: 
Arrays are not almost equal (mismatch 22.2222222222%):
        Array 1: [[ 45. +0.j         -4.5+2.5980762j  -4.5-2.5980762j]
 [-13.5+7.7942286j   0. +0.j          0. +0.j       ]
 [-13.5-7.79...
        Array 2: [[ 45. +0.j         -4.5+2.5980762j  -4.5-2.5980762j]
 [-13.5+0.j         -0. +0.j         -0. -0.j       ]
 [-13.5+0.j ...


======================================================================
FAIL: check_definition (scipy.fftpack.basic.test_basic.test_ifft)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/tests/
test_basic.py", line 183, in check_definition
    assert_array_almost_equal(y,y1)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 
183, in assert_array_almost_equal
    assert cond,\
AssertionError: 
Arrays are not almost equal (mismatch 100.0%):
        Array 1: [ 2.5+0.j   0. -0.j  -0.5-0.5j  0. -0.j  -0.5+0.j   0. +0.j  -0.5+0.5j
  0. +0.j ]
        Array 2: [ 2.5      +0.375j      0.0883883+0.0883883j -0.125    -0.5j
  0.0883883-0.0883883j -0.5      -0.375j     -0.0883883-0.0...


======================================================================
FAIL: check_random_real (scipy.fftpack.basic.test_basic.test_ifft)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/tests/
test_basic.py", line 217, in check_random_real
    assert_array_almost_equal (ifft(fft(x)),x)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 
183, in assert_array_almost_equal
    assert cond,\
AssertionError: 
Arrays are not almost equal (mismatch 98.0392156863%):
        Array 1: [ 0.4084044 +0.0000000e+00j  0.3922044 +1.5238355e-17j
  0.5022578 +1.0884539e-18j  0.2854401 -4.4163695e-18j
  0.771945...
        Array 2: [ 0.4084044  0.6151218  0.1139266  0.2933692  0.8680635  0.3443912
  0.7993071  0.360068   0.4277811  0.1723109  0.16786...


======================================================================
FAIL: check_definition (scipy.fftpack.basic.test_basic.test_ifftn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/tests/
test_basic.py", line 594, in check_definition
    assert_array_almost_equal(y,direct_idftn(x))
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 
183, in assert_array_almost_equal
    assert cond,\
AssertionError: 
Arrays are not almost equal (mismatch 22.2222222222%):
        Array 1: [[ 5. +0.j        -0.5-0.2886751j -0.5+0.2886751j]
 [-1.5-0.8660254j  0. +0.j         0. +0.j       ]
 [-1.5+0.8660254j ...
        Array 2: [[ 5. +0.j        -0.5-0.2886751j -0.5+0.2886751j]
 [-1.5+0.j        -0. -0.j        -0. +0.j       ]
 [-1.5+0.j        ...


======================================================================
FAIL: check_definition (scipy.fftpack.basic.test_basic.test_irfft)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/tests/
test_basic.py", line 341, in check_definition
    assert_array_almost_equal(y,ifft(x1))
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 
183, in assert_array_almost_equal
    assert cond,\
AssertionError: 
Arrays are not almost equal (mismatch 50.0%):
        Array 1: [ 2.625     -1.6856602 -0.375     -1.1856602  0.625      0.4356602 -0.375
  0.9356602]
        Array 2: [ 2.625+0.j -0.375-0.j -0.375-0.j -0.375-0.j  0.625+0.j -0.375+0.j
 -0.375+0.j -0.375+0.j]


======================================================================
FAIL: check_definition (scipy.fftpack.pseudo_diffs.test_pseudo_diffs.test_diff)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/tests/
test_pseudo_diffs.py", line 86, in check_definition
    assert_array_almost_equal(diff(sin(x),2),direct_diff(sin(x),2))
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 
183, in assert_array_almost_equal
    assert cond,\
AssertionError: 
Arrays are not almost equal (mismatch 87.5%):
        Array 1: [ -6.3519652e-15  -3.8268343e-01  -7.0710678e-01  -9.2387953e-01
  -1.0000000e+00  -9.2387953e-01  -7.0710678e-01  -3.82...
        Array 2: [ -7.3854931e-15   6.5259351e-15  -2.4942634e-15  -7.5636114e-17
   1.4745663e-15  -1.9133685e-15   2.2804788e-16   8.70...


======================================================================
FAIL: check_random_even (scipy.fftpack.pseudo_diffs.test_pseudo_diffs.test_hilbert)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/tests/
test_pseudo_diffs.py", line 332, in check_random_even
    assert_array_almost_equal(direct_hilbert(direct_ihilbert(f)),f)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 
183, in assert_array_almost_equal
    assert cond,\
AssertionError: 
Arrays are not almost equal (mismatch 100.0%):
        Array 1: [  8.1315163e-19+0.j   0.0000000e+00-0.j   1.5541025e-18-0.j
   0.0000000e+00-0.j   2.1849431e-18-0.j   0.0000000e+00-0....
        Array 2: [-0.1272037 -0.1873667 -0.0639312 -0.029223   0.058697   0.1326041
 -0.0476338 -0.4124686 -0.0012274 -0.2744091 -0.28491...


======================================================================
FAIL: check_definition (scipy.fftpack.pseudo_diffs.test_pseudo_diffs.test_shift)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/tests/
test_pseudo_diffs.py", line 390, in check_definition
    assert_array_almost_equal(shift(sin(x),a),direct_shift(sin(x),a))
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 
183, in assert_array_almost_equal
    assert cond,\
AssertionError: 
Arrays are not almost equal (mismatch 88.8888888889%):
        Array 1: [ 0.0998334  0.4341242  0.7160532  0.9116156  0.9972237  0.9625519
  0.8117822  0.5630995  0.2464987 -0.0998334 -0.43412...
        Array 2: [ 0.0998334  0.0938127  0.0764768  0.0499167  0.0173359 -0.0173359
 -0.0499167 -0.0764768 -0.0938127 -0.0998334 -0.09381...


======================================================================
FAIL: check_random_even (scipy.fftpack.pseudo_diffs.test_pseudo_diffs.test_tilbert)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/tests/
test_pseudo_diffs.py", line 240, in check_random_even
    assert_array_almost_equal(direct_tilbert(direct_itilbert(f,h),h),f)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 
183, in assert_array_almost_equal
    assert cond,\
AssertionError: 
Arrays are not almost equal (mismatch 100.0%):
        Array 1: [ 0.+0.j  0.-0.j  0.-0.j  0.-0.j  0.-0.j  0.-0.j  0.-0.j  0.-0.j  0.-0.j
  0.-0.j  0.-0.j  0.-0.j  0.-0.j  0.-0.j  0.-0....
        Array 2: [ 0.3665402 -0.106089   0.2154525 -0.1109742  0.0947835  0.408259
  0.4949894  0.2839439  0.5027918 -0.0850018 -0.453880...



-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




More information about the Scipy-dev mailing list