Skip to content

Commit af40047

Browse files
committed
fix another test
1 parent f5e52c9 commit af40047

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

tests/test_resume.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def fit_main(fname,
6363
pool=pool,
6464
queue_size=queue_size,
6565
blob=True)
66+
kw = dict(n_effective=NEFF0)
6667
else:
6768
dns = dynesty.NestedSampler(curlike,
6869
curpt,
@@ -72,11 +73,11 @@ def fit_main(fname,
7273
pool=pool,
7374
queue_size=queue_size,
7475
blob=True)
75-
neff = None
76+
kw = dict()
7677
dns.run_nested(checkpoint_file=fname,
7778
print_progress=printing,
7879
checkpoint_every=checkpoint_every,
79-
n_effective=neff)
80+
**kw)
8081
return dns
8182

8283

@@ -91,7 +92,11 @@ def fit_resume(fname, dynamic, prev_logz, pool=None, neff=NEFF0):
9192
dns = dynesty.NestedSampler.restore(fname, pool=pool)
9293
neff = None
9394
print('resuming', file=sys.stderr)
94-
dns.run_nested(resume=True, n_effective=neff, print_progress=printing)
95+
if dynamic:
96+
kw = dict(n_effective=neff)
97+
else:
98+
kw = dict()
99+
dns.run_nested(resume=True, print_progress=printing, **kw)
95100
# verify that the logz value is *identical*
96101
if prev_logz is not None:
97102
assert dns.results['logz'][-1] == prev_logz
@@ -132,14 +137,12 @@ def getlogz(fname, save_every):
132137
return cache.dt, cache.logz
133138

134139

135-
@pytest.mark.parametrize("dynamic,delay_frac,with_pool,dyn_pool",
136-
itertools.chain(
137-
itertools.product([False, True],
138-
[.2, .5, .75, .9], [False],
139-
[False]),
140-
itertools.product([False, True], [.5], [True],
141-
[False]),
142-
[[True, .5, True, True]]))
140+
@pytest.mark.parametrize(
141+
"dynamic,delay_frac,with_pool,dyn_pool",
142+
itertools.chain(
143+
itertools.product([False, True], [.2, .5, .75, .9], [False], [False]),
144+
itertools.product([False, True], [.5], [True], [False]),
145+
[[True, .5, True, True]]))
143146
@pytest.mark.xdist_group(name="resume_group")
144147
def test_resume(dynamic, delay_frac, with_pool, dyn_pool):
145148
"""

0 commit comments

Comments
 (0)