Skip to content

Commit 398d5f1

Browse files
authored
Fix docs (scikit-hep#1052)
Descriptions of multinomial_chi2 and poisson_chi2 were swapped. Removed superfluous code in conf.py for sphinx_rtd_theme.
1 parent 8ac24c8 commit 398d5f1

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

doc/conf.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,7 @@
7171
# so a file named "default.css" will overwrite the builtin "default.css".
7272
html_static_path = ["_static"]
7373

74-
# http://read-the-docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs
75-
# on_rtd is whether we are on readthedocs.org
76-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
77-
if not on_rtd:
78-
# Import and set the theme if we're building docs locally
79-
import sphinx_rtd_theme
80-
81-
html_theme = "sphinx_rtd_theme"
82-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
74+
html_theme = "sphinx_rtd_theme"
8375

8476
nbsphinx_kernel_name = "python3"
8577
nbsphinx_execute_arguments = [

src/iminuit/cost.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def poisson_chi2(n: ArrayLike, mu: ArrayLike) -> float:
254254
n : array-like
255255
Observed counts.
256256
mu : array-like
257-
Expected counts per bin. Must satisfy sum(mu) == sum(n).
257+
Expected counts per bin.
258258
259259
Returns
260260
-------
@@ -265,6 +265,8 @@ def poisson_chi2(n: ArrayLike, mu: ArrayLike) -> float:
265265
-----
266266
The implementation makes the result asymptotically chi2-distributed,
267267
which helps to maximise the numerical accuracy for Minuit.
268+
269+
If sum(mu) == sum(n), the result is equal to :func:`multinomial_chi2`.
268270
"""
269271
n, mu = np.atleast_1d(n, mu)
270272
return 2 * np.sum(n * (log_or_zero(n) - log_or_zero(mu)) + mu - n)
@@ -286,7 +288,7 @@ def multinomial_chi2(n: ArrayLike, mu: ArrayLike) -> float:
286288
n : array-like
287289
Observed counts.
288290
mu : array-like
289-
Expected counts.
291+
Expected counts. Must satisfy sum(mu) == sum(n).
290292
291293
Returns
292294
-------

0 commit comments

Comments
 (0)