# Path: pyLIMA/microlfits.py
# class FitException(Exception):
# class MLFits(object):
#     def __init__(self, event):
#     def mlfit(self, model, method, DE_population_size=10, flux_estimation_MCMC='MCMC', fix_parameters_dictionnary=None,
#               grid_resolution=10, computational_pool=None, binary_regime=None):
#     def check_parameters_boundaries(self):
#     def check_fit(self):
#     def initial_guess(self):
#     def MCMC(self,pool):
#     def chichi_MCMC(self, fit_process_parameters):
#     def differential_evolution(self,pool):
#     def chichi_differential_evolution(self, fit_process_parameters):
#     def lmarquardt(self):
#     def residuals_LM(self, fit_process_parameters):
#     def LM_Jacobian(self, fit_process_parameters):
#     def trust_region_reflective(self):
#     def chichi_telescopes(self, fit_process_parameters):
#     def model_residuals(self, telescope, pyLIMA_parameters):
#     def all_telescope_residuals(self, pyLIMA_parameters):
#     def find_fluxes(self, fit_process_parameters, model):
#     def grids(self):
#     def optimization_on_grid_pixel(self, grid_pixel_parameters):
#     def chichi_grids(self, moving_parameters, *fix_parameters):
#     def reconstruct_fit_process_parameters(self, moving_parameters, fix_parameters):
#     def redefine_parameters_boundaries(self):
#     def construct_the_hyper_grid(self, parameters):
#     def produce_outputs(self):
#     def produce_fit_statistics(self):
#     def produce_pdf(self, output_directory='./'):
#     def produce_latex_table_results(self, output_directory='./'):


import sys
import numpy as np
from pyLIMA import microlfits
        available_methods parameter:

            'LM' : Levenberg-Marquardt algorithm

            'DE' : Differential Evolution algorithm

            'MCMC' : Monte-Carlo Markov Chain algorithm

            More details in the microlfits module

        A microlfits object is added in the event.fits list. For example, if you request two fits,
        you will obtain :

        event.fits=[fit1,fit2]

        More details in the microlfits module.

        """
        available_kind = ['Microlensing']
        available_methods = ['LM', 'DE', 'MCMC', 'GRIDS', 'TRF']

        if self.kind not in available_kind:
            print('ERROR : No possible fit yet for a non microlensing event, sorry :(')
            raise EventException('Can not fit this event kind')

        if method not in available_methods:
            print('ERROR : Wrong method request, has to be a string selected between ' + \
                  ' or '.join(available_methods) + '')
            raise EventException('Wrong fit method request')


# Path: pyLIMA/microlfits.py
# class FitException(Exception):
# class MLFits(object):
#     def __init__(self, event):
#     def mlfit(self, model, method, DE_population_size=10, flux_estimation_MCMC='MCMC', fix_parameters_dictionnary=None,
#               grid_resolution=10, computational_pool=None, binary_regime=None):
#     def check_parameters_boundaries(self):
#     def check_fit(self):
#     def initial_guess(self):
#     def MCMC(self,pool):
#     def chichi_MCMC(self, fit_process_parameters):
#     def differential_evolution(self,pool):
#     def chichi_differential_evolution(self, fit_process_parameters):
#     def lmarquardt(self):
#     def residuals_LM(self, fit_process_parameters):
#     def LM_Jacobian(self, fit_process_parameters):
#     def trust_region_reflective(self):
#     def chichi_telescopes(self, fit_process_parameters):
#     def model_residuals(self, telescope, pyLIMA_parameters):
#     def all_telescope_residuals(self, pyLIMA_parameters):
#     def find_fluxes(self, fit_process_parameters, model):
#     def grids(self):
#     def optimization_on_grid_pixel(self, grid_pixel_parameters):
#     def chichi_grids(self, moving_parameters, *fix_parameters):
#     def reconstruct_fit_process_parameters(self, moving_parameters, fix_parameters):
#     def redefine_parameters_boundaries(self):
#     def construct_the_hyper_grid(self, parameters):
#     def produce_outputs(self):
#     def produce_fit_statistics(self):
#     def produce_pdf(self, output_directory='./'):
#     def produce_latex_table_results(self, output_directory='./'):


# Path: pyLIMA/event.py
import sys
import numpy as np
from pyLIMA import microlfits

        available_methods parameter:

            'LM' : Levenberg-Marquardt algorithm

            'DE' : Differential Evolution algorithm

            'MCMC' : Monte-Carlo Markov Chain algorithm

            More details in the microlfits module

        A microlfits object is added in the event.fits list. For example, if you request two fits,
        you will obtain :

        event.fits=[fit1,fit2]

        More details in the microlfits module.

        """
        available_kind = ['Microlensing']
        available_methods = ['LM', 'DE', 'MCMC', 'GRIDS', 'TRF']

        if self.kind not in available_kind:
            print('ERROR : No possible fit yet for a non microlensing event, sorry :(')
            raise EventException('Can not fit this event kind')

        if method not in available_methods:
            print('ERROR : Wrong method request, has to be a string selected between ' + \
                  ' or '.join(available_methods) + '')
            raise EventException('Wrong fit method request')


        fit = microlfits.MLFits(self)