| 4132 | |
| 4133 | |
| 4134 | def test_no_chunks_2d(): |
| 4135 | X = np.arange(24).reshape((4, 6)) |
| 4136 | x = da.from_array(X, chunks=(2, 2)) |
| 4137 | x._chunks = ((np.nan, np.nan), (np.nan, np.nan, np.nan)) |
| 4138 | |
| 4139 | with warnings.catch_warnings(): |
| 4140 | warnings.simplefilter("ignore", RuntimeWarning) # divide by zero |
| 4141 | assert_eq(da.log(x), np.log(X)) |
| 4142 | assert_eq(x.T, X.T) |
| 4143 | assert_eq(x.sum(axis=0, keepdims=True), X.sum(axis=0, keepdims=True)) |
| 4144 | assert_eq(x.sum(axis=1, keepdims=True), X.sum(axis=1, keepdims=True)) |
| 4145 | assert_eq(x.dot(x.T + 1), X.dot(X.T + 1)) |
| 4146 | |
| 4147 | |
| 4148 | def test_no_chunks_yes_chunks(): |