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

Method testProcess3DTranspose

tools/swig/test/testFlat.py:51–62  ·  view source on GitHub ↗

Test Process function 3D array, FORTRAN order

(self)

Source from the content-addressed store, hash-verified

49 self.assertEqual(np.all((x+1)==y),True)
50
51 def testProcess3DTranspose(self):
52 "Test Process function 3D array, FORTRAN order"
53 print(self.typeStr, "... ", end=' ', file=sys.stderr)
54 process = Flat.__dict__[self.typeStr + "Process"]
55 pack_output = b''
56 for i in range(24):
57 pack_output += struct.pack(self.typeCode,i)
58 x = np.frombuffer(pack_output, dtype=self.typeCode)
59 x.shape = (2,3,4)
60 y = x.copy()
61 process(y.T)
62 self.assertEqual(np.all((x.T+1)==y.T),True)
63
64 def testProcessNoncontiguous(self):
65 "Test Process function with non-contiguous array, which should raise an error"

Callers

nothing calls this directly

Calls 4

printFunction · 0.85
processFunction · 0.85
copyMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected