-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
DOC: docstring validation script improvements #20298
Comments
There were some like
that complained about the explanation not starting with a capital letter. Maybe we're OK with that to force a general explanation before going into individual params. Tangentially related: whitespace normalization for doctests (#20284) |
Under the see also, we could check for and error if they have It'd be nice to somehow know if the target is valid (a decent amount of |
I think we can easily check if the first character is a
We need to do this for pytest, but it is already handled separately in the validation_script |
If I'm not wrong, the validation wasn't checking much on the CCing @kynan and @mariocj89, if I'm not wrong they did some work on the |
Also, I think it could be good to warn if the user is importing pandas or numpy in the examples, or if uses I can take care of this ticket if nobody is working on it already, I've got couple of fixes to the generation of the csv that I didn't send it yet. |
Yes, certainly go ahead with doing a PR |
@datapythonista if it helps I started on a test for the validation script in #20061 - I can put some time into wrapping that up today so we can be sure we don't fix one thing and break another with this going forward |
The section order should be validated. I believe there's a numpydoc issue about making the order required. |
Would be nice to extract the code examples and pipe them through |
Yes, that would be a nice one! |
I was looking a bit, apparently flake8 isn't easily called from Python:
http://flake8.pycqa.org/en/latest/user/python-api.html
Shelling out seems fragile.
…On Mon, Mar 12, 2018 at 3:11 PM, Joris Van den Bossche < ***@***.***> wrote:
Would be nice to extract the code examples and pipe them through flake8 if
possible.
Yes, that would be a nice one!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20298 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIjvW7KHogiwqWJQER531NyCqsj_Sks5tdtaMgaJpZM4SmiYl>
.
|
@WillAyd that sounds. I've already got some changes to the script, but it's more in the I love both ideas @TomAugspurger, validating both things will be very useful. |
Other point originally reported in #20318: if the docstring contains a newline, it gives problems in the validation script. |
Edited to add a bullet for the discussion in #20061 (comment) |
Some minor improvements in #25122 |
A couple more issues that need to be fixed:
This will solve a lot of the false positives for |
Based on the experience from the sprint, some known issues:
versionadded
(Consider directives when validating docstrings parameters #22405)pandas.core.resample.Resampler.backfill
See Also
beforeExamples
...) (DOC: Validate the order of the sections in the docstrings #23133)pandas
andnumpy
are not being imported (DOC: Validate that the docstrings do not import pandas or numpy #23134)See Also
items do not start withpandas.
(DOC: Validate that items in See Also section do not start by pandas. #23136)string
,boolean
,integer
in the param descriptions (should bestr
,bool
,int
) (DOC: Validate parameter types in docstrings (e.g. str instead of string) #23165)Returns
section: first line with type only if a single return, desc starting with capital and ending with period... (DOC: Validate the Returns section in the docstrings #23138)axis
parameter using the same format{0 or 'index', 1 or 'columns'}
NaN
,nan
,NA
... and warn if the others are foundNone
,NaN
...)See Also
starts with capital letter and ends with period. (DOC: Validate description of See Also section in docstrings #23135)cc @TomAugspurger @datapythonista @WillAyd others that you noticed?
The text was updated successfully, but these errors were encountered: