Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions xarray/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def dict_equiv(
return True


def ordered_dict_intersection(
def compat_dict_intersection(
first_dict: Mapping[K, V],
second_dict: Mapping[K, V],
compat: Callable[[V, V], bool] = equivalent,
Expand All @@ -361,9 +361,6 @@ def ordered_dict_intersection(
Binary operator to determine if two values are compatible. By default,
checks for equivalence.

# TODO: Rename to compat_dict_intersection, as we do not use OrderedDicts
# any more.

Returns
-------
intersection : dict
Expand Down
6 changes: 3 additions & 3 deletions xarray/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ def test_unsafe(self):
with pytest.raises(ValueError):
utils.update_safety_check(self.x, self.z)

def test_ordered_dict_intersection(self):
assert {"b": "B"} == utils.ordered_dict_intersection(self.x, self.y)
assert {} == utils.ordered_dict_intersection(self.x, self.z)
def test_compat_dict_intersection(self):
assert {"b": "B"} == utils.compat_dict_intersection(self.x, self.y)
assert {} == utils.compat_dict_intersection(self.x, self.z)

def test_compat_dict_union(self):
assert {"a": "A", "b": "B", "c": "C"} == utils.compat_dict_union(self.x, self.y)
Expand Down