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

Rename plot to check_point_plot

parent 49ce764c
No related branches found
No related tags found
1 merge request!750Improve ptemcee
Pipeline #113276 failed
This commit is part of merge request !750. Comments created here will be created in the context of that merge request.
......@@ -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
......
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