Beispiel #1
0
 def testCompound(self): # make new datasets with ones
     print "test compound"
     dds = np.ndarrayCB(3, (3,4))
     self.assertEquals(3, dds.itemsize, msg="itemsize incorrect")
     dds = np.ndarrayRGB((3,5))
     print type(dds), dds.dtype, dds.shape
     self.assertEquals(6, dds.itemsize, msg="itemsize incorrect")
     dds = dds.get_red()
     print type(dds), dds.dtype, dds.shape
     self.assertEquals(2, dds.itemsize, msg="itemsize incorrect")
     dds = np.zeros((3,4), np.cint32, 2)
     print type(dds), dds.dtype, dds.shape
     self.assertEquals(8, dds.itemsize, msg="itemsize incorrect")
     dds = np.zeros((3,4), np.cint32(2))
     print type(dds), dds.dtype, dds.shape
     self.assertEquals(8, dds.itemsize, msg="itemsize incorrect")
Beispiel #2
0
    def testCompound(self): # make new datasets with ones
        print "test compound"
#        dds = np.ndarrayCB(3, (3,4))
#        self.assertEquals(3, dds.itemsize, msg="itemsize incorrect")
        dds = np.zeros((3,5), np.rgb)
        print type(dds), dds.dtype, dds.shape
        self.assertEquals(6, dds.itemsize, msg="itemsize incorrect")
        dds = dds.red
        print type(dds), dds.dtype, dds.shape
        self.assertEquals(2, dds.itemsize, msg="itemsize incorrect")
        dds = np.zeros((3,4), np.cint32, elements=2)
        print type(dds), dds.dtype, dds.shape
        self.assertEquals(8, dds.itemsize, msg="itemsize incorrect")
        dds = np.zeros((3,4), np.cint32(2))
        print type(dds), dds.dtype, dds.shape
        self.assertEquals(8, dds.itemsize, msg="itemsize incorrect")
 def testCompound(self):  # make new datasets with ones
     print "test compound"
     #        dds = np.ndarrayCB(3, (3,4))
     #        self.assertEquals(3, dds.itemsize, msg="itemsize incorrect")
     dds = np.zeros((3, 5), np.rgb)
     print type(dds), dds.dtype, dds.shape
     self.assertEquals(6, dds.itemsize, msg="itemsize incorrect")
     dds = dds.red
     print type(dds), dds.dtype, dds.shape
     self.assertEquals(2, dds.itemsize, msg="itemsize incorrect")
     dds = np.zeros((3, 4), np.cint32, elements=2)
     print type(dds), dds.dtype, dds.shape
     self.assertEquals(8, dds.itemsize, msg="itemsize incorrect")
     dds = np.zeros((3, 4), np.cint32(2))
     print type(dds), dds.dtype, dds.shape
     self.assertEquals(8, dds.itemsize, msg="itemsize incorrect")