From 9574558a695340bfd41b64e9c6192c8276ffe9ee Mon Sep 17 00:00:00 2001 From: Gregory Ashton <gregory.ashton@ligo.org> Date: Wed, 25 Mar 2020 17:58:47 +1100 Subject: [PATCH] Rename plot to check_point_plot --- bilby/core/sampler/ptemcee.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bilby/core/sampler/ptemcee.py b/bilby/core/sampler/ptemcee.py index 5aa4ca2c0..67c91f5be 100644 --- a/bilby/core/sampler/ptemcee.py +++ b/bilby/core/sampler/ptemcee.py @@ -45,11 +45,12 @@ class Ptemcee(MCMCSampler): swap_ratios=False) def __init__(self, likelihood, priors, outdir='outdir', label='label', - use_ratio=False, plot=False, skip_import_verification=False, + use_ratio=False, check_point_plot=True, skip_import_verification=False, resume=True, nsamples=5000, burn_in_nact=50, thin_by_nact=1, autocorr_c=5, safety=1, frac_threshold=0.01, autocorr_tol=50, min_tau=1, check_point_deltaT=600, - threads=1, exit_code=77, store_walkers=False, **kwargs): + threads=1, exit_code=77, plot=False, store_walkers=False, + **kwargs): super(Ptemcee, self).__init__( likelihood=likelihood, priors=priors, outdir=outdir, label=label, use_ratio=use_ratio, plot=plot, @@ -73,6 +74,7 @@ class Ptemcee(MCMCSampler): self.threads = threads self.store_walkers = store_walkers + self.check_point_plot = check_point_plot self.resume_file = "{}/{}_checkpoint_resume.pickle".format(self.outdir, self.label) self.exit_code = exit_code @@ -243,7 +245,7 @@ class Ptemcee(MCMCSampler): last_checkpoint_s = np.sum(self.time_per_check) if last_checkpoint_s > self.check_point_deltaT: - self.write_current_state(plot=self.plot) + self.write_current_state(plot=self.check_point_plot) # Check if we reached the end without converging if sampler.time == self.sampler_function_kwargs["iterations"]: @@ -254,7 +256,7 @@ class Ptemcee(MCMCSampler): ) # Run a final checkpoint to update the plots and samples - self.write_current_state(plot=self.plot) + self.write_current_state(plot=self.check_point_plot) # Get 0-likelihood samples and store in the result samples = sampler.chain[0, :, :, :] # nwalkers, nsteps, ndim -- GitLab