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

Function test_concat_missing_var

xarray/tests/test_concat.py:154–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152
153
154def test_concat_missing_var() -> None:
155 datasets = create_concat_datasets(2, seed=123)
156 expected = concat(datasets, dim="day")
157 vars_to_drop = ["humidity", "precipitation", "cloud_cover"]
158
159 expected = expected.drop_vars(vars_to_drop)
160 expected["pressure"][..., 2:] = np.nan
161
162 datasets[0] = datasets[0].drop_vars(vars_to_drop)
163 datasets[1] = datasets[1].drop_vars(vars_to_drop + ["pressure"])
164 actual = concat(datasets, dim="day")
165
166 assert list(actual.data_vars.keys()) == ["temperature", "pressure"]
167 assert_identical(actual, expected)
168
169
170@pytest.mark.parametrize("var", ["var4", pytest.param("var5", marks=requires_pyarrow)])

Callers

nothing calls this directly

Calls 5

concatFunction · 0.90
assert_identicalFunction · 0.90
create_concat_datasetsFunction · 0.85
keysMethod · 0.80
drop_varsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…