MCPcopy Index your code
hub / github.com/pydata/xarray / test_time_grouping_seasons_specified

Function test_time_grouping_seasons_specified

xarray/tests/test_groupby.py:3282–3288  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3280
3281
3282def test_time_grouping_seasons_specified() -> None:
3283 time = xr.date_range("2001-01-01", "2002-01-01", freq="D")
3284 ds = xr.Dataset({"foo": np.arange(time.size)}, coords={"time": ("time", time)})
3285 labels = ["DJF", "MAM", "JJA", "SON"]
3286 actual = ds.groupby({"time.season": UniqueGrouper(labels=labels)}).sum()
3287 expected = ds.groupby("time.season").sum()
3288 assert_identical(actual, expected.reindex(season=labels))
3289
3290
3291def test_multiple_grouper_unsorted_order() -> None:

Callers

nothing calls this directly

Calls 6

groupbyMethod · 0.95
UniqueGrouperClass · 0.90
assert_identicalFunction · 0.90
arangeMethod · 0.80
sumMethod · 0.45
reindexMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…