Skip to content

Commit 8255e68

Browse files
committed
Improve docstring for convertMo2Fmu()
1 parent 3028854 commit 8255e68

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
@@ -1230,15 +1230,22 @@ def _createCSVData(self) -> pathlib.Path:
12301230

12311231
return csvFile
12321232

1233-
# to convert Modelica model to FMU
1234-
def convertMo2Fmu(self, version="2.0", fmuType="me_cs", fileNamePrefix="<default>", includeResources=True): # 19
1235-
"""
1236-
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:
1237-
with no arguments
1238-
with arguments of https://build.openmodelica.org/Documentation/OpenModelica.Scripting.translateModelFMU.html
1239-
usage
1240-
>>> convertMo2Fmu()
1241-
>>> convertMo2Fmu(version="2.0", fmuType="me|cs|me_cs", fileNamePrefix="<default>", includeResources=True)
1233+
def convertMo2Fmu(self, version: str = "2.0", fmuType: str = "me_cs",
1234+
fileNamePrefix: str = "<default>",
1235+
includeResources: bool = True) -> str:
1236+
"""Translate the model into a Functional Mockup Unit.
1237+
1238+
Args:
1239+
See https://build.openmodelica.org/Documentation/OpenModelica.Scripting.translateModelFMU.html
1240+
1241+
Returns:
1242+
str: Path to the created '*.fmu' file.
1243+
1244+
Examples:
1245+
>>> mod.convertMo2Fmu()
1246+
'/tmp/tmpmhfx9umo/CauerLowPassAnalog.fmu'
1247+
>>> mod.convertMo2Fmu(version="2.0", fmuType="me|cs|me_cs", fileNamePrefix="<default>", includeResources=True)
1248+
'/tmp/tmpmhfx9umo/CauerLowPassAnalog.fmu'
12421249
"""
12431250

12441251
if fileNamePrefix == "<default>":

0 commit comments

Comments
 (0)