Cpnest does not run if `resume=False`
This is probably caused by this line https://git.ligo.org/lscsoft/bilby/blob/master/bilby/core/sampler/cpnest.py#L132
15:44 bilby INFO : Using sampler Cpnest with kwargs {'verbose': 1, 'nthreads': 1, 'nlive': 20, 'maxmcmc': 1000, 'seed': None, 'poolsize': 100, 'nhamiltonian': 0, 'resume': False, 'output': 'outdir/cpnest_fast_tutorial/', 'proposals': None, 'n_periodic_checkpoint': None}
Running with 1 parallel threads
Checkpointing Sampler
SMPLR 0 init evolve: 0%| | 0/100 [00:00<?, ?it/s]/home/moritz/Dropbox/PhD/PythonProjects/bilby/bilby/core/prior.py:645: RuntimeWarning: divide by zero encountered in log
return np.log(self.prob(val))
CPNEST: populate samplers: 5%|▌ | 1/20 [00:28<09:02, 28.57s/it]
CPNEST: populate samplers: 10%|█ | 2/20 [00:28<06:01, 20.07s/it]
CPNEST: populate samplers: 15%|█▌ | 3/20 [00:28<03:59, 14.11s/it]
CPNEST: populate samplers: 20%|██ | 4/20 [00:29<02:38, 9.93s/it]
CPNEST: populate samplers: 25%|██▌ | 5/20 [00:29<01:45, 7.00s/it]
CPNEST: populate samplers: 30%|███ | 6/20 [00:29<01:09, 4.94s/it]
CPNEST: populate samplers: 35%|███▌ | 7/20 [00:29<00:45, 3.50s/it]
CPNEST: populate samplers: 40%|████ | 8/20 [00:29<00:30, 2.51s/it]
CPNEST: populate samplers: 45%|████▌ | 9/20 [00:29<00:19, 1.81s/it]
CPNEST: populate samplers: 50%|█████ | 10/20 [00:30<00:13, 1.32s/it]
CPNEST: populate samplers: 55%|█████▌ | 11/20 [00:30<00:08, 1.02it/s]
CPNEST: populate samplers: 60%|██████ | 12/20 [00:30<00:05, 1.36it/s]
CPNEST: populate samplers: 65%|██████▌ | 13/20 [00:30<00:03, 1.77it/s]
CPNEST: populate samplers: 70%|███████ | 14/20 [00:30<00:02, 2.24it/s]
CPNEST: populate samplers: 75%|███████▌ | 15/20 [00:31<00:01, 2.80it/s]
CPNEST: populate samplers: 80%|████████ | 16/20 [00:31<00:01, 3.47it/s]
CPNEST: populate samplers: 85%|████████▌ | 17/20 [00:31<00:00, 3.79it/s]
CPNEST: populate samplers: 90%|█████████ | 18/20 [00:31<00:00, 4.17it/s]
CPNEST: populate samplers: 95%|█████████▌| 19/20 [00:31<00:00, 4.52it/s]
CPNEST: populate samplers: 100%|██████████| 20/20 [00:31<00:00, 4.79it/s]
Traceback (most recent call last):
File "/home/moritz/Dropbox/PhD/PythonProjects/bilby/examples/gw_examples/injection_examples/fast_tutorial.py", line 84, in <module>
injection_parameters=injection_parameters, outdir=outdir, label=label, resume=False, clean=True)
File "/home/moritz/Dropbox/PhD/PythonProjects/bilby/bilby/core/sampler/__init__.py", line 175, in run_sampler
result = sampler.run_sampler()
File "/home/moritz/Dropbox/PhD/PythonProjects/bilby/bilby/core/sampler/cpnest.py", line 103, in run_sampler
out.run()
File "/home/moritz/.local/lib/python3.6/site-packages/cpnest-0.9.7-py3.6-linux-x86_64.egg/cpnest/cpnest.py", line 164, in run
self.NS.nested_sampling_loop()
File "/home/moritz/.local/lib/python3.6/site-packages/cpnest-0.9.7-py3.6-linux-x86_64.egg/cpnest/NestedSampling.py", line 322, in nested_sampling_loop
for i in range(self.n_periodic_checkpoint):
TypeError: 'NoneType' object cannot be interpreted as an integer