pandas-market-calendars 5.1.1__tar.gz → 5.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pandas_market_calendars-5.1.1/pandas_market_calendars.egg-info → pandas_market_calendars-5.1.3}/PKG-INFO +3 -4
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendar_registry.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendar_utils.py +4 -4
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/asx.py +24 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/bmf.py +3 -4
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/bse.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/cboe.py +4 -7
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/cme.py +6 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/cme_globex_base.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/cme_globex_crypto.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/cme_globex_equities.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/eurex.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/eurex_fixed_income.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/hkex.py +3 -4
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/ice.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/iex.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/jpx.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/lse.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/nyse.py +6 -16
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/ose.py +3 -4
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/sifma.py +4 -3
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/six.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/sse.py +11 -28
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/tase.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/tsx.py +2 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/oz.py +19 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/uk.py +186 -186
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/market_calendar.py +1 -3
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3/pandas_market_calendars.egg-info}/PKG-INFO +3 -4
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars.egg-info/requires.txt +1 -3
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pyproject.toml +16 -3
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_cboe_calendars.py +99 -99
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_exchange_calendar_cme_globex_grains.py +0 -2
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_ice_calendar.py +57 -57
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_nyse_calendar.py +0 -1
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_utils.py +4 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/LICENSE +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/NOTICE +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/README.rst +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/__init__.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/__init__.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/cme_globex_agriculture.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/cme_globex_fixed_income.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/cme_globex_fx.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/calendars/mirror.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/class_registry.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/__init__.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/cme.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/cme_globex.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/cn.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/jp.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/jpx_equinox.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/nyse.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/sifma.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars/holidays/us.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars.egg-info/SOURCES.txt +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars.egg-info/dependency_links.txt +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/pandas_market_calendars.egg-info/top_level.txt +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/setup.cfg +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_24_7_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_XNYS_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_asx_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_bmf_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_bse_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_class_registry.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_cme_agriculture_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_cme_bond_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_cme_equity_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_date_range.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_eurex_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_eurex_fixed_income_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_exchange_calendar_cme_globex_crypto.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_exchange_calendar_cme_globex_energy_and_metals.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_exchange_calendar_cme_globex_equities.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_exchange_calendar_cme_globex_fixed_income.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_exchange_calendar_cme_globex_fx.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_hkex_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_iex_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_jpx_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_lse_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_market_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_nyse_calendar_early_years.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_ose_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_sifma_calendars.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_six_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_sse_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_tsx_calendar.py +0 -0
 - {pandas_market_calendars-5.1.1 → pandas_market_calendars-5.1.3}/tests/test_xtae_calendar.py +0 -0
 
| 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            Metadata-Version: 2.4
         
     | 
| 
       2 
2 
     | 
    
         
             
            Name: pandas_market_calendars
         
     | 
| 
       3 
     | 
    
         
            -
            Version: 5.1. 
     | 
| 
      
 3 
     | 
    
         
            +
            Version: 5.1.3
         
     | 
| 
       4 
4 
     | 
    
         
             
            Summary: Market and exchange trading calendars for pandas
         
     | 
| 
       5 
5 
     | 
    
         
             
            Author-email: Ryan Sheftel <rsheftel@alumni.upenn.edu>
         
     | 
| 
       6 
6 
     | 
    
         
             
            License: MIT
         
     | 
| 
         @@ -20,14 +20,13 @@ Classifier: Programming Language :: Python :: 3.10 
     | 
|
| 
       20 
20 
     | 
    
         
             
            Classifier: Programming Language :: Python :: 3.11
         
     | 
| 
       21 
21 
     | 
    
         
             
            Classifier: Programming Language :: Python :: 3.12
         
     | 
| 
       22 
22 
     | 
    
         
             
            Classifier: Programming Language :: Python :: 3.13
         
     | 
| 
      
 23 
     | 
    
         
            +
            Classifier: Programming Language :: Python :: 3.14
         
     | 
| 
       23 
24 
     | 
    
         
             
            Requires-Python: >=3.8
         
     | 
| 
       24 
25 
     | 
    
         
             
            Description-Content-Type: text/x-rst
         
     | 
| 
       25 
26 
     | 
    
         
             
            License-File: LICENSE
         
     | 
| 
       26 
27 
     | 
    
         
             
            License-File: NOTICE
         
     | 
| 
       27 
     | 
    
         
            -
            Requires-Dist: pandas>=1.1
         
     | 
| 
       28 
     | 
    
         
            -
            Requires-Dist: tzdata
         
     | 
| 
       29 
     | 
    
         
            -
            Requires-Dist: python-dateutil
         
     | 
| 
       30 
28 
     | 
    
         
             
            Requires-Dist: exchange-calendars>=3.3
         
     | 
| 
      
 29 
     | 
    
         
            +
            Requires-Dist: pandas>=1.1
         
     | 
| 
       31 
30 
     | 
    
         
             
            Provides-Extra: dev
         
     | 
| 
       32 
31 
     | 
    
         
             
            Requires-Dist: pytest; extra == "dev"
         
     | 
| 
       33 
32 
     | 
    
         
             
            Requires-Dist: black; extra == "dev"
         
     | 
| 
         @@ -1,3 +1,4 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # fmt: off
         
     | 
| 
       1 
2 
     | 
    
         
             
            from .market_calendar import MarketCalendar
         
     | 
| 
       2 
3 
     | 
    
         
             
            from .calendars.asx import ASXExchangeCalendar
         
     | 
| 
       3 
4 
     | 
    
         
             
            from .calendars.bmf import BMFExchangeCalendar
         
     | 
| 
         @@ -36,7 +37,7 @@ from .calendars.sse import SSEExchangeCalendar 
     | 
|
| 
       36 
37 
     | 
    
         
             
            from .calendars.tase import TASEExchangeCalendar
         
     | 
| 
       37 
38 
     | 
    
         
             
            from .calendars.tsx import TSXExchangeCalendar
         
     | 
| 
       38 
39 
     | 
    
         
             
            from .calendars.mirror import *
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
      
 40 
     | 
    
         
            +
            # fmt: on
         
     | 
| 
       40 
41 
     | 
    
         | 
| 
       41 
42 
     | 
    
         
             
            def get_calendar(name, open_time=None, close_time=None) -> MarketCalendar:
         
     | 
| 
       42 
43 
     | 
    
         
             
                """
         
     | 
| 
         @@ -161,11 +161,11 @@ def merge_schedules(schedules, how="outer"): 
     | 
|
| 
       161 
161 
     | 
    
         
             
                for schedule in schedules[1:]:
         
     | 
| 
       162 
162 
     | 
    
         
             
                    result = result.merge(schedule, how=how, right_index=True, left_index=True)
         
     | 
| 
       163 
163 
     | 
    
         
             
                    if how == "outer":
         
     | 
| 
       164 
     | 
    
         
            -
                        result["market_open"] = result 
     | 
| 
       165 
     | 
    
         
            -
                        result["market_close"] = result 
     | 
| 
      
 164 
     | 
    
         
            +
                        result["market_open"] = result[["market_open_x", "market_open_y"]].min(axis=1)
         
     | 
| 
      
 165 
     | 
    
         
            +
                        result["market_close"] = result[["market_close_x", "market_close_y"]].max(axis=1)
         
     | 
| 
       166 
166 
     | 
    
         
             
                    elif how == "inner":
         
     | 
| 
       167 
     | 
    
         
            -
                        result["market_open"] = result 
     | 
| 
       168 
     | 
    
         
            -
                        result["market_close"] = result 
     | 
| 
      
 167 
     | 
    
         
            +
                        result["market_open"] = result[["market_open_x", "market_open_y"]].max(axis=1)
         
     | 
| 
      
 168 
     | 
    
         
            +
                        result["market_close"] = result[["market_close_x", "market_close_y"]].min(axis=1)
         
     | 
| 
       169 
169 
     | 
    
         
             
                    else:
         
     | 
| 
       170 
170 
     | 
    
         
             
                        raise ValueError('how argument must be "inner" or "outer"')
         
     | 
| 
       171 
171 
     | 
    
         
             
                    result = result[["market_open", "market_close"]]
         
     | 
| 
         @@ -1,7 +1,8 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            from datetime import time
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            from pandas.tseries.holiday import AbstractHolidayCalendar, GoodFriday, EasterMonday
         
     | 
| 
       4 
     | 
    
         
            -
            import sys 
     | 
| 
      
 4 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
       5 
6 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       6 
7 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       7 
8 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -21,6 +22,7 @@ class ASXExchangeCalendar(MarketCalendar): 
     | 
|
| 
       21 
22 
     | 
    
         
             
                Open Time: 10:00 AM, Australia/Sydney
         
     | 
| 
       22 
23 
     | 
    
         
             
                Close Time: 4:10 PM, Australia/Sydney
         
     | 
| 
       23 
24 
     | 
    
         | 
| 
      
 25 
     | 
    
         
            +
                https://www.asx.com.au/markets/market-resources/trading-hours-calendar/cash-market-trading-hours/trading-calendar
         
     | 
| 
       24 
26 
     | 
    
         | 
| 
       25 
27 
     | 
    
         
             
                Regularly-Observed Holidays:
         
     | 
| 
       26 
28 
     | 
    
         
             
                - New Year's Day (observed on Monday when Jan 1 is a Saturday or Sunday)
         
     | 
| 
         @@ -75,3 +77,24 @@ class ASXExchangeCalendar(MarketCalendar): 
     | 
|
| 
       75 
77 
     | 
    
         
             
                @property
         
     | 
| 
       76 
78 
     | 
    
         
             
                def adhoc_holidays(self):
         
     | 
| 
       77 
79 
     | 
    
         
             
                    return UniqueCloses
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                @property
         
     | 
| 
      
 82 
     | 
    
         
            +
                def special_closes(self):
         
     | 
| 
      
 83 
     | 
    
         
            +
                    return [
         
     | 
| 
      
 84 
     | 
    
         
            +
                        (
         
     | 
| 
      
 85 
     | 
    
         
            +
                            time(hour=14, minute=10, tzinfo=self.tz),
         
     | 
| 
      
 86 
     | 
    
         
            +
                            AbstractHolidayCalendar(
         
     | 
| 
      
 87 
     | 
    
         
            +
                                rules=[
         
     | 
| 
      
 88 
     | 
    
         
            +
                                    ChristmasEve,
         
     | 
| 
      
 89 
     | 
    
         
            +
                                ]
         
     | 
| 
      
 90 
     | 
    
         
            +
                            ),
         
     | 
| 
      
 91 
     | 
    
         
            +
                        ),
         
     | 
| 
      
 92 
     | 
    
         
            +
                        (
         
     | 
| 
      
 93 
     | 
    
         
            +
                            time(hour=14, minute=10, tzinfo=self.tz),
         
     | 
| 
      
 94 
     | 
    
         
            +
                            AbstractHolidayCalendar(
         
     | 
| 
      
 95 
     | 
    
         
            +
                                rules=[
         
     | 
| 
      
 96 
     | 
    
         
            +
                                    NewYearsEve,
         
     | 
| 
      
 97 
     | 
    
         
            +
                                ]
         
     | 
| 
      
 98 
     | 
    
         
            +
                            ),
         
     | 
| 
      
 99 
     | 
    
         
            +
                        ),
         
     | 
| 
      
 100 
     | 
    
         
            +
                    ]
         
     | 
| 
         @@ -23,7 +23,8 @@ from pandas.tseries.holiday import ( 
     | 
|
| 
       23 
23 
     | 
    
         
             
                GoodFriday,
         
     | 
| 
       24 
24 
     | 
    
         
             
                Holiday,
         
     | 
| 
       25 
25 
     | 
    
         
             
            )
         
     | 
| 
       26 
     | 
    
         
            -
            import sys 
     | 
| 
      
 26 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
       27 
28 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       28 
29 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       29 
30 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -41,9 +42,7 @@ ConfUniversal = Holiday( 
     | 
|
| 
       41 
42 
     | 
    
         
             
                day=1,
         
     | 
| 
       42 
43 
     | 
    
         
             
            )
         
     | 
| 
       43 
44 
     | 
    
         
             
            # Sao Paulo city birthday
         
     | 
| 
       44 
     | 
    
         
            -
            AniversarioSaoPaulo = Holiday(
         
     | 
| 
       45 
     | 
    
         
            -
                "Aniversario de Sao Paulo", month=1, day=25, end_date="2021-12-31"
         
     | 
| 
       46 
     | 
    
         
            -
            )
         
     | 
| 
      
 45 
     | 
    
         
            +
            AniversarioSaoPaulo = Holiday("Aniversario de Sao Paulo", month=1, day=25, end_date="2021-12-31")
         
     | 
| 
       47 
46 
     | 
    
         
             
            # Carnival Monday
         
     | 
| 
       48 
47 
     | 
    
         
             
            CarnavalSegunda = Holiday("Carnaval Segunda", month=1, day=1, offset=[Easter(), Day(-48)])
         
     | 
| 
       49 
48 
     | 
    
         
             
            # Carnival Tuesday
         
     | 
| 
         @@ -10,7 +10,8 @@ from pandas.tseries.holiday import ( 
     | 
|
| 
       10 
10 
     | 
    
         
             
                USThanksgivingDay,
         
     | 
| 
       11 
11 
     | 
    
         
             
                Holiday,
         
     | 
| 
       12 
12 
     | 
    
         
             
            )
         
     | 
| 
       13 
     | 
    
         
            -
            import sys 
     | 
| 
      
 13 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
       14 
15 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       15 
16 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       16 
17 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -44,12 +45,8 @@ def good_friday_unless_christmas_nye_friday(dt): 
     | 
|
| 
       44 
45 
     | 
    
         
             
                    raise NotImplementedError()
         
     | 
| 
       45 
46 
     | 
    
         | 
| 
       46 
47 
     | 
    
         
             
                year = dt.year
         
     | 
| 
       47 
     | 
    
         
            -
                christmas_weekday = Christmas.observance(
         
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
       49 
     | 
    
         
            -
                ).weekday()
         
     | 
| 
       50 
     | 
    
         
            -
                nyd_weekday = USNewYearsDay.observance(
         
     | 
| 
       51 
     | 
    
         
            -
                    pd.Timestamp(year=year, month=1, day=1)
         
     | 
| 
       52 
     | 
    
         
            -
                ).weekday()
         
     | 
| 
      
 48 
     | 
    
         
            +
                christmas_weekday = Christmas.observance(pd.Timestamp(year=year, month=12, day=25)).weekday()
         
     | 
| 
      
 49 
     | 
    
         
            +
                nyd_weekday = USNewYearsDay.observance(pd.Timestamp(year=year, month=1, day=1)).weekday()
         
     | 
| 
       53 
50 
     | 
    
         
             
                if christmas_weekday != 4 and nyd_weekday != 4:
         
     | 
| 
       54 
51 
     | 
    
         
             
                    return GoodFriday.dates(
         
     | 
| 
       55 
52 
     | 
    
         
             
                        pd.Timestamp(year=year, month=1, day=1),
         
     | 
| 
         @@ -24,7 +24,8 @@ from pandas.tseries.holiday import ( 
     | 
|
| 
       24 
24 
     | 
    
         
             
                USPresidentsDay,
         
     | 
| 
       25 
25 
     | 
    
         
             
                USThanksgivingDay,
         
     | 
| 
       26 
26 
     | 
    
         
             
            )
         
     | 
| 
       27 
     | 
    
         
            -
            import sys 
     | 
| 
      
 27 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
       28 
29 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       29 
30 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       30 
31 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -46,6 +47,9 @@ from pandas_market_calendars.holidays.us import ( 
     | 
|
| 
       46 
47 
     | 
    
         
             
                USNewYearsDay,
         
     | 
| 
       47 
48 
     | 
    
         
             
            )
         
     | 
| 
       48 
49 
     | 
    
         
             
            from pandas_market_calendars.market_calendar import MarketCalendar
         
     | 
| 
      
 50 
     | 
    
         
            +
            from pandas_market_calendars.holidays.cme import (
         
     | 
| 
      
 51 
     | 
    
         
            +
                USIndependenceDayBefore2022PreviousDay,
         
     | 
| 
      
 52 
     | 
    
         
            +
            )
         
     | 
| 
       49 
53 
     | 
    
         | 
| 
       50 
54 
     | 
    
         | 
| 
       51 
55 
     | 
    
         
             
            # Useful resources for making changes to this file: http://www.cmegroup.com/tools-information/holiday-calendar.html
         
     | 
| 
         @@ -108,6 +112,7 @@ class CMEEquityExchangeCalendar(MarketCalendar): 
     | 
|
| 
       108 
112 
     | 
    
         
             
                                    USLaborDay,
         
     | 
| 
       109 
113 
     | 
    
         
             
                                    USJuneteenthAfter2022,
         
     | 
| 
       110 
114 
     | 
    
         
             
                                    USIndependenceDay,
         
     | 
| 
      
 115 
     | 
    
         
            +
                                    USIndependenceDayBefore2022PreviousDay,
         
     | 
| 
       111 
116 
     | 
    
         
             
                                    USThanksgivingDay,
         
     | 
| 
       112 
117 
     | 
    
         
             
                                    USBlackFridayInOrAfter1993,
         
     | 
| 
       113 
118 
     | 
    
         
             
                                    ChristmasEveBefore1993,
         
     | 
| 
         @@ -18,7 +18,8 @@ from datetime import time 
     | 
|
| 
       18 
18 
     | 
    
         
             
            from pandas.tseries.holiday import (
         
     | 
| 
       19 
19 
     | 
    
         
             
                AbstractHolidayCalendar,
         
     | 
| 
       20 
20 
     | 
    
         
             
            )  # , GoodFriday, USLaborDay, USPresidentsDay, USThanksgivingDay
         
     | 
| 
       21 
     | 
    
         
            -
            import sys 
     | 
| 
      
 21 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
       22 
23 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       23 
24 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       24 
25 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -10,7 +10,8 @@ from pandas.tseries.holiday import ( 
     | 
|
| 
       10 
10 
     | 
    
         
             
                sunday_to_monday,
         
     | 
| 
       11 
11 
     | 
    
         
             
            )
         
     | 
| 
       12 
12 
     | 
    
         
             
            from pandas.tseries.offsets import LastWeekOfMonth, WeekOfMonth
         
     | 
| 
       13 
     | 
    
         
            -
            import sys 
     | 
| 
      
 13 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
       14 
15 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       15 
16 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       16 
17 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -185,9 +186,7 @@ MidAutumnFestivalDayBefore1983 = Holiday( 
     | 
|
| 
       185 
186 
     | 
    
         
             
                name="Mid-autumn Festival",  # 中秋节翌日
         
     | 
| 
       186 
187 
     | 
    
         
             
                month=9,
         
     | 
| 
       187 
188 
     | 
    
         
             
                day=7,
         
     | 
| 
       188 
     | 
    
         
            -
                observance=partial(
         
     | 
| 
       189 
     | 
    
         
            -
                    process_date, mapping=maf_mapping, delta=1, func=sunday_to_monday
         
     | 
| 
       190 
     | 
    
         
            -
                ),
         
     | 
| 
      
 189 
     | 
    
         
            +
                observance=partial(process_date, mapping=maf_mapping, delta=1, func=sunday_to_monday),
         
     | 
| 
       191 
190 
     | 
    
         
             
                start_date=Timestamp("1961-01-01"),
         
     | 
| 
       192 
191 
     | 
    
         
             
                end_date=Timestamp("1983-01-01"),
         
     | 
| 
       193 
192 
     | 
    
         
             
            )
         
     | 
| 
         @@ -3,7 +3,8 @@ from itertools import chain 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            from pandas import Timestamp, DatetimeIndex, Timedelta
         
     | 
| 
       5 
5 
     | 
    
         
             
            from pandas.tseries.holiday import AbstractHolidayCalendar
         
     | 
| 
       6 
     | 
    
         
            -
            import sys 
     | 
| 
      
 6 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
       7 
8 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       8 
9 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       9 
10 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -2,7 +2,8 @@ from datetime import time 
     | 
|
| 
       2 
2 
     | 
    
         
             
            from itertools import chain
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            from pandas.tseries.holiday import AbstractHolidayCalendar
         
     | 
| 
       5 
     | 
    
         
            -
            import sys 
     | 
| 
      
 5 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
       6 
7 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       7 
8 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       8 
9 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -16,7 +16,8 @@ 
     | 
|
| 
       16 
16 
     | 
    
         
             
            from datetime import time
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
            from pandas.tseries.holiday import AbstractHolidayCalendar, EasterMonday, GoodFriday
         
     | 
| 
       19 
     | 
    
         
            -
            import sys 
     | 
| 
      
 19 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
       20 
21 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       21 
22 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       22 
23 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -16,7 +16,8 @@ 
     | 
|
| 
       16 
16 
     | 
    
         
             
            from datetime import time
         
     | 
| 
       17 
17 
     | 
    
         
             
            from itertools import chain
         
     | 
| 
       18 
18 
     | 
    
         
             
            from typing import Literal, Union
         
     | 
| 
       19 
     | 
    
         
            -
            import sys 
     | 
| 
      
 19 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
       20 
21 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       21 
22 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       22 
23 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -1135,19 +1136,12 @@ class NYSEExchangeCalendar(MarketCalendar): 
     | 
|
| 
       1135 
1136 
     | 
    
         
             
                        (
         
     | 
| 
       1136 
1137 
     | 
    
         
             
                            time(13, tzinfo=ZoneInfo("America/New_York")),
         
     | 
| 
       1137 
1138 
     | 
    
         
             
                            # DaysBeforeIndependenceDay1pmEarlyCloseAdhoc # list
         
     | 
| 
       1138 
     | 
    
         
            -
                            ChristmasEve1pmEarlyCloseAdhoc
         
     | 
| 
       1139 
     | 
    
         
            -
                            + DayAfterChristmas1pmEarlyCloseAdhoc
         
     | 
| 
       1140 
     | 
    
         
            -
                            + BacklogRelief1pmEarlyClose1929,
         
     | 
| 
      
 1139 
     | 
    
         
            +
                            ChristmasEve1pmEarlyCloseAdhoc + DayAfterChristmas1pmEarlyCloseAdhoc + BacklogRelief1pmEarlyClose1929,
         
     | 
| 
       1141 
1140 
     | 
    
         
             
                        ),
         
     | 
| 
       1142 
1141 
     | 
    
         
             
                        (
         
     | 
| 
       1143 
1142 
     | 
    
         
             
                            time(14, tzinfo=ZoneInfo("America/New_York")),
         
     | 
| 
       1144 
1143 
     | 
    
         
             
                            _union_many(
         
     | 
| 
       1145 
     | 
    
         
            -
                                [
         
     | 
| 
       1146 
     | 
    
         
            -
                                    pd.DatetimeIndex(
         
     | 
| 
       1147 
     | 
    
         
            -
                                        ChristmasEve2pmEarlyCloseAdhoc
         
     | 
| 
       1148 
     | 
    
         
            -
                                        + HeavyVolume2pmEarlyClose1933
         
     | 
| 
       1149 
     | 
    
         
            -
                                    )
         
     | 
| 
       1150 
     | 
    
         
            -
                                ]
         
     | 
| 
      
 1144 
     | 
    
         
            +
                                [pd.DatetimeIndex(ChristmasEve2pmEarlyCloseAdhoc + HeavyVolume2pmEarlyClose1933)]
         
     | 
| 
       1151 
1145 
     | 
    
         
             
                                + [
         
     | 
| 
       1152 
1146 
     | 
    
         
             
                                    BacklogRelief2pmEarlyClose1928,
         
     | 
| 
       1153 
1147 
     | 
    
         
             
                                    TransitStrike2pmEarlyClose1966,  # index
         
     | 
| 
         @@ -1160,15 +1154,11 @@ class NYSEExchangeCalendar(MarketCalendar): 
     | 
|
| 
       1160 
1154 
     | 
    
         
             
                        ),
         
     | 
| 
       1161 
1155 
     | 
    
         
             
                        (
         
     | 
| 
       1162 
1156 
     | 
    
         
             
                            time(14, 30, tzinfo=ZoneInfo("America/New_York")),
         
     | 
| 
       1163 
     | 
    
         
            -
                            _union_many(
         
     | 
| 
       1164 
     | 
    
         
            -
                                [PaperworkCrisis230pmEarlyCloses1969, Backlog230pmEarlyCloses1987]
         
     | 
| 
       1165 
     | 
    
         
            -
                            ),  # index
         
     | 
| 
      
 1157 
     | 
    
         
            +
                            _union_many([PaperworkCrisis230pmEarlyCloses1969, Backlog230pmEarlyCloses1987]),  # index
         
     | 
| 
       1166 
1158 
     | 
    
         
             
                        ),
         
     | 
| 
       1167 
1159 
     | 
    
         
             
                        (
         
     | 
| 
       1168 
1160 
     | 
    
         
             
                            time(15, tzinfo=ZoneInfo("America/New_York")),
         
     | 
| 
       1169 
     | 
    
         
            -
                            _union_many(
         
     | 
| 
       1170 
     | 
    
         
            -
                                [PaperworkCrisis3pmEarlyCloses1969to1970, Backlog3pmEarlyCloses1987]
         
     | 
| 
       1171 
     | 
    
         
            -
                            ),  # index
         
     | 
| 
      
 1161 
     | 
    
         
            +
                            _union_many([PaperworkCrisis3pmEarlyCloses1969to1970, Backlog3pmEarlyCloses1987]),  # index
         
     | 
| 
       1172 
1162 
     | 
    
         
             
                        ),
         
     | 
| 
       1173 
1163 
     | 
    
         
             
                        (
         
     | 
| 
       1174 
1164 
     | 
    
         
             
                            time(15, 30, tzinfo=ZoneInfo("America/New_York")),
         
     | 
| 
         @@ -7,7 +7,8 @@ from pandas.tseries.holiday import ( 
     | 
|
| 
       7 
7 
     | 
    
         
             
                Holiday,
         
     | 
| 
       8 
8 
     | 
    
         
             
            )
         
     | 
| 
       9 
9 
     | 
    
         
             
            from pandas.tseries.offsets import Day, Easter
         
     | 
| 
       10 
     | 
    
         
            -
            import sys 
     | 
| 
      
 10 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
       11 
12 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       12 
13 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       13 
14 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -20,9 +21,7 @@ from pandas_market_calendars.market_calendar import MarketCalendar 
     | 
|
| 
       20 
21 
     | 
    
         | 
| 
       21 
22 
     | 
    
         
             
            OSENewYearsDay = Holiday("New Year's Day", month=1, day=1)
         
     | 
| 
       22 
23 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
            OSEWednesdayBeforeEaster = Holiday(
         
     | 
| 
       24 
     | 
    
         
            -
                "Wednesday before Easter", month=1, day=1, offset=[Easter(), Day(-4)]
         
     | 
| 
       25 
     | 
    
         
            -
            )
         
     | 
| 
      
 24 
     | 
    
         
            +
            OSEWednesdayBeforeEaster = Holiday("Wednesday before Easter", month=1, day=1, offset=[Easter(), Day(-4)])
         
     | 
| 
       26 
25 
     | 
    
         | 
| 
       27 
26 
     | 
    
         
             
            OSEMaundyThursday = Holiday("Maundy Thursday", month=1, day=1, offset=[Easter(), Day(-3)])
         
     | 
| 
       28 
27 
     | 
    
         | 
| 
         @@ -3,7 +3,8 @@ import functools 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            import pandas as pd
         
     | 
| 
       5 
5 
     | 
    
         
             
            from pandas.tseries.holiday import AbstractHolidayCalendar
         
     | 
| 
       6 
     | 
    
         
            -
            import sys 
     | 
| 
      
 6 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
       7 
8 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       8 
9 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       9 
10 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -203,11 +204,11 @@ class SIFMAUSExchangeCalendar(MarketCalendar): 
     | 
|
| 
       203 
204 
     | 
    
         
             
                    _, gf_12pm_early_closes, thurs_before_gf_2pm_early_closes = self._get_dynamic_gf_rules()
         
     | 
| 
       204 
205 
     | 
    
         
             
                    return [
         
     | 
| 
       205 
206 
     | 
    
         
             
                        (
         
     | 
| 
       206 
     | 
    
         
            -
                            time(12), 
     | 
| 
      
 207 
     | 
    
         
            +
                            time(12),  # SIFMA rule specifies 12:00 PM ET
         
     | 
| 
       207 
208 
     | 
    
         
             
                            gf_12pm_early_closes,
         
     | 
| 
       208 
209 
     | 
    
         
             
                        ),
         
     | 
| 
       209 
210 
     | 
    
         
             
                        (
         
     | 
| 
       210 
     | 
    
         
            -
                            time(14), 
     | 
| 
      
 211 
     | 
    
         
            +
                            time(14),  # SIFMA rule specifies 2:00 PM ET
         
     | 
| 
       211 
212 
     | 
    
         
             
                            thurs_before_gf_2pm_early_closes,
         
     | 
| 
       212 
213 
     | 
    
         
             
                        ),
         
     | 
| 
       213 
214 
     | 
    
         
             
                    ]
         
     | 
| 
         @@ -2,7 +2,8 @@ from datetime import time, timedelta 
     | 
|
| 
       2 
2 
     | 
    
         
             
            from functools import partial
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            from pandas.tseries.holiday import AbstractHolidayCalendar, Holiday, next_monday
         
     | 
| 
       5 
     | 
    
         
            -
            import sys 
     | 
| 
      
 5 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
       6 
7 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       7 
8 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       8 
9 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -152,81 +153,63 @@ class SSEExchangeCalendar(MarketCalendar): 
     | 
|
| 
       152 
153 
     | 
    
         
             
                                name="Tomb-sweeping Day",
         
     | 
| 
       153 
154 
     | 
    
         
             
                                month=4,
         
     | 
| 
       154 
155 
     | 
    
         
             
                                day=4,
         
     | 
| 
       155 
     | 
    
         
            -
                                observance=partial(
         
     | 
| 
       156 
     | 
    
         
            -
                                    lunisolar, mapping=tsd_mapping, func=next_monday
         
     | 
| 
       157 
     | 
    
         
            -
                                ),
         
     | 
| 
      
 156 
     | 
    
         
            +
                                observance=partial(lunisolar, mapping=tsd_mapping, func=next_monday),
         
     | 
| 
       158 
157 
     | 
    
         
             
                                start_date=Timestamp(start_year, 4, 4),
         
     | 
| 
       159 
158 
     | 
    
         
             
                            ),
         
     | 
| 
       160 
159 
     | 
    
         
             
                            Holiday(
         
     | 
| 
       161 
160 
     | 
    
         
             
                                name="Tomb-sweeping Day",
         
     | 
| 
       162 
161 
     | 
    
         
             
                                month=4,
         
     | 
| 
       163 
162 
     | 
    
         
             
                                day=5,
         
     | 
| 
       164 
     | 
    
         
            -
                                observance=partial(
         
     | 
| 
       165 
     | 
    
         
            -
                                    lunisolar, mapping=tsd_mapping, func=second_day_in_lieu, delta=1
         
     | 
| 
       166 
     | 
    
         
            -
                                ),
         
     | 
| 
      
 163 
     | 
    
         
            +
                                observance=partial(lunisolar, mapping=tsd_mapping, func=second_day_in_lieu, delta=1),
         
     | 
| 
       167 
164 
     | 
    
         
             
                                start_date=Timestamp(start_year, 4, 4),
         
     | 
| 
       168 
165 
     | 
    
         
             
                            ),
         
     | 
| 
       169 
166 
     | 
    
         
             
                            Holiday(
         
     | 
| 
       170 
167 
     | 
    
         
             
                                name="Tomb-sweeping Day",
         
     | 
| 
       171 
168 
     | 
    
         
             
                                month=4,
         
     | 
| 
       172 
169 
     | 
    
         
             
                                day=6,
         
     | 
| 
       173 
     | 
    
         
            -
                                observance=partial(
         
     | 
| 
       174 
     | 
    
         
            -
                                    lunisolar, mapping=tsd_mapping, func=third_day_in_lieu, delta=2
         
     | 
| 
       175 
     | 
    
         
            -
                                ),
         
     | 
| 
      
 170 
     | 
    
         
            +
                                observance=partial(lunisolar, mapping=tsd_mapping, func=third_day_in_lieu, delta=2),
         
     | 
| 
       176 
171 
     | 
    
         
             
                                start_date=Timestamp(start_year, 4, 4),
         
     | 
| 
       177 
172 
     | 
    
         
             
                            ),
         
     | 
| 
       178 
173 
     | 
    
         
             
                            Holiday(
         
     | 
| 
       179 
174 
     | 
    
         
             
                                name="Dragon Boat Festival",
         
     | 
| 
       180 
175 
     | 
    
         
             
                                month=5,
         
     | 
| 
       181 
176 
     | 
    
         
             
                                day=27,
         
     | 
| 
       182 
     | 
    
         
            -
                                observance=partial(
         
     | 
| 
       183 
     | 
    
         
            -
                                    lunisolar, mapping=dbf_mapping, func=next_monday
         
     | 
| 
       184 
     | 
    
         
            -
                                ),
         
     | 
| 
      
 177 
     | 
    
         
            +
                                observance=partial(lunisolar, mapping=dbf_mapping, func=next_monday),
         
     | 
| 
       185 
178 
     | 
    
         
             
                                start_date=Timestamp(start_year, 5, 27),
         
     | 
| 
       186 
179 
     | 
    
         
             
                            ),
         
     | 
| 
       187 
180 
     | 
    
         
             
                            Holiday(
         
     | 
| 
       188 
181 
     | 
    
         
             
                                name="Dragon Boat Festival",
         
     | 
| 
       189 
182 
     | 
    
         
             
                                month=5,
         
     | 
| 
       190 
183 
     | 
    
         
             
                                day=28,
         
     | 
| 
       191 
     | 
    
         
            -
                                observance=partial(
         
     | 
| 
       192 
     | 
    
         
            -
                                    lunisolar, mapping=dbf_mapping, func=second_day_in_lieu, delta=1
         
     | 
| 
       193 
     | 
    
         
            -
                                ),
         
     | 
| 
      
 184 
     | 
    
         
            +
                                observance=partial(lunisolar, mapping=dbf_mapping, func=second_day_in_lieu, delta=1),
         
     | 
| 
       194 
185 
     | 
    
         
             
                                start_date=Timestamp(start_year, 5, 27),
         
     | 
| 
       195 
186 
     | 
    
         
             
                            ),
         
     | 
| 
       196 
187 
     | 
    
         
             
                            Holiday(
         
     | 
| 
       197 
188 
     | 
    
         
             
                                name="Dragon Boat Festival",
         
     | 
| 
       198 
189 
     | 
    
         
             
                                month=5,
         
     | 
| 
       199 
190 
     | 
    
         
             
                                day=29,
         
     | 
| 
       200 
     | 
    
         
            -
                                observance=partial(
         
     | 
| 
       201 
     | 
    
         
            -
                                    lunisolar, mapping=dbf_mapping, func=third_day_in_lieu, delta=2
         
     | 
| 
       202 
     | 
    
         
            -
                                ),
         
     | 
| 
      
 191 
     | 
    
         
            +
                                observance=partial(lunisolar, mapping=dbf_mapping, func=third_day_in_lieu, delta=2),
         
     | 
| 
       203 
192 
     | 
    
         
             
                                start_date=Timestamp(start_year, 5, 27),
         
     | 
| 
       204 
193 
     | 
    
         
             
                            ),
         
     | 
| 
       205 
194 
     | 
    
         
             
                            Holiday(
         
     | 
| 
       206 
195 
     | 
    
         
             
                                name="Mid-autumn Festival",
         
     | 
| 
       207 
196 
     | 
    
         
             
                                month=9,
         
     | 
| 
       208 
197 
     | 
    
         
             
                                day=7,
         
     | 
| 
       209 
     | 
    
         
            -
                                observance=partial(
         
     | 
| 
       210 
     | 
    
         
            -
                                    lunisolar, mapping=maf_mapping, func=next_monday
         
     | 
| 
       211 
     | 
    
         
            -
                                ),
         
     | 
| 
      
 198 
     | 
    
         
            +
                                observance=partial(lunisolar, mapping=maf_mapping, func=next_monday),
         
     | 
| 
       212 
199 
     | 
    
         
             
                                start_date=Timestamp(start_year, 9, 7),
         
     | 
| 
       213 
200 
     | 
    
         
             
                            ),
         
     | 
| 
       214 
201 
     | 
    
         
             
                            Holiday(
         
     | 
| 
       215 
202 
     | 
    
         
             
                                name="Mid-autumn Festival",
         
     | 
| 
       216 
203 
     | 
    
         
             
                                month=9,
         
     | 
| 
       217 
204 
     | 
    
         
             
                                day=8,
         
     | 
| 
       218 
     | 
    
         
            -
                                observance=partial(
         
     | 
| 
       219 
     | 
    
         
            -
                                    lunisolar, mapping=maf_mapping, func=second_day_in_lieu, delta=1
         
     | 
| 
       220 
     | 
    
         
            -
                                ),
         
     | 
| 
      
 205 
     | 
    
         
            +
                                observance=partial(lunisolar, mapping=maf_mapping, func=second_day_in_lieu, delta=1),
         
     | 
| 
       221 
206 
     | 
    
         
             
                                start_date=Timestamp(start_year, 9, 7),
         
     | 
| 
       222 
207 
     | 
    
         
             
                            ),
         
     | 
| 
       223 
208 
     | 
    
         
             
                            Holiday(
         
     | 
| 
       224 
209 
     | 
    
         
             
                                name="Mid-autumn Festival",
         
     | 
| 
       225 
210 
     | 
    
         
             
                                month=9,
         
     | 
| 
       226 
211 
     | 
    
         
             
                                day=9,
         
     | 
| 
       227 
     | 
    
         
            -
                                observance=partial(
         
     | 
| 
       228 
     | 
    
         
            -
                                    lunisolar, mapping=maf_mapping, func=third_day_in_lieu, delta=2
         
     | 
| 
       229 
     | 
    
         
            -
                                ),
         
     | 
| 
      
 212 
     | 
    
         
            +
                                observance=partial(lunisolar, mapping=maf_mapping, func=third_day_in_lieu, delta=2),
         
     | 
| 
       230 
213 
     | 
    
         
             
                                start_date=Timestamp(start_year, 9, 7),
         
     | 
| 
       231 
214 
     | 
    
         
             
                            ),
         
     | 
| 
       232 
215 
     | 
    
         
             
                            Holiday(
         
     | 
| 
         @@ -2,7 +2,8 @@ from datetime import time 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            from typing import Literal, Union
         
     | 
| 
       4 
4 
     | 
    
         
             
            from pandas import Timestamp, Timedelta, DatetimeIndex
         
     | 
| 
       5 
     | 
    
         
            -
            import sys 
     | 
| 
      
 5 
     | 
    
         
            +
            import sys
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
       6 
7 
     | 
    
         
             
            # check python versiOn aNd import accordingly
         
     | 
| 
       7 
8 
     | 
    
         
             
            if sys.version_info >= (3, 9):
         
     | 
| 
       8 
9 
     | 
    
         
             
                # For Python 3.9 and later, import directly
         
     | 
| 
         @@ -6,6 +6,7 @@ from pandas.tseries.holiday import ( 
     | 
|
| 
       6 
6 
     | 
    
         
             
                MO,
         
     | 
| 
       7 
7 
     | 
    
         
             
                next_monday_or_tuesday,
         
     | 
| 
       8 
8 
     | 
    
         
             
                weekend_to_monday,
         
     | 
| 
      
 9 
     | 
    
         
            +
                previous_friday,
         
     | 
| 
       9 
10 
     | 
    
         
             
            )
         
     | 
| 
       10 
11 
     | 
    
         | 
| 
       11 
12 
     | 
    
         
             
            # New Year's Day
         
     | 
| 
         @@ -61,3 +62,21 @@ UniqueCloses = [] 
     | 
|
| 
       61 
62 
     | 
    
         | 
| 
       62 
63 
     | 
    
         
             
            # National Day of Mourning for Her Majesty the Queen
         
     | 
| 
       63 
64 
     | 
    
         
             
            UniqueCloses.append(Timestamp("2022-09-22", tz="UTC"))
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
            # Early closes
         
     | 
| 
      
 68 
     | 
    
         
            +
            # Christmas Eve
         
     | 
| 
      
 69 
     | 
    
         
            +
            ChristmasEve = Holiday(
         
     | 
| 
      
 70 
     | 
    
         
            +
                "Christmas Eve",
         
     | 
| 
      
 71 
     | 
    
         
            +
                month=12,
         
     | 
| 
      
 72 
     | 
    
         
            +
                day=24,
         
     | 
| 
      
 73 
     | 
    
         
            +
                observance=previous_friday,
         
     | 
| 
      
 74 
     | 
    
         
            +
            )
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
            # New Year's Eve
         
     | 
| 
      
 77 
     | 
    
         
            +
            NewYearsEve = Holiday(
         
     | 
| 
      
 78 
     | 
    
         
            +
                "New Year's Eve",
         
     | 
| 
      
 79 
     | 
    
         
            +
                month=12,
         
     | 
| 
      
 80 
     | 
    
         
            +
                day=31,
         
     | 
| 
      
 81 
     | 
    
         
            +
                observance=previous_friday,
         
     | 
| 
      
 82 
     | 
    
         
            +
            )
         
     |