Skip to content

Commit 5b10515

Browse files
syntronadeas31
andauthored
[ModelicaSystem*] remove all timeouts (#383)
* [ModelicaSystem*] add timeout argument * [ModelicaSystem*] remove timeout variable(s) --------- Co-authored-by: Adeel Asghar <adeel.asghar@liu.se>
1 parent d590e64 commit 5b10515

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

OMPython/ModelicaSystem.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,13 @@ def __init__(
130130
session: OMCSessionZMQ,
131131
runpath: OMCPath,
132132
modelname: Optional[str] = None,
133-
timeout: Optional[float] = None,
134133
) -> None:
135134
if modelname is None:
136135
raise ModelicaSystemError("Missing model name!")
137136

138137
self._session = session
139138
self._runpath = runpath
140139
self._model_name = modelname
141-
self._timeout = timeout
142140

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

284281
omc_run_data_updated = self._session.omc_run_data_update(
@@ -575,7 +572,6 @@ def buildModel(self, variableFilter: Optional[str] = None):
575572
session=self._session,
576573
runpath=self.getWorkDirectory(),
577574
modelname=self._model_name,
578-
timeout=5.0,
579575
)
580576
# ... by running it - output help for command help
581577
om_cmd.arg_set(key="help", val="help")
@@ -1058,7 +1054,6 @@ def simulate_cmd(
10581054
result_file: OMCPath,
10591055
simflags: Optional[str] = None,
10601056
simargs: Optional[dict[str, Optional[str | dict[str, Any] | numbers.Number]]] = None,
1061-
timeout: Optional[float] = None,
10621057
) -> ModelicaSystemCmd:
10631058
"""
10641059
This method prepares the simulates model according to the simulation options. It returns an instance of
@@ -1075,7 +1070,6 @@ def simulate_cmd(
10751070
result_file
10761071
simflags
10771072
simargs
1078-
timeout
10791073
10801074
Returns
10811075
-------
@@ -1086,7 +1080,6 @@ def simulate_cmd(
10861080
session=self._session,
10871081
runpath=self.getWorkDirectory(),
10881082
modelname=self._model_name,
1089-
timeout=timeout,
10901083
)
10911084

10921085
# always define the result file to use
@@ -1136,7 +1129,6 @@ def simulate(
11361129
resultfile: Optional[str | os.PathLike] = None,
11371130
simflags: Optional[str] = None,
11381131
simargs: Optional[dict[str, Optional[str | dict[str, Any] | numbers.Number]]] = None,
1139-
timeout: Optional[float] = None,
11401132
) -> None:
11411133
"""Simulate the model according to simulation options.
11421134
@@ -1147,7 +1139,6 @@ def simulate(
11471139
simflags: String of extra command line flags for the model binary.
11481140
This argument is deprecated, use simargs instead.
11491141
simargs: Dict with simulation runtime flags.
1150-
timeout: Maximum execution time in seconds.
11511142
11521143
Examples:
11531144
mod.simulate()
@@ -1175,7 +1166,6 @@ def simulate(
11751166
result_file=self._result_file,
11761167
simflags=simflags,
11771168
simargs=simargs,
1178-
timeout=timeout,
11791169
)
11801170

11811171
# delete resultfile ...
@@ -1759,7 +1749,6 @@ def linearize(
17591749
lintime: Optional[float] = None,
17601750
simflags: Optional[str] = None,
17611751
simargs: Optional[dict[str, Optional[str | dict[str, Any] | numbers.Number]]] = None,
1762-
timeout: Optional[float] = None,
17631752
) -> LinearizationResult:
17641753
"""Linearize the model according to linearization options.
17651754
@@ -1770,7 +1759,6 @@ def linearize(
17701759
simflags: String of extra command line flags for the model binary.
17711760
This argument is deprecated, use simargs instead.
17721761
simargs: A dict with command line flags and possible options; example: "simargs={'csvInput': 'a.csv'}"
1773-
timeout: Maximum execution time in seconds.
17741762
17751763
Returns:
17761764
A LinearizationResult object is returned. This allows several
@@ -1792,7 +1780,6 @@ def linearize(
17921780
session=self._session,
17931781
runpath=self.getWorkDirectory(),
17941782
modelname=self._model_name,
1795-
timeout=timeout,
17961783
)
17971784

17981785
override_content = (
@@ -1971,7 +1958,6 @@ def __init__(
19711958
# simulation specific input
19721959
# TODO: add more settings (simulation options, input options, ...)
19731960
simargs: Optional[dict[str, Optional[str | dict[str, str] | numbers.Number]]] = None,
1974-
timeout: Optional[int] = None,
19751961
# DoE specific inputs
19761962
resultpath: Optional[str | os.PathLike] = None,
19771963
parameters: Optional[dict[str, list[str] | list[int] | list[float]]] = None,
@@ -2000,7 +1986,6 @@ def __init__(
20001986
self._model_name = model_name
20011987

20021988
self._simargs = simargs
2003-
self._timeout = timeout
20041989

20051990
if resultpath is None:
20061991
self._resultpath = self.session().omcpath_tempdir()
@@ -2103,7 +2088,6 @@ def prepare(self) -> int:
21032088
self._mod.setParameters(sim_param_non_structural)
21042089
mscmd = self._mod.simulate_cmd(
21052090
result_file=resultfile,
2106-
timeout=self._timeout,
21072091
)
21082092
if self._simargs is not None:
21092093
mscmd.args_set(args=self._simargs)

0 commit comments

Comments
 (0)