Skip to content

Commit 522ee22

Browse files
authored
explain keep_attrs in docstring of apply_ufunc (#7445)
1 parent b741d83 commit 522ee22

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

xarray/core/computation.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,12 @@ def apply_ufunc(
938938
Value used in place of missing variables on Dataset inputs when the
939939
datasets do not share the exact same ``data_vars``. Required if
940940
``dataset_join not in {'inner', 'exact'}``, otherwise ignored.
941-
keep_attrs : bool, optional
942-
Whether to copy attributes from the first argument to the output.
941+
keep_attrs : {"drop", "identical", "no_conflicts", "drop_conflicts", "override"} or bool, optional
942+
- 'drop' or False: empty attrs on returned xarray object.
943+
- 'identical': all attrs must be the same on every object.
944+
- 'no_conflicts': attrs from all objects are combined, any that have the same name must also have the same value.
945+
- 'drop_conflicts': attrs from all objects are combined, any that have the same name but different values are dropped.
946+
- 'override' or True: skip comparing and copy attrs from the first object to the result.
943947
kwargs : dict, optional
944948
Optional keyword arguments passed directly on to call ``func``.
945949
dask : {"forbidden", "allowed", "parallelized"}, default: "forbidden"

0 commit comments

Comments
 (0)