From 0793a98057299dc331147aa5e957378550f01ab5 Mon Sep 17 00:00:00 2001 From: Gerry Manoim Date: Fri, 15 Oct 2021 00:18:35 -0400 Subject: [PATCH 1/2] Add a PR template --- .github/pull_request_template.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..34e0154b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,14 @@ +**Adding a new Exchange Calendar** + +- [ ] Added new exchange to readme +- [ ] Added calendar class (python module like `exchange_calendars/exchange_calendar_{Exchange MIC}.py`) + - Class should contain reference to trading calendar on exchange website +- [ ] Referenced new calendar in `exchange_calendars/calendar_utils.py` +- [ ] Added tests (e.g `tests/test_{Exchange MIC}_calendar.py`) + - You can generate tests input using `python etc/make_exchange_calendar_test_csv.py {Exchange MIC}` + +**Modifying an existing Exchange Calendar** + +- [ ] 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}` +- [ ] Check if any of the fixtrues in `tests/test_{Exchange MIC}_calendar.py` need updating to reflect your changes +- [ ] Add references to any new/modified holidasy in `exchange_calendars/exchange_calendar_{Exchange MIC}.py`. From 3b6b1689d4039a5b82330114ef90f400a9ff454d Mon Sep 17 00:00:00 2001 From: gerrymanoim Date: Tue, 19 Oct 2021 01:25:27 -0400 Subject: [PATCH 2/2] Update .github/pull_request_template.md Co-authored-by: Marcus Read --- .github/pull_request_template.md | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 34e0154b..75811a85 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,14 +1,22 @@ -**Adding a new Exchange Calendar** +**Workflow to add a new Exchange Calendar** -- [ ] Added new exchange to readme -- [ ] Added calendar class (python module like `exchange_calendars/exchange_calendar_{Exchange MIC}.py`) - - Class should contain reference to trading calendar on exchange website -- [ ] Referenced new calendar in `exchange_calendars/calendar_utils.py` -- [ ] Added tests (e.g `tests/test_{Exchange MIC}_calendar.py`) - - You can generate tests input using `python etc/make_exchange_calendar_test_csv.py {Exchange MIC}` +It's recommended that whilst working through the process reference be made to existing calendar and test classes. -**Modifying an existing Exchange Calendar** +- [ ] 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`). + - [ ] Name subclass `{Exchange MIC}ExchangeCalendar`. + - [ ] Override methods and properties as required, being guided by ExchangeCalendar documentation and in-code comments. All abstract properties must be overriden. + - [ ] Include references / links for holidays and timings (either to class documentation or as comments). +- [ ] Import calendar class to `exchange_calendars/calendar_utils.py` and add class to `_default_calendar_factories`. +- [ ] 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`). + - [ ] Name subclass `Test{Exchange MIC}Calendar`. + - [ ] Override fixtures as required, being guided by ExchangeCalendarTestBase documentation and in-code comments. The `calendar_cls` and `max_session_hours` fixtures must be overriden. +- [ ] 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. +- [ ] Add new exchange to Calendars table of README.md. +- [ ] PR it! -- [ ] 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}` -- [ ] Check if any of the fixtrues in `tests/test_{Exchange MIC}_calendar.py` need updating to reflect your changes -- [ ] Add references to any new/modified holidasy in `exchange_calendars/exchange_calendar_{Exchange MIC}.py`. +**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 fixtrues 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`.