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

Method set_and_check_flag

numpy/core/tests/test_numeric.py:3454–3467  ·  view source on GitHub ↗
(self, flag, dtype, arr)

Source from the content-addressed store, hash-verified

3452 return a
3453
3454 def set_and_check_flag(self, flag, dtype, arr):
3455 if dtype is None:
3456 dtype = arr.dtype
3457 b = np.require(arr, dtype, [flag])
3458 assert_(b.flags[flag])
3459 assert_(b.dtype == dtype)
3460
3461 # a further call to np.require ought to return the same array
3462 # unless OWNDATA is specified.
3463 c = np.require(b, None, [flag])
3464 if flag[0] != 'O':
3465 assert_(c is b)
3466 else:
3467 assert_(c.flags[flag])
3468
3469 def test_require_each(self):
3470

Callers 2

test_require_eachMethod · 0.95
test_preserve_subtypeMethod · 0.95

Calls 1

assert_Function · 0.90

Tested by

no test coverage detected