""" Path configuration for running scripts from backup folder Import this at the top of each script to automatically adjust paths """ from pathlib import Path import os # Detect if we're running from backup BACKUP_DIR = Path("/app") RUNNING_FROM_BACKUP = Path.cwd().resolve().is_relative_to(BACKUP_DIR.resolve()) if RUNNING_FROM_BACKUP: print("🔧 BACKUP MODE: Using backup folder paths") # Base paths BASE_DIR = BACKUP_DIR MODELS_DIR = BACKUP_DIR / "models" SCRIPTS_DIR = BACKUP_DIR / "scripts" # Tournament-specific model paths MODELS = { 'root': MODELS_DIR / "root", 'main': MODELS_DIR / "main", 'signals': MODELS_DIR / "signals", 'crypto': MODELS_DIR / "crypto", } # Output directories SUBMISSIONS_DIR = BACKUP_DIR / "submissions" SUBMISSIONS_DIR.mkdir(exist_ok=True) # Create tournament submission folders for tournament in ['main', 'signals', 'crypto']: (SUBMISSIONS_DIR / tournament).mkdir(exist_ok=True) # Path mapping function def get_model_path(tournament, filename): """Get model file path for given tournament""" if tournament == 'crypto' and 'crypto_full_activations' in filename: return MODELS['crypto'] / 'crypto_full_activations' / Path(filename).name elif tournament == 'main' and 'trained_models' in filename: return MODELS['main'] / 'trained_models' / Path(filename).name else: return MODELS[tournament] / filename def get_submission_path(tournament): """Get submission directory for tournament""" return SUBMISSIONS_DIR / tournament # Config paths CONFIG_DIR = BACKUP_DIR / "config" else: print("📍 PRODUCTION MODE: Using production paths") # Production paths remain as-is BASE_DIR = Path("C:/tournament_numerai") def get_model_path(tournament, filename): """Return production paths""" if tournament == 'crypto': return Path("c:/tournament_numerai/crypto/models/crypto_full_activations") / filename elif tournament == 'main' and 'trained_models' in filename: return Path("C:/tournament_numerai/main/trained_models") / filename else: return Path(f"C:/tournament_numerai/{tournament}") / filename def get_submission_path(tournament): """Get production submission directory""" return Path(f"C:/tournament_numerai/{tournament}/submissions") CONFIG_DIR = Path("C:/3tournaments/historical_validation") # Print configuration print(f" Base: {BASE_DIR}") if RUNNING_FROM_BACKUP: print(f" Models: {MODELS_DIR}") print(f" Submissions: {SUBMISSIONS_DIR}")