-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Bug]: add_missing_bounds
not working when time type is numpy.timedelta64
#659
Comments
@lee1043 – what type of objects are in the time axis itself (I am guessing they are not Note that xcdat's missing bounds functionality expects Is it possible to convert the time axis before using
I think this would be preferable to adding in pandas functionality in the missing bounds routines. If you do add this functionality, it would be ideal to do it in a separate PR. |
@lee1043 : does this resolve this issue:
|
@pochedls Thank you for the thoughts. Good to learn about The current Line 916 in 223869e
I however see @tomvothecoder left a comment below the above line
I will open a separate PR as suggested. |
What happened?
xarray's tutorial sample data for air temperature has its time axis typed
numpy.timedelta64
whilenumpy.timedelta
is expected from xcdatWhat did you expect to happen? Are there are possible answers you came across?
The issue can be addressed by converting
numpy.timedelta64
tonumpy.timedelta
if needed when checking the difference between the interval of the second and first time steps.Minimal Complete Verifiable Example (MVCE)
Relevant log output
Anything else we need to know?
Narrow down to the issue:
Environment
INSTALLED VERSIONS
commit: None
python: 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:51:20) [Clang 16.0.6 ]
python-bits: 64
OS: Darwin
OS-release: 23.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None
LOCALE: (None, 'UTF-8')
libhdf5: 1.14.3
libnetcdf: 4.9.2
xarray: 2024.3.0
pandas: 2.2.1
numpy: 1.26.4
scipy: 1.12.0
netCDF4: 1.6.5
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.6.3
nc_time_axis: 1.4.1
iris: None
bottleneck: None
dask: 2024.3.1
distributed: 2024.3.1
matplotlib: 3.8.3
cartopy: None
seaborn: None
numbagg: None
fsspec: 2024.3.1
cupy: None
pint: None
sparse: 0.15.1
flox: None
numpy_groupies: None
setuptools: 69.2.0
pip: 24.0
conda: None
pytest: 8.1.1
mypy: 1.4.0
IPython: 8.22.2
sphinx: 7.2.6
The text was updated successfully, but these errors were encountered: