MCPcopy Index your code
hub / github.com/numpy/numpy / test_errors

Method test_errors

numpy/lib/tests/test_stride_tricks.py:473–489  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 1

sliding_window_viewFunction · 0.90

Tested by

no test coverage detected