コード例 #1
0
ファイル: test_to_hdf5.py プロジェクト: caochensi/nideep
    def test_arr_shape(self):
        
        fpath = os.path.join(self.dir_tmp, 'xarr_sh.h5')
        to.arrays_to_h5_fixed(self.arr, 'x', fpath)

        with h5py.File(fpath, 'r') as h:
            assert_list_equal(h.keys(), ['x'])
            assert_equal(2, len(h['x']))
            for x, y in zip(self.arr, h['x'][:]):
                assert_equal(x.shape, y.shape)
コード例 #2
0
ファイル: test_to_hdf5.py プロジェクト: wzkg2012/nideep
    def test_arr_shape(self):

        fpath = os.path.join(self.dir_tmp, 'xarr_sh.h5')
        to.arrays_to_h5_fixed(self.arr, 'x', fpath)

        with h5py.File(fpath, 'r') as h:
            assert_list_equal(h.keys(), ['x'])
            assert_equal(2, len(h['x']))
            for x, y in zip(self.arr, h['x'][:]):
                assert_equal(x.shape, y.shape)
コード例 #3
0
ファイル: test_to_hdf5.py プロジェクト: caochensi/nideep
 def test_arr_single(self):
     
     # use the module and test it
     fpath = os.path.join(self.dir_tmp, 'xarr1.h5')
     to.arrays_to_h5_fixed([self.arr[0]], 'x', fpath)
     
     with h5py.File(fpath, 'r') as h:
         assert_list_equal(h.keys(), ['x'])
         assert_equal(1, len(h['x']))  
         assert_true(np.all(self.arr[0]==h['x'][:]))
コード例 #4
0
ファイル: test_to_hdf5.py プロジェクト: wzkg2012/nideep
    def test_arr_single(self):

        # use the module and test it
        fpath = os.path.join(self.dir_tmp, 'xarr1.h5')
        to.arrays_to_h5_fixed([self.arr[0]], 'x', fpath)

        with h5py.File(fpath, 'r') as h:
            assert_list_equal(h.keys(), ['x'])
            assert_equal(1, len(h['x']))
            assert_true(np.all(self.arr[0] == h['x'][:]))