def test_jpx_2019_holidays(): jpx_calendar = JPXExchangeCalendar() # holidays we expect in 2019 (calendar changes for new Emperor) holidays_2019 = [ pd.Timestamp("2019-01-01", tz='UTC'), pd.Timestamp("2019-01-02", tz='UTC'), pd.Timestamp("2019-01-03", tz='UTC'), pd.Timestamp("2019-01-14", tz='UTC'), pd.Timestamp("2019-02-11", tz='UTC'), pd.Timestamp("2019-03-21", tz='UTC'), pd.Timestamp("2019-04-29", tz='UTC'), pd.Timestamp("2019-04-30", tz='UTC'), pd.Timestamp("2019-05-01", tz='UTC'), pd.Timestamp("2019-05-02", tz='UTC'), pd.Timestamp("2019-05-03", tz='UTC'), pd.Timestamp("2019-05-04", tz='UTC'), pd.Timestamp("2019-05-06", tz='UTC'), pd.Timestamp("2019-07-15", tz='UTC'), pd.Timestamp("2019-08-12", tz='UTC'), pd.Timestamp("2019-09-16", tz='UTC'), pd.Timestamp("2019-09-23", tz='UTC'), pd.Timestamp("2019-10-14", tz='UTC'), pd.Timestamp("2019-10-22", tz='UTC'), pd.Timestamp("2019-11-04", tz='UTC'), pd.Timestamp("2019-11-23", tz='UTC'), pd.Timestamp("2019-12-31", tz='UTC'), ] valid_days = jpx_calendar.valid_days(pd.Timestamp('2019-01-01'), pd.Timestamp('2019-12-31')) for session_label in holidays_2019: assert session_label not in valid_days
def test_2018_jpx_holidays(): jpx_calendar = JPXExchangeCalendar() # holidays we expect holidays_2018 = [ pd.Timestamp("2018-01-01", tz='UTC'), pd.Timestamp("2018-01-02", tz='UTC'), pd.Timestamp("2018-01-03", tz='UTC'), pd.Timestamp("2018-01-08", tz='UTC'), pd.Timestamp("2018-02-12", tz='UTC'), pd.Timestamp("2018-03-21", tz='UTC'), pd.Timestamp("2018-04-30", tz='UTC'), pd.Timestamp("2018-05-03", tz='UTC'), pd.Timestamp("2018-05-04", tz='UTC'), pd.Timestamp("2018-05-05", tz='UTC'), pd.Timestamp("2018-07-16", tz='UTC'), pd.Timestamp("2018-08-11", tz='UTC'), pd.Timestamp("2018-09-17", tz='UTC'), pd.Timestamp("2018-09-24", tz='UTC'), pd.Timestamp("2018-10-08", tz='UTC'), pd.Timestamp("2018-11-03", tz='UTC'), pd.Timestamp("2018-11-23", tz='UTC'), pd.Timestamp("2018-12-24", tz='UTC'), pd.Timestamp("2018-12-31", tz='UTC'), ] valid_days = jpx_calendar.valid_days(pd.Timestamp('2018-01-01'), pd.Timestamp('2018-12-31')) for session_label in holidays_2018: assert session_label not in valid_days
def test_jpx_2020_holidays(): jpx_calendar = JPXExchangeCalendar() # holidays we expect in 2020 (calendar changes for Olympics) holidays_2020 = [ pd.Timestamp("2020-01-01", tz='UTC'), pd.Timestamp("2020-01-02", tz='UTC'), pd.Timestamp("2020-01-03", tz='UTC'), pd.Timestamp("2020-01-13", tz='UTC'), pd.Timestamp("2020-02-11", tz='UTC'), pd.Timestamp("2020-02-24", tz='UTC'), # from 2/23 pd.Timestamp("2020-03-20", tz='UTC'), pd.Timestamp("2020-04-29", tz='UTC'), pd.Timestamp("2020-05-03", tz='UTC'), pd.Timestamp("2020-05-04", tz='UTC'), pd.Timestamp("2020-05-05", tz='UTC'), pd.Timestamp("2020-07-23", tz='UTC'), # sea day pd.Timestamp("2020-07-24", tz='UTC'), # sports day pd.Timestamp("2020-08-10", tz='UTC'), # mountain day pd.Timestamp("2020-09-21", tz='UTC'), pd.Timestamp("2020-09-22", tz='UTC'), pd.Timestamp("2020-11-03", tz='UTC'), pd.Timestamp("2020-11-23", tz='UTC'), pd.Timestamp("2020-12-31", tz='UTC'), ] valid_days = jpx_calendar.valid_days(pd.Timestamp('2020-01-01'), pd.Timestamp('2020-12-31')) for session_label in holidays_2020: assert session_label not in valid_days
def test_jpx_2021_holidays(): jpx_calendar = JPXExchangeCalendar() # holidays we expect in 2021 (regular calendar generation resumed) holidays_2021 = [ pd.Timestamp("2021-01-01", tz='UTC'), pd.Timestamp("2021-01-02", tz='UTC'), pd.Timestamp("2021-01-03", tz='UTC'), pd.Timestamp("2021-01-11", tz='UTC'), pd.Timestamp("2021-02-11", tz='UTC'), pd.Timestamp("2021-02-23", tz='UTC'), pd.Timestamp("2021-03-20", tz='UTC'), pd.Timestamp("2021-04-29", tz='UTC'), pd.Timestamp("2021-05-03", tz='UTC'), pd.Timestamp("2021-05-04", tz='UTC'), pd.Timestamp("2021-05-05", tz='UTC'), pd.Timestamp("2021-07-19", tz='UTC'), pd.Timestamp("2021-08-11", tz='UTC'), pd.Timestamp("2021-09-20", tz='UTC'), pd.Timestamp("2021-09-23", tz='UTC'), pd.Timestamp("2021-10-11", tz='UTC'), pd.Timestamp("2021-11-03", tz='UTC'), pd.Timestamp("2021-11-23", tz='UTC'), pd.Timestamp("2021-12-31", tz='UTC'), ] valid_days = jpx_calendar.valid_days(pd.Timestamp('2021-01-01'), pd.Timestamp('2021-12-31')) for session_label in holidays_2021: assert session_label not in valid_days
def test_2017_holidays(): jpx_calendar = JPXExchangeCalendar() # holidays we expect holidays_2017 = [ pd.Timestamp("2017-01-01", tz='UTC'), pd.Timestamp("2017-01-02", tz='UTC'), pd.Timestamp("2017-01-03", tz='UTC'), pd.Timestamp("2017-01-09", tz='UTC'), pd.Timestamp("2017-02-11", tz='UTC'), pd.Timestamp("2017-03-20", tz='UTC'), pd.Timestamp("2017-04-29", tz='UTC'), pd.Timestamp("2017-05-03", tz='UTC'), pd.Timestamp("2017-05-04", tz='UTC'), pd.Timestamp("2017-05-05", tz='UTC'), pd.Timestamp("2017-07-17", tz='UTC'), pd.Timestamp("2017-08-11", tz='UTC'), pd.Timestamp("2017-09-23", tz='UTC'), pd.Timestamp("2017-10-09", tz='UTC'), pd.Timestamp("2017-11-03", tz='UTC'), pd.Timestamp("2017-11-23", tz='UTC'), pd.Timestamp("2017-12-23", tz='UTC'), pd.Timestamp("2017-12-31", tz='UTC'), ] for session_label in holidays_2017: assert session_label not in jpx_calendar.valid_days( '2017-01-01', '2017-12-31')