Skip to content

Commit

Permalink
Merge pull request #482 from hadjimy/comparison_to_None_fix
Browse files Browse the repository at this point in the history
Fix warning about elementwise comparison to 'None'.
  • Loading branch information
ketch committed Dec 15, 2014
2 parents bff7e5e + 95b9f43 commit 40a7249
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/shallow_1d/test_sill.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -38,4 +38,4 @@ def sill_verify(claw):

if __name__=='__main__':
import nose
nose.main()
nose.main()
2 changes: 1 addition & 1 deletion src/pyclaw/classic/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 40a7249

Please sign in to comment.