File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -36,3 +36,17 @@ def test_variable_isel_scalars(self, data):
3636
3737 assert isinstance (actual , self .array_type ), f"wrong type: { type (actual )} "
3838 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 )
You can’t perform that action at this time.
0 commit comments