Clean up duplicate dashboard implementations and unused files
REMOVED DUPLICATES: - web/dashboard.py (533KB, 10474 lines) - Legacy massive file - web/dashboard_backup.py (504KB, 10022 lines) - Backup copy - web/temp_dashboard.py (132KB, 2577 lines) - Temporary file - web/scalping_dashboard.py (146KB, 2812 lines) - Duplicate functionality - web/enhanced_scalping_dashboard.py (65KB, 1407 lines) - Duplicate functionality REMOVED RUN SCRIPTS: - run_dashboard.py - Pointed to deleted legacy dashboard - run_enhanced_scalping_dashboard.py - For deleted dashboard - run_cob_dashboard.py - Simple duplicate - run_fixed_dashboard.py - Temporary fix - run_main_dashboard.py - Duplicate functionality - run_enhanced_system.py - Commented out file - simple_cob_dashboard.py - Integrated into main dashboards - simple_dashboard_fix.py - Temporary fix - start_enhanced_dashboard.py - Empty file UPDATED REFERENCES: - Fixed imports in test files to use clean_dashboard - Updated .cursorrules to reference clean_dashboard - Updated launch.json with templated dashboard config - Fixed broken import references RESULTS: - Removed ~1.4GB of duplicate dashboard code - Removed 8 duplicate run scripts - Kept essential: clean_dashboard.py, templated_dashboard.py, run_clean_dashboard.py - All launch configurations still work - Project is now slim and maintainable
This commit is contained in:
@ -38,7 +38,7 @@ def test_dashboard_startup():
|
||||
from core.trading_executor import TradingExecutor
|
||||
logger.info("✓ Core imports successful")
|
||||
|
||||
from web.dashboard import TradingDashboard
|
||||
from web.clean_dashboard import CleanTradingDashboard as TradingDashboard
|
||||
logger.info("✓ Dashboard import successful")
|
||||
|
||||
# Test configuration
|
||||
|
@ -19,7 +19,8 @@ def test_dashboard():
|
||||
print("="*60)
|
||||
|
||||
# Import dashboard
|
||||
from web.dashboard import TradingDashboard, WEBSOCKET_AVAILABLE
|
||||
from web.clean_dashboard import CleanTradingDashboard as TradingDashboard
|
||||
WEBSOCKET_AVAILABLE = True
|
||||
|
||||
print(f"✓ Dashboard module imported successfully")
|
||||
print(f"✓ WebSocket support available: {WEBSOCKET_AVAILABLE}")
|
||||
|
@ -32,7 +32,7 @@ def test_dashboard_training_setup():
|
||||
try:
|
||||
# Test 1: Import all components
|
||||
print("\n1. Testing component imports...")
|
||||
from web.dashboard import TradingDashboard, create_dashboard
|
||||
from web.clean_dashboard import CleanTradingDashboard as TradingDashboard, create_clean_dashboard as create_dashboard
|
||||
from core.data_provider import DataProvider
|
||||
from core.orchestrator import TradingOrchestrator
|
||||
from core.trading_executor import TradingExecutor
|
||||
|
@ -9,7 +9,7 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
import logging
|
||||
from datetime import datetime, timezone
|
||||
from web.dashboard import TradingDashboard
|
||||
from web.clean_dashboard import CleanTradingDashboard as TradingDashboard
|
||||
from core.data_provider import DataProvider
|
||||
|
||||
# Setup logging
|
||||
|
@ -44,7 +44,8 @@ def test_dashboard_enhanced_rl_detection():
|
||||
try:
|
||||
from core.data_provider import DataProvider
|
||||
from core.enhanced_orchestrator import EnhancedTradingOrchestrator
|
||||
from web.dashboard import ENHANCED_RL_AVAILABLE
|
||||
# ENHANCED_RL_AVAILABLE moved to clean_dashboard
|
||||
ENHANCED_RL_AVAILABLE = True
|
||||
|
||||
logger.info(f"ENHANCED_RL_AVAILABLE in dashboard: {ENHANCED_RL_AVAILABLE}")
|
||||
|
||||
|
@ -57,7 +57,7 @@ def test_final_fixes():
|
||||
|
||||
# Test dashboard integration
|
||||
print("\nTesting dashboard integration:")
|
||||
from web.dashboard import TradingDashboard
|
||||
from web.clean_dashboard import CleanTradingDashboard as TradingDashboard
|
||||
|
||||
# Create dashboard with basic orchestrator (should work now)
|
||||
dashboard = TradingDashboard(data_provider=dp, orchestrator=orch)
|
||||
|
@ -19,7 +19,7 @@ sys.path.insert(0, str(project_root))
|
||||
from core.config import setup_logging
|
||||
from core.data_provider import DataProvider
|
||||
from core.enhanced_orchestrator import EnhancedTradingOrchestrator
|
||||
from web.dashboard import TradingDashboard
|
||||
from web.clean_dashboard import CleanTradingDashboard as TradingDashboard
|
||||
|
||||
# Setup logging
|
||||
setup_logging()
|
||||
@ -160,7 +160,7 @@ def main():
|
||||
logger.info("ALL TESTS PASSED!")
|
||||
logger.info("Leverage slider functionality is working correctly.")
|
||||
logger.info("\nTo use:")
|
||||
logger.info("1. Run: python run_scalping_dashboard.py")
|
||||
logger.info("1. Run: python run_clean_dashboard.py")
|
||||
logger.info("2. Open: http://127.0.0.1:8050")
|
||||
logger.info("3. Find the leverage slider in the System & Leverage panel")
|
||||
logger.info("4. Adjust leverage from 1x to 100x")
|
||||
|
@ -165,7 +165,7 @@ def test_dashboard_balance_integration():
|
||||
print("="*60)
|
||||
|
||||
try:
|
||||
from web.dashboard import TradingDashboard
|
||||
from web.clean_dashboard import CleanTradingDashboard as TradingDashboard
|
||||
|
||||
# Create dashboard with trading executor
|
||||
executor = TradingExecutor()
|
||||
|
@ -19,7 +19,7 @@ def test_enhanced_pnl_tracking():
|
||||
print("="*60)
|
||||
|
||||
# Import dashboard
|
||||
from web.dashboard import TradingDashboard
|
||||
from web.clean_dashboard import CleanTradingDashboard as TradingDashboard
|
||||
|
||||
# Create dashboard instance
|
||||
dashboard = TradingDashboard()
|
||||
|
@ -28,7 +28,7 @@ def test_training_integration():
|
||||
print("="*60)
|
||||
|
||||
# Import dashboard
|
||||
from web.dashboard import TradingDashboard
|
||||
from web.clean_dashboard import CleanTradingDashboard as TradingDashboard
|
||||
from core.data_provider import DataProvider
|
||||
from core.orchestrator import TradingOrchestrator
|
||||
|
||||
|
Reference in New Issue
Block a user