Skip to content

Commit

Permalink
Fix docs (#1052)
Browse files Browse the repository at this point in the history
Descriptions of multinomial_chi2 and poisson_chi2 were swapped. Removed
superfluous code in conf.py for sphinx_rtd_theme.
  • Loading branch information
HDembinski authored Oct 12, 2024
1 parent 8ac24c8 commit 398d5f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 1 addition & 9 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,7 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

# http://read-the-docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs
# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
if not on_rtd:
# Import and set the theme if we're building docs locally
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = "sphinx_rtd_theme"

nbsphinx_kernel_name = "python3"
nbsphinx_execute_arguments = [
Expand Down
6 changes: 4 additions & 2 deletions src/iminuit/cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def poisson_chi2(n: ArrayLike, mu: ArrayLike) -> float:
n : array-like
Observed counts.
mu : array-like
Expected counts per bin. Must satisfy sum(mu) == sum(n).
Expected counts per bin.
Returns
-------
Expand All @@ -265,6 +265,8 @@ def poisson_chi2(n: ArrayLike, mu: ArrayLike) -> float:
-----
The implementation makes the result asymptotically chi2-distributed,
which helps to maximise the numerical accuracy for Minuit.
If sum(mu) == sum(n), the result is equal to :func:`multinomial_chi2`.
"""
n, mu = np.atleast_1d(n, mu)
return 2 * np.sum(n * (log_or_zero(n) - log_or_zero(mu)) + mu - n)
Expand All @@ -286,7 +288,7 @@ def multinomial_chi2(n: ArrayLike, mu: ArrayLike) -> float:
n : array-like
Observed counts.
mu : array-like
Expected counts.
Expected counts. Must satisfy sum(mu) == sum(n).
Returns
-------
Expand Down

0 comments on commit 398d5f1

Please sign in to comment.