From 806bd7d1c2f9f2beec81571272e9980ee7d37320 Mon Sep 17 00:00:00 2001
From: Matthew Pitkin <matthew.pitkin@ligo.org>
Date: Mon, 1 Jun 2020 17:00:17 +0100
Subject: [PATCH] result.py: fix reading of prior from HDF5

---
 bilby/core/result.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/bilby/core/result.py b/bilby/core/result.py
index db69507a..96432e06 100644
--- a/bilby/core/result.py
+++ b/bilby/core/result.py
@@ -23,7 +23,8 @@ from .utils import (
     check_directory_exists_and_if_not_mkdir,
     latex_plot_format, safe_save_figure,
     BilbyJsonEncoder, load_json,
-    move_old_file, get_version_information
+    move_old_file, get_version_information,
+    decode_bilby_json,
 )
 from .prior import Prior, PriorDict, DeltaFunction
 
@@ -368,9 +369,11 @@ class Result(object):
                 # compatibility)
                 if not isinstance(dictionary["priors"], PriorDict):
                     try:
-                        dictionary["priors"] = PriorDict._get_from_json_dict(
-                            dictionary["priors"]
-                        )
+                        priordict = PriorDict()
+                        for key, value in dictionary["priors"].items():
+                            if key not in ["__module__", "__name__", "__prior_dict__"]:
+                                priordict[key] = decode_bilby_json(value)
+                        dictionary["priors"] = priordict
                     except Exception as e:
                         raise IOError(
                             "Unable to parse priors from '{}':\n{}".format(
-- 
GitLab