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

Method test_data_property

xarray/tests/test_dataarray.py:170–177  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

168 self.dv.variable = self.v # type: ignore[misc]
169
170 def test_data_property(self) -> None:
171 array = DataArray(np.zeros((3, 4)))
172 actual = array.copy()
173 actual.values = np.ones((3, 4))
174 assert_array_equal(np.ones((3, 4)), actual.values)
175 actual.data = 2 * np.ones((3, 4))
176 assert_array_equal(2 * np.ones((3, 4)), actual.data)
177 assert_array_equal(actual.data, actual.values)
178
179 def test_indexes(self) -> None:
180 array = DataArray(np.zeros((2, 3)), [("x", [0, 1]), ("y", ["a", "b", "c"])])

Callers

nothing calls this directly

Calls 2

copyMethod · 0.95
DataArrayClass · 0.90

Tested by

no test coverage detected