From 08505071b7a8a1cb1d6aac92813561b1a0723a55 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 20:27:27 +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.14.3 → v0.14.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.3...v0.14.10) - [github.com/astral-sh/uv-pre-commit: 0.9.7 → 0.9.21](https://github.com/astral-sh/uv-pre-commit/compare/0.9.7...0.9.21) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dca3c646..fb3ada2c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ exclude: ^python/tests/__snapshots__/ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.3 + rev: v0.14.10 hooks: - id: ruff-check args: [--fix] - id: ruff-format - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.9.7 + rev: 0.9.21 hooks: - id: uv-lock From 1579e6b12b4d132dfb571b2fa433bcaeb30d98c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 20:27:34 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- python/egglog/__init__.py | 2 +- python/tests/test_array_api.py | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/python/egglog/__init__.py b/python/egglog/__init__.py index 7d20dfdb..66e7402b 100644 --- a/python/egglog/__init__.py +++ b/python/egglog/__init__.py @@ -4,7 +4,7 @@ from . import config, ipython_magic # noqa: F401 from .bindings import EggSmolError, StageInfo, TimeOnly, WithPlan # noqa: F401 -from .builtins import * # noqa: UP029 +from .builtins import * from .conversion import * from .deconstruct import * from .egraph import * diff --git a/python/tests/test_array_api.py b/python/tests/test_array_api.py index 34564ddc..f3c50a7f 100644 --- a/python/tests/test_array_api.py +++ b/python/tests/test_array_api.py @@ -210,11 +210,14 @@ def linalg_norm(X: NDArray, axis: TupleIntLike) -> NDArray: return NDArray( outshape, X.dtype, - lambda k: LoopNestAPI.from_tuple(reduce_axis) - .unwrap() - .indices() - .foldl_value(lambda carry, i: carry + ((x := X.index(i + k)).conj() * x).real(), init=0.0) - .sqrt(), + lambda k: ( + LoopNestAPI + .from_tuple(reduce_axis) + .unwrap() + .indices() + .foldl_value(lambda carry, i: carry + ((x := X.index(i + k)).conj() * x).real(), init=0.0) + .sqrt() + ), ) @@ -224,9 +227,11 @@ def linalg_norm_v2(X: NDArrayLike, axis: TupleIntLike) -> NDArray: return NDArray( X.shape.deselect(axis), X.dtype, - lambda k: ndindex(X.shape.select(axis)) - .foldl_value(lambda carry, i: carry + ((x := X.index(i + k)).conj() * x).real(), init=0.0) - .sqrt(), + lambda k: ( + ndindex(X.shape.select(axis)) + .foldl_value(lambda carry, i: carry + ((x := X.index(i + k)).conj() * x).real(), init=0.0) + .sqrt() + ), )