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

Class Boolean

pythonfmu/variables.py:163–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161
162
163class Boolean(ScalarVariable):
164 def __init__(self, name: str, start: Optional[Any] = None, **kwargs):
165 super().__init__(name, **kwargs)
166 self.__attrs = {"start": start}
167
168 @property
169 def start(self) -> Optional[Any]:
170 return self.__attrs["start"]
171
172 @start.setter
173 def start(self, value: float):
174 self.__attrs["start"] = value
175
176 def to_xml(self) -> Element:
177 attrib = dict()
178 for key, value in self.__attrs.items():
179 if value is not None:
180 attrib[key] = str(value).lower()
181 parent = super().to_xml()
182 SubElement(parent, "Boolean", attrib)
183
184 return parent
185
186
187class String(ScalarVariable):

Callers 3

test_Boolean_constructorFunction · 0.90
test_Boolean_to_xmlFunction · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by 2

test_Boolean_constructorFunction · 0.72
test_Boolean_to_xmlFunction · 0.72