From 95b9f4395dbd2b5d5ae51c361b537acce152c919 Mon Sep 17 00:00:00 2001 From: Yiannis Hadjimichael Date: Fri, 12 Dec 2014 14:05:15 +0300 Subject: [PATCH] Fix warning about elementwise comparison to 'None'. --- examples/shallow_1d/test_sill.py | 4 ++-- src/pyclaw/classic/solver.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/shallow_1d/test_sill.py b/examples/shallow_1d/test_sill.py index 143571d3f..d7bc1876e 100644 --- a/examples/shallow_1d/test_sill.py +++ b/examples/shallow_1d/test_sill.py @@ -18,7 +18,7 @@ def sill_verify(claw): q0 = claw.frames[0].state.get_q_global() qfinal = claw.frames[claw.num_output_times].state.get_q_global() - if q0 != None and qfinal != None: + if q0 is not None and qfinal is not None: dx = claw.solution.domain.grid.delta[0] test = dx * np.linalg.norm(qfinal - q0, 1) return check_diff(expected, test, reltol=1e-4) @@ -38,4 +38,4 @@ def sill_verify(claw): if __name__=='__main__': import nose - nose.main() \ No newline at end of file + nose.main() diff --git a/src/pyclaw/classic/solver.py b/src/pyclaw/classic/solver.py index 95b6325cb..46e286985 100644 --- a/src/pyclaw/classic/solver.py +++ b/src/pyclaw/classic/solver.py @@ -636,7 +636,7 @@ def _allocate_workspace(self,solution): #with f2py. It involves wastefully allocating three arrays. #f2py seems not able to handle multiple zero-size arrays being passed. # it appears the bug is related to f2py/src/fortranobject.c line 841. - if(aux == None): num_aux=1 + if(aux is None): num_aux=1 grid = state.grid maxmx,maxmy,maxmz = grid.num_cells[0],grid.num_cells[1],grid.num_cells[2]