Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
[Unreleased]
### Added
### Changed
- Show the ETA when sampling
- When restoring the sampler with the pool, use an updated value of `queue_size` based on the pool size
- Use `chunksize=1` for the dynesty pool, as that is better behaved for `queue_size > nthreads` and unequal durations of function evaluations
- When starting dynesty with a multiprocessing pool, dynesty now tries to use the `_processes` keyword to determine how many CPUs are available. This should reduce the need for manual `queue_size` specification
Expand Down
11 changes: 9 additions & 2 deletions py/dynesty/dynamicsampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ def _configure_batch_sampler(main_sampler,
boundidx=0,
bounditer=0,
eff=main_sampler.eff,
delta_logz=np.nan,
proposal_stats=None))
batch_sampler.update_bound_if_needed(logl_min)
# Trigger an update of the internal bounding distribution based
Expand Down Expand Up @@ -583,6 +584,7 @@ def _configure_batch_sampler(main_sampler,
boundidx=live_bound[i],
bounditer=live_bound[i],
eff=main_sampler.eff,
delta_logz=np.nan,
proposal_stats=live_proposal_stats[i]))
niter += nlive_new
# Overwrite the previous set of live points in our internal sampler
Expand Down Expand Up @@ -1410,6 +1412,7 @@ def sample_batch(self,
boundidx=results.boundidx,
bounditer=results.bounditer,
eff=self.eff,
delta_logz=results.delta_logz,
proposal_stats=results.proposal_stats)
if iterated_batch and results.loglstar < logl_max and np.isfinite(
logl_max) and maxiter_left > 0 and maxcall_left > 0:
Expand Down Expand Up @@ -1456,6 +1459,7 @@ def sample_batch(self,
boundidx=results.boundidx,
bounditer=results.bounditer,
eff=self.eff,
delta_logz=np.nan,
proposal_stats=None)
del self.batch_sampler
self.batch_sampler = None
Expand Down Expand Up @@ -1822,7 +1826,9 @@ def run_nested(self,
return

# Baseline run.
pbar, print_func = get_print_func(print_func, print_progress)
pbar, print_func = get_print_func(print_func,
print_progress,
initial=self.it - 1)
self.checkpoint_timer = DelayTimer(checkpoint_every)
try:
# the init should be the first default stage, all other ones
Expand Down Expand Up @@ -2088,7 +2094,7 @@ def add_batch(self,
boundidx=cur_results.boundidx,
bounditer=cur_results.bounditer,
eff=cur_results.eff,
delta_logz=np.nan,
delta_logz=cur_results.delta_logz,
proposal_stats=cur_results.proposal_stats)

# Print progress.
Expand All @@ -2097,6 +2103,7 @@ def add_batch(self,
niter,
ncall,
nbatch=n + 1,
dlogz=dlogz,
stop_val=stop_val,
logl_min=logl_min,
logl_max=logl_max)
Expand Down
4 changes: 3 additions & 1 deletion py/dynesty/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,9 @@ def run_nested(self,
return

# Run the main nested sampling loop.
pbar, print_func = get_print_func(print_func, print_progress)
pbar, print_func = get_print_func(print_func,
print_progress,
initial=self.it - 1)
if checkpoint_file is not None:
timer = DelayTimer(checkpoint_every)
try:
Expand Down
Loading