Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ts = [1, 2, 3, 4, 5, 6, 7, 8]
m = 4
idx = 0
profile_len = scrimp.calc_profile_len(len(ts), m) # 4
exclusion_zone = scrimp.calc_exclusion_zone(m) # 1
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 1
assert(expected_stop == stop)
idx = 2
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 3
assert(expected_stop == stop)
idx = 3
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 4
assert(expected_stop == stop)
idx = 4
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 5
assert(expected_stop == stop)
def test_calc_exclusion_stop():
ts = [1, 2, 3, 4, 5, 6, 7, 8]
m = 4
idx = 0
profile_len = scrimp.calc_profile_len(len(ts), m) # 4
exclusion_zone = scrimp.calc_exclusion_zone(m) # 1
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 1
assert(expected_stop == stop)
idx = 2
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 3
assert(expected_stop == stop)
idx = 3
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 4
assert(expected_stop == stop)
idx = 4
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 5
assert(expected_stop == stop)
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 1
assert(expected_stop == stop)
idx = 2
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 3
assert(expected_stop == stop)
idx = 3
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 4
assert(expected_stop == stop)
idx = 4
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 5
assert(expected_stop == stop)
def test_calc_exclusion_stop():
ts = [1, 2, 3, 4, 5, 6, 7, 8]
m = 4
idx = 0
profile_len = scrimp.calc_profile_len(len(ts), m) # 4
exclusion_zone = scrimp.calc_exclusion_zone(m) # 1
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 1
assert(expected_stop == stop)
idx = 2
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 3
assert(expected_stop == stop)
idx = 3
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 4
assert(expected_stop == stop)
idx = 4
stop = scrimp.calc_exclusion_stop(idx, exclusion_zone, profile_len)
expected_stop = 5