From 92d57abde05f7decb42b6c027eeed9cbe88d0bdf Mon Sep 17 00:00:00 2001
From: Gregory Ashton <gregory.ashton@ligo.org>
Date: Wed, 12 Sep 2018 18:43:06 +0100
Subject: [PATCH] Add fixed-prior samples to the posterior data frame

Previously variables with a fixed (or delta function) prior where not
added to the posterior data frame; the documentation for
`samples_to_posterior` indicates that this is the case. This resolves that.
---
 tupak/core/result.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tupak/core/result.py b/tupak/core/result.py
index fbeffc5bc..83a3a8c88 100644
--- a/tupak/core/result.py
+++ b/tupak/core/result.py
@@ -236,7 +236,8 @@ class Result(dict):
         """
         return self.posterior_volume / self.prior_volume(priors)
 
-    def plot_corner(self, parameters=None, save=True, dpi=300, **kwargs):
+    def plot_corner(self, parameters=None, save=True, priors=None, dpi=300,
+                    **kwargs):
         """ Plot a corner-plot using corner
 
         See https://corner.readthedocs.io/en/latest/ for a detailed API.
@@ -423,6 +424,9 @@ class Result(dict):
                 self.samples, columns=self.search_parameter_keys)
             data_frame['log_likelihood'] = getattr(
                 self, 'log_likelihood_evaluations', np.nan)
+            for key in priors:
+                if getattr(priors[key], 'is_fixed', False):
+                    data_frame[key] = priors[key].peak
             # We save the samples in the posterior and remove the array of samples
             del self.samples
         else:
-- 
GitLab