Release v0.1.0a11: API hardening, correctness fixes, beta prep - #1
Merged
Conversation
…ness Breaking changes (alpha, clean breaks): - Rename QuantLabTAError → ML4TEngineerError, remove all deprecated aliases - Remove COMMON_PARAM_DEFAULTS silent parameter fallback from compute_features - Delete selection/systematic.py (moved to ml4t-diagnostic) - Remove ml4t-style dependency Correctness fixes: - Fix GARCH forecast lookahead bias (was using future data for in-sample) - Fix trailing_stop=True with column-name barriers (ATR barriers) - Fix scaler column order preservation in StandardScaler/RobustScaler - Fix validate_ohlcv_schema dtype check (use is_numeric() not hardcoded list) - Fix TII value_range to (-100, 100) (indicator goes negative for downtrends) - Fix experiment config YAML tuple serialization roundtrip API improvements: - Add NaN validation at all labeling entry points - Add validate_ohlcv_schema guard in compute_features() - Add group_col parameter to trend_scanning_labels() for panel data - Add O(N*L) performance warning for atr_triple_barrier_labels - Add parameters= defaults to sma/ema/wma/cyclical_encode/time_decay_weights - Add BaseScaler.clone() method Cleanup (-2123 lines net): - Remove mypy: disable-error-code comments from ~50 feature files - Delete unused _calculate_drawdowns_nb numba function - Delete validate_numeric_column no-op - Remove deprecated plot_feature_analysis_summary stub - Remove coverage omissions for bars/microstructure Tests (+920 lines): - Add test_catalog.py (31 tests for FeatureCatalog) - Add test_experiment_config.py (20 tests for ExperimentConfig) - Add test_integration_pipeline.py (19 tests for end-to-end pipeline) - Update existing tests for NaN validation behavior changes
There was a problem hiding this comment.
Pull request overview
This release (v0.1.0a11) hardens the API, fixes several correctness bugs, and removes large swaths of deprecated/dead code in preparation for a beta release. It is a breaking release: the base exception is renamed, COMMON_PARAM_DEFAULTS is removed, and selection/systematic.py is deleted.
Changes:
- Breaking API changes: Rename
QuantLabTAError→ML4TEngineerError, removeCOMMON_PARAM_DEFAULTS(features without registered defaults now raise errors), moveFeatureSelectortoml4t-diagnostic, deleteselection/systematic.py. - Correctness fixes: Fix GARCH lookahead bias (always use conditional-expectation forecast), fix trailing-stop ATR barriers (raise error instead of silently using 1% default), fix scaler column reordering (iterate
X.columnsinstead of_fitted_columns), add NaN validation at all labeling entry points, addgroup_colsupport totrend_scanning_labels. - New tests: 430 lines of integration pipeline tests, 234 lines of experiment config tests, 256 lines of catalog tests.
Reviewed changes
Copilot reviewed 113 out of 113 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/ml4t/engineer/core/exceptions.py |
Rename base exception, remove all backward-compat aliases |
src/ml4t/engineer/labeling/utils.py |
Add validate_price_no_nans utility |
src/ml4t/engineer/labeling/triple_barrier.py |
Integrate NaN validation; fix trailing-stop error path; add label_bars/label_duration/barrier_hit to empty-group result |
src/ml4t/engineer/labeling/horizon_labels.py |
Integrate NaN validation; refactor trend_scanning_labels to support group_col via new _trend_scanning_single_group helper |
src/ml4t/engineer/labeling/atr_barriers.py |
Integrate NaN validation; add performance warning for large max_holding_bars=None |
src/ml4t/engineer/labeling/calendar.py |
Add _session_breaks attribute initialization |
src/ml4t/engineer/labeling/numba_ops.py |
Rename event_times → event_indices; fix array dtypes (np.int64, np.int32) |
src/ml4t/engineer/preprocessing.py |
Fix column-order bug in all three _apply_transform methods; add BaseScaler.clone(); handle empty series in MinMaxScaler/RobustScaler |
src/ml4t/engineer/dataset.py |
Use clone() in cross-validation loop instead of manual attribute copying |
src/ml4t/engineer/api.py |
Remove COMMON_PARAM_DEFAULTS; add validate_ohlcv_schema at entry; cleaner error for missing params |
src/ml4t/engineer/config/experiment.py |
Add _tuples_to_lists for YAML roundtrip fidelity of tuples |
src/ml4t/engineer/config/preprocessing_config.py |
Pass columns=self.columns to scaler constructors in create_scaler() |
src/ml4t/engineer/core/schemas.py |
Use dtype.is_numeric() instead of explicit type list for OHLCV validation |
src/ml4t/engineer/selection/__init__.py / systematic.py |
Remove FeatureSelector; add __getattr__ stub redirecting to ml4t-diagnostic |
src/ml4t/engineer/visualization/__init__.py / summary.py |
Remove deprecated plot_feature_analysis_summary; simplify module docs |
src/ml4t/engineer/features/… |
Remove mypy: disable-error-code comments across ~40 files; fix lookback/parameters metadata for sma, ema, wma, etc. |
tests/test_integration_pipeline.py |
New end-to-end integration tests |
tests/test_experiment_config.py |
New tests for experiment config load/save/roundtrip |
tests/test_catalog.py |
New tests for FeatureCatalog API |
tests/test_labeling.py / test_labeling_calendar.py / labeling/test_labeling_coverage.py |
Update NaN and trailing-stop tests to expect errors |
tests/test_api.py |
Update feature tests for removed COMMON_PARAM_DEFAULTS |
tests/selection/test_systematic.py / __init__.py |
Delete tests for removed module |
pyproject.toml |
Remove coverage omissions for now-covered modules |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
QuantLabTAError→ML4TEngineerError, removeCOMMON_PARAM_DEFAULTS, deleteselection/systematic.py(→ ml4t-diagnostic), removeml4t-styledependencygroup_colfortrend_scanning_labels,validate_ohlcv_schemaincompute_features113 files changed, 1,306 insertions, 2,123 deletions. 3,199 tests passing.
Test plan
ruff check src/— cleanty check— cleanpytest tests/— 3,199 passed, 1 skipped