From 36cfa76f3d275fd7eea4971566c301d0e3ecacc4 Mon Sep 17 00:00:00 2001 From: Johnnie Gray Date: Wed, 14 Sep 2016 02:29:13 +0100 Subject: [PATCH] update dataset.merge docs and fix Raises ValueError -> MergeError --- xarray/core/dataset.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index daf2b6c73d5..92ac6bdb39b 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -1422,7 +1422,8 @@ def merge(self, other, inplace=False, overwrite_vars=set(), overwrite_vars : str or sequence, optional If provided, update variables of these name(s) without checking for conflicts in this dataset. - compat : {'broadcast_equals', 'equals', 'identical'}, optional + compat : {'broadcast_equals', 'equals', 'identical', + 'no_conflicts'}, optional String indicating how to compare variables of the same name for potential conflicts: @@ -1431,6 +1432,9 @@ def merge(self, other, inplace=False, overwrite_vars=set(), - 'equals': all values and dimensions must be the same. - 'identical': all values, dimensions and attributes must be the same. + - 'no_conflicts': only values which are not null in both datasets + must be equal. The returned dataset then contains the combination + of all non-null values. join : {'outer', 'inner', 'left', 'right'}, optional Method for joining ``self`` and ``other`` along shared dimensions: @@ -1446,7 +1450,7 @@ def merge(self, other, inplace=False, overwrite_vars=set(), Raises ------ - ValueError + MergeError If any variables conflict (see ``compat``). """ variables, coord_names, dims = dataset_merge_method(