-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
DOC Record the default value of parameters #12111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's worth mentioning, for the contributors, to know that we prefer to follow some suggestions given in Examples:
The default values can be taken in most cases from the function definition or the Priority is with the cases where the default value is not mentioned. I guess the ones which don't follow the format can be left alone for now. However, should we say, if the docstring of a class is touched for this PR, all parameters should follow the convention? |
AFAIK, we fail to follow the recommendation from numpy strictly when recording the default value. I doubt whether it's worthwhile to correct these formatting issue. I'm fine as long as the default value is added to the docstring. |
However, section 4 says "Optional keyword parameters have default values, which are displayed as part of the function signature. They can also be detailed in the description". Hence as along as the default value is in the signature, numpydoc standards do not force to put the default value in the docstring. |
Fair enough, but I guess we still prefer to have the default values mentioned in the docstring. I'll update the post accordingly. |
Then we should also mention it in the coding guidelines of the doc contributing section |
Thanks @albertcthomas . I guess I'll close this one and let's focus on other important issues. At the same time, I won't reject PRs which improves the doc or the contributing guide. |
Yeah, I've never entirely been sold on putting default values in the
docstring. I feel like this is better addressed through better
documentation processing to automatically insert this information where
possible. Sometimes putting default values in docstrings results in them
getting out of sync, or miscopied, too.
|
In some functions / classes, we fail to record the default value of some parameter (See e.g., DBSCAN.)
Related PR: #12108
The text was updated successfully, but these errors were encountered: