[Numpy-discussion] bug report ?
Revaz Yves
yves.revaz at obspm.fr
Wed Mar 5 09:13:45 EST 2008
Matthieu Brucher wrote:
> Hi,
>
> What type is pos->dimensions in your case ? It may be long (64bits
> long) instead of the expected int (32bits) or something like that ?
>
yes,
pos->dimensions is a 64bits long
while PyArray_FromDims expects 32bits int.
Why is it so ?
> Matthieu
>
> 2008/2/8, Yves Revaz <yves.revaz at obspm.fr <mailto:yves.revaz at obspm.fr>>:
>
>
> Dear list,
>
> I'm using old numarray C api with numpy.
> It seems that there is a bug when using the PyArray_FromDims function.
>
> for example, if I define :
> acc = (PyArrayObject *)
> PyArray_FromDims(pos->nd,pos->dimensions,pos->descr->type_num);
>
> where pos is PyArrayObject *pos; (3x3 array)
>
> when using return PyArray_Return(acc);
> I get
> array([], shape=(3, 0), dtype=float32)
>
>
> It is possible to make everything works if I use the following lines
> instead :
> int ld[2];
> ld[0]=pos->dimensions[0];
> ld[1]=pos->dimensions[1];
> acc = (PyArrayObject *)
> PyArray_FromDims(pos->nd,ld,pos->descr->type_num);
>
> So, the problem comes from the pos->dimensions.
>
>
> Is it a known bug ?
>
>
> (I'm working on a linux 64bits machine.)
>
>
> Cheers,
>
>
> yves
>
>
>
>
>
>
>
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org <mailto:Numpy-discussion at scipy.org>
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
>
> --
> French PhD student
> Website : http://matthieu-brucher.developpez.com/
> Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
> LinkedIn : http://www.linkedin.com/in/matthieubrucher
> ------------------------------------------------------------------------
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
More information about the NumPy-Discussion
mailing list