From 380f5bc36156ce1afc869f12cf6dc36fdebbca6e Mon Sep 17 00:00:00 2001
From: Pablo Prietz <pablo@prietz.org>
Date: Thu, 21 Nov 2019 12:13:05 +0100
Subject: [PATCH 1/2] Online Fixation Detector: Fix removing deprecated gaze
 from queue

---
 pupil_src/shared_modules/fixation_detector.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pupil_src/shared_modules/fixation_detector.py b/pupil_src/shared_modules/fixation_detector.py
index f7307c1f07..73d0754640 100644
--- a/pupil_src/shared_modules/fixation_detector.py
+++ b/pupil_src/shared_modules/fixation_detector.py
@@ -711,7 +711,7 @@ def recent_events(self, events):
             age_threshold = ts_newest - self.min_duration / 1000.0
             # pop elements until only one element below the age threshold remains:
             while self.history[1]["timestamp"] < age_threshold:
-                self.history.popleft()  # remove outdated gaze points
+                del self.history[0]  # remove outdated gaze points
 
         except IndexError:
             pass

From cb650e059b63d52d04f6c25c153c9312bbb08f0f Mon Sep 17 00:00:00 2001
From: Pablo Prietz <pablo@prietz.org>
Date: Thu, 21 Nov 2019 12:16:54 +0100
Subject: [PATCH 2/2] Remove calibration speed boosting through fixations

Also applies black.

Feature was removed since the fixation detector always requires calibrated gaze to work properly.
---
 .../manual_marker_calibration.py                |  2 --
 .../screen_marker_calibration.py                | 17 ++++++++++-------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/pupil_src/shared_modules/calibration_routines/manual_marker_calibration.py b/pupil_src/shared_modules/calibration_routines/manual_marker_calibration.py
index 0f24fe5086..a1477d3ac3 100644
--- a/pupil_src/shared_modules/calibration_routines/manual_marker_calibration.py
+++ b/pupil_src/shared_modules/calibration_routines/manual_marker_calibration.py
@@ -200,8 +200,6 @@ def recent_events(self, events):
                         ref["screen_pos"] = marker_pos
                         ref["timestamp"] = frame.timestamp
                         self.ref_list.append(ref)
-                        if events.get("fixations", []):
-                            self.counter -= 5
                         if self.counter <= 0:
                             # last sample before counter done and moving on
                             audio.tink()
diff --git a/pupil_src/shared_modules/calibration_routines/screen_marker_calibration.py b/pupil_src/shared_modules/calibration_routines/screen_marker_calibration.py
index 1918bcc0b0..becf8e8170 100644
--- a/pupil_src/shared_modules/calibration_routines/screen_marker_calibration.py
+++ b/pupil_src/shared_modules/calibration_routines/screen_marker_calibration.py
@@ -226,9 +226,14 @@ def open_window(self, title="new_window"):
                     )
                     self.monitor_idx = 0
                     monitor = glfwGetMonitors()[self.monitor_idx]
-                width, height, redBits, blueBits, greenBits, refreshRate = glfwGetVideoMode(
-                    monitor
-                )
+                (
+                    width,
+                    height,
+                    redBits,
+                    blueBits,
+                    greenBits,
+                    refreshRate,
+                ) = glfwGetVideoMode(monitor)
             else:
                 monitor = None
                 width, height = 640, 360
@@ -342,11 +347,9 @@ def recent_events(self, events):
             # Always save pupil positions
             self.pupil_list.extend(events["pupil"])
 
-            if on_position and len(self.markers) and events.get("fixations", []):
-                fixation_boost = 5
+            if on_position and len(self.markers):
                 self.screen_marker_state = min(
-                    self.sample_duration + self.lead_in,
-                    self.screen_marker_state + fixation_boost,
+                    self.sample_duration + self.lead_in, self.screen_marker_state,
                 )
 
             # Animate the screen marker