Skip to content
Snippets Groups Projects
Commit c6a752ee authored by Colm Talbot's avatar Colm Talbot
Browse files

vectorise prior calculations

parent a4eef56a
No related branches found
No related tags found
1 merge request!499vectorise prior calculations
Pipeline #62145 failed
......@@ -1029,7 +1029,7 @@ class Result(object):
----------
likelihood: bilby.likelihood.GravitationalWaveTransient, optional
GravitationalWaveTransient likelihood used for sampling.
priors: dict, optional
priors: bilby.prior.PriorDict, optional
Dictionary of prior object, used to fill in delta function priors.
conversion_function: function, optional
Function which adds in extra parameters to the data frame,
......@@ -1045,12 +1045,8 @@ class Result(object):
data_frame['log_likelihood'] = getattr(
self, 'log_likelihood_evaluations', np.nan)
if self.log_prior_evaluations is None:
ln_prior = list()
for ii in range(len(data_frame)):
ln_prior.append(
self.priors.ln_prob(dict(
data_frame[self.search_parameter_keys].iloc[ii])))
data_frame['log_prior'] = np.array(ln_prior)
data_frame['log_prior'] = priors.ln_prob(
dict(data_frame[self.search_parameter_keys]), axis=0)
else:
data_frame['log_prior'] = self.log_prior_evaluations
if conversion_function is not None:
......
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