Skip to content

Commit

Permalink
export: test both me/cs
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Dec 1, 2023
1 parent f01ec73 commit 2e0cd04
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@


@pytest.mark.parametrize("mode", ["pyprocess", "pythonfmu"])
def test_export_fmu_vector(mode):
@pytest.mark.parametrize("fmuType", ["cs", "me"])
def test_export_fmu_vector(mode, fmuType):
# export fmu
f = ot.SymbolicFunction(["E", "F", "L", "I"], ["(F*L^3)/(3.0*E*I)"])
start = [3e7, 3e4, 250.0, 400.0]
Expand All @@ -24,7 +25,7 @@ def test_export_fmu_vector(mode):
temp_path = tempfile.mkdtemp()
path_fmu = os.path.join(temp_path, "Deviation.fmu")
fe = otfmi.FunctionExporter(f, start)
fe.export_fmu(path_fmu, fmuType="cs", mode=mode, verbose=True)
fe.export_fmu(path_fmu, fmuType=fmuType, mode=mode, verbose=True)
assert os.path.isfile(path_fmu), "fmu not created"

# simulate with OMSimulator
Expand Down Expand Up @@ -67,7 +68,8 @@ def test_export_fmu_vector(mode):


@pytest.mark.skipif(sys.platform.startswith("win"), reason="N/A")
def test_export_fmu_field():
@pytest.mark.parametrize("fmuType", ["cs", "me"])
def test_export_fmu_field(fmuType):

N = 100
start = 0.0
Expand All @@ -82,7 +84,7 @@ def test_export_fmu_field():

# export
fe = otfmi.FunctionExporter(f, x0)
fe.export_fmu(path_fmu, fmuType="cs", mode="pythonfmu", verbose=True)
fe.export_fmu(path_fmu, fmuType=fmuType, mode="pythonfmu", verbose=True)
assert os.path.isfile(path_fmu), f"fmu not created in {path_fmu}"

# simulate with OMSimulator
Expand Down

0 comments on commit 2e0cd04

Please sign in to comment.