[Numpy-tickets] [NumPy] #661: maximum handles nan improperly

NumPy numpy-tickets@scipy....
Thu Feb 21 04:42:35 CST 2008


#661: maximum handles nan improperly
--------------------+-------------------------------------------------------
 Reporter:  tmb     |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  normal  |   Milestone:  1.0.5   
Component:  Other   |     Version:  none    
 Severity:  normal  |    Keywords:          
--------------------+-------------------------------------------------------
 Reproduce by:

 >>> maximum(3,array([1,nan,3.0]))
 Warning: invalid value encountered in maximum
 array([ 3.        ,         nan,  3.        ])
 >>>

 Printing a warning is about the worst thing the system can do: the error
 message is not informative and it messes up interactive and CGI output.
 There is also no obvious way of disabling it, and the message doesn't even
 make it clear that it comes from numpy.maximum, leading people on a wild
 goose chase through their sources.

 The correct behavior would be either to raise an exception if the
 condition is detected, or to quietly carry out the operation.  I think the
 default should be to raise an exception, with an option to disable.

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/661>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list