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:
|
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 the drop_incomplete kwarg, and not silently drop data.
Is your feature request related to a problem?
This doesn't work today
with an obscure error because
TimeResampleris special-cased:xarray/xarray/core/dataset.py
Lines 2515 to 2522 in 8796d55
That is a good thing because
SeasonResamplersetsdrop_incomplete=Trueby default.We should
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.