Skip to content

Commit d798e71

Browse files
committed
Improve docstring for convertMo2Fmu()
1 parent 93160a4 commit d798e71

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

OMPython/ModelicaSystem.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,15 +1264,22 @@ def _createCSVData(self) -> pathlib.Path:
12641264

12651265
return csvFile
12661266

1267-
# to convert Modelica model to FMU
1268-
def convertMo2Fmu(self, version="2.0", fmuType="me_cs", fileNamePrefix="<default>", includeResources=True): # 19
1269-
"""
1270-
This method is used to generate FMU from the given Modelica model. It creates "modelName.fmu" in the current working directory. It can be called:
1271-
with no arguments
1272-
with arguments of https://build.openmodelica.org/Documentation/OpenModelica.Scripting.translateModelFMU.html
1273-
usage
1274-
>>> convertMo2Fmu()
1275-
>>> convertMo2Fmu(version="2.0", fmuType="me|cs|me_cs", fileNamePrefix="<default>", includeResources=True)
1267+
def convertMo2Fmu(self, version: str = "2.0", fmuType: str = "me_cs",
1268+
fileNamePrefix: str = "<default>",
1269+
includeResources: bool = True) -> str:
1270+
"""Translate the model into a Functional Mockup Unit.
1271+
1272+
Args:
1273+
See https://build.openmodelica.org/Documentation/OpenModelica.Scripting.translateModelFMU.html
1274+
1275+
Returns:
1276+
str: Path to the created '*.fmu' file.
1277+
1278+
Examples:
1279+
>>> mod.convertMo2Fmu()
1280+
'/tmp/tmpmhfx9umo/CauerLowPassAnalog.fmu'
1281+
>>> mod.convertMo2Fmu(version="2.0", fmuType="me|cs|me_cs", fileNamePrefix="<default>", includeResources=True)
1282+
'/tmp/tmpmhfx9umo/CauerLowPassAnalog.fmu'
12761283
"""
12771284

12781285
if fileNamePrefix == "<default>":

0 commit comments

Comments
 (0)