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

Method test__title_for_slice

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

Source from the content-addressed store, hash-verified

4180 array2.to_dataset("x")
4181
4182 def test__title_for_slice(self) -> None:
4183 array = DataArray(
4184 np.ones((4, 3, 2)),
4185 dims=["a", "b", "c"],
4186 coords={"a": range(4), "b": range(3), "c": range(2)},
4187 )
4188 assert "" == array._title_for_slice()
4189 assert "c = 0" == array.isel(c=0)._title_for_slice()
4190 title = array.isel(b=1, c=0)._title_for_slice()
4191 assert title in {"b = 1, c = 0", "c = 0, b = 1"}
4192
4193 a2 = DataArray(np.ones((4, 1)), dims=["a", "b"])
4194 assert "" == a2._title_for_slice()
4195
4196 def test__title_for_slice_truncate(self) -> None:
4197 array = DataArray(np.ones(4))

Callers

nothing calls this directly

Calls 3

_title_for_sliceMethod · 0.95
iselMethod · 0.95
DataArrayClass · 0.90

Tested by

no test coverage detected