From 56ca06a7b206ae2b0550047c24c93c4263eb66d5 Mon Sep 17 00:00:00 2001 From: Antony Lewis Date: Wed, 2 Nov 2022 15:10:59 +0000 Subject: [PATCH] allow max_tries inf --- cobaya/samplers/mcmc/mcmc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cobaya/samplers/mcmc/mcmc.py b/cobaya/samplers/mcmc/mcmc.py index 2dfed4a22..095d6c05d 100644 --- a/cobaya/samplers/mcmc/mcmc.py +++ b/cobaya/samplers/mcmc/mcmc.py @@ -151,7 +151,7 @@ def initialize(self): self.max_tries.set_scale(self.model.prior.d()) self.log.info("Getting initial point... (this may take a few seconds)") initial_point, results = \ - self.model.get_valid_point(max_tries=self.max_tries.value, + self.model.get_valid_point(max_tries=min(self.max_tries.value, int(1e7)), random_state=self._rng) # If resuming but no existing chain, assume failed run and ignore blocking # if speeds measurement requested @@ -247,7 +247,7 @@ def set_proposer_blocking(self): if self.drag_interp_steps < 2: self.drag = False self.mpi_warning("Dragging disabled: " - "speed ratio and fast-to-slow ratio not large enough.") + "speed ratio and fast-to-slow ratio not large enough.") # Define proposer and other blocking-related quantities if self.drag: # MARKED FOR DEPRECATION IN v3.0