joshspeagle / dynesty

Dynamic Nested Sampling package for computing Bayesian posteriors and evidences
https://dynesty.readthedocs.io/
MIT License
346 stars 76 forks source link

fix the resuming of dynamic nested sampler runs with the pool #439

Closed segasai closed 1 year ago

segasai commented 1 year ago

Addresses #438

What remains to be done here is some kind of test that would prevent this bug from happening. I.e. the test that would verify that after restoring with the pool, it's actually used.

If I won't have an idea for the test, I'll be merging without.

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 4934149245


Changes Missing Coverage Covered Lines Changed/Added Lines %
py/dynesty/dynamicsampler.py 6 7 85.71%
<!-- Total: 22 23 95.65% -->
Files with Coverage Reduction New Missed Lines %
py/dynesty/sampler.py 1 92.38%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 4710600622: -0.03%
Covered Lines: 4161
Relevant Lines: 4526

💛 - Coveralls
segasai commented 1 year ago

Now with the last commit I included the test that properly verifies that the pool is used after the restoration from the checkpoint. That helped me to discover that the first patch only fixed the case if the restoration from the checkpoint happens during the initial run. I think I'll merge this in a couple of days and probably make a new release after that.

joshspeagle commented 1 year ago

Good catch on this and thanks for quickly addressing the bug!

segasai commented 1 year ago

Okay, this thread has two more fixes of issues that I uncovered when running the tests with different seeds.