From d9a3f44c0ba29d3e18b99398176d8c49a2552fec Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Fri, 1 Dec 2023 15:52:14 +0100 Subject: [PATCH] test/export: try fmpy --- test/test_export.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test_export.py b/test/test_export.py index 8c24e0f..55c6638 100644 --- a/test/test_export.py +++ b/test/test_export.py @@ -10,6 +10,7 @@ import subprocess import time import pytest +import fmpy @pytest.mark.parametrize("mode", ["pyprocess", "pythonfmu"]) @@ -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)