-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating a test for fieldset creation
- Loading branch information
1 parent
90716a5
commit e472ff0
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|