(self)
| 456 | assert_array_equal(arr_view, expected) |
| 457 | |
| 458 | def test_errors(self): |
| 459 | i, j = np.ogrid[:4, :4] |
| 460 | arr = 10*i + j |
| 461 | with pytest.raises(ValueError, match='cannot contain negative values'): |
| 462 | sliding_window_view(arr, (-1, 3)) |
| 463 | with pytest.raises( |
| 464 | ValueError, |
| 465 | match='must provide window_shape for all dimensions of `x`'): |
| 466 | sliding_window_view(arr, (1,)) |
| 467 | with pytest.raises( |
| 468 | ValueError, |
| 469 | match='Must provide matching length window_shape and axis'): |
| 470 | sliding_window_view(arr, (1, 3, 4), axis=(0, 1)) |
| 471 | with pytest.raises( |
| 472 | ValueError, |
| 473 | match='window shape cannot be larger than input array'): |
| 474 | sliding_window_view(arr, (5, 5)) |
| 475 | |
| 476 | def test_writeable(self): |
| 477 | arr = np.arange(5) |
nothing calls this directly
no test coverage detected