Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gregory Ashton
PyFstat
Commits
629667a3
Commit
629667a3
authored
Feb 21, 2017
by
Gregory Ashton
Browse files
Fix multi-stage set-up when using convergence testing (adds test)
parent
90df76df
Changes
2
Hide whitespace changes
Inline
Side-by-side
pyfstat/mcmc_based_searches.py
View file @
629667a3
...
@@ -638,7 +638,7 @@ class MCMCSearch(BaseSearchClass):
...
@@ -638,7 +638,7 @@ class MCMCSearch(BaseSearchClass):
raise
ValueError
(
"dist_type {} unknown"
.
format
(
dist_type
))
raise
ValueError
(
"dist_type {} unknown"
.
format
(
dist_type
))
def
plot_walkers
(
self
,
sampler
,
symbols
=
None
,
alpha
=
0.4
,
color
=
"k"
,
temp
=
0
,
def
plot_walkers
(
self
,
sampler
,
symbols
=
None
,
alpha
=
0.4
,
color
=
"k"
,
temp
=
0
,
lw
=
0.1
,
nprod
=
None
,
add_det_stat_burnin
=
False
,
lw
=
0.1
,
nprod
=
0
,
add_det_stat_burnin
=
False
,
fig
=
None
,
axes
=
None
,
xoffset
=
0
,
plot_det_stat
=
True
,
fig
=
None
,
axes
=
None
,
xoffset
=
0
,
plot_det_stat
=
True
,
context
=
'classic'
,
subtractions
=
None
,
labelpad
=
0.05
):
context
=
'classic'
,
subtractions
=
None
,
labelpad
=
0.05
):
""" Plot all the chains from a sampler """
""" Plot all the chains from a sampler """
...
...
tests.py
View file @
629667a3
...
@@ -232,6 +232,21 @@ class TestMCMCSearch(Test):
...
@@ -232,6 +232,21 @@ class TestMCMCSearch(Test):
self
.
assertTrue
(
self
.
assertTrue
(
FS
>
predicted_FS
or
np
.
abs
((
FS
-
predicted_FS
))
/
predicted_FS
<
0.3
)
FS
>
predicted_FS
or
np
.
abs
((
FS
-
predicted_FS
))
/
predicted_FS
<
0.3
)
def
test_multi_stage
(
self
):
Writer
=
pyfstat
.
Writer
()
Writer
.
make_cff
()
theta
=
{
'F0'
:
{
'type'
:
'norm'
,
'loc'
:
10
,
'scale'
:
1e-2
},
'F1'
:
0
,
'F2'
:
0
,
'Alpha'
:
0
,
'Delta'
:
0
}
search
=
pyfstat
.
MCMCSearch
(
label
=
self
.
label
,
outdir
=
outdir
,
theta_prior
=
theta
,
tref
=
Writer
.
tref
,
injectSources
=
Writer
.
config_file_name
,
minStartTime
=
Writer
.
minStartTime
,
maxStartTime
=
Writer
.
maxStartTime
,
nsteps
=
[
5
,
5
],
nwalkers
=
20
,
ntemps
=
1
,
detectors
=
'H1'
,
minCoverFreq
=
9
,
maxCoverFreq
=
11
)
search
.
run
(
create_plots
=
False
)
class
TestAuxillaryFunctions
(
Test
):
class
TestAuxillaryFunctions
(
Test
):
nsegs
=
10
nsegs
=
10
...
...
Write
Preview
Supports
Markdown
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