MCPcopy Create free account
hub / github.com/NTNU-IHB/PythonFMU / Integer

Class Integer

pythonfmu/variables.py:139–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137
138
139class Integer(ScalarVariable):
140 def __init__(self, name: str, start: Optional[Any] = None, **kwargs):
141 super().__init__(name, **kwargs)
142 self.__attrs = {"start": start}
143
144 @property
145 def start(self) -> Optional[Any]:
146 return self.__attrs["start"]
147
148 @start.setter
149 def start(self, value: float):
150 self.__attrs["start"] = value
151
152 def to_xml(self) -> Element:
153 attrib = dict()
154 for key, value in self.__attrs.items():
155 if value is not None:
156 attrib[key] = str(value)
157 parent = super().to_xml()
158 SubElement(parent, "Integer", attrib)
159
160 return parent
161
162
163class Boolean(ScalarVariable):

Callers 4

test_Integer_constructorFunction · 0.90
test_Integer_to_xmlFunction · 0.90
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by 2

test_Integer_constructorFunction · 0.72
test_Integer_to_xmlFunction · 0.72