Skip to content
Snippets Groups Projects

Adds documentation for implemented samplers

Merged Gregory Ashton requested to merge add-sampler-help into master
All threads resolved!

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Moritz Huebner added 1 commit

    added 1 commit

    Compare with previous version

  • This is all great! We should also add it into the docs, I'm ashamed to say I don't know how to do that, but can the docstrings be directly put into the docs?

  • Colm Talbot resolved all discussions

    resolved all discussions

  • Colm Talbot added 1 commit

    added 1 commit

    Compare with previous version

  • Colm Talbot resolved all discussions

    resolved all discussions

  • Colm Talbot mentioned in merge request !189 (merged)

    mentioned in merge request !189 (merged)

  • @colm.talbot yes they can.

    I think that the samplers docs needs more attention though than just plugging these in. I will get around to it, but lets merge this in for now.

  • Colm Talbot approved this merge request

    approved this merge request

  • Moritz Huebner approved this merge request

    approved this merge request

  • Moritz Huebner mentioned in commit 69311d09

    mentioned in commit 69311d09

  • Please register or sign in to reply
    Loading