def fit_sequence(self, fitting_list):
        """

        :param fitting_list: list of [['string', {kwargs}], ..] with 'string being the specific fitting option and kwargs being the arguments passed to this option
        :return: fitting results
        """
        chain_list = []
        param_list = []
        samples_mcmc, param_mcmc, dist_mcmc = [], [], []
        for i, fitting in enumerate(fitting_list):
            fitting_type = fitting[0]
            kwargs = fitting[1]
            if fitting_type == 'restart':
                self._lens_temp, self._source_temp, self._lens_light_temp, self._ps_temp, self._cosmo_temp = self._updateManager.init_kwargs
            elif fitting_type == 'update_settings':
                self.update_settings(**kwargs)
            elif fitting_type == 'psf_iteration':
                self.psf_iteration(**kwargs)
            elif fitting_type == 'align_images':
                self.align_images(**kwargs)
            elif fitting_type == 'PSO':
                lens_result, source_result, lens_light_result, ps_result, cosmo_result, chain, param = self.pso(**kwargs)
                self._lens_temp, self._source_temp, self._lens_light_temp, self._ps_temp, self._cosmo_temp = lens_result, source_result, lens_light_result, ps_result, cosmo_result
                chain_list.append(chain)
                param_list.append(param)
            elif fitting_type == 'MCMC':
                if not 'init_samples' in kwargs:
                    kwargs['init_samples'] = self._mcmc_init_samples
                elif kwargs['init_samples'] is None:
                    kwargs['init_samples'] = self._mcmc_init_samples
                samples_mcmc, param_mcmc, dist_mcmc = self.mcmc(**kwargs)
                self._mcmc_init_samples = samples_mcmc
            else:
                raise ValueError("fitting_sequence %s is not supported. Please use: 'PSO', 'MCMC', 'psf_iteration', "
                                 "'restart', 'update_settings' or ""'align_images'" % fitting_type)
        return chain_list, param_list, samples_mcmc, param_mcmc, dist_mcmc
def fit_sequence ( self , fitting_list ) : chain_list = [ ] param_list = [ ] samples_mcmc , param_mcmc , dist_mcmc = [ ] , [ ] , [ ] for i , fitting in enumerate ( fitting_list ) : fitting_type = fitting [ 0 ] kwargs = fitting [ 1 ] if fitting_type == 'restart' : self . _lens_temp , self . _source_temp , self . _lens_light_temp , self . _ps_temp , self . _cosmo_temp = self . _updateManager . init_kwargs elif fitting_type == 'update_settings' : self . update_settings ( ** kwargs ) elif fitting_type == 'psf_iteration' : self . psf_iteration ( ** kwargs ) elif fitting_type == 'align_images' : self . align_images ( ** kwargs ) elif fitting_type == 'PSO' : lens_result , source_result , lens_light_result , ps_result , cosmo_result , chain , param = self . pso ( ** kwargs ) self . _lens_temp , self . _source_temp , self . _lens_light_temp , self . _ps_temp , self . _cosmo_temp = lens_result , source_result , lens_light_result , ps_result , cosmo_result chain_list . append ( chain ) param_list . append ( param ) elif fitting_type == 'MCMC' : if not 'init_samples' in kwargs : kwargs [ 'init_samples' ] = self . _mcmc_init_samples elif kwargs [ 'init_samples' ] is None : kwargs [ 'init_samples' ] = self . _mcmc_init_samples samples_mcmc , param_mcmc , dist_mcmc = self . mcmc ( ** kwargs ) self . _mcmc_init_samples = samples_mcmc else : raise ValueError ( "fitting_sequence %s is not supported. Please use: 'PSO', 'MCMC', 'psf_iteration', " "'restart', 'update_settings' or " "'align_images'" % fitting_type ) return chain_list , param_list , samples_mcmc , param_mcmc , dist_mcmc
:param fitting_list: list of [['string', {kwargs}], ..] with 'string being the specific fitting option and kwargs being the arguments passed to this option
        :return: fitting results