Skip to content

Commit

Permalink
FIX: Add symbol attribute to Constant class constructor to fix false …
Browse files Browse the repository at this point in the history
…assigment of description to the symbol attribute.
  • Loading branch information
leon-k-martin committed Jan 30, 2024
1 parent 373a259 commit 20c0cb3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lems/parser/LEMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,14 @@ def parse_constant(self, node):
else:
description = None

constant = Constant(name, value, dimension, description)
if "symbol" in node.lattrib:
symbol = node.lattrib["symbol"]
else:
symbol = None

constant = Constant(
name, value, dimension=dimension, description=description, symbol=symbol
)

if self.current_component_type:
self.current_component_type.add_constant(constant)
Expand Down

0 comments on commit 20c0cb3

Please sign in to comment.