[NumPy-Tickets] [NumPy] #1422: ma._extrema_operation subclasses' reduce method raise ValueError...

NumPy Trac numpy-tickets@scipy....
Fri Mar 5 12:03:56 CST 2010


#1422: ma._extrema_operation subclasses' reduce method raise ValueError...
----------------------------------------------------+-----------------------
 Reporter:  dgoldsmith                              |       Owner:  pierregm
     Type:  defect                                  |      Status:  new     
 Priority:  high                                    |   Milestone:          
Component:  numpy.ma                                |     Version:  1.4.0   
 Keywords:  ma.reduce ValueError "zero-size array"  |  
----------------------------------------------------+-----------------------
 ...if passed zero-size array.
 {{{
 >>> mn = numpy.ma.core._minimum_operation()
 >>> mn.reduce(N.array(()))
 Traceback (most recent call last):
   File "<input>", line 1, in <module>
   File "C:\Python254\Lib\site-packages\numpy\ma\core.py", line 5570, in
 reduce
     t = self.ufunc.reduce(target, **kargs)
 ValueError: zero-size array to ufunc.reduce without identity
 }}}

 Notes:

 0) Problem discovered via a call from matplotlib.imshow; here's that
 traceback:
 {{{
 Traceback (most recent call last):
  File "<my_code.py>", line 108, in <module>
 ax.imshow(part2plot, cmap_name, extent = extent)
  File "C:\Python254\lib\site-packages\matplotlib\axes.py", line 6261, in
 imshow
 im.autoscale_None()
  File "C:\Python254\lib\site-packages\matplotlib\cm.py", line 236, in
 autoscale_None
 self.norm.autoscale_None(self._A)
  File "C:\Python254\lib\site-packages\matplotlib\colors.py", line 792, in
 autoscale_None
 if self.vmin is None: self.vmin = ma.minimum(A)
  File "C:\Python254\Lib\site-packages\numpy\ma\core.py", line 5555, in
 __call__
 return self.reduce(a)
  File "C:\Python254\Lib\site-packages\numpy\ma\core.py", line 5570, in
 reduce
 t = self.ufunc.reduce(target, **kargs)
 ValueError: zero-size array to ufunc.reduce without identity
 Script terminated.
 }}}
 1) Platform details: numpy 1.4.0, MPL 0.99.0, python 2.5.4, 32 bit Vista
 Home Premium SP2

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


More information about the NumPy-Tickets mailing list