diff --git a/bilby/core/sampler/dynesty.py b/bilby/core/sampler/dynesty.py index bc88b02748d4fc525b7bc8b681d30013ccd472c0..80de8ca6377abc55b8995f297bd454584ee19948 100644 --- a/bilby/core/sampler/dynesty.py +++ b/bilby/core/sampler/dynesty.py @@ -55,8 +55,8 @@ class Dynesty(NestedSampler): Method used to sample uniformly within the likelihood constraints, conditioned on the provided bounds walks: int - Number of walks taken if using `sample='rwalk'`, defaults to `ndim * 5` - dlogz: float, (0.1) + Number of walks taken if using `sample='rwalk'`, defaults to `ndim * 30` + dlogz: float, (0.5) Stopping criteria verbose: Bool If true, print information information about the convergence during @@ -85,7 +85,7 @@ class Dynesty(NestedSampler): enlarge=None, bootstrap=None, vol_dec=0.5, vol_check=2.0, facc=0.5, slices=5, update_interval=None, print_func=None, - dlogz=0.1, maxiter=None, maxcall=None, + dlogz=0.5, maxiter=None, maxcall=None, logl_max=np.inf, add_live=True, print_progress=True, save_bounds=False) diff --git a/test/sampler_test.py b/test/sampler_test.py index 6bb4a4a24d51d91a1e1fd36e182c21a5a711deef..1182910921302ed466514cba0f84c5bb3d6bb5cc 100644 --- a/test/sampler_test.py +++ b/test/sampler_test.py @@ -5,7 +5,6 @@ import unittest from mock import MagicMock import numpy as np import os -import sys import shutil import copy @@ -152,16 +151,15 @@ class TestDynesty(unittest.TestCase): use_pool=None, live_points=None, logl_args=None, logl_kwargs=None, ptform_args=None, ptform_kwargs=None, enlarge=None, bootstrap=None, vol_dec=0.5, vol_check=2.0, - facc=0.5, slices=5, dlogz=0.1, maxiter=None, maxcall=None, + facc=0.5, slices=5, dlogz=0.5, maxiter=None, maxcall=None, logl_max=np.inf, add_live=True, print_progress=True, save_bounds=False, - walks=20, update_interval=600, print_func='func') + walks=60, update_interval=600, print_func='func') self.sampler.kwargs['print_func'] = 'func' # set this manually as this is not testable otherwise self.assertListEqual([0, 1], self.sampler.kwargs['periodic']) # Check this separately self.sampler.kwargs['periodic'] = None # The dict comparison can't handle lists for key in self.sampler.kwargs.keys(): - print(key) - print(expected[key]) - print(self.sampler.kwargs[key]) + print("key={}, expected={}, actual={}" + .format(key, expected[key], self.sampler.kwargs[key])) self.assertDictEqual(expected, self.sampler.kwargs) def test_translate_kwargs(self): @@ -171,9 +169,9 @@ class TestDynesty(unittest.TestCase): use_pool=None, live_points=None, logl_args=None, logl_kwargs=None, ptform_args=None, ptform_kwargs=None, enlarge=None, bootstrap=None, vol_dec=0.5, vol_check=2.0, - facc=0.5, slices=5, dlogz=0.1, maxiter=None, maxcall=None, + facc=0.5, slices=5, dlogz=0.5, maxiter=None, maxcall=None, logl_max=np.inf, add_live=True, print_progress=True, save_bounds=False, - walks=20, update_interval=600, print_func='func') + walks=60, update_interval=600, print_func='func') for equiv in bilby.core.sampler.base_sampler.NestedSampler.npoints_equiv_kwargs: new_kwargs = self.sampler.kwargs.copy()