[SciPy-dev] AttributeError: __array_offset__

Travis Oliphant oliphant at ee.byu.edu
Thu Nov 3 10:07:09 CST 2005

Nils Wagner wrote:

>ERROR: check_djbfft (scipy.fftpack.basic.test_basic.test_fft)
>Traceback (most recent call last):
>  File
>line 133, in check_djbfft
>    assert_array_almost_equal(y,y2)
>  File "/usr/local/lib/python2.4/site-packages/scipy/test/testing.py",
>line 718, in assert_array_almost_equal
>    y = asarray(y)
>  File "/usr/local/lib/python2.4/site-packages/scipy/base/numeric.py",
>line 71, in asarray
>    return array(a, dtype, copy=False, fortran=fortran)
>AttributeError: __array_offset__
Hmm.  I see where this error could come from (I was not clearing the 
error if the__array_offset__ was not present in the array protocol 
consumer code).

What I don't see is why this function was calling the array protocol --- 
oh, wait I guess we are really testing against the old Numeric and FFT 
functions (if they are present).   I did not realize that.  I suppose 
that is not a bad idea.  That would definitely require the array 
interface to convert the Numeric arrays to scipy ones.

At any rate, I've fixed the problem.


More information about the Scipy-dev mailing list