Commit 5daa5b4c authored by Colm Talbot's avatar Colm Talbot
Browse files

Merge branch 'add-kwargs-to-prob' into 'master'

Allow prob to take in kwargs which are passed to product

See merge request Monash/bilby!248
parents ae405c0d 57781941
Pipeline #34856 passed with stages
in 11 minutes and 15 seconds
......@@ -187,20 +187,22 @@ class PriorSet(OrderedDict):
logger.debug('{} not a known prior.'.format(key))
return samples
def prob(self, sample):
def prob(self, sample, **kwargs):
sample: dict
Dictionary of the samples of which we want to have the probability of
The keyword arguments are passed directly to `np.product`
float: Joint probability of all individual sample probabilities
return np.product([self[key].prob(sample[key]) for key in sample])
return np.product([self[key].prob(sample[key]) for key in sample], **kwargs)
def ln_prob(self, sample):
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