def save_aspickle(self, fname):
        """
        Saves object as pickle.

        fname : str
            file path.
        """
        if fname[-4:] != '.pkl':
            fname += '.pkl'
        with open(fname, 'wb') as f:
            pickle.dump(self, f, pickle.HIGHEST_PROTOCOL)