Skip to content

Commit e47100a

Browse files
Updating document on how to send a pull request
1 parent 0424b0e commit e47100a

File tree

4 files changed

+16
-68
lines changed

4 files changed

+16
-68
lines changed

pandas/guide/_sources/pandas_pr.rst.txt

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ technical parts of the pandas docstring convention. To run the script,
1616
execute in your terminal:
1717

1818
| ``cd <pandas-dir>``
19-
| ``scripts/validate_docstring.py <your-function-or-method>``
19+
| ``scripts/validate_docstrings.py <your-function-or-method>``
2020
2121
where `<your-function-or-method>` is for example `pandas.DataFrame.head`,
2222
`pandas.Series.tail` or `pandas.to_datetime`.
@@ -41,31 +41,14 @@ section.
4141
This will generate a file `<pandas-dir>/doc/build/html/generated/<your-function-or-method>.html`
4242
that can be opened with your web browser.
4343

44-
3. Validate code in the examples
45-
--------------------------------
46-
47-
Code in the `Examples` section of the docstring must be valid Python code, and
48-
return the exact output as presented. Besides illustrating the functionality
49-
in the documentation, this code is also part of the unit tests.
50-
51-
To run the examples as unit tests, and validate that the code is correct and
52-
returns the expected output, execute the next in your terminal:
53-
54-
| ``cd <pandas-dir>``
55-
| ``pytest --doctest-modules <file-of-your-docstring> -k <function-or-method-name>``
56-
57-
where `<file-of-your-docstring>` is the path to the file where you edited your docstring
58-
(e.g. `pandas/core/frame.py`) and `<function-or-method-name>` is the name of the function
59-
or method you edited (e.g. `head`).
60-
61-
4. Validate that the docstring is clear to others
44+
3. Validate that the docstring is clear to others
6245
-------------------------------------------------
6346

6447
As the last validation, please show the html version of your docstring to a
6548
person in the sprint not involved in the changes to the docstring, and make
6649
sure they are able to fully understand it.
6750

68-
5. Commit your changes
51+
4. Commit your changes
6952
----------------------
7053

7154
Once all the validations are successful, you can proceed to commit the changes
@@ -88,7 +71,7 @@ cases it could be more than one file). And `<commit-message>` is a short
8871
description of your changes, starting by "DOC:" (e.g. "DOC: Improved the
8972
docsting of DataFrame.head()").
9073

91-
6. Push your changes to the sprint repository
74+
5. Push your changes to the sprint repository
9275
---------------------------------------------
9376

9477
Before sending the pull request to the pandas core developers, you will send

pandas/guide/pandas_pr.html

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h2>1. Validate that your docstring does not have technical errors<a class="head
5252
<blockquote>
5353
<div><div class="line-block">
5454
<div class="line"><code class="docutils literal"><span class="pre">cd</span> <span class="pre">&lt;pandas-dir&gt;</span></code></div>
55-
<div class="line"><code class="docutils literal"><span class="pre">scripts/validate_docstring.py</span> <span class="pre">&lt;your-function-or-method&gt;</span></code></div>
55+
<div class="line"><code class="docutils literal"><span class="pre">scripts/validate_docstrings.py</span> <span class="pre">&lt;your-function-or-method&gt;</span></code></div>
5656
</div>
5757
</div></blockquote>
5858
<p>where <cite>&lt;your-function-or-method&gt;</cite> is for example <cite>pandas.DataFrame.head</cite>,
@@ -77,31 +77,14 @@ <h2>2. Visual validation of the docstring<a class="headerlink" href="#visual-val
7777
<p>This will generate a file <cite>&lt;pandas-dir&gt;/doc/build/html/generated/&lt;your-function-or-method&gt;.html</cite>
7878
that can be opened with your web browser.</p>
7979
</div>
80-
<div class="section" id="validate-code-in-the-examples">
81-
<h2>3. Validate code in the examples<a class="headerlink" href="#validate-code-in-the-examples" title="Permalink to this headline"></a></h2>
82-
<p>Code in the <cite>Examples</cite> section of the docstring must be valid Python code, and
83-
return the exact output as presented. Besides illustrating the functionality
84-
in the documentation, this code is also part of the unit tests.</p>
85-
<p>To run the examples as unit tests, and validate that the code is correct and
86-
returns the expected output, execute the next in your terminal:</p>
87-
<blockquote>
88-
<div><div class="line-block">
89-
<div class="line"><code class="docutils literal"><span class="pre">cd</span> <span class="pre">&lt;pandas-dir&gt;</span></code></div>
90-
<div class="line"><code class="docutils literal"><span class="pre">pytest</span> <span class="pre">--doctest-modules</span> <span class="pre">&lt;file-of-your-docstring&gt;</span> <span class="pre">-k</span> <span class="pre">&lt;function-or-method-name&gt;</span></code></div>
91-
</div>
92-
</div></blockquote>
93-
<p>where <cite>&lt;file-of-your-docstring&gt;</cite> is the path to the file where you edited your docstring
94-
(e.g. <cite>pandas/core/frame.py</cite>) and <cite>&lt;function-or-method-name&gt;</cite> is the name of the function
95-
or method you edited (e.g. <cite>head</cite>).</p>
96-
</div>
9780
<div class="section" id="validate-that-the-docstring-is-clear-to-others">
98-
<h2>4. Validate that the docstring is clear to others<a class="headerlink" href="#validate-that-the-docstring-is-clear-to-others" title="Permalink to this headline"></a></h2>
81+
<h2>3. Validate that the docstring is clear to others<a class="headerlink" href="#validate-that-the-docstring-is-clear-to-others" title="Permalink to this headline"></a></h2>
9982
<p>As the last validation, please show the html version of your docstring to a
10083
person in the sprint not involved in the changes to the docstring, and make
10184
sure they are able to fully understand it.</p>
10285
</div>
10386
<div class="section" id="commit-your-changes">
104-
<h2>5. Commit your changes<a class="headerlink" href="#commit-your-changes" title="Permalink to this headline"></a></h2>
87+
<h2>4. Commit your changes<a class="headerlink" href="#commit-your-changes" title="Permalink to this headline"></a></h2>
10588
<p>Once all the validations are successful, you can proceed to commit the changes
10689
into git.</p>
10790
<p>Before committing your changes, make sure you are in the branch of the feature
@@ -126,7 +109,7 @@ <h2>5. Commit your changes<a class="headerlink" href="#commit-your-changes" titl
126109
docsting of DataFrame.head()”).</p>
127110
</div>
128111
<div class="section" id="push-your-changes-to-the-sprint-repository">
129-
<h2>6. Push your changes to the sprint repository<a class="headerlink" href="#push-your-changes-to-the-sprint-repository" title="Permalink to this headline"></a></h2>
112+
<h2>5. Push your changes to the sprint repository<a class="headerlink" href="#push-your-changes-to-the-sprint-repository" title="Permalink to this headline"></a></h2>
130113
<p>Before sending the pull request to the pandas core developers, you will send
131114
it to the sprint repository. Where more experienced contributors will review
132115
it, and suggest changes if needed.</p>
@@ -158,10 +141,9 @@ <h3><a href="contents.html">Table Of Contents</a></h3>
158141
<li><a class="reference internal" href="#">Submitting your changes</a><ul>
159142
<li><a class="reference internal" href="#validate-that-your-docstring-does-not-have-technical-errors">1. Validate that your docstring does not have technical errors</a></li>
160143
<li><a class="reference internal" href="#visual-validation-of-the-docstring">2. Visual validation of the docstring</a></li>
161-
<li><a class="reference internal" href="#validate-code-in-the-examples">3. Validate code in the examples</a></li>
162-
<li><a class="reference internal" href="#validate-that-the-docstring-is-clear-to-others">4. Validate that the docstring is clear to others</a></li>
163-
<li><a class="reference internal" href="#commit-your-changes">5. Commit your changes</a></li>
164-
<li><a class="reference internal" href="#push-your-changes-to-the-sprint-repository">6. Push your changes to the sprint repository</a></li>
144+
<li><a class="reference internal" href="#validate-that-the-docstring-is-clear-to-others">3. Validate that the docstring is clear to others</a></li>
145+
<li><a class="reference internal" href="#commit-your-changes">4. Commit your changes</a></li>
146+
<li><a class="reference internal" href="#push-your-changes-to-the-sprint-repository">5. Push your changes to the sprint repository</a></li>
165147
</ul>
166148
</li>
167149
</ul>

0 commit comments

Comments
 (0)