[NumPy-Tickets] [NumPy] #1676: dtypes error in recfunctions

NumPy Trac numpy-tickets@scipy....
Mon Nov 15 18:17:56 CST 2010


#1676: dtypes error in recfunctions
--------------------------+-------------------------------------------------
 Reporter:  weathergod    |       Owner:  somebody
     Type:  defect        |      Status:  new     
 Priority:  normal        |   Milestone:  1.5.1   
Component:  numpy.lib     |     Version:  1.5.0   
 Keywords:  recfunctions  |  
--------------------------+-------------------------------------------------
 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).

 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.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1676>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list