File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 18
18
BinGrouper ,
19
19
EncodedGroups ,
20
20
Grouper ,
21
+ TimeResampler ,
21
22
UniqueGrouper ,
22
23
)
23
24
from xarray .tests import (
@@ -2693,3 +2694,14 @@ def test_weather_data_resample(use_flox):
2693
2694
with xr .set_options (use_flox = use_flox ):
2694
2695
actual = ds .resample (time = "1MS" ).mean ()
2695
2696
assert "location" in actual ._indexes
2697
+
2698
+ gb = ds .groupby (time = TimeResampler (freq = "1MS" ), location = UniqueGrouper ())
2699
+ with xr .set_options (use_flox = use_flox ):
2700
+ actual = gb .mean ()
2701
+ expected = ds .resample (time = "1MS" ).mean ().sortby ("location" )
2702
+ assert_allclose (actual , expected )
2703
+ assert actual .time .attrs == ds .time .attrs
2704
+ assert actual .location .attrs == ds .location .attrs
2705
+
2706
+ assert expected .time .attrs == ds .time .attrs
2707
+ assert expected .location .attrs == ds .location .attrs
You can’t perform that action at this time.
0 commit comments