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

TEST: fix dummy likelihood

parent 28d00120
No related branches found
No related tags found
No related merge requests found
import unittest
from copy import deepcopy
from unittest.mock import MagicMock
from attr import define
import bilby
......@@ -22,9 +21,22 @@ class Dummy:
loglstar: float = -1
class DummyLikelihood(bilby.core.likelihood.Likelihood):
"""
A trivial likelihood used for testing. Add some randomness so the likelihood
isn't flat everywhere as that can cause issues for nested samplers.
"""
def __init__(self):
super().__init__(dict())
def log_likelihood(self):
return np.random.uniform(0, 0.01)
class TestDynesty(unittest.TestCase):
def setUp(self):
self.likelihood = MagicMock()
self.likelihood = DummyLikelihood()
self.priors = bilby.core.prior.PriorDict(
dict(a=bilby.core.prior.Uniform(0, 1), b=bilby.core.prior.Uniform(0, 1))
)
......
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