sofirpy.fmu_export.open_modelica_fmu_export module

This module allows to export a OpenModelica model as a fmu.

class sofirpy.fmu_export.open_modelica_fmu_export.OpenModelicaFmuExport(model_path: Path, model_name: str, output_directory: Path | None = None)[source]

Bases: FmuExport

Object that performs the OpenModelica fmu export.

Parameters:
  • model_path (Path) – Path to the modelica model that should be exported

  • model_name (str) – Name of the model.

  • output_directory (Path | None, optional) – Output directory for the fmu.

export_fmu() bool[source]

Exports the model as an fmu.

Returns:

True if export is successful else False

Return type:

bool

sofirpy.fmu_export.open_modelica_fmu_export.export_open_modelica_model(model_path: Path | str, model_name: str, output_directory: Path | str) Path[source]

Exports a modelica model as an fmu and moves the fmu to the output directory

Parameters:
  • model_path (Path | str) – Path to the modelica model that should be exported.

  • model_name (str) – Name of the model.

  • output_directory (Path | str) – Output directory for the fmu.

Returns:

Path to the exported FMU.

Return type:

Path