FMU

class ospx.fmi.fmu.FMU(file: str | PathLike[str])

Bases: object

Class to read and interact with an fmi 2.0 Functional Mockup Unit (FMU).

See also https://github.com/modelica/fmi-standard/blob/v2.0.x/schema/fmi2ModelDescription.xsd

__init__(file: str | PathLike[str]) None

Methods

__init__(file)

copy(new_name)

Save a copy of the FMU with a new name.

proxify(host, port)

Create a proxy version of the FMU.

Attributes

default_experiment

Returns the default experiment, if defined in the FMU.

units

Returns a dict with all units defined in the FMU.

variables

Returns a dict with all scalar variables defined in the FMU.

copy(new_name: str) FMU

Save a copy of the FMU with a new name.

Parameters:

new_name (str) – Intended name of the copy. The new name must be different from the existing name.

Returns:

The new FMU

Return type:

FMU

proxify(host: str, port: int) FMU

Create a proxy version of the FMU.

For details see https://github.com/NTNU-IHB/FMU-proxy

Parameters:
  • host (str) – Remote host

  • port (int) – Remote port

Returns:

The created proxy version of the FMU

Return type:

FMU

property default_experiment: Experiment | None

Returns the default experiment, if defined in the FMU.

Returns:

the default experiment, if defined. Otherwise None.

Return type:

Union[Experiment, None]

property units: dict[str, Unit]

Returns a dict with all units defined in the FMU.

Returns:

dict with all units

Return type:

Dict[str, Unit]

property variables: dict[str, ScalarVariable]

Returns a dict with all scalar variables defined in the FMU.

Returns:

dict with all scalar variables

Return type:

dict[str, ScalarVariable]