Skip to content
Snippets Groups Projects
Commit 505b0ad3 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Make the saved results a dictionary

parent 6bf77295
No related branches found
No related tags found
No related merge requests found
...@@ -67,6 +67,9 @@ class Result(dict): ...@@ -67,6 +67,9 @@ class Result(dict):
else: else:
return '' return ''
def get_result_dictionary(self):
return dict(self)
def save_to_file(self, outdir, label): def save_to_file(self, outdir, label):
""" Writes the Result to a deepdish h5 file """ """ Writes the Result to a deepdish h5 file """
file_name = result_file_name(outdir, label) file_name = result_file_name(outdir, label)
...@@ -80,7 +83,7 @@ class Result(dict): ...@@ -80,7 +83,7 @@ class Result(dict):
logging.info("Saving result to {}".format(file_name)) logging.info("Saving result to {}".format(file_name))
try: try:
deepdish.io.save(file_name, self) deepdish.io.save(file_name, self.get_result_dictionary())
except Exception as e: except Exception as e:
logging.error( logging.error(
"\n\n Saving the data has failed with the following message:\n {} \n\n" "\n\n Saving the data has failed with the following message:\n {} \n\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment