import pickle


def load(filename):
    """ Loads in a saved instance of the SunXspex class.

    Parameters
    ----------
    filename : str
            Filename for the pickled fitting class.

    Returns
    -------
    Loaded in fitting class.
    """
    with open(filename, 'rb') as f:
        loaded = pickle.load(f)
    return loaded