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

Method test_binary_op_bitshift

xarray/tests/test_dask.py:183–194  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

181 self.assertLazyAndIdentical(u[0] + u, v[0] + v)
182
183 def test_binary_op_bitshift(self) -> None:
184 # bit shifts only work on ints so we need to generate
185 # new eager and lazy vars
186 rng = np.random.default_rng(0)
187 values = rng.integers(low=-10000, high=10000, size=(4, 6))
188 data = da.from_array(values, chunks=(2, 2))
189 u = Variable(("x", "y"), values)
190 v = Variable(("x", "y"), data)
191 self.assertLazyAndIdentical(u << 2, v << 2)
192 self.assertLazyAndIdentical(u << 5, v << 5)
193 self.assertLazyAndIdentical(u >> 2, v >> 2)
194 self.assertLazyAndIdentical(u >> 5, v >> 5)
195
196 def test_repr(self):
197 expected = dedent(

Callers

nothing calls this directly

Calls 3

VariableClass · 0.90
from_arrayMethod · 0.45

Tested by

no test coverage detected