-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
85 lines (78 loc) · 2.2 KB
/
config.py
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
81
82
83
84
85
import os
from logging.config import dictConfig
# algorithms
RESEARCH_MODE = "research"
BASELINE_MODE = "baseline"
# development
RANDOM_STATE = 42 # change it to something random if it should not be reconstructive.
# server
REACT_PORT = 3000
API_PORT = 8000
SERVER_PATH = 'localhost'
# Data sets
RATED_DATASETS_PATH = os.path.join('rated_datasets')
MOCK_DATASETS_DIR = os.path.join('tests', 'data')
# Configuration for sessions saved on the file system
SESSION_CACHE_DIR = os.path.join('tmp', 'sessions')
SESSION_THRESHOLD = 500
SESSION_MODE = '0700'
# Redis Configuration
REDIS_PORT = 6381
REDIS_HOST = '172.20.14.22'
#!!!!!!!!!!!!!!!!!!!!!!!!PLEASE LEAVE THERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#REDIS_HOST = '172.16.19.193'
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
REDIS_PASSWORD = None
PARALLEL_EXISTENCE_TEST_PROCESSES = 12
LOG_DIR = 'log'
MAX_META_PATH_LENGTH = 6
"""{
'name': 'Freebase',
'url': 'https://hpi.de/mueller/metaexp-demo-neo4j-2',
'bolt-url': 'bolt://172.20.14.22:7717',
'username': 'neo4j',
'password': 'neo4j'
},"""
AVAILABLE_DATA_SETS = [
{
'name': 'Helmholtz',
'url': 'http://172.20.14.22:7484',
'bolt-url': 'bolt://172.20.14.22:7697',
'username': 'neo4j',
'password': ''
}
]
def set_up_logger():
log_dir = 'log'
filename = 'debug.log'
if not os.path.isdir(log_dir):
os.makedirs(log_dir)
dictConfig({
'version': 1,
'formatters': {'default': {
'format': '[%(asctime)s] %(levelname)s from %(name)s: %(message)s',
}},
'handlers': {
'default': {
'class': 'logging.StreamHandler',
'formatter': 'default',
'level': 'DEBUG'
},
'file': {
'class': 'logging.FileHandler',
'formatter': 'default',
'filename': os.path.join(log_dir, filename),
'mode': 'w',
'level': 'DEBUG'
},
},
'loggers': {
'MetaExp': {
'handlers': ['default', 'file']
}
},
'root': {
'level': 'DEBUG',
'handlers': []
},
})