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

Method test_where_dispatching

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

Source from the content-addressed store, hash-verified

646 self.assertLazyAndAllClose(np.sin(u), np.sin(v))
647
648 def test_where_dispatching(self):
649 a = np.arange(10)
650 b = a > 3
651 x = da.from_array(a, 5)
652 y = da.from_array(b, 5)
653 expected = DataArray(a).where(b)
654 self.assertLazyAndEqual(expected, DataArray(a).where(y))
655 self.assertLazyAndEqual(expected, DataArray(x).where(b))
656 self.assertLazyAndEqual(expected, DataArray(x).where(y))
657
658 def test_simultaneous_compute(self):
659 ds = Dataset({"foo": ("x", range(5)), "bar": ("x", range(5))}).chunk()

Callers

nothing calls this directly

Calls 5

assertLazyAndEqualMethod · 0.95
DataArrayClass · 0.90
arangeMethod · 0.80
from_arrayMethod · 0.45
whereMethod · 0.45

Tested by

no test coverage detected