Commit 0cd77bb1 authored by Moritz Huebner's avatar Moritz Huebner

Moritz Huebner: Removed the property and created a function to initialise the result

parent bb91eb56
Pipeline #19341 passed with stages
in 7 minutes and 17 seconds
......@@ -59,18 +59,7 @@ class Sampler(object):
if os.path.isdir(outdir) is False:
os.makedirs(outdir)
@property
def result(self):
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]
self.__result.label = self.label
self.__result.outdir = self.outdir
self.__result.priors = self.priors
self.__result.kwargs = self.kwargs
self.result = self.initialise_result()
@property
def search_parameter_keys(self):
......@@ -140,6 +129,19 @@ class Sampler(object):
for key in self.__fixed_parameter_keys:
logging.info(' {} = {}'.format(key, self.priors[key].peak))
def initialise_result(self):
result = Result()
result.search_parameter_keys = self.__search_parameter_keys
result.fixed_parameter_keys = self.__fixed_parameter_keys
result.parameter_labels = [
self.priors[k].latex_label for k in
self.__search_parameter_keys]
result.label = self.label
result.outdir = self.outdir
result.priors = self.priors
result.kwargs = self.kwargs
return result
def verify_parameters(self):
required_keys = self.priors
unmatched_keys = [r for r in required_keys if r not in self.likelihood.parameters]
......
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