From b9cc3255fa214274c744c9434f529f6b0ac28839 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 21:14:56 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.22 → v0.16.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.22...v0.16.10) - [github.com/PyCQA/isort: 9.0.0b1 → 9.0.2](https://github.com/PyCQA/isort/compare/9.0.0b1...9.0.2) - [github.com/PyCQA/autoflake: v2.3.3 → v2.4.0](https://github.com/PyCQA/autoflake/compare/v2.3.3...v2.4.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fcb9eb6..acc08d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,14 +12,14 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.22 + rev: v0.16.10 hooks: - id: ruff args: [--fix] exclude: \.ipynb$ - id: ruff-format - repo: https://github.com/PyCQA/isort - rev: 9.0.0b1 + rev: 9.0.2 hooks: - id: isort args: ["--profile", "black", "--filter-files"] @@ -28,7 +28,7 @@ repos: hooks: - id: pyupgrade - repo: https://github.com/PyCQA/autoflake - rev: v2.3.3 + rev: v2.4.0 hooks: - id: autoflake args: ["--remove-all-unused-imports", "--in-place"] From f05ca87cb98eb7eb94153d1458b7d962490e0d14 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 21:15:59 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- data_loader.py | 2 +- features_loader.py | 2 +- utils/functional_video.py | 4 +--- utils/transforms_video.py | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/data_loader.py b/data_loader.py index e33a997..9ee0846 100644 --- a/data_loader.py +++ b/data_loader.py @@ -91,7 +91,7 @@ def __getitem__(self, index: int, max_retries: int = 10): raise RuntimeError( f"VideoIter:: failed to load a sample after {max_retries} retries" ) from e - index = np.random.choice(range(0, self.__len__())) + index = np.random.choice(range(self.__len__())) trace_back = sys.exc_info()[2] if trace_back is not None: line = str(trace_back.tb_lineno) diff --git a/features_loader.py b/features_loader.py index 8731345..7674eb1 100644 --- a/features_loader.py +++ b/features_loader.py @@ -65,7 +65,7 @@ def __getitem__(self, index: int, max_retries: int = 10) -> tuple[Tensor, Tensor raise RuntimeError( f"FeaturesLoader:: failed to load a sample after {max_retries} retries" ) from e - index = np.random.choice(range(0, self.__len__())) + index = np.random.choice(range(self.__len__())) logging.warning( f"FeaturesLoader:: ERROR!! (Force using another index:\n{index})\n{e}" ) diff --git a/utils/functional_video.py b/utils/functional_video.py index 864ef99..0f010e5 100644 --- a/utils/functional_video.py +++ b/utils/functional_video.py @@ -68,9 +68,7 @@ def to_tensor(clip): """ _is_tensor_video_clip(clip) if not clip.dtype == torch.uint8: - raise TypeError( - f"clip tensor should have data type uint8. Got {str(clip.dtype)}" - ) + raise TypeError(f"clip tensor should have data type uint8. Got {clip.dtype!s}") return clip.float().permute(3, 0, 1, 2) / 255.0 diff --git a/utils/transforms_video.py b/utils/transforms_video.py index 2040664..788105b 100644 --- a/utils/transforms_video.py +++ b/utils/transforms_video.py @@ -9,11 +9,11 @@ from . import functional_video as F __all__ = [ - "RandomResizedCropVideo", "CenterCropVideo", "NormalizeVideo", - "ToTensorVideo", "RandomHorizontalFlipVideo", + "RandomResizedCropVideo", + "ToTensorVideo", ]