Skip to content

Commit

Permalink
Merge branch 'main' of github.com:zarr-developers/zarr-python into s3…
Browse files Browse the repository at this point in the history
…_zip_docs
  • Loading branch information
d-v-b committed Feb 15, 2024
2 parents e94c9fe + 7449853 commit 0687b1d
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ default_language_version:
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.1.14'
rev: 'v0.2.1'
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev_numpy.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Break this out into a separate file to allow testing against
# different versions of numpy. This file should pin to the latest
# numpy version.
numpy==1.24.3
numpy==1.26.1
2 changes: 1 addition & 1 deletion requirements_dev_optional.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
lmdb==1.4.1; sys_platform != 'win32'
# optional library requirements for Jupyter
ipytree==0.2.2
ipywidgets==8.1.0
ipywidgets==8.1.2
# optional library requirements for services
# don't let pyup change pinning for azure-storage-blob, need to pin to older
# version to get compatibility with azure storage emulator on appveyor (FIXME)
Expand Down
1 change: 1 addition & 0 deletions zarr/convenience.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Convenience functions for storing and loading data."""

import itertools
import os
import re
Expand Down
8 changes: 5 additions & 3 deletions zarr/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2060,9 +2060,11 @@ def _process_chunk(
index_selection = PartialChunkIterator(chunk_selection, self.chunks)
for start, nitems, partial_out_selection in index_selection:
expected_shape = [
len(range(*partial_out_selection[i].indices(self.chunks[0] + 1)))
if i < len(partial_out_selection)
else dim
(
len(range(*partial_out_selection[i].indices(self.chunks[0] + 1)))
if i < len(partial_out_selection)
else dim
)
for i, dim in enumerate(self.chunks)
]
if isinstance(cdata, UncompressedPartialReadBufferV3):
Expand Down
10 changes: 5 additions & 5 deletions zarr/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,11 @@ def ix_(selection, shape):

# replace slice and int as these are not supported by numpy.ix_
selection = [
slice_to_range(dim_sel, dim_len)
if isinstance(dim_sel, slice)
else [dim_sel]
if is_integer(dim_sel)
else dim_sel
(
slice_to_range(dim_sel, dim_len)
if isinstance(dim_sel, slice)
else [dim_sel] if is_integer(dim_sel) else dim_sel
)
for dim_sel, dim_len in zip(selection, shape)
]

Expand Down
1 change: 1 addition & 0 deletions zarr/n5.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""This module contains a storage class and codec to support the N5 format.
"""

import os
import struct
import sys
Expand Down
1 change: 1 addition & 0 deletions zarr/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
path) and a `getsize` method (return the size in bytes of a given value).
"""

import atexit
import errno
import glob
Expand Down
1 change: 1 addition & 0 deletions zarr/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class Synchronizer(Protocol):
"""Base class for synchronizers."""

def __getitem__(self, item):
# see subclasses
...


Expand Down
4 changes: 2 additions & 2 deletions zarr/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ def test_set_selections_with_fields():
),
(
(slice(0, 10, 1),),
np.arange(0, 10).reshape((10)),
np.arange(0, 10).reshape(10),
[(0, 10, (slice(0, 10, 1),))],
),
((0,), np.arange(0, 100).reshape((10, 10)), [(0, 10, (slice(0, 1, 1),))]),
Expand All @@ -1644,7 +1644,7 @@ def test_set_selections_with_fields():
np.arange(0, 100).reshape((10, 10)),
[(0, 1, (slice(0, 1, 1), slice(0, 1, 1)))],
),
((0,), np.arange(0, 10).reshape((10)), [(0, 1, (slice(0, 1, 1),))]),
((0,), np.arange(0, 10).reshape(10), [(0, 1, (slice(0, 1, 1),))]),
pytest.param(
(slice(5, 8, 1), slice(2, 4, 1), slice(0, 5, 1)),
np.arange(2, 100002).reshape((10, 1, 10000)),
Expand Down
1 change: 1 addition & 0 deletions zarr/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

class MetaArray(Protocol):
def __array_function__(self, func, types, args, kwargs):
# To be extended
...

0 comments on commit 0687b1d

Please sign in to comment.