Skip to content

Commit

Permalink
Adding all combinations of fields in fieldset testing
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldenes committed Jun 4, 2024
1 parent ea48925 commit 3d947ec
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ def test_create_hydrodynamic_fieldset():
assert isinstance(fieldset, parcels.FieldSet)

# Test the create_fieldset() function
def test_create_fieldset():
@pytest.mark.parametrize('use_3D', [True, False])
@pytest.mark.parametrize('use_biofouling', [True, False])
@pytest.mark.parametrize('use_stokes', [True, False])
@pytest.mark.parametrize('use_wind', [True, False])
@pytest.mark.parametrize('use_mixing', [True, False])
def test_create_fieldset(use_3D, use_biofouling, use_stokes, use_wind, use_mixing):
settings_file = 'tests/test_data/test_settings.json'
settings = pp.utils.load_settings(settings_file)
settings = pp.utils.download_plasticparcels_dataset('NEMO0083', settings, 'input_data')
Expand All @@ -38,6 +43,12 @@ def test_create_fieldset():
'dt': timedelta(minutes=20),
}

settings['use_3D'] = use_3D
settings['use_biofouling'] = use_biofouling
settings['use_stokes'] = use_stokes
settings['use_wind'] = use_wind
settings['use_mixing'] = use_mixing

fieldset = pp.constructors.create_fieldset(settings)

assert isinstance(fieldset, parcels.FieldSet)
Expand Down

0 comments on commit 3d947ec

Please sign in to comment.