Skip to content

Commit 0f336d3

Browse files
committed
parametrize by xp
This requires converting the static method to an actual method.
1 parent dcd4ca1 commit 0f336d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

xarray_array_testing/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from abc import ABC
33
from types import ModuleType
44

5-
import numpy as np
65
import numpy.testing as npt
76
from xarray.namedarray._typing import duckarray
87

@@ -26,13 +25,14 @@ def array_strategy_fn(*, shape, dtype):
2625
def assert_equal(a, b):
2726
npt.assert_equal(a, b)
2827

29-
@staticmethod
30-
def assert_dimension_indexers_equal(a, b):
28+
def assert_dimension_indexers_equal(self, a, b):
3129
assert type(a) is type(b), f"types don't match: {type(a)} vs {type(b)}"
3230

3331
if isinstance(a, dict):
3432
assert a.keys() == b.keys(), f"Different dimensions: {list(a)} vs {list(b)}"
3533

36-
assert all(np.equal(a[k], b[k]) for k in a), "Differing indexers"
34+
assert all(
35+
self.xp.all(self.xp.equal(a[k], b[k])) for k in a
36+
), "Differing indexers"
3737
else:
3838
npt.assert_equal(a, b)

0 commit comments

Comments
 (0)