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

Method test_merge_arrays_attrs_default

xarray/tests/test_merge.py:62–76  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

60 xr.merge([data])
61
62 def test_merge_arrays_attrs_default(self):
63 var1_attrs = {"a": 1, "b": 2}
64 var2_attrs = {"a": 1, "c": 3}
65 expected_attrs = {"a": 1, "b": 2}
66
67 data = create_test_data(add_attrs=False)
68 expected = data[["var1", "var2"]].copy()
69 expected.var1.attrs = var1_attrs
70 expected.var2.attrs = var2_attrs
71 expected.attrs = expected_attrs
72
73 data.var1.attrs = var1_attrs
74 data.var2.attrs = var2_attrs
75 actual = xr.merge([data.var1, data.var2])
76 assert_identical(actual, expected)
77
78 @pytest.mark.parametrize(
79 "combine_attrs, var1_attrs, var2_attrs, expected_attrs, expect_exception",

Callers

nothing calls this directly

Calls 4

assert_identicalFunction · 0.90
create_test_dataFunction · 0.85
copyMethod · 0.45
mergeMethod · 0.45

Tested by

no test coverage detected