Replies: 2 comments 4 replies
-
I think that's it, or in general that some operations would invalidate certain attributes (automatic physical unit propagation has come a long way in the past few years). It is true that it is more common to just globally set We also (partially) changed |
Beta Was this translation helpful? Give feedback.
-
For context I originally started adding the I think in general it seems a lot of users with rich metadata (CF conventions + data provenance info especially) would often like to keep info that might be wrong in case it's useful. Xarray's metadata handling originally made the opposite assumption - that if we can't be sure the information is consistent it's best to drop it.
I don't understand your suggestion here - are you suggesting that you drop the attrs, then use I agree with @keewis that at least for the units motivation we now have better ways to handle the metadata. EDIT: P.S. Also hey @max-sixty 👋 Haven't seen you here for a while! 😁 |
Beta Was this translation helpful? Give feedback.
-
I notice that
keep_attrs
has been the object of lots of work, and there are still some open issues — e.g. on a recent unrelated PR it was a lagging issue.Can I ask a n00b question — as someone who doesn't use them much but sees the impact on the interface — why do we have this parameter is so many methods? Why not offer a
.reset_attrs()
method, similar to.reset_coords()
, cut the parameter in each transformation — wouldn't that make the interface more orthogonal?Is it that users would want to reset so often that this approach would litter use code with these calls? Or is it that we used to use
attrs
for units where dropping generally made sense, and then we added the functionality to keep them, and then it spread throughout the interface?Beta Was this translation helpful? Give feedback.
All reactions