add short dict and getter in HS

setup.py
Theophile Terraz 2023-12-11 15:29:02 +01:00
parent d6561ab44d
commit 352c0beb27
2 changed files with 8 additions and 0 deletions

View File

@ -35,3 +35,8 @@ class NotDefined(BasicHS):
BHSValue("bar", float, 42.0),
BHSValue("baz", int, 13),
]
BHS_types = {
"ND": NotDefined,
}

View File

@ -233,6 +233,9 @@ class HydraulicStructure(SQLSubModel):
def basic_structures(self):
return self._data.copy()
def basic_structure(self, index: int):
return self._data[index]
def add(self, index: int):
value = NotDefined(status=self._status)
self._data.insert(index, value)