|
From: Francesc A. <fa...@ca...> - 2005-11-10 17:50:39
|
Ups, I've made a cvs update and not luck yet:
>>> import numarray; numarray.__version__
'1.4.2'
>>> import Numeric; Numeric.__version__
'24.1'
>>> num=3DNumeric.array([1,2,3,4])
>>> numarray.array(num)
array([1, 2, 3, 4])
>>> num2=3Dnum[::2]
>>> numarray.array(num2)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 38=
0,=20
in array
a =3D a.astype(type)
File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 86=
7,=20
in astype
return self.copy()
File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line 92=
7,=20
in copy
c =3D _gen.NDArray.copy(self)
File "/usr/lib/python2.4/site-packages/numarray/generic.py", line 724, in=
=20
copy
arr._itemsize)
numarray.libnumarray.error: copy4bytes: access beyond buffer. offset=3D11=20
buffersize=3D8
I've made a rm -rf of old numarray extension, and rebuild everything
from scratch.
Regards,
A Dijous 10 Novembre 2005 17:47, v=E0reu escriure:
> Francesc Altet wrote:
> >El dv 04 de 11 del 2005 a les 15:35 -0500, en/na Todd Miller va
> >
> >escriure:
> >>This turned out to be a problem with the way numarray handles Numeric's
> >>multi-segment buffer protocol. I worked around this by implementing
> >>David Cooke's __array_struct__ array interface for numarray.
> >
> >Did you commit the changes in CVS? I'm getting the same problems with
> >
> >the current CVS version:
> >>>>Numeric.__version__
> >
> >'24.1'
> >
> >>>>import numarray
> >>>>numarray.__version__
> >
> >'1.4.2'
> >
> >>>>num=3DNumeric.array([1,2,3,4])
> >>>>numarray.array(num)
> >
> >array([1, 2, 3, 4])
> >
> >>>>num2=3Dnum[::2]
> >>>>numarray.array(num2)
> >
> >Traceback (most recent call last):
> > File "<stdin>", line 1, in ?
> > File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line
> >380, in array
> > a =3D a.astype(type)
> > File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line
> >867, in astype
> > return self.copy()
> > File "/usr/lib/python2.4/site-packages/numarray/numarraycore.py", line
> >927, in copy
> > c =3D _gen.NDArray.copy(self)
> > File "/usr/lib/python2.4/site-packages/numarray/generic.py", line 724,
> >in copy
> > arr._itemsize)
> >numarray.libnumarray.error: copy4bytes: access beyond buffer. offset=3D11
> >buffersize=3D8
>
> This turned out to be a bug in numarray buffer size determination...
> striding wasn't accounted for so the buffer appeared to be too small.
> It's fixed now in CVS. There's still a backward compatibility problem
> for old Numerics which don't implement __array_struct__ and get
> multi-segment buffers through __array_data__.
>
> Regards,
> Todd
=2D-=20
>0,0< Francesc Altet =A0 =A0 http://www.carabos.com/
V V C=E1rabos Coop. V. =A0=A0Enjoy Data
"-"
|