diff --git a/CHANGELOG.md b/CHANGELOG.md index 9501624d2dca1e7bd83c184bfdbc3148ce7ccad7..58c91df81b115d2d65941fce1d6ca732001779ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ Changes currently on master, but not under a tag. +### Changes +- Make filling in posterior with fixed parameters work + ## [0.3] 2018-01-02 ### Added diff --git a/bilby/core/result.py b/bilby/core/result.py index bbe55e2d3c3ff6c6d714955cff95d3aafdc88e88..0ac69ab2bea9b30a3892a6aa6b6459b4074f34de 100644 --- a/bilby/core/result.py +++ b/bilby/core/result.py @@ -549,12 +549,14 @@ class Result(dict): if hasattr(self, 'posterior') is False: data_frame = pd.DataFrame( 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): + if isinstance(priors[key], DeltaFunction): data_frame[key] = priors[key].peak - # We save the samples in the posterior and remove the array of samples + elif isinstance(priors[key], float): + data_frame[key] = priors[key] + data_frame['log_likelihood'] = getattr( + self, 'log_likelihood_evaluations', np.nan) + # remove the array of samples del self.samples else: data_frame = self.posterior