[SciPy-Dev] Python2.4 test failures with scipy SVN and rc3

Bruce Southey bsouthey@gmail....
Wed Jul 21 11:30:47 CDT 2010


On Wed, Jul 21, 2010 at 10:10 AM, Bruce Southey <bsouthey@gmail.com> wrote:
> On 07/21/2010 09:19 AM, Ralf Gommers wrote:
>
> On Tue, Jul 20, 2010 at 10:20 PM, Bruce Southey <bsouthey@gmail.com> wrote:
>>
>> Hi,
>> There are a few tests failing with Python2.4 under Linux 64-bit:
>> $ python2.4
>> Python 2.4.5 (#1, Oct  6 2008, 09:54:35)
>> [GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import numpy as np
>> >>> import scipy as sp
>> >>> np.__version__
>> '2.0.0.dev8391'
>> >>> sp.__version__
>> '0.9.0.dev6630'
>>
>> One is due to use of the 'functools' module introduced in Python2.5 so I
>> added the same workaround as scipy.io.arff
>> http://projects.scipy.org/scipy/ticket/1244
>>
> Applied in trunk in r6632. Will do the same for 0.8.0.
>
>>
>> Three are the same error in 'scipy/io/netcdf.py' file:
>> http://projects.scipy.org/scipy/ticket/1243
>
> No idea. There are a bunch of other tickets for netcdf, it could use a
> makeover.
>>
>> Can the test 'test_decomp.test_lapack_misaligned' be set to known as this
>> is ticket 1152
>> http://projects.scipy.org/scipy/ticket/1152
>
> Marked as known in r6633.
>
> Thanks for testing,
> Ralf
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
> I tracked down the netcdf error is one of indexing with Python2.4 with numpy
> integers.  So while int64 is okay (as it should be) but most of the other
> integer types fail. I have added this to the the ticket.
>
>>>> import numpy as np
>>>> alist=['1','4','6']
>>>> alist[np.int64(0)]
> '1'
>>>> alist[np.int32(0)]
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: list indices must be integers
>>>> alist[np.int8(0)]
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: list indices must be integers
>>>> alist[np.int16(0)]
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: list indices must be integers
>
>
> Bruce

I have just found numpy ticket 911:
http://projects.scipy.org/numpy/ticket/911

While I do not know netcdf, I think that the generic int type has been
hardcoded to the int32 type. I made a patch (attached to the ticket)
that I know is not the correct solution to address the _unpack_int
function. The correct fix is to create _unpack_int and _pack_int to
use the system default dtype of int as well as having int32 versions.
However, I do not know if that will overcome the Python2.4 indexing
issue.


Bruce


More information about the SciPy-Dev mailing list