Skip to content

Commit 78bf0e4

Browse files
committed
add an extra test
1 parent fc1694e commit 78bf0e4

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

tests/test_pool.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def test_pool_args2():
178178
terminator(pool)
179179

180180

181-
@pytest.mark.parametrize('sample', ['slice', 'rwalk', 'rslice'])
181+
@pytest.mark.parametrize('sample', ['slice', 'rwalk', 'rslice', 'unif'])
182182
def test_pool_samplers(sample):
183183
# this is to test how the samplers are dealing with queue_size>1
184184
rstate = get_rstate()
@@ -223,3 +223,22 @@ def test_usepool(func):
223223
queue_size=100)
224224
sampler.run_nested(maxiter=10000, print_progress=printing)
225225
terminator(pool)
226+
227+
228+
@pytest.mark.parametrize('queue_size', [None, 2])
229+
def test_pool_queue_size(queue_size):
230+
# this is to test how the samplers are dealing with specified
231+
# or unspecified queue_size
232+
rstate = get_rstate()
233+
234+
ctx = mp.get_context('spawn')
235+
with ctx.Pool(2) as pool:
236+
sampler = dynesty.NestedSampler(loglike_gau,
237+
prior_transform_gau,
238+
ndim,
239+
nlive=nlive,
240+
sample='rslice',
241+
pool=pool,
242+
queue_size=queue_size,
243+
rstate=rstate)
244+
sampler.run_nested(print_progress=printing, dlogz=10)

0 commit comments

Comments
 (0)