issues: 1973088408
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1973088408 | I_kwDOAMm_X851mvCY | 8399 | Dataset.resample fails with certain time offset strings provided to the loffset parameter | 7872563 | closed | 0 | 3 | 2023-11-01T20:48:04Z | 2023-11-08T00:52:07Z | 2023-11-08T00:52:07Z | CONTRIBUTOR | What happened?resample fails with offset aliases provided to the loffset argument that do not result in unambiguous timedelta values following pydata/xarray#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```Python import xarray as xr import numpy as np dates = xr.cftime_range(start="0001", periods=24, freq="MS", calendar="noleap") da = xr.DataArray(np.arange(24), coords=[dates], dims=["time"], name="foo") dar = da.resample({'time':'QS-DEC'},loffset='MS').mean() ``` 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
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/8399/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |