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
2831f752
Commit
2831f752
authored
1 year ago
by
Rhiannon Udall
Browse files
Options
Downloads
Patches
Plain Diff
Fix crash when attempting to plot histograms with infinite values
parent
360dd5df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1261
Bugfix crash when bilby_mcmc attempts to produce diagnostic histograms for parameters with infinte values
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bilby/bilby_mcmc/chain.py
+9
-5
9 additions, 5 deletions
bilby/bilby_mcmc/chain.py
with
9 additions
and
5 deletions
bilby/bilby_mcmc/chain.py
+
9
−
5
View file @
2831f752
...
...
@@ -412,12 +412,16 @@ class Chain(object):
for
ax
,
key
in
zip
(
axes
[:,
1
],
self
.
keys
):
if
all_samples
is
not
None
:
yy_all
=
all_samples
[
key
]
ax
.
hist
(
yy_all
,
bins
=
50
,
alpha
=
0.6
,
density
=
True
,
color
=
"
k
"
)
if
np
.
any
(
np
.
isinf
(
yy_all
)):
logger
.
warning
(
f
"
Could not plot histogram for parameter
{
key
}
due to infinite values
"
)
else
:
ax
.
hist
(
yy_all
,
bins
=
50
,
alpha
=
0.6
,
density
=
True
,
color
=
"
k
"
)
yy
=
self
.
get_1d_array
(
key
)[
nburn
:
self
.
position
:
self
.
thin
]
ax
.
hist
(
yy
,
bins
=
50
,
alpha
=
0.8
,
density
=
True
)
ax
.
set_xlabel
(
self
.
_get_plot_label_by_key
(
key
,
priors
))
if
np
.
any
(
np
.
isinf
(
yy
)):
logger
.
warning
(
f
"
Could not plot histogram for parameter
{
key
}
due to infinite values
"
)
else
:
ax
.
hist
(
yy
,
bins
=
50
,
alpha
=
0.8
,
density
=
True
)
ax
.
set_xlabel
(
self
.
_get_plot_label_by_key
(
key
,
priors
))
# Add x-axes labels to the traceplots
axes
[
-
1
,
0
].
set_xlabel
(
r
"
Iteration $[\times 10^{3}]$
"
)
...
...
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