Ejemplo n.º 1
0
    def test03_carray(self):
        """Check dtype accessor for EArray objects."""

        a = self.h5file.create_earray('/',
                                      'array',
                                      atom=FloatAtom(),
                                      shape=[0, 2])
        self.assertEqual(a.dtype, a.atom.dtype)
Ejemplo n.º 2
0
 def test_create_dataset_2(self):
     """Test create a dataset 2D
     """
     r = HDFNode(self.h5, '/', '')
     
     d = r._create_dataSet('d', FloatAtom(), (3, 0))
     d.hdfo.append(((0.1, 0.2, 0.3), (1.1, 1.2, 1.3), (2.1, 2.2, 2.3)))
     self.assertTrue(numpy.all(d.hdfo 
                               == numpy.array(((0.1, 0.2, 0.3),
                                               (1.1, 1.2, 1.3),
                                               (2.1, 2.2, 2.3)))))
     self.assertEqual(d.hdfo.shape, (3, 3))
Ejemplo n.º 3
0
    def test04_vlarray(self):
        """Check dtype accessor for VLArray objects."""

        a = self.h5file.create_vlarray('/', 'array', FloatAtom())
        self.assertEqual(a.dtype, a.atom.dtype)