def read_hdf5(fname, title='h5io', slash='ignore'):
 h5py = _check_h5py()
 if (not op.isfile(fname)):
  raise IOError(('file "%s" not found' % fname))
 if (not isinstance(title, string_types)):
  raise ValueError('title must be a string')
 with h5py.File(fname, mode='r') as fid:
  if (title not in fid):
   raise ValueError(('no "%s" data found' % title))
  if isinstance(fid[title], h5py.Group):
   if ('TITLE' not in fid[title].attrs):
    raise ValueError(('no "%s" data found' % title))
  data = _triage_read(fid[title], slash=slash)
 return data

def read_hdf5 ( fname , title = 'h5io' , slash = 'ignore' ) : h5py = _check_h5py ( ) if ( not op . isfile ( fname ) ) : raise IOError ( ( 'file "%s" not found' % fname ) ) if ( not isinstance ( title , string_types ) ) : raise ValueError ( 'title must be a string' ) with h5py . File ( fname , mode = 'r' ) as fid : if ( title not in fid ) : raise ValueError ( ( 'no "%s" data found' % title ) ) if isinstance ( fid [ title ] , h5py . Group ) : if ( 'TITLE' not in fid [ title ] . attrs ) : raise ValueError ( ( 'no "%s" data found' % title ) ) data = _triage_read ( fid [ title ] , slash = slash ) return data
read python object from hdf5 format using h5py parameters fname : str file to load .