-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
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 y = x > 2 are now sharing the same attrs, which leads to things like:
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!
Metadata
Metadata
Assignees
Labels
No labels