Skip to content

Commit b62e7ba

Browse files
committed
Regenerate html
1 parent f68780a commit b62e7ba

File tree

5 files changed

+103
-116
lines changed

5 files changed

+103
-116
lines changed

pandas/guide/_sources/pandas_docstring.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ for `dict` and normal brackets for `tuple`):
353353

354354
In case where there are just a set of values allowed, list them in curly
355355
brackets and separated by commas (followed by a space). If the values are
356-
ordinal and they have an order, list them in this order. Otherwuse, list
356+
ordinal and they have an order, list them in this order. Otherwise, list
357357
the default value first, if there is one:
358358

359359
- {0, 10, 25}

pandas/guide/_sources/pandas_pr.rst.txt

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ and released in the next version.
1313

1414
There is a script in pandas that validates whether a docstring follows the
1515
technical parts of the pandas docstring convention. To run the script,
16-
execute in your terminal:
16+
execute in your terminal: ::
1717

18-
| ``cd <pandas-dir>``
19-
| ``python scripts/validate_docstrings.py <your-function-or-method>``
18+
cd <pandas-dir>
19+
python scripts/validate_docstrings.py <your-function-or-method>
2020

21-
where `<your-function-or-method>` is for example `pandas.DataFrame.head`,
22-
`pandas.Series.tail` or `pandas.to_datetime`.
21+
where ``<your-function-or-method>`` is for example ``pandas.DataFrame.head``,
22+
``pandas.Series.tail`` or ``pandas.to_datetime``.
2323

2424
The output of the script will show the final docstring. In many cases just a
2525
verbatim copy, but in some cases the docstring is implemented as a template,
2626
and reused by more than one method or function, and this is useful to see
2727
the final result.
2828

29-
The output will also contain a list of issues with the docstring. Mainly style
29+
The output will also highlight any issues with the docstring. Mainly style
3030
errors, where the docstring does not respect the convention. For example, a
3131
missing dot at the end of a sentence, a blank line where it should not be, etc.
3232

@@ -38,29 +38,31 @@ If you are changing a docstring in a cython file (with ``.pyx`` extension),
3838
you need to rebuild the pandas C extensions to be able to see the resulting
3939
changes in the docstring and to validate the docstring with the command
4040
above.
41-
To recompile pandas, run:
4241

43-
| ``cd <pandas-dir>``
44-
| ``python setup.py build_ext --inplace``
42+
To recompile pandas, run: ::
43+
44+
cd <pandas-dir>
45+
python setup.py build_ext --inplace
4546

4647
2. Visual validation of the docstring
4748
-------------------------------------
4849

4950
The previous script validates things like the names of the sections, or
50-
that there are dots, spaces, or blank lines in the right side. But does
51+
that there are dots, spaces, or blank lines in the right place. It does
5152
not validate for typos, unclear sentences, or other mistakes. To validate
5253
them, as well as the visualization of your docstring in the pandas website
5354
you need to generate the html version of the page you worked on.
5455

55-
To build the documentation run:
56+
To build the documentation run: ::
5657

57-
| ``cd <pandas-dir>/doc``
58-
| ``python make.py html --single <your-function-or-method>``
58+
cd <pandas-dir>/doc
59+
python make.py html --single <your-function-or-method>
5960

60-
where `<your-function-or-method>` follows the format described in the previous
61+
where ``<your-function-or-method>`` follows the format described in the previous
6162
section.
6263

63-
This will generate a file `<pandas-dir>/doc/build/html/generated_single/<your-function-or-method>.html`
64+
This will generate a file
65+
``<pandas-dir>/doc/build/html/generated_single/<your-function-or-method>.html``
6466
that can be opened with your web browser.
6567

6668
3. Validate that the docstring is clear to others
@@ -77,24 +79,24 @@ Once all the validations are successful, you can proceed to commit the changes
7779
into git.
7880

7981
Before committing your changes, make sure you are in the branch of the feature
80-
you are going to commit with:
82+
you are going to commit with: ::
8183

82-
| ``git branch``
84+
git branch
8385

84-
If the current branch is `master`, do not commit your changes, as you can get
86+
If the current branch is ``master``, do not commit your changes, as you can get
8587
into a situation where you need to undo your history in git, which is not
8688
straightforward.
8789

88-
Then, follow the next steps:
90+
Then, get the latest upstream changes and commit your changes on top: ::
8991

90-
| ``git fetch upstream``
91-
| ``git merge upstream/master``
92-
| ``git add <modified-file(s)>``
93-
| ``git commit -m "<commit-message>"``
92+
git fetch upstream
93+
git merge upstream/master
94+
git add <modified-file(s)>
95+
git commit -m "<commit-message>"
9496

95-
where `<modified-file(s)>` is the file where you made your changes (in rare
96-
cases it could be more than one file). And `<commit-message>` is a short
97-
description of your changes, starting by "DOC:" (e.g. "DOC: Improved the
97+
where ``<modified-file(s)>`` is the file where you made your changes (in rare
98+
cases it could be more than one file). And ``<commit-message>`` is a short
99+
description of your changes, starting by "DOC:" (e.g. "DOC: Improve the
98100
docstring of DataFrame.head()").
99101

100102
5. Push your changes to pandas
@@ -104,27 +106,29 @@ Once you committed your changes locally, you need to make them available to
104106
pandas maintainers, so they can add them to the main pandas repository.
105107

106108
The first step is to push your local changes to your own fork, so they are
107-
available online:
109+
available online: ::
108110

109-
| ``git push -u origin <your-branch-name>``
111+
git push -u origin <your-branch-name>
110112

111113
Then, visit https://github.com/pandas-dev/pandas in your browser, and click
112114
on the "Compare & pull request" button in the yellow box above the repository
113115
files.
114116

115-
If you have only one commit, the pull request will automatically use its
116-
comment as title. Otherwise, please name it following the same standard as
117-
described before (e.g. "DOC: Improved the docstring of DataFrame.head()").
118-
In the body of the description, there are some checkboxes. For the sprint,
119-
we do not have an issue for each docstring change, and as we are not changing
120-
code, we do not need to add/run tests or add a `whatsnew` entry. So you can
121-
ignore these check boxes. Just verify that your changes respect the PEP-8
122-
style by running the command:
117+
If you have only one commit, the pull request will automatically use its commit
118+
message as title. Otherwise, please name it following the same standard as
119+
described before (e.g. "DOC: Improve the docstring of DataFrame.head()"). In
120+
the body of the description, there are some checkboxes. For the sprint, we do
121+
not have an issue for each docstring change, and as we are not changing code,
122+
we do not need to add/run tests or add a `whatsnew` entry. So you can ignore
123+
these check boxes. Just verify that your changes respect the PEP-8 style by
124+
running the command: ::
125+
126+
git diff upstream/master -u -- "*.py" | flake8 --diff
123127

124-
| ``git diff upstream/master -u -- "*.py" | flake8 --diff``
128+
If you don't already have flake8 installed, you can install it in the Anaconda
129+
Prompt it via ::
125130

126-
If you don't already have flake8 installed, you can install it in the Anaconda Prompt it via
127-
| ``conda install flake8``
131+
conda install flake8
128132

129133
If the command does not return any warning, mark that checkbox with an X (do
130134
not leave spaces inside the brackets, use `[X]`). If it returns a warning,
@@ -146,10 +150,10 @@ contributors.
146150

147151
For comments in your review, you can make new changes in your local branch for
148152
that pull request. And once you addressed all the comments, you can commit them
149-
and push again to your local branch. As you used the parameter `-u` in your
150-
first push, you can simply run:
153+
and push again to your local branch. As you used the parameter ``-u`` to set
154+
the upstream branch in your first push, you can simply run: ::
151155

152-
| ``git push``
156+
git push
153157

154158
from your local branch, and the changes will be pushed to your remote branch.
155159

@@ -165,5 +169,5 @@ the same pull request. While in the first contributions is normal to feel
165169
frustrated for getting feedback requesting changes, it is actually because of
166170
reviews that the open source software quality is very high. And also, it is
167171
probably the part of contributing to open source projects in which you will
168-
learn more. So, be patient and enjoy. And feel free to provide constructive
172+
learn the most. So, be patient and enjoy. And feel free to provide constructive
169173
feedback in other contributors pull requests too.

pandas/guide/pandas_docstring.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ <h2>About docstrings and standards<a class="headerlink" href="#about-docstrings-
334334
</ul>
335335
<p>In case where there are just a set of values allowed, list them in curly
336336
brackets and separated by commas (followed by a space). If the values are
337-
ordinal and they have an order, list them in this order. Otherwuse, list
337+
ordinal and they have an order, list them in this order. Otherwise, list
338338
the default value first, if there is one:</p>
339339
<ul class="simple">
340340
<li>{0, 10, 25}</li>

0 commit comments

Comments
 (0)