Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[ModelicaSystem] replace pathlib by OMCPath
  • Loading branch information
syntron committed Nov 13, 2025
commit 84797256667630cf1701e9e03b7070388bf13890
9 changes: 6 additions & 3 deletions OMPython/ModelicaSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ def convertMo2Fmu(
fmuType: str = "me_cs",
fileNamePrefix: Optional[str] = None,
includeResources: bool = True,
) -> pathlib.Path:
) -> OMCPath:
"""Translate the model into a Functional Mockup Unit.

Args:
Expand Down Expand Up @@ -1670,7 +1670,7 @@ def convertMo2Fmu(
def convertFmu2Mo(
self,
fmu: os.PathLike,
) -> pathlib.Path:
) -> OMCPath:
"""
In order to load FMU, at first it needs to be translated into Modelica model. This method is used to generate
Modelica model from the given FMU. It generates "fmuName_me_FMU.mo".
Expand All @@ -1679,7 +1679,10 @@ def convertFmu2Mo(
>>> convertFmu2Mo("c:/BouncingBall.Fmu")
"""

fmu_path = pathlib.Path(fmu)
fmu_path = self._getconn.omcpath(fmu)

if not fmu_path.is_file():
raise ModelicaSystemError(f"Missing FMU file: {fmu_path.as_posix()}")

filename = self._requestApi(apiName='importFMU', entity=fmu_path.as_posix())
filepath = self._work_dir / filename
Expand Down