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

Method test_subok

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

Source from the content-addressed store, hash-verified

502 assert_array_equal(arr, np.array([0, 3, 2, 3, 4]))
503
504 def test_subok(self):
505 class MyArray(np.ndarray):
506 pass
507
508 arr = np.arange(5).view(MyArray)
509 assert_(not isinstance(sliding_window_view(arr, 2,
510 subok=False),
511 MyArray))
512 assert_(isinstance(sliding_window_view(arr, 2, subok=True), MyArray))
513 # Default behavior
514 assert_(not isinstance(sliding_window_view(arr, 2), MyArray))
515
516
517def as_strided_writeable():

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
sliding_window_viewFunction · 0.90
viewMethod · 0.45

Tested by

no test coverage detected