Skip to content

Commit 43530b9

Browse files
committed
[ModelicaDoERunner] fix definition; allow all variations of ModelicaSystem*
1 parent 1aa0990 commit 43530b9

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,16 +2646,16 @@ class ModelicaDoERunner(ModelicaDoEABC):
26462646
def __init__(
26472647
self,
26482648
# ModelicaSystem definition to use
2649-
mod: ModelicaSystemOMC,
2649+
mod: ModelicaSystemABC,
26502650
# simulation specific input
26512651
# TODO: add more settings (simulation options, input options, ...)
26522652
simargs: Optional[dict[str, Optional[str | dict[str, str] | numbers.Number]]] = None,
26532653
# DoE specific inputs
26542654
resultpath: Optional[str | os.PathLike] = None,
26552655
parameters: Optional[dict[str, list[str] | list[int] | list[float]]] = None,
26562656
) -> None:
2657-
if not isinstance(mod, ModelicaSystemRunner):
2658-
raise ModelicaSystemError(f"Invalid definition for mod: {type(mod)} - expect ModelicaSystemOMC!")
2657+
if not isinstance(mod, ModelicaSystemABC):
2658+
raise ModelicaSystemError(f"Invalid definition for ModelicaSystem*: {type(mod)}!")
26592659

26602660
super().__init__(
26612661
mod=mod,
@@ -2670,5 +2670,8 @@ def _prepare_structure_parameters(
26702670
pc_structure: Tuple,
26712671
param_structure: dict[str, list[str] | list[int] | list[float]],
26722672
) -> dict[str, str | int | float]:
2673-
raise ModelicaSystemError(f"{self.__class__.__name__} can not handle structure parameters as it uses a "
2674-
"pre-compiled binary of model.")
2673+
if len(param_structure.keys()) > 0:
2674+
raise ModelicaSystemError(f"{self.__class__.__name__} can not handle structure parameters as it uses a "
2675+
"pre-compiled binary of model.")
2676+
2677+
return {}

0 commit comments

Comments
 (0)