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

Method setUp

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

Source from the content-addressed store, hash-verified

2688class TestDatasetQuiverPlots(PlotTestCase):
2689 @pytest.fixture(autouse=True)
2690 def setUp(self) -> None:
2691 das = [
2692 DataArray(
2693 np.random.randn(3, 3, 4, 4),
2694 dims=["x", "y", "row", "col"],
2695 coords=[range(k) for k in [3, 3, 4, 4]],
2696 )
2697 for _ in [1, 2]
2698 ]
2699 ds = Dataset({"u": das[0], "v": das[1]})
2700 ds.x.attrs["units"] = "xunits"
2701 ds.y.attrs["units"] = "yunits"
2702 ds.col.attrs["units"] = "colunits"
2703 ds.row.attrs["units"] = "rowunits"
2704 ds.u.attrs["units"] = "uunits"
2705 ds.v.attrs["units"] = "vunits"
2706 ds["mag"] = np.hypot(ds.u, ds.v)
2707 self.ds = ds
2708
2709 def test_quiver(self) -> None:
2710 with figure_context():

Callers

nothing calls this directly

Calls 2

DataArrayClass · 0.90
DatasetClass · 0.90

Tested by

no test coverage detected