Skip to content

Adds documentation for implemented samplers

Gregory Ashton requested to merge add-sampler-help into master

This adds a simple way to help users understand what options are available for different samplers.

  • Adds a CLI arguments sampler-help which prints the docstring for the given sampler
  • Documents each Sampler class with details of the commonly-used kwargs and information on where the kwargs are passed (except for pymc3)

This actually exposes a few inconsistencies in how different samplers are implemented. I'll create issues for this rather than try to fix them here.

Examples

Calling without any arguments

: $ python gaussian_example.py --sampler-help
09:37 tupak INFO    : Running tupak version: 0.2.2: (UNCLEAN) af1e374 2018-09-10 22:43:21 +0100
For help with a specific sampler, call sampler-help with the name of the sampler
Available samplers = ['Cpnest', 'Dynesty', 'Emcee', 'Nestle', 'Ptemcee', 'Pymc3', 'Pymultinest', 'Sampler']

Calling for nestle

$ python gaussian_example.py --sampler-help nestle
09:37 tupak INFO    : Running tupak version: 0.2.2: (UNCLEAN) af1e374 2018-09-10 22:43:21 +0100
Help for sampler "nestle":
tupak wrapper `nestle.Sampler` (http://kylebarbary.com/nestle/)

    All positional and keyword arguments (i.e., the args and kwargs) passed to
    `run_sampler` will be propogated to `nestle.sample`, see documentation for
    that function for further help. Under Keyword Arguments, we list commonly
    used kwargs and the tupak defaults

    Keyword Arguments
   ------------------
    npoints: int
        The number of live points, note this can also equivalently be given as
        one of [nlive, nlives, n_live_points]
    method: {'classic', 'single', 'multi'} ('multi')
        Method used to select new points
    verbose: Bool
        If true, print information information about the convergance during
        sampling

Merge request reports