Repository navigation
fix(workflow): stop rolling when the next test window leaves the calendar - #2375
Open
Divyansh Barodiya (Divyansh151005) wants to merge 1 commit into
Open
Divyansh Barodiya (Divyansh151005) wants to merge 1 commit into
Divyansh Barodiya (Divyansh151005) wants to merge 1 commit into
Conversation
…ndar TimeAdjuster.get returns None for the first index past the last trading day, and shift does not raise for that index. Comparing the missing test start with test_end raised TypeError and aborted rolling generation.
|
Divyansh Barodiya (@Divyansh151005) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
RollingGen.gen_following_tasksstops when the next test window starts after the last trading day.TimeAdjuster.getreturnsNonefor an index oflen(calendar). That is the first position after the last trading day.shiftdoes not raiseKeyErrorthere (KeyErroris only for an index greater thanlen(calendar)), so the next test start isNone. The old check compared that start withtest_endand raised:A missing test start is now the end of rolling, and that window is not emitted. A window that still begins on a trading day is kept, including one that ends on the last trading day. If another segment's start has already fallen off the calendar, that segment stays
Noneand the in-range test window is still emitted.Motivation and Context
Fixes #1660
Rolling benchmark generation hit this at the right edge of the calendar. The reporter's
Noneguard is the right stop condition for the test segment.shiftis left as it is so a train or valid segment can pass the end of the calendar without dropping a test window that is still valid.How Has This Been Tested?
pytest qlib/tests/test_all_pipeline.pyunder upper directory ofqlib.test_all_pipeline.pytrains a CSI300 LightGBM workflow and needs the market dataset. These tests use a synthetic calendar and do not load market data.flake8on the changed Python files, with the ignore list from the developer guide, reported no issues.black -l 120left the files unchanged.Screenshots of Test Results (if appropriate):
tests/rolling_tests/test_rolling_calendar_boundary.py, 5 passed.Types of changes