Skip to content

Commit 876e4fe

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

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

python/zarrs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from ._internal import __version__
22
from .pipeline import ZarrsCodecPipeline as _ZarrsCodecPipeline
3-
from .utils import UnsupportedVIndexingError, DiscontiguousArrayError
3+
from .utils import DiscontiguousArrayError, UnsupportedVIndexingError
44

55

66
# Need to do this redirection so people can access the pipeline as `zarrs.ZarrsCodecPipeline` instead of `zarrs.pipeline.ZarrsCodecPipeline`

python/zarrs/utils.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ def make_chunk_info_for_rust_with_indices(
182182
shape_chunk_selection = get_shape_for_selector(
183183
chunk_selection, chunk_spec.shape, pad=True, drop_axes=drop_axes
184184
)
185-
if (chunk_size := prod_op(shape_chunk_selection)) != prod_op(shape_chunk_selection_slices):
185+
if (chunk_size := prod_op(shape_chunk_selection)) != prod_op(
186+
shape_chunk_selection_slices
187+
):
186188
raise UnsupportedVIndexingError(
187189
f"{shape_chunk_selection} != {shape_chunk_selection_slices}"
188190
)
@@ -192,13 +194,18 @@ def make_chunk_info_for_rust_with_indices(
192194
)
193195
# We need to have io_array_shape and out_selection_expanded with dimensionalities matching that of the underlying array.
194196
# So if we detect that a dimension has been dropped (due to a singleton axis) when converting to slices, we update these two values.
195-
if not is_constant and len(shape_chunk_selection) != len(shape_chunk_selection_slices):
197+
if not is_constant and len(shape_chunk_selection) != len(
198+
shape_chunk_selection_slices
199+
):
196200
shape_ctr = 0
197201
io_array_shape = []
198202
out_selection_expanded = []
199203
for shape_chunk in shape_chunk_selection_slices:
200204
# Append 1/size-1 slice if this dimension has been dropped on the io_array i.e., shape_chunk_selection has been exhausted so there is an extra 1-sized dimension at the end or has a mismatch with the "full" chunk shape `shape_chunk_selection_slices`.
201-
if shape_chunk == 1 and (shape_ctr >= len(shape_chunk_selection) or shape_chunk != shape_chunk_selection[shape_ctr]):
205+
if shape_chunk == 1 and (
206+
shape_ctr >= len(shape_chunk_selection)
207+
or shape_chunk != shape_chunk_selection[shape_ctr]
208+
):
202209
io_array_shape += [1]
203210
out_selection_expanded += [slice(0, 1)]
204211
else:

0 commit comments

Comments
 (0)