@@ -287,44 +287,6 @@ def definition(self) -> OMCSessionRunData:
287287
288288 return omc_run_data_updated
289289
290- @staticmethod
291- def parse_simflags (simflags : str ) -> dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]:
292- """
293- Parse a simflag definition; this is deprecated!
294-
295- The return data can be used as input for self.args_set().
296- """
297- warnings .warn ("The argument 'simflags' is depreciated and will be removed in future versions; "
298- "please use 'simargs' instead" , DeprecationWarning , stacklevel = 2 )
299-
300- simargs : dict [str , Optional [str | dict [str , Any ] | numbers .Number ]] = {}
301-
302- args = [s for s in simflags .split (' ' ) if s ]
303- for arg in args :
304- if arg [0 ] != '-' :
305- raise ModelicaSystemError (f"Invalid simulation flag: { arg } " )
306- arg = arg [1 :]
307- parts = arg .split ('=' )
308- if len (parts ) == 1 :
309- simargs [parts [0 ]] = None
310- elif parts [0 ] == 'override' :
311- override = '=' .join (parts [1 :])
312-
313- override_dict = {}
314- for item in override .split (',' ):
315- kv = item .split ('=' )
316- if not 0 < len (kv ) < 3 :
317- raise ModelicaSystemError (f"Invalid value for '-override': { override } " )
318- if kv [0 ]:
319- try :
320- override_dict [kv [0 ]] = kv [1 ]
321- except (KeyError , IndexError ) as ex :
322- raise ModelicaSystemError (f"Invalid value for '-override': { override } " ) from ex
323-
324- simargs [parts [0 ]] = override_dict
325-
326- return simargs
327-
328290
329291class ModelicaSystem :
330292 """
@@ -1056,7 +1018,6 @@ def getOptimizationOptions(
10561018 def simulate_cmd (
10571019 self ,
10581020 result_file : OMCPath ,
1059- simflags : Optional [str ] = None ,
10601021 simargs : Optional [dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]] = None ,
10611022 timeout : Optional [float ] = None ,
10621023 ) -> ModelicaSystemCmd :
@@ -1070,13 +1031,6 @@ def simulate_cmd(
10701031 However, if only non-structural parameters are used, it is possible to reuse an existing instance of
10711032 ModelicaSystem to create several version ModelicaSystemCmd to run the model using different settings.
10721033
1073- Parameters
1074- ----------
1075- result_file
1076- simflags
1077- simargs
1078- timeout
1079-
10801034 Returns
10811035 -------
10821036 An instance if ModelicaSystemCmd to run the requested simulation.
@@ -1092,11 +1046,7 @@ def simulate_cmd(
10921046 # always define the result file to use
10931047 om_cmd .arg_set (key = "r" , val = result_file .as_posix ())
10941048
1095- # allow runtime simulation flags from user input
1096- if simflags is not None :
1097- om_cmd .args_set (args = om_cmd .parse_simflags (simflags = simflags ))
1098-
1099- if simargs :
1049+ if simargs is not None :
11001050 om_cmd .args_set (args = simargs )
11011051
11021052 if self ._override_variables or self ._simulate_options_override :
@@ -1134,7 +1084,6 @@ def simulate_cmd(
11341084 def simulate (
11351085 self ,
11361086 resultfile : Optional [str | os .PathLike ] = None ,
1137- simflags : Optional [str ] = None ,
11381087 simargs : Optional [dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]] = None ,
11391088 timeout : Optional [float ] = None ,
11401089 ) -> None :
@@ -1144,8 +1093,6 @@ def simulate(
11441093
11451094 Args:
11461095 resultfile: Path to a custom result file
1147- simflags: String of extra command line flags for the model binary.
1148- This argument is deprecated, use simargs instead.
11491096 simargs: Dict with simulation runtime flags.
11501097 timeout: Maximum execution time in seconds.
11511098
@@ -1173,7 +1120,6 @@ def simulate(
11731120
11741121 om_cmd = self .simulate_cmd (
11751122 result_file = self ._result_file ,
1176- simflags = simflags ,
11771123 simargs = simargs ,
11781124 timeout = timeout ,
11791125 )
@@ -1757,7 +1703,6 @@ def optimize(self) -> dict[str, Any]:
17571703 def linearize (
17581704 self ,
17591705 lintime : Optional [float ] = None ,
1760- simflags : Optional [str ] = None ,
17611706 simargs : Optional [dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]] = None ,
17621707 timeout : Optional [float ] = None ,
17631708 ) -> LinearizationResult :
@@ -1767,8 +1712,6 @@ def linearize(
17671712
17681713 Args:
17691714 lintime: Override "stopTime" value.
1770- simflags: String of extra command line flags for the model binary.
1771- This argument is deprecated, use simargs instead.
17721715 simargs: A dict with command line flags and possible options; example: "simargs={'csvInput': 'a.csv'}"
17731716 timeout: Maximum execution time in seconds.
17741717
@@ -1816,11 +1759,7 @@ def linearize(
18161759
18171760 om_cmd .arg_set (key = "l" , val = str (lintime or self ._linearization_options ["stopTime" ]))
18181761
1819- # allow runtime simulation flags from user input
1820- if simflags is not None :
1821- om_cmd .args_set (args = om_cmd .parse_simflags (simflags = simflags ))
1822-
1823- if simargs :
1762+ if simargs is not None :
18241763 om_cmd .args_set (args = simargs )
18251764
18261765 # the file create by the model executable which contains the matrix and linear inputs, outputs and states
0 commit comments