You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resample fails with offset aliases provided to the loffset argument that do not result in unambiguous timedelta values following #7206. We're running into this over on NCAR/geocat-comp.
I realize the loffset argument is slated to be deprecated anyway, but wanted to at least document this for others who might run into it. Especially since #7596 is still open and the time offset arithmetic gets a little tricky with cftime.
Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the Contributing Guide for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!
Thanks for the report @kafitzgerald — indeed we should see about getting this to work despite the deprecation. It may just be a matter of inserting the appropriate logic around this line:
In other words, in the case that self.loffset is a string we could use xarray.coding.cftime_offsets.to_offset instead of pd.to_timedelta. I think we'd be happy to take a PR if you're up for it.
What happened?
resample fails with offset aliases provided to the loffset argument that do not result in unambiguous timedelta values following #7206. We're running into this over on NCAR/geocat-comp.
I realize the loffset argument is slated to be deprecated anyway, but wanted to at least document this for others who might run into it. Especially since #7596 is still open and the time offset arithmetic gets a little tricky with cftime.
What did you expect to happen?
The operation to complete without error.
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
No response
Environment
INSTALLED VERSIONS
commit: None
python: 3.12.0 | packaged by conda-forge | (main, Oct 3 2023, 08:36:57) [Clang 15.0.7 ]
python-bits: 64
OS: Darwin
OS-release: 21.6.0
machine: arm64
processor: arm
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: None
libnetcdf: None
xarray: 2023.10.1
pandas: 2.1.2
numpy: 1.26.0
scipy: None
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.6.3
nc_time_axis: None
PseudoNetCDF: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: 3.8.0
cartopy: None
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 68.2.2
pip: 23.3.1
conda: None
pytest: None
mypy: None
IPython: None
sphinx: None
The text was updated successfully, but these errors were encountered: