-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Is your feature request related to a problem?
This doesn't work today
from xarray.groupers import SeasonResampler
ds.chunk(time=SeasonResampler(["DJF", "MAMJ", "JAS", "ON"]))
with an obscure error because TimeResampler
is special-cased:
Lines 2515 to 2522 in 8796d55
chunks_mapping_ints: Mapping[Any, T_ChunkDim] = { | |
name: ( | |
_resolve_frequency(name, chunks) | |
if isinstance(chunks, TimeResampler) | |
else chunks | |
) | |
for name, chunks in chunks_mapping.items() | |
} |
That is a good thing because SeasonResampler
sets drop_incomplete=True
by default.
We should
- Raise a better error
- Probably add another method (memo-ized) to
Resampler
objects that takes an input tuple of chunks and returns a tuple of chunks, so that SeasonResampler will ignore thedrop_incomplete
kwarg, and not silently drop data.