From d6cccb69f03132d46ede7888bfeac14d3af2df16 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Fri, 20 Sep 2024 20:02:41 -0700 Subject: [PATCH 1/7] chore(deps): drop support for python 3.10 and numpy 124 --- .github/workflows/test.yml | 4 ++-- pyproject.toml | 25 ++++++++++++------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48e579711..5683b62df 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,8 +21,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] - numpy-version: ['1.24', '1.26', '2.0'] + python-version: ['3.11', '3.12'] + numpy-version: ['1.25', '1.26', '2.0'] dependency-set: ["minimal", "optional"] steps: diff --git a/pyproject.toml b/pyproject.toml index 41c2006b2..2f6e19f5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,13 +20,13 @@ maintainers = [ { name = "Norman Rzepka" }, { name = "Ryan Abernathey" } ] -requires-python = ">=3.10" +requires-python = ">=3.11" # If you add a new dependency here, please also add it to .pre-commit-config.yml dependencies = [ 'asciitree', - 'numpy>=1.24', + 'numpy>=1.25', 'fasteners', - 'numcodecs>=0.10.0', + 'numcodecs>=0.10.2', 'fsspec>2024', 'crc32c', 'typing_extensions', @@ -45,7 +45,6 @@ classifiers = [ 'Topic :: Software Development :: Libraries :: Python Modules', 'Operating System :: Unix', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', ] @@ -130,18 +129,18 @@ dependencies = [ features = ["test", "extra"] [[tool.hatch.envs.test.matrix]] -python = ["3.10", "3.11", "3.12"] -numpy = ["1.24", "1.26", "2.0"] +python = ["3.11", "3.12"] +numpy = ["1.25", "1.26", "2.0"] version = ["minimal"] [[tool.hatch.envs.test.matrix]] -python = ["3.10", "3.11", "3.12"] -numpy = ["1.24", "1.26", "2.0"] +python = ["3.11", "3.12"] +numpy = ["1.25", "1.26", "2.0"] features = ["optional"] [[tool.hatch.envs.test.matrix]] -python = ["3.10", "3.11", "3.12"] -numpy = ["1.24", "1.26", "2.0"] +python = ["3.11", "3.12"] +numpy = ["1.25", "1.26", "2.0"] features = ["gpu"] [tool.hatch.envs.test.scripts] @@ -161,8 +160,8 @@ dependencies = [ features = ["test", "extra", "gpu"] [[tool.hatch.envs.gputest.matrix]] -python = ["3.10", "3.11", "3.12"] -numpy = ["1.24", "1.26", "2.0"] +python = ["3.11", "3.12"] +numpy = ["1.25", "1.26", "2.0"] version = ["minimal"] [tool.hatch.envs.gputest.scripts] @@ -222,7 +221,7 @@ ignore = [ ] [tool.mypy] -python_version = "3.10" +python_version = "3.11" ignore_missing_imports = true namespace_packages = false From 09aa1234f0a1465a1569ebcd78fe3d442d8c74a2 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Fri, 20 Sep 2024 20:07:29 -0700 Subject: [PATCH 2/7] lint --- src/zarr/abc/codec.py | 2 +- src/zarr/abc/metadata.py | 2 +- src/zarr/abc/store.py | 4 +--- src/zarr/codecs/blosc.py | 2 +- src/zarr/codecs/bytes.py | 2 +- src/zarr/codecs/crc32c_.py | 2 +- src/zarr/codecs/gzip.py | 2 +- src/zarr/codecs/pipeline.py | 2 +- src/zarr/codecs/sharding.py | 3 +-- src/zarr/codecs/transpose.py | 4 +--- src/zarr/codecs/zstd.py | 2 +- src/zarr/core/buffer/core.py | 3 +-- src/zarr/core/buffer/cpu.py | 3 +-- src/zarr/core/buffer/gpu.py | 3 +-- src/zarr/core/chunk_grids.py | 3 +-- src/zarr/core/metadata/common.py | 3 +-- src/zarr/core/metadata/v2.py | 3 +-- src/zarr/core/metadata/v3.py | 3 ++- src/zarr/core/sync.py | 2 +- src/zarr/testing/buffer.py | 3 +-- 20 files changed, 21 insertions(+), 32 deletions(-) diff --git a/src/zarr/abc/codec.py b/src/zarr/abc/codec.py index 2098d989e..057e66c4b 100644 --- a/src/zarr/abc/codec.py +++ b/src/zarr/abc/codec.py @@ -10,9 +10,9 @@ if TYPE_CHECKING: from collections.abc import Awaitable, Callable, Iterable + from typing import Self import numpy as np - from typing_extensions import Self from zarr.abc.store import ByteGetter, ByteSetter from zarr.core.array_spec import ArraySpec diff --git a/src/zarr/abc/metadata.py b/src/zarr/abc/metadata.py index 7ea668c89..239d151c0 100644 --- a/src/zarr/abc/metadata.py +++ b/src/zarr/abc/metadata.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self + from typing import Self from zarr.core.common import JSON diff --git a/src/zarr/abc/store.py b/src/zarr/abc/store.py index f95ba34ef..903279fb0 100644 --- a/src/zarr/abc/store.py +++ b/src/zarr/abc/store.py @@ -1,9 +1,7 @@ from abc import ABC, abstractmethod from asyncio import gather from collections.abc import AsyncGenerator, Iterable -from typing import Any, NamedTuple, Protocol, runtime_checkable - -from typing_extensions import Self +from typing import Any, NamedTuple, Protocol, Self, runtime_checkable from zarr.core.buffer import Buffer, BufferPrototype from zarr.core.common import AccessModeLiteral, BytesLike diff --git a/src/zarr/codecs/blosc.py b/src/zarr/codecs/blosc.py index 7b10d91a6..16bcf48a3 100644 --- a/src/zarr/codecs/blosc.py +++ b/src/zarr/codecs/blosc.py @@ -14,7 +14,7 @@ from zarr.registry import register_codec if TYPE_CHECKING: - from typing_extensions import Self + from typing import Self from zarr.core.array_spec import ArraySpec from zarr.core.buffer import Buffer diff --git a/src/zarr/codecs/bytes.py b/src/zarr/codecs/bytes.py index 7a683411e..78c7b22fb 100644 --- a/src/zarr/codecs/bytes.py +++ b/src/zarr/codecs/bytes.py @@ -13,7 +13,7 @@ from zarr.registry import register_codec if TYPE_CHECKING: - from typing_extensions import Self + from typing import Self from zarr.core.array_spec import ArraySpec diff --git a/src/zarr/codecs/crc32c_.py b/src/zarr/codecs/crc32c_.py index f814ba15e..3a6624ad2 100644 --- a/src/zarr/codecs/crc32c_.py +++ b/src/zarr/codecs/crc32c_.py @@ -12,7 +12,7 @@ from zarr.registry import register_codec if TYPE_CHECKING: - from typing_extensions import Self + from typing import Self from zarr.core.array_spec import ArraySpec from zarr.core.buffer import Buffer diff --git a/src/zarr/codecs/gzip.py b/src/zarr/codecs/gzip.py index 0dd31009c..6cc8517f2 100644 --- a/src/zarr/codecs/gzip.py +++ b/src/zarr/codecs/gzip.py @@ -11,7 +11,7 @@ from zarr.registry import register_codec if TYPE_CHECKING: - from typing_extensions import Self + from typing import Self from zarr.core.array_spec import ArraySpec from zarr.core.buffer import Buffer diff --git a/src/zarr/codecs/pipeline.py b/src/zarr/codecs/pipeline.py index 182621c59..6828377f9 100644 --- a/src/zarr/codecs/pipeline.py +++ b/src/zarr/codecs/pipeline.py @@ -21,9 +21,9 @@ if TYPE_CHECKING: from collections.abc import Iterable, Iterator + from typing import Self import numpy as np - from typing_extensions import Self from zarr.abc.store import ByteGetter, ByteSetter from zarr.core.array_spec import ArraySpec diff --git a/src/zarr/codecs/sharding.py b/src/zarr/codecs/sharding.py index 3ae51ce54..ab2bf4598 100644 --- a/src/zarr/codecs/sharding.py +++ b/src/zarr/codecs/sharding.py @@ -49,8 +49,7 @@ if TYPE_CHECKING: from collections.abc import Awaitable, Callable, Iterator - - from typing_extensions import Self + from typing import Self from zarr.core.common import JSON diff --git a/src/zarr/codecs/transpose.py b/src/zarr/codecs/transpose.py index 45eb5bbe5..9873014f8 100644 --- a/src/zarr/codecs/transpose.py +++ b/src/zarr/codecs/transpose.py @@ -12,9 +12,7 @@ from zarr.registry import register_codec if TYPE_CHECKING: - from typing import Any - - from typing_extensions import Self + from typing import Any, Self from zarr.core.buffer import NDBuffer from zarr.core.chunk_grids import ChunkGrid diff --git a/src/zarr/codecs/zstd.py b/src/zarr/codecs/zstd.py index 572d594d5..913d0f01c 100644 --- a/src/zarr/codecs/zstd.py +++ b/src/zarr/codecs/zstd.py @@ -13,7 +13,7 @@ from zarr.registry import register_codec if TYPE_CHECKING: - from typing_extensions import Self + from typing import Self from zarr.core.array_spec import ArraySpec from zarr.core.buffer import Buffer diff --git a/src/zarr/core/buffer/core.py b/src/zarr/core/buffer/core.py index ba629befa..0a4374576 100644 --- a/src/zarr/core/buffer/core.py +++ b/src/zarr/core/buffer/core.py @@ -23,8 +23,7 @@ if TYPE_CHECKING: from collections.abc import Iterable, Sequence - - from typing_extensions import Self + from typing import Self from zarr.codecs.bytes import Endian from zarr.core.common import BytesLike, ChunkCoords diff --git a/src/zarr/core/buffer/cpu.py b/src/zarr/core/buffer/cpu.py index cef16209e..0c1da60d5 100644 --- a/src/zarr/core/buffer/cpu.py +++ b/src/zarr/core/buffer/cpu.py @@ -17,8 +17,7 @@ if TYPE_CHECKING: from collections.abc import Callable, Iterable - - from typing_extensions import Self + from typing import Self from zarr.core.buffer.core import ArrayLike, NDArrayLike from zarr.core.common import BytesLike diff --git a/src/zarr/core/buffer/gpu.py b/src/zarr/core/buffer/gpu.py index c817431d3..1c4e7706f 100644 --- a/src/zarr/core/buffer/gpu.py +++ b/src/zarr/core/buffer/gpu.py @@ -16,8 +16,7 @@ if TYPE_CHECKING: from collections.abc import Iterable - - from typing_extensions import Self + from typing import Self from zarr.core.common import BytesLike diff --git a/src/zarr/core/chunk_grids.py b/src/zarr/core/chunk_grids.py index 61723215c..46209bd16 100644 --- a/src/zarr/core/chunk_grids.py +++ b/src/zarr/core/chunk_grids.py @@ -23,8 +23,7 @@ if TYPE_CHECKING: from collections.abc import Iterator - - from typing_extensions import Self + from typing import Self def _guess_chunks( diff --git a/src/zarr/core/metadata/common.py b/src/zarr/core/metadata/common.py index 583375b4b..7d71455a4 100644 --- a/src/zarr/core/metadata/common.py +++ b/src/zarr/core/metadata/common.py @@ -3,10 +3,9 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing import Any, Literal + from typing import Any, Literal, Self import numpy as np - from typing_extensions import Self from zarr.core.array_spec import ArraySpec from zarr.core.buffer import Buffer, BufferPrototype diff --git a/src/zarr/core/metadata/v2.py b/src/zarr/core/metadata/v2.py index af7821bea..07238dbfa 100644 --- a/src/zarr/core/metadata/v2.py +++ b/src/zarr/core/metadata/v2.py @@ -4,10 +4,9 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing import Any, Literal + from typing import Any, Literal, Self import numpy.typing as npt - from typing_extensions import Self from zarr.core.buffer import Buffer, BufferPrototype from zarr.core.common import JSON, ChunkCoords diff --git a/src/zarr/core/metadata/v3.py b/src/zarr/core/metadata/v3.py index 10047cbb9..3fe054faa 100644 --- a/src/zarr/core/metadata/v3.py +++ b/src/zarr/core/metadata/v3.py @@ -3,8 +3,9 @@ from typing import TYPE_CHECKING, cast, overload if TYPE_CHECKING: + from typing import Self + import numpy.typing as npt - from typing_extensions import Self from zarr.core.buffer import Buffer, BufferPrototype from zarr.core.chunk_grids import ChunkGrid diff --git a/src/zarr/core/sync.py b/src/zarr/core/sync.py index db3dce79b..091c980cf 100644 --- a/src/zarr/core/sync.py +++ b/src/zarr/core/sync.py @@ -83,7 +83,7 @@ def sync( finished, unfinished = wait([future], return_when=asyncio.ALL_COMPLETED, timeout=timeout) if len(unfinished) > 0: - raise asyncio.TimeoutError(f"Coroutine {coro} failed to finish in within {timeout}s") + raise TimeoutError(f"Coroutine {coro} failed to finish in within {timeout}s") assert len(finished) == 1 return_result = next(iter(finished)).result() diff --git a/src/zarr/testing/buffer.py b/src/zarr/testing/buffer.py index 9d640d2c6..a0d70e78e 100644 --- a/src/zarr/testing/buffer.py +++ b/src/zarr/testing/buffer.py @@ -11,8 +11,7 @@ if TYPE_CHECKING: from collections.abc import Iterable - - from typing_extensions import Self + from typing import Self __all__ = [ From a78cb05622a7267ef3e4ecff3eefd9b55cbcc2f3 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Sat, 21 Sep 2024 08:32:02 -0700 Subject: [PATCH 3/7] bump python in readthedocs --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index cae58c064..3a97c9412 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.10" + python: "3.11" sphinx: configuration: docs/conf.py From 4a7b1768f7f5ca11e0bff0a0cf792aef2c2e02cf Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Sat, 21 Sep 2024 08:54:50 -0700 Subject: [PATCH 4/7] fix array import in docs --- docs/release.rst | 4 ++-- docs/tutorial.rst | 50 +++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/release.rst b/docs/release.rst index dbf390a80..5c3a43a14 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -1142,7 +1142,7 @@ Documentation * Update docs to use ``python -m pytest``. By :user:`Ray Bell ` :issue:`923`. -* Fix versionadded tag in zarr.core.Array docstring. +* Fix versionadded tag in zarr.Array docstring. By :user:`Juan Nunez-Iglesias ` :issue:`852`. * Doctest seem to be stricter now, updating tostring() to tobytes(). @@ -1896,7 +1896,7 @@ Enhancements :user:`John Kirkham `, :issue:`92`, :issue:`122`. * **Viewing an array as a different dtype**. The ``Array`` class has a new - :func:`zarr.core.Array.astype` method, which is a convenience that enables an + :func:`zarr.Array.astype` method, which is a convenience that enables an array to be viewed as a different dtype. By :user:`John Kirkham `, :issue:`94`, :issue:`96`. diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 4099bac1c..a40422490 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -18,7 +18,7 @@ Zarr has several functions for creating arrays. For example:: >>> import zarr >>> z = zarr.zeros((10000, 10000), chunks=(1000, 1000), dtype='i4') >>> z - + The code above creates a 2-dimensional array of 32-bit integers with 10000 rows and 10000 columns, divided into chunks where each chunk has 1000 rows and 1000 @@ -168,7 +168,7 @@ compression ratio. Zarr arrays provide a ``info`` property which can be used to print some diagnostics, e.g.:: >>> z.info - Type : zarr.core.Array + Type : zarr.Array Data type : int32 Shape : (10000, 10000) Chunk shape : (1000, 1000) @@ -260,7 +260,7 @@ Here is an example using a delta filter with the Blosc compressor:: >>> data = np.arange(100000000, dtype='i4').reshape(10000, 10000) >>> z = zarr.array(data, chunks=(1000, 1000), filters=filters, compressor=compressor) >>> z.info - Type : zarr.core.Array + Type : zarr.Array Data type : int32 Shape : (10000, 10000) Chunk shape : (1000, 1000) @@ -302,7 +302,7 @@ Groups can also contain arrays, e.g.:: >>> z1 = bar.zeros('baz', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4') >>> z1 - + Arrays are known as "datasets" in HDF5 terminology. For compatibility with h5py, Zarr groups also implement the ``create_dataset()`` and ``require_dataset()`` @@ -310,7 +310,7 @@ methods, e.g.:: >>> z = bar.create_dataset('quux', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4') >>> z - + Members of a group can be accessed via the suffix notation, e.g.:: @@ -323,7 +323,7 @@ call, e.g.:: >>> root['foo/bar'] >>> root['foo/bar/baz'] - + The :func:`zarr.hierarchy.Group.tree` method can be used to print a tree representation of the hierarchy, e.g.:: @@ -344,7 +344,7 @@ sub-directories, e.g.:: >>> z = root.zeros('foo/bar/baz', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4') >>> z - + Groups can be used as context managers (in a ``with`` statement). If the underlying store has a ``close`` method, it will be called on exit. @@ -388,7 +388,7 @@ property. E.g.:: >>> bar.info Name : /foo/bar - Type : zarr.core.Array + Type : zarr.Array Data type : int64 Shape : (1000000,) Chunk shape : (100000,) @@ -403,7 +403,7 @@ property. E.g.:: >>> baz.info Name : /foo/baz - Type : zarr.core.Array + Type : zarr.Array Data type : float32 Shape : (1000, 1000) Chunk shape : (100, 100) @@ -472,7 +472,7 @@ Note that although this functionality is similar to some of the advanced indexing capabilities available on NumPy arrays and on h5py datasets, **the Zarr API for advanced indexing is different from both NumPy and h5py**, so please read this section carefully. For a complete description of the indexing API, -see the documentation for the :class:`zarr.core.Array` class. +see the documentation for the :class:`zarr.Array` class. Indexing with coordinate arrays ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -880,10 +880,10 @@ Here is an example using S3Map to read an array created previously:: >>> root = zarr.group(store=store) >>> z = root['foo/bar/baz'] >>> z - + >>> z.info Name : /foo/bar/baz - Type : zarr.core.Array + Type : zarr.Array Data type : |S1 Shape : (21,) Chunk shape : (7,) @@ -1150,7 +1150,7 @@ your array, then you can use an array with a fixed-length bytes dtype. E.g.:: >>> z = zarr.zeros(10, dtype='S6') >>> z - + >>> z[0] = b'Hello' >>> z[1] = b'world!' >>> z[:] @@ -1166,7 +1166,7 @@ A fixed-length unicode dtype is also available, e.g.:: >>> text_data = greetings * 10000 >>> z = zarr.array(text_data, dtype='U20') >>> z - + >>> z[:] array(['¡Hola mundo!', 'Hej Världen!', 'Servus Woid!', ..., 'Helló, világ!', 'Zdravo svete!', 'เฮลโลเวิลด์'], @@ -1182,7 +1182,7 @@ E.g. using ``VLenUTF8``:: >>> import numcodecs >>> z = zarr.array(text_data, dtype=object, object_codec=numcodecs.VLenUTF8()) >>> z - + >>> z.filters [VLenUTF8()] >>> z[:] @@ -1194,7 +1194,7 @@ is a short-hand for ``dtype=object, object_codec=numcodecs.VLenUTF8()``, e.g.:: >>> z = zarr.array(text_data, dtype=str) >>> z - + >>> z.filters [VLenUTF8()] >>> z[:] @@ -1210,7 +1210,7 @@ e.g.:: >>> bytes_data = [g.encode('utf-8') for g in greetings] * 10000 >>> z = zarr.array(bytes_data, dtype=bytes) >>> z - + >>> z.filters [VLenBytes()] >>> z[:] @@ -1225,7 +1225,7 @@ integer. E.g.:: >>> categorize = numcodecs.Categorize(greetings, dtype=object) >>> z = zarr.array(text_data, dtype=object, object_codec=categorize) >>> z - + >>> z.filters [Categorize(dtype='|O', astype='|u1', labels=['¡Hola mundo!', 'Hej Världen!', 'Servus Woid!', ...])] >>> z[:] @@ -1275,7 +1275,7 @@ and stores the same primitive type (a.k.a. a ragged array), the >>> z = zarr.empty(4, dtype=object, object_codec=numcodecs.VLenArray(int)) >>> z - + >>> z.filters [VLenArray(dtype='>> z[0] = np.array([1, 3, 5]) @@ -1291,7 +1291,7 @@ primitive dtype such as 'i4' or 'f8'. E.g.:: >>> z = zarr.empty(4, dtype='array:i8') >>> z - + >>> z.filters [VLenArray(dtype='>> z[0] = np.array([1, 3, 5]) @@ -1367,7 +1367,7 @@ ratios, depending on the correlation structure within the data. E.g.:: >>> a = np.arange(100000000, dtype='i4').reshape(10000, 10000).T >>> c = zarr.array(a, chunks=(1000, 1000)) >>> c.info - Type : zarr.core.Array + Type : zarr.Array Data type : int32 Shape : (10000, 10000) Chunk shape : (1000, 1000) @@ -1381,7 +1381,7 @@ ratios, depending on the correlation structure within the data. E.g.:: Chunks initialized : 100/100 >>> f = zarr.array(a, chunks=(1000, 1000), order='F') >>> f.info - Type : zarr.core.Array + Type : zarr.Array Data type : int32 Shape : (10000, 10000) Chunk shape : (1000, 1000) @@ -1549,7 +1549,7 @@ with thread synchronization:: >>> z = zarr.zeros((10000, 10000), chunks=(1000, 1000), dtype='i4', ... synchronizer=zarr.ThreadSynchronizer()) >>> z - + This array is safe to read or write within a multi-threaded program. @@ -1563,7 +1563,7 @@ some networked file systems). E.g.:: ... chunks=(1000, 1000), dtype='i4', ... synchronizer=synchronizer) >>> z - + This array is safe to read or write from multiple processes. @@ -1631,7 +1631,7 @@ arrays, as long as the units are specified. E.g.:: >>> z = zarr.array(['2007-07-13', '2006-01-13', '2010-08-13'], dtype='M8[D]') >>> z - + >>> z[:] array(['2007-07-13', '2006-01-13', '2010-08-13'], dtype='datetime64[D]') >>> z[0] From e934785a4e78f8f046f4026419c5240ab8798848 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Wed, 25 Sep 2024 22:18:11 -0600 Subject: [PATCH 5/7] try on 3.12 --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 3a97c9412..32a3f0e4e 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.12" sphinx: configuration: docs/conf.py From 849ed0afbb45c2500e19f7a511f8867d6c8ee6ca Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 21:46:01 +0000 Subject: [PATCH 6/7] style: pre-commit fixes --- src/zarr/abc/store.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zarr/abc/store.py b/src/zarr/abc/store.py index 42eb2cb5d..5f5036055 100644 --- a/src/zarr/abc/store.py +++ b/src/zarr/abc/store.py @@ -9,7 +9,7 @@ if TYPE_CHECKING: from collections.abc import AsyncGenerator, Iterable from types import TracebackType - from typing import Any, TypeAlias, Self + from typing import Any, Self, TypeAlias from zarr.core.buffer import Buffer, BufferPrototype from zarr.core.common import AccessModeLiteral, BytesLike From ff142d24d6b7148704e92f9f4540c6e9de76a18d Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Thu, 26 Sep 2024 15:56:18 -0600 Subject: [PATCH 7/7] fixup --- src/zarr/store/logging.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/zarr/store/logging.py b/src/zarr/store/logging.py index 792dc66d9..0c05b4265 100644 --- a/src/zarr/store/logging.py +++ b/src/zarr/store/logging.py @@ -7,10 +7,10 @@ from contextlib import contextmanager from typing import TYPE_CHECKING -from zarr.abc.store import AccessMode, Store +from zarr.abc.store import AccessMode, ByteRangeRequest, Store if TYPE_CHECKING: - from collections.abc import AsyncGenerator, Generator + from collections.abc import AsyncGenerator, Generator, Iterable from zarr.core.buffer import Buffer, BufferPrototype @@ -125,7 +125,7 @@ async def get( async def get_partial_values( self, prototype: BufferPrototype, - key_ranges: list[tuple[str, tuple[int | None, int | None]]], + key_ranges: Iterable[tuple[str, ByteRangeRequest]], ) -> list[Buffer | None]: with self.log(): return await self._store.get_partial_values(prototype=prototype, key_ranges=key_ranges) @@ -142,7 +142,9 @@ async def delete(self, key: str) -> None: with self.log(): return await self._store.delete(key=key) - async def set_partial_values(self, key_start_values: list[tuple[str, int, bytes]]) -> None: + async def set_partial_values( + self, key_start_values: Iterable[tuple[str, int, bytes | bytearray | memoryview]] + ) -> None: with self.log(): return await self._store.set_partial_values(key_start_values=key_start_values)