[Numpy-discussion] return type diffences of indexed arrays with Intel C++ compiler (Python 2.5)
Lars Bittrich
lars.bittrich at googlemail.com
Fri Sep 29 07:48:30 CDT 2006
Hi all,
recently I tried to compile numpy/scipy with Python 2.5 and Intel C++ compiler
9.1. At first everything was fine, but the scipy test produced a few errors.
The reason was a little difference:
latest svn(1.0.dev3233) with Intel C compiler (Python 2.5):
-----------------------------------------------------------
In [1]:from numpy import ones, zeros, integer
In [2]:
In [2]:x = ones(1)
In [3]:i = zeros(1, integer)
In [4]:x[i]
Out[4]:1.0
latest svn(1.0.dev3233) with GCC 3.3 (Python 2.3):
--------------------------------------------------
In [1]:from numpy import ones, zeros, integer
In [2]:
In [2]:x = ones(1)
In [3]:i = zeros(1, integer)
In [4]:print x[i]
Out[4]:array([1])
The Intel version gives me a scalar whereas the gcc version an array. Maybe
Python 2.5 is causing this problem but my first guess was the compiler.
A typical error message from scipy.test(10):
======================================================================
ERROR: check_chebyc (scipy.special.tests.test_basic.test_chebyc)
----------------------------------------------------------------------
Traceback (most recent call last):
File "[...]/lib/python2.5/site-packages/scipy/special/tests/test_basic.py",
line 667, in check_chebyc
C1 = chebyc(1)
File "[...]/lib/python2.5/site-packages/scipy/special/orthogonal.py", line
461, in chebyc
p = orthopoly1d(x,w,hn,kn,wfunc=lambda x:
1.0/sqrt(1-x*x/4.0),limits=(-2,2),monic=monic)
File "[...]/lib/python2.5/site-packages/scipy/special/orthogonal.py", line
78, in __init__
equiv_weights = [weights[k] / wfunc(roots[k]) for k in range(len(roots))]
TypeError: object of type 'numpy.complex128' has no len()
Does anyone know how to resolve the problem?
Best regards,
Lars
More information about the Numpy-discussion
mailing list