Skip to content

Commit 009aa66

Browse files
authored
Rename ordered_dict_intersection -> compat_dict_intersection (#3887)
Do not use OrderedDicts any more, so name did not make sense.
1 parent d8bb620 commit 009aa66

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

xarray/core/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def dict_equiv(
343343
return True
344344

345345

346-
def ordered_dict_intersection(
346+
def compat_dict_intersection(
347347
first_dict: Mapping[K, V],
348348
second_dict: Mapping[K, V],
349349
compat: Callable[[V, V], bool] = equivalent,
@@ -361,9 +361,6 @@ def ordered_dict_intersection(
361361
Binary operator to determine if two values are compatible. By default,
362362
checks for equivalence.
363363
364-
# TODO: Rename to compat_dict_intersection, as we do not use OrderedDicts
365-
# any more.
366-
367364
Returns
368365
-------
369366
intersection : dict

xarray/tests/test_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ def test_unsafe(self):
120120
with pytest.raises(ValueError):
121121
utils.update_safety_check(self.x, self.z)
122122

123-
def test_ordered_dict_intersection(self):
124-
assert {"b": "B"} == utils.ordered_dict_intersection(self.x, self.y)
125-
assert {} == utils.ordered_dict_intersection(self.x, self.z)
123+
def test_compat_dict_intersection(self):
124+
assert {"b": "B"} == utils.compat_dict_intersection(self.x, self.y)
125+
assert {} == utils.compat_dict_intersection(self.x, self.z)
126126

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

0 commit comments

Comments
 (0)