@classmethod<EOL><INDENT>def load_hdf(cls, filename, path='<STR_LIT>', name=None):<DEDENT>
if not os.path.exists(filename):<EOL><INDENT>raise IOError('<STR_LIT>'.format(filename))<EOL><DEDENT>store = pd.HDFStore(filename)<EOL>try:<EOL><INDENT>samples = store[path+'<STR_LIT>']<EOL>attrs = store.get_storer(path+'<STR_LIT>').attrs<EOL><DEDENT>except:<EOL><INDENT>store.close()<EOL>raise<EOL><DEDENT>try:<EOL><INDENT>ic = attrs.ic_type(attrs.ic_bands)<EOL><DEDENT>except AttributeError:<EOL><INDENT>ic = attrs.ic_type<EOL><DEDENT>use_emcee = attrs.use_emcee<EOL>mnest = True<EOL>try:<EOL><INDENT>basename = attrs._mnest_basename<EOL><DEDENT>except AttributeError:<EOL><INDENT>mnest = False<EOL><DEDENT>bounds = attrs._bounds<EOL>priors = attrs._priors<EOL>if name is None:<EOL><INDENT>try:<EOL><INDENT>name = attrs.name<EOL><DEDENT>except:<EOL><INDENT>name = '<STR_LIT>'<EOL><DEDENT><DEDENT>store.close()<EOL>obs = ObservationTree.load_hdf(filename, path+'<STR_LIT>', ic=ic)<EOL>mod = cls(ic, obs=obs,<EOL>use_emcee=use_emcee, name=name)<EOL>mod._samples = samples<EOL>if mnest:<EOL><INDENT>mod._mnest_basename = basename<EOL><DEDENT>mod._directory = os.path.dirname(filename)<EOL>return mod<EOL>
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.