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

Method test_concat

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

Source from the content-addressed store, hash-verified

652 assert np.all(b2.coords["x"].data == ["a", "b", "c", "d", "e"])
653
654 def test_concat(self):
655 ds1 = xr.Dataset(data_vars={"d": self.sp_xr})
656 ds2 = xr.Dataset(data_vars={"d": self.sp_xr})
657 ds3 = xr.Dataset(data_vars={"d": self.sp_xr})
658 out = xr.concat([ds1, ds2, ds3], dim="x")
659 assert_sparse_equal(
660 out["d"].data,
661 sparse.concatenate([self.sp_ar, self.sp_ar, self.sp_ar], axis=0),
662 )
663
664 out_concat = xr.concat([self.sp_xr, self.sp_xr, self.sp_xr], dim="y")
665 assert_sparse_equal(
666 out_concat.data,
667 sparse.concatenate([self.sp_ar, self.sp_ar, self.sp_ar], axis=1),
668 )
669
670 def test_stack(self):
671 arr = make_xrarray({"w": 2, "x": 3, "y": 4})

Callers

nothing calls this directly

Calls 2

assert_sparse_equalFunction · 0.85
concatMethod · 0.45

Tested by

no test coverage detected