Skip to content

doc(gh-2187): enhance documentation for Chi2, DiscreteUniform, and Categorical distributions#2199

Merged
Qazalbash merged 4 commits into
pyro-ppl:masterfrom
Metbcy:doc/gh-2187-chi2-discreteuniform-categorical
May 25, 2026
Merged

doc(gh-2187): enhance documentation for Chi2, DiscreteUniform, and Categorical distributions#2199
Qazalbash merged 4 commits into
pyro-ppl:masterfrom
Metbcy:doc/gh-2187-chi2-discreteuniform-categorical

Conversation

@Metbcy
Copy link
Copy Markdown
Contributor

@Metbcy Metbcy commented May 23, 2026

Adds math-flavored docstrings to four more distributions on the #2187 checklist, following the template from #2188 and #2192.

  • Chi2 (class + __init__) — also notes the Gamma(k/2, 1/2) equivalence so readers know why the other methods aren't redocumented here.
  • DiscreteUniform — class, __init__, sample, log_prob, cdf, icdf, mean, variance, enumerate_support, entropy.
  • CategoricalProbs — same surface; mean/variance documented as NaN since the categories are unordered.
  • CategoricalLogits — same, with the logsumexp stability note on log_prob and entropy.

Docstrings only, no logic changes. ruff check and ruff format --check are clean on both files.

@Qazalbash Qazalbash self-requested a review May 23, 2026 21:07
@Qazalbash Qazalbash self-assigned this May 23, 2026
@Qazalbash
Copy link
Copy Markdown
Collaborator

Thanks @Metbcy

Copy link
Copy Markdown
Collaborator

@Qazalbash Qazalbash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, please look into the changes I have requested. Also, merge the master branch to pass the CI.

Comment thread numpyro/distributions/discrete.py Outdated
Comment thread numpyro/distributions/discrete.py
@Metbcy
Copy link
Copy Markdown
Contributor Author

Metbcy commented May 24, 2026

Thanks @Qazalbash, addressed both:

  • added the tilde on :func:~numpyro.distributions.util.categorical``
  • switched the DiscreteUniform equations to use a/b throughout (PMF, log_prob, cdf, icdf, mean, variance, entropy, support, enumerate)

Also merged master. 40f98fc

@Qazalbash Qazalbash merged commit be26d95 into pyro-ppl:master May 25, 2026
Qazalbash added a commit that referenced this pull request May 28, 2026
* doc(gh-2187): enhance documentation for Gumbel, Laplace, and Logistic distributions

Adds math-flavored docstrings to three more continuous distributions on the
#2187 checklist, following the template from #2188, #2192, and #2199:

- Gumbel: class, __init__, sample, log_prob, mean, variance, cdf, icdf.
- Laplace: class, __init__, sample, log_prob, mean, variance, cdf, icdf, entropy.
- Logistic: class, __init__, sample, log_prob, mean, variance, cdf, icdf, entropy.

Docstrings only, no logic changes. ruff check and ruff format --check are
clean.

* fix: small fixes

---------

Co-authored-by: Meesum Qazalbash <meesumqazalbash@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants