Skip to content

Commit 6cd65ea

Browse files
committed
[ModelicaSystem] add class function setParameter() which uses kwargs
1 parent 30cb70e commit 6cd65ea

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

OMPython/ModelicaSystem.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,15 @@ def setParameters(
12681268
datatype="parameter",
12691269
overwritedata=self._override_variables)
12701270

1271+
def setParameter(
1272+
self,
1273+
**kwargs,
1274+
) -> bool:
1275+
"""
1276+
Simple wrapper for setParameters() which implements a natural way to set parameters via name=val syntax.
1277+
"""
1278+
return self.setParameters(pvals=kwargs)
1279+
12711280
def setSimulationOptions(
12721281
self,
12731282
simOptions: str | list[str] | dict[str, Any],

0 commit comments

Comments
 (0)