Skip to content

Add docstring content to docs website#2047

Open
abhro wants to merge 6 commits intoJuliaStats:masterfrom
abhro:docs
Open

Add docstring content to docs website#2047
abhro wants to merge 6 commits intoJuliaStats:masterfrom
abhro:docs

Conversation

@abhro
Copy link
Copy Markdown
Contributor

@abhro abhro commented Mar 25, 2026

  • Add docstrings to docs website
  • Create docstring for loglikelihood method
  • Fix reference to/of fit(D, x) method

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.62%. Comparing base (46ef6a3) to head (7a192ca).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2047   +/-   ##
=======================================
  Coverage   86.62%   86.62%           
=======================================
  Files         148      148           
  Lines        8903     8903           
=======================================
  Hits         7712     7712           
  Misses       1191     1191           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread docs/src/reshape.md Outdated
`MatrixDistribution`s can be reshaped.

```@docs
Distributions.ReshapedDistribution
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is internal, users should only use reshape.

Suggested change
Distributions.ReshapedDistribution

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The docstring for reshape does link to ReshapedDistribution, and I added this so that the cross-reference link has a target. Should I remove the @ref to ReshapedDistribution from the reshape docstring instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, probably it should be removed from the docstring. I assume the intention was to explain the default fallback but as mentioned in the docstring that one is not exported and its constructor shouldn't be used.

Comment thread src/univariates.jl
Comment on lines +329 to +337
"""
loglikelihood(d::UnivariateDistribution, x)

The log-likelihood of distribution `d` with respect to `x`.

Here, `x` can be any output of `rand(d, dims...)` and `rand!(d, x)`.
For univariate distributions, `x` therfore must be a scalar or
an array with an arbitrary number of dimensions.
"""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is already covered by

"""
loglikelihood(d::Distribution{ArrayLikeVariate{N}}, x) where {N}
The log-likelihood of distribution `d` with respect to all variate(s) contained in `x`.
Here, `x` can be any output of `rand(d, dims...)` and `rand!(d, x)`. For instance, `x` can
be
- an array of dimension `N` with `size(x) == size(d)`,
- an array of dimension `N + 1` with `size(x)[1:N] == size(d)`, or
- an array of arrays `xi` of dimension `N` with `size(xi) == size(d)`.
"""

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm. I did basically copy it from that docstring, to cover the docstring requested in univariate.md, line 76. Should the signature for that method be replaced with the method defined in common.jl? It did seem weird that there was a docstring listing for a method that didn't have those specific types, but I wasn't sure if there was a specific documentation need that was served, with the implementation still being the same somehow.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, no, the generic method is the relevant one in this case as well. I'm not sure what's the best way to handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants