Skip to content
Snippets Groups Projects
Commit 01575b9f authored by Colm Talbot's avatar Colm Talbot
Browse files

BUG: fix Pymc sampler import

parent 2b93355c
No related branches found
No related tags found
1 merge request!1349BUG: fix Pymc sampler import
Pipeline #613834 failed
......@@ -12,6 +12,7 @@ import bilby
import matplotlib.pyplot as plt
import numpy as np
import pymc as pm
from bilby.core.sampler.pymc import Pymc
# A few simple setup steps
label = "linear_regression_pymc_custom_likelihood"
......@@ -76,13 +77,11 @@ class GaussianLikelihoodPyMC(bilby.core.likelihood.GaussianLikelihood):
----------
sampler: :class:`bilby.core.sampler.Pymc`
A Sampler object must be passed containing the prior distributions
and PyMC3 :class:`~pymc3.Model` to use as a context manager.
and PyMC :class:`~pymc.Model` to use as a context manager.
If this is not passed, the super class is called and the regular
likelihood is evaluated.
"""
from bilby.core.sampler.pymc import Pymc
if not isinstance(sampler, Pymc):
return super(GaussianLikelihoodPyMC, self).log_likelihood()
......@@ -116,15 +115,12 @@ class PyMCUniformPrior(bilby.core.prior.Uniform):
def ln_prob(self, sampler=None):
"""
Change ln_prob method to take in a Sampler and return a PyMC3
Change ln_prob method to take in a Sampler and return a PyMC
distribution.
If the passed argument is not a `Pymc3` sampler, assume that it is a
If the passed argument is not a `Pymc` sampler, assume that it is a
float or array to be passed to the superclass.
"""
from bilby.core.sampler import Pymc
if not isinstance(sampler, Pymc):
return super(PyMCUniformPrior, self).ln_prob(sampler)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment