@@ -482,14 +482,27 @@ def getContinuous(self, names=None): # 4
482482 raise ModelicaSystemError (f"OM error: { i } is not continuous" )
483483 return valuelist
484484
485- def getParameters (self , names = None ): # 5
486- """
487- This method returns dict. The key is parameter names and value is corresponding parameter value.
488- If name is None then the function will return dict which contain all parameter names as key and value as corresponding values.
489- usage:
490- >>> getParameters()
491- >>> getParameters("Name1")
492- >>> getParameters(["Name1","Name2"])
485+ def getParameters (self , names : Optional [str | list [str ]] = None ) -> dict [str , str ] | list [str ]: # 5
486+ """Get parameter values.
487+
488+ Args:
489+ names: Either None (default), a string with the parameter name,
490+ or a list of parameter name strings.
491+ Returns:
492+ If `names` is None, a dict in the format
493+ {parameter_name: parameter_value} is returned.
494+ If `names` is a string, a single element list is returned.
495+ If `names` is a list, a list with one value for each parameter name
496+ in names is returned.
497+ In all cases, parameter values are returned as strings.
498+
499+ Examples:
500+ >>> mod.getParameters()
501+ {'Name1': '1.23', 'Name2': '4.56'}
502+ >>> mod.getParameters("Name1")
503+ ['1.23']
504+ >>> mod.getParameters(["Name1","Name2"])
505+ ['1.23', '4.56']
493506 """
494507 if names is None :
495508 return self .paramlist
0 commit comments