diff --git a/bilby/core/prior/dict.py b/bilby/core/prior/dict.py index 97c61322509e404d437b69b61f0358a1d1442d75..732bcf149677037557c3b5b6cf055cc65c228cc1 100644 --- a/bilby/core/prior/dict.py +++ b/bilby/core/prior/dict.py @@ -410,14 +410,7 @@ class PriorDict(dict): prob = np.product([self[key].prob(sample[key]) for key in sample], **kwargs) - ratio = 1 - outsample = self.conversion_function(sample) - # Check if there is a constraint in sample/outsample - if (np.any(isinstance([self[key] for key in sample.keys()], Constraint)) or - np.any(isinstance([self[key] for key in outsample.keys()], Constraint))): - # If constraint exists in keys, caclulate the cached normalization constant - ratio = self.normalize_constraint_factor(sample.keys()) - + ratio = self.normalize_constraint_factor(sample.keys()) if np.all(prob == 0.): return prob else: @@ -451,14 +444,7 @@ class PriorDict(dict): ln_prob = np.sum([self[key].ln_prob(sample[key]) for key in sample], axis=axis) - ratio = 1 - outsample = self.conversion_function(sample) - # Check if there is a constraint in sample/outsample - if (np.any(isinstance([self[key] for key in sample.keys()], Constraint)) or - np.any(isinstance([self[key] for key in outsample.keys()], Constraint))): - # If constraint exists in keys, caclulate the cached normalization constant - ratio = self.normalize_constraint_factor(sample.keys()) - + ratio = self.normalize_constraint_factor(sample.keys()) if np.all(np.isinf(ln_prob)): return ln_prob else: