diff --git a/peyote/sampler.py b/peyote/sampler.py index e926b8b90ccdd6f27a2c32f83e8adfa656c72a5f..be858d9a876a30f5de6b777907910083fc7be6cf 100644 --- a/peyote/sampler.py +++ b/peyote/sampler.py @@ -262,6 +262,12 @@ def run_sampler(likelihood, priors, label='label', outdir='outdir', the loglikelhood. **sampler_kwargs: All kwargs are passed directly to the samplers `run` functino + + Returns + ------ + result, sampler + An object containing the results, and the sampler instance (useful + for creating plots etc) """ implemented_samplers = get_implemented_samplers() diff --git a/test/tests.py b/test/tests.py index fc5ec1e585244b25e9a8e9153e7409af31d320f7..8ddf7ca3f7809379ded42e479d4ff90ad9db1732 100644 --- a/test/tests.py +++ b/test/tests.py @@ -54,8 +54,8 @@ class Test(unittest.TestCase): name='luminosity_distance', lower=dL - 10, upper=dL + 10) } - result = peyote.sampler.run_sampler(likelihood, priors, sampler='nestle', - verbose=False) + result, sampler = peyote.sampler.run_sampler( + likelihood, priors, sampler='nestle', verbose=False) self.assertAlmostEqual(np.mean(result.samples), dL, delta=np.std(result.samples))