-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
topic-metadataRelating to the handling of metadata (i.e. attrs and encoding)Relating to the handling of metadata (i.e. attrs and encoding)
Description
merge()
currently supports four options for merging attrs
:
combine_attrs : {"drop", "identical", "no_conflicts", "override"}, \
default: "drop"
String indicating how to combine attrs of the objects being merged:
- "drop": empty attrs on returned Dataset.
- "identical": all attrs must be the same on every object.
- "no_conflicts": attrs from all objects are combined, any that have
the same name must also have the same value.
- "override": skip comparing and copy attrs from the first dataset to
the result.
It would be nice to have an option to combine attrs from all objects like "no_conflicts", but that drops attributes with conflicting values rather than raising an error. We might call this combine_attrs="drop_conflicts"
or combine_attrs="matching"
.
This is similar to how xarray currently handles conflicting values for DataArray.name
and would be more suitable to consider for the default behavior of merge
and other functions/methods that merge coordinates (e.g., apply_ufunc, concat, where, binary arithmetic).
cc @keewis
keewis and max-sixty
Metadata
Metadata
Assignees
Labels
topic-metadataRelating to the handling of metadata (i.e. attrs and encoding)Relating to the handling of metadata (i.e. attrs and encoding)