@@ -283,44 +283,6 @@ def definition(self) -> OMCSessionRunData:
283283
284284 return omc_run_data_updated
285285
286- @staticmethod
287- def parse_simflags (simflags : str ) -> dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]:
288- """
289- Parse a simflag definition; this is deprecated!
290-
291- The return data can be used as input for self.args_set().
292- """
293- warnings .warn ("The argument 'simflags' is depreciated and will be removed in future versions; "
294- "please use 'simargs' instead" , DeprecationWarning , stacklevel = 2 )
295-
296- simargs : dict [str , Optional [str | dict [str , Any ] | numbers .Number ]] = {}
297-
298- args = [s for s in simflags .split (' ' ) if s ]
299- for arg in args :
300- if arg [0 ] != '-' :
301- raise ModelicaSystemError (f"Invalid simulation flag: { arg } " )
302- arg = arg [1 :]
303- parts = arg .split ('=' )
304- if len (parts ) == 1 :
305- simargs [parts [0 ]] = None
306- elif parts [0 ] == 'override' :
307- override = '=' .join (parts [1 :])
308-
309- override_dict = {}
310- for item in override .split (',' ):
311- kv = item .split ('=' )
312- if not 0 < len (kv ) < 3 :
313- raise ModelicaSystemError (f"Invalid value for '-override': { override } " )
314- if kv [0 ]:
315- try :
316- override_dict [kv [0 ]] = kv [1 ]
317- except (KeyError , IndexError ) as ex :
318- raise ModelicaSystemError (f"Invalid value for '-override': { override } " ) from ex
319-
320- simargs [parts [0 ]] = override_dict
321-
322- return simargs
323-
324286
325287class ModelicaSystem :
326288 """
@@ -1052,7 +1014,6 @@ def getOptimizationOptions(
10521014 def simulate_cmd (
10531015 self ,
10541016 result_file : OMCPath ,
1055- simflags : Optional [str ] = None ,
10561017 simargs : Optional [dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]] = None ,
10571018 timeout : Optional [float ] = None ,
10581019 ) -> ModelicaSystemCmd :
@@ -1066,13 +1027,6 @@ def simulate_cmd(
10661027 However, if only non-structural parameters are used, it is possible to reuse an existing instance of
10671028 ModelicaSystem to create several version ModelicaSystemCmd to run the model using different settings.
10681029
1069- Parameters
1070- ----------
1071- result_file
1072- simflags
1073- simargs
1074- timeout
1075-
10761030 Returns
10771031 -------
10781032 An instance if ModelicaSystemCmd to run the requested simulation.
@@ -1088,11 +1042,7 @@ def simulate_cmd(
10881042 # always define the result file to use
10891043 om_cmd .arg_set (key = "r" , val = result_file .as_posix ())
10901044
1091- # allow runtime simulation flags from user input
1092- if simflags is not None :
1093- om_cmd .args_set (args = om_cmd .parse_simflags (simflags = simflags ))
1094-
1095- if simargs :
1045+ if simargs is not None :
10961046 om_cmd .args_set (args = simargs )
10971047
10981048 if self ._override_variables or self ._simulate_options_override :
@@ -1130,7 +1080,6 @@ def simulate_cmd(
11301080 def simulate (
11311081 self ,
11321082 resultfile : Optional [str | os .PathLike ] = None ,
1133- simflags : Optional [str ] = None ,
11341083 simargs : Optional [dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]] = None ,
11351084 timeout : Optional [float ] = None ,
11361085 ) -> None :
@@ -1140,8 +1089,6 @@ def simulate(
11401089
11411090 Args:
11421091 resultfile: Path to a custom result file
1143- simflags: String of extra command line flags for the model binary.
1144- This argument is deprecated, use simargs instead.
11451092 simargs: Dict with simulation runtime flags.
11461093 timeout: Maximum execution time in seconds.
11471094
@@ -1169,7 +1116,6 @@ def simulate(
11691116
11701117 om_cmd = self .simulate_cmd (
11711118 result_file = self ._result_file ,
1172- simflags = simflags ,
11731119 simargs = simargs ,
11741120 timeout = timeout ,
11751121 )
@@ -1681,7 +1627,6 @@ def optimize(self) -> dict[str, Any]:
16811627 def linearize (
16821628 self ,
16831629 lintime : Optional [float ] = None ,
1684- simflags : Optional [str ] = None ,
16851630 simargs : Optional [dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]] = None ,
16861631 timeout : Optional [float ] = None ,
16871632 ) -> LinearizationResult :
@@ -1691,8 +1636,6 @@ def linearize(
16911636
16921637 Args:
16931638 lintime: Override "stopTime" value.
1694- simflags: String of extra command line flags for the model binary.
1695- This argument is deprecated, use simargs instead.
16961639 simargs: A dict with command line flags and possible options; example: "simargs={'csvInput': 'a.csv'}"
16971640 timeout: Maximum execution time in seconds.
16981641
@@ -1740,11 +1683,7 @@ def linearize(
17401683
17411684 om_cmd .arg_set (key = "l" , val = str (lintime or self ._linearization_options ["stopTime" ]))
17421685
1743- # allow runtime simulation flags from user input
1744- if simflags is not None :
1745- om_cmd .args_set (args = om_cmd .parse_simflags (simflags = simflags ))
1746-
1747- if simargs :
1686+ if simargs is not None :
17481687 om_cmd .args_set (args = simargs )
17491688
17501689 # the file create by the model executable which contains the matrix and linear inputs, outputs and states
0 commit comments