diff --git a/tupak/result.py b/tupak/result.py index eb31e70a433232e0a5e0ca316aa2874c4fcc900c..56bf507bac42b86b19815e65542e54048ae9d408 100644 --- a/tupak/result.py +++ b/tupak/result.py @@ -37,7 +37,12 @@ class Result(dict): os.rename(file_name, file_name + '.old') logging.info("Saving result to {}".format(file_name)) - deepdish.io.save(file_name, self) + try: + deepdish.io.save(file_name, self) + except Exception as e: + logging.error( + "\n\n Saving the data has failed with the following message:\n {} \n\n" + .format(e)) def plot_corner(self, save=True, **kwargs): """ Plot a corner-plot using chain-consumer diff --git a/tupak/sampler.py b/tupak/sampler.py index 4c281a188a1040add1e310b8cdc40353b1067c14..61eab712ef7186e82b6483b1da56b451b87c28e9 100644 --- a/tupak/sampler.py +++ b/tupak/sampler.py @@ -401,7 +401,7 @@ def run_sampler(likelihood, priors=None, label='label', outdir='outdir', result.log_bayes_factor = result.logz - result.noise_logz result.injection_parameters = injection_parameters result.fixed_parameter_keys = [key for key in priors if isinstance(key, prior.DeltaFunction)] - result.prior = priors + # result.prior = prior # Removed as this breaks the saving of the data result.samples_to_data_frame() result.save_to_file(outdir=outdir, label=label) return result