refactor(ml): rename real_data_loader to data_loader
The real_ prefix was misleading — there is no fake data loader. Mechanical rename across 18 source files, no logic changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,7 @@ use tokio::sync::Mutex;
|
||||
use tracing::info;
|
||||
|
||||
use crate::dqn::{Experience, DQN, DQNConfig};
|
||||
use crate::real_data_loader::{FeatureMatrix, RealDataLoader};
|
||||
use crate::data_loader::{FeatureMatrix, RealDataLoader};
|
||||
|
||||
use super::batch_size_finder::{BatchSizeConfig, BatchSizeFinder};
|
||||
use super::gpu_hardware::GpuHardwareManager;
|
||||
@@ -319,7 +319,7 @@ impl DqnBenchmarkRunner {
|
||||
/// Convert Indicators to feature vectors
|
||||
fn convert_indicators_to_features(
|
||||
&self,
|
||||
indicators: &crate::real_data_loader::Indicators,
|
||||
indicators: &crate::data_loader::Indicators,
|
||||
) -> Result<Vec<Vec<f32>>> {
|
||||
let mut features = Vec::new();
|
||||
let len = indicators.rsi.len();
|
||||
|
||||
@@ -61,7 +61,7 @@ use tokio::sync::Mutex;
|
||||
use tracing::info;
|
||||
|
||||
use crate::mamba::{Mamba2Config, Mamba2SSM, OptimizerType};
|
||||
use crate::real_data_loader::RealDataLoader;
|
||||
use crate::data_loader::RealDataLoader;
|
||||
|
||||
use super::batch_size_finder::{BatchSizeConfig, BatchSizeFinder};
|
||||
use super::gpu_hardware::GpuHardwareManager;
|
||||
@@ -326,7 +326,7 @@ impl Mamba2BenchmarkRunner {
|
||||
/// Each sequence is 128 timesteps, predicting the next value.
|
||||
fn create_sequences(
|
||||
&self,
|
||||
features: &crate::real_data_loader::FeatureMatrix,
|
||||
features: &crate::data_loader::FeatureMatrix,
|
||||
) -> Result<Vec<(Tensor, Tensor)>> {
|
||||
let seq_len = 128; // Sequence length for MAMBA-2
|
||||
let mut sequences = Vec::new();
|
||||
|
||||
@@ -61,7 +61,7 @@ use std::time::Instant;
|
||||
use tokio::sync::Mutex;
|
||||
use tracing::info;
|
||||
|
||||
use crate::real_data_loader::{FeatureMatrix, RealDataLoader};
|
||||
use crate::data_loader::{FeatureMatrix, RealDataLoader};
|
||||
use crate::tft::training::{TFTDataLoader, TFTTrainer, TFTTrainingConfig};
|
||||
use crate::tft::TFTConfig;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
//! ## Usage
|
||||
//!
|
||||
//! ```rust
|
||||
//! use ml::real_data_loader::RealDataLoader;
|
||||
//! use ml::data_loader::RealDataLoader;
|
||||
//!
|
||||
//! let loader = RealDataLoader::new("test_data/real/databento").await?;
|
||||
//! let bars = loader.load_symbol_data("ZN.FUT").await?;
|
||||
@@ -4,7 +4,7 @@
|
||||
//! Each rule implements the `ValidationRule` trait and can be composed
|
||||
//! into a comprehensive validation pipeline.
|
||||
|
||||
use crate::real_data_loader::Indicators;
|
||||
use crate::data_loader::Indicators;
|
||||
use crate::types::OHLCVBar;
|
||||
use anyhow::Result;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
use std::fmt::Write as _;
|
||||
|
||||
use super::rules::{Severity, ValidationError, ValidationRule};
|
||||
use crate::real_data_loader::Indicators;
|
||||
use crate::data_loader::Indicators;
|
||||
use crate::types::OHLCVBar;
|
||||
use anyhow::Result;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//! ## Architecture
|
||||
//! ```rust
|
||||
//! use ml::features::extraction::extract_ml_features;
|
||||
//! use ml::real_data_loader::RealDataLoader;
|
||||
//! use ml::data_loader::RealDataLoader;
|
||||
//!
|
||||
//! let loader = RealDataLoader::new();
|
||||
//! let bars = loader.load_ohlcv_bars("ES.FUT").await?;
|
||||
|
||||
@@ -933,7 +933,7 @@ pub mod stress_testing; // Stress testing framework
|
||||
pub mod training_pipeline; // Complete training pipeline system
|
||||
pub mod traits; // Common traits for ML models // Production observability and monitoring // Integration with model_loader crate
|
||||
|
||||
pub mod real_data_loader;
|
||||
pub mod data_loader;
|
||||
pub mod walk_forward;
|
||||
pub mod data_validation;
|
||||
pub mod model_registry;
|
||||
|
||||
@@ -481,7 +481,7 @@ fn test_performance_changepoint_detection() {
|
||||
#[tokio::test]
|
||||
async fn test_real_data_zn_futures() {
|
||||
// Test BOCD on real 10-Year Treasury Note futures data
|
||||
use ml::real_data_loader::RealDataLoader;
|
||||
use ml::data_loader::RealDataLoader;
|
||||
|
||||
let loader = RealDataLoader::new();
|
||||
let file_path = "test_data/real/databento/ml_training/ZN.FUT_ohlcv-1m_2024-01-02.dbn";
|
||||
@@ -556,7 +556,7 @@ async fn test_real_data_zn_futures() {
|
||||
#[tokio::test]
|
||||
async fn test_real_data_euro_futures() {
|
||||
// Test BOCD on real Euro FX futures data
|
||||
use ml::real_data_loader::RealDataLoader;
|
||||
use ml::data_loader::RealDataLoader;
|
||||
|
||||
let loader = RealDataLoader::new();
|
||||
let file_path = "test_data/real/databento/6E.FUT_ohlcv-1m_2024-01-02_to_2024-01-31.dbn";
|
||||
|
||||
@@ -25,7 +25,7 @@ use ml::data_validation::rules::{
|
||||
CompletenessRule, ContinuityRule, IndicatorRule, IntegrityRule, TimestampRule,
|
||||
};
|
||||
use ml::data_validation::validator::{DataValidator, ValidationResult};
|
||||
use ml::real_data_loader::Indicators;
|
||||
use ml::data_loader::Indicators;
|
||||
use ml::types::OHLCVBar;
|
||||
|
||||
// ============================================================================
|
||||
|
||||
@@ -172,7 +172,7 @@ async fn test_dqn_training_smoke() -> Result<()> {
|
||||
// architecture, we test the validation pipeline independently with a simpler
|
||||
// DQN that trains inside the harness vs. random baseline.
|
||||
use ml::dqn::DQNConfig;
|
||||
use ml::real_data_loader::RealDataLoader;
|
||||
use ml::data_loader::RealDataLoader;
|
||||
use ml::validation::{
|
||||
DqnStrategy, TimeSeriesData, ValidationHarness, ValidationHarnessConfig,
|
||||
WalkForwardConfig,
|
||||
|
||||
@@ -27,7 +27,7 @@ use ml::ensemble::decision::{
|
||||
use ml::ppo::gae::{compute_gae, GAEConfig};
|
||||
use ml::ppo::ppo::{PPOConfig, PPO};
|
||||
use ml::ppo::trajectories::{Trajectory, TrajectoryBatch, TrajectoryStep};
|
||||
use ml::real_data_loader::RealDataLoader;
|
||||
use ml::data_loader::RealDataLoader;
|
||||
use ml::{Features, ModelPrediction};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use ml::ppo::gae::GAEConfig;
|
||||
use ml::ppo::ppo::PPOConfig;
|
||||
use ml::real_data_loader::RealDataLoader;
|
||||
use ml::data_loader::RealDataLoader;
|
||||
use ml::validation::{
|
||||
PpoLstmStrategy, PpoStrategy, TimeSeriesData, ValidationHarness, ValidationHarnessConfig,
|
||||
WalkForwardConfig,
|
||||
|
||||
@@ -201,7 +201,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_real_data_loader_creation() {
|
||||
async fn test_data_loader_creation() {
|
||||
let loader = RealDataLoader::new();
|
||||
assert!(!loader.base_path.is_empty());
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
use chrono::{DateTime, Utc};
|
||||
use ml::dqn::DQNConfig;
|
||||
use ml::real_data_loader::RealDataLoader;
|
||||
use ml::data_loader::RealDataLoader;
|
||||
use ml::validation::{
|
||||
DqnStrategy, TimeSeriesData, ValidationHarness, ValidationHarnessConfig, WalkForwardConfig,
|
||||
};
|
||||
|
||||
@@ -191,7 +191,7 @@ fn test_real_databento_integration() -> Result<()> {
|
||||
|
||||
// Note: This requires the databento crate and proper decoder
|
||||
// For now, we'll just verify the file exists and skip actual loading
|
||||
// In production, use: ml::real_data_loader::RealDataLoader
|
||||
// In production, use: ml::data_loader::RealDataLoader
|
||||
|
||||
println!("✓ Test data file exists (actual loading requires RealDataLoader)");
|
||||
println!(" For full integration, run: cargo test -p ml --test real_data_integration");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! OHLCV Bar builder for testing
|
||||
|
||||
use chrono::{DateTime, Duration, Utc};
|
||||
use ml::real_data_loader::OHLCVBar;
|
||||
use ml::data_loader::OHLCVBar;
|
||||
|
||||
/// Builder for creating OHLCV bars
|
||||
pub struct BarBuilder {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! Consolidates patterns from 15+ test files with `create_mock_bars()` functions.
|
||||
|
||||
use chrono::{DateTime, Duration, Utc};
|
||||
use ml::real_data_loader::OHLCVBar;
|
||||
use ml::data_loader::OHLCVBar;
|
||||
use rand::Rng;
|
||||
|
||||
/// Generate OHLCV bars with realistic price movements
|
||||
|
||||
Reference in New Issue
Block a user