From 5cce7f4d55b3522e780df0d40be3a16862b88d75 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 4 Sep 2020 19:30:18 -0400 Subject: [PATCH] pid_calibrate: Update for improved python3 compatibility Signed-off-by: Kevin O'Connor --- klippy/extras/pid_calibrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klippy/extras/pid_calibrate.py b/klippy/extras/pid_calibrate.py index a7768e57..a00f0a1b 100644 --- a/klippy/extras/pid_calibrate.py +++ b/klippy/extras/pid_calibrate.py @@ -130,7 +130,7 @@ class ControlAutoTune: def calc_final_pid(self): cycle_times = [(self.peaks[pos][1] - self.peaks[pos-2][1], pos) for pos in range(4, len(self.peaks))] - midpoint_pos = sorted(cycle_times)[len(cycle_times)/2][1] + midpoint_pos = sorted(cycle_times)[len(cycle_times)//2][1] return self.calc_pid(midpoint_pos) # Offline analysis helper def write_file(self, filename):