def rank(self): for shape_t, shape_s, count in self._shapes: shape_ft = Shape(shape_t) shape_fs = Shape(shape_s) self.assertEqual(len(shape_fs), len(shape_t)) self.assertEqual(len(shape_ft), len(shape_t)) self.assertEqual(shape_fs.rank(), len(shape_t)) self.assertEqual(shape_ft.rank(), len(shape_t))
def cube_6D(self): shape = Shape("6x10x5x9x4x12") out_filename_format = "ltmp_{rank}d_{shape}.{format}" out_filename = out_filename_format.format(shape=shape, format=self.file_format, rank=shape.rank()) returncode, output, error = self.run_program( """-e 'cb.linear_cube("{s}")' -o '{o}'""".format( s=shape, o=out_filename_format)) self.assertFileExistsAndHasShape(out_filename, shape)