Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
lscsoft
bilby
Commits
1f9491a9
Commit
1f9491a9
authored
Oct 02, 2018
by
Colm Talbot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tupak is dead long live bilby
parent
f4899901
Changes
137
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
146 additions
and
147 deletions
+146
-147
.gitignore
.gitignore
+1
-1
.gitlab-ci.yml
.gitlab-ci.yml
+2
-2
CHANGELOG.md
CHANGELOG.md
+7
-7
CONTRIBUTING.md
CONTRIBUTING.md
+19
-19
README.rst
README.rst
+14
-14
bilby/__init__.py
bilby/__init__.py
+5
-5
bilby/core/__init__.py
bilby/core/__init__.py
+0
-0
bilby/core/likelihood.py
bilby/core/likelihood.py
+1
-1
bilby/core/prior.py
bilby/core/prior.py
+4
-4
bilby/core/result.py
bilby/core/result.py
+6
-6
bilby/core/sampler/__init__.py
bilby/core/sampler/__init__.py
+5
-6
bilby/core/sampler/base_sampler.py
bilby/core/sampler/base_sampler.py
+4
-4
bilby/core/sampler/cpnest.py
bilby/core/sampler/cpnest.py
+2
-2
bilby/core/sampler/dynesty.py
bilby/core/sampler/dynesty.py
+2
-2
bilby/core/sampler/emcee.py
bilby/core/sampler/emcee.py
+2
-2
bilby/core/sampler/nestle.py
bilby/core/sampler/nestle.py
+4
-4
bilby/core/sampler/ptemcee.py
bilby/core/sampler/ptemcee.py
+2
-2
bilby/core/sampler/pymc3.py
bilby/core/sampler/pymc3.py
+15
-15
bilby/core/sampler/pymultinest.py
bilby/core/sampler/pymultinest.py
+3
-3
bilby/core/utils.py
bilby/core/utils.py
+11
-11
bilby/gw/__init__.py
bilby/gw/__init__.py
+0
-0
bilby/gw/calibration.py
bilby/gw/calibration.py
+0
-0
bilby/gw/conversion.py
bilby/gw/conversion.py
+4
-4
bilby/gw/detector.py
bilby/gw/detector.py
+11
-11
bilby/gw/detectors/CE.interferometer
bilby/gw/detectors/CE.interferometer
+0
-0
bilby/gw/detectors/ET.interferometer
bilby/gw/detectors/ET.interferometer
+0
-0
bilby/gw/detectors/GEO600.interferometer
bilby/gw/detectors/GEO600.interferometer
+0
-0
bilby/gw/detectors/H1.interferometer
bilby/gw/detectors/H1.interferometer
+0
-0
bilby/gw/detectors/K1.interferometer
bilby/gw/detectors/K1.interferometer
+0
-0
bilby/gw/detectors/L1.interferometer
bilby/gw/detectors/L1.interferometer
+0
-0
bilby/gw/detectors/V1.interferometer
bilby/gw/detectors/V1.interferometer
+0
-0
bilby/gw/likelihood.py
bilby/gw/likelihood.py
+11
-11
bilby/gw/noise_curves/AdV_asd.txt
bilby/gw/noise_curves/AdV_asd.txt
+0
-0
bilby/gw/noise_curves/AdV_psd.txt
bilby/gw/noise_curves/AdV_psd.txt
+0
-0
bilby/gw/noise_curves/Aplus_asd.txt
bilby/gw/noise_curves/Aplus_asd.txt
+0
-0
bilby/gw/noise_curves/CE_asd.txt
bilby/gw/noise_curves/CE_asd.txt
+0
-0
bilby/gw/noise_curves/CE_psd.txt
bilby/gw/noise_curves/CE_psd.txt
+0
-0
bilby/gw/noise_curves/CE_wb_asd.txt
bilby/gw/noise_curves/CE_wb_asd.txt
+0
-0
bilby/gw/noise_curves/CE_wb_psd.txt
bilby/gw/noise_curves/CE_wb_psd.txt
+0
-0
bilby/gw/noise_curves/ET_B_asd.txt
bilby/gw/noise_curves/ET_B_asd.txt
+0
-0
bilby/gw/noise_curves/ET_B_psd.txt
bilby/gw/noise_curves/ET_B_psd.txt
+0
-0
bilby/gw/noise_curves/ET_D_asd.txt
bilby/gw/noise_curves/ET_D_asd.txt
+0
-0
bilby/gw/noise_curves/ET_D_psd.txt
bilby/gw/noise_curves/ET_D_psd.txt
+0
-0
bilby/gw/noise_curves/GEO600_S6e_asd.txt
bilby/gw/noise_curves/GEO600_S6e_asd.txt
+0
-0
bilby/gw/noise_curves/KAGRA_design_asd.txt
bilby/gw/noise_curves/KAGRA_design_asd.txt
+0
-0
bilby/gw/noise_curves/KAGRA_design_psd.txt
bilby/gw/noise_curves/KAGRA_design_psd.txt
+0
-0
bilby/gw/noise_curves/LIGO_srd_asd.txt
bilby/gw/noise_curves/LIGO_srd_asd.txt
+0
-0
bilby/gw/noise_curves/LIGO_srd_psd.txt
bilby/gw/noise_curves/LIGO_srd_psd.txt
+0
-0
bilby/gw/noise_curves/README.md
bilby/gw/noise_curves/README.md
+0
-0
bilby/gw/noise_curves/aLIGO_ZERO_DET_high_P_asd.txt
bilby/gw/noise_curves/aLIGO_ZERO_DET_high_P_asd.txt
+0
-0
bilby/gw/noise_curves/aLIGO_ZERO_DET_high_P_psd.txt
bilby/gw/noise_curves/aLIGO_ZERO_DET_high_P_psd.txt
+0
-0
bilby/gw/noise_curves/aLIGO_early_asd.txt
bilby/gw/noise_curves/aLIGO_early_asd.txt
+0
-0
bilby/gw/noise_curves/aLIGO_early_high_asd.txt
bilby/gw/noise_curves/aLIGO_early_high_asd.txt
+0
-0
bilby/gw/noise_curves/aLIGO_early_high_psd.txt
bilby/gw/noise_curves/aLIGO_early_high_psd.txt
+0
-0
bilby/gw/noise_curves/aLIGO_early_psd.txt
bilby/gw/noise_curves/aLIGO_early_psd.txt
+0
-0
bilby/gw/noise_curves/aLIGO_late_asd.txt
bilby/gw/noise_curves/aLIGO_late_asd.txt
+0
-0
bilby/gw/noise_curves/aLIGO_late_psd.txt
bilby/gw/noise_curves/aLIGO_late_psd.txt
+0
-0
bilby/gw/noise_curves/aLIGO_mid_asd.txt
bilby/gw/noise_curves/aLIGO_mid_asd.txt
+0
-0
bilby/gw/noise_curves/aLIGO_mid_psd.txt
bilby/gw/noise_curves/aLIGO_mid_psd.txt
+0
-0
bilby/gw/noise_curves/highf_psd.txt
bilby/gw/noise_curves/highf_psd.txt
+0
-0
bilby/gw/noise_curves/lisa_asd.txt
bilby/gw/noise_curves/lisa_asd.txt
+0
-0
bilby/gw/noise_curves/lisa_psd.txt
bilby/gw/noise_curves/lisa_psd.txt
+0
-0
bilby/gw/prior.py
bilby/gw/prior.py
+0
-0
bilby/gw/prior_files/GW150914.prior
bilby/gw/prior_files/GW150914.prior
+1
-1
bilby/gw/prior_files/binary_black_holes.prior
bilby/gw/prior_files/binary_black_holes.prior
+2
-2
bilby/gw/prior_files/binary_neutron_stars.prior
bilby/gw/prior_files/binary_neutron_stars.prior
+2
-2
bilby/gw/prior_files/comoving.txt
bilby/gw/prior_files/comoving.txt
+0
-0
bilby/gw/source.py
bilby/gw/source.py
+0
-0
bilby/gw/utils.py
bilby/gw/utils.py
+1
-1
bilby/gw/waveform_generator.py
bilby/gw/waveform_generator.py
+0
-0
bilby/hyper/__init__.py
bilby/hyper/__init__.py
+0
-0
bilby/hyper/likelihood.py
bilby/hyper/likelihood.py
+2
-2
bilby/hyper/model.py
bilby/hyper/model.py
+0
-0
cli_bilby/__init__.py
cli_bilby/__init__.py
+0
-0
cli_bilby/plot_multiple_posteriors.py
cli_bilby/plot_multiple_posteriors.py
+3
-3
No files found.
.gitignore
View file @
1f9491a9
...
...
@@ -2,7 +2,7 @@
build/
dist/
docs/_*
tupak
.egg-info/
bilby
.egg-info/
MANIFEST
*.pyc
*.png
...
...
.gitlab-ci.yml
View file @
1f9491a9
...
...
@@ -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
:
...
...
CHANGELOG.md
View file @
1f9491a9
...
...
@@ -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.md
View file @
1f9491a9
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]
...
...
README.rst
View file @
1f9491a9
|pipeline status| |coverage report| |pypi| |version|
Tupak
Bilby
=====
Fulfilling all your
gravitational wav
e dreams.
Fulfilling all your
Bayesian inferenc
e 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
/__init__.py
→
bilby
/__init__.py
View file @
1f9491a9
"""
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.
"""
...
...
tupak
/core/__init__.py
→
bilby
/core/__init__.py
View file @
1f9491a9
File moved
tupak
/core/likelihood.py
→
bilby
/core/likelihood.py
View file @
1f9491a9
...
...
@@ -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
...
...
tupak
/core/prior.py
→
bilby
/core/prior.py
View file @
1f9491a9
...
...
@@ -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
------
...
...
tupak
/core/result.py
→
bilby
/core/result.py
View file @
1f9491a9
...
...
@@ -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
...
...
tupak
/core/sampler/__init__.py
→
bilby
/core/sampler/__init__.py
View file @
1f9491a9
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.
...
...
tupak
/core/sampler/base_sampler.py
→
bilby
/core/sampler/base_sampler.py
View file @
1f9491a9
...
...
@@ -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
()
...
...
tupak
/core/sampler/cpnest.py
→
bilby
/core/sampler/cpnest.py
View file @
1f9491a9
...
...
@@ -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
-----------------
...
...
tupak
/core/sampler/dynesty.py
→
bilby
/core/sampler/dynesty.py
View file @
1f9491a9
...
...
@@ -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
-----------------
...
...
tupak
/core/sampler/emcee.py
→
bilby
/core/sampler/emcee.py
View file @
1f9491a9
...
...
@@ -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
-----------------
...
...
tupak
/core/sampler/nestle.py
→
bilby
/core/sampler/nestle.py
View file @
1f9491a9
...
...
@@ -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
...
...
tupak
/core/sampler/ptemcee.py
→
bilby
/core/sampler/ptemcee.py
View file @
1f9491a9
...
...
@@ -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
-----------------
...
...
tupak
/core/sampler/pymc3.py
→
bilby
/core/sampler/pymc3.py
View file @
1f9491a9
...
...
@@ -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