[Numpy-discussion] dtypes error in recfunctions

Benjamin Root ben.root@ou....
Mon Nov 15 18:21:10 CST 2010

On Mon, Nov 15, 2010 at 4:57 PM, Pierre GM <pgmdevlist@gmail.com> wrote:

> On Nov 15, 2010, at 11:43 PM, Benjamin Root wrote:
> > Hello,
> >
> > I was using append_fields() in numpy.lib.recfunctions when I discovered a
> slight logic mistake in handling the dtypes argument.
> >
> > The code first checks to see if dtypes is None.  If so, it then guesses
> the dtype info from the input data.  Then, it goes to see if the dtypes is
> not a sequence and puts it into a list.  This is where the logic breaks
> down.  It then proceeds to use that dtypes to start merging the data.
>  However, if you pass in a sequence of dtype, that condition gets skipped
> and the rest of the function has to figure out the dtype (and ignores the
> supplied names as well).
> Good call. I never advertised these functions just because I thought they
> hadn't been thoroughly tested. Thanks a million!
> > I have attached a patch to fix this.  I did not check the rest of the
> module to see if this mis-logic crops up anywhere else.
> Please file a ticket, otherwise I'm more than likely to forget about it...
> And please attach your patch!
> Thanks again
> P.

No problem.  It is ticket 1676.


Glad to be of help!
Ben Root
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20101115/e6dd5674/attachment-0001.html 

More information about the NumPy-Discussion mailing list