joshspeagle / dynesty

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

Index fix #243

Closed segasai closed 3 years ago

segasai commented 3 years ago

The previous implementation of add_batch did not rewind down to the very lowest point (it stopped at the second lowest) The patch fixes that.

Demonstration

nbase=10;nblive=4
i=np.arange(1,nbase-nblive);r=-(nblive+i)+nbase;print(r)
[5 4 3 2 1]
joshspeagle commented 3 years ago

oof -- good catch here. Let me know when this looks good and I should review it.

Thanks for all the contributions!

segasai commented 3 years ago

It is ready to be reviewed as far as I can see.

I've also made a change that ensured that CI is being run on PRs.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 807365728


Totals Coverage Status
Change from base Build 776497136: 1.0%
Covered Lines: 3507
Relevant Lines: 4908

💛 - Coveralls
joshspeagle commented 3 years ago

This all looks good, except I think for the Dynamic Nested Sampling test it's not actually changing the number of live points since the API for that is slightly different. If that's fine, I can just merge in now though.

segasai commented 3 years ago

Yes, I did not necessarily intend to change the number of live points I just wanted to have a test where the dynamic part does considerable amount of work (rather than exit early). And it certainly happens in that test case. But in general the tests may need to be restructured somewhat (in the future).

Also after the merge it'd be nice if you could also check the paths in the coveralls page, to ensure the files are properly shown, as this branch includes updates to that