From 20c0cb36a3080dd86a6ec94d0ae74f49acf2b27c Mon Sep 17 00:00:00 2001 From: leon-k-martin Date: Tue, 30 Jan 2024 16:37:16 +0100 Subject: [PATCH] FIX: Add symbol attribute to Constant class constructor to fix false assigment of description to the symbol attribute. --- lems/parser/LEMS.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lems/parser/LEMS.py b/lems/parser/LEMS.py index 47158aa..b8b1d71 100644 --- a/lems/parser/LEMS.py +++ b/lems/parser/LEMS.py @@ -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)