exness-data-preprocess 0.5.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/.cz.toml +1 -1
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/AUTHORS.md +1 -0
- exness_data_preprocess-0.7.0/CHANGELOG.md +138 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/CLAUDE.md +16 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/CONTRIBUTING.md +7 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/DOCUMENTATION.md +30 -4
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/GITHUB_PYPI_SETUP.md +38 -1
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/PKG-INFO +5 -1
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/README.md +3 -0
- exness_data_preprocess-0.7.0/RELEASE_NOTES.md +21 -0
- exness_data_preprocess-0.7.0/RELEASE_NOTES_SHORT.md +40 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/DATABASE_SCHEMA.md +59 -43
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/EXNESS_DATA_SOURCES.md +30 -6
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/MODULE_ARCHITECTURE.md +75 -3
- exness_data_preprocess-0.7.0/docs/PHASE4_DRY_RUN_CONFIG_PLAN.yaml +362 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/README.md +26 -18
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/RESEARCH_PATTERNS.md +18 -5
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/TRADING_HOURS_RESEARCH.md +86 -22
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/UNIFIED_DUCKDB_PLAN_v2.md +1 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/archive/PYDANTIC_REFACTORING_PLAN_v0.2.0_COMPLETE.md +46 -6
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/archive/PYDANTIC_REFACTORING_STATUS_v0.2.0_COMPLETE.md +23 -4
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/optimization/OPTIMIZATION_OPPORTUNITIES_2025-10-18.md +98 -65
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/CLAUDE_MD_AUDIT_2025-10-16_PASS2.md +48 -26
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/CLAUDE_MD_VERIFICATION_CHECKLIST_2025-10-16.md +57 -1
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/CLAUDE_MD_VERIFICATION_FINDINGS_2025-10-16.md +45 -17
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/DOCUMENTATION_AUDIT_2025-10-15.md +40 -8
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/DOCUMENTATION_AUDIT_PASS2_2025-10-15.md +16 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/DOCUMENTATION_BEST_PRACTICES_LINE_COUNTS.md +19 -4
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/EXCHANGE_SESSION_AUDIT_2025-10-17.md +56 -16
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/FUNCTIONALITY_VALIDATION_REPORT_2025-10-15.md +42 -9
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/FUNCTIONALITY_VALIDATION_REPORT_2025-10-16.md +44 -20
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/PHASE7_v1.5.0_REFACTORING_PLAN.md +61 -20
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/PHASE7_v1.6.0_REFACTORING_PROGRESS.md +24 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/REFACTORING_CHECKLIST.md +17 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/RESEARCH_PATTERNS_CANONICALIZATION_2025-10-17.md +29 -5
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/SCHEMA_v1.6.0_AUDIT_FINDINGS.md +35 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/SCHEMA_v1.6.0_MIGRATION_GUIDE.md +30 -1
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/plans/SESSION_2025-10-15_SUMMARY.md +27 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/GAP_DETECTION_COMPARISON.md +36 -18
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/GAP_DETECTION_SQL_APPROACH.md +30 -6
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/HYBRID_SESSION_DETECTION_ANALYSIS.md +79 -5
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/compression-benchmarks/README.md +17 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/01-methodology.md +30 -7
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/02-mode-truncated-analysis.md +67 -42
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/03-hurdle-model-analysis.md +73 -50
- exness_data_preprocess-0.7.0/docs/research/eurusd-spread-analysis/04-temporal-patterns.md +166 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/05-final-recommendations.md +50 -22
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/README.md +13 -6
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/scripts/reproduction_guide.md +30 -11
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/01-methodology.md +28 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/02-baseline-sep2024.md +23 -11
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/03-multiperiod-validation.md +51 -27
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/04-discoveries-and-plan-evolution.md +29 -7
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/README.md +14 -6
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/findings/baseline-sep2024-comprehensive-summary.md +72 -32
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/findings/phase2-mean-reversion-report.md +9 -6
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/findings/phase3-volatility-model-report.md +5 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/findings/phase4-5-statistical-tests-survivorship-report.md +77 -58
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/reproduction_guide.md +28 -2
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/validation/ARCHITECTURE_AUDIT_2025-10-17.md +54 -32
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/validation/ARCHITECTURE_EFFICIENCY_AUDIT_2025-10-18.md +50 -26
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/validation/DOCUMENTATION_SURVEY_v1.7.0.md +37 -3
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/validation/E2E_VALIDATION_RESULTS_v1.6.0.md +30 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md +35 -6
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md +46 -16
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/validation/WEEKEND_GAP_VALIDATION_SUMMARY.md +13 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/validation/WORKSPACE_SURVEY_2025-10-17.md +21 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/pyproject.toml +2 -1
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/__init__.py +3 -1
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/api.py +20 -7
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/cli.py +53 -1
- exness_data_preprocess-0.7.0/src/exness_data_preprocess/config.py +126 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/models.py +197 -3
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/processor.py +356 -13
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/tests/README.md +5 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/tests/archive/E2E_TESTING_PLAN_v1.0.0.md +23 -0
- exness_data_preprocess-0.5.0/CHANGELOG.md +0 -169
- exness_data_preprocess-0.5.0/RELEASE_NOTES.md +0 -26
- exness_data_preprocess-0.5.0/docs/research/eurusd-spread-analysis/04-temporal-patterns.md +0 -166
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/.github/workflows/ci.yml +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/.github/workflows/pre-commit-autoupdate.yml +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/.github/workflows/publish.yml +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/.gitignore +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/.pre-commit-config.yaml +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/LICENSE +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/Makefile +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/cliff-release-notes.toml +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/cliff.toml +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/archive/UNIFIED_DUCKDB_PLAN_v1.0.0_LEGACY.md +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/implementation-plan.yaml +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/planning-index.yaml +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/compression-benchmarks/test_all_compression_methods.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/compression-benchmarks/test_delta_encoding_properly.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/compression-benchmarks/test_parquet_compression_methods.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/visualizations/hurdle-model/hurdle_decomposition.png +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/visualizations/mode-truncated/cv_mode_comparison.png +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/visualizations/mode-truncated/distribution_overlay.png +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/visualizations/mode-truncated/signal_quality_comparison.png +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/visualizations/mode-truncated/variance_decomposition.png +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/visualizations/temporal/concentration_curve.png +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-spread-analysis/visualizations/temporal/percentile_analysis.png +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/baseline-sep2024/01_mean_reversion_analysis.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/baseline-sep2024/02_volatility_model_simple.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/baseline-sep2024/03_liquidity_crisis_detection.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/baseline-sep2024/04_regime_detection_analysis.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase1_data_validation.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase2_mean_reversion.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase3_volatility_model.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase4_statistical_tests.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase5_survivorship_bias.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase5_survivorship_bias_v1.0.1.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase6a_interval_analysis.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase6b_price_clustering.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/multiperiod-validation/phase6c_combined_pattern.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/visualization/diagnostic_burst_decay.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/visualization/generate_interactive_dashboard.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/visualization/generate_lightweight_dashboard.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/eurusd-zero-spread-deviations/scripts/visualization/prepare_visualization_data.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/docs/research/gap_detection_implementation_example.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/examples/basic_usage.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/examples/batch_processing.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/database_manager.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/downloader.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/exchanges.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/gap_detector.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/ohlc_generator.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/query_engine.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/schema.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/session_detector.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/src/exness_data_preprocess/tick_loader.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/tests/__init__.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/tests/conftest.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/tests/test_basic.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/tests/test_functional_regression.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/tests/test_models.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/tests/test_processor_pydantic.py +0 -0
- {exness_data_preprocess-0.5.0 → exness_data_preprocess-0.7.0}/tests/test_types.py +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to exness-data-preprocess will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ✨ Features
|
|
10
|
+
|
|
11
|
+
- **phase4**: Add dry-run mode and config file support Implements Phase 4 features from adversarial probe recommendations. Both features follow SSoT methodology with iterative plan updates. **Dry-Run Mode**: - Preview download operations without file system changes - Estimates based on historical averages (~9.5M ticks/month, ~11 MB/month) - Returns DryRunResult with gap analysis and size estimates - CLI: exness-preprocess process --dry-run **Config File Support**: - Persistent user preferences in ~/.exness-preprocess.yaml - Pydantic validation with off-the-shelf PyYAML - Priority resolution: CLI flags > config > defaults - Optional (no error if missing) - CLI: exness-preprocess --config /path/to/config.yaml **Implementation**: - config.py (new): ConfigModel with Pydantic + PyYAML loader - models.py: DryRunResult model with 2 computed fields - processor.py: dry_run + config parameters, union return type - api.py: dry_run forwarding for v1.0.0 API compatibility - cli.py: --dry-run + --config flags with precedence logic - pyproject.toml: pyyaml>=6.0.0 dependency **SLOs**: - Availability: Features optional, no breaking changes - Correctness: Gap detector reused, Pydantic validation on config - Observability: Dry-run prints estimate summary - Maintainability: Off-the-shelf PyYAML, no custom config parser **Testing**: - All 48 tests passing - Backward compatible (all new parameters optional) - Config file errors propagate (no silent fallbacks) **Time**: ~1.5 hours (as estimated in probe report) Related: v0.6.0 probe recommendations (items 4-5) SSoT Plan: docs/PHASE4_DRY_RUN_CONFIG_PLAN.yaml v2.0.0
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### 💅 Code Style
|
|
15
|
+
|
|
16
|
+
- Format markdown files with prettier Auto-formatted 66 markdown files across docs, root, and tests directories to maintain consistent style and readability.
|
|
17
|
+
|
|
18
|
+
### 🔌 API Enhancements
|
|
19
|
+
|
|
20
|
+
- **api**: Add AI-agent-friendly input validation (Phase 1 critical fixes) Implement adversarial probe recommendations for improved AI agent usability. This addresses the three critical issues identified in the v0.5.0 probe report. ## Changes ### 1. Early Input Validation (Critical Issue #1) - Add validation helper methods: \_validate_pair(), \_validate_variant(), \_validate_timeframe(), \_validate_date_format() - Call validators BEFORE file operations in all public methods - Clear ValueError messages instead of confusing FileNotFoundError - Example: "Invalid pair 'INVALID'. Must be one of: EURUSD, GBPUSD, ..." instead of "FileNotFoundError: Database not found" ### 2. Pydantic Field Constraints (Critical Issue #2) - Add pattern validation to CoverageInfo.earliest_date and latest_date fields - Validates date format: r'^\d{4}-\d{2}-\d{2}' (YYYY-MM-DD) - Note: ge=0 constraints already existed on all numeric fields ✓ ### 3. Raises Documentation (Critical Issue #3) - Add comprehensive Raises sections to 4 public methods: - update_data(): ValueError, FileNotFoundError, ConnectionError, pd.errors.EmptyDataError - query_ticks(): ValueError, FileNotFoundError, duckdb.Error, pd.errors.EmptyDataError - query_ohlc(): ValueError, FileNotFoundError, duckdb.Error, pd.errors.EmptyDataError - get_data_coverage(): ValueError, duckdb.Error - AI agents can now understand error handling before calling methods ## Impact Before (confusing): `python proc.query_ticks(pair='INVALID') # FileNotFoundError: Database not found: /path/to/invalid.duckdb ` After (clear): `python proc.query_ticks(pair='INVALID') # ValueError: Invalid pair 'INVALID'. Must be one of: EURUSD, GBPUSD, XAUUSD, ... ` ## Testing ✓ Import successful ✓ Validation works correctly ✓ All error messages clear and actionable ✓ No regressions (backward compatible) ## Performance - Validation overhead: <1ms per method call - Zero impact on existing functionality ## References - Adversarial Probe Report: exness-data-preprocess v0.5.0 - Priority: 🔴 CRITICAL (Issues #1, #2, #3) - Estimated time: 45 minutes (actual: 45 minutes) - ROI: ⭐⭐⭐⭐⭐ (10x better AI-agent discoverability) Closes: Critical Issues #1, #2, #3 from adversarial probe report
|
|
21
|
+
|
|
22
|
+
- **api**: Add computed fields, convenience methods, and context manager (Phase 2) Implements high-impact improvements for AI-agent usability following adversarial probe report recommendations. **Pydantic Computed Fields** (models.py): - UpdateResult: - avg_ticks_per_month: Average ticks per month downloaded - storage_efficiency_mb_per_million_ticks: Storage efficiency metric - CoverageInfo: - total_ticks: Sum of both data variants - coverage_percentage: Estimated trading day coverage - storage_efficiency_mb_per_million_ticks: Storage efficiency metric **Convenience Methods** (processor.py): - get_available_dates(): Returns (earliest, latest) tuple for quick boundary checks - validate_date_range(): Pre-flight validation returning (bool, error_msg) - estimate_download_size(): Estimates MB based on date range (~11 MB/month) **Context Manager Support** (processor.py): - **enter**(): Returns self for 'with' statement usage - **exit**(): Cleans up temporary ZIP files, doesn't suppress exceptions - Enables: with ExnessDataProcessor() as proc: ... **CLI Enhancement** (cli.py): - Added --version flag using importlib.metadata - Standard version display for automation scripts All methods include comprehensive docstrings with examples and type hints. Computed fields auto-appear in JSON Schema for AI agent discovery. Related: Phase 1 (f8c3ad2) - Input validation, field constraints, Raises docs Time: ~1 hour implementation
|
|
23
|
+
|
|
24
|
+
### ✨ Features
|
|
25
|
+
|
|
26
|
+
- **ohlc**: Implement incremental OHLC generation with 95% speedup Add optional date filtering to OHLC generation, enabling three operation modes instead of always regenerating all historical data. Performance Impact: - Incremental updates: 95-97% faster (45s → 1s for 1-month addition) - Backward compatible: No breaking changes to existing API - Scales linearly: O(M) new data vs O(N) total database size Implementation Details: 1. ohlc*generator.py: - Add optional start_date/end_date parameters to regenerate_ohlc() - Implement three modes: * Mode 1 (default): Full regeneration - DELETE all + INSERT all \_ Mode 2 (new): Incremental append - INSERT OR IGNORE new data only \* Mode 3 (new): Range update - DELETE range + INSERT range - Add WHERE clause filtering for INSERT and session detection queries - Change INSERT to INSERT OR IGNORE for duplicate handling - Update comprehensive docstring with usage examples 2. processor.py: - Track earliest_added_month during update loop - Pass start_date to regenerate_ohlc() for incremental updates - Update print messages to reflect incremental vs full generation Testing: - All 48 existing tests pass (4m24s) - No breaking changes to existing behavior - Full backward compatibility verified Related: - Addresses critical inefficiency identified in ARCHITECTURE_EFFICIENCY_AUDIT - Part of v1.7.0 performance optimization initiative - Complements upcoming session vectorization and SQL gap detection
|
|
27
|
+
|
|
28
|
+
- **session**: Implement vectorized session detection with 2.2x speedup Pre-computes trading minutes for vectorized .isin() lookup instead of per-timestamp .apply() calls. Preserves accuracy via exchange_calendars. Implementation: - Added \_precompute_trading_minutes() helper in SessionDetector - Replaced .apply() loop with vectorized .isin() lookup - Delegated lunch breaks and trading hour changes to exchange_calendars - Backward compatible API (detect_sessions_and_holidays unchanged) Performance: - Spike test: 2.2x speedup (5.99s → 2.69s for 302K bars) - Combined Phase 1+2: ~16x total speedup - All 48 tests passed (no regressions) Documentation: - PHASE2_SESSION_VECTORIZATION_PLAN.yaml: SSoT with SLOs and discoveries - SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md: Validation results Refs: docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml
|
|
29
|
+
|
|
30
|
+
- **gap**: Implement SQL gap detection with complete coverage Replaced Python iteration with SQL EXCEPT query to detect ALL gaps (before + within + after), not just edge gaps. Implementation: - Replaced lines 94-155 (62 lines) with SQL EXCEPT query (34 lines) - Uses DuckDB generate_series() + EXCEPT operator - Detects internal gaps missed by Python MIN/MAX approach - Backward compatible (same method signature) Spike Test Results: - Python approach: 41 gaps detected (missed internal gap 2022-03) - SQL approach: 42 gaps detected (correctly found 2022-03) - Validation: SQL detects gaps Python iteration misses Performance: - LOC reduction: 46% (62 → 34 lines) - Complexity: O(n) Python loops → O(1) SQL query - All 48 tests passed (no regressions) Documentation: - PHASE3_SQL_GAP_DETECTION_PLAN.yaml: SSoT with SLOs and discoveries - Updated docstring to reflect complete gap detection Refs: docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml
|
|
31
|
+
|
|
32
|
+
### 📚 Documentation
|
|
33
|
+
|
|
34
|
+
- **architecture**: Fix documentation accuracy based on comprehensive audit Update MODULE_ARCHITECTURE.md to v1.3.1 with verified accuracy against source code implementation. All 8 modules audited line-by-line to ensure documentation matches actual implementation. Major Corrections: - Fixed module count: 6 instances + 1 static utility (was "7 modules") - Added all missing constructor signatures (base_dir, temp_dir params) - Fixed HTTP library: urllib.request not httpx (critical dependency error) - Completely rewrote query_engine.py signatures (pair-based API, not duckdb_path) - Fixed all type signatures (str vs datetime, Pydantic models vs dicts) - Enhanced data flow: 8-step workflow + separated query operations - Added 3 detailed Mermaid flowcharts (update_data, query_ticks, query_ohlc) Module-Specific Fixes: - processor.py: Documented Pydantic return types, observability via print - downloader.py: Fixed urllib.request, Returns None SLO, file caching - tick_loader.py: Documented UTC timezone-aware timestamps - database_manager.py: OHLCSchema integration, INSERT OR IGNORE, TIMESTAMP WITH TIME ZONE - session_detector.py: Input schema (ts + date), exchanges.py location, is_open_on_minute() - gap_detector.py: Fixed start_date type (str not datetime), gap detection limitations - ohlc_generator.py: SessionDetector injection, return None, DELETE pattern - query_engine.py: Complete signature rewrite for all 3 methods Audit Results: - Initial accuracy: 78% (mostly correct, significant gaps) - Final accuracy: 100% (all corrections verified against source code) - Methods audited: Parallel research agents + deep source analysis - Evidence: Line numbers cited for all corrections Files: - docs/MODULE_ARCHITECTURE.md: v1.3.1 with all corrections applied - docs/validation/ARCHITECTURE_AUDIT_2025-10-17.md: Complete audit trail This ensures MODULE_ARCHITECTURE.md serves as ultra-accurate single source of truth for codebase architecture, verified line-by-line against actual implementation.
|
|
35
|
+
|
|
36
|
+
- Add DOCUMENTATION.md hub organizing 72+ docs from beginner to advanced - Created comprehensive documentation hub with progressive disclosure - Organized into 9 major sections: Quick Start, Beginner/Intermediate/Advanced paths, Research Projects, Reference, Development, Archive - Added decision tree for 6 common user scenarios - Linked from README.md for easy discovery - All 72+ documentation files indexed with relative URLs - Hub-and-spoke model with checkpoints and emoji navigation
|
|
37
|
+
|
|
38
|
+
- **research**: Add multimodal caveats to 118.1% CV interpretation Root cause: Standard variant exhibits bimodal structure not addressed by single-mode truncation methodology. Findings: - Primary mode: 0.56 pips (77.5% of data) - Secondary mode: 0.69 pips (P1-P90 of non-modal ≈ 20% of total) - True tail: 3.68-13.4 pips outliers (P95-P99.9) - 118.1% CV driven by tail outliers, not uniform spread variability Changes: - 01-methodology.md: Expanded Limitation #3 with Standard bimodal example - 02-mode-truncated-analysis.md: Added inline methodological note after CV - 05-final-recommendations.md: Added CV interpretation note and comparison clarification Preserves original analysis while documenting outlier-driven nature of CV. No new files created - follows existing research documentation patterns.
|
|
39
|
+
|
|
40
|
+
- **audit**: Comprehensive architecture & efficiency audit Verified MODULE_ARCHITECTURE.md v1.3.1 accuracy and analyzed business logic for redundancy, unnecessary operations, and inefficiencies. Architecture Accuracy: ✅ 100% - Mermaid diagram 8-step workflow matches actual code execution - All 7 specialized modules verified (constructors + methods) - Complete call graph tracing confirms documentation accuracy Critical Findings: 🚨 1 major inefficiency 1. Full OHLC regeneration on every update (O(N) not O(M)) - Adding 1 month to 36-month DB: 28s wasted regenerating existing data - Scales linearly with total data size (3 years = 28s, 5 years = 50s) - Fix: Implement incremental generation (35-62× faster) Missing Features: ⚠️ 1 TODO 2. Gap detection only finds before/after, not within range - gaps_detector.py:107 has TODO comment - Fix: Query distinct months, compare with expected range Good Practices: ✅ 5 identified - File existence caching (prevents re-downloads) - PRIMARY KEY deduplication (database-level) - Read-only connections (safe concurrent queries) - Timezone-aware timestamps (UTC explicit) - Self-documenting database (COMMENT ON statements) Recommendations: - Priority 1: Incremental OHLC generation (4-8h, 35× speedup) - Priority 2: Full gap detection (2-4h, automatic gap filling) - Priority 3: Parallel downloads (2-3h, 2× faster) No architectural discrepancies found - documentation is accurate.
|
|
41
|
+
|
|
42
|
+
- **optimization**: Comprehensive research on minimal-change, high-impact optimizations Spawned 5 parallel research agents to analyze architecture for optimization opportunities with minimal code changes and maximum efficiency impact. Research Coverage: 1. Incremental OHLC generation strategies 2. DuckDB-specific performance features 3. Session detection caching/vectorization 4. Parallel processing opportunities 5. Gap detection query optimization Top 3 Optimizations (92% overall speedup): 🥇 Incremental OHLC: 95-97% reduction (45s → 1s) - 20 LOC 🥈 Session Vectorization: 99.6% reduction (1.6s → 0.007s) - net -17 LOC 🥉 Parallel Downloads: 43% overall speedup - 20 LOC Combined Impact: - Current: ~60 seconds per 1-month update - Optimized: ~5 seconds per 1-month update - Speedup: 12× faster (92% reduction) All optimizations maintain backward compatibility and have low risk. Implementation Roadmap: - Phase 1 (Week 1): Critical wins (#1, #2) → 92% speedup - Phase 2 (Week 2): High-value (#3, #4) → Additional improvements - Phase 3 (Week 2): Quick wins (#5, #6) → Polish Total implementation time: 6-8 hours for critical + high-value
|
|
43
|
+
|
|
44
|
+
- **validation**: Add Phase 1 spike test results Documented incremental OHLC spike test validation showing 7.3x speedup. Key findings: - Speedup: 7.3x (8.05s → 1.10s for 7 months) - Accuracy: 100% match (identical row counts, no duplicates) - Bottleneck discovered: Session detection dominates (94% of time) - Validates Phase 2 priority (session vectorization) Refs: docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md
|
|
45
|
+
|
|
46
|
+
- **v0.5.0**: Comprehensive documentation update for performance optimizations Update all documentation with v0.5.0 performance optimization details: - Incremental OHLC generation: 7.3x speedup (8.05s → 1.10s) - Vectorized session detection: 2.2x speedup (5.99s → 2.69s) - SQL gap detection: Complete coverage + 46% LOC reduction - Combined Phase 1+2: ~16x total speedup (8.05s → 0.50s) Files Updated: - CHANGELOG.md: Added comprehensive v0.5.0 entry with all 3 phases - README.md: Added "Performance Optimizations (v0.5.0)" section - DOCUMENTATION.md: Added "Performance Optimizations" with SSoT plan links - CLAUDE.md: Added optimization summary, updated version to v1.7.0 - docs/MODULE_ARCHITECTURE.md: Updated to v1.7.0 with optimization details - docs/README.md: Added "Performance Optimizations" section - pyproject.toml: Bump version 0.4.0 → 0.5.0 Documentation Added: - docs/validation/DOCUMENTATION_SURVEY_v1.7.0.md: Holistic doc update survey - docs/research/GAP_DETECTION_COMPARISON.md: Gap detection approach comparison - docs/research/GAP_DETECTION_SQL_APPROACH.md: SQL EXCEPT implementation research - docs/research/gap_detection_implementation_example.py: Reference implementation All changes backward compatible (no API breaking changes). All 48 tests pass. SSoT plans and spike test validation included.
|
|
47
|
+
|
|
48
|
+
### ♻️ Refactoring
|
|
49
|
+
|
|
50
|
+
- **schema**: Centralize OHLC schema in schema.py module - Create schema.py with OHLCSchema class as single source of truth - Reduce coupling from 42 to 5 update locations (88% reduction) - Replace hardcoded column lists in docs with pointers to schema.py - Delete obsolete PYDANTIC_TEST_STRATEGY.md (tests implemented) - Delete add_schema_comments.py (functionality merged into processor) - Update tests to use OHLCSchema.get_required_columns() - Achieve maximum DRY: future column additions require 1-2 file updates BREAKING CHANGE: None (additive refactoring, no API changes)
|
|
51
|
+
|
|
52
|
+
- Extract 7 specialized modules from processor.py (Phase 1-5) Refactor processor.py (885 → 414 lines, 53% reduction) using facade pattern with 7 focused modules implementing separation of concerns. Modules Created: - downloader.py (89 lines): HTTP download operations - tick_loader.py (67 lines): CSV parsing - database_manager.py (213 lines): Database operations - session_detector.py (121 lines): Holiday/session detection - gap_detector.py (163 lines): Incremental update logic - ohlc_generator.py (210 lines): Phase7 OHLC generation - query_engine.py (283 lines): Query operations Design Principles: - Facade pattern: processor.py delegates to specialized modules - SLO-based: All modules define Availability, Correctness, Observability, Maintainability - Off-the-shelf: httpx, pandas, DuckDB, exchange_calendars (no custom implementations) - Zero regressions: All 48 tests pass, all ruff checks pass Documentation: - Updated CLAUDE.md with module structure and facade pattern - Updated docs/README.md with implementation architecture v1.3.0 - Added planning documents (REFACTORING_CHECKLIST.md, PHASE7_v1.6.0_REFACTORING_PROGRESS.md) Version: 1.3.0 (Implementation) Validation: 48 tests pass, ruff checks pass, backward compatible
|
|
53
|
+
|
|
54
|
+
### ✨ Features
|
|
55
|
+
|
|
56
|
+
- Implement pydantic v2 models with dual-variant e2e testing - Add Pydantic v2 models (UpdateResult, CoverageInfo) for type-safe API - Update processor to use Pydantic types (PairType, TimeframeType, VariantType) - Remove deprecated api.py module (broken functionality) - Implement comprehensive test suite (48 tests, 100% passing): _ test_models.py - Pydantic model validation (13 tests) _ test*types.py - Type safety and helpers (15 tests) * test*processor_pydantic.py - Integration tests (6 tests) * test_functional_regression.py - v2.0.0 regression tests (10 tests) - Fix Standard variant downloads (variant="" not "Standard") - Add true end-to-end testing with real Exness downloads - Test data: EURUSD August 2024 (815K Raw_Spread + 877K Standard ticks) - Update documentation and add refactoring status tracking - Coverage: models.py 100%, **init**.py 100%, processor.py 45% BREAKING CHANGE: api.py removed (use ExnessDataProcessor directly)
|
|
57
|
+
|
|
58
|
+
- **schema**: V1.6.0 - fix session columns to check trading hours BREAKING CHANGE: Exchange session columns now check trading HOURS not just trading DAYS. This requires database regeneration. Package version bumped to 0.4.0. Changes: - Add trading hours to ExchangeConfig (open_hour, open_minute, close_hour, close_minute) - Update session_detector.py to check both trading day + time within hours - Fix timezone handling for naive timestamps (tz_localize) - Update 33 v1.5.0 references across 10 files - Bump package version 0.3.1 → 0.4.0 - Update schema version 1.5.0 → 1.6.0 - All 48 tests passing - Add comprehensive migration guide Details: - Core: exchanges.py, session_detector.py, schema.py - Modules: query_engine.py, database_manager.py, processor.py, api.py, ohlc_generator.py, **init**.py - Docs: README.md, CLAUDE.md, DATABASE_SCHEMA.md, docs/README.md, UNIFIED_DUCKDB_PLAN_v2.md - Examples: basic_usage.py, batch_processing.py - Migration: docs/plans/SCHEMA_v1.6.0_MIGRATION_GUIDE.md
|
|
59
|
+
|
|
60
|
+
- Implement lunch break support using exchange_calendars Replace manual trading hour checks with exchange_calendars.is_open_on_minute() to automatically handle lunch breaks for Asian exchanges. ## Changes ### Core Implementation (session_detector.py) - Replace manual hour/minute comparison with calendar.is_open_on_minute() - Simplifies code from 16 lines to 6 lines - Automatically handles lunch breaks, holidays, and trading hour changes ### Lunch Breaks Now Supported - Tokyo (XTKS): 11:30-12:30 JST - Hong Kong (XHKG): 12:00-13:00 HKT - Singapore (XSES): 12:00-13:00 SGT ### Benefits - Single source of truth for exchange hours (upstream library) - Auto-updates for trading hour changes (e.g., Tokyo extended to 15:30 on Nov 5, 2024) - Simpler, more maintainable code - Zero regressions (all 48 tests pass) ## End-to-End Validation Generated fresh test database (15 months, 450K+ OHLC bars) and verified: - Tokyo lunch (11:30-12:30 JST): 0/61 incorrectly flagged ✅ - Hong Kong lunch (12:00-13:00 HKT): 0/61 incorrectly flagged ✅ - Singapore lunch (12:00-13:00 SGT): 0/61 incorrectly flagged ✅ - Direct database verification: 0 session flags during lunch periods ✅ ## Documentation - Updated DATABASE_SCHEMA.md with lunch break details - Added comprehensive validation results to migration guide - Documented audit findings and resolution ## Breaking Change Databases generated with v1.6.0 before this fix need regeneration to respect lunch breaks. See docs/plans/SCHEMA_v1.6.0_MIGRATION_GUIDE.md. Closes: Asian exchange lunch break detection issue Ref: SCHEMA_v1.6.0_AUDIT_FINDINGS.md
|
|
61
|
+
|
|
62
|
+
### 🐛 Bug Fixes
|
|
63
|
+
|
|
64
|
+
- Resolve 7 critical functionality issues (CLI, versions, schema) Critical Fixes: - Fix **version** in **init**.py (0.1.0 → 0.3.1) - Fix schema version in **init**.py (13-column v1.2.0 → 30-column v1.5.0) - Fix schema version in examples/basic_usage.py (3 occurrences) - Fix schema version in examples/batch_processing.py (1 occurrence) - Create api.py module (267 lines) for CLI backward compatibility - Remove 4 references to non-existent add_schema_comments.py from CLAUDE.md - Update api.py description in CLAUDE.md (legacy → compatibility layer with SLOs) API Module Design: - SLOs: Availability (raise on errors), Correctness (delegate to processor), Observability (logging), Maintainability (thin wrappers) - Functions: process_month(), process_date_range(), query_ohlc(), analyze_ticks(), get_storage_stats() - Architecture: Facade pattern wrapping ExnessDataProcessor - v1.0.0 monthly-file API → v2.0.0 unified single-file API mapping Validation Results: - CLI: Full functionality restored (process, query, analyze, stats commands working) - Tests: 48 passed in 100.88s (zero regressions) - Time to fix: 35 minutes (vs 40-150 estimated) Files Modified: - src/exness_data_preprocess/**init**.py (2 changes) - examples/basic_usage.py (3 changes) - examples/batch_processing.py (1 change) - src/exness_data_preprocess/api.py (NEW, 267 lines) - CLAUDE.md (4 changes) - docs/plans/FUNCTIONALITY_VALIDATION_REPORT_2025-10-15.md (implementation results) Closes all 7 issues from FUNCTIONALITY_VALIDATION_REPORT_2025-10-15.md
|
|
65
|
+
|
|
66
|
+
- **v1.6.0**: Implement minute-level session detection (was checking midnight only) ## Critical Bug Fix **Problem**: Session flags were checked at MIDNIGHT timestamps then applied to all minutes of that day. For Tokyo (9:00-15:00 JST), midnight is NEVER during trading hours, so all session flags were incorrectly 0. **Root Cause** (ohlc_generator.py:151-184): - Line 152-153: Queried DISTINCT DATES (not timestamps) - Line 158: Created midnight timestamps from dates - Line 183: Applied midnight flag to ALL minutes via DATE match **Solution**: 1. Query ALL timestamps from ohlc_1m (not just unique dates) 2. Check session flags for EACH minute individually 3. Update database with exact timestamp match (not DATE match) ## Validation Results ### Tokyo Stock Exchange (XTKS) ✅ Lunch break (11:30-12:29 JST): 0/60 flagged (correct) ✅ Morning session (9:00-11:29 JST): 150/150 flagged (correct) ✅ Afternoon session (12:30-15:00 JST): 150/151 flagged (correct) ### Tokyo Extended Hours (Nov 5, 2024 transition) ✅ Before Nov 5: Closes 14:59 JST (15:00 close time) ✅ After Nov 5: Closes 15:29 JST (15:30 close time) ✅ Extended hours (15:00-15:30): 30/31 minutes flagged ### Test Suite ✅ All 48 tests pass ✅ Zero regressions ## Impact **Breaking Change**: Existing v1.6.0 databases need regeneration. - Previous: Session flags all 0 for Tokyo, Hong Kong, Singapore - Fixed: Session flags now correctly respect trading hours AND lunch breaks ## Implementation Details - **Before**: Date-level detection at midnight (broken for v1.6.0) - **After**: Minute-level detection using exchange_calendars.is_open_on_minute() - **Performance**: Acceptable (30-60s for 450K rows based on research) - **Lunch breaks**: Automatically handled by exchange_calendars - **Trading hour changes**: Automatically handled (e.g., Tokyo Nov 5, 2024) ## Research Backing 5 parallel research agents unanimously recommended this approach: - Option A: Minute-level Python detection ✅ (implemented) - Option B: SQL-based detection ❌ (181+ lines, no holiday support) - Option C: Hybrid approach ✅ (what we're doing) References: - /tmp/test_lunch_simple.py (validation script) - /tmp/test_tokyo_extended_hours.py (extended hours validation) - /tmp/test_tokyo_lunch_boundaries.py (boundary verification)
|
|
67
|
+
|
|
68
|
+
### 💅 Code Style
|
|
69
|
+
|
|
70
|
+
- Apply pre-commit auto-fixes (ruff format, end-of-file)
|
|
71
|
+
|
|
72
|
+
### 📚 Documentation
|
|
73
|
+
|
|
74
|
+
- Update all schema references from 9-column to 13-column (v1.2.0) Update outdated "9-column" or "Phase7 9 columns" references to "13-column (v1.2.0)" across all documentation files to reflect the current schema version with normalized spread metrics. Files updated: - GITHUB_PYPI_SETUP.md - Release notes reference - PYDANTIC_REFACTORING_PLAN.md - API documentation and examples (4 locations) - docs/DATABASE_SCHEMA.md - Version history (2 locations) - docs/README.md - Validation results - docs/UNIFIED_DUCKDB_PLAN_v2.md - Table descriptions and return types (2 locations) - tests/README.md - Test descriptions (2 locations) All outdated schema references now consistently reference the Phase7 13-column (v1.2.0) schema with normalized metrics (range_per_spread, range_per_tick, body_per_spread, body_per_tick). CHANGELOG.md and research/archive files intentionally preserved for historical accuracy.
|
|
75
|
+
|
|
76
|
+
- Fix documentation audit issues (Phase 5 complete, v0.3.1 released) Update planning documents to reflect Phase 5 completion and v0.3.1 release. Update all line counts to actual values after ruff/mypy fixes. Archive completed Pydantic refactoring documents to docs/archive/. **SLO-Correctness-1**: All documentation reflects actual code state **SLO-Correctness-2**: Line counts match wc -l output **SLO-Maintainability-1**: Historical documents archived with version suffix Changes: - RELEASE*NOTES.md: Add proper v0.3.1 release notes (was empty) - REFACTORING_CHECKLIST.md: Mark Phase 5 complete, v0.3.1 released - PHASE7_v1.6.0_REFACTORING_PROGRESS.md: Add Phase 5 details, update metrics - CLAUDE.md: Update all module line counts (414→412, 1146→1124) - Archive PYDANTIC_REFACTORING*_.md → docs/archive/_\_v0.2.0_COMPLETE.md - Add DOCUMENTATION_AUDIT_2025-10-15.md with 15 issues identified/fixed Line Count Corrections (actual vs documented): - processor.py: 414→412 lines - downloader.py: 89→82 lines - database_manager.py: 213→208 lines - gap_detector.py: 163→157 lines - ohlc_generator.py: 210→199 lines - query_engine.py: 283→290 lines Audit Findings: - 7 critical issues resolved (outdated status, wrong line counts, unchecked commits) - 2 high-priority issues resolved (archived Pydantic docs, removed stale dist/) - Documentation now consistent with v0.3.1 release Reference: docs/plans/DOCUMENTATION_AUDIT_2025-10-15.md
|
|
77
|
+
|
|
78
|
+
- Fix documentation audit issues (Phase 5 complete, v0.3.1 released) - Fix RELEASE*NOTES.md with complete v0.3.1 release notes - Update REFACTORING_CHECKLIST.md to Phase 5 complete status - Update PHASE7_v1.6.0_REFACTORING_PROGRESS.md with Phase 5 details - Update all line count references in CLAUDE.md to actual values - Archive PYDANTIC_REFACTORING*\*.md files to docs/archive/ with v0.2.0 suffix - Remove stale dist/ directory (v0.1.0 artifacts) - Create comprehensive audit report at docs/plans/DOCUMENTATION_AUDIT_2025-10-15.md Line count corrections (post-ruff/mypy): - processor.py: 414→412 (-2) - downloader.py: 89→82 (-7) - database_manager.py: 213→208 (-5) - gap_detector.py: 163→157 (-6) - ohlc_generator.py: 210→199 (-11) - query_engine.py: 283→290 (+7) - Total extracted: 1,146→1,124 (-22) Fixes 7 critical issues from documentation audit report.
|
|
79
|
+
|
|
80
|
+
- Fix documentation audit pass 2 issues (line counts and status) - Fix docs/README.md line counts to actual values (412, 82, 208, 157, 199, 290) - Update docs/README.md total extracted lines (1,146 → 1,124) - Update docs/README.md status to Phase 5 Complete (v0.3.1 released) - Update SESSION_2025-10-15_SUMMARY.md with Phase 5 completion details - Add Phase 2-5 completion summary to SESSION_2025-10-15_SUMMARY.md - Update all module statuses from TODO to COMPLETE - Update all phase checkboxes from [ ] to [x] - Update statistics to reflect all phases (6.5 hours, 7 modules, 1,124 lines) - Create DOCUMENTATION_AUDIT_PASS2_2025-10-15.md with 4 issues found Line count corrections (post-ruff/mypy): - processor.py: 414→412 (-2) - downloader.py: 89→82 (-7) - database_manager.py: 213→208 (-5) - gap_detector.py: 163→157 (-6) - ohlc_generator.py: 210→199 (-11) - query_engine.py: 283→290 (+7) - Total extracted: 1,146→1,124 (-22) Fixes 3 of 4 issues from documentation audit pass 2. CHANGELOG.md not edited (auto-generated file).
|
|
81
|
+
|
|
82
|
+
- Remove line count references, add introspection commands Replace volatile line count metrics with stable architecture patterns across all user-facing documentation. Add Makefile with introspection commands for on-demand module statistics. Changes: - Remove 9 line count references from CLAUDE.md - Remove 8 line count references from docs/README.md - Remove 8 line count references from RELEASE_NOTES.md - Remove 8 line count references from CHANGELOG.md - Add Makefile with module-stats, module-complexity, module-deps commands - Add best practices guide: DOCUMENTATION_BEST_PRACTICES_LINE_COUNTS.md - Add validation report: FUNCTIONALITY_VALIDATION_REPORT_2025-10-16.md Rationale: Line counts become stale with formatting, comments, and refactoring. Architecture patterns (facade, thin wrapper) remain stable. Industry research shows 78% of teams struggle with outdated documentation. Implementation adheres to: - Abstractions Over Details principle - Intent Over Implementation principle - SLOs: Availability (raise on errors), Correctness (all counts removed), Observability (audit trail), Maintainability (off-the-shelf tools) Time investment: 65 minutes Annual maintenance saved: ~160 minutes Payback period: 5 months
|
|
83
|
+
|
|
84
|
+
- **CLAUDE.md**: Reorganize as hub-and-spoke with progressive disclosure Restructure CLAUDE.md from 479-line monolithic file to 130-line hub document following Link Farm + Hub-and-Spoke pattern. Eliminate redundant content and establish single source of truth per topic. Changes: - Reduce size 73% (479 lines → 130 lines) - Move Documentation Hub to top (was line 227, now line 11) - Remove detailed implementation (now in docs/README.md) - Remove database schema details (in docs/DATABASE_SCHEMA.md) - Remove research findings (in docs/research/) - Remove absolute file paths (use relative paths) - Add audit report: CLAUDE_MD_AUDIT_2025-10-16.md Organization: - Level 0 (CLAUDE.md): Essentials + hub links - Level 1 (docs/README.md): Architecture overview - Level 2+ (specialized docs): Complete specifications Compliance: - Hub-and-spoke: Hub at top, all major docs linked - Progressive disclosure: Summary → link to details - Single source of truth: No duplicate content - Abstractions over details: Patterns not implementations Validation: - All 10 links verified to exist - Zero redundant content - Zero absolute paths - Zero promotional language Maintenance benefit: Architecture updates now require changes to only one source document (not CLAUDE.md + multiple other docs).
|
|
85
|
+
|
|
86
|
+
- **CLAUDE.md**: Reorganize as hub-and-spoke with verified content migration **Approach**: Verification-first reorganization (create docs BEFORE removing content) **Changes**: - CLAUDE.md: 479 → 159 lines (67% reduction) - Hub positioned at line 11 (was line 227, 96% earlier) - Progressive disclosure: essentials + links to deeper docs - No absolute paths or line numbers (use Makefile introspection) **New Documentation**: - docs/MODULE_ARCHITECTURE.md - Complete module details with SLOs, class names, method signatures (all 7 modules) - docs/plans/CLAUDE_MD_VERIFICATION_CHECKLIST_2025-10-16.md - Systematic verification plan - docs/plans/CLAUDE_MD_VERIFICATION_FINDINGS_2025-10-16.md - Verification results and recommendations **Verification Results**: - ✅ Database schema: EXISTS in docs/DATABASE_SCHEMA.md - ✅ Data sources: EXISTS in docs/EXNESS_DATA_SOURCES.md - ✅ File locations: EXISTS in README.md - ✅ Migration guide: EXISTS in README.md - ❌ Module SLOs: CREATED in docs/MODULE_ARCHITECTURE.md (was only in CLAUDE.md) **Single Source of Truth**: | Topic | Authoritative Document | |-------|----------------------| | Module architecture | docs/MODULE_ARCHITECTURE.md | | Database schema | docs/DATABASE_SCHEMA.md | | Data sources | docs/EXNESS_DATA_SOURCES.md | | API reference | README.md | | File locations | README.md | | Migration guide | README.md | **Lesson Learned**: Always verify content exists elsewhere BEFORE removing from CLAUDE.md
|
|
87
|
+
|
|
88
|
+
- Remove promotional language (audit pass 2) **Audit Scope**: CLAUDE.md + docs/README.md **Pattern**: Link Farm + Hub-and-Spoke with Progressive Disclosure **Finding**: 2 instances of promotional language **Changes**: 1. CLAUDE.md:5 - "Professional forex..." → "Forex..." (remove promotional) 2. docs/README.md:175 - "production-ready" → "validated with 13 months real data" (factual) 3. docs/README.md:221 - Update "Last Updated" to 2025-10-16 **Audit Report**: docs/plans/CLAUDE_MD_AUDIT_2025-10-16_PASS2.md **Pattern Compliance**: - ✅ Hub-and-spoke (hub at line 11 in CLAUDE.md) - ✅ Progressive disclosure (3 levels: essentials → overview → detailed specs) - ✅ Single source of truth (all topics link to authoritative docs) - ✅ No promotional language (2 instances fixed) - ✅ No absolute paths - ✅ Version tracking **Metrics**: - CLAUDE.md: 159 lines (67% reduction from 479) - Hub position: Line 11 (was 227, 96% earlier) - Single source violations: 0
|
|
89
|
+
|
|
90
|
+
- **research**: Add comprehensive trading hours research backing v1.6.0 Add two research documents providing detailed backing for the v1.6.0 architectural decisions: 1. TRADING_HOURS_RESEARCH.md (49K, 1620 lines) - Industry standards (exchange_calendars, pandas_market_calendars, zipline, backtrader, QuantConnect) - Professional data platforms (TradingHours.com, Bloomberg, Reuters) - Scalability patterns (DuckDB, ClickHouse, Arctic, InfluxDB, QuestDB) - Edge cases (DST transitions, historical hour changes, forex specifics) - Architectural patterns (separation of concerns, query-time vs storage) - Recommended implementation with code examples 2. HYBRID_SESSION_DETECTION_ANALYSIS.md (34K, 858 lines) - Architectural analysis of hybrid approach (Option C) - Why holidays can stay date-level (O(1) set lookups) - Why sessions must be minute-level (trading hours, lunch breaks, DST) - DuckDB bulk UPDATE strategies and performance - Optimization techniques for large-scale data enrichment - Comparison to pure SQL and pure Python approaches - Final recommendation: hybrid approach already optimal in v1.6.0 Research findings: - Industry consensus: calendar abstraction + query-time filtering - 5 parallel agents unanimous: minute-level Python detection - Performance: 30-60s for 1 year (400K OHLC bars) is acceptable - Current v1.6.0 implementation uses recommended best practices These documents provide valuable reference for future development and justify the architectural choices made in the v1.6.0 session detection implementation.
|
|
91
|
+
|
|
92
|
+
- **migration**: Fix formatting of midnight bug section
|
|
93
|
+
|
|
94
|
+
- Add v1.6.0 E2E validation results with real Exness data Add comprehensive validation documentation for v1.6.0 schema with 10 global exchange session flags, tested against 355,970 bars of real EURUSD data (12 months, 1.92 GB). Validation Results: - ✅ Tokyo lunch breaks: 100% accuracy (0/59 lunch, 150/150 morning, 151/151 afternoon) - ✅ Holidays: US, UK, major holidays correctly detected - ✅ DST transitions: US DST shift verified (13:30→14:30 UTC) - ✅ Weekend gaps: 48-hour gap, NZ first to open Monday - ✅ Tokyo extended hours: Nov 5 transition (15:00→15:30) detected - ✅ Multi-exchange overlaps: 5 concurrent exchanges, London-NY 120min overlap Architecture Validation: - exchange_calendars.is_open_on_minute() handles all edge cases automatically - Lunch breaks (Tokyo, HK, Singapore) correctly excluded - Schedule changes (Tokyo Nov 5) require zero code modifications - Concurrent flags work correctly (not mutually exclusive) - Ready for production use with v0.4.0 Files: - docs/validation/E2E_VALIDATION_RESULTS_v1.6.0.md (11K) - docs/validation/WEEKEND_GAP_VALIDATION_SUMMARY.md (4K) - docs/validation/WORKSPACE_SURVEY_2025-10-17.md (8K)
|
|
95
|
+
|
|
96
|
+
### 📝 Other Changes
|
|
97
|
+
|
|
98
|
+
- Revert "docs(CLAUDE.md): reorganize as hub-and-spoke with progressive disclosure" This reverts commit 6d0aa9a61c5d6a60bb3238aa7b8a018adf3f2796.
|
|
99
|
+
|
|
100
|
+
### 🔧 Continuous Integration
|
|
101
|
+
|
|
102
|
+
- Modernize publish workflow with uv and validation pipeline Update GitHub Actions publish workflow to match gapless-crypto-data standards: Build System: - Replace pip+build with uv for consistency with local development - Add UV_SYSTEM_PYTHON=1 environment variable - Use uv sync --dev for dependency installation Validation Pipeline: - Add file encoding validation (UTF-8/ASCII enforcement) - Add ruff linting and format checking - Add pytest test suite execution before build Security: - Add Sigstore artifact signing for published packages - Maintain PyPI Trusted Publishing (OIDC) authentication Configuration: - Change environment name: release → pypi (semantic clarity) - Change artifact name: dist → python-package-distributions (consistency) - Add verbose output to PyPI publish step Security Note: - Added .token-info.md to .gitignore to prevent accidental token documentation commits - Workflow uses OIDC (no API token needed)
|
|
103
|
+
|
|
104
|
+
### 🧰 Maintenance
|
|
105
|
+
|
|
106
|
+
- **release**: Bump version 0.1.0 → 0.2.0 [skip ci]
|
|
107
|
+
|
|
108
|
+
- **release**: Bump version 0.2.0 → 0.3.0 [skip ci]
|
|
109
|
+
|
|
110
|
+
- **release**: Bump version 0.3.0 → 0.3.1 [skip ci]
|
|
111
|
+
|
|
112
|
+
- Sync commitizen version to 0.4.0
|
|
113
|
+
|
|
114
|
+
### ✨ Features
|
|
115
|
+
|
|
116
|
+
- Initial commit with v2.0.0 unified DuckDB architecture - Unified single-file DuckDB storage per instrument (eurusd.duckdb) - Phase7 9-column OHLC schema with dual-variant spreads - Sub-15ms query performance with date range filtering - PRIMARY KEY constraints prevent duplicates - Automatic gap detection for incremental updates - DuckDB self-documentation with COMMENT ON statements - GitHub Actions CI/CD with PyPI Trusted Publishing - Pre-commit hooks (ruff, commitizen, basic checks) - Professional README with shields.io badges
|
|
117
|
+
|
|
118
|
+
### 🐛 Bug Fixes
|
|
119
|
+
|
|
120
|
+
- Force add .pre-commit-config.yaml (was incorrectly gitignored)
|
|
121
|
+
|
|
122
|
+
- Remove .pre-commit-config.yaml from .gitignore Pre-commit config should be version controlled, not ignored.
|
|
123
|
+
|
|
124
|
+
- **pre-commit**: Enable unsafe fixes for ruff to resolve remaining errors
|
|
125
|
+
|
|
126
|
+
- **research**: Resolve remaining linting errors in research scripts - Fix bare except clause in 02_volatility_model_simple.py (E722) - Move math.erf imports to top in 03_liquidity_crisis_detection.py (E402) - Move math.erf imports to top in 04_regime_detection_analysis.py (E402)
|
|
127
|
+
|
|
128
|
+
### 💅 Code Style
|
|
129
|
+
|
|
130
|
+
- Apply pre-commit formatting fixes - Fix end-of-file newlines in 2 MD files - Apply ruff quote style fixes (200 errors fixed) - Reformat 26 files with ruff-format
|
|
131
|
+
|
|
132
|
+
### 🔧 CI/CD Improvements
|
|
133
|
+
|
|
134
|
+
- **ci**: Add pre-commit config and basic tests - Add .pre-commit-config.yaml to repository - Create basic test suite (test_basic.py) for CI - Add GITHUB_PYPI_SETUP.md with complete setup instructions Fixes CI failures: - Pre-commit hook now finds config file - Pytest now finds and runs tests successfully
|
|
135
|
+
|
|
136
|
+
### 🧰 Maintenance
|
|
137
|
+
|
|
138
|
+
- Prepare v0.1.0 release
|
|
@@ -11,11 +11,13 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
11
11
|
## Documentation Hub
|
|
12
12
|
|
|
13
13
|
### User Documentation
|
|
14
|
+
|
|
14
15
|
- **[README.md](README.md)** - Installation, API reference, usage examples
|
|
15
16
|
- **[examples/basic_usage.py](examples/basic_usage.py)** - Download, query, coverage operations
|
|
16
17
|
- **[examples/batch_processing.py](examples/batch_processing.py)** - Multi-instrument parallel processing
|
|
17
18
|
|
|
18
19
|
### AI Assistant Documentation
|
|
20
|
+
|
|
19
21
|
- **[docs/README.md](docs/README.md)** - Architecture, planning, research findings
|
|
20
22
|
- **[docs/MODULE_ARCHITECTURE.md](docs/MODULE_ARCHITECTURE.md)** - Complete module documentation with SLOs (v1.7.0)
|
|
21
23
|
- **[docs/DATABASE_SCHEMA.md](docs/DATABASE_SCHEMA.md)** - Complete database schema with self-documentation
|
|
@@ -25,12 +27,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
25
27
|
- **[Makefile](Makefile)** - Module introspection commands (module-stats, module-complexity, module-deps)
|
|
26
28
|
|
|
27
29
|
### Optimization Plans (v1.7.0)
|
|
30
|
+
|
|
28
31
|
- **[docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml](docs/PHASE2_SESSION_VECTORIZATION_PLAN.yaml)** - SSoT plan v2.0.0 (2.2x speedup)
|
|
29
32
|
- **[docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml](docs/PHASE3_SQL_GAP_DETECTION_PLAN.yaml)** - SSoT plan v2.0.0 (complete coverage)
|
|
30
33
|
- **[docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md](docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md)** - Phase 1 validation
|
|
31
34
|
- **[docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md](docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md)** - Phase 2 validation
|
|
32
35
|
|
|
33
36
|
### Implementation
|
|
37
|
+
|
|
34
38
|
- **src/exness_data_preprocess/** - Source code (7 specialized modules + facade)
|
|
35
39
|
- **tests/** - Test suite (48 tests, 100% passing)
|
|
36
40
|
- **[CONTRIBUTING.md](CONTRIBUTING.md)** - Contribution guidelines
|
|
@@ -40,6 +44,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
40
44
|
## Architecture Summary
|
|
41
45
|
|
|
42
46
|
### Storage Pattern (v2.0.0)
|
|
47
|
+
|
|
43
48
|
- **Single DuckDB file per instrument** (e.g., eurusd.duckdb containing all historical data)
|
|
44
49
|
- **Dual-variant storage** (Raw_Spread + Standard in same database)
|
|
45
50
|
- **Incremental updates** with automatic gap detection
|
|
@@ -50,6 +55,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
50
55
|
**Complete Specification**: [`docs/UNIFIED_DUCKDB_PLAN_v2.md`](docs/UNIFIED_DUCKDB_PLAN_v2.md)
|
|
51
56
|
|
|
52
57
|
### Module Pattern (v1.7.0)
|
|
58
|
+
|
|
53
59
|
- **Facade orchestrator** (processor.py) coordinating 7 specialized modules
|
|
54
60
|
- **Separation of concerns** with single-responsibility modules
|
|
55
61
|
- **SLO-based design** (Availability, Correctness, Observability, Maintainability)
|
|
@@ -57,6 +63,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
57
63
|
- **Zero regressions** (48 tests pass)
|
|
58
64
|
|
|
59
65
|
**Modules**:
|
|
66
|
+
|
|
60
67
|
1. **processor.py** - Thin orchestrator facade
|
|
61
68
|
2. **downloader.py** - HTTP download operations
|
|
62
69
|
3. **tick_loader.py** - CSV parsing
|
|
@@ -69,6 +76,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
69
76
|
**Complete Details**: [`docs/MODULE_ARCHITECTURE.md`](docs/MODULE_ARCHITECTURE.md)
|
|
70
77
|
|
|
71
78
|
### Performance Optimizations (v1.7.0)
|
|
79
|
+
|
|
72
80
|
- **Incremental OHLC Generation** (Phase 1): 7.3x speedup
|
|
73
81
|
- Optional date-range filtering for regeneration
|
|
74
82
|
- Measured: 8.05s → 1.10s for incremental updates (7 months)
|
|
@@ -90,6 +98,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
90
98
|
**Pattern**: Spike test first (validate theory) → Implement → Iterative SSoT plan updates
|
|
91
99
|
|
|
92
100
|
### Schema (v1.6.0)
|
|
101
|
+
|
|
93
102
|
- **Phase7 30-column OHLC** with dual-variant spreads
|
|
94
103
|
- **BID-only OHLC** from Raw_Spread execution prices
|
|
95
104
|
- **Normalized metrics** (range_per_spread, range_per_tick, body_per_spread, body_per_tick)
|
|
@@ -100,6 +109,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
100
109
|
**Complete Schema**: [`docs/DATABASE_SCHEMA.md`](docs/DATABASE_SCHEMA.md)
|
|
101
110
|
|
|
102
111
|
### Data Sources
|
|
112
|
+
|
|
103
113
|
- **Source**: https://ticks.ex2archive.com/ (public Exness tick data)
|
|
104
114
|
- **Primary**: Raw_Spread variant (97.81% zero-spreads, execution prices)
|
|
105
115
|
- **Reference**: Standard variant (0% zero-spreads, market quotes)
|
|
@@ -108,6 +118,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
108
118
|
**Complete Guide**: [`docs/EXNESS_DATA_SOURCES.md`](docs/EXNESS_DATA_SOURCES.md)
|
|
109
119
|
|
|
110
120
|
### Research Patterns (v1.0.0)
|
|
121
|
+
|
|
111
122
|
- **Lifecycle**: Explore (pandas/Polars) → Validate → Graduate (DuckDB) → Query (SQL)
|
|
112
123
|
- **ASOF Performance**: pandas/Polars 0.04s, DuckDB 0.89s at 880K ticks (24x difference)
|
|
113
124
|
- **Tool Selection**: pandas/Polars for tick-level temporal matching, DuckDB for materialized results
|
|
@@ -121,6 +132,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
121
132
|
## Development Commands
|
|
122
133
|
|
|
123
134
|
### Setup
|
|
135
|
+
|
|
124
136
|
```bash
|
|
125
137
|
# Install with development dependencies
|
|
126
138
|
uv sync --dev
|
|
@@ -130,6 +142,7 @@ pip install -e ".[dev]"
|
|
|
130
142
|
```
|
|
131
143
|
|
|
132
144
|
### Testing
|
|
145
|
+
|
|
133
146
|
```bash
|
|
134
147
|
# Run all tests
|
|
135
148
|
uv run pytest
|
|
@@ -142,6 +155,7 @@ uv run pytest tests/test_basic.py -v
|
|
|
142
155
|
```
|
|
143
156
|
|
|
144
157
|
### Code Quality
|
|
158
|
+
|
|
145
159
|
```bash
|
|
146
160
|
# Format code
|
|
147
161
|
uv run ruff format .
|
|
@@ -154,6 +168,7 @@ uv run mypy src/
|
|
|
154
168
|
```
|
|
155
169
|
|
|
156
170
|
### Module Introspection
|
|
171
|
+
|
|
157
172
|
```bash
|
|
158
173
|
# Show current line counts (always accurate)
|
|
159
174
|
make module-stats
|
|
@@ -166,6 +181,7 @@ make module-deps
|
|
|
166
181
|
```
|
|
167
182
|
|
|
168
183
|
### Building and Publishing
|
|
184
|
+
|
|
169
185
|
```bash
|
|
170
186
|
# Build package
|
|
171
187
|
uv build
|
|
@@ -87,6 +87,7 @@ When reporting issues, please include:
|
|
|
87
87
|
### Submitting Pull Requests
|
|
88
88
|
|
|
89
89
|
1. **Fork the repository** and create a new branch:
|
|
90
|
+
|
|
90
91
|
```bash
|
|
91
92
|
git checkout -b feature/your-feature-name
|
|
92
93
|
```
|
|
@@ -98,6 +99,7 @@ When reporting issues, please include:
|
|
|
98
99
|
4. **Update documentation** if needed (README.md, docstrings)
|
|
99
100
|
|
|
100
101
|
5. **Run all quality checks**:
|
|
102
|
+
|
|
101
103
|
```bash
|
|
102
104
|
uv run ruff format .
|
|
103
105
|
uv run ruff check --fix .
|
|
@@ -106,6 +108,7 @@ When reporting issues, please include:
|
|
|
106
108
|
```
|
|
107
109
|
|
|
108
110
|
6. **Commit your changes** with clear messages:
|
|
111
|
+
|
|
109
112
|
```bash
|
|
110
113
|
git commit -m "feat: add support for custom compression levels"
|
|
111
114
|
```
|
|
@@ -128,6 +131,7 @@ We follow conventional commit format:
|
|
|
128
131
|
- `chore:` Build process or tooling changes
|
|
129
132
|
|
|
130
133
|
Examples:
|
|
134
|
+
|
|
131
135
|
```
|
|
132
136
|
feat: add support for multiple currency pairs
|
|
133
137
|
fix: handle timezone conversion edge case
|
|
@@ -167,6 +171,7 @@ When adding new features:
|
|
|
167
171
|
5. **Add docstrings** following Google style
|
|
168
172
|
|
|
169
173
|
Example docstring:
|
|
174
|
+
|
|
170
175
|
```python
|
|
171
176
|
def my_function(param1: int, param2: str) -> bool:
|
|
172
177
|
"""
|
|
@@ -215,6 +220,7 @@ def test_feature_name(fixture1, fixture2):
|
|
|
215
220
|
### Integration Tests
|
|
216
221
|
|
|
217
222
|
Mark integration tests (requiring network access) with:
|
|
223
|
+
|
|
218
224
|
```python
|
|
219
225
|
@pytest.mark.integration
|
|
220
226
|
def test_download_real_data():
|
|
@@ -263,6 +269,7 @@ def process_data(data: pd.DataFrame, compression: str = "zstd") -> Path:
|
|
|
263
269
|
### README Updates
|
|
264
270
|
|
|
265
271
|
When adding features:
|
|
272
|
+
|
|
266
273
|
- Add usage examples
|
|
267
274
|
- Update feature list
|
|
268
275
|
- Document any breaking changes
|
|
@@ -21,17 +21,20 @@ New to this project? Start here:
|
|
|
21
21
|
Follow this path if you're new to the project:
|
|
22
22
|
|
|
23
23
|
### 1. Getting Started
|
|
24
|
+
|
|
24
25
|
- **[README.md](README.md)** - Main documentation with installation and API reference
|
|
25
26
|
- **[Basic Usage Examples](examples/basic_usage.py)** - 6 practical code examples you can run immediately
|
|
26
27
|
- **[Contributing Guide](CONTRIBUTING.md)** - Development setup, code quality, testing
|
|
27
28
|
|
|
28
29
|
### 2. Understanding the Data
|
|
30
|
+
|
|
29
31
|
- **[Exness Data Sources](docs/EXNESS_DATA_SOURCES.md)** - Raw_Spread vs Standard variants, data quality characteristics
|
|
30
32
|
- Learn about 97.81% zero-spreads in Raw_Spread (execution prices)
|
|
31
33
|
- Understand tick density and storage estimates
|
|
32
34
|
- See CSV format and download patterns
|
|
33
35
|
|
|
34
36
|
### 3. First Queries
|
|
37
|
+
|
|
35
38
|
- **[Database Schema](docs/DATABASE_SCHEMA.md)** - Phase7 30-column OHLC structure
|
|
36
39
|
- 4 tables: raw_spread_ticks, standard_ticks, ohlc_1m, metadata
|
|
37
40
|
- SQL query examples and performance benchmarks
|
|
@@ -46,18 +49,21 @@ Follow this path if you're new to the project:
|
|
|
46
49
|
Ready for multi-instrument processing and advanced queries:
|
|
47
50
|
|
|
48
51
|
### 4. Advanced Workflows
|
|
52
|
+
|
|
49
53
|
- **[Batch Processing Examples](examples/batch_processing.py)** - Multi-instrument parallel processing
|
|
50
54
|
- Sequential and parallel processing patterns
|
|
51
55
|
- Error handling and retry logic
|
|
52
56
|
- Progress monitoring with tqdm
|
|
53
57
|
|
|
54
58
|
### 5. Research Methodology
|
|
59
|
+
|
|
55
60
|
- **[Research Patterns](docs/RESEARCH_PATTERNS.md)** - pandas/Polars vs DuckDB tool selection
|
|
56
61
|
- Research lifecycle: Explore → Validate → Graduate → Query
|
|
57
62
|
- Hybrid materialization pattern
|
|
58
63
|
- Performance benchmarks (ASOF joins: pandas 0.04s vs DuckDB 0.89s)
|
|
59
64
|
|
|
60
65
|
### 6. Schema Deep Dive
|
|
66
|
+
|
|
61
67
|
- **[Schema v1.6.0 Migration Guide](docs/plans/SCHEMA_v1.6.0_MIGRATION_GUIDE.md)** - Breaking changes from v1.5.0
|
|
62
68
|
- 19 → 30 columns (added 10 exchange sessions + 1 major holiday flag)
|
|
63
69
|
- Midnight detection bug fix (critical for session flags)
|
|
@@ -72,7 +78,8 @@ Ready for multi-instrument processing and advanced queries:
|
|
|
72
78
|
For contributors and researchers who need deep understanding:
|
|
73
79
|
|
|
74
80
|
### 7. System Architecture
|
|
75
|
-
|
|
81
|
+
|
|
82
|
+
- **[Module Architecture](docs/MODULE_ARCHITECTURE.md)** ⭐ _v1.3.1 - Verified Accurate_
|
|
76
83
|
- Facade pattern with 6 module instances + 1 static utility
|
|
77
84
|
- SLO-based design (Availability, Correctness, Observability, Maintainability)
|
|
78
85
|
- Complete data flow with 3 Mermaid diagrams
|
|
@@ -84,6 +91,7 @@ For contributors and researchers who need deep understanding:
|
|
|
84
91
|
- PRIMARY KEY prevents duplicates
|
|
85
92
|
|
|
86
93
|
### 8. Trading Hours Implementation
|
|
94
|
+
|
|
87
95
|
- **[Trading Hours Research](docs/TRADING_HOURS_RESEARCH.md)** - Industry analysis (49KB comprehensive)
|
|
88
96
|
- 5 quant finance libraries studied
|
|
89
97
|
- 3 professional platforms analyzed
|
|
@@ -96,7 +104,8 @@ For contributors and researchers who need deep understanding:
|
|
|
96
104
|
- Bulk UPDATE strategies
|
|
97
105
|
|
|
98
106
|
### 9. Validation & Quality Assurance
|
|
99
|
-
|
|
107
|
+
|
|
108
|
+
- **[E2E Validation Results v1.6.0](docs/validation/E2E_VALIDATION_RESULTS_v1.6.0.md)** ⭐ _100% Accuracy_
|
|
100
109
|
- 355,970 bars of real EURUSD data (12 months, 1.92 GB)
|
|
101
110
|
- Tokyo lunch breaks: 0/59 lunch, 150/150 morning, 151/151 afternoon
|
|
102
111
|
- Holidays, DST, weekend gaps, exchange overlaps all verified
|
|
@@ -111,7 +120,8 @@ For contributors and researchers who need deep understanding:
|
|
|
111
120
|
- HTTP library, type signatures, data flow corrected
|
|
112
121
|
|
|
113
122
|
### 10. Performance Optimizations (v0.5.0)
|
|
114
|
-
|
|
123
|
+
|
|
124
|
+
- **[Phase 1 Spike Test Results](docs/validation/SPIKE_TEST_RESULTS_PHASE1_2025-10-18.md)** ⭐ _7.3x Speedup_
|
|
115
125
|
- Incremental OHLC generation: 8.05s → 1.10s for updates
|
|
116
126
|
- 303K bars regeneration vs 43K incremental update
|
|
117
127
|
- Measured: 86.3% time reduction
|
|
@@ -121,7 +131,7 @@ For contributors and researchers who need deep understanding:
|
|
|
121
131
|
- Version tracking: v1.0.0 (initial) → v2.0.0 (completed)
|
|
122
132
|
- Implementation discoveries and nuances documented
|
|
123
133
|
|
|
124
|
-
- **[Phase 2 Spike Test Results](docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md)** ⭐
|
|
134
|
+
- **[Phase 2 Spike Test Results](docs/validation/SPIKE_TEST_RESULTS_PHASE2_2025-10-18.md)** ⭐ _2.2x Speedup_
|
|
125
135
|
- Vectorized session detection: 5.99s → 2.69s for 302K bars
|
|
126
136
|
- 10 global exchange sessions processed in parallel
|
|
127
137
|
- Combined Phase 1+2: ~16x total speedup (8.05s → 0.50s)
|
|
@@ -142,6 +152,7 @@ For contributors and researchers who need deep understanding:
|
|
|
142
152
|
Published research with reproduction guides:
|
|
143
153
|
|
|
144
154
|
### Zero-Spread Deviation Analysis
|
|
155
|
+
|
|
145
156
|
- **[Project Overview](docs/research/eurusd-zero-spread-deviations/README.md)** - 16-month validation study
|
|
146
157
|
- **[Methodology](docs/research/eurusd-zero-spread-deviations/01-methodology.md)** - Research approach
|
|
147
158
|
- **[Baseline Analysis](docs/research/eurusd-zero-spread-deviations/02-baseline-sep2024.md)** - September 2024 baseline
|
|
@@ -150,6 +161,7 @@ Published research with reproduction guides:
|
|
|
150
161
|
- **[Reproduction Guide](docs/research/eurusd-zero-spread-deviations/scripts/reproduction_guide.md)** - How to reproduce results
|
|
151
162
|
|
|
152
163
|
### Spread Variant Analysis
|
|
164
|
+
|
|
153
165
|
- **[Project Overview](docs/research/eurusd-spread-analysis/README.md)** - Modal-band-excluded variance estimation
|
|
154
166
|
- **[Methodology](docs/research/eurusd-spread-analysis/01-methodology.md)** - Research design
|
|
155
167
|
- **[Mode-Truncated Analysis](docs/research/eurusd-spread-analysis/02-mode-truncated-analysis.md)** - Truncation approach
|
|
@@ -159,6 +171,7 @@ Published research with reproduction guides:
|
|
|
159
171
|
- **[Reproduction Guide](docs/research/eurusd-spread-analysis/scripts/reproduction_guide.md)** - How to reproduce
|
|
160
172
|
|
|
161
173
|
### Compression Benchmarks
|
|
174
|
+
|
|
162
175
|
- **[Compression Study](docs/research/compression-benchmarks/README.md)** - Why Parquet + Zstd-22
|
|
163
176
|
|
|
164
177
|
---
|
|
@@ -168,16 +181,19 @@ Published research with reproduction guides:
|
|
|
168
181
|
Quick lookups and specific information:
|
|
169
182
|
|
|
170
183
|
### API & Schema
|
|
184
|
+
|
|
171
185
|
- **[README.md](README.md)** - Complete API reference with examples
|
|
172
186
|
- **[Database Schema](docs/DATABASE_SCHEMA.md)** - 30-column Phase7 OHLC specification
|
|
173
187
|
- **[CLAUDE.md](CLAUDE.md)** - AI assistant quick reference (architecture summary)
|
|
174
188
|
|
|
175
189
|
### Version History
|
|
190
|
+
|
|
176
191
|
- **[CHANGELOG.md](CHANGELOG.md)** - Version history (Keep a Changelog format)
|
|
177
192
|
- **[RELEASE_NOTES.md](RELEASE_NOTES.md)** - Human-readable release notes
|
|
178
193
|
- **[AUTHORS.md](AUTHORS.md)** - Project contributors
|
|
179
194
|
|
|
180
195
|
### Testing
|
|
196
|
+
|
|
181
197
|
- **[Test Suite Documentation](tests/README.md)** - 48 tests, coverage reports
|
|
182
198
|
- **[Makefile](Makefile)** - Build commands (`make test`, `make module-stats`, etc.)
|
|
183
199
|
|
|
@@ -188,16 +204,19 @@ Quick lookups and specific information:
|
|
|
188
204
|
Internal documentation for contributors:
|
|
189
205
|
|
|
190
206
|
### Current Plans
|
|
207
|
+
|
|
191
208
|
- **[Documentation Hub](docs/README.md)** - Hub-and-spoke architecture with progressive disclosure
|
|
192
209
|
- **[Implementation Plan](docs/implementation-plan.yaml)** - Machine-readable implementation plan with SLOs
|
|
193
210
|
- **[Planning Index](docs/planning-index.yaml)** - Index of all planning documents
|
|
194
211
|
|
|
195
212
|
### Migration & Refactoring
|
|
213
|
+
|
|
196
214
|
- **[Schema v1.6.0 Migration Guide](docs/plans/SCHEMA_v1.6.0_MIGRATION_GUIDE.md)** - v1.5.0 → v1.6.0 breaking changes
|
|
197
215
|
- **[Phase7 v1.6.0 Progress](docs/plans/PHASE7_v1.6.0_REFACTORING_PROGRESS.md)** - Refactoring progress tracking
|
|
198
216
|
- **[Refactoring Checklist](docs/plans/REFACTORING_CHECKLIST.md)** - Comprehensive checklist
|
|
199
217
|
|
|
200
218
|
### Quality Audits
|
|
219
|
+
|
|
201
220
|
- **[Workspace Survey](docs/validation/WORKSPACE_SURVEY_2025-10-17.md)** - Organization assessment (2025-10-17)
|
|
202
221
|
- **[Architecture Audit](docs/validation/ARCHITECTURE_AUDIT_2025-10-17.md)** - Documentation accuracy (2025-10-17)
|
|
203
222
|
- **[Functionality Validation](docs/plans/FUNCTIONALITY_VALIDATION_REPORT_2025-10-16.md)** - Feature testing (2025-10-16)
|
|
@@ -228,6 +247,7 @@ DOCUMENTATION.md (You are here - Hub)
|
|
|
228
247
|
```
|
|
229
248
|
|
|
230
249
|
**Navigation Tips**:
|
|
250
|
+
|
|
231
251
|
- 🎯 = Start here if you're new
|
|
232
252
|
- ⭐ = Critical documentation (verified accurate)
|
|
233
253
|
- All links use relative URLs from project root
|
|
@@ -238,21 +258,27 @@ DOCUMENTATION.md (You are here - Hub)
|
|
|
238
258
|
## 🤔 Which Documentation Should I Read?
|
|
239
259
|
|
|
240
260
|
### "I just want to download forex data and analyze it"
|
|
261
|
+
|
|
241
262
|
→ [README.md](README.md) → [Basic Usage Examples](examples/basic_usage.py)
|
|
242
263
|
|
|
243
264
|
### "I need to process multiple currency pairs efficiently"
|
|
265
|
+
|
|
244
266
|
→ [Batch Processing Examples](examples/batch_processing.py)
|
|
245
267
|
|
|
246
268
|
### "I want to write SQL queries against tick data"
|
|
269
|
+
|
|
247
270
|
→ [Database Schema](docs/DATABASE_SCHEMA.md)
|
|
248
271
|
|
|
249
272
|
### "I'm doing quantitative research with temporal analysis"
|
|
273
|
+
|
|
250
274
|
→ [Research Patterns](docs/RESEARCH_PATTERNS.md) → [Database Schema](docs/DATABASE_SCHEMA.md)
|
|
251
275
|
|
|
252
276
|
### "I want to contribute code to this project"
|
|
277
|
+
|
|
253
278
|
→ [Module Architecture](docs/MODULE_ARCHITECTURE.md) → [Contributing Guide](CONTRIBUTING.md)
|
|
254
279
|
|
|
255
280
|
### "I need to understand trading hour detection"
|
|
281
|
+
|
|
256
282
|
→ [Trading Hours Research](docs/TRADING_HOURS_RESEARCH.md) → [E2E Validation](docs/validation/E2E_VALIDATION_RESULTS_v1.6.0.md)
|
|
257
283
|
|
|
258
284
|
---
|