[Numpy-discussion] numpy.test(): invalid value encountered in {isinf, divide, power, ...}

Pauli Virtanen pav+sp at iki.fi
Thu Jan 21 05:17:17 EST 2010

Thu, 21 Jan 2010 19:03:06 +0900, David Cournapeau wrote:
> On Thu, Jan 21, 2010 at 6:23 PM, Pauli Virtanen <pav+sp at iki.fi> wrote:
>> Wed, 20 Jan 2010 16:57:01 -0500, Darren Dale wrote: [clip]
>>> Warning: invalid value encountered in isinf Warning: invalid value
>>> encountered in isfinite
>> [clip]
>> This is because of changed seterr() default values.
>> IMHO, the 'print' default is slightly worse than the previous 'ignore'.
>> Personally, I don't see great value in the "invalid value encountered"
>> reports that are appear every time a nan is generated...
> I thought it was agreed that the default would be changed to warnings
> for 1.5.0?

I'm not so sure whether that's the best choice either, although it's 
better than stderr, but maybe I'm in a minority. OTOH, for instance 
Matlab and Fortran do not warn about division by zero or invalid values.


More information about the NumPy-Discussion mailing list