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

Function test_concat_multiple_missing_variables

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

Source from the content-addressed store, hash-verified

251
252
253def test_concat_multiple_missing_variables() -> None:
254 datasets = create_concat_datasets(2, seed=123)
255 expected = concat(datasets, dim="day")
256 vars_to_drop = ["pressure", "cloud_cover"]
257
258 expected["pressure"][..., 2:] = np.nan
259 expected["cloud_cover"][..., 2:] = np.nan
260
261 datasets[1] = datasets[1].drop_vars(vars_to_drop)
262 actual = concat(datasets, dim="day")
263
264 # check the variables orders are the same
265 assert list(actual.data_vars.keys()) == [
266 "temperature",
267 "pressure",
268 "humidity",
269 "precipitation",
270 "cloud_cover",
271 ]
272
273 assert_identical(actual, expected)
274
275
276@pytest.mark.parametrize("include_day", [True, False])

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…