Skip to content

Commit

Permalink
Creating a test for fieldset creation
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldenes committed Jun 4, 2024
1 parent 90716a5 commit e472ff0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_constructors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import plasticparcels as pp
import parcels
from datetime import datetime, timedelta

def test_create_fieldset():
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')

settings['simulation'] = {'startdate': datetime.strptime('2020-01-04-00:00:00', '%Y-%m-%d-%H:%M:%S'), # Start date of simulation
'runtime': timedelta(days=2), # Runtime of simulation
'outputdt': timedelta(hours=1), # Timestep of output
'dt': timedelta(minutes=20), # Timestep of advection
}

fieldset = pp.constructors.create_fieldset(settings)

assert isinstance(fieldset, parcels.FieldSet)

0 comments on commit e472ff0

Please sign in to comment.