Add walk-forward splits and data manifest - #6
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a small research-workflow layer to the toolkit by introducing walk-forward split utilities and a dataset manifest helper, with accompanying unit tests and an updated example diagnostics report to reflect the new capabilities.
Changes:
- Added
WalkForwardSplit,build_walk_forward_splits, andapply_splitfor strict train-before-test rolling windows. - Added
DataManifestfor serializable dataset metadata (shape, identity columns, known limitations). - Added unit tests for split ordering/panel slicing and manifest shape/validation; updated example diagnostics markdown.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_splits.py | Adds unit tests covering split construction ordering and panel slicing behavior. |
| tests/test_manifest.py | Adds unit tests covering manifest serialization and identity-column validation. |
| src/quant_toolkit/splits.py | Introduces walk-forward split dataclass + helpers to build/apply splits. |
| src/quant_toolkit/manifest.py | Introduces DataManifest for reproducible dataset metadata. |
| src/quant_toolkit/init.py | Exposes new manifest/splits APIs via package exports. |
| reports/example-diagnostics.md | Updates documentation to describe the expanded workflow capabilities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| raise ValueError(f"missing manifest identity columns: {missing}") | ||
| return cls( | ||
| source=source, | ||
| created_at=pd.Timestamp.utcnow().isoformat(), |
Comment on lines
+63
to
+65
| dates = pd.to_datetime(panel[date_col]) | ||
| train_mask = (dates >= split.train_start) & (dates <= split.train_end) | ||
| test_mask = (dates >= split.test_start) & (dates <= split.test_end) |
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.
Adds a small, test-covered research workflow layer:
Local verification:
C:\qds\Scripts\python.exe -m unittest discover -s tests -vpassed with 13 tests.