(self)
| 7203 | assert_identical(expected, actual) |
| 7204 | |
| 7205 | def test_combine_first(self) -> None: |
| 7206 | dsx0 = DataArray([0, 0], [("x", ["a", "b"])]).to_dataset(name="dsx0") |
| 7207 | dsx1 = DataArray([1, 1], [("x", ["b", "c"])]).to_dataset(name="dsx1") |
| 7208 | |
| 7209 | actual = dsx0.combine_first(dsx1) |
| 7210 | expected = Dataset( |
| 7211 | {"dsx0": ("x", [0, 0, np.nan]), "dsx1": ("x", [np.nan, 1, 1])}, |
| 7212 | coords={"x": ["a", "b", "c"]}, |
| 7213 | ) |
| 7214 | assert_equal(actual, expected) |
| 7215 | assert_equal(actual, xr.merge([dsx0, dsx1], join="outer")) |
| 7216 | |
| 7217 | # works just like xr.merge([self, other]) |
| 7218 | dsy2 = DataArray([2, 2, 2], [("x", ["b", "c", "d"])]).to_dataset(name="dsy2") |
| 7219 | actual = dsx0.combine_first(dsy2) |
| 7220 | expected = xr.merge([dsy2, dsx0], join="outer") |
| 7221 | assert_equal(actual, expected) |
| 7222 | |
| 7223 | def test_sortby(self) -> None: |
| 7224 | ds = Dataset( |
nothing calls this directly
no test coverage detected