|
1 |
| -**Adding a new Exchange Calendar** |
| 1 | +**Workflow to add a new Exchange Calendar** |
2 | 2 |
|
3 |
| -- [ ] Added new exchange to readme |
4 |
| -- [ ] Added calendar class (python module like `exchange_calendars/exchange_calendar_{Exchange MIC}.py`) |
5 |
| - - Class should contain reference to trading calendar on exchange website |
6 |
| -- [ ] Referenced new calendar in `exchange_calendars/calendar_utils.py` |
7 |
| -- [ ] Added tests (e.g `tests/test_{Exchange MIC}_calendar.py`) |
8 |
| - - You can generate tests input using `python etc/make_exchange_calendar_test_csv.py {Exchange MIC}` |
| 3 | +It's recommended that whilst working through the process reference be made to existing calendar and test classes. |
9 | 4 |
|
10 |
| -**Modifying an existing Exchange Calendar** |
| 5 | +- [ ] 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`). |
| 6 | + - [ ] Name subclass `{Exchange MIC}ExchangeCalendar`. |
| 7 | + - [ ] Override methods and properties as required, being guided by ExchangeCalendar documentation and in-code comments. All abstract properties must be overriden. |
| 8 | + - [ ] Include references / links for holidays and timings (either to class documentation or as comments). |
| 9 | +- [ ] Import calendar class to `exchange_calendars/calendar_utils.py` and add class to `_default_calendar_factories`. |
| 10 | +- [ ] 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`). |
| 11 | + - [ ] Name subclass `Test{Exchange MIC}Calendar`. |
| 12 | + - [ ] Override fixtures as required, being guided by ExchangeCalendarTestBase documentation and in-code comments. The `calendar_cls` and `max_session_hours` fixtures must be overriden. |
| 13 | +- [ ] 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. |
| 14 | +- [ ] Add new exchange to Calendars table of README.md. |
| 15 | +- [ ] PR it! |
11 | 16 |
|
12 |
| -- [ ] Modify the test resources file (e.g `tests/resources/{Exchange MIC}.csv`), either manually or executing `python etc/make_exchange_calendar_test_csv.py {Exchange MIC}` |
13 |
| -- [ ] Check if any of the fixtrues in `tests/test_{Exchange MIC}_calendar.py` need updating to reflect your changes |
14 |
| -- [ ] Add references to any new/modified holidasy in `exchange_calendars/exchange_calendar_{Exchange MIC}.py`. |
| 17 | +**Workflow to modify an existing Exchange Calendar** |
| 18 | + |
| 19 | +- [ ] Modify calendar class as required. |
| 20 | +- [ ] 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}`. |
| 21 | +- [ ] Check if any of the fixtrues in `tests/test_{Exchange MIC}_calendar.py` need updating to reflect your changes. |
| 22 | +- [ ] Add references to any new/modified holidays in `exchange_calendars/exchange_calendar_{Exchange MIC}.py`. |
0 commit comments