MCPcopy
hub / github.com/pydata/xarray / test_dataarray_repr

Method test_dataarray_repr

xarray/tests/test_dask.py:696–709  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

694 self.assertLazyAndAllClose(eager, lazy)
695
696 def test_dataarray_repr(self):
697 data = build_dask_array("data")
698 nonindex_coord = build_dask_array("coord")
699 a = DataArray(data, dims=["x"], coords={"y": ("x", nonindex_coord)})
700 expected = dedent(
701 f"""\
702 <xarray.DataArray 'data' (x: 1)> Size: 8B
703 {data!r}
704 Coordinates:
705 y (x) int64 8B dask.array<chunksize=(1,), meta=np.ndarray>
706 Dimensions without coordinates: x"""
707 )
708 assert expected == repr(a)
709 assert kernel_call_count == 0 # should not evaluate dask array
710
711 def test_dataset_repr(self):
712 data = build_dask_array("data")

Callers

nothing calls this directly

Calls 2

DataArrayClass · 0.90
build_dask_arrayFunction · 0.85

Tested by

no test coverage detected