|
1 | 1 | # -*- coding: utf-8 -*-
|
2 |
| -from datetime import date, datetime, timedelta |
3 | 2 | import functools
|
4 | 3 | import operator
|
| 4 | +from datetime import date, datetime, timedelta |
5 | 5 |
|
6 |
| -from dateutil.easter import easter |
7 | 6 | import numpy as np
|
| 7 | +from dateutil.easter import easter |
| 8 | +from pandas._libs.tslibs.offsets import ( |
| 9 | + ApplyTypeError, BaseOffset, _get_calendar, _is_normalized, _to_dt64, |
| 10 | + apply_index_wraps, as_datetime, roll_yearday, shift_month) |
8 | 11 |
|
| 12 | +import pandas.compat as compat |
9 | 13 | from pandas._libs.tslibs import (
|
10 | 14 | NaT, OutOfBoundsDatetime, Timedelta, Timestamp, ccalendar, conversion,
|
11 | 15 | delta_to_nanoseconds, frequencies as libfrequencies, normalize_date,
|
12 | 16 | offsets as liboffsets, timezones)
|
13 |
| -from pandas._libs.tslibs.offsets import ( |
14 |
| - ApplyTypeError, BaseOffset, _get_calendar, _is_normalized, _to_dt64, |
15 |
| - apply_index_wraps, as_datetime, roll_yearday, shift_month) |
16 |
| -import pandas.compat as compat |
17 | 17 | from pandas.compat import range
|
18 |
| -from pandas.errors import AbstractMethodError |
19 |
| -from pandas.util._decorators import cache_readonly |
20 |
| - |
21 | 18 | from pandas.core.dtypes.generic import ABCPeriod
|
22 |
| - |
23 | 19 | from pandas.core.tools.datetimes import to_datetime
|
| 20 | +from pandas.errors import AbstractMethodError |
| 21 | +from pandas.util._decorators import cache_readonly, Substitution, Appender |
24 | 22 |
|
25 | 23 | __all__ = ['Day', 'BusinessDay', 'BDay', 'CustomBusinessDay', 'CDay',
|
26 | 24 | 'CBMonthEnd', 'CBMonthBegin',
|
@@ -973,7 +971,7 @@ class BusinessMonthBegin(MonthOffset):
|
973 | 971 | class _CustomBusinessMonth(_CustomMixin, BusinessMixin, MonthOffset):
|
974 | 972 | """
|
975 | 973 | DateOffset subclass representing one custom business month, incrementing
|
976 |
| - between [BEGIN/END] of month dates. |
| 974 | + between %(bound)s of month dates. |
977 | 975 |
|
978 | 976 | Parameters
|
979 | 977 | ----------
|
@@ -1053,18 +1051,15 @@ def apply(self, other):
|
1053 | 1051 | return result
|
1054 | 1052 |
|
1055 | 1053 |
|
| 1054 | +@Substitution(bound="end") |
| 1055 | +@Appender(_CustomBusinessMonth.__doc__) |
1056 | 1056 | class CustomBusinessMonthEnd(_CustomBusinessMonth):
|
1057 |
| - # TODO(py27): Replace condition with Subsitution after dropping Py27 |
1058 |
| - if _CustomBusinessMonth.__doc__: |
1059 |
| - __doc__ = _CustomBusinessMonth.__doc__.replace('[BEGIN/END]', 'end') |
1060 | 1057 | _prefix = 'CBM'
|
1061 | 1058 |
|
1062 | 1059 |
|
| 1060 | +@Substitution(bound="beginning") |
| 1061 | +@Appender(_CustomBusinessMonth.__doc__) |
1063 | 1062 | class CustomBusinessMonthBegin(_CustomBusinessMonth):
|
1064 |
| - # TODO(py27): Replace condition with Subsitution after dropping Py27 |
1065 |
| - if _CustomBusinessMonth.__doc__: |
1066 |
| - __doc__ = _CustomBusinessMonth.__doc__.replace('[BEGIN/END]', |
1067 |
| - 'beginning') |
1068 | 1063 | _prefix = 'CBMS'
|
1069 | 1064 |
|
1070 | 1065 |
|
|
0 commit comments