@@ -231,29 +231,37 @@ def test_linear_function_task():
231231
232232
233233@pytest .mark .parametrize (
234- ["resize_parameters " , "features_call" , "features_check" , "outputs" ],
234+ ["resize_type" , "height_param" , "width_param " , "features_call" , "features_check" , "outputs" ],
235235 [
236- ((ResizeParam .NEW_SIZE , (50 , 70 )), ("data" , "CLP" ), ("data" , "CLP" ), (68 , 50 , 70 , 1 )),
237- ((ResizeParam .NEW_SIZE , (50 , 70 )), ("data" , "CLP" ), ("mask" , "CLM" ), (68 , 101 , 100 , 1 )),
238- ((ResizeParam .NEW_SIZE , (50 , 70 )), ..., ("data" , "CLP" ), (68 , 50 , 70 , 1 )),
239- ((ResizeParam .NEW_SIZE , (50 , 70 )), ..., ("mask" , "CLM" ), (68 , 50 , 70 , 1 )),
240- ((ResizeParam .NEW_SIZE , (50 , 70 )), ("data" , "CLP" , "CLP_small" ), ("data" , "CLP_small" ), (68 , 50 , 70 , 1 )),
241- ((ResizeParam .NEW_SIZE , (50 , 70 )), ("data" , "CLP" , "CLP_small" ), ("data" , "CLP" ), (68 , 101 , 100 , 1 )),
242- ((ResizeParam .SCALE_FACTORS , (2 , 2 )), ("data" , "CLP" ), ("data" , "CLP" ), (68 , 202 , 200 , 1 )),
243- ((ResizeParam .SCALE_FACTORS , (0.1 , 0.1 )), ("data" , "CLP" ), ("data" , "CLP" ), (68 , 10 , 10 , 1 )),
244- ((ResizeParam .RESOLUTION , (5 , 5 )), ("data" , "CLP" ), ("data" , "CLP" ), (68 , 200 , 202 , 1 )),
245- ((ResizeParam .RESOLUTION , (20 , 20 )), ("data" , "CLP" ), ("data" , "CLP" ), (68 , 50 , 50 , 1 )),
236+ (ResizeParam .NEW_SIZE , 50 , 70 , ("data" , "CLP" ), ("data" , "CLP" ), (68 , 50 , 70 , 1 )),
237+ (ResizeParam .NEW_SIZE , 50 , 70 , ("data" , "CLP" ), ("mask" , "CLM" ), (68 , 101 , 100 , 1 )),
238+ (ResizeParam .NEW_SIZE , 50 , 70 , ..., ("data" , "CLP" ), (68 , 50 , 70 , 1 )),
239+ (ResizeParam .NEW_SIZE , 50 , 70 , ..., ("mask" , "CLM" ), (68 , 50 , 70 , 1 )),
240+ (ResizeParam .NEW_SIZE , 50 , 70 , ("data" , "CLP" , "CLP_small" ), ("data" , "CLP_small" ), (68 , 50 , 70 , 1 )),
241+ (ResizeParam .NEW_SIZE , 50 , 70 , ("data" , "CLP" , "CLP_small" ), ("data" , "CLP" ), (68 , 101 , 100 , 1 )),
242+ (ResizeParam .SCALE_FACTORS , 2 , 2 , ("data" , "CLP" ), ("data" , "CLP" ), (68 , 202 , 200 , 1 )),
243+ (ResizeParam .SCALE_FACTORS , 0.5 , 2 , ("data" , "CLP" ), ("data" , "CLP" ), (68 , 50 , 200 , 1 )),
244+ (ResizeParam .SCALE_FACTORS , 0.1 , 0.1 , ("data" , "CLP" ), ("data" , "CLP" ), (68 , 10 , 10 , 1 )),
245+ (ResizeParam .RESOLUTION , 5 , 5 , ("data" , "CLP" ), ("data" , "CLP" ), (68 , 202 , 200 , 1 )),
246+ (ResizeParam .RESOLUTION , 20 , 20 , ("data" , "CLP" ), ("data" , "CLP" ), (68 , 50 , 50 , 1 )),
247+ (ResizeParam .RESOLUTION , 5 , 20 , ("data" , "CLP" ), ("data" , "CLP" ), (68 , 202 , 50 , 1 )),
246248 ],
247249)
248250@pytest .mark .filterwarnings ("ignore::RuntimeWarning" )
249- def test_spatial_resize_task (example_eopatch , resize_parameters , features_call , features_check , outputs ):
251+ def test_spatial_resize_task (
252+ example_eopatch , resize_type , height_param , width_param , features_call , features_check , outputs
253+ ):
250254 # Warnings occur due to lossy casting in the downsampling procedure
251255
252- resize = SpatialResizeTask (resize_parameters = resize_parameters , features = features_call )
256+ resize = SpatialResizeTask (
257+ resize_type = resize_type , height_param = height_param , width_param = width_param , features = features_call
258+ )
253259 assert resize (example_eopatch )[features_check ].shape == outputs
254260
255261
256262def test_spatial_resize_task_exception (example_eopatch ):
257263 with pytest .raises (ValueError ):
258- resize_wrong_param = SpatialResizeTask (features = ("mask" , "CLM" ), resize_parameters = ("blabla" , (20 , 20 )))
264+ resize_wrong_param = SpatialResizeTask (
265+ features = ("mask" , "CLM" ), resize_type = "blabla" , height_param = 20 , width_param = 20
266+ )
259267 resize_wrong_param (example_eopatch )
0 commit comments