Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alec Gunny
bilby
Commits
67cc263c
Commit
67cc263c
authored
2 years ago
by
Colm Talbot
Browse files
Options
Downloads
Patches
Plain Diff
TEST: fix dummy likelihood
parent
28d00120
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/core/sampler/dynesty_test.py
+14
-2
14 additions, 2 deletions
test/core/sampler/dynesty_test.py
with
14 additions
and
2 deletions
test/core/sampler/dynesty_test.py
+
14
−
2
View file @
67cc263c
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
))
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment