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

Method test_values

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

Source from the content-addressed store, hash-verified

1069 self.d = np.random.random((10, 3)).astype(np.float64)
1070
1071 def test_values(self):
1072 v = Variable(["time", "x"], self.d)
1073 assert_array_equal(v.values, self.d)
1074 assert source_ndarray(v.values) is self.d
1075 with pytest.raises(ValueError):
1076 # wrong size
1077 v.values = np.random.random(5)
1078 d2 = np.random.random((10, 3))
1079 v.values = d2
1080 assert source_ndarray(v.values) is d2
1081
1082 def test_numpy_same_methods(self):
1083 v = Variable([], np.float32(0.0))

Callers

nothing calls this directly

Calls 2

VariableClass · 0.90
source_ndarrayFunction · 0.90

Tested by

no test coverage detected