Skip to content

DOC: Updating capitalization of doc/source/development #33121

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

Merged
merged 36 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
194d5a7
Updating capitalization in folder doc/source/reference
cleconte987 Mar 19, 2020
3d1960c
Merge remote-tracking branch 'upstream_main_pandas/master' into chang…
cleconte987 Mar 20, 2020
9da1e8a
Add folder doc/source/reference in ci code checking in ci/code_check…
cleconte987 Mar 20, 2020
55587f7
Modification of validate_rst_title_capitalization.py script
cleconte987 Mar 20, 2020
048fb78
Modify validate_rst_title_capitalization.py script to take into accou…
cleconte987 Mar 20, 2020
d1ae9ea
remove stylistic errors in comment section L:77,78,79
cleconte987 Mar 20, 2020
83280b7
Modify validate_rst_title_capitalization.py script
cleconte987 Mar 22, 2020
4314d3c
Merge remote-tracking branch 'upstream_main_pandas/master' into scrip…
cleconte987 Mar 22, 2020
937b5df
modify script following tests
cleconte987 Mar 22, 2020
589b0fe
Modify second time following style checking
cleconte987 Mar 22, 2020
f09689c
Update branch with pandas repository commits
cleconte987 Mar 23, 2020
e71cffd
Commit to update capitalization in folder doc/source/reference and to…
cleconte987 Mar 23, 2020
dc839c5
Merge branches to update PR
cleconte987 Mar 23, 2020
f354797
Merge remote-tracking branch 'upstream_main_pandas/master' into scrip…
cleconte987 Mar 23, 2020
62d5164
Merge remote-tracking branch 'temporary_repo/changes_to_pandas_remote…
cleconte987 Mar 23, 2020
f8b496c
Remove wrong lines of code
cleconte987 Mar 23, 2020
5d01189
Formatting
cleconte987 Mar 23, 2020
1685076
Update branch
cleconte987 Mar 24, 2020
06dc1cd
Remove exception "GroupBy" and lower "GroupBy" in doc
cleconte987 Mar 24, 2020
a11dc2b
modifying for PR
cleconte987 Mar 25, 2020
e55064d
Merge remote-tracking branch 'upstream_main_pandas/master' into chang…
cleconte987 Mar 25, 2020
fc1009d
Update "groupby" to "GroupBy"
cleconte987 Mar 25, 2020
eba0d13
Merge remote-tracking branch 'upstream_main_pandas/master' into chang…
cleconte987 Mar 27, 2020
726bd4c
Merge remote-tracking branch 'upstream_main_pandas/master' into chang…
cleconte987 Mar 29, 2020
0beeda1
Commit changes to folder doc/source/development
cleconte987 Mar 29, 2020
f48b2dd
Add keywords to CAPITALIZATION_EXCEPTIONS
cleconte987 Mar 29, 2020
5ba464c
Merge remote-tracking branch 'upstream_main_pandas/master' into chang…
cleconte987 Apr 1, 2020
7c09610
Commit and updating documentation syntax and capitalization for folde…
cleconte987 Apr 1, 2020
940109d
Remove the 'ExtensionDtype' and 'ExtensionArray' exceptions from 'CAP…
cleconte987 Apr 1, 2020
35b1a37
Style formatting
cleconte987 Apr 1, 2020
5f0512e
Correct error by removing wrong lines of code in validate_rst_title_c…
cleconte987 Apr 1, 2020
7767d3c
Weird behaviour file 'pandas/tests/frame/indexing/test_setitem.py' no…
cleconte987 Apr 2, 2020
888aa10
merging remote pandas-dev/pandas/master
cleconte987 Apr 2, 2020
5fc4dcc
Commit modifying script 'validate_rst_title_capitalization.py' to ch…
cleconte987 Apr 2, 2020
0ad8143
Correct style errors
cleconte987 Apr 2, 2020
3ea43a5
Merge remote-tracking branch 'upstream_main_pandas/master' into chang…
cleconte987 Apr 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Validate correct capitalization among titles in documentation' ; echo $MSG
$BASE_DIR/scripts/validate_rst_title_capitalization.py $BASE_DIR/doc/source/development/contributing.rst
$BASE_DIR/scripts/validate_rst_title_capitalization.py $BASE_DIR/doc/source/development/contributing.rst $BASE_DIR/doc/source/reference
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If everything in development/ is fixed, can you change this in a new PR, so the whole directory is validated in the CI? Thanks!

Suggested change
$BASE_DIR/scripts/validate_rst_title_capitalization.py $BASE_DIR/doc/source/development/contributing.rst $BASE_DIR/doc/source/reference
$BASE_DIR/scripts/validate_rst_title_capitalization.py $BASE_DIR/doc/source/development $BASE_DIR/doc/source/reference

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

RET=$(($RET + $?)) ; echo $MSG "DONE"

fi
Expand Down
4 changes: 2 additions & 2 deletions doc/source/development/code_style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ consistent code format throughout the project. For details see the
Patterns
========

foo.__class__
Foo.class
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is on purpose, does validate_rst_title_capitalization.py showing this as an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is showing this as an error, because foo is not inside exceptions.
But moreover, it is removing underscores from the title here:
with open(rst_file, "r") as fd: previous_line = "" for i, line in enumerate(fd): line = line[:-1] line_chars = set(line) if ( len(line_chars) == 1 and line_chars.pop() in symbols and len(line) == len(previous_line) ): **yield re.sub(r"[{backtick}\*_]", "", previous_line)**, i previous_line = line

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cleconte987 can you change the title to Using foo.__class__ instead? And below same for Using f-strings.

This will make the validation pass, and things look probably even better, without adding extra complexity.

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger that!

-------------


Expand Down Expand Up @@ -47,7 +47,7 @@ String formatting
Concatenated strings
--------------------

f-strings
F-strings
~~~~~~~~~

pandas uses f-strings formatting instead of '%' and '.format()' string formatters.
Expand Down
14 changes: 7 additions & 7 deletions doc/source/development/contributing_docstring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ backticks. The following are considered inline code:

.. _docstring.short_summary:

Section 1: Short summary
Section 1: short summary
~~~~~~~~~~~~~~~~~~~~~~~~

The short summary is a single sentence that expresses what the function does in
Expand Down Expand Up @@ -228,7 +228,7 @@ infinitive verb.

.. _docstring.extended_summary:

Section 2: Extended summary
Section 2: extended summary
~~~~~~~~~~~~~~~~~~~~~~~~~~~

The extended summary provides details on what the function does. It should not
Expand Down Expand Up @@ -259,7 +259,7 @@ their use cases, if it is not too generic.

.. _docstring.parameters:

Section 3: Parameters
Section 3: parameters
~~~~~~~~~~~~~~~~~~~~~

The details of the parameters will be added in this section. This section has
Expand Down Expand Up @@ -424,7 +424,7 @@ For axis, the convention is to use something like:

.. _docstring.returns:

Section 4: Returns or Yields
Section 4: returns or yields
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the method returns a value, it will be documented in this section. Also
Expand Down Expand Up @@ -505,7 +505,7 @@ If the method yields its value:

.. _docstring.see_also:

Section 5: See Also
Section 5: see also
~~~~~~~~~~~~~~~~~~~

This section is used to let users know about pandas functionality
Expand Down Expand Up @@ -583,7 +583,7 @@ For example:

.. _docstring.notes:

Section 6: Notes
Section 6: notes
~~~~~~~~~~~~~~~~

This is an optional section used for notes about the implementation of the
Expand All @@ -597,7 +597,7 @@ This section follows the same format as the extended summary section.

.. _docstring.examples:

Section 7: Examples
Section 7: examples
~~~~~~~~~~~~~~~~~~~

This is one of the most important sections of a docstring, despite being
Expand Down
4 changes: 2 additions & 2 deletions doc/source/development/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ for each column, *including the index columns*. This has JSON form:

See below for the detailed specification for these.

Index Metadata Descriptors
Index metadata descriptors
~~~~~~~~~~~~~~~~~~~~~~~~~~

``RangeIndex`` can be stored as metadata only, not requiring serialization. The
Expand All @@ -89,7 +89,7 @@ with other column names) a disambiguating name with pattern matching
columns, ``name`` attribute is always stored in the column descriptors as
above.

Column Metadata
Column metadata
~~~~~~~~~~~~~~~

``pandas_type`` is the logical type of the column, and is one of:
Expand Down
8 changes: 4 additions & 4 deletions doc/source/development/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ on :ref:`ecosystem.extensions`.

The interface consists of two classes.

:class:`~pandas.api.extensions.ExtensionDtype`
Class:~pandas.API.extensions.ExtensionDtype
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:class: is something that we use for sphinx, I don't think that this is something we want

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

A :class:`pandas.api.extensions.ExtensionDtype` is similar to a ``numpy.dtype`` object. It describes the
Expand All @@ -115,7 +115,7 @@ example ``'category'`` is a registered string accessor for the ``CategoricalDtyp

See the `extension dtype dtypes`_ for more on how to register dtypes.

:class:`~pandas.api.extensions.ExtensionArray`
Class:~pandas.API.extensions.ExtensionArray
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This class provides all the array-like functionality. ExtensionArrays are
Expand All @@ -139,7 +139,7 @@ and comments contain guidance for properly implementing the interface.

.. _extending.extension.operator:

:class:`~pandas.api.extensions.ExtensionArray` Operator Support
Class:~pandas.API.extensions.ExtensionArray operator support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. versionadded:: 0.24.0
Expand Down Expand Up @@ -210,7 +210,7 @@ will

.. _extending.extension.ufunc:

NumPy Universal Functions
NumPy universal functions
^^^^^^^^^^^^^^^^^^^^^^^^^

:class:`Series` implements ``__array_ufunc__``. As part of the implementation,
Expand Down
12 changes: 6 additions & 6 deletions doc/source/development/maintaining.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _maintaining:

******************
Pandas Maintenance
pandas maintenance
******************

This guide is for pandas' maintainers. It may also be interesting to contributors
Expand Down Expand Up @@ -41,7 +41,7 @@ reading.

.. _maintaining.triage:

Issue Triage
Issue triage
------------


Expand Down Expand Up @@ -123,7 +123,7 @@ Here's a typical workflow for triaging a newly opened issue.

.. _maintaining.closing:

Closing Issues
Closing issues
--------------

Be delicate here: many people interpret closing an issue as us saying that the
Expand All @@ -132,7 +132,7 @@ respond or self-close their issue if it's determined that the behavior is not a
or the feature is out of scope. Sometimes reporters just go away though, and
we'll close the issue after the conversation has died.

Reviewing Pull Requests
Reviewing pull requests
-----------------------

Anybody can review a pull request: regular contributors, triagers, or core-team
Expand All @@ -144,7 +144,7 @@ members. Here are some guidelines to check.
* User-facing changes should have a whatsnew in the appropriate file.
* Regression tests should reference the original GitHub issue number like ``# GH-1234``.

Cleaning up old Issues
Cleaning up old issues
----------------------

Every open issue in pandas has a cost. Open issues make finding duplicates harder,
Expand All @@ -164,7 +164,7 @@ If an older issue lacks a reproducible example, label it as "Needs Info" and
ask them to provide one (or write one yourself if possible). If one isn't
provide reasonably soon, close it according to the policies in :ref:`maintaining.closing`.

Cleaning up old Pull Requests
Cleaning up old pull requests
-----------------------------

Occasionally, contributors are unable to finish off a pull request.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/development/meeting.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _meeting:

==================
Developer Meetings
Developer meetings
==================

We hold regular developer meetings on the second Wednesday
Expand Down
4 changes: 2 additions & 2 deletions doc/source/development/policies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Policies

.. _policies.version:

Version Policy
Version policy
~~~~~~~~~~~~~~

.. versionchanged:: 1.0.0
Expand Down Expand Up @@ -48,7 +48,7 @@ deprecation removed in the next next major release (2.0.0).
These policies do not apply to features marked as **experimental** in the documentation.
pandas may change the behavior of experimental features at any time.

Python Support
Python support
~~~~~~~~~~~~~~

pandas will only drop support for specific Python versions (e.g. 3.6.x, 3.7.x) in
Expand Down
2 changes: 1 addition & 1 deletion doc/source/development/roadmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ We'd like to fund improvements and maintenance of these tools to

.. _roadmap.evolution:

Roadmap Evolution
Roadmap evolution
-----------------

pandas continues to evolve. The direction is primarily determined by community
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/arrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. _api.arrays:

=============
Pandas arrays
pandas arrays
=============

.. currentmodule:: pandas
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Combining / joining / merging
DataFrame.merge
DataFrame.update

Time series-related
Time Series-related
~~~~~~~~~~~~~~~~~~~
.. autosummary::
:toctree: api/
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/indexing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ DatetimeIndex

DatetimeIndex

Time/Date components
Time/date components
~~~~~~~~~~~~~~~~~~~~
.. autosummary::
:toctree: api/
Expand Down
4 changes: 2 additions & 2 deletions doc/source/reference/series.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Binary operator functions
Series.product
Series.dot

Function application, groupby & window
Function application, GroupBy & window
--------------------------------------
.. autosummary::
:toctree: api/
Expand Down Expand Up @@ -249,7 +249,7 @@ Combining / joining / merging
Series.replace
Series.update

Time series-related
Time Series-related
-------------------
.. autosummary::
:toctree: api/
Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Exponentially-weighted moving window functions
EWM.corr
EWM.cov

Window Indexer
Window indexer
--------------
.. currentmodule:: pandas

Expand Down
64 changes: 60 additions & 4 deletions scripts/validate_rst_title_capitalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

"""
import argparse
import sys
import re
import os
from typing import Tuple, Generator, List
import glob
import os
import re
import sys
from typing import Generator, List, Tuple


CAPITALIZATION_EXCEPTIONS = {
Expand Down Expand Up @@ -46,6 +46,62 @@
"NumFOCUS",
"sklearn",
"Docker",
"PeriodIndex",
"NA",
"NaN",
"ValueError",
"BooleanArray",
"KeyError",
"API",
"FAQ",
"IO",
"TimedeltaIndex",
"DatetimeIndex",
"IntervalIndex",
"CategoricalIndex",
"GroupBy",
"SPSS",
"ORC",
"R",
"HDF5",
"HDFStore",
"CDay",
"CBMonthBegin",
"CBMonthEnd",
"BMonthBegin",
"BMonthEnd",
"BDay",
"FY5253Quarter",
"FY5253",
"YearBegin",
"YearEnd",
"BYearBegin",
"BYearEnd",
"YearOffset",
"QuarterBegin",
"QuarterEnd",
"BQuarterBegin",
"BQuarterEnd",
"QuarterOffset",
"LastWeekOfMonth",
"WeekOfMonth",
"SemiMonthBegin",
"SemiMonthEnd",
"SemiMonthOffset",
"CustomBusinessMonthBegin",
"CustomBusinessMonthEnd",
"BusinessMonthBegin",
"BusinessMonthEnd",
"MonthBegin",
"MonthEnd",
"MonthOffset",
"CustomBusinessHour",
"CustomBusinessDay",
"BusinessHour",
"BusinessDay",
"DateOffset",
"ExtensionDtype",
"ExtensionArray",
}

CAP_EXCEPTIONS_DICT = {word.lower(): word for word in CAPITALIZATION_EXCEPTIONS}
Expand Down