2525 except ImportError :
2626 pass
2727
28- disallowed_methods = (
29- "conservative" ,
30- "conservative_2nd" ,
31- # "nearest_dtos",
32- )
33-
3428methods = (
3529 "linear" ,
3630 "nearest_stod" ,
@@ -162,7 +156,7 @@ def test_Field_regrid_grid_to_featureType_3d(self):
162156 y = esmpy_regrid (coord_sys , method , src , dst , ** kwargs )
163157
164158 self .assertEqual (y .size , a .size )
165- self .assertTrue (np .allclose (y , a , atol = 4e-3 , rtol = rtol ))
159+ self .assertTrue (np .allclose (y , a , atol = atol , rtol = rtol ))
166160
167161 if isinstance (a , np .ma .MaskedArray ):
168162 self .assertTrue ((y .mask == a .mask ).all ())
@@ -173,6 +167,7 @@ def test_Field_regrid_grid_to_featureType_3d(self):
173167 def test_Field_regrid_featureType_to_grid_2d (self ):
174168 self .assertFalse (cf .regrid_logging ())
175169
170+ # Create some nice data
176171 src = self .dst_featureType
177172 src .del_construct ("cellmethod0" )
178173 src = src [:12 ]
@@ -191,6 +186,7 @@ def test_Field_regrid_featureType_to_grid_2d(self):
191186 # Mask some destination grid points
192187 dst [0 , 0 , 1 , 2 ] = cf .masked
193188
189+ # Expected destination regridded values
194190 y0 = np .ma .array (
195191 [[0 , 0 , 0 , 0 ], [0 , 0 , 1122 , 0 ], [0 , 1114 , 0 , 0 ], [1106 , 0 , 0 , 0 ]],
196192 mask = [
@@ -201,13 +197,14 @@ def test_Field_regrid_featureType_to_grid_2d(self):
201197 ],
202198 )
203199
204- coord_sys = "spherical"
205-
206200 for src_masked in (False , True ):
207201 y = y0 .copy ()
208202 if src_masked :
209203 src = src .copy ()
210204 src [6 :8 ] = cf .masked
205+ # This following element should be smaller, because it
206+ # now only has two source cells conrtibuting to it,
207+ # rather than four.
211208 y [3 , 0 ] = 547
212209
213210 # Loop over whether or not to use the destination grid
@@ -327,7 +324,7 @@ def test_Field_regrid_featureType_bad_methods(self):
327324 dst = self .dst_featureType .copy ()
328325 src = self .src_grid .copy ()
329326
330- for method in disallowed_methods :
327+ for method in ( "conservative" , "conservative_2nd" ) :
331328 with self .assertRaises (ValueError ):
332329 src .regrids (dst , method = method )
333330
0 commit comments