|
14 | 14 | from .results import Results, print_fn
|
15 | 15 | from .bounding import UnitCube
|
16 | 16 | from .sampling import sample_unif, SamplerArgument
|
17 |
| -from .utils import (get_seed_sequence, get_print_func, progress_integration, |
| 17 | +from .utils import (get_random_generator, get_seed_sequence, |
| 18 | + get_print_func, progress_integration, |
18 | 19 | IteratorResult, RunRecord, get_neff_from_logwt,
|
19 | 20 | compute_integrals, DelayTimer, _LOWL_VAL)
|
20 | 21 |
|
@@ -430,10 +431,11 @@ def _distance_insertion_index(self, start, point):
|
430 | 431 | if distance == 0:
|
431 | 432 | log_ratio = np.inf
|
432 | 433 | else:
|
433 |
| - other = self.live_u[np.random.choice(len(self.live_u))] |
| 434 | + rstate = get_random_generator(self.rstate) |
| 435 | + other = self.live_u[rstate.choice(len(self.live_u))] |
434 | 436 | other_distance = np.linalg.norm((other - start) / norms)
|
435 | 437 | while other_distance == 0:
|
436 |
| - other = self.live_u[np.random.choice(len(self.live_u))] |
| 438 | + other = self.live_u[rstate.choice(len(self.live_u))] |
437 | 439 | other_distance = np.linalg.norm((other - start) / norms)
|
438 | 440 | alt_distance = np.linalg.norm((point - other) / norms)
|
439 | 441 | log_ratio = self.ndim * (np.log(other_distance / distance) + np.log(other_distance / alt_distance)) / 2
|
|
0 commit comments