Skip to content
Snippets Groups Projects
Commit 323246b4 authored by Rhiannon Udall's avatar Rhiannon Udall
Browse files

Fixes for pre-commit and CI

parent 2831f752
No related branches found
No related tags found
1 merge request!1261Bugfix crash when bilby_mcmc attempts to produce diagnostic histograms for parameters with infinte values
......@@ -413,12 +413,16 @@ class Chain(object):
if all_samples is not None:
yy_all = all_samples[key]
if np.any(np.isinf(yy_all)):
logger.warning(f"Could not plot histogram for parameter {key} due to infinite values")
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]
if np.any(np.isinf(yy)):
logger.warning(f"Could not plot histogram for parameter {key} due to infinite values")
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))
......
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