diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 744f934142a24..823687cc20ca0 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -93,8 +93,8 @@ fi ### DOCSTRINGS ### if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then - MSG='Validate docstrings (GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS03, SS04, SS05, PR03, PR04, PR05, PRO9, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS03,SS04,SS05,PR03,PR04,PR05,PR09,PR10,EX04,RT01,RT04,RT05,SA02,SA03 + MSG='Validate docstrings (GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS03, SS04, SS05, PR03, PR04, PR05, PRO9, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG + $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS03,SS04,SS05,PR03,PR04,PR05,PR09,PR10,EX04,RT01,RT04,RT05,SA02,SA03 RET=$(($RET + $?)) ; echo $MSG "DONE" fi diff --git a/pandas/core/window/doc.py b/pandas/core/window/doc.py index 2cc7962c6bd7b..61f388c35df0f 100644 --- a/pandas/core/window/doc.py +++ b/pandas/core/window/doc.py @@ -11,7 +11,7 @@ def create_section_header(header: str) -> str: return "\n".join((header, "-" * len(header))) + "\n" -template_header = "Calculate the {window_method} {aggregation_description}.\n\n" +template_header = "\nCalculate the {window_method} {aggregation_description}.\n\n" template_returns = dedent( """ diff --git a/pandas/io/formats/style_render.py b/pandas/io/formats/style_render.py index a94d9ee5416c4..de475d145f3a0 100644 --- a/pandas/io/formats/style_render.py +++ b/pandas/io/formats/style_render.py @@ -57,17 +57,23 @@ class CSSDict(TypedDict): Subset = Union[slice, Sequence, Index] +def _gl01_adjust(obj: Any) -> Any: + """Adjust docstrings for Numpydoc GLO1.""" + obj.__doc__ = "\n" + obj.__doc__ + return obj + + class StylerRenderer: """ Base class to process rendering a Styler with a specified jinja2 template. """ - loader = jinja2.PackageLoader("pandas", "io/formats/templates") - env = jinja2.Environment(loader=loader, trim_blocks=True) - template_html = env.get_template("html.tpl") - template_html_table = env.get_template("html_table.tpl") - template_html_style = env.get_template("html_style.tpl") - template_latex = env.get_template("latex.tpl") + loader = _gl01_adjust(jinja2.PackageLoader("pandas", "io/formats/templates")) + env = _gl01_adjust(jinja2.Environment(loader=loader, trim_blocks=True)) + template_html = _gl01_adjust(env.get_template("html.tpl")) + template_html_table = _gl01_adjust(env.get_template("html_table.tpl")) + template_html_style = _gl01_adjust(env.get_template("html_style.tpl")) + template_latex = _gl01_adjust(env.get_template("latex.tpl")) def __init__( self,