Skip to content

Commit

Permalink
Merge pull request #417 from hyanwong/typo
Browse files Browse the repository at this point in the history
Numpy 2 compatibility
  • Loading branch information
hyanwong authored Jul 17, 2024
2 parents e0210f7 + 0f2e639 commit 870ae18
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ sphinx:
config:
html_theme: sphinx_book_theme
html_theme_options:
pygment_dark_style: monokai
pygments_dark_style: monokai
pygments_style: monokai
bibtex_reference_style: author_year
myst_enable_extensions:
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sphinxcontrib-bibtex
humanize==4.7.0
lmdb==1.4.1
tqdm==4.66.3
daiquiri==3.2.1
msprime==1.2.0
daiquiri
msprime
ipywidgets==8.1.0
sphinx-book-theme #Unpinned to allow easy updating.
2 changes: 1 addition & 1 deletion tsdate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def tsdate_cli_parser():
"--rescaling-intervals",
type=float,
help=(
"The number of time intervals within which to estimate a time scaling"
"The number of time intervals within which to estimate a time scaling "
f"parameter. Default: None treated as {core.DEFAULT_RESCALING_INTERVALS}"
),
default=None,
Expand Down
6 changes: 3 additions & 3 deletions tsdate/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,17 +409,17 @@ class LogLikelihoods(Likelihoods):
@staticmethod
@numba.jit(nopython=True)
def logsumexp(X):
alpha = -np.Inf
alpha = -np.inf
r = 0.0
for x in X:
if x != -np.Inf:
if x != -np.inf:
if x <= alpha:
r += np.exp(x - alpha)
else:
r *= np.exp(alpha - x)
r += 1.0
alpha = x
return -np.Inf if r == 0 else np.log(r) + alpha
return -np.inf if r == 0 else np.log(r) + alpha

@staticmethod
def _lik(muts, span, dt, mutation_rate, standardize=True):
Expand Down

0 comments on commit 870ae18

Please sign in to comment.