-
-
Notifications
You must be signed in to change notification settings - Fork 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
Indexing preserves outdated attrs which cause trouble downstream #2247
Comments
Here is the |
See #1614 for a large discussion about these sorts of issues (propagating metadata). |
@shoyer thanks, I missed that issue. I appreciate the complexity of the problem. For now, I'm dropping the |
Code Sample, a copy-pastable example if possible
Output:
Problem description
Indexing seems to preserve the
attrs
. If it contains information about the values, then this information will be outdated. Some software, like GMT rely on this information for certain operations. It can manage missing metadata but there is no way to guard against incorrect metadata.Expected Output
I would expect indexing to drop
attrs
unlesskeep_attrs
is specified. It's better to have no metadata than to have incorrect metadata.Output of
xr.show_versions()
xarray: 0.10.2
pandas: 0.22.0
numpy: 1.14.2
scipy: 1.0.1
netCDF4: 1.3.1
h5netcdf: 0.5.0
h5py: 2.7.1
Nio: None
zarr: None
bottleneck: 1.2.1
cyordereddict: None
dask: 0.17.2
distributed: 1.21.4
matplotlib: 2.2.2
cartopy: None
seaborn: None
setuptools: 39.0.1
pip: 9.0.1
conda: None
pytest: 3.5.0
IPython: 6.2.1
sphinx: 1.7.2
The text was updated successfully, but these errors were encountered: