Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Container Registry
Model registry
Operate
Environments
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
lscsoft
bilby
Commits
b89c79e6
Commit
b89c79e6
authored
5 years ago
by
Isobel Marguarethe Romero-Shaw
Committed by
Gregory Ashton
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Updating default dynesty settings
parent
9f36336b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bilby/core/sampler/dynesty.py
+6
-6
6 additions, 6 deletions
bilby/core/sampler/dynesty.py
test/sampler_test.py
+7
-7
7 additions, 7 deletions
test/sampler_test.py
with
13 additions
and
13 deletions
bilby/core/sampler/dynesty.py
+
6
−
6
View file @
b89c79e6
...
@@ -44,7 +44,7 @@ class Dynesty(NestedSampler):
...
@@ -44,7 +44,7 @@ class Dynesty(NestedSampler):
Other Parameters
Other Parameters
----------------
----------------
npoints: int, (
25
0)
npoints: int, (
100
0)
The number of live points, note this can also equivalently be given as
The number of live points, note this can also equivalently be given as
one of [nlive, nlives, n_live_points]
one of [nlive, nlives, n_live_points]
bound: {
'
none
'
,
'
single
'
,
'
multi
'
,
'
balls
'
,
'
cubes
'
}, (
'
multi
'
)
bound: {
'
none
'
,
'
single
'
,
'
multi
'
,
'
balls
'
,
'
cubes
'
}, (
'
multi
'
)
...
@@ -72,18 +72,18 @@ class Dynesty(NestedSampler):
...
@@ -72,18 +72,18 @@ class Dynesty(NestedSampler):
"""
"""
default_kwargs
=
dict
(
bound
=
'
multi
'
,
sample
=
'
rwalk
'
,
default_kwargs
=
dict
(
bound
=
'
multi
'
,
sample
=
'
rwalk
'
,
verbose
=
True
,
periodic
=
None
,
verbose
=
True
,
periodic
=
None
,
check_point_delta_t
=
600
,
nlive
=
5
00
,
check_point_delta_t
=
600
,
nlive
=
10
00
,
first_update
=
None
,
first_update
=
None
,
walks
=
None
,
npdim
=
None
,
rstate
=
None
,
queue_size
=
None
,
pool
=
None
,
npdim
=
None
,
rstate
=
None
,
queue_size
=
None
,
pool
=
None
,
use_pool
=
None
,
live_points
=
None
,
use_pool
=
None
,
live_points
=
None
,
logl_args
=
None
,
logl_kwargs
=
None
,
logl_args
=
None
,
logl_kwargs
=
None
,
ptform_args
=
None
,
ptform_kwargs
=
None
,
ptform_args
=
None
,
ptform_kwargs
=
None
,
enlarge
=
None
,
bootstrap
=
None
,
vol_dec
=
0.5
,
vol_check
=
2.0
,
enlarge
=
None
,
bootstrap
=
None
,
vol_dec
=
0.5
,
vol_check
=
2.0
,
facc
=
0.5
,
slices
=
5
,
facc
=
0.5
,
slices
=
5
,
walks
=
None
,
update_interval
=
None
,
print_func
=
None
,
update_interval
=
None
,
print_func
=
None
,
dlogz
=
0.1
,
maxiter
=
None
,
maxcall
=
None
,
dlogz
=
0.1
,
maxiter
=
None
,
maxcall
=
None
,
logl_max
=
np
.
inf
,
add_live
=
True
,
print_progress
=
True
,
logl_max
=
np
.
inf
,
add_live
=
True
,
print_progress
=
True
,
save_bounds
=
Tru
e
)
save_bounds
=
Fals
e
)
def
__init__
(
self
,
likelihood
,
priors
,
outdir
=
'
outdir
'
,
label
=
'
label
'
,
use_ratio
=
False
,
plot
=
False
,
def
__init__
(
self
,
likelihood
,
priors
,
outdir
=
'
outdir
'
,
label
=
'
label
'
,
use_ratio
=
False
,
plot
=
False
,
skip_import_verification
=
False
,
check_point
=
True
,
n_check_point
=
None
,
check_point_delta_t
=
600
,
skip_import_verification
=
False
,
check_point
=
True
,
n_check_point
=
None
,
check_point_delta_t
=
600
,
...
@@ -135,7 +135,7 @@ class Dynesty(NestedSampler):
...
@@ -135,7 +135,7 @@ class Dynesty(NestedSampler):
def
_verify_kwargs_against_default_kwargs
(
self
):
def
_verify_kwargs_against_default_kwargs
(
self
):
if
not
self
.
kwargs
[
'
walks
'
]:
if
not
self
.
kwargs
[
'
walks
'
]:
self
.
kwargs
[
'
walks
'
]
=
self
.
ndim
*
5
self
.
kwargs
[
'
walks
'
]
=
self
.
ndim
*
10
if
not
self
.
kwargs
[
'
update_interval
'
]:
if
not
self
.
kwargs
[
'
update_interval
'
]:
self
.
kwargs
[
'
update_interval
'
]
=
int
(
0.6
*
self
.
kwargs
[
'
nlive
'
])
self
.
kwargs
[
'
update_interval
'
]
=
int
(
0.6
*
self
.
kwargs
[
'
nlive
'
])
if
not
self
.
kwargs
[
'
print_func
'
]:
if
not
self
.
kwargs
[
'
print_func
'
]:
...
...
This diff is collapsed.
Click to expand it.
test/sampler_test.py
+
7
−
7
View file @
b89c79e6
...
@@ -147,14 +147,14 @@ class TestDynesty(unittest.TestCase):
...
@@ -147,14 +147,14 @@ class TestDynesty(unittest.TestCase):
def
test_default_kwargs
(
self
):
def
test_default_kwargs
(
self
):
expected
=
dict
(
bound
=
'
multi
'
,
sample
=
'
rwalk
'
,
periodic
=
None
,
verbose
=
True
,
expected
=
dict
(
bound
=
'
multi
'
,
sample
=
'
rwalk
'
,
periodic
=
None
,
verbose
=
True
,
check_point_delta_t
=
600
,
nlive
=
5
00
,
first_update
=
None
,
check_point_delta_t
=
600
,
nlive
=
10
00
,
first_update
=
None
,
npdim
=
None
,
rstate
=
None
,
queue_size
=
None
,
pool
=
None
,
npdim
=
None
,
rstate
=
None
,
queue_size
=
None
,
pool
=
None
,
use_pool
=
None
,
live_points
=
None
,
logl_args
=
None
,
logl_kwargs
=
None
,
use_pool
=
None
,
live_points
=
None
,
logl_args
=
None
,
logl_kwargs
=
None
,
ptform_args
=
None
,
ptform_kwargs
=
None
,
ptform_args
=
None
,
ptform_kwargs
=
None
,
enlarge
=
None
,
bootstrap
=
None
,
vol_dec
=
0.5
,
vol_check
=
2.0
,
enlarge
=
None
,
bootstrap
=
None
,
vol_dec
=
0.5
,
vol_check
=
2.0
,
facc
=
0.5
,
slices
=
5
,
dlogz
=
0.1
,
maxiter
=
None
,
maxcall
=
None
,
facc
=
0.5
,
slices
=
5
,
dlogz
=
0.1
,
maxiter
=
None
,
maxcall
=
None
,
logl_max
=
np
.
inf
,
add_live
=
True
,
print_progress
=
True
,
save_bounds
=
Tru
e
,
logl_max
=
np
.
inf
,
add_live
=
True
,
print_progress
=
True
,
save_bounds
=
Fals
e
,
walks
=
1
0
,
update_interval
=
3
00
,
print_func
=
'
func
'
)
walks
=
2
0
,
update_interval
=
6
00
,
print_func
=
'
func
'
)
self
.
sampler
.
kwargs
[
'
print_func
'
]
=
'
func
'
# set this manually as this is not testable otherwise
self
.
sampler
.
kwargs
[
'
print_func
'
]
=
'
func
'
# set this manually as this is not testable otherwise
self
.
assertListEqual
([
0
],
self
.
sampler
.
kwargs
[
'
periodic
'
])
# Check this separately
self
.
assertListEqual
([
0
],
self
.
sampler
.
kwargs
[
'
periodic
'
])
# Check this separately
self
.
sampler
.
kwargs
[
'
periodic
'
]
=
None
# The dict comparison can't handle lists
self
.
sampler
.
kwargs
[
'
periodic
'
]
=
None
# The dict comparison can't handle lists
...
@@ -166,19 +166,19 @@ class TestDynesty(unittest.TestCase):
...
@@ -166,19 +166,19 @@ class TestDynesty(unittest.TestCase):
def
test_translate_kwargs
(
self
):
def
test_translate_kwargs
(
self
):
expected
=
dict
(
bound
=
'
multi
'
,
sample
=
'
rwalk
'
,
periodic
=
[
0
],
verbose
=
True
,
expected
=
dict
(
bound
=
'
multi
'
,
sample
=
'
rwalk
'
,
periodic
=
[
0
],
verbose
=
True
,
check_point_delta_t
=
600
,
nlive
=
25
0
,
first_update
=
None
,
check_point_delta_t
=
600
,
nlive
=
100
0
,
first_update
=
None
,
npdim
=
None
,
rstate
=
None
,
queue_size
=
None
,
pool
=
None
,
npdim
=
None
,
rstate
=
None
,
queue_size
=
None
,
pool
=
None
,
use_pool
=
None
,
live_points
=
None
,
logl_args
=
None
,
logl_kwargs
=
None
,
use_pool
=
None
,
live_points
=
None
,
logl_args
=
None
,
logl_kwargs
=
None
,
ptform_args
=
None
,
ptform_kwargs
=
None
,
ptform_args
=
None
,
ptform_kwargs
=
None
,
enlarge
=
None
,
bootstrap
=
None
,
vol_dec
=
0.5
,
vol_check
=
2.0
,
enlarge
=
None
,
bootstrap
=
None
,
vol_dec
=
0.5
,
vol_check
=
2.0
,
facc
=
0.5
,
slices
=
5
,
dlogz
=
0.1
,
maxiter
=
None
,
maxcall
=
None
,
facc
=
0.5
,
slices
=
5
,
dlogz
=
0.1
,
maxiter
=
None
,
maxcall
=
None
,
logl_max
=
np
.
inf
,
add_live
=
True
,
print_progress
=
True
,
save_bounds
=
Tru
e
,
logl_max
=
np
.
inf
,
add_live
=
True
,
print_progress
=
True
,
save_bounds
=
Fals
e
,
walks
=
1
0
,
update_interval
=
3
00
,
print_func
=
'
func
'
)
walks
=
2
0
,
update_interval
=
6
00
,
print_func
=
'
func
'
)
for
equiv
in
bilby
.
core
.
sampler
.
base_sampler
.
NestedSampler
.
npoints_equiv_kwargs
:
for
equiv
in
bilby
.
core
.
sampler
.
base_sampler
.
NestedSampler
.
npoints_equiv_kwargs
:
new_kwargs
=
self
.
sampler
.
kwargs
.
copy
()
new_kwargs
=
self
.
sampler
.
kwargs
.
copy
()
del
new_kwargs
[
'
nlive
'
]
del
new_kwargs
[
'
nlive
'
]
new_kwargs
[
equiv
]
=
25
0
new_kwargs
[
equiv
]
=
100
0
self
.
sampler
.
kwargs
=
new_kwargs
self
.
sampler
.
kwargs
=
new_kwargs
self
.
sampler
.
kwargs
[
'
print_func
'
]
=
'
func
'
# set this manually as this is not testable otherwise
self
.
sampler
.
kwargs
[
'
print_func
'
]
=
'
func
'
# set this manually as this is not testable otherwise
self
.
assertDictEqual
(
expected
,
self
.
sampler
.
kwargs
)
self
.
assertDictEqual
(
expected
,
self
.
sampler
.
kwargs
)
...
...
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