From ed1f3a1f2b3aa9b06040f71c823e08785d5174cb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 21:56:38 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 2 +- src/pupil_labs/dynamic_content_on_rim/dynamic_rim.py | 7 ++++--- src/pupil_labs/dynamic_content_on_rim/video/read.py | 8 ++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/setup.cfg b/setup.cfg index 9da973e..d91eac3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,7 @@ install_requires = pandas rich importlib-metadata;python_version<"3.8" -python_requires = >=3.7 +python_requires = >=3.8 include_package_data = true package_dir = =src diff --git a/src/pupil_labs/dynamic_content_on_rim/dynamic_rim.py b/src/pupil_labs/dynamic_content_on_rim/dynamic_rim.py index dbc7ce1..9411b20 100644 --- a/src/pupil_labs/dynamic_content_on_rim/dynamic_rim.py +++ b/src/pupil_labs/dynamic_content_on_rim/dynamic_rim.py @@ -3,6 +3,7 @@ This script is used to plot gaze over a video displayed on RIM enrichment eye tracking recording. """ + import glob import logging import os @@ -162,9 +163,9 @@ def main(): # Applying the perspective transform xy_transf = cv2.perspectiveTransform(xy, M) # Saving the transformed gaze points - gaze_rim_df[ - ["gaze position transf x [px]", "gaze position transf y [px]"] - ] = pd.DataFrame(xy_transf[0]).set_index(gaze_rim_df.index) + gaze_rim_df[["gaze position transf x [px]", "gaze position transf y [px]"]] = ( + pd.DataFrame(xy_transf[0]).set_index(gaze_rim_df.index) + ) # Get the patch of the screen mask = np.zeros(np.asarray(ref_img.shape)[0:2], dtype=np.uint8) cv2.fillPoly( diff --git a/src/pupil_labs/dynamic_content_on_rim/video/read.py b/src/pupil_labs/dynamic_content_on_rim/video/read.py index 3c95745..a6a7f5e 100644 --- a/src/pupil_labs/dynamic_content_on_rim/video/read.py +++ b/src/pupil_labs/dynamic_content_on_rim/video/read.py @@ -29,8 +29,12 @@ def read_video_ts(video_path, audio=False, auto_thread_type=True): for frame in packet.decode(): if frame is not None and frame.pts is not None: pts.append(frame.pts) - dts.append(frame.dts) if frame.dts is not None else logging.info( - f"Decoding timestamp is missing at frame {len(pts)}" + ( + dts.append(frame.dts) + if frame.dts is not None + else logging.info( + f"Decoding timestamp is missing at frame {len(pts)}" + ) ) ts.append( (