@@ -576,9 +576,25 @@ def test_fill_value_xarray_behaviour():
576576 }
577577 )
578578
579- expected_time = pd .date_range ("2000-01-01" , freq = "3H" , periods = 19 )
580- expected = ds . reindex ( time = expected_time )
581- expected = ds .resample (time = "3H" ).sum ()
579+ pd .date_range ("2000-01-01" , freq = "3H" , periods = 19 )
580+ with xr . set_options ( use_flox = False ):
581+ expected = ds .resample (time = "3H" ).sum ()
582582 with xr .set_options (use_flox = True ):
583583 actual = ds .resample (time = "3H" ).sum ()
584584 xr .testing .assert_identical (expected , actual )
585+
586+
587+ def test_fill_value_xarray_binning ():
588+ array = np .linspace (0 , 10 , 5 * 10 , dtype = int ).reshape (5 , 10 )
589+
590+ x = np .array ([0 , 0 , 1 , 2 , 2 ])
591+ y = np .arange (array .shape [1 ]) * 3
592+ u = np .linspace (0 , 1 , 5 )
593+
594+ data_array = xr .DataArray (data = array , coords = {"x" : x , "y" : y , "u" : ("x" , u )}, dims = ("x" , "y" ))
595+ with xr .set_options (use_flox = False ):
596+ expected = data_array .groupby_bins ("y" , bins = 4 ).mean ()
597+ with xr .set_options (use_flox = True ):
598+ actual = data_array .groupby_bins ("y" , bins = 4 ).mean ()
599+
600+ xr .testing .assert_identical (expected , actual )
0 commit comments