refactor(ml): consolidate 13 duplicate OHLCVBar definitions into single canonical type
Created ml/src/types/ohlcv.rs as the single source of truth for OHLCVBar (DateTime<Utc> timestamp, f64 OHLCV fields). Replaced all 13 duplicate definitions across features/, regime/, real_data_loader, and evaluation/ with imports from crate::types::OHLCVBar. Key changes: - New: ml/src/types/mod.rs + ohlcv.rs with canonical OHLCVBar (derives: Debug, Clone, Copy, PartialEq, Serialize, Deserialize + Default) - Renamed: evaluation::metrics::OHLCVBar → OHLCVBarF32 (genuinely different type: f32 fields, i64 timestamp for compact backtesting) - Eliminated all import aliases (ExtractionOHLCVBar, RegimeOHLCVBar, PriceOHLCVBar, VolumeOHLCVBar) in dbn_sequence_loader.rs and pipeline.rs - Renamed regime::orchestrator::Bar → OHLCVBar (same fields, just aliased) - Updated 39 files total (13 definitions removed, imports normalized) 1883 lib tests passing, compilation clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
//! All corrections are conservative and preserve data integrity.
|
||||
//! Original data is never modified in-place.
|
||||
|
||||
use crate::real_data_loader::OHLCVBar;
|
||||
use crate::types::OHLCVBar;
|
||||
use anyhow::Result;
|
||||
|
||||
/// Data corrector for automatic fixes
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
//! Each rule implements the `ValidationRule` trait and can be composed
|
||||
//! into a comprehensive validation pipeline.
|
||||
|
||||
use crate::real_data_loader::{Indicators, OHLCVBar};
|
||||
use crate::real_data_loader::Indicators;
|
||||
use crate::types::OHLCVBar;
|
||||
use anyhow::Result;
|
||||
|
||||
/// Validation error information
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
//! Orchestrates multiple validation rules and generates comprehensive reports.
|
||||
|
||||
use super::rules::{Severity, ValidationError, ValidationRule};
|
||||
use crate::real_data_loader::{Indicators, OHLCVBar};
|
||||
use crate::real_data_loader::Indicators;
|
||||
use crate::types::OHLCVBar;
|
||||
use anyhow::Result;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user