diff --git a/bilby/core/sampler/emcee.py b/bilby/core/sampler/emcee.py index 9f028c9fc91901344434aaf434c48d190daa50cf..75eaed43da6405808142277a8a4f952029a23d9c 100644 --- a/bilby/core/sampler/emcee.py +++ b/bilby/core/sampler/emcee.py @@ -104,6 +104,13 @@ class Emcee(MCMCSampler): def nsteps(self, nsteps): self.kwargs['iterations'] = nsteps + def __getstate__(self): + # In order to be picklable with dill, we need to discard the pool + # object before trying. + d = self.__dict__ + d["_Sampler__kwargs"]["pool"] = None + return d + def run_sampler(self): import emcee tqdm = get_progress_bar()