Skip to content

Commit

Permalink
Skip platform checks in simulate_fmu() if fmu_instance is provided
Browse files Browse the repository at this point in the history
fixes #727
  • Loading branch information
t-sommer committed Dec 13, 2024
1 parent 561ae94 commit 7620609
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions fmpy/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,15 +652,17 @@ def simulate_fmu(filename,
from fmpy.model_description import read_model_description
from fmpy.util import can_simulate

platforms = supported_platforms(filename)
if fmu_instance is None:

platforms = supported_platforms(filename)

if fmu_instance is None and platform not in platforms and remote_platform is None:
raise Exception(f"The current platform ({platform}) is not supported by the FMU.")
if platform not in platforms and remote_platform is None:
raise Exception(f"The current platform ({platform}) is not supported by the FMU.")

can_sim, remote_platform = can_simulate(platforms, remote_platform)
can_sim, remote_platform = can_simulate(platforms, remote_platform)

if not can_sim:
raise Exception(f"The FMU cannot be simulated on the current platform ({platform}).")
if not can_sim:
raise Exception(f"The FMU cannot be simulated on the current platform ({platform}).")

if model_description is None:
model_description = read_model_description(filename, validate=validate)
Expand Down

0 comments on commit 7620609

Please sign in to comment.