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

NumPy numpy-tickets@scipy....
Thu Feb 21 19:41:11 CST 2008


#661: maximum handles nan improperly
--------------------+-------------------------------------------------------
 Reporter:  tmb     |        Owner:  somebody
     Type:  defect  |       Status:  closed  
 Priority:  normal  |    Milestone:  1.0.5   
Component:  Other   |      Version:  none    
 Severity:  normal  |   Resolution:  wontfix 
 Keywords:          |  
--------------------+-------------------------------------------------------
Changes (by rkern):

  * status:  new => closed
  * resolution:  => wontfix

Comment:

 You can control the behavior through {{{seterr()}}}.

 {{{

 In [25]: import numpy

 In [26]: numpy.seterr?
 Type:             function
 Base Class:       <type 'function'>
 Namespace:        Interactive
 File:             /Users/rkern/svn/numpy/numpy/core/numeric.py
 Definition:       numpy.seterr(all=None, divide=None, over=None,
 under=None, invalid=None)
 Docstring:
     Set how floating-point errors are handled.

     Valid values for each type of error are the strings
     "ignore", "warn", "raise", and "call". Returns the old settings.
     If 'all' is specified, values that are not otherwise specified
     will be set to 'all', otherwise they will retain their old
     values.

     Note that operations on integer scalar types (such as int16) are
     handled like floating point, and are affected by these settings.

     Example:

     >>> seterr(over='raise') # doctest: +SKIP
     {'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore', 'under':
 'ignore'}

     >>> seterr(all='warn', over='raise') # doctest: +SKIP
     {'over': 'raise', 'divide': 'ignore', 'invalid': 'ignore', 'under':
 'ignore'}

     >>> int16(32000) * int16(3) # doctest: +SKIP
     Traceback (most recent call last):
           File "<stdin>", line 1, in ?
     FloatingPointError: overflow encountered in short_scalars
     >>> seterr(all='ignore') # doctest: +SKIP
     {'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore', 'under':
 'ignore'}
 }}}

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


More information about the Numpy-tickets mailing list