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
c91c8b2a
Commit
c91c8b2a
authored
Oct 05, 2018
by
MoritzThomasHuebner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PEP8-ed imports
parent
7b42ff83
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
40 additions
and
27 deletions
+40
-27
bilby/core/likelihood.py
bilby/core/likelihood.py
+2
-1
bilby/core/prior.py
bilby/core/prior.py
+8
-8
bilby/core/result.py
bilby/core/result.py
+2
-1
bilby/core/sampler/cpnest.py
bilby/core/sampler/cpnest.py
+2
-2
bilby/core/sampler/dynesty.py
bilby/core/sampler/dynesty.py
+3
-1
bilby/core/sampler/emcee.py
bilby/core/sampler/emcee.py
+2
-1
bilby/core/sampler/nestle.py
bilby/core/sampler/nestle.py
+2
-1
bilby/core/sampler/ptemcee.py
bilby/core/sampler/ptemcee.py
+2
-1
bilby/core/sampler/pymc3.py
bilby/core/sampler/pymc3.py
+6
-7
bilby/core/utils.py
bilby/core/utils.py
+3
-1
bilby/gw/conversion.py
bilby/gw/conversion.py
+3
-3
bilby/gw/prior.py
bilby/gw/prior.py
+2
-0
bilby/gw/waveform_generator.py
bilby/gw/waveform_generator.py
+1
-0
bilby/hyper/likelihood.py
bilby/hyper/likelihood.py
+2
-0
No files found.
bilby/core/likelihood.py
View file @
c91c8b2a
from
__future__
import
division
,
print_function
import
copy
import
numpy
as
np
from
scipy.special
import
gammaln
from
.utils
import
infer_parameters_from_function
...
...
bilby/core/prior.py
View file @
c91c8b2a
from
__future__
import
division
import
numpy
as
np
from
scipy.interpolate
import
interp1d
from
scipy.integrate
import
cumtrapz
from
scipy.special
import
erf
,
erfinv
import
scipy.stats
import
inspect
import
os
from
collections
import
OrderedDict
from
future.utils
import
iteritems
from
.utils
import
logger
import
numpy
as
np
import
scipy.stats
from
scipy.integrate
import
cumtrapz
from
scipy.interpolate
import
interp1d
from
scipy.special
import
erf
,
erfinv
from
.
import
utils
import
bilby
# noqa
import
inspect
from
.utils
import
logger
class
PriorSet
(
OrderedDict
):
...
...
bilby/core/result.py
View file @
c91c8b2a
import
os
from
distutils.version
import
LooseVersion
from
collections
import
OrderedDict
import
numpy
as
np
import
deepdish
import
pandas
as
pd
import
corner
import
matplotlib
import
matplotlib.pyplot
as
plt
from
collections
import
OrderedDict
from
.
import
utils
from
.utils
import
logger
,
infer_parameters_from_function
...
...
bilby/core/sampler/cpnest.py
View file @
c91c8b2a
...
...
@@ -3,15 +3,15 @@ from __future__ import absolute_import
import
numpy
as
np
from
pandas
import
DataFrame
from
.base_sampler
import
NestedSampler
from
..utils
import
logger
try
:
from
cpnest
import
model
as
cpmodel
,
CPNest
except
ImportError
:
logger
.
warning
(
'CPNest is not installed on this system, you will '
'not be able to use the CPNest sampler'
)
from
..utils
import
logger
from
.base_sampler
import
NestedSampler
class
Cpnest
(
NestedSampler
):
...
...
bilby/core/sampler/dynesty.py
View file @
c91c8b2a
from
__future__
import
absolute_import
import
os
import
sys
...
...
@@ -7,12 +8,13 @@ from pandas import DataFrame
from
deepdish.io
import
load
,
save
from
..utils
import
logger
,
check_directory_exists_and_if_not_mkdir
from
.base_sampler
import
Sampler
,
NestedSampler
try
:
import
dynesty
except
ImportError
:
logger
.
warning
(
'Dynesty is not installed on this system, you will '
'not be able to use the Dynesty sampler'
)
from
.base_sampler
import
Sampler
,
NestedSampler
class
Dynesty
(
NestedSampler
):
...
...
bilby/core/sampler/emcee.py
View file @
c91c8b2a
...
...
@@ -4,12 +4,13 @@ import numpy as np
from
pandas
import
DataFrame
from
..utils
import
logger
,
get_progress_bar
from
.base_sampler
import
MCMCSampler
try
:
import
emcee
except
ImportError
:
logger
.
warning
(
'Emcee is not installed on this system, you will '
'not be able to use the Emcee sampler'
)
from
.base_sampler
import
MCMCSampler
class
Emcee
(
MCMCSampler
):
...
...
bilby/core/sampler/nestle.py
View file @
c91c8b2a
...
...
@@ -4,12 +4,13 @@ import numpy as np
from
pandas
import
DataFrame
from
..utils
import
logger
from
.base_sampler
import
NestedSampler
try
:
import
nestle
except
ImportError
:
logger
.
warning
(
'Nestle is not installed on this system, you will '
'not be able to use the Nestle sampler'
)
from
.base_sampler
import
NestedSampler
class
Nestle
(
NestedSampler
):
...
...
bilby/core/sampler/ptemcee.py
View file @
c91c8b2a
...
...
@@ -3,12 +3,13 @@ from __future__ import absolute_import
import
numpy
as
np
from
..utils
import
get_progress_bar
,
logger
from
.
import
Emcee
try
:
import
ptemcee
except
ImportError
:
logger
.
warning
(
'PTEmcee is not installed on this system, you will '
'not be able to use the PTEmcee sampler'
)
from
.
import
Emcee
class
Ptemcee
(
Emcee
):
...
...
bilby/core/sampler/pymc3.py
View file @
c91c8b2a
...
...
@@ -6,6 +6,12 @@ import inspect
import
numpy
as
np
from
..utils
import
derivatives
,
logger
from
..prior
import
Prior
,
DeltaFunction
,
Sine
,
Cosine
,
PowerLaw
from
..result
import
Result
from
.base_sampler
import
Sampler
,
MCMCSampler
from
..likelihood
import
GaussianLikelihood
,
PoissonLikelihood
,
ExponentialLikelihood
,
\
StudentTLikelihood
from
...gw.likelihood
import
BasicGravitationalWaveTransient
,
GravitationalWaveTransient
try
:
import
pymc3
...
...
@@ -21,13 +27,6 @@ try:
except
ImportError
:
logger
.
warning
(
"You must have Theano installed to use PyMC3"
)
from
..prior
import
Prior
,
DeltaFunction
,
Sine
,
Cosine
,
PowerLaw
from
..result
import
Result
from
.base_sampler
import
Sampler
,
MCMCSampler
from
..likelihood
import
GaussianLikelihood
,
PoissonLikelihood
,
ExponentialLikelihood
,
\
StudentTLikelihood
from
...gw.likelihood
import
BasicGravitationalWaveTransient
,
GravitationalWaveTransient
class
Pymc3
(
MCMCSampler
):
""" bilby wrapper of the PyMC3 sampler (https://docs.pymc.io/)
...
...
bilby/core/utils.py
View file @
c91c8b2a
from
__future__
import
division
import
logging
import
os
import
numpy
as
np
from
math
import
fmod
import
argparse
import
traceback
import
inspect
import
numpy
as
np
logger
=
logging
.
getLogger
(
'bilby'
)
# Constants
...
...
bilby/gw/conversion.py
View file @
c91c8b2a
from
__future__
import
division
import
numpy
as
np
import
pandas
as
pd
from
..core.utils
import
logger
,
solar_mass
from
..core.prior
import
DeltaFunction
try
:
from
astropy.cosmology
import
z_at_value
,
Planck15
import
astropy.units
as
u
...
...
@@ -18,6 +16,8 @@ except ImportError:
logger
.
warning
(
"You do not have lalsuite installed currently. You will"
" not be able to use some of the prebuilt functions."
)
from
..core.prior
import
DeltaFunction
def
redshift_to_luminosity_distance
(
redshift
):
return
Planck15
.
luminosity_distance
(
redshift
).
value
...
...
bilby/gw/prior.py
View file @
c91c8b2a
import
os
import
numpy
as
np
from
scipy.interpolate
import
UnivariateSpline
from
..core.prior
import
(
PriorSet
,
Uniform
,
FromFile
,
Prior
,
DeltaFunction
,
Gaussian
,
Interped
)
from
..core.utils
import
logger
...
...
bilby/gw/waveform_generator.py
View file @
c91c8b2a
import
numpy
as
np
from
..core
import
utils
...
...
bilby/hyper/likelihood.py
View file @
c91c8b2a
from
__future__
import
division
,
print_function
import
logging
import
numpy
as
np
from
..core.likelihood
import
Likelihood
from
.model
import
Model
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment