joshspeagle / dynesty

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

Resolve some issues when using custom sampler #401

Closed ColmTalbot closed 1 year ago

ColmTalbot commented 1 year ago

I ran into some issues trying to use a customised Sampler subclass and with a different proposal distribution.

The changes in this PR allow me to fairly simple define the new class and function to modify the analysis.

ColmTalbot commented 1 year ago

Ping @joshspeagle @segasai

segasai commented 1 year ago

Thanks for adding a new test. that was previously lacking, because I never used this functionality One quick comment is that I think it would be better to make the test not part of test_egg because here IMO we don't particularly care about the complex function to sample, we just care that the code can run (i.e. a single gaussian like in test_gau would do).. Also I'm not sure the test needs to be part of the itertools.product over bounds too (i.e. custom+rslice and multi+sample_rwalk combinations would do). The reason for these comments is that the test execution time is a concern, so one should try to make tests as short as possible.

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 3191988185


Totals Coverage Status
Change from base Build 3185506400: 0.1%
Covered Lines: 3990
Relevant Lines: 4362

💛 - Coveralls
segasai commented 1 year ago

thank for the PR. I've merged the edited version of it in #402