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

Merge branch 'pickle-dynesty' into 'master'

Remove dynesty from __getstate__

See merge request !513
parents 206f412b ad2f5497
No related branches found
No related tags found
1 merge request!513Remove dynesty from __getstate__
Pipeline #66472 passed with warnings
......@@ -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',
......
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