@@ -1140,7 +1140,6 @@ def getSolutions(
11401140
11411141 @staticmethod
11421142 def _prepare_input_data (
1143- input_args : Any ,
11441143 input_kwargs : dict [str , Any ],
11451144 ) -> dict [str , str ]:
11461145 """
@@ -1159,28 +1158,6 @@ def prepare_str(str_in: str) -> dict[str, str]:
11591158
11601159 input_data : dict [str , str ] = {}
11611160
1162- for input_arg in input_args :
1163- if isinstance (input_arg , str ):
1164- warnings .warn (message = "The definition of values to set should use a dictionary, "
1165- "i.e. {'key1': 'val1', 'key2': 'val2', ...}. Please convert all cases which "
1166- "use a string ('key=val') or list ['key1=val1', 'key2=val2', ...]" ,
1167- category = DeprecationWarning ,
1168- stacklevel = 3 )
1169- input_data = input_data | prepare_str (input_arg )
1170- elif isinstance (input_arg , list ):
1171- warnings .warn (message = "The definition of values to set should use a dictionary, "
1172- "i.e. {'key1': 'val1', 'key2': 'val2', ...}. Please convert all cases which "
1173- "use a string ('key=val') or list ['key1=val1', 'key2=val2', ...]" ,
1174- category = DeprecationWarning ,
1175- stacklevel = 3 )
1176-
1177- for item in input_arg :
1178- if not isinstance (item , str ):
1179- raise ModelicaSystemError (f"Invalid input data type for set*() function: { type (item )} !" )
1180- input_data = input_data | prepare_str (item )
1181- else :
1182- raise ModelicaSystemError (f"Invalid input data type for set*() function: { type (input_arg )} !" )
1183-
11841161 if len (input_kwargs ):
11851162 for key , val in input_kwargs .items ():
11861163 # ensure all values are strings to align it on one type: dict[str, str]
@@ -1254,21 +1231,15 @@ def isParameterChangeable(
12541231
12551232 def setContinuous (
12561233 self ,
1257- * args : Any ,
12581234 ** kwargs : dict [str , Any ],
12591235 ) -> bool :
12601236 """
1261- This method is used to set continuous values. It can be called:
1262- with a sequence of continuous name and assigning corresponding values as arguments as show in the example below:
1263- usage
1264- >>> setContinuous("Name=value") # depreciated
1265- >>> setContinuous(["Name1=value1","Name2=value2"]) # depreciated
1266-
1237+ This method is used to set continuous values.
12671238 >>> setContinuous(Name1="value1", Name2="value2")
12681239 >>> param = {"Name1": "value1", "Name2": "value2"}
12691240 >>> setContinuous(**param)
12701241 """
1271- inputdata = self ._prepare_input_data (input_args = args , input_kwargs = kwargs )
1242+ inputdata = self ._prepare_input_data (input_kwargs = kwargs )
12721243
12731244 return self ._set_method_helper (
12741245 inputdata = inputdata ,
@@ -1278,21 +1249,15 @@ def setContinuous(
12781249
12791250 def setParameters (
12801251 self ,
1281- * args : Any ,
12821252 ** kwargs : dict [str , Any ],
12831253 ) -> bool :
12841254 """
1285- This method is used to set parameter values. It can be called:
1286- with a sequence of parameter name and assigning corresponding value as arguments as show in the example below:
1287- usage
1288- >>> setParameters("Name=value") # depreciated
1289- >>> setParameters(["Name1=value1","Name2=value2"]) # depreciated
1290-
1255+ This method is used to set parameter values.
12911256 >>> setParameters(Name1="value1", Name2="value2")
12921257 >>> param = {"Name1": "value1", "Name2": "value2"}
12931258 >>> setParameters(**param)
12941259 """
1295- inputdata = self ._prepare_input_data (input_args = args , input_kwargs = kwargs )
1260+ inputdata = self ._prepare_input_data (input_kwargs = kwargs )
12961261
12971262 return self ._set_method_helper (
12981263 inputdata = inputdata ,
@@ -1302,21 +1267,15 @@ def setParameters(
13021267
13031268 def setSimulationOptions (
13041269 self ,
1305- * args : Any ,
13061270 ** kwargs : dict [str , Any ],
13071271 ) -> bool :
13081272 """
1309- This method is used to set simulation options. It can be called:
1310- with a sequence of simulation options name and assigning corresponding values as arguments as show in the example below:
1311- usage
1312- >>> setSimulationOptions("Name=value") # depreciated
1313- >>> setSimulationOptions(["Name1=value1","Name2=value2"]) # depreciated
1314-
1273+ This method is used to set simulation options.
13151274 >>> setSimulationOptions(Name1="value1", Name2="value2")
13161275 >>> param = {"Name1": "value1", "Name2": "value2"}
13171276 >>> setSimulationOptions(**param)
13181277 """
1319- inputdata = self ._prepare_input_data (input_args = args , input_kwargs = kwargs )
1278+ inputdata = self ._prepare_input_data (input_kwargs = kwargs )
13201279
13211280 return self ._set_method_helper (
13221281 inputdata = inputdata ,
@@ -1326,21 +1285,15 @@ def setSimulationOptions(
13261285
13271286 def setLinearizationOptions (
13281287 self ,
1329- * args : Any ,
13301288 ** kwargs : dict [str , Any ],
13311289 ) -> bool :
13321290 """
1333- This method is used to set linearization options. It can be called:
1334- with a sequence of linearization options name and assigning corresponding value as arguments as show in the example below
1335- usage
1336- >>> setLinearizationOptions("Name=value") # depreciated
1337- >>> setLinearizationOptions(["Name1=value1","Name2=value2"]) # depreciated
1338-
1291+ This method is used to set linearization options.
13391292 >>> setLinearizationOptions(Name1="value1", Name2="value2")
13401293 >>> param = {"Name1": "value1", "Name2": "value2"}
13411294 >>> setLinearizationOptions(**param)
13421295 """
1343- inputdata = self ._prepare_input_data (input_args = args , input_kwargs = kwargs )
1296+ inputdata = self ._prepare_input_data (input_kwargs = kwargs )
13441297
13451298 return self ._set_method_helper (
13461299 inputdata = inputdata ,
@@ -1350,21 +1303,17 @@ def setLinearizationOptions(
13501303
13511304 def setOptimizationOptions (
13521305 self ,
1353- * args : Any ,
13541306 ** kwargs : dict [str , Any ],
13551307 ) -> bool :
13561308 """
13571309 This method is used to set optimization options. It can be called:
13581310 with a sequence of optimization options name and assigning corresponding values as arguments as show in the example below:
13591311 usage
1360- >>> setOptimizationOptions("Name=value") # depreciated
1361- >>> setOptimizationOptions(["Name1=value1","Name2=value2"]) # depreciated
1362-
13631312 >>> setOptimizationOptions(Name1="value1", Name2="value2")
13641313 >>> param = {"Name1": "value1", "Name2": "value2"}
13651314 >>> setOptimizationOptions(**param)
13661315 """
1367- inputdata = self ._prepare_input_data (input_args = args , input_kwargs = kwargs )
1316+ inputdata = self ._prepare_input_data (input_kwargs = kwargs )
13681317
13691318 return self ._set_method_helper (
13701319 inputdata = inputdata ,
@@ -1374,23 +1323,18 @@ def setOptimizationOptions(
13741323
13751324 def setInputs (
13761325 self ,
1377- * args : Any ,
13781326 ** kwargs : dict [str , Any ],
13791327 ) -> bool :
13801328 """
1381- This method is used to set input values. It can be called with a sequence of input name and assigning
1382- corresponding values as arguments as show in the example below. Compared to other set*() methods this is a
1383- special case as value could be a list of tuples - these are converted to a string in _prepare_input_data()
1384- and restored here via ast.literal_eval().
1385-
1386- >>> setInputs("Name=value") # depreciated
1387- >>> setInputs(["Name1=value1","Name2=value2"]) # depreciated
1329+ This method is used to set input values.
13881330
1331+ Compared to other set*() methods this is a special case as value could be a list of tuples - these are
1332+ converted to a string in _prepare_input_data() and restored here via ast.literal_eval().
13891333 >>> setInputs(Name1="value1", Name2="value2")
13901334 >>> param = {"Name1": "value1", "Name2": "value2"}
13911335 >>> setInputs(**param)
13921336 """
1393- inputdata = self ._prepare_input_data (input_args = args , input_kwargs = kwargs )
1337+ inputdata = self ._prepare_input_data (input_kwargs = kwargs )
13941338
13951339 for key , val in inputdata .items ():
13961340 if key not in self ._inputs :
0 commit comments