-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Fix formatting of parameters #23729
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
I would like to work on this. |
This probably isn't the right place to post this, but when I run the script I get an error:
I'm not really sure what the issue is here. Is there a known solution or should I make a new issue? |
Can you create a new issue following the template we provide? We need detailed information to understand the problem. Feel free to mention me, and I'll take a look. |
@datapythonista I see that somebody took my issue haha. So I will not work on this anymore? |
@datapythonista Since there is already a pull request for this issue, would you be able to recommend something similar to this for me to work on over the weekend? I'm really interested in contributing to Pandas, however I'm having a hard time finding issues to work on because they get taken quickly and there is somebody working on most of the existing issues. Please let me know if there is something that I can work on that hasn't been filed as an issue yet. Thanks. |
Improving the content of a whole docstring that doesn't look good is something always useful. If you run validate_docstrings.py without parameters you will get a very long list of issues, everything should be fixed. If you run flake8-rst on the docs, there are 2000 errors in the rst files that should also be fixed. I keep creating issues, but you can create them yourself, or just sendP PRs for some fixes, no need for issue. |
@datapythonista Thank you, I will look into this and create some issues. |
In the pandas API documentation, when the parameters are defined, they should be defined as:
Note that in
name : str
there is one space before the colon, and one after. This is important, because when the html documentation is rendered, if those spaces are not found, the name of the parameter is not splitted from the type, and everything is rendered as if everything was the name.See for example in the
bins
parameter ofSeries.hist
(note that in this case there are two of them, and the second should be removed, instead of fixing the spaces).This happens in many docstrings, and it should be fixed to ensure that the documentation is rendered correctly.
We have a script to generate the whole list or cases where this happens:
Calling the same script with the parameter
--format=azure
can be useful, as it reports also the file and the line where the function is defined. Python introspection is used to obtain them, and it probably won't be correct if the function is created dynamically, but it could be helpful in many cases. Usinggrep "encoding:"
is also an option (encoding
is the name of the parameter of the first detected failing case).We should add all the missing spaces and fix all the formats. Executing the script after this has been done, should report no errors.
The text was updated successfully, but these errors were encountered: