MCPcopy Index your code
hub / github.com/pydata/xarray / test_sel_invalid_slice

Method test_sel_invalid_slice

xarray/tests/test_dataarray.py:1147–1150  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1145 assert_equal(actual["new_dim"].drop_vars("x"), ind["new_dim"])
1146
1147 def test_sel_invalid_slice(self) -> None:
1148 array = DataArray(np.arange(10), [("x", np.arange(10))])
1149 with pytest.raises(ValueError, match=r"cannot use non-scalar arrays"):
1150 array.sel(x=slice(array.x))
1151
1152 def test_sel_dataarray_datetime_slice(self) -> None:
1153 # regression test for GH1240

Callers

nothing calls this directly

Calls 3

selMethod · 0.95
DataArrayClass · 0.90
arangeMethod · 0.80

Tested by

no test coverage detected