Skip to content
Snippets Groups Projects
Commit b0dfcf40 authored by Colm Talbot's avatar Colm Talbot Committed by Moritz Huebner
Browse files

Make sure posterior save delta function

parent edb7950d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
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