forked from snikolov/rumor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
params.py
51 lines (47 loc) · 1.65 KB
/
params.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
from collections import namedtuple
"""
Params = namedtuple('Params',
['pos_path',
'neg_path',
'threshold',
'test_frac',
'cmpr_window',
'cmpr_step',
'w_smooth',
'gamma',
'p_sample',
'detection_step',
'min_dist_step',
'detection_window_hrs',
'req_consec_detections'])
"""
# TODO: This __str__ overriding doesn't seem to work properly...
params_list = ['pos_path',
'neg_path',
'threshold',
'test_frac',
'cmpr_window',
'cmpr_step',
'w_smooth',
'gamma',
'p_sample',
'detection_step',
'min_dist_step',
'detection_window_hrs',
'req_consec_detections']
class Params(namedtuple("Params", params_list)):
__slots__ = ()
def __str__(self):
return 'threshold=' + str(self.threshold) + ',' + \
'cmpr_window=' + str(self.cmpr_window) + ',' + \
'w_smooth=' + str(self.w_smooth) + ',' + \
'gamma=' + str(self.gamma) + ',' + \
'detection_window_hrs=' + str(self.detection_window_hrs) + ',' + \
'req_consec_detections=' + str(self.req_consec_detections)
def __str_short__(self):
return str(self.threshold) + ',' + \
str(self.cmpr_window) + ',' + \
str(self.w_smooth) + ',' + \
str(self.gamma) + ',' + \
str(self.detection_window_hrs) + ',' + \
str(self.req_consec_detections)