It's recommended that whilst working through the process reference be made to existing calendar and test classes.
[x] Add calendar module exchange_calendars/exchange_calendar_{Exchange MIC}.py. Module should contain a subclass of the abstract base class ExchangeCalendar (in exchange_calendars/exchange_calendar.py).
[x] Name subclass {Exchange MIC}ExchangeCalendar.
[x] Override methods and properties as required, being guided by ExchangeCalendar documentation and in-code comments. All abstract properties must be overriden.
[x] Include references / links for holidays and timings (either to class documentation or as comments).
[x] Import calendar class to exchange_calendars/calendar_utils.py and add class to _default_calendar_factories.
[x] Add calendar test module tests/test_{Exchange MIC}_calendar.py Module should contain a subclass of the test base class ExchangeCalendarTestBase (in tests/test_exchange_calendars.py).
[x] Name subclass Test{Exchange MIC}Calendar.
[x] Override fixtures as required, being guided by ExchangeCalendarTestBase documentation and in-code comments. The calendar_cls and max_session_hours fixtures must be overriden.
[x] Add a .csv file containing expected timings to tests/resources/{Exchange MIC}.csv. This file be generated by executing python etc/make_exchange_calendar_test_csv.py {Exchange MIC}. See script's documentation.
[x] Add new exchange to Calendars table of README.md.
[x] PR it!
Workflow to modify an existing Exchange Calendar
[ ] Modify calendar class as required.
[ ] Modify the test resources file (e.g tests/resources/{Exchange MIC}.csv), either manually or by executing python etc/make_exchange_calendar_test_csv.py {Exchange MIC}.
[ ] Check if any of the fixtures in tests/test_{Exchange MIC}_calendar.py need updating to reflect your changes.
[ ] Add references to any new/modified holidays in exchange_calendars/exchange_calendar_{Exchange MIC}.py.
Workflow to add a new Exchange Calendar
It's recommended that whilst working through the process reference be made to existing calendar and test classes.
exchange_calendars/exchange_calendar_{Exchange MIC}.py
. Module should contain a subclass of the abstract base classExchangeCalendar
(inexchange_calendars/exchange_calendar.py
).{Exchange MIC}ExchangeCalendar
.exchange_calendars/calendar_utils.py
and add class to_default_calendar_factories
.tests/test_{Exchange MIC}_calendar.py
Module should contain a subclass of the test base classExchangeCalendarTestBase
(intests/test_exchange_calendars.py
).Test{Exchange MIC}Calendar
.calendar_cls
andmax_session_hours
fixtures must be overriden.tests/resources/{Exchange MIC}.csv
. This file be generated by executingpython etc/make_exchange_calendar_test_csv.py {Exchange MIC}
. See script's documentation.Workflow to modify an existing Exchange Calendar
tests/resources/{Exchange MIC}.csv
), either manually or by executingpython etc/make_exchange_calendar_test_csv.py {Exchange MIC}
.tests/test_{Exchange MIC}_calendar.py
need updating to reflect your changes.exchange_calendars/exchange_calendar_{Exchange MIC}.py
.