diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dca3c646..fe681410 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.18 hooks: - id: uv-lock 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() + ), )