"""
Data Module for ML Engine
=========================
Provides database access, data loading, datasets, and validation utilities.

Components:
- database: PostgreSQL connection and query utilities
- training_loader: Efficient data loading for ML training
- dataset: PyTorch Dataset classes for sequence and time series models
- validators: Data quality validation tools

Usage:
    from data import (
        # Database access
        PostgreSQLConnection,
        DatabaseManager,
        load_ohlcv_from_postgres,

        # Training data loading
        TrainingDataLoader,
        TrainingDataConfig,
        load_training_data,

        # PyTorch datasets
        TradingDataset,
        TimeSeriesDataset,
        DatasetConfig,
        create_train_val_datasets,

        # Validation
        DataValidator,
        QualityReport,
        validate_trading_data,
    )
"""

from .database import (
    PostgreSQLConnection,
    MySQLConnection,  # Alias for backward compatibility
    DatabaseManager,
    load_ohlcv_from_postgres,
)

from .training_loader import (
    TrainingDataLoader,
    TrainingDataConfig,
    load_training_data,
)

from .dataset import (
    TradingDataset,
    TimeSeriesDataset,
    DatasetConfig,
    create_train_val_datasets,
)

from .validators import (
    DataValidator,
    ValidationIssue,
    ValidationSeverity,
    QualityReport,
    validate_trading_data,
)

__all__ = [
    # Database
    'PostgreSQLConnection',
    'MySQLConnection',
    'DatabaseManager',
    'load_ohlcv_from_postgres',
    # Training loader
    'TrainingDataLoader',
    'TrainingDataConfig',
    'load_training_data',
    # Datasets
    'TradingDataset',
    'TimeSeriesDataset',
    'DatasetConfig',
    'create_train_val_datasets',
    # Validators
    'DataValidator',
    'ValidationIssue',
    'ValidationSeverity',
    'QualityReport',
    'validate_trading_data',
]
