Skip to content

Commit

Permalink
Merge pull request #78 from leon-k-martin/master
Browse files Browse the repository at this point in the history
Fix: Properly Parse 'symbol' and 'description' Attributes in LEMS Constant Element
  • Loading branch information
pgleeson authored Feb 6, 2024
2 parents db26c2b + 20c0cb3 commit 1296b5c
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 1296b5c

Please sign in to comment.