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

Method test_coarsen

xarray/tests/test_sparse.py:756–763  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

754 assert_identical(ds1, ds2)
755
756 def test_coarsen(self):
757 a1 = self.ds_xr
758 a2 = self.sp_xr
759 m1 = a1.coarsen(x=2, boundary="trim").mean() # type: ignore[attr-defined]
760 m2 = a2.coarsen(x=2, boundary="trim").mean() # type: ignore[attr-defined]
761
762 assert isinstance(m2.data, sparse.SparseArray)
763 assert np.allclose(m1.data, m2.data.todense())
764
765 @pytest.mark.xfail(reason="No implementation of np.pad")
766 def test_rolling(self):

Callers

nothing calls this directly

Calls 3

meanMethod · 0.45
coarsenMethod · 0.45
todenseMethod · 0.45

Tested by

no test coverage detected