From caea0332f9746da2966e079cd28c34894a3b6ced Mon Sep 17 00:00:00 2001 From: hlakams Date: Tue, 27 Aug 2024 16:23:08 -0700 Subject: [PATCH 1/3] DOCS: pandas.core.window SA01 docstring validation error fixed --- ci/code_checks.sh | 5 ----- pandas/core/window/expanding.py | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 72678be1587f8..0136443c4c678 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -253,11 +253,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.core.resample.Resampler.sum SA01" \ -i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \ -i "pandas.core.resample.Resampler.var SA01" \ - -i "pandas.core.window.expanding.Expanding.corr PR01" \ - -i "pandas.core.window.expanding.Expanding.count PR01" \ - -i "pandas.core.window.rolling.Rolling.max PR01" \ - -i "pandas.core.window.rolling.Window.std PR01" \ - -i "pandas.core.window.rolling.Window.var PR01" \ -i "pandas.date_range RT03" \ -i "pandas.errors.AbstractMethodError PR01,SA01" \ -i "pandas.errors.AttributeConflictWarning SA01" \ diff --git a/pandas/core/window/expanding.py b/pandas/core/window/expanding.py index d0c8a2e67b6ca..4bf77b3d38689 100644 --- a/pandas/core/window/expanding.py +++ b/pandas/core/window/expanding.py @@ -174,6 +174,8 @@ def aggregate(self, func, *args, **kwargs): @doc( template_header, + create_section_header("Parameters"), + kwargs_numeric_only, create_section_header("Returns"), template_returns, create_section_header("See Also"), @@ -865,6 +867,9 @@ def cov( output will be a MultiIndexed DataFrame in the case of DataFrame inputs. In the case of missing elements, only complete pairwise observations will be used. + ddof : int, default 1 + Delta Degrees of Freedom. The divisor used in calculations + is ``N - ddof``, where ``N`` represents the number of elements.\n """ ).replace("\n", "", 1), kwargs_numeric_only, From 9c476ede4b17e574617b5140a1d5f215939fa3b5 Mon Sep 17 00:00:00 2001 From: hlakams Date: Tue, 27 Aug 2024 17:52:06 -0700 Subject: [PATCH 2/3] DOC: pandas.core.window SA01 docstring validation error linting fixes --- pandas/core/window/rolling.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 16aa6d7e56a1c..2b3fab206f212 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -1392,6 +1392,13 @@ def var(self, ddof: int = 1, numeric_only: bool = False, **kwargs): @doc( template_header, create_section_header("Parameters"), + dedent( + """ + ddof : int, default 1 + Delta Degrees of Freedom. The divisor used in calculations + is ``N - ddof``, where ``N`` represents the number of elements. + """ + ).replace("\n", "", 1), kwargs_numeric_only, kwargs_scipy, create_section_header("Returns"), @@ -2099,7 +2106,19 @@ def sum( template_header, create_section_header("Parameters"), kwargs_numeric_only, + dedent( + """ + *args : iterable, optional + Positional arguments passed into ``func``.\n + """ + ).replace("\n", "", 1), window_agg_numba_parameters(), + dedent( + """ + **kwargs : mapping, optional + A dictionary of keyword arguments passed into ``func``.\n + """ + ).replace("\n", "", 1), create_section_header("Returns"), template_returns, create_section_header("See Also"), From 3aeaf1d17fe9690300b73f6937bf145130cf051a Mon Sep 17 00:00:00 2001 From: hlakams Date: Tue, 27 Aug 2024 19:57:00 -0700 Subject: [PATCH 3/3] DOC: pandas.core.window.rolling.Window.var PR01 docstring validation fix --- pandas/core/window/rolling.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 2b3fab206f212..37dcf3bc14282 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -1350,6 +1350,13 @@ def mean(self, numeric_only: bool = False, **kwargs): @doc( template_header, create_section_header("Parameters"), + dedent( + """ + ddof : int, default 1 + Delta Degrees of Freedom. The divisor used in calculations + is ``N - ddof``, where ``N`` represents the number of elements. + """ + ).replace("\n", "", 1), kwargs_numeric_only, kwargs_scipy, create_section_header("Returns"),