diff --git a/bilby/bilby_mcmc/proposals.py b/bilby/bilby_mcmc/proposals.py index 29c40d057a217f194576bf75964c9b331a865739..90e2f567d03d5c9e8c62df6c9d29d1f2ccd4f79c 100644 --- a/bilby/bilby_mcmc/proposals.py +++ b/bilby/bilby_mcmc/proposals.py @@ -131,7 +131,8 @@ class BaseProposal(object): def __call__(self, chain): sample, log_factor = self.propose(chain) - sample = self.apply_boundaries(sample) + if log_factor == 0: + sample = self.apply_boundaries(sample) return sample, log_factor @abstractmethod @@ -945,7 +946,8 @@ class EnsembleProposal(BaseProposal): def __call__(self, chain, chain_complement): sample, log_factor = self.propose(chain, chain_complement) - sample = self.apply_boundaries(sample) + if log_factor == 0: + sample = self.apply_boundaries(sample) return sample, log_factor