Commit a313d514 authored by Moritz Huebner's avatar Moritz Huebner

Moritz Huebner: Fixed a behaviour relating to saving and loading files

parent ca960e99
Pipeline #19336 passed with stages
in 5 minutes and 34 seconds
......@@ -200,7 +200,7 @@ class Result(dict):
data_frame = pd.DataFrame(self.samples, columns=self.search_parameter_keys)
self.posterior = data_frame
for key in self.fixed_parameter_keys:
self.posterior[key] = self.prior[key].sample(len(self.posterior))
self.posterior[key] = self.priors[key].sample(len(self.posterior))
def construct_cbc_derived_parameters(self):
"""
......
......@@ -70,6 +70,7 @@ class Sampler(object):
if result is None:
self.__result = Result()
self.__result.search_parameter_keys = self.__search_parameter_keys
self.__result.fixed_parameter_keys = self.__fixed_parameter_keys
self.__result.parameter_labels = [
self.priors[k].latex_label for k in
self.__search_parameter_keys]
......@@ -456,7 +457,6 @@ def run_sampler(likelihood, priors=None, label='label', outdir='outdir',
else:
result.log_bayes_factor = result.logz - result.noise_logz
result.injection_parameters = injection_parameters
result.fixed_parameter_keys = [key for key in priors if isinstance(key, prior.DeltaFunction)]
result.priors = priors
result.kwargs = sampler.kwargs
result.samples_to_data_frame()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment