code: def load_hdf(cls, filename, path='', name=None):
          
          if not os.path.exists(filename):
              raise IOError('{} does not exist.'.format(filename))
          store = pd.HDFStore(filename)
          try:
              samples = store[path+'/samples']
              attrs = store.get_storer(path+'/samples').attrs
          except:
              store.close()
              raise
  
          try:
              ic = attrs.ic_type(attrs.ic_bands)
          except AttributeError:
              ic = attrs.ic_type
  
          use_emcee = attrs.use_emcee
          mnest = True
          try:
              basename = attrs._mnest_basename
          except AttributeError:
              mnest = False
          bounds = attrs._bounds
          priors = attrs._priors
  
          if name is None:
              try:
                  name = attrs.name
              except:
                  name = ''
  
          store.close()
  
          obs = ObservationTree.load_hdf(filename, path+'/obs', ic=ic)
  
          mod = cls(ic, obs=obs,
                    use_emcee=use_emcee, name=name)
          mod._samples = samples
          if mnest:
              mod._mnest_basename = basename
          mod._directory = os.path.dirname(filename)
          return mod
docs: A class method to load a saved StarModel from an HDF5 file.
  
          File must have been created by a call to :func:`StarModel.save_hdf`.
  
          :param filename:
              H5 file to load.
  
          :param path: (optional)
              Path within HDF file.
  
          :return:
              :class:`StarModel` object.