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

Method test_replace

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

Source from the content-addressed store, hash-verified

637 orig.values = new_data
638
639 def test_replace(self):
640 var = Variable(("x", "y"), [[1.5, 2.0], [3.1, 4.3]], {"foo": "bar"})
641 result = var._replace()
642 assert_identical(result, var)
643
644 new_data = np.arange(4).reshape(2, 2)
645 result = var._replace(data=new_data)
646 assert_array_equal(result.data, new_data)
647
648 def test_real_and_imag(self):
649 v = self.cls("x", np.arange(3) - 1j * np.arange(3), {"foo": "bar"})

Callers

nothing calls this directly

Calls 4

_replaceMethod · 0.95
VariableClass · 0.90
assert_identicalFunction · 0.90
arangeMethod · 0.80

Tested by

no test coverage detected