Skip to content

Commit

Permalink
Merge pull request #478 from joezuntz/master
Browse files Browse the repository at this point in the history
Replace x.ptp() with np.ptp(x)
  • Loading branch information
segasai authored Jun 24, 2024
2 parents 2d53242 + 83fd327 commit af70910
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion py/dynesty/dynamicsampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def compute_weights(results):
logwt = results.logwt
samples_n = results.samples_n

if logz.ptp() == 0:
if np.ptp(logz) == 0:
# this pathological case can happen if all logl are very small
# and all logz are very small and the same
# then the calculation below failse
Expand Down
2 changes: 1 addition & 1 deletion py/dynesty/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def sample(self,
self.added_live = False
if current_n_effective > n_effective:
stop_iterations = True
if self.live_logl.ptp() == 0:
if np.ptp(self.live_logl) == 0:
warnings.warn(
'We have reached the plateau in the likelihood we are'
' stopping sampling')
Expand Down
2 changes: 1 addition & 1 deletion py/dynesty/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,7 @@ def _merge_two(res1, res2, compute_aux=False):
if nplateau > 1:
# the number of live points should not change throughout
# the plateau
# assert nlive_array[i:][plateau_mask].ptp() == 0
# assert np.ptp(nlive_array[i:][plateau_mask]) == 0
# TODO currently I disabled this check

plateau_counter = nplateau
Expand Down

0 comments on commit af70910

Please sign in to comment.