40
40
from popmon .hist .hist_utils import COMMON_HIST_TYPES , is_numeric
41
41
42
42
43
- def hist_compare (row , hist_name1 = "" , hist_name2 = "" ):
43
+ def hist_compare (row , hist_name1 : str = "" , hist_name2 : str = "" ):
44
44
"""Function to compare two histograms
45
45
46
46
Apply statistical tests to compare two input histograms, such as:
@@ -107,11 +107,11 @@ def __init__(
107
107
read_key ,
108
108
store_key ,
109
109
assign_to_key = None ,
110
- hist_col = "histogram" ,
111
- suffix = "comp" ,
110
+ hist_col : str = "histogram" ,
111
+ suffix : str = "comp" ,
112
112
* args ,
113
113
** kwargs ,
114
- ):
114
+ ) -> None :
115
115
"""Initialize an instance of RollingHistComparer.
116
116
117
117
:param func_hist_collector: histogram collection function
@@ -160,10 +160,10 @@ def __init__(
160
160
read_key ,
161
161
store_key ,
162
162
window ,
163
- shift = 1 ,
164
- hist_col = "histogram" ,
165
- suffix = "roll" ,
166
- ):
163
+ shift : int = 1 ,
164
+ hist_col : str = "histogram" ,
165
+ suffix : str = "roll" ,
166
+ ) -> None :
167
167
"""Initialize an instance of RollingHistComparer.
168
168
169
169
:param str read_key: key of input data to read from data store
@@ -201,9 +201,9 @@ def __init__(
201
201
self ,
202
202
read_key ,
203
203
store_key ,
204
- hist_col = "histogram" ,
205
- suffix = "prev1" ,
206
- ):
204
+ hist_col : str = "histogram" ,
205
+ suffix : str = "prev1" ,
206
+ ) -> None :
207
207
"""Initialize an instance of PreviousHistComparer.
208
208
209
209
:param str read_key: key of input data to read from data store
@@ -228,10 +228,10 @@ def __init__(
228
228
self ,
229
229
read_key ,
230
230
store_key ,
231
- shift = 1 ,
232
- hist_col = "histogram" ,
233
- suffix = "expanding" ,
234
- ):
231
+ shift : int = 1 ,
232
+ hist_col : str = "histogram" ,
233
+ suffix : str = "expanding" ,
234
+ ) -> None :
235
235
"""Initialize an instance of ExpandingHistComparer.
236
236
237
237
:param str read_key: key of input data to read from data store
@@ -267,9 +267,9 @@ def __init__(
267
267
reference_key ,
268
268
assign_to_key ,
269
269
store_key ,
270
- hist_col = "histogram" ,
271
- suffix = "ref" ,
272
- ):
270
+ hist_col : str = "histogram" ,
271
+ suffix : str = "ref" ,
272
+ ) -> None :
273
273
"""Initialize an instance of ReferenceHistComparer.
274
274
275
275
:param str reference_key: key of input data to read from data store
@@ -306,10 +306,10 @@ def __init__(
306
306
read_key ,
307
307
store_key ,
308
308
assign_to_key = None ,
309
- hist_col = "histogram" ,
309
+ hist_col : str = "histogram" ,
310
310
* args ,
311
311
** kwargs ,
312
- ):
312
+ ) -> None :
313
313
"""Initialize an instance of NormHistComparer.
314
314
315
315
:param func_hist_collector: histogram collection function
@@ -349,7 +349,9 @@ def __init__(
349
349
class RollingNormHistComparer (NormHistComparer ):
350
350
"""Compare histogram to previous rolling normalized histograms"""
351
351
352
- def __init__ (self , read_key , store_key , window , shift = 1 , hist_col = "histogram" ):
352
+ def __init__ (
353
+ self , read_key , store_key , window , shift : int = 1 , hist_col : str = "histogram"
354
+ ) -> None :
353
355
"""Initialize an instance of RollingNormHistComparer.
354
356
355
357
:param str read_key: key of input data to read from data store
@@ -383,7 +385,9 @@ def transform(self, datastore):
383
385
class ExpandingNormHistComparer (NormHistComparer ):
384
386
"""Compare histogram to previous expanding normalized histograms"""
385
387
386
- def __init__ (self , read_key , store_key , shift = 1 , hist_col = "histogram" ):
388
+ def __init__ (
389
+ self , read_key , store_key , shift : int = 1 , hist_col : str = "histogram"
390
+ ) -> None :
387
391
"""Initialize an instance of ExpandingNormHistComparer.
388
392
389
393
:param str read_key: key of input data to read from data store
@@ -412,7 +416,9 @@ def transform(self, datastore):
412
416
class ReferenceNormHistComparer (NormHistComparer ):
413
417
"""Compare histogram to reference normalized histograms"""
414
418
415
- def __init__ (self , reference_key , assign_to_key , store_key , hist_col = "histogram" ):
419
+ def __init__ (
420
+ self , reference_key , assign_to_key , store_key , hist_col : str = "histogram"
421
+ ) -> None :
416
422
"""Initialize an instance of ReferenceNormHistComparer.
417
423
418
424
:param str reference_key: key of input data to read from data store
0 commit comments