id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 831779578,MDU6SXNzdWU4MzE3Nzk1Nzg=,5036,In-place operation on DataArray coordinate throws error but still modifies the coordinate values,39047984,closed,0,,,1,2021-03-15T12:51:21Z,2021-11-09T20:28:13Z,2021-11-09T20:28:13Z,NONE,,,,"Example: ```Py import xarray as xr import numpy as np data = np.random.rand(4, 3) locs = np.arange(3.) times = np.arange(4.) foo = xr.DataArray(data, coords=[times, locs], dims=[""time"", ""space""]) foo ``` ![Screenshot at 2021-03-15 13-47-22](https://user-images.githubusercontent.com/39047984/111155637-fe1e8880-8594-11eb-854a-efca5414e1f5.png) When trying to do an in-place modification of the coordinate values ```Py foo.coords['time'] += 10. ``` I get ```Py ValueError: Cannot assign to the .values attribute of dimension coordinate a.k.a IndexVariable 'time'. Please use DataArray.assign_coords, Dataset.assign_coords or Dataset.assign as appropriate. ``` However, when looking at the values of the coordinate, they seem to have been modified by the operation: ![Screenshot at 2021-03-15 13-49-12](https://user-images.githubusercontent.com/39047984/111155819-3f169d00-8595-11eb-8481-1ca6bef020d8.png)
Output of xr.show_versions() INSTALLED VERSIONS ------------------ commit: None python: 3.7.7 (default, May 7 2020, 21:25:33) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.4.0-66-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.6 libnetcdf: None xarray: 0.16.2 pandas: 1.2.0 numpy: 1.19.4 scipy: 1.5.3 netCDF4: None pydap: None h5netcdf: None h5py: 3.1.0 Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: None distributed: None matplotlib: 3.2.2 cartopy: None seaborn: None numbagg: None pint: 0.16.1 setuptools: 49.6.0.post20201009 pip: 20.3.3 conda: 4.9.2 pytest: 6.1.2 IPython: 7.19.0 sphinx: 3.3.0
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/5036/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue