From eb3de8dd58206b3ed44dca06a6dc9c81e22829df Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Mon, 23 Sep 2019 00:34:34 +0100 Subject: [PATCH 1/9] Updated tseries.offsets for docstring errors PR08 --- pandas/tseries/offsets.py | 117 +++++++++++++++++++++++--------------- 1 file changed, 71 insertions(+), 46 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 82cbfa831bf32..5c982e548520b 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -1007,9 +1007,9 @@ class CustomBusinessDay(_CustomMixin, BusinessDay): normalize : bool, default False Normalize start/end dates to midnight before generating date range weekmask : str, Default 'Mon Tue Wed Thu Fri' - weekmask of valid business days, passed to ``numpy.busdaycalendar`` + Weekmask of valid business days, passed to ``numpy.busdaycalendar`` holidays : list - list/array of dates to exclude from the set of valid business days, + List/array of dates to exclude from the set of valid business days, passed to ``numpy.busdaycalendar`` calendar : pd.HolidayCalendar or np.busdaycalendar offset : timedelta, default timedelta(0) @@ -1671,16 +1671,19 @@ class WeekOfMonth(_WeekOfMonthMixin, DateOffset): Parameters ---------- n : int - week : {0, 1, 2, 3, ...}, default 0 - 0 is 1st week of month, 1 2nd week, etc. - weekday : {0, 1, ..., 6}, default 0 - 0: Mondays - 1: Tuesdays - 2: Wednesdays - 3: Thursdays - 4: Fridays - 5: Saturdays - 6: Sundays + week : int {0, 1, 2, 3, ...}, default 0 + A specific integer for the week of the month. + e.g. 0 is 1st week of month, 1 is the 2nd week, etc. + weekday : int {0, 1, ..., 6}, default 0 + A specific integer for the day of the week. + + - 0 is Monday + - 1 is Tuesday + - 2 is Wednesday + - 3 is Thursday + - 4 is Friday + - 5 is Saturday + - 6 is Sunday """ _prefix = "WOM" @@ -1747,14 +1750,16 @@ class LastWeekOfMonth(_WeekOfMonthMixin, DateOffset): Parameters ---------- n : int, default 1 - weekday : {0, 1, ..., 6}, default 0 - 0: Mondays - 1: Tuesdays - 2: Wednesdays - 3: Thursdays - 4: Fridays - 5: Saturdays - 6: Sundays + weekday : int {0, 1, ..., 6}, default 0 + A specific integer for the day of the week. + + - 0 is Monday + - 1 is Tuesday + - 2 is Wednesday + - 3 is Thursday + - 4 is Friday + - 5 is Saturday + - 6 is Sunday """ _prefix = "LWOM" @@ -2055,6 +2060,7 @@ class FY5253(DateOffset): http://en.wikipedia.org/wiki/4-4-5_calendar The year may either: + - end on the last X day of the Y month. - end on the last X day closest to the last day of the Y month. @@ -2064,17 +2070,26 @@ class FY5253(DateOffset): Parameters ---------- n : int - weekday : {0, 1, ..., 6} - 0: Mondays - 1: Tuesdays - 2: Wednesdays - 3: Thursdays - 4: Fridays - 5: Saturdays - 6: Sundays - startingMonth : The month in which fiscal years end. {1, 2, ... 12} - variation : str - {"nearest", "last"} for "LastOfMonth" or "NearestEndMonth" + weekday : int {0, 1, ..., 6}, default 0 + A specific integer for the day of the week. + + - 0 is Monday + - 1 is Tuesday + - 2 is Wednesday + - 3 is Thursday + - 4 is Friday + - 5 is Saturday + - 6 is Sunday + startingMonth : int {1, 2, ... 12}, default 1 + The month in which the fiscal year ends. + variation : str, default "nearest" + Method of employing 4-4-5 calendar. There are two options: + + - "nearest" defines fiscal year end as the **weekday** which falls + closest to the last day of the fiscal year end month. + + - "last" defines fiscal year end as the final **weekday** in the + fiscal year end month. """ _prefix = "RE" @@ -2258,6 +2273,7 @@ class FY5253Quarter(DateOffset): http://en.wikipedia.org/wiki/4-4-5_calendar The year may either: + - end on the last X day of the Y month. - end on the last X day closest to the last day of the Y month. @@ -2271,19 +2287,28 @@ class FY5253Quarter(DateOffset): Parameters ---------- n : int - weekday : {0, 1, ..., 6} - 0: Mondays - 1: Tuesdays - 2: Wednesdays - 3: Thursdays - 4: Fridays - 5: Saturdays - 6: Sundays - startingMonth : The month in which fiscal years end. {1, 2, ... 12} - qtr_with_extra_week : The quarter number that has the leap - or 14 week when needed. {1,2,3,4} - variation : str - {"nearest", "last"} for "LastOfMonth" or "NearestEndMonth" + weekday : int {0, 1, ..., 6}, default 0 + A specific integer for the day of the week. + + - 0 is Monday + - 1 is Tuesday + - 2 is Wednesday + - 3 is Thursday + - 4 is Friday + - 5 is Saturday + - 6 is Sunday + startingMonth : int {1, 2, ..., 12}, default 1 + The month in which fiscal years end. + qtr_with_extra_week : int {1, 2, 3, 4}, default 1 + The quarter number that has the leap or 14 week when needed. + variation : str, default "nearest" + Method of employing 4-4-5 calendar. There are two options: + + - "nearest" defines fiscal year end as the **weekday** which falls + closest to the last day of the fiscal year end month. + + - "last" defines fiscal year end as the final **weekday** in the + fiscal year end month. """ _prefix = "REQ" @@ -2707,8 +2732,8 @@ def generate_range(start=None, end=None, periods=None, offset=BDay()): Parameters ---------- - start : datetime (default None) - end : datetime (default None) + start : datetime, (default None) + end : datetime, (default None) periods : int, (default None) offset : DateOffset, (default BDay()) From 1049a54a6ccb3e0ee59173e3c87c4f8ac5acac11 Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Mon, 23 Sep 2019 23:00:48 +0100 Subject: [PATCH 2/9] DOC: 10 fixes for PR08 doc issues. Also Added blank lines to fix format tests in CI GH28571 --- pandas/tseries/offsets.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 5c982e548520b..d676bae3b712a 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -2080,6 +2080,7 @@ class FY5253(DateOffset): - 4 is Friday - 5 is Saturday - 6 is Sunday + startingMonth : int {1, 2, ... 12}, default 1 The month in which the fiscal year ends. variation : str, default "nearest" @@ -2090,6 +2091,7 @@ class FY5253(DateOffset): - "last" defines fiscal year end as the final **weekday** in the fiscal year end month. + """ _prefix = "RE" @@ -2297,6 +2299,7 @@ class FY5253Quarter(DateOffset): - 4 is Friday - 5 is Saturday - 6 is Sunday + startingMonth : int {1, 2, ..., 12}, default 1 The month in which fiscal years end. qtr_with_extra_week : int {1, 2, 3, 4}, default 1 @@ -2309,6 +2312,7 @@ class FY5253Quarter(DateOffset): - "last" defines fiscal year end as the final **weekday** in the fiscal year end month. + """ _prefix = "REQ" From f446cb3a628fd37b06c402469268e0b8744c5221 Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Mon, 23 Sep 2019 23:32:12 +0100 Subject: [PATCH 3/9] DOC: 10 fixes for PR08 doc issues. Also Added blank lines to fix format tests in CI GH28571 --- pandas/tseries/offsets.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index d676bae3b712a..7e56291c0675c 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -2091,7 +2091,6 @@ class FY5253(DateOffset): - "last" defines fiscal year end as the final **weekday** in the fiscal year end month. - """ _prefix = "RE" @@ -2312,7 +2311,6 @@ class FY5253Quarter(DateOffset): - "last" defines fiscal year end as the final **weekday** in the fiscal year end month. - """ _prefix = "REQ" From b9cb97fad3dd81c242b1f8c6cf13088bf623d7ac Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Tue, 24 Sep 2019 00:04:44 +0100 Subject: [PATCH 4/9] DOC: 10 fixes for PR08 doc issues. Also Added blank lines to fix format tests in CI GH28571 --- pandas/tseries/offsets.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 7e56291c0675c..35408f7efadd0 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -2081,8 +2081,6 @@ class FY5253(DateOffset): - 5 is Saturday - 6 is Sunday - startingMonth : int {1, 2, ... 12}, default 1 - The month in which the fiscal year ends. variation : str, default "nearest" Method of employing 4-4-5 calendar. There are two options: @@ -2091,6 +2089,9 @@ class FY5253(DateOffset): - "last" defines fiscal year end as the final **weekday** in the fiscal year end month. + + startingMonth : int {1, 2, ... 12}, default 1 + The month in which the fiscal year ends. """ _prefix = "RE" @@ -2301,8 +2302,6 @@ class FY5253Quarter(DateOffset): startingMonth : int {1, 2, ..., 12}, default 1 The month in which fiscal years end. - qtr_with_extra_week : int {1, 2, 3, 4}, default 1 - The quarter number that has the leap or 14 week when needed. variation : str, default "nearest" Method of employing 4-4-5 calendar. There are two options: @@ -2311,6 +2310,9 @@ class FY5253Quarter(DateOffset): - "last" defines fiscal year end as the final **weekday** in the fiscal year end month. + + qtr_with_extra_week : int {1, 2, 3, 4}, default 1 + The quarter number that has the leap or 14 week when needed. """ _prefix = "REQ" From 0eb80d019764f926b44c0ebfae3a08605159ae7b Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Thu, 26 Sep 2019 16:52:47 +0100 Subject: [PATCH 5/9] DOC: updated tseries for PR08 doc errors --- pandas/tseries/offsets.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 35408f7efadd0..3257b6c413b05 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -2081,17 +2081,15 @@ class FY5253(DateOffset): - 5 is Saturday - 6 is Sunday + startingMonth : int {1, 2, ... 12}, default 1 + The month in which the fiscal year ends. + variation : str, default "nearest" Method of employing 4-4-5 calendar. There are two options: - - "nearest" defines fiscal year end as the **weekday** which falls - closest to the last day of the fiscal year end month. - - - "last" defines fiscal year end as the final **weekday** in the - fiscal year end month. + - "nearest" defines fiscal year end a **weekday** which falls closest to last day of month in fiscal year. - startingMonth : int {1, 2, ... 12}, default 1 - The month in which the fiscal year ends. + - "last" defines fiscal year end as the final **weekday** in the fiscal year end month. """ _prefix = "RE" @@ -2302,17 +2300,16 @@ class FY5253Quarter(DateOffset): startingMonth : int {1, 2, ..., 12}, default 1 The month in which fiscal years end. + + qtr_with_extra_week : int {1, 2, 3, 4}, default 1 + The quarter number that has the leap or 14 week when needed. + variation : str, default "nearest" Method of employing 4-4-5 calendar. There are two options: - - "nearest" defines fiscal year end as the **weekday** which falls - closest to the last day of the fiscal year end month. + - "nearest" defines fiscal year end as **weekday** which falls closest to last day of month in fiscal year. - - "last" defines fiscal year end as the final **weekday** in the - fiscal year end month. - - qtr_with_extra_week : int {1, 2, 3, 4}, default 1 - The quarter number that has the leap or 14 week when needed. + - "last" defines fiscal year end as the final **weekday** in the fiscal year end month. """ _prefix = "REQ" From 6382dd4becf4860b19341d778ab8e11665c186e0 Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Thu, 26 Sep 2019 16:56:32 +0100 Subject: [PATCH 6/9] DOC: updated tseries for PR08 doc errors --- pandas/tseries/offsets.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 3257b6c413b05..346b223f496bb 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -2087,9 +2087,11 @@ class FY5253(DateOffset): variation : str, default "nearest" Method of employing 4-4-5 calendar. There are two options: - - "nearest" defines fiscal year end a **weekday** which falls closest to last day of month in fiscal year. + - "nearest" defines fiscal year end a **weekday** which falls + closest to last day of month in fiscal year. - - "last" defines fiscal year end as the final **weekday** in the fiscal year end month. + - "last" defines fiscal year end as the final + **weekday** in the fiscal year end month. """ _prefix = "RE" @@ -2307,9 +2309,11 @@ class FY5253Quarter(DateOffset): variation : str, default "nearest" Method of employing 4-4-5 calendar. There are two options: - - "nearest" defines fiscal year end as **weekday** which falls closest to last day of month in fiscal year. + - "nearest" defines fiscal year end as **weekday** which falls closest + to last day of month in fiscal year. - - "last" defines fiscal year end as the final **weekday** in the fiscal year end month. + - "last" defines fiscal year end as the final **weekday** in the fiscal + year end month. """ _prefix = "REQ" From e671962f8c31ac1d53c94c555fad01eb2c326b89 Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Thu, 26 Sep 2019 16:59:08 +0100 Subject: [PATCH 7/9] DOC: updated tseries for PR08 doc errors --- pandas/tseries/offsets.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 346b223f496bb..57802c965a41c 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -2090,8 +2090,7 @@ class FY5253(DateOffset): - "nearest" defines fiscal year end a **weekday** which falls closest to last day of month in fiscal year. - - "last" defines fiscal year end as the final - **weekday** in the fiscal year end month. + - "last" defines fiscal year end as final **weekday** in fiscal year end month. """ _prefix = "RE" @@ -2312,8 +2311,7 @@ class FY5253Quarter(DateOffset): - "nearest" defines fiscal year end as **weekday** which falls closest to last day of month in fiscal year. - - "last" defines fiscal year end as the final **weekday** in the fiscal - year end month. + - "last" defines fiscal year end as final **weekday** in fiscal year end month. """ _prefix = "REQ" From 563e7d92e11976bf8242e4990dd928cb97368236 Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Thu, 26 Sep 2019 17:45:38 +0100 Subject: [PATCH 8/9] DOC: updated tseries for PR08 doc errors --- pandas/tseries/offsets.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 57802c965a41c..c7699cd3cb3a8 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -2087,10 +2087,8 @@ class FY5253(DateOffset): variation : str, default "nearest" Method of employing 4-4-5 calendar. There are two options: - - "nearest" defines fiscal year end a **weekday** which falls - closest to last day of month in fiscal year. - - - "last" defines fiscal year end as final **weekday** in fiscal year end month. + - "nearest" means year end is **weekday** closest to last day of month in year. + - "last" means year end is final **weekday** of the final month in fiscal year. """ _prefix = "RE" @@ -2308,10 +2306,9 @@ class FY5253Quarter(DateOffset): variation : str, default "nearest" Method of employing 4-4-5 calendar. There are two options: - - "nearest" defines fiscal year end as **weekday** which falls closest - to last day of month in fiscal year. - - - "last" defines fiscal year end as final **weekday** in fiscal year end month. + - "nearest" means year end is **weekday** closest to last day of month in fiscal + year. + - "last" means year end is final **weekday** of the final month in fiscal year. """ _prefix = "REQ" From a8b6e852345df4ebd08984670faa7a5800bcc3c0 Mon Sep 17 00:00:00 2001 From: jackbicknell Date: Fri, 27 Sep 2019 09:45:19 +0100 Subject: [PATCH 9/9] DOC: updated tseries for PR08 doc errors --- pandas/tseries/offsets.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index c7699cd3cb3a8..4ebb4f353a8fd 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -2306,8 +2306,7 @@ class FY5253Quarter(DateOffset): variation : str, default "nearest" Method of employing 4-4-5 calendar. There are two options: - - "nearest" means year end is **weekday** closest to last day of month in fiscal - year. + - "nearest" means year end is **weekday** closest to last day of month in year. - "last" means year end is final **weekday** of the final month in fiscal year. """