def __init__(self, fit_pars):
    '\n        Parameters\n        ----------\n        fit_pars : str -or- dictionary\n            If a string, `fit_pars` should be a path to a parameter file which\n            can be parsed by readparam.readParam, to construct a dictionary.\n            Alternatively, an actual dictionary can be passed in. See README.md\n            for a description of parameters.\n        '
    if (type(fit_pars) is str):
        fit_pars = readparam.readParam(fit_pars, default_pars=self.DEFAULT_FIT_PARS)
    self.fit_pars = dict(self.DEFAULT_FIT_PARS)
    self.fit_pars.update(fit_pars)
    assert (type(self.fit_pars) is dict)
    self.fit_pars['par_log_file'] = os.path.join(self.fit_pars['results_dir'], self.fit_pars['par_log_file'])
    self.data_dict = tabletool.build_data_dict_from_table(self.fit_pars['data_table'], historical=self.fit_pars['historical_colnames'])
    self.ncomps = 1
    if (self.fit_pars['component'] == 'sphere'):
        self.Component = component.SphereComponent
        self.fit_pars['Component'] = component.SphereComponent
    elif (self.fit_pars['component'] == 'ellip'):
        self.Component = component.EllipComponent
        self.fit_pars['Component'] = component.EllipComponent
    else:
        raise UserWarning('Unknown (or missing) component parametrisation')
    if (os.path.exists(self.fit_pars['results_dir']) and (not self.fit_pars['overwrite_prev_run'])):
        rdir = '{}_{}'.format(self.fit_pars['results_dir'].rstrip('/'), random.randint(0, 1000))
    else:
        rdir = self.fit_pars['results_dir']
    self.rdir = (rdir.rstrip('/') + '/')
    mkpath(self.rdir)
    assert os.access(self.rdir, os.W_OK)
    readparam.log_used_pars(self.fit_pars, default_pars=self.DEFAULT_FIT_PARS)
    logging.basicConfig(filename=(self.rdir + 'log.log'), level=logging.INFO)
    log_message(msg='Component count cap set to {}'.format(self.fit_pars['max_comp_count']), symbol='+', surround=True)
    log_message(msg='Iteration count cap set to {}'.format(self.fit_pars['max_em_iterations']), symbol='+', surround=True)
    print('printed')
    if (self.fit_pars['nthreads'] > (cpu_count() - 1)):
        raise UserWarning('Provided nthreads exceeds cpu count on this machine. Rememeber to leave one cpu free for master thread!')
    if (self.fit_pars['nthreads'] > 1):
        log_message(('pool = Pool(nthreads) = pool(%d)' % self.fit_pars['nthreads']))
        self.fit_pars['pool'] = Pool(self.fit_pars['nthreads'])
    else:
        self.pool = None
    if (self.fit_pars['trace_orbit_func'] == 'dummy_trace_orbit_func'):
        self.fit_pars['trace_orbit_func'] = dummy_trace_orbit_func
    elif (self.fit_pars['trace_orbit_func'] == 'epicyclic'):
        log_message('trace_orbit: epicyclic')
        self.fit_pars['trace_orbit_func'] = traceorbit.trace_epicyclic_orbit
    else:
        self.fit_pars['trace_orbit_func'] = traceorbit.trace_cartesian_orbit
    if (type(self.fit_pars['init_comps']) is str):
        self.fit_pars['init_comps'] = self.Component.load_raw_components(self.fit_pars['init_comps'])
        self.ncomps = len(self.fit_pars['init_comps'])
        print('Managed to load in init_comps from file')
    else:
        self.fit_pars['init_comps'] = None
        print("'Init comps' is initialised as none")
Parameters
----------
fit_pars : str -or- dictionary
    If a string, `fit_pars` should be a path to a parameter file which
    can be parsed by readparam.readParam, to construct a dictionary.
    Alternatively, an actual dictionary can be passed in. See README.md
    for a description of parameters.
def __init__(self, fit_pars):
    '\n        Parameters\n        ----------\n        fit_pars : str -or- dictionary\n            If a string, `fit_pars` should be a path to a parameter file which\n            can be parsed by readparam.readParam, to construct a dictionary.\n            Alternatively, an actual dictionary can be passed in. See README.md\n            for a description of parameters.\n        '
    if (type(fit_pars) is str):
        fit_pars = readparam.readParam(fit_pars, default_pars=self.DEFAULT_FIT_PARS)
    self.fit_pars = dict(self.DEFAULT_FIT_PARS)
    self.fit_pars.update(fit_pars)
    assert (type(self.fit_pars) is dict)
    self.fit_pars['par_log_file'] = os.path.join(self.fit_pars['results_dir'], self.fit_pars['par_log_file'])
    self.data_dict = tabletool.build_data_dict_from_table(self.fit_pars['data_table'], historical=self.fit_pars['historical_colnames'])
    self.ncomps = 1
    if (self.fit_pars['component'] == 'sphere'):
        self.Component = component.SphereComponent
        self.fit_pars['Component'] = component.SphereComponent
    elif (self.fit_pars['component'] == 'ellip'):
        self.Component = component.EllipComponent
        self.fit_pars['Component'] = component.EllipComponent
    else:
        raise UserWarning('Unknown (or missing) component parametrisation')
    if (os.path.exists(self.fit_pars['results_dir']) and (not self.fit_pars['overwrite_prev_run'])):
        rdir = '{}_{}'.format(self.fit_pars['results_dir'].rstrip('/'), random.randint(0, 1000))
    else:
        rdir = self.fit_pars['results_dir']
    self.rdir = (rdir.rstrip('/') + '/')
    mkpath(self.rdir)
    assert os.access(self.rdir, os.W_OK)
    readparam.log_used_pars(self.fit_pars, default_pars=self.DEFAULT_FIT_PARS)
    logging.basicConfig(filename=(self.rdir + 'log.log'), level=logging.INFO)
    log_message(msg='Component count cap set to {}'.format(self.fit_pars['max_comp_count']), symbol='+', surround=True)
    log_message(msg='Iteration count cap set to {}'.format(self.fit_pars['max_em_iterations']), symbol='+', surround=True)
    print('printed')
    if (self.fit_pars['nthreads'] > (cpu_count() - 1)):
        raise UserWarning('Provided nthreads exceeds cpu count on this machine. Rememeber to leave one cpu free for master thread!')
    if (self.fit_pars['nthreads'] > 1):
        log_message(('pool = Pool(nthreads) = pool(%d)' % self.fit_pars['nthreads']))
        self.fit_pars['pool'] = Pool(self.fit_pars['nthreads'])
    else:
        self.pool = None
    if (self.fit_pars['trace_orbit_func'] == 'dummy_trace_orbit_func'):
        self.fit_pars['trace_orbit_func'] = dummy_trace_orbit_func
    elif (self.fit_pars['trace_orbit_func'] == 'epicyclic'):
        log_message('trace_orbit: epicyclic')
        self.fit_pars['trace_orbit_func'] = traceorbit.trace_epicyclic_orbit
    else:
        self.fit_pars['trace_orbit_func'] = traceorbit.trace_cartesian_orbit
    if (type(self.fit_pars['init_comps']) is str):
        self.fit_pars['init_comps'] = self.Component.load_raw_components(self.fit_pars['init_comps'])
        self.ncomps = len(self.fit_pars['init_comps'])
        print('Managed to load in init_comps from file')
    else:
        self.fit_pars['init_comps'] = None
        print("'Init comps' is initialised as none")