Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions OMPython/ModelicaSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,13 @@ def __init__(
session: OMCSessionZMQ,
runpath: OMCPath,
modelname: Optional[str] = None,
timeout: Optional[float] = None,
) -> None:
if modelname is None:
raise ModelicaSystemError("Missing model name!")

self._session = session
self._runpath = runpath
self._model_name = modelname
self._timeout = timeout

# dictionaries of command line arguments for the model executable
self._args: dict[str, str | None] = {}
Expand Down Expand Up @@ -278,7 +276,6 @@ def definition(self) -> OMCSessionRunData:
cmd_model_name=self._model_name,
cmd_args=self.get_cmd_args(),
cmd_result_path=result_file,
cmd_timeout=self._timeout,
)

omc_run_data_updated = self._session.omc_run_data_update(
Expand Down Expand Up @@ -575,7 +572,6 @@ def buildModel(self, variableFilter: Optional[str] = None):
session=self._session,
runpath=self.getWorkDirectory(),
modelname=self._model_name,
timeout=5.0,
)
# ... by running it - output help for command help
om_cmd.arg_set(key="help", val="help")
Expand Down Expand Up @@ -1058,7 +1054,6 @@ def simulate_cmd(
result_file: OMCPath,
simflags: Optional[str] = None,
simargs: Optional[dict[str, Optional[str | dict[str, Any] | numbers.Number]]] = None,
timeout: Optional[float] = None,
) -> ModelicaSystemCmd:
"""
This method prepares the simulates model according to the simulation options. It returns an instance of
Expand All @@ -1075,7 +1070,6 @@ def simulate_cmd(
result_file
simflags
simargs
timeout

Returns
-------
Expand All @@ -1086,7 +1080,6 @@ def simulate_cmd(
session=self._session,
runpath=self.getWorkDirectory(),
modelname=self._model_name,
timeout=timeout,
)

# always define the result file to use
Expand Down Expand Up @@ -1136,7 +1129,6 @@ def simulate(
resultfile: Optional[str | os.PathLike] = None,
simflags: Optional[str] = None,
simargs: Optional[dict[str, Optional[str | dict[str, Any] | numbers.Number]]] = None,
timeout: Optional[float] = None,
) -> None:
"""Simulate the model according to simulation options.

Expand All @@ -1147,7 +1139,6 @@ def simulate(
simflags: String of extra command line flags for the model binary.
This argument is deprecated, use simargs instead.
simargs: Dict with simulation runtime flags.
timeout: Maximum execution time in seconds.

Examples:
mod.simulate()
Expand Down Expand Up @@ -1175,7 +1166,6 @@ def simulate(
result_file=self._result_file,
simflags=simflags,
simargs=simargs,
timeout=timeout,
)

# delete resultfile ...
Expand Down Expand Up @@ -1759,7 +1749,6 @@ def linearize(
lintime: Optional[float] = None,
simflags: Optional[str] = None,
simargs: Optional[dict[str, Optional[str | dict[str, Any] | numbers.Number]]] = None,
timeout: Optional[float] = None,
) -> LinearizationResult:
"""Linearize the model according to linearization options.

Expand All @@ -1770,7 +1759,6 @@ def linearize(
simflags: String of extra command line flags for the model binary.
This argument is deprecated, use simargs instead.
simargs: A dict with command line flags and possible options; example: "simargs={'csvInput': 'a.csv'}"
timeout: Maximum execution time in seconds.

Returns:
A LinearizationResult object is returned. This allows several
Expand All @@ -1792,7 +1780,6 @@ def linearize(
session=self._session,
runpath=self.getWorkDirectory(),
modelname=self._model_name,
timeout=timeout,
)

override_content = (
Expand Down Expand Up @@ -1971,7 +1958,6 @@ def __init__(
# simulation specific input
# TODO: add more settings (simulation options, input options, ...)
simargs: Optional[dict[str, Optional[str | dict[str, str] | numbers.Number]]] = None,
timeout: Optional[int] = None,
# DoE specific inputs
resultpath: Optional[str | os.PathLike] = None,
parameters: Optional[dict[str, list[str] | list[int] | list[float]]] = None,
Expand Down Expand Up @@ -2000,7 +1986,6 @@ def __init__(
self._model_name = model_name

self._simargs = simargs
self._timeout = timeout

if resultpath is None:
self._resultpath = self.session().omcpath_tempdir()
Expand Down Expand Up @@ -2103,7 +2088,6 @@ def prepare(self) -> int:
self._mod.setParameters(sim_param_non_structural)
mscmd = self._mod.simulate_cmd(
result_file=resultfile,
timeout=self._timeout,
)
if self._simargs is not None:
mscmd.args_set(args=self._simargs)
Expand Down