clinical-drug-repurposing / project_config.py
ayushnoori's picture
Update input
48e3a32
'''
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