99from parcels ._datasets .structured .generic import T as T_structured
1010from parcels ._datasets .structured .generic import datasets as datasets_structured
1111from parcels ._datasets .unstructured .generic import datasets as datasets_unstructured
12+ from parcels ._python import NOTSET
1213from parcels .interpolators import (
1314 UxConstantFaceConstantZC ,
1415)
1516
1617
1718def test_field_init_param_types ():
1819 data = datasets_structured ["ds_2d_left" ]
19- model = StructuredModelData .from_sgrid_conventions (data , mesh = "flat" )
20+ model = StructuredModelData .from_sgrid_conventions (data , mesh = "flat" , vector_fields = NOTSET )
2021
2122 with pytest .raises (TypeError , match = "Expected a string for variable name, got int instead." ):
2223 Field (name = 123 , model = model )
@@ -49,7 +50,7 @@ def test_field_init_fail_on_float_time_dim():
4950 ds ["time" ].attrs ,
5051 )
5152
52- model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" )
53+ model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" , vector_fields = NOTSET )
5354 with pytest .raises (
5455 ValueError ,
5556 match = r"Are you sure that the time dimension on the xarray dataset is stored as timedelta, datetime or cftime datetime objects\?" ,
@@ -61,7 +62,7 @@ def test_field_init_fail_on_float_time_dim():
6162def test_field_time_interval ():
6263 """Test that field.time_interval delegates correctly to model.time_interval."""
6364 data = datasets_structured ["ds_2d_left" ]
64- model = StructuredModelData .from_sgrid_conventions (data , mesh = "flat" )
65+ model = StructuredModelData .from_sgrid_conventions (data , mesh = "flat" , vector_fields = NOTSET )
6566 field = Field (name = "data_g" , model = model )
6667 assert field .time_interval .left == np .datetime64 ("2000-01-01" )
6768 assert field .time_interval .right == np .datetime64 ("2001-01-01" )
@@ -74,7 +75,7 @@ def test_vectorfield_init_different_time_intervals():
7475
7576def test_field_invalid_interpolator ():
7677 ds = datasets_structured ["ds_2d_left" ]
77- model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" )
78+ model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" , vector_fields = NOTSET )
7879 field = Field (name = "data_g" , model = model )
7980
8081 def not_a_scalar_interpolator (particle_positions , grid_positions , field ):
@@ -87,7 +88,7 @@ def not_a_scalar_interpolator(particle_positions, grid_positions, field):
8788
8889def test_vectorfield_invalid_interpolator ():
8990 ds = datasets_structured ["ds_2d_left" ]
90- model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" )
91+ model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" , vector_fields = NOTSET )
9192 fields = {f .name : f for f in model .construct_fields ()}
9293 U = fields ["U_A_grid" ]
9394 V = fields ["V_A_grid" ]
0 commit comments