Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
expected_result = np.array([
0,
0,
0.4215e-07,
0.4215e-07,
0.4215e-07,
])
np.testing.assert_almost_equal(curdistance, expected_result)
# test index 3
idx = 3
curlastz = np.zeros(profile_len)
curlastz = scrimp.calc_curlastz(ts, m, n, idx, profile_len, curlastz)
curdistance = np.zeros(profile_len)
curdistance = scrimp.calc_curdistance(curlastz, meanx, sigmax, idx,
profile_len, m, curdistance)
np.testing.assert_almost_equal(curdistance, expected_result)
def test_calc_curdistance():
ts = np.array([1, 2, 3, 4, 5, 6, 7, 8])
m = 4
# test index 2
idx = 2
profile_len = scrimp.calc_profile_len(len(ts), m)
X, n, sumx2, sumx, meanx, sigmax2, sigmax = scrimp.fast_find_nn_pre(ts, m)
curlastz = np.zeros(profile_len)
curlastz = scrimp.calc_curlastz(ts, m, n, idx, profile_len, curlastz)
curdistance = np.zeros(profile_len)
curdistance = scrimp.calc_curdistance(curlastz, meanx, sigmax, idx,
profile_len, m, curdistance)
expected_result = np.array([
0,
0,
0.4215e-07,
0.4215e-07,
0.4215e-07,
])
np.testing.assert_almost_equal(curdistance, expected_result)
# test index 3
idx = 3
curlastz = np.zeros(profile_len)
curlastz = scrimp.calc_curlastz(ts, m, n, idx, profile_len, curlastz)