From 7174241c71db7f104e692023cfa7d8153e1ac1bf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 19:47:55 +0000 Subject: [PATCH 1/2] ci: pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/compilerla/conventional-pre-commit: v2.4.0 → v4.3.0](https://github.com/compilerla/conventional-pre-commit/compare/v2.4.0...v4.3.0) - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v6.0.0) - [github.com/Lucas-C/pre-commit-hooks-safety: v1.3.2 → v1.4.2](https://github.com/Lucas-C/pre-commit-hooks-safety/compare/v1.3.2...v1.4.2) - [github.com/PyCQA/docformatter: v1.7.5 → v1.7.7](https://github.com/PyCQA/docformatter/compare/v1.7.5...v1.7.7) - [github.com/nbQA-dev/nbQA: 1.7.0 → 1.9.1](https://github.com/nbQA-dev/nbQA/compare/1.7.0...1.9.1) - [github.com/bwhmather/ssort: v0.11.6 → 0.15.0](https://github.com/bwhmather/ssort/compare/v0.11.6...0.15.0) - [github.com/asottile/pyupgrade: v3.15.0 → v3.21.1](https://github.com/asottile/pyupgrade/compare/v3.15.0...v3.21.1) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 23.10.1 → 25.11.0](https://github.com/psf/black-pre-commit-mirror/compare/23.10.1...25.11.0) - [github.com/PyCQA/isort: 5.12.0 → 7.0.0](https://github.com/PyCQA/isort/compare/5.12.0...7.0.0) - [github.com/PyCQA/pylint: v3.0.1 → v4.0.2](https://github.com/PyCQA/pylint/compare/v3.0.1...v4.0.2) - [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.18.2](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.18.2) - [github.com/PyCQA/bandit: 1.7.5 → 1.8.6](https://github.com/PyCQA/bandit/compare/1.7.5...1.8.6) - [github.com/kynan/nbstripout: 0.6.1 → 0.8.1](https://github.com/kynan/nbstripout/compare/0.6.1...0.8.1) --- .pre-commit-config.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c68489..ee11226 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ ci: repos: - repo: https://github.com/compilerla/conventional-pre-commit - rev: v2.4.0 + rev: v4.3.0 hooks: - id: conventional-pre-commit stages: [commit-msg] @@ -36,7 +36,7 @@ repos: ] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -70,18 +70,18 @@ repos: - id: text-unicode-replacement-char - repo: https://github.com/Lucas-C/pre-commit-hooks-safety - rev: v1.3.2 + rev: v1.4.2 hooks: - id: python-safety-dependencies-check files: pyproject.toml - repo: https://github.com/PyCQA/docformatter - rev: v1.7.5 + rev: v1.7.7 hooks: - id: docformatter - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.0 + rev: 1.9.1 hooks: - id: nbqa-check-ast - id: nbqa-mypy @@ -89,36 +89,36 @@ repos: - id: nbqa-pyupgrade - repo: https://github.com/bwhmather/ssort - rev: v0.11.6 + rev: 0.15.0 hooks: - id: ssort - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.21.1 hooks: - id: pyupgrade - - repo: https://github.com/psf/black - rev: 23.10.1 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 25.11.0 hooks: - id: black - id: black-jupyter files: \.ipynb$ - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 7.0.0 hooks: - id: isort args: ["--profile=black"] - repo: https://github.com/PyCQA/pylint - rev: v3.0.1 + rev: v4.0.2 hooks: - id: pylint args: ["--rcfile=pyproject.toml"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.18.2 hooks: - id: mypy args: @@ -126,7 +126,7 @@ repos: exclude: "tests" - repo: https://github.com/PyCQA/bandit - rev: 1.7.5 + rev: 1.8.6 hooks: - id: bandit exclude: "^tests/" @@ -134,7 +134,7 @@ repos: - "-r" - repo: https://github.com/kynan/nbstripout - rev: 0.6.1 + rev: 0.8.1 hooks: - id: nbstripout From 2cd9df942e856fc375512710d7530bfeeca5daa2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 19:48:59 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/autoembedder/data.py | 2 +- src/autoembedder/evaluator.py | 8 +++++--- src/autoembedder/learner.py | 19 ++++++++++++------- src/autoembedder/model.py | 8 +++++--- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/autoembedder/data.py b/src/autoembedder/data.py index 9f47b55..8778f66 100644 --- a/src/autoembedder/data.py +++ b/src/autoembedder/data.py @@ -28,7 +28,7 @@ def __init__( @staticmethod def _data_from_source( - source: Union[str, dd.DataFrame, pd.DataFrame] + source: Union[str, dd.DataFrame, pd.DataFrame], ) -> dd.DataFrame: if isinstance(source, str): try: diff --git a/src/autoembedder/evaluator.py b/src/autoembedder/evaluator.py index fde110d..2f2b7ca 100644 --- a/src/autoembedder/evaluator.py +++ b/src/autoembedder/evaluator.py @@ -37,9 +37,11 @@ def _predict( device = torch.device( "cuda" if torch.cuda.is_available() - else "mps" - if torch.backends.mps.is_available() and parameters.get("use_mps", False) - else "cpu" + else ( + "mps" + if torch.backends.mps.is_available() and parameters.get("use_mps", False) + else "cpu" + ) ) with torch.no_grad(): diff --git a/src/autoembedder/learner.py b/src/autoembedder/learner.py index 3bc5610..cf2533b 100644 --- a/src/autoembedder/learner.py +++ b/src/autoembedder/learner.py @@ -362,9 +362,12 @@ def fit( torch.device( "cuda" if torch.cuda.is_available() - else "mps" - if torch.backends.mps.is_available() and parameters.get("use_mps", False) - else "cpu" + else ( + "mps" + if torch.backends.mps.is_available() + and parameters.get("use_mps", False) + else "cpu" + ) ) ) if ( @@ -437,10 +440,12 @@ def fit( map_location=torch.device( "cuda" if torch.cuda.is_available() - else "mps" - if torch.backends.mps.is_available() - and parameters.get("use_mps", False) - else "cpu" + else ( + "mps" + if torch.backends.mps.is_available() + and parameters.get("use_mps", False) + else "cpu" + ) ), ) Checkpoint.load_objects( diff --git a/src/autoembedder/model.py b/src/autoembedder/model.py index 5a1296a..700ea2f 100644 --- a/src/autoembedder/model.py +++ b/src/autoembedder/model.py @@ -58,9 +58,11 @@ def model_input( device = torch.device( "cuda" if torch.cuda.is_available() - else "mps" - if torch.backends.mps.is_available() and parameters.get("use_mps", False) - else "cpu" + else ( + "mps" + if torch.backends.mps.is_available() and parameters.get("use_mps", False) + else "cpu" + ) ) cat = [] cont = []