#!/usr/bin/env python3 """ Debug Orchestrator Methods - Test enhanced orchestrator method availability """ import sys from pathlib import Path project_root = Path(__file__).parent sys.path.insert(0, str(project_root)) def debug_orchestrator_methods(): """Debug orchestrator method availability""" print("=== DEBUGGING ORCHESTRATOR METHODS ===") try: # Import the classes we need from core.enhanced_orchestrator import EnhancedTradingOrchestrator from core.data_provider import DataProvider from core.orchestrator import TradingOrchestrator print("✓ Imports successful") # Create basic data provider (no async) dp = DataProvider() print("✓ DataProvider created") # Create basic orchestrator first basic_orch = TradingOrchestrator(dp) print("✓ Basic TradingOrchestrator created") # Test basic orchestrator methods basic_methods = ['calculate_enhanced_pivot_reward', 'build_comprehensive_rl_state'] print("\nBasic TradingOrchestrator methods:") for method in basic_methods: available = hasattr(basic_orch, method) print(f" {method}: {'✓' if available else '✗'}") # Now test Enhanced orchestrator class methods (not instantiated) print("\nEnhancedTradingOrchestrator class methods:") for method in basic_methods: available = hasattr(EnhancedTradingOrchestrator, method) print(f" {method}: {'✓' if available else '✗'}") # Check what methods are actually in the EnhancedTradingOrchestrator print(f"\nEnhancedTradingOrchestrator all methods:") all_methods = [m for m in dir(EnhancedTradingOrchestrator) if not m.startswith('_')] enhanced_methods = [m for m in all_methods if 'enhanced' in m.lower() or 'comprehensive' in m.lower() or 'pivot' in m.lower()] print(f" Total methods: {len(all_methods)}") print(f" Enhanced/comprehensive/pivot methods: {enhanced_methods}") # Test specific methods we're looking for target_methods = [ 'calculate_enhanced_pivot_reward', 'build_comprehensive_rl_state', '_get_symbol_correlation' ] print(f"\nTarget methods in EnhancedTradingOrchestrator:") for method in target_methods: if hasattr(EnhancedTradingOrchestrator, method): print(f" ✓ {method}: Found") else: print(f" ✗ {method}: Missing") # Check if it's a similar name similar = [m for m in all_methods if method.replace('_', '').lower() in m.replace('_', '').lower()] if similar: print(f" Similar: {similar}") print("\n=== DEBUG COMPLETE ===") except Exception as e: print(f"✗ Debug failed: {e}") import traceback traceback.print_exc() if __name__ == "__main__": debug_orchestrator_methods()