fix: support datetime variables in Dataset.interp#11081
fix: support datetime variables in Dataset.interp#11081emmanuel-ferdman wants to merge 7 commits intopydata:mainfrom
Dataset.interp#11081Conversation
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
29d76d7 to
e4bf80a
Compare
spencerkclark
left a comment
There was a problem hiding this comment.
Thanks @emmanuel-ferdman—this largely looks good.
Could you add "Mm" to the valid dtypes on the DataArray.interp side as well? There is no need now to raise in that circumstance, which is great.
One edge case to consider is what to do in the scenario that extrapolation leads to float values outside the range that can be represented by 64-bit integers. Maybe we punt on that for now though, since it could be messy to handle in a robust way.
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
|
@spencerkclark Thanks, updated :) Regarding the offset-based approach, I think we could subtract the minimum datetime before converting to float, which gives nanosecond precision - but it would break dask laziness since we'd need to compute |
spencerkclark
left a comment
There was a problem hiding this comment.
Thanks @emmanuel-ferdman! This looks good from my perspective.
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
PR Summary
Dataset.interp()silently droppeddatetime64andtimedelta64variables. Now they are interpolated by converting tofloat64and back, withNaThandled likeNaN.Dataset.interp()silently dropping time-like data arrays #10900