-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.py
More file actions
38 lines (35 loc) · 1.1 KB
/
config.py
File metadata and controls
38 lines (35 loc) · 1.1 KB
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
configuration = {
'pool_size': 10,
'jobs_to_run': {
'generate_cfs_random': {
'args': { 'bulk': 5000, 'max_deg': 3, 'max_coeff': 50, 'num_denom_factor': (2, True) },
'iterations': 50
},
'calculate_precision': {
'args': { 'bulk': 1000, 'num_denom_factor': (2, True) },
'run_async': True,
'async_cores': 4,
'cooldown': 30,
'no_work_timeout': 60
},
'const_cf_pslq': {
'args': { 'bulk': 1000, 'num_denom_factor': (2, True) },
'run_async': True,
'async_cores': 4,
'cooldown': 30,
'no_work_timeout': 60
},
}
}
db_configuration = {
'host': '',
'port': 5432,
'user': '',
'passwd': '',
'name': ''
}
def get_connection_string(db_name=None):
conf = db_configuration.copy()
if db_name:
conf['name'] = db_name
return 'postgresql://{user}:{passwd}@{host}:{port}/{name}'.format(**conf)