We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 339ed3a commit 93e786bCopy full SHA for 93e786b
xarray/tests/test_groupby.py
@@ -3004,6 +3004,15 @@ def test_lazy_int_bins_error():
3004
_ = BinGrouper(bins=4).factorize(DataArray(dask.array.arange(3)))
3005
3006
3007
+def test_time_grouping_seasons_specified():
3008
+ time = xr.date_range("2001-01-01", "2002-01-01", freq="D")
3009
+ ds = xr.Dataset({"foo": np.arange(time.size)}, coords={"time": ("time", time)})
3010
+ labels = ["DJF", "MAM", "JJA", "SON"]
3011
+ actual = ds.groupby({"time.season": UniqueGrouper(labels=labels)}).sum()
3012
+ expected = ds.groupby("time.season").sum()
3013
+ assert_identical(actual, expected.reindex(season=labels))
3014
+
3015
3016
# Possible property tests
3017
# 1. lambda x: x
3018
# 2. grouped-reduce on unique coords is identical to array
0 commit comments