(self)
| 1191 | assert_equal(actual, expected) |
| 1192 | |
| 1193 | def test_sel_float16(self) -> None: |
| 1194 | data_values = np.arange(4) |
| 1195 | coord_values = np.array([0.0, 0.111, 0.222, 0.333], dtype="float16") |
| 1196 | indices = slice(1, 3) |
| 1197 | |
| 1198 | message = "`pandas.Index` does not support the `float16` dtype.*" |
| 1199 | |
| 1200 | with pytest.warns(FutureWarning, match=message): |
| 1201 | arr = DataArray(data_values, coords={"x": coord_values}, dims="x") |
| 1202 | with pytest.warns(FutureWarning, match=message): |
| 1203 | expected = DataArray( |
| 1204 | data_values[indices], coords={"x": coord_values[indices]}, dims="x" |
| 1205 | ) |
| 1206 | |
| 1207 | actual = arr.sel(x=coord_values[indices]) |
| 1208 | |
| 1209 | assert_equal(actual, expected) |
| 1210 | |
| 1211 | def test_sel_float_multiindex(self) -> None: |
| 1212 | # regression test https://github.com/pydata/xarray/issues/5691 |
nothing calls this directly
no test coverage detected