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

Method test_in_nocopy

numpy/f2py/tests/test_array_from_pyobj.py:422–429  ·  view source on GitHub ↗

Test if intent(in) array can be passed without copies

(self, write, order, inp)

Source from the content-addressed store, hash-verified

420 @pytest.mark.parametrize("order", ["C", "F"])
421 @pytest.mark.parametrize("inp", ["2seq", "23seq"])
422 def test_in_nocopy(self, write, order, inp):
423 """Test if intent(in) array can be passed without copies"""
424 seq = getattr(self, "num" + inp)
425 obj = np.array(seq, dtype=self.type.dtype, order=order)
426 obj.setflags(write=(write == 'w'))
427 a = self.array(obj.shape,
428 ((order == 'C' and intent.in_.c) or intent.in_), obj)
429 assert a.has_shared_memory()
430
431 def test_inout_2seq(self):
432 obj = np.array(self.num2seq, dtype=self.type.dtype)

Callers

nothing calls this directly

Calls 1

has_shared_memoryMethod · 0.80

Tested by

no test coverage detected