Skip to content
Snippets Groups Projects

Resolve "GW-specific result object"

Merged Gregory Ashton requested to merge 251-gw-specific-result-object into master
All threads resolved!
5 files
+ 158
14
Compare changes
  • Side-by-side
  • Inline
Files
5
  • 8bd8ac4a
    Add GW-specific result object · 8bd8ac4a
    Gregory Ashton authored
    - Adds a `result_class` argument to run_sampler which can determine
      which result class to use
    - Extend the `meta_data` use in the gw module to save more information
    - Adds a bilby.gw.result.CBCResult class which unpacks the meta_data to
      provide easy access to commonly required information
@@ -39,7 +39,8 @@ if command_line_args.sampler_help:
def run_sampler(likelihood, priors=None, label='label', outdir='outdir',
sampler='dynesty', use_ratio=None, injection_parameters=None,
conversion_function=None, plot=False, default_priors_file=None,
clean=None, meta_data=None, save=True, **kwargs):
clean=None, meta_data=None, save=True, result_class=None,
**kwargs):
"""
The primary interface to easy parameter estimation
@@ -81,6 +82,10 @@ def run_sampler(likelihood, priors=None, label='label', outdir='outdir',
overwritten.
save: bool
If true, save the priors and results to disk.
result_class: bilby.core.result.Result, or child of
The result class to use. By default, `bilby.core.result.Result` is used,
but objects which inherit from this class can be given providing
additional methods.
**kwargs:
All kwargs are passed directly to the samplers `run` function
@@ -126,7 +131,8 @@ def run_sampler(likelihood, priors=None, label='label', outdir='outdir',
sampler = sampler_class(
likelihood, priors=priors, outdir=outdir, label=label,
injection_parameters=injection_parameters, meta_data=meta_data,
use_ratio=use_ratio, plot=plot, **kwargs)
use_ratio=use_ratio, plot=plot, result_class=result_class,
**kwargs)
else:
print(implemented_samplers)
raise ValueError(
Loading