doc: add numpydoc-compliant docstrings to HalfFlat distribution#8208
doc: add numpydoc-compliant docstrings to HalfFlat distribution#8208KRYSTALM7 wants to merge 14 commits intopymc-devs:mainfrom
Conversation
…from trace (pymc-devs#8015) Co-authored-by: Michael Osthege <michael.osthege@outlook.com>
Like done with other Metropolis step methods.
|
|
OriolAbril
left a comment
There was a problem hiding this comment.
There are several unrelated commits being included in the PR. My guess is you started from main and did some changes but now the PR is set to be merged against v6 instead of main.
Regarding the docstring changes themselves. If you look at the docstring for pymc.HalfFlat you'll see only .dist is listed as a method. There is no need to add docstrings to any of its methods. Everything should be documented on the class docstring.
The tutorial linked on the issue you commented on has the following:
You have to review section by section to make sure everything is well documented. If you have chosen a class that is not a distribution, you should review the docstrings of all the methods (only if they already exist though, no need to write missing docstrings). Otherwise, you should work only on the function or class docstring. We will therefore ignore the docstrings of the logcdf, get_moment and dist methods.
This is a distribution so you can ignore the methods.
If you look at some other distributions you'll see they have the extended summary section has the following blocks: formula for the pdf, plot for the pdf and table with support and moments. I think for this one we can skip the plot as it would be a flat line of infinite length and indeterminate y but we can add the other two blocks; in fact, the description of the return value you added to the logp method is basically the pdf formula. As you'll have seen it takes no parameters so you can skip the parameters section in the class docstring.
|
Thank you for the detailed feedback @OriolAbril I understand the issues I'll update the PR to target main instead of v6,I'll remove the docstrings from logp and logcdf and focus only on the class-level docstring.I will add the PDF formula and support/moments table as seen in other distributions. Will push the fixes! Thanks for the Support. |
|
@OriolAbril I Updated the PR — removed method docstrings and kept only the |
532ac45 to
e430184
Compare
|
@OriolAbril Closing this PR as the branch history got too messy to clean up properly. I've opened a new PR #(will update) with a single clean commit touching only pymc/distributions/continuous.py with the correct class-level docstring. Sorry for the confusion! |
|
@KRYSTALM7 you should start the PR from v6 and target v6 to be merged into. The usual default branch is |
|
@OriolAbril (#8211) This is a clean replacement for #8208. Sorry for the confusion! I've updated the base branch to |

Summary
Adds numpydoc-compliant docstrings to the
HalfFlatdistributionin
pymc/distributions/continuous.py.Changes
logpmethodlogcdfmethodRelated Issues
Related to #5459