joshspeagle / dynesty

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

Results interface #390

Closed segasai closed 2 years ago

segasai commented 2 years ago

This is first part of the PR that I'd like to push in before the next release that allows to get equal weighted samples directly from the results object. I.e.

res=ns.run_nested()
samps = res.samples_equal()

without having to do the manual calculation of weigths etc

For this PR I've had to move a lot of code from results.py to utils.py to avoid cyclic dependency issues. That's not great, but I didn't have a better way.

Docs are still TBD, and feedback is welcome.

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 3054198643


Changes Missing Coverage Covered Lines Changed/Added Lines %
py/dynesty/utils.py 129 136 94.85%
<!-- Total: 130 137 94.89% -->
Totals Coverage Status
Change from base Build 3044831958: 0.01%
Covered Lines: 3836
Relevant Lines: 4235

💛 - Coveralls
segasai commented 2 years ago

I'll aim to merge this tomorrow barring any last minute objections.

joshspeagle commented 2 years ago

None from me!

segasai commented 2 years ago

Thanks. Merging..