Open mathause opened 1 year ago
cc @spencerkclark @znicholls
cc @spencerkclark @znicholls
Legend thanks
@mathause
That might need a special data type for timedeltas of cftime.Datetime objects, or allowing to add 'timedelta64[ns]' to cftime.Datetime objects
I think this might be related:
What happened?
A cftime variable returns a timedelta64[ns] when calling
diff
/+
/-
and it can then not be added/ subtracted from the original data.What did you expect to happen?
We can
add
cftime timedeltas.Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
returns
array([datetime.timedelta(seconds=21600), ...])
but thenreturns a
dtype='timedelta64[ns]'
array.Anything else we need to know?
'timedelta64[ns]'
to cftime.Datetime objectshttps://github.com/pydata/xarray/blob/d8ec3a3f6b02a8b941b484b3d254537af84b5fde/xarray/core/variable.py#L366
https://github.com/pydata/xarray/blob/d8ec3a3f6b02a8b941b484b3d254537af84b5fde/xarray/core/variable.py#L272
Environment