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
What happened:
I recently ran into the trouble as I assigned data generate by an external program to a dataset, and suddenly the dataset contained only NaN, see the example below. The issue was, that the program rounded numbers to 10 digits, so the coordinates didn't match anymore. xarray silently ignores this.
What you expected to happen:
I would have expected an error or at least a warning, when the coordinates don't match.
The current behavior can lead to bugs which are very hard to trace.
I agree, that the given example problem is related to a tolerance.
In principle, I see the problem in the current practice of just dropping data that doesn't align. If I perform an assignment =, I do not expect to lose any data.
This line of code would effectively do nothing, I generate data and upon assignment it is dropped.
But this might be a bit of a physiological question, what the governing design principle is. Personally I think, an assignment should only be possible if the assigned coordinates are a subset of the dataset's coordinates.
What happened:
I recently ran into the trouble as I assigned data generate by an external program to a dataset, and suddenly the dataset contained only
NaN
, see the example below. The issue was, that the program rounded numbers to 10 digits, so the coordinates didn't match anymore.xarray
silently ignores this.What you expected to happen:
I would have expected an error or at least a warning, when the coordinates don't match.
The current behavior can lead to bugs which are very hard to trace.
Minimal Complete Verifiable Example:
Output:
Anything else we need to know?:
Environment:
Output of xr.show_versions()
$ py -c "import xarray as xr; xr.show_versions()" INSTALLED VERSIONS ------------------ commit: None python: 3.7.3 (default, Mar 27 2019, 22:11:17) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.15.0-118-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.2 libnetcdf: 4.6.1 xarray: 0.16.1 pandas: 1.0.5 numpy: 1.18.5 scipy: 1.5.0 netCDF4: 1.4.2 pydap: None h5netcdf: 0.8.1 h5py: 2.9.0 Nio: None zarr: None cftime: 1.1.2 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.13.0 distributed: 2.13.0 matplotlib: 3.2.1 cartopy: None seaborn: None numbagg: None pint: None setuptools: 46.1.3 pip: 19.3.1 conda: 4.8.5 pytest: 5.1.2 IPython: 7.18.1 sphinx: 3.0.2
The text was updated successfully, but these errors were encountered: