1212from parcels ._datasets .structured .generic import datasets as datasets_structured
1313from parcels ._datasets .unstructured .generic import _ux_constant_flow_face_centered_2D
1414from parcels ._datasets .unstructured .generic import datasets as datasets_unstructured
15+ from parcels ._python import NOTSET
1516from parcels .interpolators import (
1617 UxConstantFaceConstantZC ,
1718)
1819
1920
2021def test_field_init_param_types ():
2122 data = datasets_structured ["ds_2d_left" ]
22- model = StructuredModelData .from_sgrid_conventions (data , mesh = "flat" )
23+ model = StructuredModelData .from_sgrid_conventions (data , mesh = "flat" , vector_fields = NOTSET )
2324
2425 with pytest .raises (TypeError , match = "Expected a string for variable name, got int instead." ):
2526 Field (name = 123 , model = model )
@@ -52,7 +53,7 @@ def test_field_init_fail_on_float_time_dim():
5253 ds ["time" ].attrs ,
5354 )
5455
55- model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" )
56+ model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" , vector_fields = NOTSET )
5657 with pytest .raises (
5758 ValueError ,
5859 match = r"Are you sure that the time dimension on the xarray dataset is stored as timedelta, datetime or cftime datetime objects\?" ,
@@ -64,7 +65,7 @@ def test_field_init_fail_on_float_time_dim():
6465def test_field_time_interval ():
6566 """Test that field.time_interval delegates correctly to model.time_interval."""
6667 data = datasets_structured ["ds_2d_left" ]
67- model = StructuredModelData .from_sgrid_conventions (data , mesh = "flat" )
68+ model = StructuredModelData .from_sgrid_conventions (data , mesh = "flat" , vector_fields = NOTSET )
6869 field = Field (name = "data_g" , model = model )
6970 assert field .time_interval .left == np .datetime64 ("2000-01-01" )
7071 assert field .time_interval .right == np .datetime64 ("2001-01-01" )
@@ -77,7 +78,7 @@ def test_vectorfield_init_different_time_intervals():
7778
7879def test_field_invalid_interpolator ():
7980 ds = datasets_structured ["ds_2d_left" ]
80- model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" )
81+ model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" , vector_fields = NOTSET )
8182 field = Field (name = "data_g" , model = model )
8283
8384 def not_a_scalar_interpolator (particle_positions , grid_positions , field ):
@@ -90,7 +91,7 @@ def not_a_scalar_interpolator(particle_positions, grid_positions, field):
9091
9192def test_vectorfield_invalid_interpolator ():
9293 ds = datasets_structured ["ds_2d_left" ]
93- model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" )
94+ model = StructuredModelData .from_sgrid_conventions (ds , mesh = "flat" , vector_fields = NOTSET )
9495 fields = {f .name : f for f in model .construct_fields ()}
9596 U = fields ["U_A_grid" ]
9697 V = fields ["V_A_grid" ]
0 commit comments