issues: 1362895131
This data as json
| 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1362895131 | I_kwDOAMm_X85RPCEb | 6996 | attrs are now views, not copies | 10050469 | closed | 0 | 5 | 2022-09-06T08:23:59Z | 2022-09-06T10:45:43Z | 2022-09-06T10:45:36Z | MEMBER | What is your issue?I'm not sure yet if this is a feature or a bug - I would tend to the latter. Apologies if this has been discussed before. Objects originating from operations such as ```python import numpy as np import xarray as xr xr.version '2022.6.0' x = xr.DataArray( 0.1 * np.arange(10), dims=["lat"], coords={"lat": np.arange(10)}, name="sst", ) x.lat.attrs['long_name'] = 'latitude' x.lat.attrs {'long_name': 'latitude'} y = x > 2 y.lat.attrs {'long_name': 'latitude'} y.lat.attrs = {} x.lat.attrs # x is changed as well! {} ``` I think this is rather a non-intuitive behavior but I'm happy to discuss! |
{
"url": "https://api.github.com/repos/pydata/xarray/issues/6996/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
completed | 13221727 | issue |