Skip to content
Snippets Groups Projects
Commit edb7950d authored by Moritz Huebner's avatar Moritz Huebner
Browse files

Merge branch '201-fix-pickling-error' into 'master'

Resolve "Unexpected warning message"

Closes #201

See merge request Monash/bilby!224
parents 0fdeabd4 1452cb4b
No related branches found
No related tags found
No related merge requests found
......@@ -196,6 +196,12 @@ class Result(dict):
if dictionary.get('priors', False):
dictionary['priors'] = {key: str(self.priors[key]) for key in self.priors}
# Convert callable kwargs to strings to avoid pickling issues
if hasattr(self, 'kwargs'):
for key in self.kwargs:
if hasattr(self.kwargs[key], '__call__'):
self.kwargs[key] = str(self.kwargs[key])
try:
deepdish.io.save(file_name, dictionary)
except Exception as e:
......
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