From b89c79e676735daff79e9a2bcb345001f086241b Mon Sep 17 00:00:00 2001
From: Isobel Marguarethe Romero-Shaw <isobel.romero-shaw@ligo.org>
Date: Tue, 30 Apr 2019 20:15:46 -0500
Subject: [PATCH] Updating default dynesty settings

---
 bilby/core/sampler/dynesty.py | 12 ++++++------
 test/sampler_test.py          | 14 +++++++-------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/bilby/core/sampler/dynesty.py b/bilby/core/sampler/dynesty.py
index 2360a3182..e0abc5a0a 100644
--- a/bilby/core/sampler/dynesty.py
+++ b/bilby/core/sampler/dynesty.py
@@ -44,7 +44,7 @@ class Dynesty(NestedSampler):
 
     Other Parameters
     ----------------
-    npoints: int, (250)
+    npoints: int, (1000)
         The number of live points, note this can also equivalently be given as
         one of [nlive, nlives, n_live_points]
     bound: {'none', 'single', 'multi', 'balls', 'cubes'}, ('multi')
@@ -72,18 +72,18 @@ class Dynesty(NestedSampler):
     """
     default_kwargs = dict(bound='multi', sample='rwalk',
                           verbose=True, periodic=None,
-                          check_point_delta_t=600, nlive=500,
-                          first_update=None,
+                          check_point_delta_t=600, nlive=1000,
+                          first_update=None, walks=None,
                           npdim=None, rstate=None, queue_size=None, pool=None,
                           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,
-                          walks=None, update_interval=None, print_func=None,
+                          update_interval=None, print_func=None,
                           dlogz=0.1, maxiter=None, maxcall=None,
                           logl_max=np.inf, add_live=True, print_progress=True,
-                          save_bounds=True)
+                          save_bounds=False)
 
     def __init__(self, likelihood, priors, outdir='outdir', label='label', use_ratio=False, plot=False,
                  skip_import_verification=False, check_point=True, n_check_point=None, check_point_delta_t=600,
@@ -135,7 +135,7 @@ class Dynesty(NestedSampler):
 
     def _verify_kwargs_against_default_kwargs(self):
         if not self.kwargs['walks']:
-            self.kwargs['walks'] = self.ndim * 5
+            self.kwargs['walks'] = self.ndim * 10
         if not self.kwargs['update_interval']:
             self.kwargs['update_interval'] = int(0.6 * self.kwargs['nlive'])
         if not self.kwargs['print_func']:
diff --git a/test/sampler_test.py b/test/sampler_test.py
index 7ca3feba5..f299d2347 100644
--- a/test/sampler_test.py
+++ b/test/sampler_test.py
@@ -147,14 +147,14 @@ class TestDynesty(unittest.TestCase):
 
     def test_default_kwargs(self):
         expected = dict(bound='multi', sample='rwalk', periodic=None, verbose=True,
-                        check_point_delta_t=600, nlive=500, first_update=None,
+                        check_point_delta_t=600, nlive=1000, first_update=None,
                         npdim=None, rstate=None, queue_size=None, pool=None,
                         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,
-                        logl_max=np.inf, add_live=True, print_progress=True, save_bounds=True,
-                        walks=10, update_interval=300, print_func='func')
+                        logl_max=np.inf, add_live=True, print_progress=True, save_bounds=False,
+                        walks=20, update_interval=600, print_func='func')
         self.sampler.kwargs['print_func'] = 'func'  # set this manually as this is not testable otherwise
         self.assertListEqual([0], self.sampler.kwargs['periodic'])  # Check this separately
         self.sampler.kwargs['periodic'] = None  # The dict comparison can't handle lists
@@ -166,19 +166,19 @@ class TestDynesty(unittest.TestCase):
 
     def test_translate_kwargs(self):
         expected = dict(bound='multi', sample='rwalk', periodic=[0], verbose=True,
-                        check_point_delta_t=600, nlive=250, first_update=None,
+                        check_point_delta_t=600, nlive=1000, first_update=None,
                         npdim=None, rstate=None, queue_size=None, pool=None,
                         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,
-                        logl_max=np.inf, add_live=True, print_progress=True, save_bounds=True,
-                        walks=10, update_interval=300, print_func='func')
+                        logl_max=np.inf, add_live=True, print_progress=True, save_bounds=False,
+                        walks=20, update_interval=600, print_func='func')
 
         for equiv in bilby.core.sampler.base_sampler.NestedSampler.npoints_equiv_kwargs:
             new_kwargs = self.sampler.kwargs.copy()
             del new_kwargs['nlive']
-            new_kwargs[equiv] = 250
+            new_kwargs[equiv] = 1000
             self.sampler.kwargs = new_kwargs
             self.sampler.kwargs['print_func'] = 'func'  # set this manually as this is not testable otherwise
             self.assertDictEqual(expected, self.sampler.kwargs)
-- 
GitLab