MCPcopy Create free account
hub / github.com/numpy/numpy / test_subok

Method test_subok

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

Source from the content-addressed store, hash-verified

487 assert_array_equal(arr, np.array([0, 3, 2, 3, 4]))
488
489 def test_subok(self):
490 class MyArray(np.ndarray):
491 pass
492
493 arr = np.arange(5).view(MyArray)
494 assert_(not isinstance(sliding_window_view(arr, 2,
495 subok=False),
496 MyArray))
497 assert_(isinstance(sliding_window_view(arr, 2, subok=True), MyArray))
498 # Default behavior
499 assert_(not isinstance(sliding_window_view(arr, 2), MyArray))
500
501
502def 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