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

Method test_convenient_facetgrid

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

Source from the content-addressed store, hash-verified

2228 # not just left and bottom
2229 @pytest.mark.filterwarnings("ignore:tight_layout cannot")
2230 def test_convenient_facetgrid(self) -> None:
2231 a = easy_array((10, 15, 4))
2232 d = DataArray(a, dims=["y", "x", "z"])
2233 g = self.plotfunc(d, x="x", y="y", col="z", col_wrap=2) # type: ignore[arg-type] # https://github.com/python/mypy/issues/15015
2234
2235 assert_array_equal(g.axs.shape, [2, 2])
2236 for (_y, _x), ax in np.ndenumerate(g.axs):
2237 assert ax.has_data()
2238 assert "y" == ax.get_ylabel()
2239 assert "x" == ax.get_xlabel()
2240
2241 # Inferring labels
2242 g = self.plotfunc(d, col="z", col_wrap=2) # type: ignore[arg-type] # https://github.com/python/mypy/issues/15015
2243 assert_array_equal(g.axs.shape, [2, 2])
2244 for (_y, _x), ax in np.ndenumerate(g.axs):
2245 assert ax.has_data()
2246 assert "y" == ax.get_ylabel()
2247 assert "x" == ax.get_xlabel()
2248
2249 def test_viridis_cmap(self) -> None:
2250 return super().test_viridis_cmap()

Callers

nothing calls this directly

Calls 3

DataArrayClass · 0.90
easy_arrayFunction · 0.85
has_dataMethod · 0.80

Tested by

no test coverage detected