(self)
| 471 | assert_array_equal(arr_view, expected) |
| 472 | |
| 473 | def test_errors(self): |
| 474 | i, j = np.ogrid[:4, :4] |
| 475 | arr = 10 * i + j |
| 476 | with pytest.raises(ValueError, match='cannot contain negative values'): |
| 477 | sliding_window_view(arr, (-1, 3)) |
| 478 | with pytest.raises( |
| 479 | ValueError, |
| 480 | match='must provide window_shape for all dimensions of `x`'): |
| 481 | sliding_window_view(arr, (1,)) |
| 482 | with pytest.raises( |
| 483 | ValueError, |
| 484 | match='Must provide matching length window_shape and axis'): |
| 485 | sliding_window_view(arr, (1, 3, 4), axis=(0, 1)) |
| 486 | with pytest.raises( |
| 487 | ValueError, |
| 488 | match='window shape cannot be larger than input array'): |
| 489 | sliding_window_view(arr, (5, 5)) |
| 490 | |
| 491 | def test_writeable(self): |
| 492 | arr = np.arange(5) |
nothing calls this directly
no test coverage detected