From 03b0967ec74a7fad9d6c61c6127dc8e33596181d Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:07:23 -0700 Subject: [PATCH 01/14] Potential fix for PR02 errors in pandas.tseries.offsets --- ci/code_checks.sh | 1 - pandas/_libs/tslibs/offsets.pyx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 9c9cd2cc6650e..456a2bb52e745 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -88,7 +88,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Series.cat.set_categories\ pandas.Series.plot\ pandas.DataFrame.plot\ - pandas.tseries.offsets.DateOffset\ pandas.tseries.offsets.BusinessDay\ pandas.tseries.offsets.BDay\ pandas.tseries.offsets.BusinessHour\ diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index e96a905367f69..37d5ba385e3d9 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,7 +1586,7 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - Parameters + Parameters # numpydoc ignore=PR02 ---------- n : int, default 1 The number of time periods the offset represents. From f972fc5da4ce68340325762e40a3cbab10a6cd86 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sat, 10 Feb 2024 19:02:50 -0700 Subject: [PATCH 02/14] fixing CI numpydoc docscrape UserWarning: potentially wrong underline length --- pandas/_libs/tslibs/offsets.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 37d5ba385e3d9..6e4eebe2010fb 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,7 +1586,8 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - Parameters # numpydoc ignore=PR02 + # numpydoc ignore=PR02 + Parameters ---------- n : int, default 1 The number of time periods the offset represents. From 611957d1dd46d767a27c8909cc185a4495e3ba52 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sat, 10 Feb 2024 19:44:55 -0700 Subject: [PATCH 03/14] testing # numpydoc ignore=PR02 fix for failing CI warnings --- pandas/_libs/tslibs/offsets.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 6e4eebe2010fb..ca0a0f645cfb8 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,9 +1586,9 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - # numpydoc ignore=PR02 - Parameters - ---------- + Parameters # numpydoc ignore=PR02 + ---------- # numpydoc ignore=PR02 + n : int, default 1 The number of time periods the offset represents. If specified without a temporal pattern, defaults to n days. From 246d088d609973f3a6537fa5cfd30f5037f0795e Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sat, 10 Feb 2024 22:00:00 -0700 Subject: [PATCH 04/14] fixing docstring formatting --- pandas/_libs/tslibs/offsets.pyx | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index ca0a0f645cfb8..82dcff85ebeda 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1588,7 +1588,6 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Parameters # numpydoc ignore=PR02 ---------- # numpydoc ignore=PR02 - n : int, default 1 The number of time periods the offset represents. If specified without a temporal pattern, defaults to n days. From 224776aa443ae3cd64fbb8090a12e9508d137b60 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sat, 10 Feb 2024 23:49:12 -0700 Subject: [PATCH 05/14] format Ignore Validation Checks w Inline Comment --- pandas/_libs/tslibs/offsets.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 82dcff85ebeda..6989eed9f8aee 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,8 +1586,8 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - Parameters # numpydoc ignore=PR02 - ---------- # numpydoc ignore=PR02 + Parameters # numpydoc ignore=PR02 + ---------- # numpydoc ignore=PR02 n : int, default 1 The number of time periods the offset represents. If specified without a temporal pattern, defaults to n days. From 5477a46523c75cacfe520ca0f9936ce6a0ecca58 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sun, 11 Feb 2024 00:18:14 -0700 Subject: [PATCH 06/14] trying different comment format --- pandas/_libs/tslibs/offsets.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 6989eed9f8aee..eee6e18c599be 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,8 +1586,9 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - Parameters # numpydoc ignore=PR02 - ---------- # numpydoc ignore=PR02 + '''numpydoc ignore=PR02''' + Parameters + ---------- n : int, default 1 The number of time periods the offset represents. If specified without a temporal pattern, defaults to n days. From 74c4e724a35d6a5afd8dc66a99ac6e56bd60e095 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sun, 11 Feb 2024 00:53:58 -0700 Subject: [PATCH 07/14] Fixing comment that is failing CI checks --- pandas/_libs/tslibs/offsets.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index eee6e18c599be..f157579fb9859 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,8 +1586,7 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - '''numpydoc ignore=PR02''' - Parameters + Parameters '''numpydoc ignore=PR02''' ---------- n : int, default 1 The number of time periods the offset represents. From 4a02b19beae0c5ab3a91b7ffea225466b714bae0 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sun, 11 Feb 2024 01:10:34 -0700 Subject: [PATCH 08/14] reverting to original comment --- pandas/_libs/tslibs/offsets.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index f157579fb9859..91d5478b510a9 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,7 +1586,7 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - Parameters '''numpydoc ignore=PR02''' + Parameters #numpydoc ignore=PR02 ---------- n : int, default 1 The number of time periods the offset represents. From 9dc8e06a4e106a18853a11240f74946fe4404305 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sun, 11 Feb 2024 01:56:03 -0700 Subject: [PATCH 09/14] using single quote comment format for PR02 errors --- pandas/_libs/tslibs/offsets.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 91d5478b510a9..f157579fb9859 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,7 +1586,7 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - Parameters #numpydoc ignore=PR02 + Parameters '''numpydoc ignore=PR02''' ---------- n : int, default 1 The number of time periods the offset represents. From 08e862e18fbf6b3fc1aae7a1d3117a5ca94f89e2 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sun, 11 Feb 2024 03:09:04 -0700 Subject: [PATCH 10/14] update formatting to triple single quotes for CI check compat --- pandas/_libs/tslibs/offsets.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index f157579fb9859..eee6e18c599be 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,7 +1586,8 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - Parameters '''numpydoc ignore=PR02''' + '''numpydoc ignore=PR02''' + Parameters ---------- n : int, default 1 The number of time periods the offset represents. From 565b300bcca49a511fcf9fe3086cce51def0dc74 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sun, 11 Feb 2024 13:07:53 -0700 Subject: [PATCH 11/14] reverting to original comment format for numpydoc ignore --- pandas/_libs/tslibs/offsets.pyx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index eee6e18c599be..6989eed9f8aee 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,9 +1586,8 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - '''numpydoc ignore=PR02''' - Parameters - ---------- + Parameters # numpydoc ignore=PR02 + ---------- # numpydoc ignore=PR02 n : int, default 1 The number of time periods the offset represents. If specified without a temporal pattern, defaults to n days. From 58f0520f926083ddfe2f145bad28d8b28e738cc7 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sun, 11 Feb 2024 13:41:09 -0700 Subject: [PATCH 12/14] inline comment whitespace --- pandas/_libs/tslibs/offsets.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 6989eed9f8aee..82dcff85ebeda 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,8 +1586,8 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - Parameters # numpydoc ignore=PR02 - ---------- # numpydoc ignore=PR02 + Parameters # numpydoc ignore=PR02 + ---------- # numpydoc ignore=PR02 n : int, default 1 The number of time periods the offset represents. If specified without a temporal pattern, defaults to n days. From a47efb9a86b9fb4cc7bd2ec296af1d4d12eb18b4 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sun, 11 Feb 2024 14:13:00 -0700 Subject: [PATCH 13/14] fixing Doc Build unexpected unindent warning --- pandas/_libs/tslibs/offsets.pyx | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 82dcff85ebeda..ca0a0f645cfb8 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1588,6 +1588,7 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Parameters # numpydoc ignore=PR02 ---------- # numpydoc ignore=PR02 + n : int, default 1 The number of time periods the offset represents. If specified without a temporal pattern, defaults to n days. From 0b79001d656b2917ba3abbf2c833592543caf058 Mon Sep 17 00:00:00 2001 From: Jordan Murphy <35613487+jordan-d-murphy@users.noreply.github.com> Date: Sun, 11 Feb 2024 14:43:33 -0700 Subject: [PATCH 14/14] testing single quote comments --- pandas/_libs/tslibs/offsets.pyx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index ca0a0f645cfb8..f04c62c8f1021 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1586,9 +1586,8 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): Besides, adding a DateOffsets specified by the singular form of the date component can be used to replace certain component of the timestamp. - Parameters # numpydoc ignore=PR02 - ---------- # numpydoc ignore=PR02 - + Parameters ''' numpydoc ignore=PR02 ''' + ---------- ''' numpydoc ignore=PR02 ''' n : int, default 1 The number of time periods the offset represents. If specified without a temporal pattern, defaults to n days.