|
15 | 15 | apply_index_wraps, as_datetime, roll_yearday, shift_month)
|
16 | 16 | import pandas.compat as compat
|
17 | 17 | from pandas.errors import AbstractMethodError
|
18 |
| -from pandas.util._decorators import cache_readonly |
| 18 | +from pandas.util._decorators import Appender, Substitution, cache_readonly |
19 | 19 |
|
20 | 20 | from pandas.core.dtypes.generic import ABCPeriod
|
21 | 21 |
|
@@ -971,21 +971,25 @@ class BusinessMonthBegin(MonthOffset):
|
971 | 971 |
|
972 | 972 | class _CustomBusinessMonth(_CustomMixin, BusinessMixin, MonthOffset):
|
973 | 973 | """
|
974 |
| - DateOffset subclass representing one custom business month, incrementing |
975 |
| - between [BEGIN/END] of month dates. |
| 974 | + DateOffset subclass representing custom business month(s). |
| 975 | +
|
| 976 | + Increments between %(bound)s of month dates. |
976 | 977 |
|
977 | 978 | Parameters
|
978 | 979 | ----------
|
979 | 980 | n : int, default 1
|
| 981 | + The number of months represented. |
980 | 982 | normalize : bool, default False
|
981 |
| - Normalize start/end dates to midnight before generating date range |
| 983 | + Normalize start/end dates to midnight before generating date range. |
982 | 984 | weekmask : str, Default 'Mon Tue Wed Thu Fri'
|
983 |
| - weekmask of valid business days, passed to ``numpy.busdaycalendar`` |
| 985 | + Weekmask of valid business days, passed to ``numpy.busdaycalendar``. |
984 | 986 | holidays : list
|
985 |
| - list/array of dates to exclude from the set of valid business days, |
986 |
| - passed to ``numpy.busdaycalendar`` |
| 987 | + List/array of dates to exclude from the set of valid business days, |
| 988 | + passed to ``numpy.busdaycalendar``. |
987 | 989 | calendar : pd.HolidayCalendar or np.busdaycalendar
|
| 990 | + Calendar to integrate. |
988 | 991 | offset : timedelta, default timedelta(0)
|
| 992 | + Time offset to apply. |
989 | 993 | """
|
990 | 994 | _attributes = frozenset(['n', 'normalize',
|
991 | 995 | 'weekmask', 'holidays', 'calendar', 'offset'])
|
@@ -1052,18 +1056,15 @@ def apply(self, other):
|
1052 | 1056 | return result
|
1053 | 1057 |
|
1054 | 1058 |
|
| 1059 | +@Substitution(bound="end") |
| 1060 | +@Appender(_CustomBusinessMonth.__doc__) |
1055 | 1061 | class CustomBusinessMonthEnd(_CustomBusinessMonth):
|
1056 |
| - # TODO(py27): Replace condition with Subsitution after dropping Py27 |
1057 |
| - if _CustomBusinessMonth.__doc__: |
1058 |
| - __doc__ = _CustomBusinessMonth.__doc__.replace('[BEGIN/END]', 'end') |
1059 | 1062 | _prefix = 'CBM'
|
1060 | 1063 |
|
1061 | 1064 |
|
| 1065 | +@Substitution(bound="beginning") |
| 1066 | +@Appender(_CustomBusinessMonth.__doc__) |
1062 | 1067 | class CustomBusinessMonthBegin(_CustomBusinessMonth):
|
1063 |
| - # TODO(py27): Replace condition with Subsitution after dropping Py27 |
1064 |
| - if _CustomBusinessMonth.__doc__: |
1065 |
| - __doc__ = _CustomBusinessMonth.__doc__.replace('[BEGIN/END]', |
1066 |
| - 'beginning') |
1067 | 1068 | _prefix = 'CBMS'
|
1068 | 1069 |
|
1069 | 1070 |
|
|
0 commit comments