|
''' |
|
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. |
|
''' |
|
|
|
|
|
from pathlib import Path |
|
import socket |
|
import getpass |
|
|
|
def check_internet_connection(): |
|
try: |
|
|
|
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 |
|
|
|
|
|
VDI = not check_internet_connection() |
|
print(f"VDI: {VDI}") |
|
|
|
|
|
hostname, username = check_local_machine() |
|
LOCAL = True if username == 'an583' else False |
|
print(f"LOCAL: {LOCAL}") |
|
|
|
|
|
HF_REPO = 'ayushnoori/clinical-drug-repurposing' |
|
|
|
|
|
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 |