Skip to content

Commit

Permalink
update bugfix
Browse files Browse the repository at this point in the history
I've changed `np.inf` to `sys.maxsive` to avoid breaking type-checking.
The behavior should be mostly unchanged.
  • Loading branch information
joshspeagle committed Sep 28, 2018
1 parent 17ef22c commit 396d217
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dynesty/dynesty.py
Expand Up @@ -104,7 +104,7 @@ def prior_transform(u):
when the likelihood function is quick to evaluate. Default behavior
is to target a roughly constant change in prior volume, with
`1.5` for `'unif'`, `0.15 * walks` for `'rwalk'`,
`0.9 * ndim * slices` for `'slice'`, and `np.inf` for `'rslice'` and
`0.9 * ndim * slices` for `'slice'`, and `sys.maxsize` for `'rslice'` and
`'hslice'` which don't utilize bounding distributions.
first_update : dict, optional
Expand Down Expand Up @@ -243,9 +243,9 @@ def prior_transform(u):
elif sample == 'slice':
update_interval = 0.9 * npdim * slices
else:
update_interval = np.inf # no bounds needed for sampling method
update_interval = sys.maxsize # no bounds needed
if bound == 'none':
update_interval = np.inf # no need to update when there are no bounds
update_interval = sys.maxsize # no need to update with no bounds
if isinstance(update_interval, float):
update_interval = max(1, round(update_interval * nlive))

Expand Down Expand Up @@ -419,7 +419,7 @@ def prior_transform(u):
when the likelihood function is quick to evaluate. Default behavior
is to target a roughly constant change in prior volume, with
`1.5` for `'unif'`, `0.15 * walks` for `'rwalk'`,
`0.9 * ndim * slices` for `'slice'`, and `np.inf` for `'rslice'` and
`0.9 * ndim * slices` for `'slice'`, and `sys.maxsize` for `'rslice'` and
`'hslice'` which don't utilize bounding distributions.
first_update : dict, optional
Expand Down Expand Up @@ -544,9 +544,9 @@ def prior_transform(u):
elif sample == 'slice':
update_interval = 0.9 * npdim * slices
else:
update_interval = np.inf # no bounds needed for sampling method
update_interval = sys.maxsize # no bounds needed
if bound == 'none':
update_interval = np.inf # no need to update when there are no bounds
update_interval = sys.maxsize # no need to update with no bounds

# Keyword arguments controlling the first update.
if first_update is None:
Expand Down

0 comments on commit 396d217

Please sign in to comment.