def test_corr2(): t = [1, 2, 3, 4] v = [40, 50, 60, 70] t2 = [1, 2, 3, 4] v2 = [40, 50, 60, 70] row = {} row['ts'] = ts.TimeSeries(t,v) #Since its the same time series, the correlation here should be zero assert(corr.proc_main(1, row, (t2, v2))[0] == 0)
def test_corr2(): t = [1, 2, 3, 4] v = [40, 50, 60, 70] t2 = [1, 2, 3, 4] v2 = [40, 50, 60, 70] row = {} row['ts'] = ts.TimeSeries(t, v) #Since its the same time series, the correlation here should be zero assert (corr.proc_main(1, row, (t2, v2))[0] == 0)
def test_corr_small(): from procs.corr import proc_main ts_l = [10, 22, 26, 4, 18] ts_l_x = range(len(ts_l)) ts_ts = ts.TimeSeries(ts_l_x, ts_l).to_json() # print (ts_ts) res = proc_main(None, {'ts': ts_ts}, {'times': ts_l_x, 'values': ts_l}) # print (res) assert np.abs(res) < EPS
def test_corr_small(): from procs.corr import proc_main ts_l = [10, 22, 26, 4, 18] ts_l_x = range(len(ts_l)) ts_ts = ts.TimeSeries(ts_l_x, ts_l).to_json() # print (ts_ts) res = proc_main(None, {'ts':ts_ts}, {'times':ts_l_x, 'values':ts_l}) # print (res) assert np.abs(res) < EPS