Skip to content

Commit 81bbb2e

Browse files
chore: update pre-commit hooks (#1642)
* chore: update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.1](astral-sh/ruff-pre-commit@v0.1.14...v0.2.1) - [github.com/psf/black: 23.12.1 → 24.2.0](psf/black@23.12.1...24.2.0) * run black incl. comments for '...' --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Josh Moore <[email protected]>
1 parent e50b471 commit 81bbb2e

File tree

8 files changed

+17
-10
lines changed

8 files changed

+17
-10
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ default_language_version:
88
repos:
99
- repo: https://github.com/astral-sh/ruff-pre-commit
1010
# Ruff version.
11-
rev: 'v0.1.14'
11+
rev: 'v0.2.1'
1212
hooks:
1313
- id: ruff
1414
- repo: https://github.com/psf/black
15-
rev: 23.12.1
15+
rev: 24.2.0
1616
hooks:
1717
- id: black
1818
- repo: https://github.com/codespell-project/codespell

zarr/convenience.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Convenience functions for storing and loading data."""
2+
23
import itertools
34
import os
45
import re

zarr/core.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,9 +2060,11 @@ def _process_chunk(
20602060
index_selection = PartialChunkIterator(chunk_selection, self.chunks)
20612061
for start, nitems, partial_out_selection in index_selection:
20622062
expected_shape = [
2063-
len(range(*partial_out_selection[i].indices(self.chunks[0] + 1)))
2064-
if i < len(partial_out_selection)
2065-
else dim
2063+
(
2064+
len(range(*partial_out_selection[i].indices(self.chunks[0] + 1)))
2065+
if i < len(partial_out_selection)
2066+
else dim
2067+
)
20662068
for i, dim in enumerate(self.chunks)
20672069
]
20682070
if isinstance(cdata, UncompressedPartialReadBufferV3):

zarr/indexing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,11 +545,11 @@ def ix_(selection, shape):
545545

546546
# replace slice and int as these are not supported by numpy.ix_
547547
selection = [
548-
slice_to_range(dim_sel, dim_len)
549-
if isinstance(dim_sel, slice)
550-
else [dim_sel]
551-
if is_integer(dim_sel)
552-
else dim_sel
548+
(
549+
slice_to_range(dim_sel, dim_len)
550+
if isinstance(dim_sel, slice)
551+
else [dim_sel] if is_integer(dim_sel) else dim_sel
552+
)
553553
for dim_sel, dim_len in zip(selection, shape)
554554
]
555555

zarr/n5.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""This module contains a storage class and codec to support the N5 format.
22
"""
3+
34
import os
45
import struct
56
import sys

zarr/storage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
path) and a `getsize` method (return the size in bytes of a given value).
1515
1616
"""
17+
1718
import atexit
1819
import errno
1920
import glob

zarr/sync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Synchronizer(Protocol):
88
"""Base class for synchronizers."""
99

1010
def __getitem__(self, item):
11+
# see subclasses
1112
...
1213

1314

zarr/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010

1111
class MetaArray(Protocol):
1212
def __array_function__(self, func, types, args, kwargs):
13+
# To be extended
1314
...

0 commit comments

Comments
 (0)