From 14709e563e1b2d2a516ddd7cdca417663b3faa5d Mon Sep 17 00:00:00 2001 From: Johannes Buchner Date: Thu, 16 Sep 2021 08:17:37 +0200 Subject: [PATCH] speed-up for region sampling by avoiding a repeated check --- ultranest/integrator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ultranest/integrator.py b/ultranest/integrator.py index f8b69bbc..6ad4c676 100644 --- a/ultranest/integrator.py +++ b/ultranest/integrator.py @@ -1655,6 +1655,10 @@ def _create_point(self, Lmin, ndraw, active_u, active_values): loglikelihoods of current live points """ + assert self.region.inside(active_u).any(), \ + ("None of the live points satisfies the current region!", + self.region.maxradiussq, self.region.u, self.region.unormed, active_u) + nit = 0 while True: ib = self.ib @@ -1681,10 +1685,6 @@ def _create_point(self, Lmin, ndraw, active_u, active_values): # skip if we already know it is not useful ib = 0 if np.isfinite(self.likes[0]) else 1 - assert self.region.inside(active_u).any(), \ - ("None of the live points satisfies the current region!", - self.region.maxradiussq, self.region.u, self.region.unormed, active_u) - use_stepsampler = self.stepsampler is not None while ib >= len(self.samples): ib = 0