joshspeagle / dynesty

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

Fixing batch sampling #416

Closed segasai closed 1 year ago

segasai commented 1 year ago

This PR started as a fix to #415 , but because of the issue i thought we need to refactor that code, so I've now completely separated the creation of the batch_sampler in a distinct method that makes things much easier to understand. Also I've added more tests, some of which would have been tripped before the #415 fix

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 3596317313


Changes Missing Coverage Covered Lines Changed/Added Lines %
py/dynesty/sampler.py 1 3 33.33%
py/dynesty/dynamicsampler.py 120 123 97.56%
<!-- Total: 122 127 96.06% -->
Totals Coverage Status
Change from base Build 3559835188: 0.1%
Covered Lines: 4048
Relevant Lines: 4413

💛 - Coveralls
segasai commented 1 year ago

Any comments @joshspeagle, otherwise I'll merge and aim to push a quick release, as the performance issue is pretty substantial.

joshspeagle commented 1 year ago

Unfortunately, I don't have time for a detailed review on this over the next day or two, so I'd say just merge this in to go for the performance improvement (well, some return to some past performance + all the additional changes).

Thanks as always for continuing to clean up all the internals. The code is so much easier to work with now compared to when you first started taking a hammer to things.