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

Method testProcess3D

tools/swig/test/testFlat.py:38–49  ·  view source on GitHub ↗

Test Process function 3D array

(self)

Source from the content-addressed store, hash-verified

36 self.assertEqual(np.all((x + 1) == y), True)
37
38 def testProcess3D(self):
39 "Test Process function 3D array"
40 print(self.typeStr, "... ", end=' ', file=sys.stderr)
41 process = Flat.__dict__[self.typeStr + "Process"]
42 pack_output = b''
43 for i in range(24):
44 pack_output += struct.pack(self.typeCode, i)
45 x = np.frombuffer(pack_output, dtype=self.typeCode)
46 x = x.reshape((2, 3, 4))
47 y = x.copy()
48 process(y)
49 self.assertEqual(np.all((x + 1) == y), True)
50
51 def testProcess3DTranspose(self):
52 "Test Process function 3D array, FORTRAN order"

Callers

nothing calls this directly

Calls 3

reshapeMethod · 0.80
copyMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected