@@ -271,44 +271,6 @@ def definition(self) -> OMCSessionRunData:
271271
272272 return omc_run_data_updated
273273
274- @staticmethod
275- def parse_simflags (simflags : str ) -> dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]:
276- """
277- Parse a simflag definition; this is deprecated!
278-
279- The return data can be used as input for self.args_set().
280- """
281- warnings .warn ("The argument 'simflags' is depreciated and will be removed in future versions; "
282- "please use 'simargs' instead" , DeprecationWarning , stacklevel = 2 )
283-
284- simargs : dict [str , Optional [str | dict [str , Any ] | numbers .Number ]] = {}
285-
286- args = [s for s in simflags .split (' ' ) if s ]
287- for arg in args :
288- if arg [0 ] != '-' :
289- raise ModelicaSystemError (f"Invalid simulation flag: { arg } " )
290- arg = arg [1 :]
291- parts = arg .split ('=' )
292- if len (parts ) == 1 :
293- simargs [parts [0 ]] = None
294- elif parts [0 ] == 'override' :
295- override = '=' .join (parts [1 :])
296-
297- override_dict = {}
298- for item in override .split (',' ):
299- kv = item .split ('=' )
300- if not 0 < len (kv ) < 3 :
301- raise ModelicaSystemError (f"Invalid value for '-override': { override } " )
302- if kv [0 ]:
303- try :
304- override_dict [kv [0 ]] = kv [1 ]
305- except (KeyError , IndexError ) as ex :
306- raise ModelicaSystemError (f"Invalid value for '-override': { override } " ) from ex
307-
308- simargs [parts [0 ]] = override_dict
309-
310- return simargs
311-
312274
313275class ModelicaSystem :
314276 def __init__ (
@@ -979,7 +941,6 @@ def getOptimizationOptions(self, names: Optional[str | list[str]] = None) -> dic
979941 def simulate_cmd (
980942 self ,
981943 result_file : OMCPath ,
982- simflags : Optional [str ] = None ,
983944 simargs : Optional [dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]] = None ,
984945 timeout : Optional [float ] = None ,
985946 ) -> ModelicaSystemCmd :
@@ -993,13 +954,6 @@ def simulate_cmd(
993954 However, if only non-structural parameters are used, it is possible to reuse an existing instance of
994955 ModelicaSystem to create several version ModelicaSystemCmd to run the model using different settings.
995956
996- Parameters
997- ----------
998- result_file
999- simflags
1000- simargs
1001- timeout
1002-
1003957 Returns
1004958 -------
1005959 An instance if ModelicaSystemCmd to run the requested simulation.
@@ -1015,11 +969,7 @@ def simulate_cmd(
1015969 # always define the result file to use
1016970 om_cmd .arg_set (key = "r" , val = result_file .as_posix ())
1017971
1018- # allow runtime simulation flags from user input
1019- if simflags is not None :
1020- om_cmd .args_set (args = om_cmd .parse_simflags (simflags = simflags ))
1021-
1022- if simargs :
972+ if simargs is not None :
1023973 om_cmd .args_set (args = simargs )
1024974
1025975 if self ._override_variables or self ._simulate_options_override :
@@ -1058,7 +1008,6 @@ def simulate_cmd(
10581008 def simulate (
10591009 self ,
10601010 resultfile : Optional [str ] = None ,
1061- simflags : Optional [str ] = None ,
10621011 simargs : Optional [dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]] = None ,
10631012 timeout : Optional [float ] = None ,
10641013 ) -> None :
@@ -1068,8 +1017,6 @@ def simulate(
10681017
10691018 Args:
10701019 resultfile: Path to a custom result file
1071- simflags: String of extra command line flags for the model binary.
1072- This argument is deprecated, use simargs instead.
10731020 simargs: Dict with simulation runtime flags.
10741021 timeout: Maximum execution time in seconds.
10751022
@@ -1095,7 +1042,6 @@ def simulate(
10951042
10961043 om_cmd = self .simulate_cmd (
10971044 result_file = self ._result_file ,
1098- simflags = simflags ,
10991045 simargs = simargs ,
11001046 timeout = timeout ,
11011047 )
@@ -1623,7 +1569,6 @@ def optimize(self) -> dict[str, Any]:
16231569 def linearize (
16241570 self ,
16251571 lintime : Optional [float ] = None ,
1626- simflags : Optional [str ] = None ,
16271572 simargs : Optional [dict [str , Optional [str | dict [str , Any ] | numbers .Number ]]] = None ,
16281573 timeout : Optional [float ] = None ,
16291574 ) -> LinearizationResult :
@@ -1633,8 +1578,6 @@ def linearize(
16331578
16341579 Args:
16351580 lintime: Override "stopTime" value.
1636- simflags: String of extra command line flags for the model binary.
1637- This argument is deprecated, use simargs instead.
16381581 simargs: A dict with command line flags and possible options; example: "simargs={'csvInput': 'a.csv'}"
16391582 timeout: Maximum execution time in seconds.
16401583
@@ -1683,11 +1626,7 @@ def linearize(
16831626
16841627 om_cmd .arg_set (key = "l" , val = str (lintime or self ._linearization_options ["stopTime" ]))
16851628
1686- # allow runtime simulation flags from user input
1687- if simflags is not None :
1688- om_cmd .args_set (args = om_cmd .parse_simflags (simflags = simflags ))
1689-
1690- if simargs :
1629+ if simargs is not None :
16911630 om_cmd .args_set (args = simargs )
16921631
16931632 # the file create by the model executable which contains the matrix and linear inputs, outputs and states
0 commit comments