File size: 2,760 Bytes
5bfc765
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"""
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}")