[SciPy-dev] All but two tests passing for me

Pearu Peterson pearu at scipy.org
Fri Oct 28 03:52:24 CDT 2005



On Fri, 28 Oct 2005, Arnd Baecker wrote:

>> ======================================================================
>> ERROR: check_integer
>> (scipy.io.array_import.test_array_import.test_read_array)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>   File
>> "/home/abaecker/BUILDS2/Build_52/inst_scipy_newcore/lib/python2.4/site-packages/scipy/io/tests/test_array_import.py",
>> line 62, in check_integer
>>     b = io.read_array(fname,atype=N.Int)
>>   File
>> "/home/abaecker/BUILDS2/Build_52//inst_scipy_newcore/lib/python2.4/site-packages/scipy/io/array_import.py",
>> line 359, in read_array
>>     raise ValueError, "One of the array types is invalid, k=%d" % k
>> ValueError: One of the array types is invalid, k=0
>>
>>
>> This is might be caused by:
>>
>> compile options:
>> '-I/home/abaecker/BUILDS2/Build_52/inst_scipy_newcore/lib/python2.4/site-packages/scipy/base/include
>> -I/scr/python/include/python2.4 -c'
>> gcc: Lib/io/numpyiomodule.c
>> Lib/io/numpyiomodule.c: In function `numpyio_tofile':
>> Lib/io/numpyiomodule.c:282: warning: passing arg 1 of pointer to function
>> from incompatible pointer type
>> Lib/io/numpyiomodule.c: In function `numpyio_convert_objects':
>> Lib/io/numpyiomodule.c:743: warning: passing arg 2 of pointer to function
>> from incompatible pointer type
>> gcc -pthread -shared build/temp.linux-x86_64-2.4/Lib/io/numpyiomodule.o
>> -Lbuild/temp.linux-x86_64-2.4 -o
>> build/lib.linux-x86_64-2.4/scipy/io/numpyio.so
>> building 'scipy.fftpack._fftpack' extension
>> compiling C sources
>
> I tried to look into this one. The offending line is:
>
> buffer_size = _PyArray_multiply_list(arr->dimensions + k, arr->nd - k);
>
> and later on
>
>  out = (PyArrayObject *)PyArray_FromDims(RANK(arr), DIMS(arr), int_type);
>
> with the definition:
>
>  #define DIMS(arr) ((arr)->dimensions)
>
> So it might be that arr->dimensions is not of the type it should be.

The type of arr->dimensions has been changed from int* to intp* in 
newcore. So, when porting extension modules to newcore, the following 
replacements are needed

   int* dimensions, strides; -> intp* dimensions, strides;
   PyArray_FromDims -> PyArray_SimpleNew
   PyArray_FromDimsAndData -> PyArray_SimpleNewFromData

> So I looked for the definition of arr:
>
> if ((arr = (PyArrayObject *)PyArray_FromDims(1,(int*)&n,out_type)) ==
> NULL)
>    return NULL;
>
> Is there some int * --> intp * needed ?

Yes, I have commited the patch already to SVN repository.

Pearu




More information about the Scipy-dev mailing list