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

Add `clean` option to run_sampler

parent 112615a8
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -511,7 +511,7 @@ class Ptemcee(Sampler):
def run_sampler(likelihood, priors=None, label='label', outdir='outdir',
sampler='nestle', use_ratio=None, injection_parameters=None,
conversion_function=None, plot=False, default_priors_file=None,
**kwargs):
clean=None, **kwargs):
"""
The primary interface to easy parameter estimation
......@@ -543,6 +543,8 @@ def run_sampler(likelihood, priors=None, label='label', outdir='outdir',
default_priors_file: str
If given, a file containing the default priors; otherwise defaults to
the tupak defaults for a binary black hole.
clean: bool
If given, override the command line interface `clean` option.
**kwargs:
All kwargs are passed directly to the samplers `run` function
......@@ -552,6 +554,9 @@ def run_sampler(likelihood, priors=None, label='label', outdir='outdir',
An object containing the results
"""
if clean:
utils.command_line_args.clean = clean
utils.check_directory_exists_and_if_not_mkdir(outdir)
implemented_samplers = get_implemented_samplers()
......
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