()
| 2022 | |
| 2023 | |
| 2024 | def test_nonzero_method(): |
| 2025 | for shape, chunks in [(0, ()), ((0, 0), (0, 0)), ((15, 16), (4, 5))]: |
| 2026 | x = np.random.default_rng().integers(10, size=shape) |
| 2027 | d = da.from_array(x, chunks=chunks) |
| 2028 | |
| 2029 | x_nz = x.nonzero() |
| 2030 | d_nz = d.nonzero() |
| 2031 | |
| 2032 | assert isinstance(d_nz, type(x_nz)) |
| 2033 | assert len(d_nz) == len(x_nz) |
| 2034 | |
| 2035 | for i in range(len(x_nz)): |
| 2036 | assert_eq(d_nz[i], x_nz[i]) |
| 2037 | |
| 2038 | |
| 2039 | def test_unravel_index_empty(): |