Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Update XLON calendars #166

Merged
merged 3 commits into from Sep 17, 2020
Merged

ENH: Update XLON calendars #166

merged 3 commits into from Sep 17, 2020

Conversation

gerrymanoim
Copy link
Collaborator

Updates XLON to include holidays from pandas_market_calendars.

Closes #163.

See details from original PR: rsheftel/pandas_market_calendars#84

@jmccorriston
Copy link
Contributor

This looks right to me. However, the only material changes (I believe) are to the May Bank holiday going forward (2021 and later) and the May Bank holiday in 1995. Everything else looks to be just style changes, right?

@rsheftel
Copy link
Collaborator

Running the test suite gives this result:

======================================================================
ERROR: test suite for <class 'tests.test_xlon_calendar.XLONCalendarTestCase'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/anaconda3/envs/tc/lib/python3.8/site-packages/nose/suite.py", line 209, in run
    self.setUp()
  File "/usr/local/anaconda3/envs/tc/lib/python3.8/site-packages/nose/suite.py", line 292, in setUp
    self.setupContext(ancestor)
  File "/usr/local/anaconda3/envs/tc/lib/python3.8/site-packages/nose/suite.py", line 315, in setupContext
    try_run(context, names)
  File "/usr/local/anaconda3/envs/tc/lib/python3.8/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/home/ryan/git/trading_calendars/tests/test_trading_calendar.py", line 237, in setupClass
    cls.calendar = cls.calendar_class(cls.start_date, cls.end_date)
  File "/home/ryan/git/trading_calendars/trading_calendars/trading_calendar.py", line 131, in __init__
    _overwrite_special_dates(_all_days, self._closes, _special_closes)
  File "/home/ryan/git/trading_calendars/trading_calendars/trading_calendar.py", line 1045, in _overwrite_special_dates
    raise ValueError("Special dates %s are not trading days." % bad_dates)
ValueError: Special dates [Timestamp('1999-12-31 12:30:00+0000', tz='UTC')] are not trading days.

----------------------------------------------------------------------
Ran 0 tests in 1.751s

@gerrymanoim
Copy link
Collaborator Author

gerrymanoim commented Sep 17, 2020

Yep - I see the same issue in the CI. Will sort it out.

@gerrymanoim
Copy link
Collaborator Author

Also yes - most of the changes were style, but I liked the styling in pandas market calendars better than what we previously had.

@gerrymanoim
Copy link
Collaborator Author

gerrymanoim commented Sep 17, 2020

Right - the issue here is we have pd.Timestamp("1999-12-31", tz='UTC') as an adhoc holiday, but also have add special closes on NewYearsEve (normally it is a half day).

It was closed as per http://news.bbc.co.uk/2/hi/uk_news/376063.stm (eve of the 3rd millennium). Will add a fix.

@rsheftel
Copy link
Collaborator

This now works for the special holidays that started this PR, but it does appear that many of the old tests fail now

@gerrymanoim
Copy link
Collaborator Author

Yep - forgot to fix the CSV. Doing that now.

@gerrymanoim gerrymanoim merged commit 7940b5f into master Sep 17, 2020
@gerrymanoim gerrymanoim deleted the update-xlon branch September 17, 2020 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LSE special holidays
3 participants