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

Method test_colorbar

xarray/tests/test_plot.py:2305–2317  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2303
2304 @pytest.mark.slow
2305 def test_colorbar(self) -> None:
2306 vmin = self.darray.values.min()
2307 vmax = self.darray.values.max()
2308 expected = np.array((vmin, vmax))
2309
2310 self.g.map_dataarray(xplt.imshow, "x", "y")
2311
2312 for image in plt.gcf().findobj(mpl.image.AxesImage):
2313 assert isinstance(image, mpl.image.AxesImage)
2314 clim = np.array(image.get_clim())
2315 assert np.allclose(expected, clim)
2316
2317 assert 1 == len(find_possible_colorbars())
2318
2319 def test_colorbar_scatter(self) -> None:
2320 ds = Dataset({"a": (("x", "y"), np.arange(4).reshape(2, 2))})

Callers

nothing calls this directly

Calls 4

find_possible_colorbarsFunction · 0.85
map_dataarrayMethod · 0.80
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected