File size: 1,286 Bytes
d4ca2d2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48e3a32
d4ca2d2
 
 
 
 
 
 
 
 
 
 
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
'''
PROJECT CONFIGURATION FILE
This file contains the configuration variables for the project. The variables are used 
in the other scripts to define the paths to the data and results directories. The variables 
are also used to set the random seed for reproducibility.
'''

# Import libraries
from pathlib import Path
import socket
import getpass

def check_internet_connection():
    try:
        # Connect to one of the DNS servers
        socket.create_connection(("8.8.8.8", 53), timeout=5)
        return True
    except OSError:
        return False
    
def check_local_machine():
    hostname = socket.gethostname()
    username = getpass.getuser()
    
    return hostname, username

# Define global variable indicating whether on VDI or not
VDI = not check_internet_connection()
print(f"VDI: {VDI}")

# Define global variable to check if running locally
hostname, username = check_local_machine()
LOCAL = True if username == 'an583' else False
print(f"LOCAL: {LOCAL}")

# Define HF repo variable
HF_REPO = 'ayushnoori/clinical-drug-repurposing'

# Define project configuration variables
PROJECT_DIR = Path(__file__).resolve().parent
DATA_DIR = PROJECT_DIR / 'data'
AUTH_DIR = PROJECT_DIR / 'auth'
MODEL_DIR = PROJECT_DIR / 'models'
MEDIA_DIR = PROJECT_DIR / 'media'
SEED = 42