Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 8, 2024
1 parent 735b71f commit 3adcae4
Show file tree
Hide file tree
Showing 243 changed files with 291 additions and 46 deletions.
1 change: 1 addition & 0 deletions pupil_src/launchables/eye.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import os
import platform
import signal
Expand Down
1 change: 1 addition & 0 deletions pupil_src/launchables/marker_detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

from types import SimpleNamespace


Expand Down
7 changes: 4 additions & 3 deletions pupil_src/launchables/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import asyncio
import os
import platform
Expand Down Expand Up @@ -775,9 +776,9 @@ def handle_notifications(n):

session_settings["loaded_plugins"] = g_pool.plugins.get_initializers()
session_settings["min_data_confidence"] = g_pool.min_data_confidence
session_settings[
"min_calibration_confidence"
] = g_pool.min_calibration_confidence
session_settings["min_calibration_confidence"] = (
g_pool.min_calibration_confidence
)
session_settings["ui_config"] = g_pool.gui.configuration
session_settings["window_position"] = glfw.get_window_pos(main_window)
session_settings["version"] = str(g_pool.version)
Expand Down
7 changes: 4 additions & 3 deletions pupil_src/launchables/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import os
import signal

Expand Down Expand Up @@ -297,9 +298,9 @@ def handle_notifications(n):
session_settings["version"] = str(g_pool.version)
session_settings["eye0_process_alive"] = eye_procs_alive[0].value
session_settings["eye1_process_alive"] = eye_procs_alive[1].value
session_settings[
"min_calibration_confidence"
] = g_pool.min_calibration_confidence
session_settings["min_calibration_confidence"] = (
g_pool.min_calibration_confidence
)
session_settings["audio_mode"] = audio.get_audio_mode()
session_settings.close()

Expand Down
7 changes: 4 additions & 3 deletions pupil_src/launchables/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import os
import platform
import signal
Expand Down Expand Up @@ -809,9 +810,9 @@ def window_should_update():
session_settings["version"] = str(g_pool.version)
session_settings["eye0_process_alive"] = eye_procs_alive[0].value
session_settings["eye1_process_alive"] = eye_procs_alive[1].value
session_settings[
"min_calibration_confidence"
] = g_pool.min_calibration_confidence
session_settings["min_calibration_confidence"] = (
g_pool.min_calibration_confidence
)
session_settings["pupil_detection_enabled"] = g_pool.pupil_detection_enabled
session_settings["audio_mode"] = audio.get_audio_mode()

Expand Down
21 changes: 13 additions & 8 deletions pupil_src/shared_modules/accuracy_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import logging
import traceback
import typing as T
Expand Down Expand Up @@ -273,10 +274,12 @@ def ignore(_):
self,
"Angular Accuracy",
setter=ignore,
getter=lambda: f"{self.accuracy.result:.3f} deg. Samples used: "
f"{self.accuracy.num_used} / {self.accuracy.num_total}"
if self.accuracy is not None
else "Not available",
getter=lambda: (
f"{self.accuracy.result:.3f} deg. Samples used: "
f"{self.accuracy.num_used} / {self.accuracy.num_total}"
if self.accuracy is not None
else "Not available"
),
)
)
self.menu.append(ui.Info_Text(precision_help))
Expand All @@ -286,10 +289,12 @@ def ignore(_):
self,
"Angular Precision",
setter=ignore,
getter=lambda: f"{self.precision.result:.3f} deg. Samples used: "
f"{self.precision.num_used} / {self.precision.num_total}"
if self.precision is not None
else "Not available",
getter=lambda: (
f"{self.precision.result:.3f} deg. Samples used: "
f"{self.precision.num_used} / {self.precision.num_total}"
if self.precision is not None
else "Not available"
),
)
)

Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import abc
import csv
import json
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/audio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import logging
import platform
import subprocess as sp
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/audio_playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import collections
import itertools
import logging
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/audio_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import collections
import logging
import traceback
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/av_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import abc
import collections
import logging
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/background_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import logging
import multiprocessing as mp
import signal
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/blink_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import csv
import logging
import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

from .base_plugin import (
CalibrationChoreographyPlugin,
ChoreographyAction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import abc
import enum
import functools as F
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

from .gui_monitor import GUIMonitor
from .gui_window import GUIWindow
from .marker_window_controller import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import collections
import typing as T

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import collections
import contextlib
import platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import abc
import functools
import logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import abc
import logging
import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

from .monitor_selection_mixin import MonitorSelectionMixin
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import logging
import typing as T

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import logging
import os
import typing as T
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import logging
import typing as T

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import enum
import logging
import typing as T
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/camera_intrinsics_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import cv2
import gl_utils
import glfw
Expand Down
16 changes: 6 additions & 10 deletions pupil_src/shared_modules/camera_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import abc
import ast
import logging
Expand Down Expand Up @@ -350,17 +351,15 @@ def focal_length(self) -> float:
return (fx + fy) / 2

@abc.abstractmethod
def undistort(self, img: npt.NDArray[np.uint8]) -> npt.NDArray[np.uint8]:
...
def undistort(self, img: npt.NDArray[np.uint8]) -> npt.NDArray[np.uint8]: ...

@abc.abstractmethod
def unprojectPoints(
self,
pts_2d: npt.NDArray[np.float64],
use_distortion: bool = True,
normalize: bool = False,
) -> npt.NDArray[np.float64]:
...
) -> npt.NDArray[np.float64]: ...

@abc.abstractmethod
def projectPoints(
Expand All @@ -369,14 +368,12 @@ def projectPoints(
rvec: T.Optional[npt.NDArray[np.float64]] = None,
tvec: T.Optional[npt.NDArray[np.float64]] = None,
use_distortion: bool = True,
):
...
): ...

@abc.abstractmethod
def undistort_points_to_ideal_point_coordinates(
self, points: npt.NDArray[np.float64]
) -> npt.NDArray[np.float64]:
...
) -> npt.NDArray[np.float64]: ...

def undistort_points_on_image_plane(
self, points: npt.NDArray[np.float64]
Expand All @@ -401,8 +398,7 @@ def solvePnP(
useExtrinsicGuess: bool = False,
rvec: T.Optional[np.ndarray] = None,
tvec: T.Optional[np.ndarray] = None,
):
...
): ...

subclass_by_cam_type: T.Dict[str, T.Type["Camera_Model"]] = dict()

Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/csv_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import abc
import csv
import os
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/cv2_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

from cv2 import VideoWriter


Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/data_changed.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

"""
Contains classes to announce available data between different plugins. Data (e.g.
pupil positions or gaze) is produced by some plugins and consumed by others. Data
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/file_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import collections
import collections.abc
import copy
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/fixation_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

"""
Fixations general knowledge from literature review
+ Goldberg et al. - fixations rarely < 100ms and range between 200ms and 400ms in
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/gaze_mapping/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

from typing import Dict, List, Type

from . import gazer_base, matching
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/gaze_mapping/gazer_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

import abc
import logging
import typing as T
Expand Down
1 change: 1 addition & 0 deletions pupil_src/shared_modules/gaze_mapping/gazer_3d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""

from .gazer_headset import Gazer3D, NeonGazer3D
from .gazer_hmd import GazerHMD3D, PosthocGazerHMD3D
Loading

0 comments on commit 3adcae4

Please sign in to comment.