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

Fix tests and increase dlogz

parent f96bfe48
No related branches found
No related tags found
1 merge request!564Changes the default number of walks to 30x ndim (previously 10x ndims).
Pipeline #72237 passed
......@@ -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)
......
......@@ -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()
......
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