Skip to content

Commit

Permalink
test/export: try fmpy
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Dec 1, 2023
1 parent 5be91fc commit d9a3f44
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import subprocess
import time
import pytest
import fmpy


@pytest.mark.parametrize("mode", ["pyprocess", "pythonfmu"])
Expand Down Expand Up @@ -64,6 +65,15 @@ def test_export_fmu_vector(mode, fmuType):
print("Speed=", size / (t1 - t0), "evals/s")
print("Memory=", mem1 - mem0)

elif mode == "pythonfmu":
summary = fmpy.dump(path_fmu)
print(summary)
start_values = {"E": 6.70455e+10, "F": 300, "L": 2.55, "I": 1.45385e-07}
result = fmpy.simulate_fmu(path_fmu, start_values=start_values)
print(result)
y = result[-1][1]
print(y)

shutil.rmtree(temp_path)


Expand Down

0 comments on commit d9a3f44

Please sign in to comment.