Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #2324

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -15,25 +15,25 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.19.0
hooks:
- id: pyupgrade
name: PyUpgrade 3.6+
args: ["--py36-plus"]
exclude: ^bin/

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: [--profile, black]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
rev: v2.7.0
hooks:
- id: setup-cfg-fmt
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
Loading