From 505b0ad3ff45caa6bdfbd5a8678739276aa4049a Mon Sep 17 00:00:00 2001 From: Gregory Ashton <gregory.ashton@ligo.org> Date: Sun, 20 May 2018 16:18:40 +1000 Subject: [PATCH] Make the saved results a dictionary --- tupak/result.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tupak/result.py b/tupak/result.py index 77bd42bb4..3ef71a34c 100644 --- a/tupak/result.py +++ b/tupak/result.py @@ -67,6 +67,9 @@ class Result(dict): else: return '' + def get_result_dictionary(self): + return dict(self) + def save_to_file(self, outdir, label): """ Writes the Result to a deepdish h5 file """ file_name = result_file_name(outdir, label) @@ -80,7 +83,7 @@ class Result(dict): logging.info("Saving result to {}".format(file_name)) try: - deepdish.io.save(file_name, self) + deepdish.io.save(file_name, self.get_result_dictionary()) except Exception as e: logging.error( "\n\n Saving the data has failed with the following message:\n {} \n\n" -- GitLab