Skip to content

Commit

Permalink
speed-up for region sampling by avoiding a repeated check
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesBuchner committed Sep 16, 2021
1 parent b9f2179 commit 14709e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ultranest/integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 14709e5

Please sign in to comment.