@@ -430,14 +430,27 @@ def getContinuous(self, names=None): # 4
430430 raise ModelicaSystemError (f"OM error: { i } is not continuous" )
431431 return valuelist
432432
433- def getParameters (self , names = None ): # 5
434- """
435- This method returns dict. The key is parameter names and value is corresponding parameter value.
436- If name is None then the function will return dict which contain all parameter names as key and value as corresponding values.
437- usage:
438- >>> getParameters()
439- >>> getParameters("Name1")
440- >>> getParameters(["Name1","Name2"])
433+ def getParameters (self , names : Optional [str | list [str ]] = None ) -> dict [str , str ] | list [str ]: # 5
434+ """Get parameter values.
435+
436+ Args:
437+ names: Either None (default), a string with the parameter name,
438+ or a list of parameter name strings.
439+ Returns:
440+ If `names` is None, a dict in the format
441+ {parameter_name: parameter_value} is returned.
442+ If `names` is a string, a single element list is returned.
443+ If `names` is a list, a list with one value for each parameter name
444+ in names is returned.
445+ In all cases, parameter values are returned as strings.
446+
447+ Examples:
448+ >>> mod.getParameters()
449+ {'Name1': '1.23', 'Name2': '4.56'}
450+ >>> mod.getParameters("Name1")
451+ ['1.23']
452+ >>> mod.getParameters(["Name1","Name2"])
453+ ['1.23', '4.56']
441454 """
442455 if names is None :
443456 return self .paramlist
0 commit comments