Skip to content

Commit d58f583

Browse files
committed
[ModelicaSystem*] remove timeout variable(s)
1 parent d37ec0b commit d58f583

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

OMPython/ModelicaSystem.py

Lines changed: 1 addition & 20 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(
@@ -337,7 +334,6 @@ def __init__(
337334
work_directory: Optional[str | os.PathLike] = None,
338335
omhome: Optional[str] = None,
339336
omc_process: Optional[OMCProcess] = None,
340-
timeout: float = 10.0,
341337
) -> None:
342338
"""Create a ModelicaSystem instance. To define the model use model() or convertFmu2Mo().
343339
@@ -351,7 +347,6 @@ def __init__(
351347
omhome: path to OMC to be used when creating the OMC session (see OMCSessionZMQ).
352348
omc_process: definition of a (local) OMC process to be used. If
353349
unspecified, a new local session will be created.
354-
timeout: float value to define the timeout; if nothing is defined, a default value of 10s is used
355350
"""
356351

357352
self._quantities: list[dict[str, Any]] = []
@@ -381,7 +376,7 @@ def __init__(
381376
if omc_process is not None:
382377
self._session = OMCSessionZMQ(omc_process=omc_process)
383378
else:
384-
self._session = OMCSessionZMQ(omhome=omhome, timeout=timeout)
379+
self._session = OMCSessionZMQ(omhome=omhome)
385380

386381
# set commandLineOptions using default values or the user defined list
387382
if command_line_options is None:
@@ -577,7 +572,6 @@ def buildModel(self, variableFilter: Optional[str] = None):
577572
session=self._session,
578573
runpath=self.getWorkDirectory(),
579574
modelname=self._model_name,
580-
timeout=5.0,
581575
)
582576
# ... by running it - output help for command help
583577
om_cmd.arg_set(key="help", val="help")
@@ -1060,7 +1054,6 @@ def simulate_cmd(
10601054
result_file: OMCPath,
10611055
simflags: Optional[str] = None,
10621056
simargs: Optional[dict[str, Optional[str | dict[str, Any] | numbers.Number]]] = None,
1063-
timeout: Optional[float] = None,
10641057
) -> ModelicaSystemCmd:
10651058
"""
10661059
This method prepares the simulates model according to the simulation options. It returns an instance of
@@ -1077,7 +1070,6 @@ def simulate_cmd(
10771070
result_file
10781071
simflags
10791072
simargs
1080-
timeout
10811073
10821074
Returns
10831075
-------
@@ -1088,7 +1080,6 @@ def simulate_cmd(
10881080
session=self._session,
10891081
runpath=self.getWorkDirectory(),
10901082
modelname=self._model_name,
1091-
timeout=timeout,
10921083
)
10931084

10941085
# always define the result file to use
@@ -1138,7 +1129,6 @@ def simulate(
11381129
resultfile: Optional[str | os.PathLike] = None,
11391130
simflags: Optional[str] = None,
11401131
simargs: Optional[dict[str, Optional[str | dict[str, Any] | numbers.Number]]] = None,
1141-
timeout: Optional[float] = None,
11421132
) -> None:
11431133
"""Simulate the model according to simulation options.
11441134
@@ -1149,7 +1139,6 @@ def simulate(
11491139
simflags: String of extra command line flags for the model binary.
11501140
This argument is deprecated, use simargs instead.
11511141
simargs: Dict with simulation runtime flags.
1152-
timeout: Maximum execution time in seconds.
11531142
11541143
Examples:
11551144
mod.simulate()
@@ -1177,7 +1166,6 @@ def simulate(
11771166
result_file=self._result_file,
11781167
simflags=simflags,
11791168
simargs=simargs,
1180-
timeout=timeout,
11811169
)
11821170

11831171
# delete resultfile ...
@@ -1761,7 +1749,6 @@ def linearize(
17611749
lintime: Optional[float] = None,
17621750
simflags: Optional[str] = None,
17631751
simargs: Optional[dict[str, Optional[str | dict[str, Any] | numbers.Number]]] = None,
1764-
timeout: Optional[float] = None,
17651752
) -> LinearizationResult:
17661753
"""Linearize the model according to linearization options.
17671754
@@ -1772,7 +1759,6 @@ def linearize(
17721759
simflags: String of extra command line flags for the model binary.
17731760
This argument is deprecated, use simargs instead.
17741761
simargs: A dict with command line flags and possible options; example: "simargs={'csvInput': 'a.csv'}"
1775-
timeout: Maximum execution time in seconds.
17761762
17771763
Returns:
17781764
A LinearizationResult object is returned. This allows several
@@ -1794,7 +1780,6 @@ def linearize(
17941780
session=self._session,
17951781
runpath=self.getWorkDirectory(),
17961782
modelname=self._model_name,
1797-
timeout=timeout,
17981783
)
17991784

18001785
override_content = (
@@ -1970,7 +1955,6 @@ def __init__(
19701955
work_directory: Optional[str | os.PathLike] = None,
19711956
omhome: Optional[str] = None,
19721957
omc_process: Optional[OMCProcess] = None,
1973-
timeout: float = 10.0,
19741958
# simulation specific input
19751959
# TODO: add more settings (simulation options, input options, ...)
19761960
simargs: Optional[dict[str, Optional[str | dict[str, str] | numbers.Number]]] = None,
@@ -1991,7 +1975,6 @@ def __init__(
19911975
work_directory=work_directory,
19921976
omhome=omhome,
19931977
omc_process=omc_process,
1994-
timeout=timeout,
19951978
)
19961979
self._mod.model(
19971980
model_file=model_file,
@@ -2003,7 +1986,6 @@ def __init__(
20031986
self._model_name = model_name
20041987

20051988
self._simargs = simargs
2006-
self._timeout = timeout
20071989

20081990
if resultpath is None:
20091991
self._resultpath = self.session().omcpath_tempdir()
@@ -2106,7 +2088,6 @@ def prepare(self) -> int:
21062088
self._mod.setParameters(sim_param_non_structural)
21072089
mscmd = self._mod.simulate_cmd(
21082090
result_file=resultfile,
2109-
timeout=self._timeout,
21102091
)
21112092
if self._simargs is not None:
21122093
mscmd.args_set(args=self._simargs)

0 commit comments

Comments
 (0)