Skip to content

Commit

Permalink
Fixes issue #62 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Letellier-Duchesne committed May 26, 2021
1 parent 35df41a commit b3a09a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions trnsystor/statement/equation.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ def from_symbolic_expression(cls, name, exp, *args, doc=None):
)
for i, arg in enumerate(sorted(exp.free_symbols, key=lambda sym: sym.name)):
new_symbol = args[i]
if isinstance(new_symbol, TypeVariable):
exp = exp.subs(arg, TypeVariableSymbol(new_symbol))
elif isinstance(new_symbol, (Equation, Constant)):
if isinstance(new_symbol, (Equation, Constant)):
exp = exp.subs(arg, Symbol(new_symbol.name))
elif isinstance(new_symbol, TypeVariable):
exp = exp.subs(arg, TypeVariableSymbol(new_symbol))
else:
exp = exp.subs(arg, Symbol(new_symbol))
return cls(name, exp, doc=doc)
Expand Down

0 comments on commit b3a09a1

Please sign in to comment.