Test Process function 3D array, FORTRAN order
(self)
| 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 = x.reshape((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" |