Skip to content

Commit

Permalink
Add test for pathos interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
misi9170 committed Sep 26, 2024
1 parent b80527f commit 821266c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/parallel_floris_model_2_unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,29 @@ def test_multiprocessing_interface(sample_inputs_fixture):

assert np.allclose(f_turb_powers, pf_turb_powers)

def test_pathos_interface(sample_inputs_fixture):
"""
With interface="pathos", the ParallelFlorisModel should return the same powers
as the FlorisModel.
"""
sample_inputs_fixture.core["wake"]["model_strings"]["velocity_model"] = VELOCITY_MODEL
sample_inputs_fixture.core["wake"]["model_strings"]["deflection_model"] = DEFLECTION_MODEL

fmodel = FlorisModel(sample_inputs_fixture.core)
pfmodel = ParallelFlorisModel(
sample_inputs_fixture.core,
interface="pathos",
n_wind_condition_splits=2
)

fmodel.run()
pfmodel.run()

f_turb_powers = fmodel.get_turbine_powers()
pf_turb_powers = pfmodel.get_turbine_powers()

assert np.allclose(f_turb_powers, pf_turb_powers)

def test_return_turbine_powers_only(sample_inputs_fixture):
"""
With return_turbine_powers_only=True, the ParallelFlorisModel should return only the
Expand Down

0 comments on commit 821266c

Please sign in to comment.