Skip to content

Commit

Permalink
Cast --inline bool results back to bool. Fixes ticket:453
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://code.matforge.org/fipy/branches/ticket453@5272 d80e17d7-ff13-0410-a124-85740d801063
  • Loading branch information
guyer committed Aug 9, 2012
1 parent 5ae3485 commit 95b58d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fipy/variables/constraintMask.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, var):
def _calcValue(self):
returnMask = numerix.zeros(self.shape, dtype=bool)
for constraint in self.var.constraints:
returnMask = returnMask | numerix.asarray(constraint.where, dtype=bool)
returnMask = returnMask | numerix.asarray(constraint.where)
return returnMask

return _ConstraintMaskVariable(var)
3 changes: 3 additions & 0 deletions fipy/variables/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,9 @@ def _execInline(self, comment=None):

if resultShape == ():
argDict['result'] = numerix.reshape(argDict['result'], resultShape)

if self.getsctype() == numerix.bool_:
argDict['result'] = numerix.asarray(argDict['result'], dtype=self.getsctype())

return argDict['result']

Expand Down

0 comments on commit 95b58d3

Please sign in to comment.