77import scipy .signal
88import time
99
10- def check_python_version ():
10+ def check_python_version (): # pragma: no cover
1111 if (sys .version_info < (3 , 0 )):
1212 raise Exception ('Matrix Profile is only compatible with python3.x' )
1313
14- def get_parser ():
14+ def get_parser (): # pragma: no cover
1515 parser = argparse .ArgumentParser ()
1616 parser .add_argument ('ts_file' , help = 'Time series input file' )
1717 parser .add_argument ('subseq_length' , help = 'Subsequence length' , type = int )
@@ -26,15 +26,15 @@ def rolling_window(a, window):
2626def z_norm (x , axis = 0 ):
2727 return (x - np .mean (x , axis , keepdims = True ))/ np .std (x , axis , keepdims = True )
2828
29- def check_dtype (arr , dtype = np .float ):
29+ def check_dtype (arr , dtype = np .float ): # pragma: no cover
3030 """
3131 Check if array has correct dtype
3232 """
3333 if not issubclass (arr .dtype .type , dtype ):
3434 msg = '{} type expected but found {}' .format (dtype , arr .dtype .type )
3535 raise TypeError (msg )
3636
37- def are_arrays_equal (arr1 , arr2 ):
37+ def are_arrays_equal (arr1 , arr2 ): # pragma: no cover
3838 """
3939 Check if two arrays are equal; first by comparing memory addresses,
4040 and secondly by their values
@@ -45,7 +45,7 @@ def are_arrays_equal(arr1, arr2):
4545
4646 return np .array_equal (arr1 , arr2 )
4747
48- def are_distances_too_small (x , threshold = 10e-6 ):
48+ def are_distances_too_small (x , threshold = 10e-6 ): # pragma: no cover
4949 """
5050 Check the distance values from a matrix profile.
5151
@@ -58,7 +58,7 @@ def are_distances_too_small(x, threshold=10e-6):
5858
5959 return False
6060
61- def timeit (func ):
61+ def timeit (func ): # pragma: no cover
6262 """
6363 Timing decorator
6464 """
@@ -196,14 +196,3 @@ def mass(Q, T, M_T=None, Σ_T=None):
196196 return calculate_distance_profile (m , QT , μ_Q , σ_Q , M_T , Σ_T )
197197
198198convolution = scipy .signal .fftconvolve # Swap for other convolution function
199-
200- if __name__ == '__main__' :
201- check_python_version ()
202- #parser = get_parser()
203- #args = parser.parse_args()
204- N = 17279800 # GPU-STOMP Comparison
205- # Select 50 random floats in range [-1000, 1000]
206- T = np .random .uniform (- 1000 , 1000 , [N ])
207- # Select 5 random floats in range [-1000, 1000]
208- Q = np .random .uniform (- 1000 , 1000 , [2000 ])
209- mass (Q , T )
0 commit comments