-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Averaging timestamps with non-nanosecond precision #9975
Labels
Comments
sfinkens
added
bug
needs triage
Issue that has not been reviewed by xarray team member
labels
Jan 22, 2025
Thanks for the report @sfinkens. This really indicates it's interpreting the int64 values as nanosecond values. The 1800 nanoseconds should be seconds in this case, which would be the expected half hour |
How did I miss this? I've thought I've grep'ed through the codebase with xarray/xarray/core/duck_array_ops.py Lines 715 to 732 in 609412d
|
kmuehlbauer
removed
the
needs triage
Issue that has not been reviewed by xarray team member
label
Jan 22, 2025
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
The latest xarray version from the main branch returns unexpected values when averaging timestamps with non-nanosecond precision.
What did you expect to happen?
The average of [01:00, 02:00] to be 01:30, instead it is 01:00:00.000001800
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.8 | packaged by conda-forge | (main, Dec 5 2024, 14:24:40) [GCC 13.3.0]
python-bits: 64
OS: Linux
OS-release: 4.18.0-513.5.1.el8_9.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: en_US.utf-8
LANG: de_DE.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.14.4
libnetcdf: 4.9.2
xarray: 2025.1.2.dev9+g609412d8
pandas: 2.2.3
numpy: 2.2.2
scipy: 1.15.1
netCDF4: 1.7.2
pydap: None
h5netcdf: 1.4.1
h5py: 3.12.1
zarr: 3.0.1
cftime: 1.6.4
nc_time_axis: None
iris: None
bottleneck: None
dask: 2024.12.1
distributed: None
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
fsspec: 2024.12.0
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 75.8.0
pip: 24.3.1
conda: None
pytest: 8.3.4
mypy: None
IPython: None
sphinx: None
The text was updated successfully, but these errors were encountered: