Commit 1f9491a9 authored by Colm Talbot's avatar Colm Talbot

Tupak is dead long live bilby

parent f4899901
......@@ -2,7 +2,7 @@
build/
dist/
docs/_*
tupak.egg-info/
bilby.egg-info/
MANIFEST
*.pyc
*.png
......
......@@ -39,7 +39,7 @@ python-3:
- flake8 .
# Run tests and collect coverage data
- pytest --cov=tupak --ignore=test/gw_example_test.py
- pytest --cov=bilby --ignore=test/gw_example_test.py
- coverage html
- coverage-badge -o coverage_badge.svg -f
......@@ -63,7 +63,7 @@ pages:
script:
- mkdir public/
- mv htmlcov/ public/
- mv /builds/Monash/tupak/coverage_badge.svg public/
- mv /builds/Monash/bilby/coverage_badge.svg public/
- mv docs/_build/html/* public/
artifacts:
paths:
......
......@@ -71,8 +71,8 @@ re-instantiate the Prior in most cases
- Result print function fixed
- Add snr functions as methods of `Interferometer`
- The paths between imports where changed so that calls such as
`tupak.WaveformGenerator` no longer work. Instead, we need to use
`tupak.gw.WaveformGenerator`. This was done to keep things cleaner going
`bilby.WaveformGenerator` no longer work. Instead, we need to use
`bilby.gw.WaveformGenerator`. This was done to keep things cleaner going
forward (when, for example, there may be multiple wfg's).
- Samplers reorganised into individual files.
......@@ -80,9 +80,9 @@ re-instantiate the Prior in most cases
### Added
- InterferometerStrainData now handles both time-domain and frequencu-domain data
- Adds documentation on setting data (https://monash.docs.ligo.org/tupak/transient-gw-data.html)
- Adds documentation on setting data (https://monash.docs.ligo.org/bilby/transient-gw-data.html)
- Checkpointing for `dynesty`: the sampling will be checkpointed every 10 minutes (approximately) and can be resumed.
- Add functionality to plot multiple results in a corner plot, see `tupak.core.result.plot_multiple()`.
- Add functionality to plot multiple results in a corner plot, see `bilby.core.result.plot_multiple()`.
- Likelihood evaluations are now saved along with the posteriors.
### Changed
......@@ -99,15 +99,15 @@ re-instantiate the Prior in most cases
## [0.2.0] 2018-06-17
First `pip` installable version https://pypi.org/project/TUPAK/ .
First `pip` installable version https://pypi.org/project/BILBY/ .
### Added
- Reoriganisation of the directory into `tupak.core` and `tupak.gw`.
- Reoriganisation of the directory into `bilby.core` and `bilby.gw`.
- Reading of frame files.
- Major effort to update all docstrings and add some documentation.
- Marginalized likelihoods.
- Examples of searches for gravitational waves from a Supernova and using a sine-Gaussian.
- A `PriorSet` to handle sets of priors and allows reading in from a standardised prior file (see https://monash.docs.ligo.org/tupak/prior.html).
- A `PriorSet` to handle sets of priors and allows reading in from a standardised prior file (see https://monash.docs.ligo.org/bilby/prior.html).
- A standardised file for storing detector data.
### Removed
......
Contributing to tupak
Contributing to bilby
=================
This is a short guide to help get you started contributing to tupak.
This is a short guide to help get you started contributing to bilby.
Getting started
-------------------
All the code lives in a git repository (for a short introduction to git, see
[this tutorial](https://docs.gitlab.com/ee/gitlab-basics/start-using-git.html))
which is hosted here: https://git.ligo.org/Monash/tupak. If you haven't
which is hosted here: https://git.ligo.org/Monash/bilby. If you haven't
already, you should
[fork](https://docs.gitlab.com/ee/gitlab-basics/fork-project.html) the repository
and clone your fork, i.e., on your local machine run
```bash
$ git clone git@git.ligo.org:albert.einstein/tupak.git
$ git clone git@git.ligo.org:albert.einstein/bilby.git
```
replacing the SSH url to that of your fork. This will create a directory `/tupak`
replacing the SSH url to that of your fork. This will create a directory `/bilby`
containing a local copy of the code. From this directory, you can run
```bash
$ python setup.py develop
```
which will install `tupak` and, because we used `develop` instead of `install`
which will install `bilby` and, because we used `develop` instead of `install`
when you change the code your installed version will automatically be updated.
---
#### Removing previously installed versions
If you have previously installed `tupak` using `pip` (or generally find buggy
If you have previously installed `bilby` using `pip` (or generally find buggy
behaviour). It may be worthwhile purging your system and reinstalling. To do
this, first find out where the module is being imported from: from any
directory that is *not* the source directory, do the following
```bash
$ python
>>> import tupak
>>> print(tupak.__file__)
/home/user/anaconda2/lib/python2.7/site-packages/tupak-0.2.2-py2.7.egg/tupak/__init__.pyc
>>> import bilby
>>> print(bilby.__file__)
/home/user/anaconda2/lib/python2.7/site-packages/bilby-0.2.2-py2.7.egg/bilby/__init__.pyc
```
In the example output above, we see that the directory that module is installed
in. To purge our python installation, run
```bash
$ rm -r /home/user/anaconda2/lib/python2.7/site-packages/tupak*
$ rm -r /home/user/anaconda2/lib/python2.7/site-packages/bilby*
```
You can then verify this was successful by trying to import tupak in the python
You can then verify this was successful by trying to import bilby in the python
interpreter.
Discussion
......@@ -62,13 +62,13 @@ you've found a bug or would like a feature it doesn't have, we want to
hear from you!
Our main forum for discussion is the project's [GitLab issue
tracker](https://git.ligo.org/Monash/tupak/issues). This is the right
tracker](https://git.ligo.org/Monash/bilby/issues). This is the right
place to start a discussion of any of the above or most any other
topic concerning the project.
#### Code of Conduct
Everyone participating in the tupak community, and in particular in our
Everyone participating in the bilby community, and in particular in our
issue tracker, pull requests, and IRC channel, is expected to treat
other people with respect and more generally to follow the guidelines
articulated in the [Python Community Code of
......@@ -165,9 +165,9 @@ At the top level, the code is split into three modules containing the core, grav
```mermaid
graph TD
tupak[tupak] --> core[.core]
tupak --> gw[.gw]
tupak --> hyper[.hyper]
bilby[bilby] --> core[.core]
bilby --> gw[.gw]
bilby --> hyper[.hyper]
```
### Core
......@@ -175,7 +175,7 @@ The core module contains the core inference logic - methods to define a prior, l
```mermaid
graph TD
core[tupak.core] --> prior[.prior]
core[bilby.core] --> prior[.prior]
core --> likelihood[.likelihood]
core --> result[.result]
core --> sampler[.sampler]
......@@ -206,7 +206,7 @@ Note this layout is not comprehensive, for example only a few example "Priors" a
```mermaid
graph TD
gw[tupak.gw] --> gw_likelihood[.likelihood]
gw[bilby.gw] --> gw_likelihood[.likelihood]
gw --> gw_prior[.prior]
gw --> gw_source[.source]
gw --> gw_waveform_generator[.waveform_generator]
......
|pipeline status| |coverage report| |pypi| |version|
Tupak
Bilby
=====
Fulfilling all your gravitational wave dreams.
Fulfilling all your Bayesian inference dreams.
- `Installation
instructions <https://monash.docs.ligo.org/tupak/installation.html>`__
- `Contributing <https://git.ligo.org/Monash/tupak/blob/master/CONTRIBUTING.md>`__
- `Documentation <https://monash.docs.ligo.org/tupak/index.html>`__
- `Issue tracker <https://git.ligo.org/Monash/tupak/issues>`__
instructions <https://monash.docs.ligo.org/bilby/installation.html>`__
- `Contributing <https://git.ligo.org/Monash/bilby/blob/master/CONTRIBUTING.md>`__
- `Documentation <https://monash.docs.ligo.org/bilby/index.html>`__
- `Issue tracker <https://git.ligo.org/Monash/bilby/issues>`__
We encourage you to contribute to the development via a merge request. For
help in creating a merge request, see `this page
<https://docs.gitlab.com/ee/gitlab-basics/add-merge-request.html>`__ or contact
us directly.
.. |pipeline status| image:: https://git.ligo.org/Monash/tupak/badges/master/pipeline.svg
:target: https://git.ligo.org/Monash/tupak/commits/master
.. |coverage report| image:: https://monash.docs.ligo.org/tupak/coverage_badge.svg
:target: https://monash.docs.ligo.org/tupak/htmlcov/
.. |pypi| image:: https://badge.fury.io/py/TUPAK.svg
:target: https://pypi.org/project/TUPAK/
.. |version| image:: https://img.shields.io/pypi/pyversions/tupak.svg
:target: https://pypi.org/project/TUPAK/
.. |pipeline status| image:: https://git.ligo.org/Monash/bilby/badges/master/pipeline.svg
:target: https://git.ligo.org/Monash/bilby/commits/master
.. |coverage report| image:: https://monash.docs.ligo.org/bilby/coverage_badge.svg
:target: https://monash.docs.ligo.org/bilby/htmlcov/
.. |pypi| image:: https://badge.fury.io/py/BILBY.svg
:target: https://pypi.org/project/BILBY/
.. |version| image:: https://img.shields.io/pypi/pyversions/bilby.svg
:target: https://pypi.org/project/BILBY/
"""
tupak
Bilby
=====
Tupak is The User friendly Parameter estimAtion Kode.
Bilby: a user friendly Bayesian inference library.
The aim of tupak is to provide user friendly interface to perform parameter
The aim of bilby is to provide user friendly interface to perform parameter
estimation. It is primarily designed and built for inference of compact
binary coalescence events in interferometric data, but it can also be used for
more general problems.
The code, and many examples are hosted at https://git.ligo.org/Monash/tupak.
The code, and many examples are hosted at https://git.ligo.org/Monash/bilby.
For installation instructions see
https://monash.docs.ligo.org/tupak/installation.html.
https://monash.docs.ligo.org/bilby/installation.html.
"""
......
......@@ -370,7 +370,7 @@ class JointLikelihood(Likelihood):
Parameters
----------
*likelihoods: tupak.core.likelihood.Likelihood
*likelihoods: bilby.core.likelihood.Likelihood
likelihoods to be combined parsed as arguments
"""
self.likelihoods = likelihoods
......
......@@ -11,7 +11,7 @@ from future.utils import iteritems
from .utils import logger
from . import utils
import tupak # noqa
import bilby # noqa
import inspect
......@@ -117,11 +117,11 @@ class PriorSet(OrderedDict):
Parameters
----------
likelihood: tupak.likelihood.GravitationalWaveTransient instance
likelihood: bilby.likelihood.GravitationalWaveTransient instance
Used to infer the set of parameters to fill the prior with
default_priors_file: str, optional
If given, a file containing the default priors; otherwise defaults
to the tupak defaults for a binary black hole.
to the bilby defaults for a binary black hole.
Returns
......@@ -247,7 +247,7 @@ def create_default_prior(name, default_priors_file=None):
Parameter name
default_priors_file: str, optional
If given, a file containing the default priors; otherwise defaults to
the tupak defaults for a binary black hole.
the bilby defaults for a binary black hole.
Return
------
......
......@@ -42,12 +42,12 @@ def read_in_result(outdir=None, label=None, filename=None):
Returns
-------
result: tupak.core.result.Result
result: bilby.core.result.Result
Raises
-------
ValueError: If no filename is given and either outdir or label is None
If no tupak.core.result.Result is found in the path
If no bilby.core.result.Result is found in the path
"""
if filename is None:
......@@ -304,7 +304,7 @@ class Result(dict):
parameters: (list, dict), optional
If given, either a list of the parameter names to include, or a
dictionary of parameter names and their "true" values to plot.
priors: {bool (False), tupak.core.prior.PriorSet}
priors: {bool (False), bilby.core.prior.PriorSet}
If true, add the stored prior probability density functions to the
one-dimensional marginal distributions. If instead a PriorSet
is provided, this will be plotted.
......@@ -341,7 +341,7 @@ class Result(dict):
if utils.command_line_args.test:
return
# tupak default corner kwargs. Overwritten by anything passed to kwargs
# bilby default corner kwargs. Overwritten by anything passed to kwargs
defaults_kwargs = dict(
bins=50, smooth=0.9, label_kwargs=dict(fontsize=16),
title_kwargs=dict(fontsize=16), color='#0072C1',
......@@ -532,7 +532,7 @@ class Result(dict):
Parameters
----------
likelihood: tupak.likelihood.GravitationalWaveTransient, optional
likelihood: bilby.likelihood.GravitationalWaveTransient, optional
GravitationalWaveTransient likelihood used for sampling.
priors: dict, optional
Dictionary of prior object, used to fill in delta function priors.
......@@ -646,7 +646,7 @@ def plot_multiple(results, filename=None, labels=None, colours=None,
Parameters
----------
results: list
A list of `tupak.core.result.Result` objects containing the samples to
A list of `bilby.core.result.Result` objects containing the samples to
plot.
filename: str
File name to save the figure to. If None (default), a filename is
......
import inspect
import sys
import numpy as np
import datetime
from collections import OrderedDict
......@@ -46,9 +45,9 @@ def run_sampler(likelihood, priors=None, label='label', outdir='outdir',
Parameters
----------
likelihood: `tupak.Likelihood`
likelihood: `bilby.Likelihood`
A `Likelihood` instance
priors: `tupak.PriorSet`
priors: `bilby.PriorSet`
A PriorSet/dictionary of the priors for each parameter - missing
parameters will use default priors, if None, all priors will be default
label: str
......@@ -57,7 +56,7 @@ def run_sampler(likelihood, priors=None, label='label', outdir='outdir',
A string used in defining output files
sampler: str, Sampler
The name of the sampler to use - see
`tupak.sampler.get_implemented_samplers()` for a list of available
`bilby.sampler.get_implemented_samplers()` for a list of available
samplers.
Alternatively a Sampler object can be passed
use_ratio: bool (False)
......@@ -72,13 +71,13 @@ def run_sampler(likelihood, priors=None, label='label', outdir='outdir',
Function to apply to posterior to generate additional parameters.
default_priors_file: str
If given, a file containing the default priors; otherwise defaults to
the tupak defaults for a binary black hole.
the bilby defaults for a binary black hole.
clean: bool
If given, override the command line interface `clean` option.
meta_data: dict
If given, adds the key-value pairs to the 'results' object before
saving. For example, if `meta_data={dtype: 'signal'}`. Warning: in case
of conflict with keys saved by tupak, the meta_data keys will be
of conflict with keys saved by bilby, the meta_data keys will be
overwritten.
save: bool
If true, save the priors and results to disk.
......
......@@ -13,7 +13,7 @@ class Sampler(object):
----------
likelihood: likelihood.Likelihood
A object with a log_l method
priors: tupak.core.prior.PriorSet, dict
priors: bilby.core.prior.PriorSet, dict
Priors to be used in the search.
This has attributes for each parameter to be sampled.
external_sampler: str, Sampler, optional
......@@ -34,7 +34,7 @@ class Sampler(object):
-------
likelihood: likelihood.Likelihood
A object with a log_l method
priors: tupak.core.prior.PriorSet
priors: bilby.core.prior.PriorSet
Priors to be used in the search.
This has attributes for each parameter to be sampled.
external_sampler: Module
......@@ -51,7 +51,7 @@ class Sampler(object):
skip_import_verification: bool
Skips the check if the sampler is installed if true. This is
only advisable for testing environments
result: tupak.core.result.Result
result: bilby.core.result.Result
Container for the results of the sampling run
kwargs: dict
Dictionary of keyword arguments that can be used in the external sampler
......@@ -182,7 +182,7 @@ class Sampler(object):
"""
Returns
-------
tupak.core.result.Result: An initial template for the result
bilby.core.result.Result: An initial template for the result
"""
result = Result()
......
......@@ -6,12 +6,12 @@ from .base_sampler import NestedSampler
class Cpnest(NestedSampler):
""" tupak wrapper of cpnest (https://github.com/johnveitch/cpnest)
""" bilby wrapper of cpnest (https://github.com/johnveitch/cpnest)
All positional and keyword arguments (i.e., the args and kwargs) passed to
`run_sampler` will be propagated to `cpnest.CPNest`, see documentation
for that class for further help. Under Keyword Arguments, we list commonly
used kwargs and the tupak defaults.
used kwargs and the bilby defaults.
Keyword Arguments
-----------------
......
......@@ -11,13 +11,13 @@ from .base_sampler import Sampler, NestedSampler
class Dynesty(NestedSampler):
"""
tupak wrapper of `dynesty.NestedSampler`
bilby wrapper of `dynesty.NestedSampler`
(https://dynesty.readthedocs.io/en/latest/)
All positional and keyword arguments (i.e., the args and kwargs) passed to
`run_sampler` will be propagated to `dynesty.NestedSampler`, see
documentation for that class for further help. Under Keyword Arguments, we
list commonly used kwargs and the tupak defaults.
list commonly used kwargs and the bilby defaults.
Keyword Arguments
-----------------
......
......@@ -6,12 +6,12 @@ from .base_sampler import MCMCSampler
class Emcee(MCMCSampler):
"""tupak wrapper emcee (https://github.com/dfm/emcee)
"""bilby wrapper emcee (https://github.com/dfm/emcee)
All positional and keyword arguments (i.e., the args and kwargs) passed to
`run_sampler` will be propagated to `emcee.EnsembleSampler`, see
documentation for that class for further help. Under Keyword Arguments, we
list commonly used kwargs and the tupak defaults.
list commonly used kwargs and the bilby defaults.
Keyword Arguments
-----------------
......
......@@ -6,12 +6,12 @@ from .base_sampler import NestedSampler
class Nestle(NestedSampler):
"""tupak wrapper `nestle.Sampler` (http://kylebarbary.com/nestle/)
"""bilby wrapper `nestle.Sampler` (http://kylebarbary.com/nestle/)
All positional and keyword arguments (i.e., the args and kwargs) passed to
`run_sampler` will be propagated to `nestle.sample`, see documentation for
that function for further help. Under Keyword Arguments, we list commonly
used kwargs and the tupak defaults
used kwargs and the bilby defaults
Keyword Arguments
------------------
......@@ -48,7 +48,7 @@ class Nestle(NestedSampler):
Returns
-------
tupak.core.result.Result: Packaged information about the result
bilby.core.result.Result: Packaged information about the result
"""
import nestle
......@@ -78,7 +78,7 @@ class Nestle(NestedSampler):
Returns
-------
tupak.core.result.Result: Dummy container for sampling results.
bilby.core.result.Result: Dummy container for sampling results.
"""
import nestle
......
......@@ -6,12 +6,12 @@ from . import Emcee
class Ptemcee(Emcee):
"""tupak wrapper ptemcee (https://github.com/willvousden/ptemcee)
"""bilby wrapper ptemcee (https://github.com/willvousden/ptemcee)
All positional and keyword arguments (i.e., the args and kwargs) passed to
`run_sampler` will be propagated to `ptemcee.Sampler`, see
documentation for that class for further help. Under Keyword Arguments, we
list commonly used kwargs and the tupak defaults.
list commonly used kwargs and the bilby defaults.
Keyword Arguments
-----------------
......
......@@ -11,12 +11,12 @@ from .base_sampler import Sampler, MCMCSampler
class Pymc3(MCMCSampler):
""" tupak wrapper of the PyMC3 sampler (https://docs.pymc.io/)
""" bilby wrapper of the PyMC3 sampler (https://docs.pymc.io/)
All keyword arguments (i.e., the kwargs) passed to `run_sampler` will be
propapated to `pymc3.sample` where appropriate, see documentation for that
class for further help. Under Keyword Arguments, we list commonly used
kwargs and the tupak, or where appropriate, PyMC3 defaults.
kwargs and the bilby, or where appropriate, PyMC3 defaults.
Keyword Arguments
-----------------
......@@ -137,7 +137,7 @@ class Pymc3(MCMCSampler):
def setup_prior_mapping(self):
"""
Set the mapping between predefined tupak priors and the equivalent
Set the mapping between predefined bilby priors and the equivalent
PyMC3 distributions.
"""
......@@ -208,7 +208,7 @@ class Pymc3(MCMCSampler):
# GW specific priors
prior_map['UniformComovingVolume'] = prior_map['Interped']
# internally defined mappings for tupak priors
# internally defined mappings for bilby priors
prior_map['DeltaFunction'] = {'internal': self._deltafunction_prior}
prior_map['Sine'] = {'internal': self._sine_prior}
prior_map['Cosine'] = {'internal': self._cosine_prior}
......@@ -217,10 +217,10 @@ class Pymc3(MCMCSampler):
def _deltafunction_prior(self, key, **kwargs):
"""
Map the tupak delta function prior to a single value for PyMC3.
Map the bilby delta function prior to a single value for PyMC3.
"""
from tupak.core.prior import DeltaFunction
from ..prior import DeltaFunction
# check prior is a DeltaFunction
if isinstance(self.priors[key], DeltaFunction):
......@@ -230,10 +230,10 @@ class Pymc3(MCMCSampler):
def _sine_prior(self, key):
"""
Map the tupak Sine prior to a PyMC3 style function
Map the bilby Sine prior to a PyMC3 style function
"""
from tupak.core.prior import Sine
from ..prior import Sine
# check prior is a Sine
if isinstance(self.priors[key], Sine):
......@@ -277,10 +277,10 @@ class Pymc3(MCMCSampler):
def _cosine_prior(self, key):
"""
Map the tupak Cosine prior to a PyMC3 style function
Map the bilby Cosine prior to a PyMC3 style function
"""
from tupak.core.prior import Cosine
from ..prior import Cosine
# check prior is a Cosine
if isinstance(self.priors[key], Cosine):
......@@ -324,10 +324,10 @@ class Pymc3(MCMCSampler):
def _powerlaw_prior(self, key):
"""
Map the tupak PowerLaw prior to a PyMC3 style function
Map the bilby PowerLaw prior to a PyMC3 style function
"""
from tupak.core.prior import PowerLaw
from ..prior import PowerLaw
# check prior is a PowerLaw
if isinstance(self.priors[key], PowerLaw):
......@@ -533,7 +533,7 @@ class Pymc3(MCMCSampler):
def set_likelihood(self):
"""
Convert any tupak likelihoods to PyMC3 distributions.
Convert any bilby likelihoods to PyMC3 distributions.
"""
try:
......@@ -543,9 +543,9 @@ class Pymc3(MCMCSampler):
except ImportError:
raise ImportError("Could not import theano")
from tupak.core.likelihood import GaussianLikelihood, PoissonLikelihood, ExponentialLikelihood, \
from ..likelihood import GaussianLikelihood, PoissonLikelihood, ExponentialLikelihood, \
StudentTLikelihood
from tupak.gw.likelihood import BasicGravitationalWaveTransient, GravitationalWaveTransient
from ...gw.likelihood import BasicGravitationalWaveTransient, GravitationalWaveTransient
# create theano Op for the log likelihood if not using a predefined model
class LogLike(tt.Op):
......
......@@ -2,18 +2,18 @@ from __future__ import absolute_import
from ..utils import check_directory_exists_and_if_not_mkdir
from .base_sampler import NestedSampler
from tupak.core.utils import logger
from ..utils import logger
class Pymultinest(NestedSampler):
"""
tupak wrapper of pymultinest
bilby wrapper of pymultinest
(https://github.com/JohannesBuchner/PyMultiNest)
All positional and keyword arguments (i.e., the args and kwargs) passed to
`run_sampler` will be propagated to `pymultinest.run`, see documentation
for that class for further help. Under Keyword Arguments, we list commonly
used kwargs and the tupak defaults.
used kwargs and the bilby defaults.
Keyword Arguments
------------------
......
......@@ -7,7 +7,7 @@ import argparse
import traceback
import inspect
logger = logging.getLogger('tupak')
logger = logging.getLogger('bilby')
# Constants
......@@ -320,7 +320,7 @@ def setup_logger(outdir=None, label=None, log_level='INFO', print_version=False)
else:
level = int(log_level)
logger = logging.getLogger('tupak')
logger = logging.getLogger('bilby')
logger.propagate = False
logger.setLevel(level)
......@@ -354,7 +354,7 @@ def setup_logger(outdir=None, label=None, log_level='INFO', print_version=False)
version = f.readline().rstrip()
if print_version:
logger.info('Running tupak version: {}'.format(version))
logger.info('Running bilby version: {}'.format(version))
def get_progress_bar(module='tqdm'):
......@@ -427,34 +427,34 @@ def set_up_command_line_arguments():
-----
The command line arguments are passed initially at runtime, but this parser
does not have a `--help` option (i.e., the command line options are
available for any script which includes `import tupak`, but no help command
available for any script which includes `import bilby`, but no help command
is available. This is done to avoid conflicts with child argparse routines
(see the example below).
Example
-------
In the following example we demonstrate how to setup a custom command line for a
project which uses tupak.
project which uses bilby.
# Here we import tupak, which initialses and parses the default command-line args
>>> import tupak
# Here we import bilby, which initialses and parses the default command-line args
>>> import bilby
# The command line arguments can then be accessed via
>>> tupak.core.utils.command_line_args
>>> bilby.core.utils.command_line_args
Namespace(clean=False, log_level=20, quite=False)
# Next, we import argparse and define a new argparse object
>>> import argparse
>>> parser = argparse.ArgumentParser(parents=[tupak.core.utils.command_line_parser])
>>> parser = argparse.ArgumentParser(parents=[bilby.core.utils.command_line_parser])
>>> parser.add_argument('--argument', type=int, default=1)
>>> args = parser.parse_args()
Namespace(clean=False, log_level=20, quite=False, argument=1)
Placing these lines into a script, you'll be able to pass in the usual tupak default
Placing these lines into a script, you'll be able to pass in the usual bilby default
arguments, in addition to `--argument`. To see a list of all options, call the script
with `--help`.
"""
parser = argparse.ArgumentParser(
description="Command line interface for tupak scripts",