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

Method test_concat_attrs

xarray/tests/test_variable.py:525–533  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

523 Variable.concat([v[:, 0], v[:, 1:]], "x")
524
525 def test_concat_attrs(self):
526 # always keep attrs from first variable
527 v = self.cls("a", np.arange(5), {"foo": "bar"})
528 w = self.cls("a", np.ones(5))
529 expected = self.cls(
530 "a", np.concatenate([np.arange(5), np.ones(5)])
531 ).to_base_variable()
532 expected.attrs["foo"] = "bar"
533 assert_identical(expected, Variable.concat([v, w], "a"))
534
535 def test_concat_fixed_len_str(self):
536 # regression test for #217

Callers

nothing calls this directly

Calls 5

assert_identicalFunction · 0.90
arangeMethod · 0.80
to_base_variableMethod · 0.80
clsMethod · 0.45
concatMethod · 0.45

Tested by

no test coverage detected