Commit 0ccf55c7 authored by Gregory Ashton's avatar Gregory Ashton

Merge branch 'pickle-dynesty' into 'master'

Remove dynesty from __getstate__

See merge request lscsoft/bilby!513
parents 206f412b ad2f5497
Pipeline #66472 passed with stages
in 6 minutes and 6 seconds
......@@ -121,6 +121,12 @@ class Dynesty(NestedSampler):
signal.signal(signal.SIGINT, self.write_current_state_and_exit)
signal.signal(signal.SIGALRM, self.write_current_state_and_exit)
def __getstate__(self):
""" For pickle: remove external_sampler, which can be an unpicklable "module" """
state = self.__dict__.copy()
del state['external_sampler']
return state
@property
def sampler_function_kwargs(self):
keys = ['dlogz', 'print_progress', 'print_func', 'maxiter',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment