We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac6a786 commit 4e9570cCopy full SHA for 4e9570c
1 file changed
xarray_array_testing/indexing.py
@@ -36,3 +36,17 @@ def test_variable_isel_scalars(self, data):
36
37
assert isinstance(actual, self.array_type), f"wrong type: {type(actual)}"
38
self.assert_equal(actual, expected)
39
+
40
+ @given(st.data())
41
+ def test_variable_isel_slices(self, data):
42
+ variable = data.draw(xrst.variables(array_strategy_fn=self.array_strategy_fn))
43
+ idx = data.draw(indexers(variable.sizes, st.slices))
44
45
+ with self.expected_errors("isel_slices", variable=variable):
46
+ actual = variable.isel(idx).data
47
48
+ raw_indexers = {dim: idx.get(dim, slice(None)) for dim in variable.dims}
49
+ expected = variable.data[*raw_indexers.values()]
50
51
+ assert isinstance(actual, self.array_type), f"wrong type: {type(actual)}"
52
+ self.assert_equal(actual, expected)
0 commit comments