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
I am trying to open netcdf files or even zarr files but with the latest version of numpy==2.0.0, the values for the time dimensions are wrong (by some seconds).
It happens when I open directly netcdf files but also some zarr files.
What did you expect to happen?
I am expecting the datetime for the time dimension to work as it was with numpy<2.0.0
Minimal Complete Verifiable Example
# download any of the files here: https://data.marine.copernicus.eu/product/IBI_MULTIYEAR_PHY_005_002/files?subdataset=cmems_mod_ibi_phy_my_0.083deg-3D_P1M-m_202012&path=IBI_MULTIYEAR_PHY_005_002%2Fcmems_mod_ibi_phy_my_0.083deg-3D_P1M-m_202012%2F2021%2Fimportxarrayds=xr.open_dataset(
"CMEMS_v5r1_IBI_PHY_MY_PdE_01mav_20211001_20211031_R20230101_RE01.nc"
)
print(ds)
# with numpy<2.0.0: (time) datetime64[ns] 2021-10-16T12:00:00# with numpy==2.0.0: (time) datetime64[ns] 8B 2021-10-16T11:58:44.279541760
MVCE confirmation
Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
Complete example — the example is self-contained, including all data and the text of any traceback.
Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
New issue — a search of GitHub Issues suggests this is not a duplicate.
Recent environment — the issue occurs with the latest version of xarray and its dependencies.
I think this is a duplicate of #9179, which was fixed in #9182. If possible, can you try installing from main to see if that works? Otherwise the next release should be in a couple of weeks.
What happened?
I am trying to open netcdf files or even zarr files but with the latest version of
numpy==2.0.0
, the values for the time dimensions are wrong (by some seconds).It happens when I open directly netcdf files but also some zarr files.
What did you expect to happen?
I am expecting the datetime for the time dimension to work as it was with
numpy<2.0.0
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
I tried to do something like this:
But it seemed to work as expected so maybe the example is too simple. However, anything else I tried had the error.
Environment
xarray: 2024.6.0
pandas: 2.2.2
numpy: 2.0.0
scipy: None
netCDF4: 1.7.1.post1
pydap: None
h5netcdf: None
h5py: None
zarr: None
cftime: 1.6.4
nc_time_axis: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 69.5.1
pip: 24.0
conda: None
pytest: None
mypy: None
IPython: None
sphinx: None
The text was updated successfully, but these errors were encountered: