()
| 163 | |
| 164 | |
| 165 | def test_repr_of_dataarray() -> None: |
| 166 | dataarray = xr.DataArray(np.random.default_rng(0).random((4, 6))) |
| 167 | formatted = xarray_html_only_repr(dataarray) |
| 168 | assert "dim_0" in formatted |
| 169 | # has an expanded data section |
| 170 | assert formatted.count("class='xr-array-in' type='checkbox' checked>") == 1 |
| 171 | # coords, indexes and attrs don't have an items so they'll be omitted |
| 172 | assert "Coordinates" not in formatted |
| 173 | assert "Indexes" not in formatted |
| 174 | assert "Attributes" not in formatted |
| 175 | |
| 176 | assert_consistent_text_and_html_dataarray(dataarray) |
| 177 | |
| 178 | with xr.set_options(display_expand_data=False): |
| 179 | formatted = xarray_html_only_repr(dataarray) |
| 180 | assert "dim_0" in formatted |
| 181 | # has a collapsed data section |
| 182 | assert formatted.count("class='xr-array-in' type='checkbox' checked>") == 0 |
| 183 | # coords, indexes and attrs don't have an items so they'll be omitted |
| 184 | assert "Coordinates" not in formatted |
| 185 | assert "Indexes" not in formatted |
| 186 | assert "Attributes" not in formatted |
| 187 | |
| 188 | |
| 189 | def test_repr_coords_order_of_datarray() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…