Skip to content

Commit 8362f0a

Browse files
Apply ruff rules (RUF) (#2319)
* Apply ruff rule RUF022 RUF022 `__all__` is not sorted * Apply ruff rule RUF031 RUF031 Avoid parentheses for tuples in subscripts.
1 parent 66afca6 commit 8362f0a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/zarr/abc/codec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
from zarr.core.indexing import SelectorTuple
2121

2222
__all__ = [
23-
"BaseCodec",
2423
"ArrayArrayCodec",
2524
"ArrayBytesCodec",
2625
"ArrayBytesCodecPartialDecodeMixin",
2726
"ArrayBytesCodecPartialEncodeMixin",
27+
"BaseCodec",
2828
"BytesBytesCodec",
2929
"CodecInput",
3030
"CodecOutput",

src/zarr/codecs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"ShardingCodec",
2929
"ShardingCodecIndexLocation",
3030
"TransposeCodec",
31-
"VLenUTF8Codec",
3231
"VLenBytesCodec",
32+
"VLenUTF8Codec",
3333
"ZstdCodec",
3434
]
3535

tests/v3/test_indexing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,8 +1838,8 @@ def test_indexing_equals_numpy(store: StorePath, selection: Selection) -> None:
18381838
a = np.arange(10000, dtype=int).reshape(1000, 10)
18391839
z = zarr_array_from_numpy_array(store, a, chunk_shape=(300, 3))
18401840
# note: in python 3.10 a[*selection] is not valid unpacking syntax
1841-
expected = a[(*selection,)]
1842-
actual = z[(*selection,)]
1841+
expected = a[*selection,]
1842+
actual = z[*selection,]
18431843
assert_array_equal(expected, actual, err_msg=f"selection: {selection}")
18441844

18451845

@@ -1859,7 +1859,7 @@ def test_orthogonal_bool_indexing_like_numpy_ix(
18591859
z = zarr_array_from_numpy_array(store, a, chunk_shape=(300, 3))
18601860
expected = a[np.ix_(*selection)]
18611861
# note: in python 3.10 z[*selection] is not valid unpacking syntax
1862-
actual = z[(*selection,)]
1862+
actual = z[*selection,]
18631863
assert_array_equal(expected, actual, err_msg=f"{selection=}")
18641864

18651865

0 commit comments

Comments
 (0)