Skip to content

Commit

Permalink
Re-add correct handling of booleans for sympy
Browse files Browse the repository at this point in the history
  • Loading branch information
mstimberg committed Aug 3, 2023
1 parent ce74a97 commit d529c9c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions brian2/parsing/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ def render_Name(self, node):
else:
return sympy.Symbol(node.id, real=True)

def render_NameConstant(self, node):
if node.value in [True, False]:
return node.value
else:
return str(node.value)

def render_Num(self, node):
if isinstance(get_node_value(node), numbers.Integral):
return sympy.Integer(get_node_value(node))
Expand Down

0 comments on commit d529c9c

Please sign in to comment.