Skip to content

Commit 1eade74

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e679cee commit 1eade74

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

python/egglog/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from . import config, ipython_magic # noqa: F401
66
from .bindings import EggSmolError, StageInfo, TimeOnly, WithPlan # noqa: F401
7-
from .builtins import * # noqa: UP029
7+
from .builtins import *
88
from .conversion import *
99
from .deconstruct import *
1010
from .egraph import *

python/tests/test_array_api.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,14 @@ def linalg_norm(X: NDArray, axis: TupleIntLike) -> NDArray:
210210
return NDArray(
211211
outshape,
212212
X.dtype,
213-
lambda k: LoopNestAPI.from_tuple(reduce_axis)
214-
.unwrap()
215-
.indices()
216-
.foldl_value(lambda carry, i: carry + ((x := X.index(i + k)).conj() * x).real(), init=0.0)
217-
.sqrt(),
213+
lambda k: (
214+
LoopNestAPI
215+
.from_tuple(reduce_axis)
216+
.unwrap()
217+
.indices()
218+
.foldl_value(lambda carry, i: carry + ((x := X.index(i + k)).conj() * x).real(), init=0.0)
219+
.sqrt()
220+
),
218221
)
219222

220223

@@ -224,9 +227,11 @@ def linalg_norm_v2(X: NDArrayLike, axis: TupleIntLike) -> NDArray:
224227
return NDArray(
225228
X.shape.deselect(axis),
226229
X.dtype,
227-
lambda k: ndindex(X.shape.select(axis))
228-
.foldl_value(lambda carry, i: carry + ((x := X.index(i + k)).conj() * x).real(), init=0.0)
229-
.sqrt(),
230+
lambda k: (
231+
ndindex(X.shape.select(axis))
232+
.foldl_value(lambda carry, i: carry + ((x := X.index(i + k)).conj() * x).real(), init=0.0)
233+
.sqrt()
234+
),
230235
)
231236

232237

0 commit comments

Comments
 (0)