Skip to content

Commit e9bd259

Browse files
committed
fix format
1 parent 177ad78 commit e9bd259

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

numojo/core/ndarray.mojo

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2643,7 +2643,13 @@ struct NDArray[dtype: DType = DType.float64](
26432643
message=String(
26442644
"Integer index {} out of bounds for axis {}"
26452645
" (size {}). Valid range: [-{}, {})."
2646-
).format(idx, i, self.shape[i], self.shape[i], self.shape[i]),
2646+
).format(
2647+
idx,
2648+
i,
2649+
self.shape[i],
2650+
self.shape[i],
2651+
self.shape[i],
2652+
),
26472653
location=(
26482654
"NDArray.__setitem__(*slices: Variant[Slice,"
26492655
" Int], scalar: Scalar)"

tests/core/test_setitem_scalar.mojo

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def test_setitem_list_slice_scalar_1d() raises:
3434

3535

3636
def test_setitem_list_slice_scalar_2d_submatrix() raises:
37-
"""List[Slice] scalar: fills a 2x2 sub-matrix, surrounding values unchanged."""
37+
"""List[Slice] scalar: fills a 2x2 sub-matrix, surrounding values unchanged.
38+
"""
3839
var a = nm.arange[nm.i32](0, 16, step=1).reshape(Shape(4, 4))
3940
var sl = List[Slice]()
4041
sl.append(Slice(1, 3))
@@ -152,7 +153,9 @@ def test_setitem_variadic_slice_scalar_2d() raises:
152153
assert_equal(
153154
Int(a.item(i, j)),
154155
Int(b.item(i, j)),
155-
String("*Slice and List[Slice] scalar paths diverge at ({},{})").format(i, j),
156+
String(
157+
"*Slice and List[Slice] scalar paths diverge at ({},{})"
158+
).format(i, j),
156159
)
157160

158161

@@ -301,7 +304,9 @@ def test_setitem_mixed_agrees_with_list_slice_scalar() raises:
301304
assert_equal(
302305
Int(a.item(i, j)),
303306
Int(b.item(i, j)),
304-
String("Mixed and List[Slice] scalar paths diverge at ({},{})").format(i, j),
307+
String(
308+
"Mixed and List[Slice] scalar paths diverge at ({},{})"
309+
).format(i, j),
305310
)
306311

307312

0 commit comments

Comments
 (0)