()
| 2122 | |
| 2123 | |
| 2124 | def test_nonzero_method(): |
| 2125 | for shape, chunks in [(0, ()), ((0, 0), (0, 0)), ((15, 16), (4, 5))]: |
| 2126 | x = np.random.default_rng().integers(10, size=shape) |
| 2127 | d = da.from_array(x, chunks=chunks) |
| 2128 | |
| 2129 | x_nz = x.nonzero() |
| 2130 | d_nz = d.nonzero() |
| 2131 | |
| 2132 | assert isinstance(d_nz, type(x_nz)) |
| 2133 | assert len(d_nz) == len(x_nz) |
| 2134 | |
| 2135 | for i in range(len(x_nz)): |
| 2136 | assert_eq(d_nz[i], x_nz[i]) |
| 2137 | |
| 2138 | |
| 2139 | def test_unravel_index_empty(): |