diff --git a/ci/code_checks.sh b/ci/code_checks.sh index c8d08277e9a26..732f9c5181b97 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -327,7 +327,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 RET=$(($RET + $?)) ; echo $MSG "DONE" fi diff --git a/doc/source/development/code_style.rst b/doc/source/development/code_style.rst index fa7532a68a06d..6d33537a40175 100644 --- a/doc/source/development/code_style.rst +++ b/doc/source/development/code_style.rst @@ -18,8 +18,8 @@ consistent code format throughout the project. For details see the Patterns ======== -foo.__class__ -------------- +Using foo.__class__ +------------------- pandas uses 'type(foo)' instead 'foo.__class__' as it is making the code more @@ -47,8 +47,8 @@ String formatting Concatenated strings -------------------- -f-strings -~~~~~~~~~ +Using f-strings +~~~~~~~~~~~~~~~ pandas uses f-strings formatting instead of '%' and '.format()' string formatters. diff --git a/doc/source/development/extending.rst b/doc/source/development/extending.rst index c0b20e2d2843b..d9fb2643e8a1a 100644 --- a/doc/source/development/extending.rst +++ b/doc/source/development/extending.rst @@ -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 diff --git a/doc/source/development/policies.rst b/doc/source/development/policies.rst index b7cc3db3ad260..1031bbfc46457 100644 --- a/doc/source/development/policies.rst +++ b/doc/source/development/policies.rst @@ -6,7 +6,7 @@ Policies .. _policies.version: -Version Policy +Version policy ~~~~~~~~~~~~~~ .. versionchanged:: 1.0.0 @@ -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 diff --git a/doc/source/development/roadmap.rst b/doc/source/development/roadmap.rst index e57ff82add278..d331491d02883 100644 --- a/doc/source/development/roadmap.rst +++ b/doc/source/development/roadmap.rst @@ -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 diff --git a/doc/source/reference/frame.rst b/doc/source/reference/frame.rst index b326bbb5a465e..cf81540a77d11 100644 --- a/doc/source/reference/frame.rst +++ b/doc/source/reference/frame.rst @@ -251,7 +251,7 @@ Combining / joining / merging DataFrame.merge DataFrame.update -Time series-related +Time Series-related ~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ diff --git a/doc/source/reference/indexing.rst b/doc/source/reference/indexing.rst index ab6ea5aea6c61..ba12c19763605 100644 --- a/doc/source/reference/indexing.rst +++ b/doc/source/reference/indexing.rst @@ -328,7 +328,7 @@ DatetimeIndex DatetimeIndex -Time/Date components +Time/date components ~~~~~~~~~~~~~~~~~~~~ .. autosummary:: :toctree: api/ diff --git a/doc/source/reference/series.rst b/doc/source/reference/series.rst index 1a69fa076dbf0..ab0540a930396 100644 --- a/doc/source/reference/series.rst +++ b/doc/source/reference/series.rst @@ -110,7 +110,7 @@ Binary operator functions Series.product Series.dot -Function application, groupby & window +Function application, GroupBy & window -------------------------------------- .. autosummary:: :toctree: api/ @@ -249,7 +249,7 @@ Combining / joining / merging Series.replace Series.update -Time series-related +Time Series-related ------------------- .. autosummary:: :toctree: api/ diff --git a/scripts/validate_rst_title_capitalization.py b/scripts/validate_rst_title_capitalization.py index 3e0ae90e26527..59d422a1605a0 100755 --- a/scripts/validate_rst_title_capitalization.py +++ b/scripts/validate_rst_title_capitalization.py @@ -45,6 +45,60 @@ "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", } CAP_EXCEPTIONS_DICT = {word.lower(): word for word in CAPITALIZATION_EXCEPTIONS} @@ -69,6 +123,11 @@ def correct_title_capitalization(title: str) -> str: Correctly capitalized heading. """ + # Skip modification no matter what if title begins by ":" to exclude specific + # syntax that is needed to build links. + if title[0] == ":": + return title + # Strip all non-word characters from the beginning of the title to the # first word character. correct_title: str = re.sub(r"^\W*", "", title).capitalize()