@@ -1776,9 +1776,19 @@ cdef class BusinessMixin(SingleConstructorOffset):
1776
1776
cdef readonly:
1777
1777
timedelta _offset
1778
1778
# Only Custom subclasses use weekmask, holiday, calendar
1779
- object weekmask, holidays, calendar
1779
+ object _weekmask, _holidays, _calendar
1780
1780
1781
1781
def __init__ (self , n = 1 , normalize = False , offset = timedelta(0 )):
1782
+ """
1783
+ Parameters
1784
+ ----------
1785
+ n : int, default 1
1786
+ The number of days represented.
1787
+ normalize : bool, default False
1788
+ Normalize start/end dates to midnight.
1789
+ offset : timedelta, default timedelta(0)
1790
+ Time offset to apply.
1791
+ """
1782
1792
BaseOffset.__init__ (self , n, normalize)
1783
1793
self ._offset = offset
1784
1794
@@ -1792,9 +1802,9 @@ cdef class BusinessMixin(SingleConstructorOffset):
1792
1802
# Custom offset instances are identified by the
1793
1803
# following two attributes. See DateOffset._params()
1794
1804
# holidays, weekmask
1795
- self .weekmask = weekmask
1796
- self .holidays = holidays
1797
- self .calendar = calendar
1805
+ self ._weekmask = weekmask
1806
+ self ._holidays = holidays
1807
+ self ._calendar = calendar
1798
1808
1799
1809
@property
1800
1810
def offset (self ):
@@ -1803,6 +1813,56 @@ cdef class BusinessMixin(SingleConstructorOffset):
1803
1813
"""
1804
1814
# Alias for backward compat
1805
1815
return self ._offset
1816
+
1817
+ @property
1818
+ def weekmask (self ):
1819
+ """
1820
+ Return the weekmask of valid business days.
1821
+
1822
+ See Also
1823
+ --------
1824
+ CustomBusinessDay : An offset that can be specified with a weekmask.
1825
+
1826
+ Examples
1827
+ --------
1828
+ >>> pd.offsets.CustomBusinessDay(weekmask="Mon Tue Wed").weekmask
1829
+ 'Mon Tue Wed'
1830
+ """
1831
+ return self ._weekmask
1832
+
1833
+ @property
1834
+ def holidays (self ):
1835
+ """
1836
+ Return a list of holidays for this offset.
1837
+
1838
+ See Also
1839
+ --------
1840
+ CustomBusinessDay : An offset that can be specified with holidays.
1841
+
1842
+ Examples
1843
+ --------
1844
+ >>> pd.offsets.CustomBusinessDay(holidays=["2025-12-25"]).holidays
1845
+ (Timestamp('2025-12-25 00:00:00'),)
1846
+ """
1847
+ return self ._holidays
1848
+
1849
+ @property
1850
+ def calendar (self ):
1851
+ """
1852
+ Return the calendar object for this offset.
1853
+
1854
+ See Also
1855
+ --------
1856
+ numpy.busdaycalendar : The underlying calendar object used.
1857
+ CustomBusinessDay : An offset that can be specified with a calendar.
1858
+
1859
+ Examples
1860
+ --------
1861
+ >>> cal = np.busdaycalendar(weekmask="Mon Tue Wed")
1862
+ >>> pd.offsets.CustomBusinessDay(calendar=cal).calendar
1863
+ <numpy.busdaycalendar object at ...>
1864
+ """
1865
+ return self ._calendar
1806
1866
1807
1867
def _repr_attrs (self ) -> str:
1808
1868
if self.offset:
@@ -1840,14 +1900,15 @@ cdef class BusinessDay(BusinessMixin):
1840
1900
"""
1841
1901
DateOffset subclass representing possibly n business days.
1842
1902
1843
- Parameters
1844
- ----------
1845
- n : int, default 1
1846
- The number of days represented.
1847
- normalize : bool, default False
1848
- Normalize start/end dates to midnight.
1849
- offset : timedelta, default timedelta(0)
1850
- Time offset to apply.
1903
+ This offset increments dates by a given number of business days,
1904
+ defined as Monday through Friday. It can be used to move forward or
1905
+ backward in time, skipping weekends.
1906
+
1907
+ See Also
1908
+ --------
1909
+ DateOffset : Standard kind of date increment.
1910
+ CustomBusinessDay : A business day offset that allows for custom
1911
+ weekmasks and holidays.
1851
1912
1852
1913
Examples
1853
1914
--------
0 commit comments