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

Function test_mask_indices

numpy/lib/tests/test_twodim_base.py:407–414  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

405
406
407def test_mask_indices():
408 # simple test without offset
409 iu = mask_indices(3, np.triu)
410 a = np.arange(9).reshape(3, 3)
411 assert_array_equal(a[iu], array([0, 1, 2, 4, 5, 8]))
412 # Now with an offset
413 iu1 = mask_indices(3, np.triu, 1)
414 assert_array_equal(a[iu1], array([1, 2, 5]))
415
416
417def test_tril_indices():

Callers

nothing calls this directly

Calls 4

mask_indicesFunction · 0.90
assert_array_equalFunction · 0.90
arrayFunction · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…