Skip to content
Snippets Groups Projects
Commit 12bb6322 authored by Thomas Jürges's avatar Thomas Jürges
Browse files

SW-382: Replace Python2 integer division (/) with Python3 one (//)

parent 20cb77da
No related branches found
No related tags found
No related merge requests found
......@@ -1477,7 +1477,7 @@ def measure_diff_stability(clock_mhz, repeat = 10,
diffs.append(normalized_diffs)
transposed = transpose_lists(diffs)
medians = [sorted(row)[repeat/2] for row in transposed]
medians = [sorted(row)[repeat // 2] for row in transposed]
deviating = [sum([diff != median for diff in row])
for median, row in zip(medians, transposed)]
return deviating, medians
......@@ -1607,7 +1607,7 @@ def measure_all_delays(clock_mhz,
for index in range(len(failed_attempts)):
if medians[index] != previous_medians[index]:
fails = failed_attempts[index]
failed_attempts[index] = min(repeat, fails + 1 + repeat/2)
failed_attempts[index] = min(repeat, fails + 1 + repeat // 2)
previous_medians = medians
logging.info('Diff errors %3d: [%s]', delay_step,
......@@ -1824,7 +1824,7 @@ def ap_optimal_delay_step(ap_failures, cycle_length = 67):
at_minimum = [fails == minimum for fails in ap_failures]
if all(at_minimum):
return -int(floor(cycle_length/2))
return -(cycle_length // 2)
d_forward = distance_forward(at_minimum, False)
d_reverse = distance_forward(at_minimum[::-1], False)[::-1]
......@@ -1833,7 +1833,7 @@ def ap_optimal_delay_step(ap_failures, cycle_length = 67):
for d_for, d_rev in zip(d_forward, d_reverse)]
modified_distance = []
for dist in distance:
if dist <= cycle_length/2:
if dist <= cycle_length // 2:
modified_distance.append(dist)
else:
modified_distance.append(cycle_length - dist)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment