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

Method testProcess1D

tools/swig/test/testFlat.py:26–36  ·  view source on GitHub ↗

Test Process function 1D array

(self)

Source from the content-addressed store, hash-verified

24
25 # Test the (type* INPLACE_ARRAY_FLAT, int DIM_FLAT) typemap
26 def testProcess1D(self):
27 "Test Process function 1D array"
28 print(self.typeStr, "... ", end=' ', file=sys.stderr)
29 process = Flat.__dict__[self.typeStr + "Process"]
30 pack_output = b''
31 for i in range(10):
32 pack_output += struct.pack(self.typeCode, i)
33 x = np.frombuffer(pack_output, dtype=self.typeCode)
34 y = x.copy()
35 process(y)
36 self.assertEqual(np.all((x + 1) == y), True)
37
38 def testProcess3D(self):
39 "Test Process function 3D array"

Callers

nothing calls this directly

Calls 2

copyMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected