mailRe: RelaxWarning: comparison to `None` will result in an elementwise object comparison in the future


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on October 16, 2015 - 14:55:
On 11 October 2015 at 19:32, Sze Chan <samuelsw.chan@xxxxxxxxxxxxxxxx> wrote:
RelaxWarning: comparison to `None` will result in an elementwise object 
comparison in the future.

Hi Sam,

This warning is due to something called a FutureWarning which was
introduced into numpy >= 1.9.  It looks like the numpy would like to
change how '==' operates on their numpy arrays.  So the previous relax
code was of the form:

    if vector == None:

This used to work and was good for checking if we had set a value.
However the numpy people would like us to now instead use:

    if vector is None:

I am running the test suite now with Python 3.5 and numpy 1.9.2, using:

$ python3.5 relax -x -d --tee test_suite.log --traceback

That way I can find all such warnings and replace '==' with 'is' and
silence them all.  However as I mentioned in the other email, this is
not the problem you are having with the analysis.  Thanks for pointing
it out though, the fixes I'll make here will allow relax to continue
running with future numpy versions.

Cheers,

Edward



Related Messages


Powered by MHonArc, Updated Sun Oct 18 06:40:13 2015