Skip to content

Commit 668cc64

Browse files
committed
Merge pull request #27 from dokato/const_update
symbol argument added to Constant
2 parents ea00df5 + 32d1fc7 commit 668cc64

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lems/model/component.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class Constant(LEMSBase):
219219
Stores a constant specification.
220220
"""
221221

222-
def __init__(self, name, value, dimension = None, description = ''):
222+
def __init__(self, name, value, dimension = None, symbol = None, description = ''):
223223
"""
224224
Constructor.
225225
@@ -229,6 +229,10 @@ def __init__(self, name, value, dimension = None, description = ''):
229229
self.name = name
230230
""" Name of the constant.
231231
@type: str """
232+
233+
self.symbol = symbol
234+
""" Symbol of the constant.
235+
@type: str """
232236

233237
self.value = value
234238
""" Value of the constant.
@@ -253,6 +257,7 @@ def toxml(self):
253257

254258
return '<Constant' +\
255259
(' name = "{0}"'.format(self.name) if self.name else '') +\
260+
(' symbol = "{0}"'.format(self.symbol) if self.symbol else '') +\
256261
(' value = "{0}"'.format(self.value) if self.value else '') +\
257262
(' dimension = "{0}"'.format(self.dimension) if self.dimension else '') +\
258263
(' description = "{0}"'.format(self.description) if self.description else '') +\

0 commit comments

Comments
 (0)