Skip to content

Commit

Permalink
BUG: Fix custom prior loading from result file
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvia Biscoveanu authored and mj-will committed May 16, 2024
1 parent 38b3052 commit a51ccb7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bilby/core/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,16 @@ def decode_bilby_json(dct):
try:
cls = getattr(import_module(dct["__module__"]), dct["__name__"])
except AttributeError:
logger.debug(
logger.warning(
"Unknown prior class for parameter {}, defaulting to base Prior object".format(
dct["kwargs"]["name"]
)
)
from ..prior import Prior

for key in list(dct["kwargs"].keys()):
if key not in ["name", "latex_label", "unit", "minimum", "maximum", "boundary"]:
dct["kwargs"].pop(key)
cls = Prior
obj = cls(**dct["kwargs"])
return obj
Expand Down

0 comments on commit a51ccb7

Please sign in to comment.