<br><br><div class="gmail_quote">On Fri, Jul 8, 2011 at 4:17 PM, Derek Homeier <span dir="ltr"><<a href="mailto:derek@astro.physik.uni-goettingen.de">derek@astro.physik.uni-goettingen.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 07.07.2011, at 7:16PM, Robert Pyle wrote:<br>
<br>
> .............../Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/numeric.py:1922: RuntimeWarning: invalid value encountered in absolute<br>
>  return all(less_equal(absolute(x-y), atol + rtol * absolute(y)))<br>
><br>
><br>
> Everything else completes with 3 KNOWNFAILs and 1 SKIP.  This warning is not new to this release; I've seen it before but haven't  tried tracking it down until today.<br>
><br>
> It arises in allclose().  The comments state "If either array contains NaN, then False is returned." but no test for NaN is done, and NaNs are indeed what cause the warning.<br>
><br>
> Inserting<br>
><br>
>    if any(isnan(x)) or any(isnan(y)):<br>
>        return False<br>
><br>
> before current line number 1916 in numeric.py seems to  fix it.<br>
<br>
</div>The same warning is still present in the current master, I just never paid attention to it because the tests still pass (it does correctly identify NaNs because they are not less_equal the tolerance), but of course this should be properly fixed as you suggest.<br>

<br></blockquote><div>Under Python 2.6 I used to see this but it has disappeared. What's going on here?<br><br>$ python2.7<br>>>> from numpy import *<br>>>> absolute(nan)<br>__main__:1: RuntimeWarning: invalid value encountered in absolute<br>
nan<br><br>$ python2.6<br>>>> from numpy import *<br>>>> absolute(nan)<br>nan<br><br>Ralf<br><br></div></div>