Skip to content

Commit 2034fc0

Browse files
committed
[ModelicaSystem] split __init__() - mypy fix in ModelicaSystemCmd
1 parent 6c44d13 commit 2034fc0

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

OMPython/ModelicaSystem.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,15 @@ def __getitem__(self, index: int):
114114
class ModelicaSystemCmd:
115115
"""A compiled model executable."""
116116

117-
def __init__(self, runpath: pathlib.Path, modelname: str, timeout: Optional[float] = None) -> None:
117+
def __init__(
118+
self,
119+
runpath: pathlib.Path,
120+
modelname: Optional[str] = None,
121+
timeout: Optional[float] = None,
122+
) -> None:
123+
if modelname is None:
124+
raise ModelicaSystemError("Missing model name!")
125+
118126
self._runpath = pathlib.Path(runpath).resolve().absolute()
119127
self._model_name = modelname
120128
self._timeout = timeout

0 commit comments

Comments
 (0)