-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
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
Resamplerobjects that takes an input tuple of chunks and returns a tuple of chunks, so that SeasonResampler will ignore thedrop_incompletekwarg, and not silently drop data.