-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: further clarifications to docstring guide #20309
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
Your quoting rules seem sensible to me. For "See Also" I say no to things that are in pandas' top-level namespace, at least Index / Series / DataFrame. Maybe for less well-known things like Categorical. For Missing values: NA when referring to the concept, NaN (or NaT) when referring to a specific value. So
For "label", yes I think so. Likewise for row labels. Some other ones: Do we use sphinx reference markup in types? I merged a couple in plotting that were like
But that's a bit noisy. I think it'd be better to just have
|
We should emphasize linking back to relevant sections of the user guide. |
Yes, I was thinking about if we could have a separate section for this (like See Also now, but then similar box with eg "Related User Guides" or something like that), but that would require some changes to numpydoc to allow this. And I was also thinking of a kind of general way to do this from tagging sections in User guide with methods that should be linked to that section, and then those links could automatically be added in the docstrings (like with a Gallery, the links are also injected into the docstrings). |
For now, I think that the extended summary is the best place for referring to the user guide. |
Another quoting rule: exception classes like |
I thought example section too :
|
In #20332 @adatasetaday mentioned "format of axis parameters".
To what extent do we think that we can add rules like this to the linter? I'd like as much of this to be rules-based and automated. |
Should explain how we doctest warnings.
|
I merged the docstring guide #19704 in its current state from the sprint.
But based on the sprint experience, I think we noticed a few areas that can use further clarifications to have less confusion / discussion:
'
or single`
or double backticks``
). The way I currently review:False
orparam=value
, but, often used class names of pandas like Series, DataFrame, Index are not quoted..pandas
or not?str
, as this is in principle too restrictive)Did you experience any others?
Let's discuss here what to do with them. Detailed inline comments can still be made on #19704
cc @datapythonista @WillAyd @TomAugspurger @jreback
The text was updated successfully, but these errors were encountered: