コード例 #1
0
ファイル: dataset_test.py プロジェクト: amundhov/scisoft-core
 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")
コード例 #2
0
ファイル: dataset_test.py プロジェクト: erwindl0/scisoft-core
    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")
コード例 #3
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")