From ab769985d7aa0279e9f628ab4148660bbf4921a5 Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Sun, 19 Jul 2026 14:19:48 -0400 Subject: [PATCH 01/61] chore: refine link checker configuration (#4158) --- lychee.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lychee.toml b/lychee.toml index 38b2b8ab7a..54a5b49b8d 100644 --- a/lychee.toml +++ b/lychee.toml @@ -1,6 +1,9 @@ # Configuration for the lychee link checker (https://lychee.cli.rs/). # Auto-discovered as ./lychee.toml by the lychee GitHub Action. +# Treat redirect status codes as success rather than failures. +accept = ["200..=299"] + # Files lychee should not scan for links. exclude_path = [ # mkdocs-material theme overrides: hrefs are Jinja expressions like @@ -17,4 +20,6 @@ exclude = [ # documentation of a command rather than a reachable link. '^https?://0\.0\.0\.0', '^https?://(localhost|127\.0\.0\.1)(:\d+)?', + # SPEC 0 page times out but is valid. + '^https://scientific-python\.org/specs/spec-0000', ] From ecc2d77718dbc4343da052347c4377945246d4fa Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Mon, 20 Jul 2026 16:39:17 +0200 Subject: [PATCH 02/61] fix(store): don't close a shared filesystem in FsspecStore.close() (#4165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: byte-order handling for structured dtypes in the bytes codec (#220) * fix: byte-order handling for structured dtypes in the bytes codec The bytes codec neither byte-swapped structured-dtype fields to its configured endian on encode (numpy reports byteorder '|' for void dtypes, so the top-level byteorder comparison never detected a mismatch) nor honored its endian when decoding, silently corrupting any structured data whose field byte order differed from the stored one (e.g. virtual references to external big-endian data). Encode now detects byte-order mismatches by comparing full dtypes via newbyteorder, and decode reinterprets raw bytes in the stored byte order before converting to the data type's declared byte order, so the stored layout (codec state) and the in-memory layout (array data type) are independent. Closes #4141 Assisted-by: ClaudeCode:claude-fable-5 * test: fold structured byte-order cases into existing bytes codec tests Extend test_endian's parametrization with structured dtypes and test_bytes_codec_sync_roundtrip with endian/dtype parametrization plus stored-layout and decoded-dtype assertions, instead of adding parallel test functions for the same properties. Assisted-by: ClaudeCode:claude-fable-5 * refactor: rename stored_dtype to view_dtype in BytesCodec decode The variable is the dtype used to view the raw chunk bytes (byte order from the codec's endian configuration), not a property of the stored data or of the returned buffer, which always carries the array's declared dtype. Assisted-by: ClaudeCode:claude-fable-5 * docs: note that the decode-side byte-order conversion copies the chunk Assisted-by: ClaudeCode:claude-fable-5 * fix(store): FsspecStore.close() no longer closes the filesystem FsspecStore.close() closed the underlying filesystem's session, on the premise that a store built by from_url "owns" the filesystem it created. That premise does not hold: fsspec caches and shares filesystem instances across callers (its instance cache keys on storage options, not path), and users can hand one filesystem to many stores directly. Closing one store therefore killed the session that sibling stores were still using, and left the dead filesystem in fsspec's cache for later callers. Determining whether a filesystem is actually shared requires reaching into fsspec's private instance cache (_cache, _fs_token, cachable) and walking wrapper chains for caching/proxy filesystems — an implementation detail that leaks upward and that we would have to keep in sync with fsspec forever, getting it subtly wrong in between. The wrapper case alone (simplecache::/dir://) already slipped through a cache-membership check. The filesystem's lifecycle is simply not the store's to manage. This removes the ownership model added in the unreleased gh-4003: no _owns_fs, no _close_fs, no ownership transfer in with_read_only, and close() just marks the store not-open. The only thing given up is suppressing an "Unclosed client session" ResourceWarning, which was true anyway — the session belongs to a cached filesystem that outlives the store. Since gh-4003 never shipped (latest release is v3.2.1), its changelog fragment is removed rather than superseded. Assisted-by: ClaudeCode:claude-opus-4.8 * test: skip with_read_only fs test when AsyncFileSystemWrapper is absent test_with_read_only_shares_filesystem replaced an ownership test that carried a guard for fsspec < 2024.12.0, and the guard was dropped in the rewrite. The test still opens a file:// URL, which needs AsyncFileSystemWrapper, so it failed the min_deps job. Assisted-by: ClaudeCode:claude-opus-4.8 * docs: correct changelog claim about gh-4003 release status The fragment said gh-4003 was unreleased with no net change for released versions. Its text is already in the staged 3.3.0 release notes, so the revert is a real behavior change for anyone relying on close() releasing the session. Assisted-by: ClaudeCode:claude-opus-4.8 * docs: remove changelog entry for unreleased versions --- src/zarr/storage/_fsspec.py | 70 ++++------------- tests/test_store/test_fsspec.py | 134 ++++++++------------------------ 2 files changed, 47 insertions(+), 157 deletions(-) diff --git a/src/zarr/storage/_fsspec.py b/src/zarr/storage/_fsspec.py index 617980ac19..37d134dd95 100644 --- a/src/zarr/storage/_fsspec.py +++ b/src/zarr/storage/_fsspec.py @@ -3,7 +3,6 @@ import json import warnings from contextlib import suppress -from logging import getLogger from typing import TYPE_CHECKING, Any from packaging.version import parse as parse_version @@ -19,8 +18,6 @@ from zarr.errors import ZarrUserWarning from zarr.storage._utils import _dereference_path -logger = getLogger(__name__) - if TYPE_CHECKING: from collections.abc import AsyncIterator, Iterable @@ -38,26 +35,6 @@ ) -async def _close_fs(fs: AsyncFileSystem) -> None: - """ - Best-effort async close of an fsspec async filesystem owned by FsspecStore. - - For filesystems that expose `set_session()` (e.g. s3fs) the underlying - aiohttp `ClientSession` is closed explicitly, which prevents - "Unclosed client session" `ResourceWarning`s from aiohttp. For all - other filesystem types the call is a no-op (not every implementation - manages an HTTP session directly). - - Note that `set_session()` lazily creates a session if none exists yet, so - closing a store that never performed any I/O may instantiate a session - purely to close it. This is accepted best-effort behavior; fsspec does not - expose a stable, cross-implementation way to test for an existing session. - """ - if hasattr(fs, "set_session"): - session = await fs.set_session() - await session.close() - - def _make_async(fs: AbstractFileSystem) -> AsyncFileSystem: """Convert a sync FSSpec filesystem to an async FFSpec filesystem @@ -126,6 +103,15 @@ class FsspecStore(Store): ZarrUserWarning If the file system (fs) was not created with `asynchronous=True`. + Notes + ----- + Closing the store does not close the underlying filesystem or its network + session. fsspec caches and shares filesystem instances across callers, so + the store cannot know whether it is the only user, and closing a shared + session would break other stores. The filesystem's lifecycle belongs to + whoever created it; use fsspec's own tools (e.g. `clear_instance_cache`) + to release it. + See Also -------- FsspecStore.from_upath @@ -152,9 +138,6 @@ def __init__( self.fs = fs self.path = path self.allowed_exceptions = allowed_exceptions - # True only when this store created fs itself (from_url / from_mapper with new instance). - # Callers who supply their own fs remain responsible for its lifecycle. - self._owns_fs: bool = False if not self.fs.async_impl: raise TypeError("Filesystem needs to support async operations.") @@ -220,17 +203,13 @@ def from_mapper( ------- FsspecStore """ - original_fs = fs_map.fs - fs = _make_async(original_fs) - store = cls( + fs = _make_async(fs_map.fs) + return cls( fs=fs, path=fs_map.root, read_only=read_only, allowed_exceptions=allowed_exceptions, ) - # _make_async returns a new instance when converting sync→async; own it. - store._owns_fs = fs is not original_fs - return store @classmethod def from_url( @@ -272,39 +251,16 @@ def from_url( if not fs.async_impl: fs = _make_async(fs) - store = cls(fs=fs, path=path, read_only=read_only, allowed_exceptions=allowed_exceptions) - store._owns_fs = True - return store + return cls(fs=fs, path=path, read_only=read_only, allowed_exceptions=allowed_exceptions) def with_read_only(self, read_only: bool = False) -> FsspecStore: # docstring inherited - new_store = type(self)( + return type(self)( fs=self.fs, path=self.path, allowed_exceptions=self.allowed_exceptions, read_only=read_only, ) - # The derived store shares the same fs. Transfer ownership so the - # surviving store closes it, and clear ours to avoid a double-close. - # Otherwise the common `from_url(...).with_read_only()` chain would - # drop the only owner (the unreferenced source) and leak the session. - new_store._owns_fs = self._owns_fs - self._owns_fs = False - return new_store - - def close(self) -> None: - # docstring inherited - if self._owns_fs: - from zarr.core.sync import sync as zarr_sync - - # Best-effort: a failure to release the session must not block close(), - # but log it so a genuine regression in the close path stays observable - # rather than silently reverting to the leaking behavior. - try: - zarr_sync(_close_fs(self.fs)) - except Exception: - logger.debug("Failed to close owned filesystem %r", self.fs, exc_info=True) - super().close() async def clear(self) -> None: # docstring inherited diff --git a/tests/test_store/test_fsspec.py b/tests/test_store/test_fsspec.py index 898d49ec08..515e1526b6 100644 --- a/tests/test_store/test_fsspec.py +++ b/tests/test_store/test_fsspec.py @@ -276,75 +276,20 @@ async def test_delete_dir_unsupported_deletes(self, store: FsspecStore) -> None: ): await store.delete_dir("test_prefix") - # ── Filesystem lifecycle (ownership) ────────────────────────────────────── + # ── Filesystem lifecycle ────────────────────────────────────────────────── - def test_from_url_owns_filesystem(self, endpoint_url: str) -> None: - """FsspecStore.from_url() creates the async fs; it must own it.""" + async def test_close_marks_store_closed(self, endpoint_url: str) -> None: + """close() must succeed and mark the store not-open.""" store = FsspecStore.from_url( f"s3://{test_bucket_name}/lifecycle/", storage_options={"endpoint_url": endpoint_url, "anon": False}, ) - assert store._owns_fs - store.close() - - async def test_from_url_close_releases_store(self, endpoint_url: str) -> None: - """ - close() on a from_url() store must succeed without error and mark the - store as closed. For the owned filesystem, _close_fs() is invoked to - release the underlying S3 client / aiohttp connection pool. - """ - store = FsspecStore.from_url( - f"s3://{test_bucket_name}/lifecycle/", - storage_options={"endpoint_url": endpoint_url, "anon": False}, - ) - # Materialise the S3 client and connection pool. await store.set("probe", cpu.Buffer.from_bytes(b"x")) store.close() assert not store._is_open - def test_direct_construction_does_not_own_filesystem(self, endpoint_url: str) -> None: - """Direct FsspecStore() must not claim ownership — the caller owns the fs.""" - try: - from fsspec import url_to_fs - except ImportError: - from fsspec.core import url_to_fs - fs, path = url_to_fs( - f"s3://{test_bucket_name}", endpoint_url=endpoint_url, anon=False, asynchronous=True - ) - store = FsspecStore(fs=fs, path=path) - assert not store._owns_fs - - @pytest.mark.skipif( - parse_version(fsspec.__version__) < parse_version("2024.03.01"), - reason="Prior bug in from_upath", - ) - def test_from_upath_does_not_own_filesystem(self, endpoint_url: str) -> None: - """from_upath() uses the UPath's existing fs; the store must not own it.""" - upath = pytest.importorskip("upath") - path = upath.UPath( - f"s3://{test_bucket_name}/foo/bar/", - endpoint_url=endpoint_url, - anon=False, - asynchronous=True, - ) - store = FsspecStore.from_upath(path) - assert not store._owns_fs - - def test_from_mapper_does_not_own_already_async_filesystem(self, endpoint_url: str) -> None: - """from_mapper() with an already-async fs must not claim ownership.""" - s3_filesystem = s3fs.S3FileSystem( - asynchronous=True, - endpoint_url=endpoint_url, - anon=False, - skip_instance_cache=True, - ) - mapper = s3_filesystem.get_mapper(f"s3://{test_bucket_name}/") - store = FsspecStore.from_mapper(mapper) - # _make_async returns the same instance for an already-async fs. - assert not store._owns_fs - def array_roundtrip(store: FsspecStore) -> None: """ @@ -574,47 +519,47 @@ def test_open_s3map_raises(endpoint_url: str) -> None: zarr.open(store=mapper, storage_options={"anon": True}, mode="w", shape=(3, 3)) -async def test_close_fs_closes_s3_client() -> None: - """ - _close_fs() must call set_session() and then close() on the returned - S3 client. This is verified with mocks to avoid a real S3 connection. - """ - from unittest.mock import AsyncMock +async def test_close_does_not_close_filesystem_session() -> None: + """close() must not touch the filesystem's session. - from zarr.storage._fsspec import _close_fs + fsspec caches and shares filesystem instances across callers, so the + session is not the store's to close. HTTP is used because its aiohttp + session is observably closed for good; s3fs transparently reconnects, which + would hide a regression. No request is issued — set_session() only + constructs the session. + """ + pytest.importorskip("aiohttp") + store = FsspecStore.from_url("http://example.com/a") + session = await store.fs.set_session() - mock_client = AsyncMock() - mock_fs = AsyncMock() - mock_fs.set_session = AsyncMock(return_value=mock_client) + store.close() - await _close_fs(mock_fs) + assert not session.closed - mock_fs.set_session.assert_called_once() - mock_client.close.assert_called_once() +async def test_close_does_not_break_a_sibling_store() -> None: + """Closing one store must not close a session another store is using. -async def test_close_fs_no_op_for_fs_without_set_session() -> None: - """_close_fs() must be a no-op for filesystems that don't expose set_session().""" - from unittest.mock import AsyncMock + Two stores from different URLs on one host are handed the same cached + filesystem; a store that closed it on close() would take the sibling's + session down too. This is the regression guard for that bug. + """ + pytest.importorskip("aiohttp") + s1 = FsspecStore.from_url("http://example.com/a") + s2 = FsspecStore.from_url("http://example.com/b") + session = await s2.fs.set_session() - from zarr.storage._fsspec import _close_fs + s1.close() - mock_fs = AsyncMock(spec=[]) # empty spec — no set_session attribute - await _close_fs(mock_fs) # must not raise + assert not session.closed @pytest.mark.skipif( parse_version(fsspec.__version__) < parse_version("2024.12.0"), reason="No AsyncFileSystemWrapper", ) -def test_from_mapper_owns_wrapped_sync_filesystem(tmp_path: pathlib.Path) -> None: - """ - from_mapper() with a sync fs must wrap it in AsyncFileSystemWrapper and - claim ownership so that close() cleans it up. - - The local filesystem is synchronous; _make_async() produces a new - AsyncFileSystemWrapper instance — a different object from the original fs. - """ +def test_from_mapper_wraps_sync_filesystem(tmp_path: pathlib.Path) -> None: + """from_mapper() with a sync fs wraps it in an AsyncFileSystemWrapper.""" import fsspec as _fsspec from fsspec.implementations.asyn_wrapper import AsyncFileSystemWrapper @@ -622,32 +567,21 @@ def test_from_mapper_owns_wrapped_sync_filesystem(tmp_path: pathlib.Path) -> Non mapper = fs.get_mapper(str(tmp_path)) store = FsspecStore.from_mapper(mapper) assert isinstance(store.fs, AsyncFileSystemWrapper) - assert store._owns_fs @pytest.mark.skipif( parse_version(fsspec.__version__) < parse_version("2024.12.0"), reason="No AsyncFileSystemWrapper", ) -def test_with_read_only_transfers_filesystem_ownership(tmp_path: pathlib.Path) -> None: - """ - with_read_only() must transfer fs ownership to the derived store and clear - it on the source, so the surviving store closes the shared fs exactly once. - - In the common ``from_url(...).with_read_only()`` chain the source store is - immediately unreferenced; if ownership were not transferred, the only owner - would be garbage-collected without close() and the session would leak. - """ +def test_with_read_only_shares_filesystem(tmp_path: pathlib.Path) -> None: + """with_read_only() returns a store sharing the source's filesystem.""" source = FsspecStore.from_url(f"file://{tmp_path}", storage_options={"auto_mkdir": False}) - assert source._owns_fs derived = source.with_read_only(read_only=True) - # Ownership moved to the survivor; the source no longer owns it (no double-close). - assert derived._owns_fs - assert not source._owns_fs - # The derived store shares the same underlying fs. assert derived.fs is source.fs + assert derived.read_only + assert not source.read_only @pytest.mark.parametrize("asynchronous", [True, False]) From faba4bc8f2cdf379879179778cc3c9b202136be8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 23:42:13 +0200 Subject: [PATCH 03/61] chore(deps): bump setuptools from 82.0.1 to 83.0.0 (#4176) Bumps [setuptools](https://github.com/pypa/setuptools) from 82.0.1 to 83.0.0. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v82.0.1...v83.0.0) --- updated-dependencies: - dependency-name: setuptools dependency-version: 83.0.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index 7a0d713873..725f9f2a20 100644 --- a/uv.lock +++ b/uv.lock @@ -2894,11 +2894,11 @@ wheels = [ [[package]] name = "setuptools" -version = "82.0.1" +version = "83.0.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/4f/db/cfac1baf10650ab4d1c111714410d2fbb77ac5a616db26775db562c8fab2/setuptools-82.0.1.tar.gz", hash = "sha256:7d872682c5d01cfde07da7bccc7b65469d3dca203318515ada1de5eda35efbf9", size = 1152316, upload-time = "2026-03-09T12:47:17.221Z" } +sdist = { url = "https://files.pythonhosted.org/packages/34/26/f5d29e25ffdb535afef2d35cdb55b325298f96debd670da4c325e08d70f4/setuptools-83.0.0.tar.gz", hash = "sha256:025bccbbf0fa05b6192bc64ae1e7b16e001fd6d6d4d5de03c97b1c1ade523bef", size = 1154254, upload-time = "2026-07-04T15:31:22.699Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/9d/76/f789f7a86709c6b087c5a2f52f911838cad707cc613162401badc665acfe/setuptools-82.0.1-py3-none-any.whl", hash = "sha256:a59e362652f08dcd477c78bb6e7bd9d80a7995bc73ce773050228a348ce2e5bb", size = 1006223, upload-time = "2026-03-09T12:47:15.026Z" }, + { url = "https://files.pythonhosted.org/packages/5d/40/e1e72872c6354b306daef1703549e8e83b4d43cfea356311bf722a043752/setuptools-83.0.0-py3-none-any.whl", hash = "sha256:29b23c360f22f414dc7336bb39178cc7bcbf6021ed2733cde173f09dba19abb3", size = 1008090, upload-time = "2026-07-04T15:31:20.885Z" }, ] [[package]] From 80e00ae006fa3466c6405ad2d3f6de26e3c5ac65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 21:57:33 +0000 Subject: [PATCH 04/61] chore(deps): bump pillow from 12.2.0 to 12.3.0 (#4169) Bumps [pillow](https://github.com/python-pillow/Pillow) from 12.2.0 to 12.3.0. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/12.2.0...12.3.0) --- updated-dependencies: - dependency-name: pillow dependency-version: 12.3.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Davis Bennett --- uv.lock | 132 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 67 insertions(+), 65 deletions(-) diff --git a/uv.lock b/uv.lock index 725f9f2a20..6035acc616 100644 --- a/uv.lock +++ b/uv.lock @@ -2015,71 +2015,73 @@ wheels = [ [[package]] name = "pillow" -version = "12.2.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/8c/21/c2bcdd5906101a30244eaffc1b6e6ce71a31bd0742a01eb89e660ebfac2d/pillow-12.2.0.tar.gz", hash = "sha256:a830b1a40919539d07806aa58e1b114df53ddd43213d9c8b75847eee6c0182b5", size = 46987819, upload-time = "2026-04-01T14:46:17.687Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/58/be/7482c8a5ebebbc6470b3eb791812fff7d5e0216c2be3827b30b8bb6603ed/pillow-12.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2d192a155bbcec180f8564f693e6fd9bccff5a7af9b32e2e4bf8c9c69dbad6b5", size = 5308279, upload-time = "2026-04-01T14:43:13.246Z" }, - { url = "https://files.pythonhosted.org/packages/d8/95/0a351b9289c2b5cbde0bacd4a83ebc44023e835490a727b2a3bd60ddc0f4/pillow-12.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f3f40b3c5a968281fd507d519e444c35f0ff171237f4fdde090dd60699458421", size = 4695490, upload-time = "2026-04-01T14:43:15.584Z" }, - { url = "https://files.pythonhosted.org/packages/de/af/4e8e6869cbed569d43c416fad3dc4ecb944cb5d9492defaed89ddd6fe871/pillow-12.2.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:03e7e372d5240cc23e9f07deca4d775c0817bffc641b01e9c3af208dbd300987", size = 6284462, upload-time = "2026-04-01T14:43:18.268Z" }, - { url = "https://files.pythonhosted.org/packages/e9/9e/c05e19657fd57841e476be1ab46c4d501bffbadbafdc31a6d665f8b737b6/pillow-12.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b86024e52a1b269467a802258c25521e6d742349d760728092e1bc2d135b4d76", size = 8094744, upload-time = "2026-04-01T14:43:20.716Z" }, - { url = "https://files.pythonhosted.org/packages/2b/54/1789c455ed10176066b6e7e6da1b01e50e36f94ba584dc68d9eebfe9156d/pillow-12.2.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7371b48c4fa448d20d2714c9a1f775a81155050d383333e0a6c15b1123dda005", size = 6398371, upload-time = "2026-04-01T14:43:23.443Z" }, - { url = "https://files.pythonhosted.org/packages/43/e3/fdc657359e919462369869f1c9f0e973f353f9a9ee295a39b1fea8ee1a77/pillow-12.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62f5409336adb0663b7caa0da5c7d9e7bdbaae9ce761d34669420c2a801b2780", size = 7087215, upload-time = "2026-04-01T14:43:26.758Z" }, - { url = "https://files.pythonhosted.org/packages/8b/f8/2f6825e441d5b1959d2ca5adec984210f1ec086435b0ed5f52c19b3b8a6e/pillow-12.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:01afa7cf67f74f09523699b4e88c73fb55c13346d212a59a2db1f86b0a63e8c5", size = 6509783, upload-time = "2026-04-01T14:43:29.56Z" }, - { url = "https://files.pythonhosted.org/packages/67/f9/029a27095ad20f854f9dba026b3ea6428548316e057e6fc3545409e86651/pillow-12.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc3d34d4a8fbec3e88a79b92e5465e0f9b842b628675850d860b8bd300b159f5", size = 7212112, upload-time = "2026-04-01T14:43:32.091Z" }, - { url = "https://files.pythonhosted.org/packages/be/42/025cfe05d1be22dbfdb4f264fe9de1ccda83f66e4fc3aac94748e784af04/pillow-12.2.0-cp312-cp312-win32.whl", hash = "sha256:58f62cc0f00fd29e64b29f4fd923ffdb3859c9f9e6105bfc37ba1d08994e8940", size = 6378489, upload-time = "2026-04-01T14:43:34.601Z" }, - { url = "https://files.pythonhosted.org/packages/5d/7b/25a221d2c761c6a8ae21bfa3874988ff2583e19cf8a27bf2fee358df7942/pillow-12.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:7f84204dee22a783350679a0333981df803dac21a0190d706a50475e361c93f5", size = 7084129, upload-time = "2026-04-01T14:43:37.213Z" }, - { url = "https://files.pythonhosted.org/packages/10/e1/542a474affab20fd4a0f1836cb234e8493519da6b76899e30bcc5d990b8b/pillow-12.2.0-cp312-cp312-win_arm64.whl", hash = "sha256:af73337013e0b3b46f175e79492d96845b16126ddf79c438d7ea7ff27783a414", size = 2463612, upload-time = "2026-04-01T14:43:39.421Z" }, - { url = "https://files.pythonhosted.org/packages/4a/01/53d10cf0dbad820a8db274d259a37ba50b88b24768ddccec07355382d5ad/pillow-12.2.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:8297651f5b5679c19968abefd6bb84d95fe30ef712eb1b2d9b2d31ca61267f4c", size = 4100837, upload-time = "2026-04-01T14:43:41.506Z" }, - { url = "https://files.pythonhosted.org/packages/0f/98/f3a6657ecb698c937f6c76ee564882945f29b79bad496abcba0e84659ec5/pillow-12.2.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:50d8520da2a6ce0af445fa6d648c4273c3eeefbc32d7ce049f22e8b5c3daecc2", size = 4176528, upload-time = "2026-04-01T14:43:43.773Z" }, - { url = "https://files.pythonhosted.org/packages/69/bc/8986948f05e3ea490b8442ea1c1d4d990b24a7e43d8a51b2c7d8b1dced36/pillow-12.2.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:766cef22385fa1091258ad7e6216792b156dc16d8d3fa607e7545b2b72061f1c", size = 3640401, upload-time = "2026-04-01T14:43:45.87Z" }, - { url = "https://files.pythonhosted.org/packages/34/46/6c717baadcd62bc8ed51d238d521ab651eaa74838291bda1f86fe1f864c9/pillow-12.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5d2fd0fa6b5d9d1de415060363433f28da8b1526c1c129020435e186794b3795", size = 5308094, upload-time = "2026-04-01T14:43:48.438Z" }, - { url = "https://files.pythonhosted.org/packages/71/43/905a14a8b17fdb1ccb58d282454490662d2cb89a6bfec26af6d3520da5ec/pillow-12.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:56b25336f502b6ed02e889f4ece894a72612fe885889a6e8c4c80239ff6e5f5f", size = 4695402, upload-time = "2026-04-01T14:43:51.292Z" }, - { url = "https://files.pythonhosted.org/packages/73/dd/42107efcb777b16fa0393317eac58f5b5cf30e8392e266e76e51cff28c3d/pillow-12.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f1c943e96e85df3d3478f7b691f229887e143f81fedab9b20205349ab04d73ed", size = 6280005, upload-time = "2026-04-01T14:43:54.242Z" }, - { url = "https://files.pythonhosted.org/packages/a8/68/b93e09e5e8549019e61acf49f65b1a8530765a7f812c77a7461bca7e4494/pillow-12.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:03f6fab9219220f041c74aeaa2939ff0062bd5c364ba9ce037197f4c6d498cd9", size = 8090669, upload-time = "2026-04-01T14:43:57.335Z" }, - { url = "https://files.pythonhosted.org/packages/4b/6e/3ccb54ce8ec4ddd1accd2d89004308b7b0b21c4ac3d20fa70af4760a4330/pillow-12.2.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5cdfebd752ec52bf5bb4e35d9c64b40826bc5b40a13df7c3cda20a2c03a0f5ed", size = 6395194, upload-time = "2026-04-01T14:43:59.864Z" }, - { url = "https://files.pythonhosted.org/packages/67/ee/21d4e8536afd1a328f01b359b4d3997b291ffd35a237c877b331c1c3b71c/pillow-12.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eedf4b74eda2b5a4b2b2fb4c006d6295df3bf29e459e198c90ea48e130dc75c3", size = 7082423, upload-time = "2026-04-01T14:44:02.74Z" }, - { url = "https://files.pythonhosted.org/packages/78/5f/e9f86ab0146464e8c133fe85df987ed9e77e08b29d8d35f9f9f4d6f917ba/pillow-12.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:00a2865911330191c0b818c59103b58a5e697cae67042366970a6b6f1b20b7f9", size = 6505667, upload-time = "2026-04-01T14:44:05.381Z" }, - { url = "https://files.pythonhosted.org/packages/ed/1e/409007f56a2fdce61584fd3acbc2bbc259857d555196cedcadc68c015c82/pillow-12.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1e1757442ed87f4912397c6d35a0db6a7b52592156014706f17658ff58bbf795", size = 7208580, upload-time = "2026-04-01T14:44:08.39Z" }, - { url = "https://files.pythonhosted.org/packages/23/c4/7349421080b12fb35414607b8871e9534546c128a11965fd4a7002ccfbee/pillow-12.2.0-cp313-cp313-win32.whl", hash = "sha256:144748b3af2d1b358d41286056d0003f47cb339b8c43a9ea42f5fea4d8c66b6e", size = 6375896, upload-time = "2026-04-01T14:44:11.197Z" }, - { url = "https://files.pythonhosted.org/packages/3f/82/8a3739a5e470b3c6cbb1d21d315800d8e16bff503d1f16b03a4ec3212786/pillow-12.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:390ede346628ccc626e5730107cde16c42d3836b89662a115a921f28440e6a3b", size = 7081266, upload-time = "2026-04-01T14:44:13.947Z" }, - { url = "https://files.pythonhosted.org/packages/c3/25/f968f618a062574294592f668218f8af564830ccebdd1fa6200f598e65c5/pillow-12.2.0-cp313-cp313-win_arm64.whl", hash = "sha256:8023abc91fba39036dbce14a7d6535632f99c0b857807cbbbf21ecc9f4717f06", size = 2463508, upload-time = "2026-04-01T14:44:16.312Z" }, - { url = "https://files.pythonhosted.org/packages/4d/a4/b342930964e3cb4dce5038ae34b0eab4653334995336cd486c5a8c25a00c/pillow-12.2.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:042db20a421b9bafecc4b84a8b6e444686bd9d836c7fd24542db3e7df7baad9b", size = 5309927, upload-time = "2026-04-01T14:44:18.89Z" }, - { url = "https://files.pythonhosted.org/packages/9f/de/23198e0a65a9cf06123f5435a5d95cea62a635697f8f03d134d3f3a96151/pillow-12.2.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:dd025009355c926a84a612fecf58bb315a3f6814b17ead51a8e48d3823d9087f", size = 4698624, upload-time = "2026-04-01T14:44:21.115Z" }, - { url = "https://files.pythonhosted.org/packages/01/a6/1265e977f17d93ea37aa28aa81bad4fa597933879fac2520d24e021c8da3/pillow-12.2.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:88ddbc66737e277852913bd1e07c150cc7bb124539f94c4e2df5344494e0a612", size = 6321252, upload-time = "2026-04-01T14:44:23.663Z" }, - { url = "https://files.pythonhosted.org/packages/3c/83/5982eb4a285967baa70340320be9f88e57665a387e3a53a7f0db8231a0cd/pillow-12.2.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d362d1878f00c142b7e1a16e6e5e780f02be8195123f164edf7eddd911eefe7c", size = 8126550, upload-time = "2026-04-01T14:44:26.772Z" }, - { url = "https://files.pythonhosted.org/packages/4e/48/6ffc514adce69f6050d0753b1a18fd920fce8cac87620d5a31231b04bfc5/pillow-12.2.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2c727a6d53cb0018aadd8018c2b938376af27914a68a492f59dfcaca650d5eea", size = 6433114, upload-time = "2026-04-01T14:44:29.615Z" }, - { url = "https://files.pythonhosted.org/packages/36/a3/f9a77144231fb8d40ee27107b4463e205fa4677e2ca2548e14da5cf18dce/pillow-12.2.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:efd8c21c98c5cc60653bcb311bef2ce0401642b7ce9d09e03a7da87c878289d4", size = 7115667, upload-time = "2026-04-01T14:44:32.773Z" }, - { url = "https://files.pythonhosted.org/packages/c1/fc/ac4ee3041e7d5a565e1c4fd72a113f03b6394cc72ab7089d27608f8aaccb/pillow-12.2.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9f08483a632889536b8139663db60f6724bfcb443c96f1b18855860d7d5c0fd4", size = 6538966, upload-time = "2026-04-01T14:44:35.252Z" }, - { url = "https://files.pythonhosted.org/packages/c0/a8/27fb307055087f3668f6d0a8ccb636e7431d56ed0750e07a60547b1e083e/pillow-12.2.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:dac8d77255a37e81a2efcbd1fc05f1c15ee82200e6c240d7e127e25e365c39ea", size = 7238241, upload-time = "2026-04-01T14:44:37.875Z" }, - { url = "https://files.pythonhosted.org/packages/ad/4b/926ab182c07fccae9fcb120043464e1ff1564775ec8864f21a0ebce6ac25/pillow-12.2.0-cp313-cp313t-win32.whl", hash = "sha256:ee3120ae9dff32f121610bb08e4313be87e03efeadfc6c0d18f89127e24d0c24", size = 6379592, upload-time = "2026-04-01T14:44:40.336Z" }, - { url = "https://files.pythonhosted.org/packages/c2/c4/f9e476451a098181b30050cc4c9a3556b64c02cf6497ea421ac047e89e4b/pillow-12.2.0-cp313-cp313t-win_amd64.whl", hash = "sha256:325ca0528c6788d2a6c3d40e3568639398137346c3d6e66bb61db96b96511c98", size = 7085542, upload-time = "2026-04-01T14:44:43.251Z" }, - { url = "https://files.pythonhosted.org/packages/00/a4/285f12aeacbe2d6dc36c407dfbbe9e96d4a80b0fb710a337f6d2ad978c75/pillow-12.2.0-cp313-cp313t-win_arm64.whl", hash = "sha256:2e5a76d03a6c6dcef67edabda7a52494afa4035021a79c8558e14af25313d453", size = 2465765, upload-time = "2026-04-01T14:44:45.996Z" }, - { url = "https://files.pythonhosted.org/packages/bf/98/4595daa2365416a86cb0d495248a393dfc84e96d62ad080c8546256cb9c0/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:3adc9215e8be0448ed6e814966ecf3d9952f0ea40eb14e89a102b87f450660d8", size = 4100848, upload-time = "2026-04-01T14:44:48.48Z" }, - { url = "https://files.pythonhosted.org/packages/0b/79/40184d464cf89f6663e18dfcf7ca21aae2491fff1a16127681bf1fa9b8cf/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:6a9adfc6d24b10f89588096364cc726174118c62130c817c2837c60cf08a392b", size = 4176515, upload-time = "2026-04-01T14:44:51.353Z" }, - { url = "https://files.pythonhosted.org/packages/b0/63/703f86fd4c422a9cf722833670f4f71418fb116b2853ff7da722ea43f184/pillow-12.2.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:6a6e67ea2e6feda684ed370f9a1c52e7a243631c025ba42149a2cc5934dec295", size = 3640159, upload-time = "2026-04-01T14:44:53.588Z" }, - { url = "https://files.pythonhosted.org/packages/71/e0/fb22f797187d0be2270f83500aab851536101b254bfa1eae10795709d283/pillow-12.2.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:2bb4a8d594eacdfc59d9e5ad972aa8afdd48d584ffd5f13a937a664c3e7db0ed", size = 5312185, upload-time = "2026-04-01T14:44:56.039Z" }, - { url = "https://files.pythonhosted.org/packages/ba/8c/1a9e46228571de18f8e28f16fabdfc20212a5d019f3e3303452b3f0a580d/pillow-12.2.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:80b2da48193b2f33ed0c32c38140f9d3186583ce7d516526d462645fd98660ae", size = 4695386, upload-time = "2026-04-01T14:44:58.663Z" }, - { url = "https://files.pythonhosted.org/packages/70/62/98f6b7f0c88b9addd0e87c217ded307b36be024d4ff8869a812b241d1345/pillow-12.2.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:22db17c68434de69d8ecfc2fe821569195c0c373b25cccb9cbdacf2c6e53c601", size = 6280384, upload-time = "2026-04-01T14:45:01.5Z" }, - { url = "https://files.pythonhosted.org/packages/5e/03/688747d2e91cfbe0e64f316cd2e8005698f76ada3130d0194664174fa5de/pillow-12.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7b14cc0106cd9aecda615dd6903840a058b4700fcb817687d0ee4fc8b6e389be", size = 8091599, upload-time = "2026-04-01T14:45:04.5Z" }, - { url = "https://files.pythonhosted.org/packages/f6/35/577e22b936fcdd66537329b33af0b4ccfefaeabd8aec04b266528cddb33c/pillow-12.2.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cbeb542b2ebc6fcdacabf8aca8c1a97c9b3ad3927d46b8723f9d4f033288a0f", size = 6396021, upload-time = "2026-04-01T14:45:07.117Z" }, - { url = "https://files.pythonhosted.org/packages/11/8d/d2532ad2a603ca2b93ad9f5135732124e57811d0168155852f37fbce2458/pillow-12.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4bfd07bc812fbd20395212969e41931001fd59eb55a60658b0e5710872e95286", size = 7083360, upload-time = "2026-04-01T14:45:09.763Z" }, - { url = "https://files.pythonhosted.org/packages/5e/26/d325f9f56c7e039034897e7380e9cc202b1e368bfd04d4cbe6a441f02885/pillow-12.2.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9aba9a17b623ef750a4d11b742cbafffeb48a869821252b30ee21b5e91392c50", size = 6507628, upload-time = "2026-04-01T14:45:12.378Z" }, - { url = "https://files.pythonhosted.org/packages/5f/f7/769d5632ffb0988f1c5e7660b3e731e30f7f8ec4318e94d0a5d674eb65a4/pillow-12.2.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:deede7c263feb25dba4e82ea23058a235dcc2fe1f6021025dc71f2b618e26104", size = 7209321, upload-time = "2026-04-01T14:45:15.122Z" }, - { url = "https://files.pythonhosted.org/packages/6a/7a/c253e3c645cd47f1aceea6a8bacdba9991bf45bb7dfe927f7c893e89c93c/pillow-12.2.0-cp314-cp314-win32.whl", hash = "sha256:632ff19b2778e43162304d50da0181ce24ac5bb8180122cbe1bf4673428328c7", size = 6479723, upload-time = "2026-04-01T14:45:17.797Z" }, - { url = "https://files.pythonhosted.org/packages/cd/8b/601e6566b957ca50e28725cb6c355c59c2c8609751efbecd980db44e0349/pillow-12.2.0-cp314-cp314-win_amd64.whl", hash = "sha256:4e6c62e9d237e9b65fac06857d511e90d8461a32adcc1b9065ea0c0fa3a28150", size = 7217400, upload-time = "2026-04-01T14:45:20.529Z" }, - { url = "https://files.pythonhosted.org/packages/d6/94/220e46c73065c3e2951bb91c11a1fb636c8c9ad427ac3ce7d7f3359b9b2f/pillow-12.2.0-cp314-cp314-win_arm64.whl", hash = "sha256:b1c1fbd8a5a1af3412a0810d060a78b5136ec0836c8a4ef9aa11807f2a22f4e1", size = 2554835, upload-time = "2026-04-01T14:45:23.162Z" }, - { url = "https://files.pythonhosted.org/packages/b6/ab/1b426a3974cb0e7da5c29ccff4807871d48110933a57207b5a676cccc155/pillow-12.2.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:57850958fe9c751670e49b2cecf6294acc99e562531f4bd317fa5ddee2068463", size = 5314225, upload-time = "2026-04-01T14:45:25.637Z" }, - { url = "https://files.pythonhosted.org/packages/19/1e/dce46f371be2438eecfee2a1960ee2a243bbe5e961890146d2dee1ff0f12/pillow-12.2.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d5d38f1411c0ed9f97bcb49b7bd59b6b7c314e0e27420e34d99d844b9ce3b6f3", size = 4698541, upload-time = "2026-04-01T14:45:28.355Z" }, - { url = "https://files.pythonhosted.org/packages/55/c3/7fbecf70adb3a0c33b77a300dc52e424dc22ad8cdc06557a2e49523b703d/pillow-12.2.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5c0a9f29ca8e79f09de89293f82fc9b0270bb4af1d58bc98f540cc4aedf03166", size = 6322251, upload-time = "2026-04-01T14:45:30.924Z" }, - { url = "https://files.pythonhosted.org/packages/1c/3c/7fbc17cfb7e4fe0ef1642e0abc17fc6c94c9f7a16be41498e12e2ba60408/pillow-12.2.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1610dd6c61621ae1cf811bef44d77e149ce3f7b95afe66a4512f8c59f25d9ebe", size = 8127807, upload-time = "2026-04-01T14:45:33.908Z" }, - { url = "https://files.pythonhosted.org/packages/ff/c3/a8ae14d6defd2e448493ff512fae903b1e9bd40b72efb6ec55ce0048c8ce/pillow-12.2.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0a34329707af4f73cf1782a36cd2289c0368880654a2c11f027bcee9052d35dd", size = 6433935, upload-time = "2026-04-01T14:45:36.623Z" }, - { url = "https://files.pythonhosted.org/packages/6e/32/2880fb3a074847ac159d8f902cb43278a61e85f681661e7419e6596803ed/pillow-12.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e9c4f5b3c546fa3458a29ab22646c1c6c787ea8f5ef51300e5a60300736905e", size = 7116720, upload-time = "2026-04-01T14:45:39.258Z" }, - { url = "https://files.pythonhosted.org/packages/46/87/495cc9c30e0129501643f24d320076f4cc54f718341df18cc70ec94c44e1/pillow-12.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fb043ee2f06b41473269765c2feae53fc2e2fbf96e5e22ca94fb5ad677856f06", size = 6540498, upload-time = "2026-04-01T14:45:41.879Z" }, - { url = "https://files.pythonhosted.org/packages/18/53/773f5edca692009d883a72211b60fdaf8871cbef075eaa9d577f0a2f989e/pillow-12.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f278f034eb75b4e8a13a54a876cc4a5ab39173d2cdd93a638e1b467fc545ac43", size = 7239413, upload-time = "2026-04-01T14:45:44.705Z" }, - { url = "https://files.pythonhosted.org/packages/c9/e4/4b64a97d71b2a83158134abbb2f5bd3f8a2ea691361282f010998f339ec7/pillow-12.2.0-cp314-cp314t-win32.whl", hash = "sha256:6bb77b2dcb06b20f9f4b4a8454caa581cd4dd0643a08bacf821216a16d9c8354", size = 6482084, upload-time = "2026-04-01T14:45:47.568Z" }, - { url = "https://files.pythonhosted.org/packages/ba/13/306d275efd3a3453f72114b7431c877d10b1154014c1ebbedd067770d629/pillow-12.2.0-cp314-cp314t-win_amd64.whl", hash = "sha256:6562ace0d3fb5f20ed7290f1f929cae41b25ae29528f2af1722966a0a02e2aa1", size = 7225152, upload-time = "2026-04-01T14:45:50.032Z" }, - { url = "https://files.pythonhosted.org/packages/ff/6e/cf826fae916b8658848d7b9f38d88da6396895c676e8086fc0988073aaf8/pillow-12.2.0-cp314-cp314t-win_arm64.whl", hash = "sha256:aa88ccfe4e32d362816319ed727a004423aab09c5cea43c01a4b435643fa34eb", size = 2556579, upload-time = "2026-04-01T14:45:52.529Z" }, +version = "12.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1c/3d/bb7fca845737cf9d7dbde16ed1843984665ff2e0a518f5db43e77ec540b9/pillow-12.3.0.tar.gz", hash = "sha256:3b8182a766685eaa002637e28b4ec8d6b18819a0c71f579bf0dbaa5830297cce", size = 47025035, upload-time = "2026-07-01T11:56:38.965Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/37/bf/fb3ebff8ddcb76aac5a01389251bbbb9519922a9b520d8247c1ca864a25d/pillow-12.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:ba09209fbe443b4acccebe845d8a138b89a8f4fbaeedd44953490b5315d5e965", size = 5345969, upload-time = "2026-07-01T11:54:06.397Z" }, + { url = "https://files.pythonhosted.org/packages/d8/66/9a386a92561f402389a4fc70c18838bf6d35eb5eb5c6850b4b2dc64f5048/pillow-12.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ffd0c5368496f41b0944be820fcb7a838aa6e623d250b01acf2643939c3f99d7", size = 4780323, upload-time = "2026-07-01T11:54:09.351Z" }, + { url = "https://files.pythonhosted.org/packages/25/27/ac8f99618ffd3dde21db0f4d4b1d2ab00c0880595bfd17df103f7f39fd0c/pillow-12.3.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d9c7f76c0673154f044e9d78c8655fb4213f6ca31a836df48b40fe5d187717b9", size = 6266838, upload-time = "2026-07-01T11:54:11.71Z" }, + { url = "https://files.pythonhosted.org/packages/84/21/a35af28dcc61f37ed850a2d64c65c701321dfbf25085e469d5559360cbbf/pillow-12.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:78cb2c6865a35ab8ff8b75fd122f6033b92a62c82801110e48ddd6c936a45d91", size = 6940830, upload-time = "2026-07-01T11:54:13.732Z" }, + { url = "https://files.pythonhosted.org/packages/eb/51/8b08617af3ad95e33ce6d7dd2c99ed6c8298f7fb131636303956be022e25/pillow-12.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e491916b378fba47242221bb9ead245211b70d504f495d105d17b14a24b4907c", size = 6344383, upload-time = "2026-07-01T11:54:15.756Z" }, + { url = "https://files.pythonhosted.org/packages/1d/72/cf78ac9780bb93c28328f408973845a309d4d145041665f734572ced1b52/pillow-12.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0dd2064cbc55aaec028ef5fbb60fa47bb6c3e7918e07ff17935284b227a9d2df", size = 7052934, upload-time = "2026-07-01T11:54:17.721Z" }, + { url = "https://files.pythonhosted.org/packages/20/20/25e0f4dc178a6bc0696793720055519a0de89e7661dae886992decbd2f81/pillow-12.3.0-cp312-cp312-win32.whl", hash = "sha256:dbce0b29841537a2fa4a214c2bbf14de3587c9680caa9b4e217568472490b28f", size = 6472684, upload-time = "2026-07-01T11:54:19.839Z" }, + { url = "https://files.pythonhosted.org/packages/45/89/da2f7971a317f83d807fdd4065c0af40208e59e692cc43d315a71a0e96d1/pillow-12.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:a2b55dd6b2a4c4b7d87ffa56bdb33fdc5fdb9a462173861a7bc097f17d91cb09", size = 7227137, upload-time = "2026-07-01T11:54:22.025Z" }, + { url = "https://files.pythonhosted.org/packages/de/47/4845a0a6c0dbf1db8456bd9fc791f13c5ced7ced20606d08a0aacfd25b49/pillow-12.3.0-cp312-cp312-win_arm64.whl", hash = "sha256:331b624368d4f1d069149002f25f44bc61c8919ce8ddb3c45bdad8f6e2d89510", size = 2568267, upload-time = "2026-07-01T11:54:24.051Z" }, + { url = "https://files.pythonhosted.org/packages/9d/ac/31fb64e1e7efb5a4b50cd3d92049ba89ac6e4d8d3bb6a74e15048ca3353e/pillow-12.3.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:21900ce7ba264168cd50defae43cd75d25c833ad4ad6e73ffc5596d12e25ac89", size = 4161684, upload-time = "2026-07-01T11:54:25.934Z" }, + { url = "https://files.pythonhosted.org/packages/87/b4/9805e23d2b4d77842b468513841fda254ee42f0289d25088340e4ff46e2d/pillow-12.3.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:4e8c2a84d977f50b9daed6eeaf3baef67d00d5d74d932288f02cb94518ee3ace", size = 4255487, upload-time = "2026-07-01T11:54:27.935Z" }, + { url = "https://files.pythonhosted.org/packages/df/39/ecf519435a200c693fe053a6ee4d835b41cf963a4dfc2551c4e637cb2a71/pillow-12.3.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:ae26d61dfa7a47befdc7572b521024e8745f3d809bd95ca9505a7bba9ef849ec", size = 3696433, upload-time = "2026-07-01T11:54:29.813Z" }, + { url = "https://files.pythonhosted.org/packages/42/92/2fc3ffad878ae8dd5469ec1bc8eb83b71f48e13efdf68f02709003982a32/pillow-12.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7a743ff716f746fc19a9557f60dab1600d4613255f8a7aeb3cdde4db7eb15a66", size = 5345889, upload-time = "2026-07-01T11:54:31.97Z" }, + { url = "https://files.pythonhosted.org/packages/10/76/8803c13605b763d33d156c4678fc77f8443389c0c51c8aef707bb02015f4/pillow-12.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d69141514cc30b774ceea5e3ed3a6635c8d8a96edf664689b890f4089111fb35", size = 4780109, upload-time = "2026-07-01T11:54:34.026Z" }, + { url = "https://files.pythonhosted.org/packages/1f/01/e18aff37cb0b4aac47ac90f016d347a49aca667ef97f190b06ac2aabc928/pillow-12.3.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f7401aebd7f581d7f83a439d87d474999317ee099218e5ad25d125290990ba65", size = 6263736, upload-time = "2026-07-01T11:54:36.131Z" }, + { url = "https://files.pythonhosted.org/packages/f7/62/de5bdd77d935331f4f802edc11e4d82950f642caad6cb2f949837b8560e2/pillow-12.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0847a763afefb695bc912d7c131e7e0632d4edc1d8698f58ddabec8e46b8b6d3", size = 6937129, upload-time = "2026-07-01T11:54:38.216Z" }, + { url = "https://files.pythonhosted.org/packages/70/4d/105627a13300c5e0df1d174230b32fd1273062c96f7745fd552b945d1e1d/pillow-12.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:571b9fcb07b97ef3a492028fb3d2dc0993ca23a06138b0315286566d29ef718a", size = 6339562, upload-time = "2026-07-01T11:54:40.354Z" }, + { url = "https://files.pythonhosted.org/packages/6b/1d/f13de01a553988ab895ba1c722e06cf3144d4f57656fd5b81b6d881f1179/pillow-12.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:756c768d0c9c2955feb7a56c37ea24aea2e369f8d36a88da270b6a9f19e62b5e", size = 7049439, upload-time = "2026-07-01T11:54:42.489Z" }, + { url = "https://files.pythonhosted.org/packages/c9/f9/066794cca041b969964f779ee5fa66a9498bbf34248ac39c5d7954e4198f/pillow-12.3.0-cp313-cp313-win32.whl", hash = "sha256:a876864214e136f0eb367788dbd7df045f4806801518e2cfe9e13229cfe06d8f", size = 6473287, upload-time = "2026-07-01T11:54:44.9Z" }, + { url = "https://files.pythonhosted.org/packages/a6/9b/7a58e61d62be561da3a356fe2384d4059a6345fc130e23ef1c36a5b81d24/pillow-12.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:1cca606cd25738df4ed873d5ad46bbdb3d83b5cbca291f6b4ff13a4df6b0bbe8", size = 7239691, upload-time = "2026-07-01T11:54:47.141Z" }, + { url = "https://files.pythonhosted.org/packages/aa/b0/c4ed4f0ef8f8fa5ee8351537db6650bb8189f7e118842978dd6589065692/pillow-12.3.0-cp313-cp313-win_arm64.whl", hash = "sha256:b629de27fda84b42cde7edef0d85f13b958b47f6e9bbcbba9b673c562a89bd8b", size = 2568185, upload-time = "2026-07-01T11:54:49.137Z" }, + { url = "https://files.pythonhosted.org/packages/dc/01/001f65b68192f0228cc1dbbc8d2530ab5d58b61037ba0587f946fea607cd/pillow-12.3.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:9cf95fe4d0f84c82d282745d9bb08ad9f926efa00be4697e767b814ce40d4330", size = 4161736, upload-time = "2026-07-01T11:54:51.156Z" }, + { url = "https://files.pythonhosted.org/packages/1a/d2/0219746d0fd16fc8a84498e79452375be3797d3ce4044596ce565164b84f/pillow-12.3.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:8728f216dcdb6e6d555cf971cb34076139ad74b31fc2c14da4fafc741c5f6217", size = 4255435, upload-time = "2026-07-01T11:54:53.414Z" }, + { url = "https://files.pythonhosted.org/packages/c8/02/8d0bc62ef0302318c46ff2a512822d2610e81c7aa46c9b3abe6cbaca5ad0/pillow-12.3.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:a45650e8ce7fafffd731db8550230db6b0d306d181a90b67d3e6bca2f1990930", size = 3696262, upload-time = "2026-07-01T11:54:55.739Z" }, + { url = "https://files.pythonhosted.org/packages/85/e2/73c77d218410b14f5f2d565e8a998d5317b7b9c75368d29985139f7a46f0/pillow-12.3.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:ba54cfebe86920a559a7c4d6b9050791c20513650a1952ebe3368c7dc70306f8", size = 5350344, upload-time = "2026-07-01T11:54:57.657Z" }, + { url = "https://files.pythonhosted.org/packages/c7/da/32c752228ae345f489e3a42499d817b6c3996da7e8a3bc7a04fc806b243b/pillow-12.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:e158cb00350dc278f3b91551101aa7d12415a66ebf2c91d8d5ac14e56ddd3ad0", size = 4780131, upload-time = "2026-07-01T11:54:59.713Z" }, + { url = "https://files.pythonhosted.org/packages/b1/9d/8b2c807dbef61a5197c047afe99823787eb66f63daf9fb2432f91d6f0462/pillow-12.3.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e9aeb04d6aef139de265b29683e119b638208f88cf73cdd1658aa07221165321", size = 6263757, upload-time = "2026-07-01T11:55:01.778Z" }, + { url = "https://files.pythonhosted.org/packages/5c/44/c85361f65dbe00eea8576ee467c768d25129989efb76e94f205e9ca9bb46/pillow-12.3.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:251bf95b67017e27b13d82f5b326234ca62d70f9cf4c2b9032de2358a3b12c7b", size = 6936962, upload-time = "2026-07-01T11:55:03.93Z" }, + { url = "https://files.pythonhosted.org/packages/18/7e/e483414b35800b86b6f08dbbc7803fb5cd52c4d6f897f47d53ea2c7e6f65/pillow-12.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:fe3cca2e4e8a592be0f269a1ca4835c25199d9f3ce815c8491048f785b0a0198", size = 6339171, upload-time = "2026-07-01T11:55:05.989Z" }, + { url = "https://files.pythonhosted.org/packages/f0/f4/68c491844841ede6bed70189546b3ee9731cf9f2cbad396faff5e1ccba45/pillow-12.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:23aceaa007d6172b02c277f0cd359c79492bbb14f7072b4ede9fbcaf20648130", size = 7048116, upload-time = "2026-07-01T11:55:08.131Z" }, + { url = "https://files.pythonhosted.org/packages/a3/34/77f3f793fed8efc7d243f21b33c5a3f0d1c97ee70346d3db855587e155ff/pillow-12.3.0-cp314-cp314-win32.whl", hash = "sha256:af8d94b0db561cf68b88a267c5c44b49e134f525d0dc2cb7ed413a66bc23559a", size = 6467209, upload-time = "2026-07-01T11:55:10.408Z" }, + { url = "https://files.pythonhosted.org/packages/f1/e0/492879f69d94f91f60fc8cd05ba03650e9520afebb2fb7aa12777d7c7f38/pillow-12.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:fdafc9cce40277e0f7a0feabce0ee50dd2fa1800f3b38015e51296b5e814048d", size = 7237707, upload-time = "2026-07-01T11:55:12.745Z" }, + { url = "https://files.pythonhosted.org/packages/c9/ac/6b11f2875f1c2ac040d84e1bbf9cf22a88038f901ca1037898b280b38365/pillow-12.3.0-cp314-cp314-win_arm64.whl", hash = "sha256:e91206ee562682b51b98ef4b26a6ef48fd84e15fd4c4bc5ec768eb641d206838", size = 2565995, upload-time = "2026-07-01T11:55:14.736Z" }, + { url = "https://files.pythonhosted.org/packages/52/69/c2208e56af9bfc1913afb24020297a691eb1d4ef688474c8a04913f65e04/pillow-12.3.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:164b31cd1a0490ab6efae01aa5df49da7061be0af1b30e035b6e9a1bfe34ee6e", size = 5352503, upload-time = "2026-07-01T11:55:17.076Z" }, + { url = "https://files.pythonhosted.org/packages/07/70/e5686d753e898a45d778ff1718dba8516ead6ab6b95d85fc8c4b70650cf2/pillow-12.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:5afb51d599ea772b8365ae807ae557f18bccfe46ab261fd1c2a9ed700fc6eb17", size = 4782956, upload-time = "2026-07-01T11:55:19.448Z" }, + { url = "https://files.pythonhosted.org/packages/d5/37/25c6692f06927ee973ff18c8d9ee98ad0b4d84ee67a09610c2dd1447958e/pillow-12.3.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3edce1d53195db527e0191f84b71d02022de0540bf43a16ed734ed7537b07385", size = 6322855, upload-time = "2026-07-01T11:55:21.613Z" }, + { url = "https://files.pythonhosted.org/packages/cc/91/420637fcb8f1bc11029e403b4538e6694744428d8246118e45719f944556/pillow-12.3.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bf16ba1b4d0b6b7c8e534936632270cf70eb00dbe09005bc345b2677b726855c", size = 6989642, upload-time = "2026-07-01T11:55:24.006Z" }, + { url = "https://files.pythonhosted.org/packages/10/08/b94d7811281ccf0d143a1cf768d1c49e1e54af63e7b708ab2ee3eb87face/pillow-12.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:24870b09b224f7ae3c39ed07d10e819d06f8720bc551847b1d623832b5b0e28d", size = 6391281, upload-time = "2026-07-01T11:55:26.252Z" }, + { url = "https://files.pythonhosted.org/packages/d2/87/24233f785f55474dc02ce3e739c5528a77e3a862e9333d1dd7a25cc31f70/pillow-12.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:30f2aa603c41533cc25c05acd0da21636e84a315768feb631c937177db558931", size = 7096716, upload-time = "2026-07-01T11:55:28.318Z" }, + { url = "https://files.pythonhosted.org/packages/23/26/fcb2f6e37175b04f53570b59937867e2b80ee1685e744023153028fc14f9/pillow-12.3.0-cp314-cp314t-win32.whl", hash = "sha256:4b0a7fe987b14c31ebda6083f74f22b561fd3739bc0ac51e019622e3d72668c7", size = 6474125, upload-time = "2026-07-01T11:55:30.956Z" }, + { url = "https://files.pythonhosted.org/packages/90/de/3634abee5f1c9e13c56787b7d5517b0ba8d6de51700b95578cf338349c9f/pillow-12.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:962864dc93511324d51ddbb5b9f8731bf71675b93ca612a07441896f4688fb8c", size = 7242939, upload-time = "2026-07-01T11:55:34.044Z" }, + { url = "https://files.pythonhosted.org/packages/ce/2a/fd13f8eb24de5714a6eb444a3d67e2842c6c576e159a43793adf23051351/pillow-12.3.0-cp314-cp314t-win_arm64.whl", hash = "sha256:0740a512dc522224c77d9aa5a8d70d8b7d73fb91f2c21125d8d025d3b8990e45", size = 2567506, upload-time = "2026-07-01T11:55:35.988Z" }, + { url = "https://files.pythonhosted.org/packages/5d/dc/8fdce34ec725a33c81c6ba122b904d6b9024e50ea9ac7bede62fab54506c/pillow-12.3.0-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:0feb2e9d6ad6c9e3c06effe9d00f3f1e618a6643273576b016f591e9315a7139", size = 4162063, upload-time = "2026-07-01T11:55:37.941Z" }, + { url = "https://files.pythonhosted.org/packages/76/66/2044b9a63d3b84ff048228dfcb7cd9bf0df983e8470971bf7d4c57b693de/pillow-12.3.0-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:9e881fca225083806662a5c43d627d215f258ff43c890f831966c7d7ba9c7402", size = 4255549, upload-time = "2026-07-01T11:55:40.022Z" }, + { url = "https://files.pythonhosted.org/packages/52/7e/1f67e6f4ece6b582ee4b539decbcc9f848dc245a93ed8cd7338bafef72f1/pillow-12.3.0-cp315-cp315-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:4998562bf62a445225f22e07c896bb04b35b1b1f2eb6d760584c9c51d7a5f78c", size = 3696331, upload-time = "2026-07-01T11:55:41.98Z" }, + { url = "https://files.pythonhosted.org/packages/12/40/d306fc2c8e4d45d7f175c77edca7063be7b86fe7fe6e68f4353bf71d808c/pillow-12.3.0-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:dc624f6bc473dacdf7ef7eb8678d0d08edf15cd94fad6ae5c7d6cc67a4e4902f", size = 5350370, upload-time = "2026-07-01T11:55:44.028Z" }, + { url = "https://files.pythonhosted.org/packages/dd/44/668fb1437e8ce420f62d6106eb66e44a5971602a4d794615bdf79315d82d/pillow-12.3.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:71d6097b330eea8fd15097780c8e89cb1a8ce7838669f48c5bacd6f663dd4701", size = 4780147, upload-time = "2026-07-01T11:55:46.073Z" }, + { url = "https://files.pythonhosted.org/packages/0c/08/93fa2e70e30a2d81547e481b6ee2bb9522117221fb1e0ce4b5df70967677/pillow-12.3.0-cp315-cp315-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:28ce87c5ab450a9dd970b52e5aca5fe63ed432d18a2eaddd1979a00a1ba24ace", size = 6273659, upload-time = "2026-07-01T11:55:48.264Z" }, + { url = "https://files.pythonhosted.org/packages/f8/6d/043e96ff814fc31a33077e4cba86082167db520c93632afdf2042febbb0c/pillow-12.3.0-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6b02afb9b97f65fbca5f31db6a2a3ba21aa93030225f150fa3f249717e938fb4", size = 6947439, upload-time = "2026-07-01T11:55:50.503Z" }, + { url = "https://files.pythonhosted.org/packages/af/92/ba71d2ee2ac0edf3fa33bd9d5ee9ee080da70b1766f3ca3934f9938ddac9/pillow-12.3.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:1182d52bc2d5e5d7d0949503aa7e36d12f42205dc287e4883f407b1988820d39", size = 6353577, upload-time = "2026-07-01T11:55:52.697Z" }, + { url = "https://files.pythonhosted.org/packages/0f/ce/e63064e2122923ff687c8ad792d0d736a7b3920a56a46982e81a7fdd25d6/pillow-12.3.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:e795b7eb908249c4e43c7c99fac7c2c75dab0c43566e37db472a355f63693d71", size = 7060394, upload-time = "2026-07-01T11:55:55.149Z" }, + { url = "https://files.pythonhosted.org/packages/54/76/a09cc3ccc8d773a7283d34c38bec1708f9e3cc932093cbc4c5e71ac4060b/pillow-12.3.0-cp315-cp315-win32.whl", hash = "sha256:57b3d78c95ba9059768b10e28b813002261d3f3dfc55cc48b0c988f625175827", size = 6467375, upload-time = "2026-07-01T11:55:57.769Z" }, + { url = "https://files.pythonhosted.org/packages/3e/03/1846c49ba3b1d5550392a4bbd06d6fb4578e1cd91a803198b5c90f5f7d53/pillow-12.3.0-cp315-cp315-win_amd64.whl", hash = "sha256:fa4ecea169a355be7a3ade2c783e2ed12f0e40d2c5621cda8b3297faf7fbb9f5", size = 7237048, upload-time = "2026-07-01T11:55:59.975Z" }, + { url = "https://files.pythonhosted.org/packages/fb/bb/89f35dcc79610423f9f195504d7def7f0d1416a711541b42867e25fe3412/pillow-12.3.0-cp315-cp315-win_arm64.whl", hash = "sha256:877c3f311ff35410f690861c4409e7ccbf0cd2f878e50628a28e5a0bb689e658", size = 2566006, upload-time = "2026-07-01T11:56:02.143Z" }, + { url = "https://files.pythonhosted.org/packages/30/88/707027ba09942dfa2c28759b5c222d769290a41c6d20ea60ec250801941f/pillow-12.3.0-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:e9871b1ffbfa9656b60aeee92ed5136a5742696006fa322b29ea3d8da0ecc9cf", size = 5352509, upload-time = "2026-07-01T11:56:04.2Z" }, + { url = "https://files.pythonhosted.org/packages/b0/6d/00352fa25332c2569cd387851f568cc5a4b75a9adbfb37ac4fbce4c02eec/pillow-12.3.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:53aa02d20d10c3d814d536aa4e5ac9b84ca0ff5a88377963b085ad6822f93e64", size = 4783167, upload-time = "2026-07-01T11:56:06.631Z" }, + { url = "https://files.pythonhosted.org/packages/13/4f/9e049dfa21af7c22427275720e2490267ba8138120add5c4c574deb69782/pillow-12.3.0-cp315-cp315t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:446c34dcc4324b084a53b705127dc15717b22c5e140ae0a3c38349d4efec071e", size = 6329237, upload-time = "2026-07-01T11:56:08.868Z" }, + { url = "https://files.pythonhosted.org/packages/36/16/cf6eeaae8d0fce8dd390a33437cf68c5d5bd73834a2bc6e2f14efda0ab45/pillow-12.3.0-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cf1845d02ad822a369a49f2bb9345b1614744267682e7a03527dc3bf6eea1777", size = 6997047, upload-time = "2026-07-01T11:56:11.379Z" }, + { url = "https://files.pythonhosted.org/packages/1e/69/dbf769bdd55f48bf5733cac28edc6364ffaa072ec9ba336266e4fe66be55/pillow-12.3.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:186941b6aef820ad110fb01fb06eb925374dc3a21b17e37ec9a53b250c6fe2d1", size = 6400440, upload-time = "2026-07-01T11:56:13.908Z" }, + { url = "https://files.pythonhosted.org/packages/a0/e1/ffc9cfc2eea0d178da8018e18e959301ad9d6bc9f3edb7181e748a474b97/pillow-12.3.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:f13c32a3abd6079a66d9526e18dad9b6d280384d49d7c54040cd57b6424041d9", size = 7105895, upload-time = "2026-07-01T11:56:16.575Z" }, + { url = "https://files.pythonhosted.org/packages/18/f0/a5595c1e8c3ae44b9828cb2f0fa8155e5095ef04d6327b8f61cf44a3df85/pillow-12.3.0-cp315-cp315t-win32.whl", hash = "sha256:1657923d2d45afb66526e5b933e5b3052e6bdea196c90d3abb2424e18c77dae8", size = 6474384, upload-time = "2026-07-01T11:56:18.855Z" }, + { url = "https://files.pythonhosted.org/packages/e4/04/62bcd9f844984c5938d3b05264a61d797a29d3e0812341a8204af70bbdee/pillow-12.3.0-cp315-cp315t-win_amd64.whl", hash = "sha256:8cd2f7bdda092d99c9fc2fb7391354f306d01443d22785d0cbfafa2e2c8bb418", size = 7243537, upload-time = "2026-07-01T11:56:21.214Z" }, + { url = "https://files.pythonhosted.org/packages/3d/68/1f3066acedf37673694a7141381d8f811ae97f30d34413d236abe7d489f1/pillow-12.3.0-cp315-cp315t-win_arm64.whl", hash = "sha256:06ff022112bc9cbf83b60f8e028d94ad87b60621706487e65f673de61610ab59", size = 2567491, upload-time = "2026-07-01T11:56:23.506Z" }, ] [[package]] From eefa424df0e7cfd1683ca7fb27996384141fea72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 18:11:51 +0200 Subject: [PATCH 05/61] chore(deps): bump the actions group with 3 updates (#4181) Bumps the actions group with 3 updates: [actions/labeler](https://github.com/actions/labeler), [actions/attest](https://github.com/actions/attest) and [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action). Updates `actions/labeler` from 6.2.0 to 7.0.0 - [Release notes](https://github.com/actions/labeler/releases) - [Commits](https://github.com/actions/labeler/compare/b8dd2d9be0f68b860e7dae5dae7d772984eacd6d...bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13) Updates `actions/attest` from 4.1.1 to 4.2.0 - [Release notes](https://github.com/actions/attest/releases) - [Changelog](https://github.com/actions/attest/blob/main/RELEASE.md) - [Commits](https://github.com/actions/attest/compare/a1948c3f048ba23858d222213b7c278aabede763...f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6) Updates `zizmorcore/zizmor-action` from 0.5.7 to 0.6.0 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/192e21d79ab29983730a13d1382995c2307fbcaa...6599ee8b7a49aef6a770f63d261d214911a7ce02) --- updated-dependencies: - dependency-name: actions/labeler dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/attest dependency-version: 4.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/needs_release_notes.yml | 2 +- .github/workflows/releases.yml | 2 +- .github/workflows/zarr-metadata-release.yml | 4 ++-- .github/workflows/zizmor.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/needs_release_notes.yml b/.github/workflows/needs_release_notes.yml index fa555d1478..e001e8cd43 100644 --- a/.github/workflows/needs_release_notes.yml +++ b/.github/workflows/needs_release_notes.yml @@ -21,7 +21,7 @@ jobs: pull-requests: write # Required to add labels to PRs runs-on: ubuntu-latest steps: - - uses: actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d # v6.2.0 + - uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} sync-labels: true diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 4d460f4a56..fe0d09f300 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -81,7 +81,7 @@ jobs: name: releases path: dist - name: Generate artifact attestation - uses: actions/attest@a1948c3f048ba23858d222213b7c278aabede763 # v4.1.1 + uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0 with: subject-path: dist/* - name: Publish package to PyPI diff --git a/.github/workflows/zarr-metadata-release.yml b/.github/workflows/zarr-metadata-release.yml index 5021f79d2e..bc9ecf9871 100644 --- a/.github/workflows/zarr-metadata-release.yml +++ b/.github/workflows/zarr-metadata-release.yml @@ -82,7 +82,7 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@a1948c3f048ba23858d222213b7c278aabede763 # v4.1.1 + uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0 with: subject-path: dist/* @@ -107,7 +107,7 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@a1948c3f048ba23858d222213b7c278aabede763 # v4.1.1 + uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0 with: subject-path: dist/* diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 6250426bae..1567bea713 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -32,4 +32,4 @@ jobs: persist-credentials: false - name: Run zizmor - uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7 + uses: zizmorcore/zizmor-action@6599ee8b7a49aef6a770f63d261d214911a7ce02 # v0.6.0 From 0b727571268c8962717ab5c23965c4642fe6bd36 Mon Sep 17 00:00:00 2001 From: Joe Hamman Date: Mon, 27 Jul 2026 19:31:14 -0700 Subject: [PATCH 06/61] feat: ZipStore accepts open binary file-like objects (#4187) Allows constructing a ZipStore from any seekable binary reader, enabling zip archives on remote storage: - io objects (BytesIO, fsspec file objects) are used directly - minimal readers that are not io.IOBase instances and whose read() may return buffer-protocol objects rather than bytes (e.g. obstore.ReadableFile) are adapted via a small io.RawIOBase wrapper when opened for reading clear()/move() raise NotImplementedError for file-object-backed stores. Co-authored-by: Claude Fable 5 --- changes/4187.feature.md | 4 + docs/user-guide/storage.md | 13 +++ src/zarr/storage/_zip.py | 114 +++++++++++++++++++++++-- tests/test_store/test_zip.py | 159 +++++++++++++++++++++++++++++++++++ 4 files changed, 281 insertions(+), 9 deletions(-) create mode 100644 changes/4187.feature.md diff --git a/changes/4187.feature.md b/changes/4187.feature.md new file mode 100644 index 0000000000..87133e2034 --- /dev/null +++ b/changes/4187.feature.md @@ -0,0 +1,4 @@ +`ZipStore` now accepts an open binary file-like object in place of a path, enabling +zip archives on remote storage (e.g. a file opened with `fsspec` or an +`obstore.ReadableFile`). Operations that require a filesystem location +(`clear`, `move`) raise `NotImplementedError` for file-object-backed stores. diff --git a/docs/user-guide/storage.md b/docs/user-guide/storage.md index 7e0154b2a0..0ba6202c76 100644 --- a/docs/user-guide/storage.md +++ b/docs/user-guide/storage.md @@ -124,6 +124,19 @@ array = zarr.create_array(store=store, shape=(2,), dtype='float64') print(array) ``` +In place of a path, `ZipStore` also accepts an open binary file object (for +example a file opened with `fsspec`, or an `obstore` reader), enabling zip +archives on remote storage. The file must stay open for as long as the store +is in use: + +```python exec="true" session="storage" source="above" result="ansi" +store.close() +f = open('data.zip', mode='rb') # must stay open while the store is used +array = zarr.open_array(store=zarr.storage.ZipStore(f), mode='r') +print(array[:]) +f.close() +``` + ### Remote Store The [`zarr.storage.FsspecStore`][] stores the contents of a Zarr hierarchy following the same diff --git a/src/zarr/storage/_zip.py b/src/zarr/storage/_zip.py index 430b0c3e2a..69ae18bc2c 100644 --- a/src/zarr/storage/_zip.py +++ b/src/zarr/storage/_zip.py @@ -1,12 +1,13 @@ from __future__ import annotations +import io import os import shutil import threading import time import zipfile from pathlib import Path -from typing import TYPE_CHECKING, Any, Literal +from typing import IO, TYPE_CHECKING, Any, Literal from zarr.abc.store import ( ByteRequest, @@ -23,14 +24,67 @@ ZipStoreAccessModeLiteral = Literal["r", "w", "a"] +class _RawReaderAdapter(io.RawIOBase): + """ + Adapt a minimal seekable reader to the `io` interface `zipfile` needs. + + Some file-like objects (e.g. `obstore.ReadableFile`) implement + `read`/`seek`/`tell` but are not `io.IOBase` instances, and their + `read` may return a buffer-protocol object rather than `bytes`. + Wrapping in this adapter plus `io.BufferedReader` yields real `bytes`. + + Reads are clamped to the bytes remaining before EOF: some readers + (obstore < 0.6) raise on short reads rather than returning fewer bytes. + The size is cached, which is safe because the adapter is only used for + read-only access. + """ + + def __init__(self, fileobj: IO[bytes]) -> None: + self._fileobj = fileobj + self._size: int | None = None + + def _get_size(self) -> int: + if self._size is None: + pos = self._fileobj.tell() + self._size = self._fileobj.seek(0, os.SEEK_END) + self._fileobj.seek(pos) + return self._size + + def readable(self) -> bool: + return True + + def seekable(self) -> bool: + return True + + def seek(self, pos: int, whence: int = 0) -> int: + return self._fileobj.seek(pos, whence) + + def tell(self) -> int: + return self._fileobj.tell() + + def readinto(self, b: Any) -> int: + n_requested = min(len(b), self._get_size() - self._fileobj.tell()) + if n_requested <= 0: + return 0 + data = self._fileobj.read(n_requested) + n = len(data) + b[:n] = memoryview(data) + return n + + class ZipStore(Store): """ Store using a ZIP file. Parameters ---------- - path : str - Location of file. + path : str, Path, or IO[bytes] + Location of file, or an open binary file object. A file object must + support `read`, `seek`, and `tell`; objects that are not `io.IOBase` + instances (e.g. an `obstore` reader) are adapted automatically but + can only be used for reading (`mode="r"`). The file object must stay + open for the lifetime of the store, and operations that require a + filesystem location (`clear`, `move`, pickling) are not supported. mode : str, optional One of 'r' to read an existing file, 'w' to truncate and write a new file, 'a' to append to an existing file, or 'x' to exclusively create @@ -58,16 +112,17 @@ class ZipStore(Store): supports_deletes: bool = False supports_listing: bool = True - path: Path + path: Path | None compression: int allowZip64: bool _zf: zipfile.ZipFile _lock: threading.RLock + _fileobj: IO[bytes] | None def __init__( self, - path: Path | str, + path: Path | str | IO[bytes], *, mode: ZipStoreAccessModeLiteral = "r", read_only: bool | None = None, @@ -81,8 +136,28 @@ def __init__( if isinstance(path, str): path = Path(path) - assert isinstance(path, Path) - self.path = path # root? + if isinstance(path, Path): + self.path = path # root? + self._fileobj = None + else: + self.path = None + if not isinstance(path, io.IOBase): + if not all( + callable(getattr(path, attr, None)) for attr in ("read", "seek", "tell") + ): + raise TypeError( + f"expected a path or an open binary file object supporting " + f"read/seek/tell, got {type(path).__name__}" + ) + if mode != "r": + raise TypeError( + f"a file object that is not an io.IOBase instance can only be " + f"opened for reading (mode='r', got mode={mode!r})" + ) + # e.g. an obstore ReadableFile: readable and seekable, but + # not an io object and reads may not return bytes + path = io.BufferedReader(_RawReaderAdapter(path)) + self._fileobj = path self._zmode = mode self.compression = compression @@ -95,7 +170,7 @@ def _sync_open(self) -> None: self._lock = threading.RLock() self._zf = zipfile.ZipFile( - self.path, + self.path if self.path is not None else self._fileobj, # type: ignore[arg-type] mode=self._zmode, compression=self.compression, allowZip64=self.allowZip64, @@ -107,6 +182,13 @@ async def _open(self) -> None: self._sync_open() def __getstate__(self) -> dict[str, Any]: + if self.path is None: + # A path-backed store pickles its path and reopens the file on + # unpickling; an open file object cannot be serialized that way. + raise TypeError( + "cannot pickle a ZipStore backed by a file-like object; " + "construct the store from a path instead" + ) # We need a copy to not modify the state of the original store state = self.__dict__.copy() for attr in ["_zf", "_lock"]: @@ -130,6 +212,10 @@ async def clear(self) -> None: # docstring inherited with self._lock: self._check_writable() + if self.path is None: + raise NotImplementedError( + "clear() is not supported for a ZipStore backed by a file-like object" + ) self._zf.close() os.remove(self.path) self._zf = zipfile.ZipFile( @@ -137,13 +223,19 @@ async def clear(self) -> None: ) def __str__(self) -> str: + if self.path is None: + return f"zip://{self._fileobj!r}" return f"zip://{self.path}" def __repr__(self) -> str: return f"ZipStore('{self}')" def __eq__(self, other: object) -> bool: - return isinstance(other, type(self)) and self.path == other.path + return ( + isinstance(other, type(self)) + and self.path == other.path + and self._fileobj is other._fileobj + ) def _get( self, @@ -297,6 +389,10 @@ async def move(self, path: Path | str) -> None: """ Move the store to another path. """ + if self.path is None: + raise NotImplementedError( + "move() is not supported for a ZipStore backed by a file-like object" + ) if isinstance(path, str): path = Path(path) self.close() diff --git a/tests/test_store/test_zip.py b/tests/test_store/test_zip.py index ed69114b51..0d8dadd18a 100644 --- a/tests/test_store/test_zip.py +++ b/tests/test_store/test_zip.py @@ -1,6 +1,8 @@ from __future__ import annotations +import io import os +import pickle import shutil import tempfile import zipfile @@ -188,6 +190,163 @@ async def test_move(self, tmp_path: Path) -> None: assert np.array_equal(array[...], np.arange(10)) +class TestZipStoreFileObj: + """ZipStore backed by an open binary file-like object instead of a path.""" + + @pytest.fixture + def zip_bytes(self, tmp_path: Path) -> bytes: + path = tmp_path / "data.zip" + store = ZipStore(path, mode="w") + zarr.create_array(store, data=np.arange(10), chunks=(5,)) + store.close() + return path.read_bytes() + + def test_read_from_fileobj(self, zip_bytes: bytes) -> None: + # an existing archive can be read through any seekable binary reader + store = ZipStore(io.BytesIO(zip_bytes), mode="r") + array = zarr.open_array(store, mode="r") + assert np.array_equal(array[...], np.arange(10)) + assert store.path is None + + def test_write_to_fileobj(self) -> None: + # a writable file object receives the archive; the bytes it holds + # after close() are a complete, reopenable zip + buffer = io.BytesIO() + store = ZipStore(buffer, mode="w", read_only=False) + zarr.create_array(store, data=np.arange(4)) + store.close() + + roundtrip = ZipStore(io.BytesIO(buffer.getvalue()), mode="r") + array = zarr.open_array(roundtrip, mode="r") + assert np.array_equal(array[...], np.arange(4)) + + async def test_clear_unsupported(self, zip_bytes: bytes) -> None: + # clear() requires a filesystem location, so it raises a clear error + # for file-object-backed stores + store = ZipStore(io.BytesIO(zip_bytes), mode="a", read_only=False) + store._sync_open() + with pytest.raises(NotImplementedError, match="clear.*file-like"): + await store.clear() + + async def test_move_unsupported(self, zip_bytes: bytes) -> None: + # move() requires a filesystem location, so it raises a clear error + # for file-object-backed stores + store = ZipStore(io.BytesIO(zip_bytes), mode="a", read_only=False) + store._sync_open() + with pytest.raises(NotImplementedError, match="move.*file-like"): + await store.move("elsewhere.zip") + + def test_invalid_file_object_rejected(self) -> None: + # objects without read/seek/tell are rejected at construction, not + # deep inside zipfile + with pytest.raises(TypeError, match="read/seek/tell"): + ZipStore(42, mode="r") # type: ignore[arg-type] + + @pytest.mark.parametrize("mode", ["w", "a", "x"]) + def test_non_iobase_reader_write_modes_rejected(self, zip_bytes: bytes, mode: str) -> None: + # readers that are not io.IOBase instances are adapted for reading + # only; write modes are rejected at construction with a clear error + class MinimalReader: + def __init__(self, data: bytes) -> None: + self._buffer = io.BytesIO(data) + + def read(self, size: int, /) -> bytes: + return self._buffer.read(size) + + def seek(self, pos: int, whence: int = 0, /) -> int: + return self._buffer.seek(pos, whence) + + def tell(self) -> int: + return self._buffer.tell() + + with pytest.raises(TypeError, match="opened for reading"): + ZipStore(MinimalReader(zip_bytes), mode=mode, read_only=False) # type: ignore[arg-type] + + def test_fsspec_file(self, tmp_path: Path, zip_bytes: bytes) -> None: + # a file opened through fsspec (already an io.IOBase) is used directly; + # fsspec's local filesystem stands in for a remote one + fsspec = pytest.importorskip("fsspec") + + path = tmp_path / "fsspec.zip" + path.write_bytes(zip_bytes) + with fsspec.open(f"local://{path}", "rb") as fileobj: + store = ZipStore(fileobj, mode="r") + array = zarr.open_array(store, mode="r") + assert np.array_equal(array[...], np.arange(10)) + assert store.path is None + + def test_obstore_reader(self, tmp_path: Path, zip_bytes: bytes) -> None: + # obstore's ReadableFile is not an io.IOBase and its read() returns a + # buffer-protocol object; ZipStore adapts it via _RawReaderAdapter + obstore = pytest.importorskip("obstore") + from obstore.store import LocalStore as ObstoreLocalStore + + (tmp_path / "obstore.zip").write_bytes(zip_bytes) + reader = obstore.open_reader(ObstoreLocalStore(str(tmp_path)), "obstore.zip") + store = ZipStore(reader, mode="r") + array = zarr.open_array(store, mode="r") + assert np.array_equal(array[...], np.arange(10)) + + def test_raw_reader_adapter_eof(self) -> None: + from zarr.storage._zip import _RawReaderAdapter + + class MinimalReader: + """Non-io.IOBase reader exposing only read/seek/tell, like obstore.""" + + def __init__(self, data: bytes) -> None: + self._buffer = io.BytesIO(data) + + def read(self, size: int, /) -> bytes: + return self._buffer.read(size) + + def seek(self, pos: int, whence: int = 0, /) -> int: + return self._buffer.seek(pos, whence) + + def tell(self) -> int: + return self._buffer.tell() + + # the adapter must clamp reads to EOF: some readers (obstore < 0.6) + # raise on short reads instead of returning fewer bytes + data = b"0123456789" + adapter = _RawReaderAdapter(MinimalReader(data)) # type: ignore[arg-type] + + # A read straddling EOF returns only the remaining bytes. + adapter.seek(len(data) - 3) + buf = bytearray(8) + assert adapter.readinto(buf) == 3 + assert bytes(buf[:3]) == data[-3:] + + # A read at EOF returns 0. + assert adapter.tell() == len(data) + assert adapter.readinto(bytearray(8)) == 0 + + def test_pickle_fileobj_raises(self, zip_bytes: bytes) -> None: + # an open file object cannot be reliably serialized, so pickling a + # file-object-backed store raises with a pointer at the alternative + store = ZipStore(io.BytesIO(zip_bytes), mode="r") + with pytest.raises(TypeError, match="cannot pickle a ZipStore backed by a file-like"): + pickle.dumps(store) + + def test_pickle_path_backed_roundtrip(self, tmp_path: Path, zip_bytes: bytes) -> None: + # path-backed stores remain picklable: the path is serialized and the + # archive is reopened on unpickling + path = tmp_path / "pickled.zip" + path.write_bytes(zip_bytes) + store = ZipStore(path, mode="r") + unpickled = pickle.loads(pickle.dumps(store)) + array = zarr.open_array(unpickled, mode="r") + assert np.array_equal(array[...], np.arange(10)) + + def test_str_and_eq(self, zip_bytes: bytes) -> None: + # file-object-backed stores stringify with the object repr and + # compare equal only when backed by the very same file object + fileobj = io.BytesIO(zip_bytes) + store = ZipStore(fileobj, mode="r") + assert str(store).startswith("zip://<") + assert store == ZipStore(fileobj, mode="r") + assert store != ZipStore(io.BytesIO(zip_bytes), mode="r") + + class ZipStoreLifecycleMachine(RuleBasedStateMachine): """Drive a ZipStore through construct / open / write / close transitions. From cb93ef80f3d825446fe4fa97499d0787b410f0a9 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Tue, 28 Jul 2026 16:56:48 +0200 Subject: [PATCH 07/61] feat: add type-safe `get_array` and `get_group` methods to `AsyncGroup` and `Group` (#4128) * chore(deps): bump the actions group across 1 directory with 8 updates (#176) Bumps the actions group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi) | `0.9.5` | `0.9.6` | | [codecov/codecov-action](https://github.com/codecov/codecov-action) | `6.0.0` | `6.0.1` | | [github/issue-metrics](https://github.com/github/issue-metrics) | `4.2.2` | `4.2.7` | | [j178/prek-action](https://github.com/j178/prek-action) | `2.0.3` | `2.0.4` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.0` | `7.0.1` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `7.0.0` | `8.0.1` | | [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) | `1.13.0` | `1.14.0` | | [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.5.3` | `0.5.6` | Updates `prefix-dev/setup-pixi` from 0.9.5 to 0.9.6 - [Release notes](https://github.com/prefix-dev/setup-pixi/releases) - [Commits](https://github.com/prefix-dev/setup-pixi/compare/1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0...5185adfbffb4bd703da3010310260805d89ebb11) Updates `codecov/codecov-action` from 6.0.0 to 6.0.1 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/57e3a136b779b570ffcdbf80b3bdc90e7fab3de2...e79a6962e0d4c0c17b229090214935d2e33f8354) Updates `github/issue-metrics` from 4.2.2 to 4.2.7 - [Release notes](https://github.com/github/issue-metrics/releases) - [Commits](https://github.com/github/issue-metrics/compare/c9e9838147fd355dace335ba787f01b6641a400a...1e38d5e62363e14db8019ed7d106b9855bdba6cc) Updates `j178/prek-action` from 2.0.3 to 2.0.4 - [Release notes](https://github.com/j178/prek-action/releases) - [Commits](https://github.com/j178/prek-action/compare/6ad80277337ad479fe43bd70701c3f7f8aa74db3...bdca6f102f98e2b4c7029491a53dfd366469e33d) Updates `actions/upload-artifact` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v7...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a) Updates `actions/download-artifact` from 7.0.0 to 8.0.1 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v7...3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c) Updates `pypa/gh-action-pypi-publish` from 1.13.0 to 1.14.0 - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.13.0...cef221092ed1bacb1cc03d23a2d87d1d172e277b) Updates `zizmorcore/zizmor-action` from 0.5.3 to 0.5.6 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/b1d7e1fb5de872772f31590499237e7cce841e8e...5f14fd08f7cf1cb1609c1e344975f152c7ee938d) --- updated-dependencies: - dependency-name: prefix-dev/setup-pixi dependency-version: 0.9.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: codecov/codecov-action dependency-version: 6.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: github/issue-metrics dependency-version: 4.2.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: j178/prek-action dependency-version: 2.0.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/download-artifact dependency-version: 8.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: pypa/gh-action-pypi-publish dependency-version: 1.14.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.5.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: add type-safe get_array and get_group methods to AsyncGroup and Group Add `get_array` and `get_group` methods that return the child node at a given path or raise: `ArrayNotFoundError`/`GroupNotFoundError` when no node exists, and `ContainsGroupError`/`ContainsArrayError` when the node is the wrong kind. Paths mirror `getitem` semantics, so nested paths like "subgroup/subarray" work on both the plain and consolidated-metadata lookup routes. Existing tests that fetched a child via `getitem` and then manually narrowed the type with `isinstance` asserts or a walrus expression now use the new methods instead. Assisted-by: ClaudeCode:claude-fable-5 * fix: pass pre-formatted messages to error constructors in get_array/get_group The multi-argument template form of BaseZarrError.__init__ is documented as deprecated; build the message string at the raise site instead, matching every other call site in the codebase. Assisted-by: ClaudeCode:claude-fable-5 * docs: add changelog entry for get_array/get_group Assisted-by: ClaudeCode:claude-fable-5 * docs: demonstrate get_array/get_group in the groups user guide Assisted-by: ClaudeCode:claude-fable-5 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- changes/4128.feature.md | 1 + docs/user-guide/groups.md | 23 ++++ src/zarr/core/group.py | 133 +++++++++++++++++++++++ tests/test_group.py | 81 +++++++++++++- tests/test_metadata/test_consolidated.py | 9 +- tests/test_store/test_zip.py | 5 +- 6 files changed, 239 insertions(+), 13 deletions(-) create mode 100644 changes/4128.feature.md diff --git a/changes/4128.feature.md b/changes/4128.feature.md new file mode 100644 index 0000000000..c62a615ac2 --- /dev/null +++ b/changes/4128.feature.md @@ -0,0 +1 @@ +Added `Group.get_array`, `Group.get_group`, `AsyncGroup.get_array`, and `AsyncGroup.get_group`: type-safe accessors that return the child array or group at a given path, raising `ArrayNotFoundError` / `GroupNotFoundError` if no node exists there, and `ContainsGroupError` / `ContainsArrayError` if the node is not of the requested kind. Unlike `Group.__getitem__`, which returns `Array | Group`, these methods have precise return types. Nested paths like `"subgroup/subarray"` are supported. diff --git a/docs/user-guide/groups.md b/docs/user-guide/groups.md index 337ad39554..7429a03847 100644 --- a/docs/user-guide/groups.md +++ b/docs/user-guide/groups.md @@ -51,6 +51,29 @@ print(root['foo/bar']) print(root['foo/bar/baz']) ``` +Accessing a member with `[]` returns either an [`zarr.Array`][] or a [`zarr.Group`][], depending on +what is stored at the given path. When you expect a node of a particular kind, use +[`zarr.Group.get_array`][] or [`zarr.Group.get_group`][] instead. These methods accept the same +paths as `[]`, but they have precise return types and raise an error if no node exists at the +given path, or if the node is not of the expected kind: + +```python exec="true" session="groups" source="above" result="ansi" +print(root.get_group('foo')) +``` + +```python exec="true" session="groups" source="above" result="ansi" +print(root.get_array('foo/bar/baz')) +``` + +```python exec="true" session="groups" source="above" result="ansi" +from zarr.errors import ContainsGroupError + +try: + root.get_array('foo') +except ContainsGroupError as e: + print(e) +``` + The [`zarr.Group.tree`][] method can be used to print a tree representation of the hierarchy, e.g.: diff --git a/src/zarr/core/group.py b/src/zarr/core/group.py index 0aaf89234e..922eaf1498 100644 --- a/src/zarr/core/group.py +++ b/src/zarr/core/group.py @@ -51,6 +51,7 @@ from zarr.core.metadata.io import save_metadata from zarr.core.sync import SyncMixin, sync from zarr.errors import ( + ArrayNotFoundError, ContainsArrayError, ContainsGroupError, GroupNotFoundError, @@ -820,6 +821,70 @@ async def get[DefaultT]( except KeyError: return default + async def get_array(self, path: str) -> AnyAsyncArray: + """Obtain an array member of this group, raising if it is absent or not an array. + + Parameters + ---------- + path : str + Path of the array relative to this group. May contain `/` to reference + a member of a subgroup, e.g. `subgroup/subarray`. + + Returns + ------- + AsyncArray + The array at the given path. + + Raises + ------ + ArrayNotFoundError + If no node exists at the given path. + ContainsGroupError + If the node at the given path is a group rather than an array. + """ + store_path = self.store_path / path + try: + node = await self.getitem(path) + except KeyError as e: + msg = f"No array found in store {store_path.store!r} at path {store_path.path!r}" + raise ArrayNotFoundError(msg) from e + if isinstance(node, AsyncGroup): + msg = f"A group exists in store {store_path.store!r} at path {store_path.path!r}." + raise ContainsGroupError(msg) + return node + + async def get_group(self, path: str) -> AsyncGroup: + """Obtain a group member of this group, raising if it is absent or not a group. + + Parameters + ---------- + path : str + Path of the group relative to this group. May contain `/` to reference + a member of a subgroup, e.g. `subgroup/subsubgroup`. + + Returns + ------- + AsyncGroup + The group at the given path. + + Raises + ------ + GroupNotFoundError + If no node exists at the given path. + ContainsArrayError + If the node at the given path is an array rather than a group. + """ + store_path = self.store_path / path + try: + node = await self.getitem(path) + except KeyError as e: + msg = f"No group found in store {store_path.store!r} at path {store_path.path!r}" + raise GroupNotFoundError(msg) from e + if isinstance(node, AsyncArray): + msg = f"An array exists in store {store_path.store!r} at path {store_path.path!r}." + raise ContainsArrayError(msg) + return node + async def _save_metadata(self, ensure_parents: bool = False) -> None: await save_metadata(self.store_path, self.metadata, ensure_parents=ensure_parents) @@ -1880,6 +1945,74 @@ def get[DefaultT]( except KeyError: return default + def get_array(self, path: str) -> AnyArray: + """Obtain an array member of this group, raising if it is absent or not an array. + + Parameters + ---------- + path : str + Path of the array relative to this group. May contain `/` to reference + a member of a subgroup, e.g. `subgroup/subarray`. + + Returns + ------- + Array + The array at the given path. + + Raises + ------ + ArrayNotFoundError + If no node exists at the given path. + ContainsGroupError + If the node at the given path is a group rather than an array. + + Examples + -------- + ```python + import zarr + from zarr.core.group import Group + group = Group.from_store(zarr.storage.MemoryStore()) + group.create_array(name="subarray", shape=(10,), chunks=(10,), dtype="float64") + group.get_array("subarray") + # + ``` + """ + return Array(self._sync(self._async_group.get_array(path))) + + def get_group(self, path: str) -> Group: + """Obtain a group member of this group, raising if it is absent or not a group. + + Parameters + ---------- + path : str + Path of the group relative to this group. May contain `/` to reference + a member of a subgroup, e.g. `subgroup/subsubgroup`. + + Returns + ------- + Group + The group at the given path. + + Raises + ------ + GroupNotFoundError + If no node exists at the given path. + ContainsArrayError + If the node at the given path is an array rather than a group. + + Examples + -------- + ```python + import zarr + from zarr.core.group import Group + group = Group.from_store(zarr.storage.MemoryStore()) + group.create_group(name="subgroup") + group.get_group("subgroup") + # + ``` + """ + return Group(self._sync(self._async_group.get_group(path))) + def __delitem__(self, key: str) -> None: """Delete a group member. diff --git a/tests/test_group.py b/tests/test_group.py index 1acd5551ca..29377a5392 100644 --- a/tests/test_group.py +++ b/tests/test_group.py @@ -41,8 +41,10 @@ from zarr.core.metadata.v3 import ArrayV3Metadata from zarr.core.sync import _collect_aiterator, sync from zarr.errors import ( + ArrayNotFoundError, ContainsArrayError, ContainsGroupError, + GroupNotFoundError, MetadataValidationError, ZarrUserWarning, ) @@ -101,7 +103,7 @@ async def test_create_creates_parents(store: Store, zarr_format: ZarrFormat) -> root = await zarr.api.asynchronous.open_group( store=store, ) - agroup = await root.getitem("a") + agroup = await root.get_group("a") assert agroup.attrs == {"key": "value"} # create a child node with a couple intermediates @@ -446,6 +448,77 @@ def test_group_get_with_default(store: Store, zarr_format: ZarrFormat) -> None: assert result.attrs["foo"] == "bar" +def test_group_get_array(store: Store, zarr_format: ZarrFormat) -> None: + """ + `Group.get_array` returns the array at the given path, for both direct child names + and nested paths, and the result is statically typed as an Array. + """ + group = Group.from_store(store, zarr_format=zarr_format) + subgroup = group.create_group(name="subgroup") + subarray = group.create_array(name="subarray", shape=(10,), chunks=(10,), dtype="uint8") + subsubarray = subgroup.create_array(name="subarray", shape=(10,), chunks=(10,), dtype="uint8") + + observed = group.get_array("subarray") + assert isinstance(observed, Array) + assert observed == subarray + assert group.get_array("subgroup/subarray") == subsubarray + + +def test_group_get_array_missing(store: Store, zarr_format: ZarrFormat) -> None: + """ + `Group.get_array` raises `ArrayNotFoundError` when no node exists at the given path. + """ + group = Group.from_store(store, zarr_format=zarr_format) + with pytest.raises(ArrayNotFoundError, match="No array found in store"): + group.get_array("missing") + + +def test_group_get_array_wrong_node_type(store: Store, zarr_format: ZarrFormat) -> None: + """ + `Group.get_array` raises `ContainsGroupError` when the node at the given path is a + group rather than an array. + """ + group = Group.from_store(store, zarr_format=zarr_format) + group.create_group(name="subgroup") + with pytest.raises(ContainsGroupError, match="A group exists in store"): + group.get_array("subgroup") + + +def test_group_get_group(store: Store, zarr_format: ZarrFormat) -> None: + """ + `Group.get_group` returns the group at the given path, for both direct child names + and nested paths, and the result is statically typed as a Group. + """ + group = Group.from_store(store, zarr_format=zarr_format) + subgroup = group.create_group(name="subgroup") + subsubgroup = subgroup.create_group(name="subsubgroup") + + observed = group.get_group("subgroup") + assert isinstance(observed, Group) + assert observed == subgroup + assert group.get_group("subgroup/subsubgroup") == subsubgroup + + +def test_group_get_group_missing(store: Store, zarr_format: ZarrFormat) -> None: + """ + `Group.get_group` raises `GroupNotFoundError` when no node exists at the given path. + """ + group = Group.from_store(store, zarr_format=zarr_format) + with pytest.raises(GroupNotFoundError, match="No group found in store"): + group.get_group("missing") + + +def test_group_get_group_wrong_node_type(store: Store, zarr_format: ZarrFormat) -> None: + """ + `Group.get_group` raises `ContainsArrayError` when the node at the given path is an + array rather than a group. + """ + group = Group.from_store(store, zarr_format=zarr_format) + group.create_array(name="subarray", shape=(10,), chunks=(10,), dtype="uint8") + with pytest.raises(ContainsArrayError, match="An array exists in store"): + group.get_group("subarray") + + @pytest.mark.parametrize("consolidated", [True, False]) def test_group_delitem(store: Store, zarr_format: ZarrFormat, consolidated: bool) -> None: """ @@ -1469,7 +1542,7 @@ async def test_group_getitem_consolidated(self, store: Store) -> None: # On disk, we've consolidated all the metadata in the root zarr.json group = await zarr.api.asynchronous.open(store=store) - rg0 = await group.getitem("g0") + rg0 = await group.get_group("g0") expected = ConsolidatedMetadata( metadata={ @@ -1490,10 +1563,10 @@ async def test_group_getitem_consolidated(self, store: Store) -> None: ) assert rg0.metadata.consolidated_metadata == expected - rg1 = await rg0.getitem("g1") + rg1 = await rg0.get_group("g1") assert rg1.metadata.consolidated_metadata == expected.metadata["g1"].consolidated_metadata - rg2 = await rg1.getitem("g2") + rg2 = await rg1.get_group("g2") assert rg2.metadata.consolidated_metadata == ConsolidatedMetadata(metadata={}) async def test_group_delitem_consolidated(self, store: Store) -> None: diff --git a/tests/test_metadata/test_consolidated.py b/tests/test_metadata/test_consolidated.py index 3596d2bcaa..e6087435fe 100644 --- a/tests/test_metadata/test_consolidated.py +++ b/tests/test_metadata/test_consolidated.py @@ -111,12 +111,10 @@ async def test_getitem_consolidated_empty_leaf_group( group = await zarr.api.asynchronous.open_consolidated( store=memory_store, zarr_format=zarr_format ) - raw = await group.getitem("raw") - assert isinstance(raw, zarr.AsyncGroup) + raw = await group.get_group("raw") assert raw.metadata.consolidated_metadata is not None - varm = await raw.getitem("varm") - assert isinstance(varm, zarr.AsyncGroup) + varm = await raw.get_group("varm") assert varm.metadata.consolidated_metadata == ConsolidatedMetadata(metadata={}) async def test_open_consolidated_false_raises(self) -> None: @@ -770,8 +768,7 @@ async def test_absolute_path_for_subgroup(self, memory_store: zarr.storage.Memor await zarr.api.asynchronous.consolidate_metadata(memory_store) group = await zarr.api.asynchronous.open_group(store=memory_store) - subgroup = await group.getitem("/a") - assert isinstance(subgroup, AsyncGroup) + subgroup = await group.get_group("/a") members = [x async for x in subgroup.keys()] # noqa: SIM118 assert members == ["b"] diff --git a/tests/test_store/test_zip.py b/tests/test_store/test_zip.py index 0d8dadd18a..32b18c5273 100644 --- a/tests/test_store/test_zip.py +++ b/tests/test_store/test_zip.py @@ -22,7 +22,6 @@ import zarr from zarr import create_array from zarr.core.buffer import Buffer, cpu, default_buffer_prototype -from zarr.core.group import Group from zarr.core.sync import sync from zarr.storage import ZipStore from zarr.testing.store import StoreTests @@ -141,13 +140,13 @@ def test_externally_zipped_store(self, tmp_path: Path) -> None: zarr_path = tmp_path / "foo.zarr" root = zarr.open_group(store=zarr_path, mode="w") root.require_group("foo") - assert isinstance(foo := root["foo"], Group) # noqa: RUF018 + foo = root.get_group("foo") foo["bar"] = np.array([1]) shutil.make_archive(str(zarr_path), "zip", zarr_path) zip_path = tmp_path / "foo.zarr.zip" zipped = zarr.open_group(ZipStore(zip_path, mode="r"), mode="r") assert list(zipped.keys()) == list(root.keys()) - assert isinstance(group := zipped["foo"], Group) + group = zipped.get_group("foo") assert list(group.keys()) == list(group.keys()) async def test_list_without_explicit_open(self, tmp_path: Path) -> None: From 015732f58cc67888f7f638e09ca447c9349c85eb Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Tue, 28 Jul 2026 22:06:03 +0200 Subject: [PATCH 08/61] feat(zarr-metadata): Zarr metadata model layer (#4119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): bump the actions group across 1 directory with 8 updates (#176) Bumps the actions group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi) | `0.9.5` | `0.9.6` | | [codecov/codecov-action](https://github.com/codecov/codecov-action) | `6.0.0` | `6.0.1` | | [github/issue-metrics](https://github.com/github/issue-metrics) | `4.2.2` | `4.2.7` | | [j178/prek-action](https://github.com/j178/prek-action) | `2.0.3` | `2.0.4` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.0` | `7.0.1` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `7.0.0` | `8.0.1` | | [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) | `1.13.0` | `1.14.0` | | [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.5.3` | `0.5.6` | Updates `prefix-dev/setup-pixi` from 0.9.5 to 0.9.6 - [Release notes](https://github.com/prefix-dev/setup-pixi/releases) - [Commits](https://github.com/prefix-dev/setup-pixi/compare/1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0...5185adfbffb4bd703da3010310260805d89ebb11) Updates `codecov/codecov-action` from 6.0.0 to 6.0.1 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/57e3a136b779b570ffcdbf80b3bdc90e7fab3de2...e79a6962e0d4c0c17b229090214935d2e33f8354) Updates `github/issue-metrics` from 4.2.2 to 4.2.7 - [Release notes](https://github.com/github/issue-metrics/releases) - [Commits](https://github.com/github/issue-metrics/compare/c9e9838147fd355dace335ba787f01b6641a400a...1e38d5e62363e14db8019ed7d106b9855bdba6cc) Updates `j178/prek-action` from 2.0.3 to 2.0.4 - [Release notes](https://github.com/j178/prek-action/releases) - [Commits](https://github.com/j178/prek-action/compare/6ad80277337ad479fe43bd70701c3f7f8aa74db3...bdca6f102f98e2b4c7029491a53dfd366469e33d) Updates `actions/upload-artifact` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v7...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a) Updates `actions/download-artifact` from 7.0.0 to 8.0.1 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v7...3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c) Updates `pypa/gh-action-pypi-publish` from 1.13.0 to 1.14.0 - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.13.0...cef221092ed1bacb1cc03d23a2d87d1d172e277b) Updates `zizmorcore/zizmor-action` from 0.5.3 to 0.5.6 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/b1d7e1fb5de872772f31590499237e7cce841e8e...5f14fd08f7cf1cb1609c1e344975f152c7ee938d) --- updated-dependencies: - dependency-name: prefix-dev/setup-pixi dependency-version: 0.9.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: codecov/codecov-action dependency-version: 6.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: github/issue-metrics dependency-version: 4.2.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: j178/prek-action dependency-version: 2.0.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/download-artifact dependency-version: 8.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: pypa/gh-action-pypi-publish dependency-version: 1.14.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.5.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat(zarr-metadata): add model._validation — structural validators Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-metadata): add model._array — array metadata models Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-metadata): port array model test suite Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-metadata): add group metadata models Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-metadata): add consolidated metadata model tests Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-metadata): export model layer from package front door Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-metadata): changelog entry for the model layer Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-metadata): harden model validation and error reporting Findings from an API-ergonomics exercise (a fresh agent consuming defective metadata documents): - ValidationProblem gains a machine-readable kind (missing_key / invalid_type / invalid_value / invalid_json), ending message string-matching in consumers. - The v2 array validator now enforces what its types declare (dtype, order, compressor, filters, dimension_separator), and all four document validators check the fixed zarr_format / node_type literals. - All ingestion failures surface as MetadataValidationError: missing store keys and undecodable bytes in from_key_value (previously KeyError / JSONDecodeError) and constructor invariants (previously bare ValueError). - ZarrMetadataV3 is renamed NamedConfigModelV3: it models a name + configuration pair, and the old name read as a whole-document type. - Discoverability: the validate_*/is_*/parse_* contract is documented on zarr_metadata.model itself; update() documents that it does not re-validate; the v2 to_json/to_key_value attributes split is documented on both. Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-metadata): annotate metadata fields with role alias MetadataFieldModelV3 Model fields and consumer signatures should convey the logical meaning of the type (a metadata-document field), not the form it takes when JSON-serialized (a named configuration). MetadataFieldModelV3 is today exactly NamedConfigModelV3; if a future spec revision adds a field form that cannot normalize to name + configuration, the alias widens to a union and annotation sites do not move. Mirrors the raw-layer split between NamedConfigV3 (shape) and MetadataV3 (field union). Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-metadata): assert required-key coverage via the typed constant test_v3_to_json_includes_required_fields hand-enumerated keys with chained asserts, restating what ARRAY_METADATA_REQUIRED_KEYS_V3 already defines. Now: one coverage assert driven by the constant (tracks the TypedDict automatically) and one whole-document equality for the values. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-metadata): single whole-document comparison for v3 to_json The subset assert against ARRAY_METADATA_REQUIRED_KEYS_V3 was redundant: equality with a literal that spells out the full document already covers every required key. One dict, one assert. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-metadata): close validation holes found by adversarial review Invalid documents that previously passed validation: - shape/chunks containing JSON booleans (bool is an int subclass in Python but not an integer in a metadata document) or negative values - dimension_names whose length does not match shape - attributes and configuration values that are not JSON-serializable — now checked recursively like fill_value, so an int-keyed dict cannot be silently rewritten by json.dumps on round-trip and a set() cannot escape as a TypeError from to_key_value - consolidated_metadata envelopes: the group validator now deep-validates the envelope and its entries via the shared validate_consolidated_metadata_v3, which ConsolidatedMetadataModelV3 .from_json also uses, so is_group_metadata_v3 never vouches for a document the model constructor would reject Three pre-existing test fixtures paired dimension_names=('x',) with the default scalar shape () and were themselves spec-invalid; they now use a matching 1-d shape. Deliberately unchanged, pending a design decision: unknown extension fields with must_understand: true still pass (which layer owns the spec's refusal duty), and empty v2 dtype records / empty codec names still pass (domain territory). Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-metadata): expose must_understand_fields on the v3 models The v3 core spec: 'An implementation MUST fail to open Zarr groups or arrays if any metadata fields are present which (a) the implementation does not recognize and (b) are not explicitly set to "must_understand": false' — and fields are implicitly must-understand unless waived. The model layer cannot discharge this itself: recognition is reader-specific (consolidated_metadata is itself an extension field one reader understands and another does not), and a document carrying a must-understand extension is still a valid document. So the models partition by obligation: must_understand_fields is the subset of extra_fields not explicitly waived, and a compliant reader fails to open when must_understand_fields.keys() - recognized is non-empty. The design spec pins that duty on the part-2 resolve layer, matching what zarr-python's parse_extra_fields enforces today. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-metadata): executable example of pydantic integration Delegate wholesale rather than letting pydantic introspect the dataclass: InstanceOf (is-instance core schema) + BeforeValidator(from_json) + PlainSerializer(to_json, return_type=dict). Field-by-field validation is impossible anyway (the models' annotation-only imports live behind TYPE_CHECKING, so pydantic raises class-not-fully-defined) and would diverge from the library's structural validation via coercion if it weren't. MetadataValidationError subclasses ValueError, so failed parses surface as pydantic ValidationError with the loc-annotated messages. pydantic is already in the package's test dependency group. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-metadata): document pydantic's native dataclass path and why not Correcting the previous commit's too-strong claim: pydantic CAN introspect the model dataclass — TypeAdapter(...).rebuild() with the TYPE_CHECKING-only names supplied as _types_namespace resolves the schema, and __post_init__ invariants still run. A new test exercises that path and pins why it is not the recommended integration: it validates the model shape, not the document (bare-string data_type rejected — no from_json normalization), and pydantic's lax coercion silently re-opens holes the library validators close (shape=[True, -5] coerces to (1, -5); a wrong dimension_names count passes). Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-metadata): engine-backed pydantic BaseModel example (pydantic-zarr pattern) For consumers that want a first-class BaseModel — JSON schema generation and generics for typed attributes, as in pydantic-zarr's ArraySpec — the example adds a third pattern: pydantic-native fields as the user-facing surface, with the library as the engine. A mode='before' validator canonicalizes every input via from_json(...).to_json(), so structural validation and normalization run before pydantic parses fields (the [True, -5] coercion divergence cannot occur), and to_metadata_model / to_document bridge both ways through the document form. One translation noted at the bridge: the document spells 'no dimension names' as key absence, the pydantic side as None. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-metadata): pin that a null dimension_names field is invalid Spec: 'If specified, must be an array of strings or null objects... If dimension_names is not specified, all dimensions are unnamed.' The null object is a permitted element (an unnamed dimension), never the field value; key absence is the only spelling of 'not specified'. Pins the validator's existing rejection so it is not later 'fixed' to accept null-as-absence, and documents that in-memory None maps to key absence on serialization. Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-metadata): optional pydantic integration as zarr_metadata.pydantic Gamed out three shapes with prototypes before choosing: - dunders on the core classes (works, verified pydantic 2.0-2.13, but puts a framework protocol in the dependency-free layer); - pydantic-aware SUBCLASSES in a namespace (rejected on empirical failures: identity split breaks equality, core instances are rejected by subclass-typed fields, and nested construction produces core-class children unless every cross-reference is overridden); - Annotated field types over the CORE classes in an opt-in module (chosen): instances are the core classes so interop is free, pydantic imports eagerly at the module (loud failure when absent), core stays framework-free, and pydantic-protocol risk is quarantined to one clearly-labeled module. The module exports one field type per model. Validation delegates to from_json (structural validation and normalization cannot be bypassed by pydantic coercion), instances pass through, serialization emits the canonical document, and WithJsonSchema describes the accepted document form so model_json_schema works. Tests cover all seven field types, core-instance interop, error quality, JSON schema, roundtrip, and that importing zarr_metadata does not import pydantic. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-metadata): create_default derives the chunk grid from shape create_default(shape=(100, 100)) silently kept the scalar default's 0-d chunk grid (chunk_shape: ()), producing a structurally-valid but semantically inconsistent document — a footgun for every test fixture built on it. When shape is overridden and the grid is not, the default is now one regular chunk covering the array (v3 chunk_shape == shape, v2 chunks == shape); an explicit chunk_grid/chunks override still wins. update() stays a dumb dataclasses.replace, per its documented contract. One existing whole-document test literal carried exactly this inconsistency (shape (10,) with chunk_shape ()) and was updated. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-metadata): pin zero-length-dimension case of the derived chunk grid The spec's constraint is conditional ('non-zero when the corresponding dimensions of the arrays have non-zero length'), so chunk_shape == shape is sound for every shape, including empty dimensions. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-metadata): document that create_default's derivation is one-way Overriding shape without a grid derives the grid; the reverse does not hold. A user-supplied chunk_grid is an extension point taken verbatim — deriving shape from it would require interpreting grid configurations, which the model layer never does and cannot do for unrecognized grid names. Pinned by test so the asymmetry reads as a decision, not an oversight; the v2 model documents the same one-way rule for chunks for cross-version consistency. Assisted-by: ClaudeCode:claude-fable-5 * refactor(zarr-metadata): eliminate every type-ignore comment Audited all 24 (15 src, 9 tests); each was either obsolete, replaceable by a sound cast, or avoidable by better-typed code: - Two fill_value arg-type ignores were factually obsolete: their justifying comment said 'fill_value: object in upstream TypedDict', but 0.3.0 narrowed it to JSONValue. - Eight pre-existing call-arg/reportInvalidTypeForm ignores on the PEP 728 TypedDicts and the recursive JSONValue alias were mypy-dialect suppressions that the checker of record (pyright strict with enableExperimentalFeatures) never needed; mypy has never checked this package. - The two extra_fields comprehensions are a genuine checker limitation (a key filter cannot narrow a PEP 728 TypedDict's item-value union), now expressed as casts whose comments state the soundness claim instead of suppressing the diagnostic. - pydantic.py's generic coercer factory takes the parse callable explicitly instead of calling from_json through type[_M]. - NamedConfigModelV3.from_json casts the validated configuration (sound since configuration values are now deep-validated as JSON). - Tests: _build_v2/_build_v3 gained real Unpack[...Partial] signatures; raw-document pydantic inputs go through model_validate (the idiomatic entry point for untyped data) instead of ignoring constructor signatures; the frozen-dataclass test uses setattr for its intentional runtime error. src and tests/model now carry zero type-ignore comments. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-metadata): absent v2 dimension_separator means '.', not '/' roborev job 426 (branch review) found that ArrayMetadataModelV2 normalized an ABSENT dimension_separator key to '/', inherited verbatim from the zng prototype. The v2 convention's default is '.': a consumer deriving chunk keys from the model against a real-world v2 array written with the default separator would have looked for '0/0' instead of '0.0'. No test caught it because every fixture started from create_default(), which always carries an explicit separator. Absence is normalized to an explicit '.' -- a semantics-preserving spelling normalization consistent with the model's existing canonical forms (bare-string metadata fields, missing configuration). The field is deliberately NOT modeled as Optional: the document grammar has no null spelling for this key, and a None in the model invites writing 'dimension_separator': null into documents. Pinned by three tests, including explicit-null rejection. Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-metadata): UNSET sentinel for absent optional document keys Establishes the models' None/absence invariant: None in a model always corresponds to a JSON null in the document (a v2 compressor/filters value, an unnamed dimension inside dimension_names), and UNSET always means the key is absent. The two are never interchangeable. Applied to the two fields that used None as an absence marker: dimension_names (ArrayMetadataModelV3) and consolidated_metadata (GroupMetadataModelV3). For dimension_names this also preserves a semantic distinction d-v-b identified: an absent field ("there are no dimension names") and an explicit all-null array ("every dimension has a name, which is null") are different documents; both spellings now round-trip faithfully and compare unequal. Normalizing absence to the all-null form was considered and rejected: the spellings' interpretations coincide but interpretation-equivalence is the resolve layer's business, and collapsing document-level distinctions on that basis is the layer violation this package exists to avoid. Verified that current zarr-python never writes "consolidated_metadata": null (GroupMetadata.to_dict pops the key), so None there was purely an absence marker, not a document spelling. UnsetType is a single-member enum (identity-checkable, repr "UNSET", deliberately truthy so `if not x` cannot silently treat it as absent); UNSET and UnsetType are exported from zarr_metadata.model and the package front door. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-metadata): accept and preserve the wild consolidated_metadata null Historical zarr-python versions wrote "consolidated_metadata": null into group documents for groups without consolidated metadata, so real stores contain the spelling; the validator was rejecting those documents ("expected a mapping"). Per the None/UNSET invariant, the field is now honestly three-state: UNSET (key absent), None (the document's literal null, preserved on round-trip), or a ConsolidatedMetadataModelV3. Interpreting null as absence is the consumer's call, not a document rewrite by this layer. Also records an implementation constraint on the sentinel itself: typing_extensions.Sentinel (PEP 661) is the intended spelling, but pyright 1.1.411 degrades a Sentinel to Unknown in dataclass FIELD annotations (function signatures work), verified by probe both with and without enableExperimentalFeatures. Using it would reintroduce suppressions at every use site under the strict gate, so UNSET stays a single-member enum, with the Sentinel switch documented in _sentinel.py for when pyright catches up. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-metadata): repair consolidated_metadata null to absence, not preserve it d-v-b: the bugged spelling should not be preserved or honored. The three-state field reverts to two states (model | UNSET): a document carrying "consolidated_metadata": null — written by a historical zarr-python bug — remains readable (the validator accepts it so real stores open), but the spelling gets no model representation: it is read as absence and never written back. This is the one deliberate exception to faithful round-tripping, pinned as such: from_json(null_doc) equals from_json(absent_doc), and to_json omits the key. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-metadata): pin the Sentinel blocker to pyright regression #11115 Investigated: the Unknown-degradation of typing_extensions.Sentinel is a confirmed upstream pyright regression, not by-design. Introduced in 1.1.405 (verified: 1.1.404 is clean on the same probe, 1.1.411 fails), affects reads of any class-body attribute annotation (dataclass or plain class), does not affect function signatures or module variables, and Final on the sentinel does not help. Tracked as microsoft/pyright#11115 (open, bug+regression); #11467 closed as its duplicate. The enum sentinel stays until the fix lands. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-metadata): sentinel switch is blocked by mypy too, not just pyright Pinning a working pyright (<= 1.1.404) in CI was considered and does not suffice: the pin controls one of four checker surfaces. Contributor IDEs (Pylance bundles current pyright) and downstream consumers' pyright read the py.typed inline annotations with their own versions, and decisively, mypy 2.1.0 has no PEP 661 support at all — a sentinel in type position is a hard [valid-type] error, which would degrade these fields to Any for mypy consumers, including zarr-python itself. The enum is currently the only spelling with exact types on every surface; switch when pyright#11115 is fixed AND mypy implements PEP 661. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-metadata): PEP 661 is Final (Python 3.15), not a draft Corrects the sentinel implementation note: PEP 661 was accepted 2026-04-23 and ships as stdlib sentinel in Python 3.15. The two checker gaps blocking the Sentinel spelling (pyright regression #11115, mypy not yet implementing the PEP) are therefore temporary gaps against a Final standard, and the enum is a stopgap with a defined end state. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-metadata): ty fully supports typed sentinels; pyright/mypy are the laggards ty 0.0.56 types the Sentinel spelling perfectly in dataclass fields: exact T | UNSET unions, both-direction is/is-not narrowing, and wrong-typed constructor arguments rejected (verified with reveal_type, so it is real inference, not silent Any). The checker matrix for sentinel-in-type-position is therefore ty full / pyright regressed (#11115) / mypy not implemented — recorded so the switch decision has current calibration. Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-metadata): adopt the PEP 661 sentinel for UNSET d-v-b's call: PEP 661 is Final, ty already types the sentinel spelling exactly, mypy support is in review (python/mypy#21647) and treated as imminent, and pyright has a known-good version — so use the standard sentinel today rather than carrying the enum stopgap. - UNSET is now typing_extensions.Sentinel("UNSET"), used directly in type expressions (tuple[str | None, ...] | UNSET); the UnsetType companion enum is gone from the API. - typing_extensions floor bumped to 4.14 (where Sentinel arrived). - CI pins pyright==1.1.404, the last version before the class-attribute sentinel regression (microsoft/pyright#11115); pyproject documents the same pin for local runs. 0 errors on the pin; ty checks the sentinel fields clean (its 2 remaining diagnostics are its incomplete PEP 728 extra_items write support, unrelated). - Known short-term cost, accepted deliberately: mypy-checked consumers need cast/type-ignore at narrowing sites until mypy#21647 merges, and contributors' Pylance may show phantom Unknowns until the pyright fix ships. Recorded in _sentinel.py and the changelog. - The pydantic native-introspection test reverts to documenting that introspection is unsupported (pydantic 2.13 cannot schema a Sentinel); the delegation patterns are unaffected. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-metadata): .zattrs presence is part of the store, not an artifact Resolves the last flagged round-trip question from the initial port: to_key_value on the v2 models always emitted a .zattrs key, so a store that never had one gained a file on round-trip. Per d-v-b's ruling, attributes on ArrayMetadataModelV2/GroupMetadataModelV2 is now `dict[str, JSONValue] | UNSET`: UNSET means no .zattrs file (and no attributes key in the merged document form) and emits nothing, while any dict — including an explicit empty {} — means the file exists and is emitted. The two spellings stay distinct through round-trips, per the None/UNSET invariant; create_default defaults to UNSET (a fresh minimal node has no .zattrs). Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-metadata): require typing_extensions>=4.16 so UNSET pickles by reference Models hold the UNSET sentinel as field values (dimension_names, attributes), so any object graph containing a model must survive pickling and deep-copying. A sentinel's contract is identity — state-based pickling would produce impostor objects that fail every `is UNSET` check — which is why typing_extensions <= 4.15 refused to pickle sentinels at all. typing_extensions 4.16 implements Sentinel.__reduce__ as pickling by reference (a lookup of the sentinel's name on its defining module), the same mechanism enum members use, so the singleton identity survives the round trip. Bump the floor and pin the behavior with tests: identity across pickle/copy/deepcopy, models holding UNSET round-tripping, and a guard that a non-importable sentinel still fails loudly rather than pickling by state. Co-Authored-By: Claude Fable 5 * refactor(zarr-metadata): format-version-first naming; dataclasses primary, JSON suffix for documents Applies the naming decisions from the PR discussion: ZarrV2/ZarrV3 moves to the front of every type name so a format version cannot be misread as a class revision, and the model dataclasses take the bare entity names (ZarrV3ArrayMetadata, ZarrV3GroupMetadata, ZarrV3ConsolidatedMetadata, ZarrV3NamedConfig, role alias ZarrV3MetadataField) while the TypedDict document forms carry a JSON suffix (ZarrV3ArrayMetadataJSON, ..., ZarrV3MetadataFieldJSON, ZarrV3NamedConfigJSON). The zarr_metadata.pydantic field types take the bare entity names, matching the model classes they validate into; the module now references the model module qualified to keep those names free. Raw-layer names released in 0.3.0 are renamed without aliases (pre-1.0), documented in changes/4119.removal.md. Validation problem messages name documents in plain English instead of type names. snake_case function names (validate_array_metadata_v3, ...) and SCREAMING_SNAKE constants are deliberately untouched: the revision ambiguity the rename fixes does not arise for them, and renaming them is a separate decision. Co-Authored-By: Claude Fable 5 * fix(zarr-metadata): harden model validation Assisted-by: Codex:gpt-5 * docs(zarr-metadata): define v3 conformance boundary Assisted-by: Codex:gpt-5 * fix(zarr-metadata): preserve v3 extension obligations Assisted-by: Codex:gpt-5 * fix(zarr-metadata): enforce v3 core extension rules Assisted-by: Codex:gpt-5 * fix(zarr-metadata): align v3 additional field types Assisted-by: Codex:gpt-5 * chore(zarr-metadata): finalize v3 model conformance Assisted-by: Codex:gpt-5 * docs: remove llm docs * chore(zarr-metadata): correct changelog PR number Assisted-by: Codex:gpt-5 * fix(metadata): enforce canonical document boundaries Assisted-by: Codex:GPT-5 * docs(metadata): record review fix design Assisted-by: Codex:gpt-5 * fix(metadata): align validation and schemas Assisted-by: Codex:gpt-5 * fix(metadata): tighten validation boundaries Assisted-by: Codex:gpt-5 * fix(metadata): repair package CI Assisted-by: Codex:gpt-5 * chore: remove stray design notes from docs Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-metadata): deep-copy mutable state in to_json output to_json previously returned documents holding direct references to the model's internal dicts (attributes, named-config configurations, extra fields, v2 compressor/filters, consolidated entries), so mutating a serialized document silently mutated the frozen model. Every value that can hold a mutable container is now deep-copied on the way out, with parametrized tests proving mutation independence for all seven models. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-metadata): describe the widened package scope The README tagline, intro, and scope section (and the PyPI description) still presented the package as type definitions only. Restructure them around the two layers plus optional integration, extend the contribution scope to models and structural validation, and state the runtime-behavior boundary explicitly. Assisted-by: ClaudeCode:claude-fable-5 * style(zarr-metadata): move None to the end of the JSONValue union The unpinned ruff in CI now enforces RUF036. Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-metadata): export store-key aliases and type to_key_value with them The six store-key Literal aliases were private and unused: only reachable via underscore modules, and absent from every signature. Export them from zarr_metadata.model beside their constants (matching the package's name/constant pairing everywhere else), and key each to_key_value return mapping by them so the store keys a model can emit are visible in its signature. from_key_value keeps Mapping[str, bytes] input on purpose — it accepts whole store mappings. A pair test guards export and value drift, and the removal note now states the version-placement and JSON-suffix conventions explicitly. Assisted-by: ClaudeCode:claude-fable-5 * refactor(zarr-metadata): make every public type name parse against a naming grammar Three grammars now cover the public surface, enforced by a conformance test that walks every public module's __all__: - core document/model names: ZarrV{2,3} + entity + optional role suffix (JSON / JSONPartial / Partial / StoreKey) - extension-entity names: registered entity + exactly one role suffix (CodecMetadata, DataTypeName, FillValue, ...) - a closed standalone-vocabulary allowlist for role-less scalar and diagnostic types, with a staleness guard The three .z-file document types were the only names that fit no grammar and are renamed: ZArrayMetadata -> ZarrV2ZArrayJSON, ZGroupMetadata -> ZarrV2ZGroupJSON, ZAttrsMetadata -> ZarrV2ZAttrsJSON. The leading V2 of V2ChunkKeyEncodingMetadata is that encoding's registered entity name, not a format version; its module docstring now says so. Assisted-by: ClaudeCode:claude-fable-5 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude Fable 5 --- .github/workflows/zarr-metadata.yml | 5 +- packages/zarr-metadata/README.md | 81 +- .../zarr-metadata/changes/4119.feature.md | 92 + .../zarr-metadata/changes/4119.removal.md | 41 + packages/zarr-metadata/pyproject.toml | 19 +- .../src/zarr_metadata/__init__.py | 114 +- .../src/zarr_metadata/_common.py | 16 +- .../src/zarr_metadata/_pydantic_schema.py | 114 ++ .../src/zarr_metadata/model/__init__.py | 132 ++ .../src/zarr_metadata/model/_array.py | 498 +++++ .../src/zarr_metadata/model/_group.py | 442 +++++ .../src/zarr_metadata/model/_sentinel.py | 37 + .../src/zarr_metadata/model/_validation.py | 875 +++++++++ .../src/zarr_metadata/pydantic.py | 176 ++ .../src/zarr_metadata/v2/__init__.py | 38 +- .../src/zarr_metadata/v2/array.py | 83 +- .../src/zarr_metadata/v2/attributes.py | 6 +- .../src/zarr_metadata/v2/codec.py | 4 +- .../src/zarr_metadata/v2/consolidated.py | 18 +- .../src/zarr_metadata/v2/group.py | 26 +- .../src/zarr_metadata/v3/__init__.py | 18 +- .../src/zarr_metadata/v3/_common.py | 10 +- .../src/zarr_metadata/v3/array.py | 80 +- .../zarr_metadata/v3/chunk_key_encoding/v2.py | 6 + .../src/zarr_metadata/v3/codec/__init__.py | 2 +- .../src/zarr_metadata/v3/codec/cast_value.py | 4 +- .../src/zarr_metadata/v3/codec/crc32c.py | 2 +- .../v3/codec/sharding_indexed.py | 6 +- .../src/zarr_metadata/v3/consolidated.py | 28 +- .../src/zarr_metadata/v3/data_type/struct.py | 4 +- .../src/zarr_metadata/v3/group.py | 20 +- .../zarr-metadata/tests/model/__init__.py | 0 packages/zarr-metadata/tests/model/_cases.py | 65 + .../zarr-metadata/tests/model/test_array.py | 1738 +++++++++++++++++ .../zarr-metadata/tests/model/test_group.py | 572 ++++++ .../tests/model/test_pydantic.py | 302 +++ .../tests/model/test_pydantic_module.py | 264 +++ .../tests/model/test_sentinel.py | 89 + .../tests/test_partial_equivalence.py | 16 +- .../zarr-metadata/tests/test_public_api.py | 164 +- .../tests/v2/array/test_fixtures.py | 6 +- .../tests/v2/consolidated/test_fixtures.py | 4 +- .../tests/v2/group/test_fixtures.py | 6 +- .../tests/v3/array/test_fixtures.py | 6 +- .../tests/v3/array/with_extra_field.json | 2 +- .../tests/v3/consolidated/test_fixtures.py | 4 +- .../tests/v3/group/test_fixtures.py | 4 +- 47 files changed, 5940 insertions(+), 299 deletions(-) create mode 100644 packages/zarr-metadata/changes/4119.feature.md create mode 100644 packages/zarr-metadata/changes/4119.removal.md create mode 100644 packages/zarr-metadata/src/zarr_metadata/_pydantic_schema.py create mode 100644 packages/zarr-metadata/src/zarr_metadata/model/__init__.py create mode 100644 packages/zarr-metadata/src/zarr_metadata/model/_array.py create mode 100644 packages/zarr-metadata/src/zarr_metadata/model/_group.py create mode 100644 packages/zarr-metadata/src/zarr_metadata/model/_sentinel.py create mode 100644 packages/zarr-metadata/src/zarr_metadata/model/_validation.py create mode 100644 packages/zarr-metadata/src/zarr_metadata/pydantic.py create mode 100644 packages/zarr-metadata/tests/model/__init__.py create mode 100644 packages/zarr-metadata/tests/model/_cases.py create mode 100644 packages/zarr-metadata/tests/model/test_array.py create mode 100644 packages/zarr-metadata/tests/model/test_group.py create mode 100644 packages/zarr-metadata/tests/model/test_pydantic.py create mode 100644 packages/zarr-metadata/tests/model/test_pydantic_module.py create mode 100644 packages/zarr-metadata/tests/model/test_sentinel.py diff --git a/.github/workflows/zarr-metadata.yml b/.github/workflows/zarr-metadata.yml index 4e5bb0fb1a..df7d96cc1c 100644 --- a/.github/workflows/zarr-metadata.yml +++ b/.github/workflows/zarr-metadata.yml @@ -82,7 +82,10 @@ jobs: - name: Sync test dependency group run: uv sync --group test --python 3.11 - name: Run pyright - run: uv run --group test --with pyright pyright src + # Pinned to the last version that types PEP 661 sentinels in class + # attributes correctly; 1.1.405+ regressed (microsoft/pyright#11115). + # Unpin when the fix lands. + run: uv run --group test --with 'pyright==1.1.404' pyright src zarr-metadata-complete: name: zarr-metadata complete diff --git a/packages/zarr-metadata/README.md b/packages/zarr-metadata/README.md index a842e07886..69b80d7332 100644 --- a/packages/zarr-metadata/README.md +++ b/packages/zarr-metadata/README.md @@ -1,51 +1,86 @@ # zarr-metadata -Python type definitions for Zarr v2 and v3 metadata. +Python types, models, and validators for Zarr v2 and v3 metadata. ## What this is -A typed-data package: `TypedDict` definitions and `Literal` aliases for the -JSON shapes specified by the [Zarr v2](https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html) -and [Zarr v3](https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html) -specifications, plus types for [`zarr-extensions`](https://github.com/zarr-developers/zarr-extensions/) -and a few widely-used-but-unspecified entities (e.g. consolidated metadata). +Two layers and an optional integration: + +- **Typed JSON shapes**: `TypedDict` definitions and `Literal` aliases for the + JSON documents specified by the [Zarr v2](https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html) + and [Zarr v3](https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html) + specifications, plus types for [`zarr-extensions`](https://github.com/zarr-developers/zarr-extensions/) + and a few widely-used-but-unspecified entities (e.g. consolidated metadata). +- **Document models** (`zarr_metadata.model`): canonical frozen-dataclass + models of whole metadata documents, with structural validators, loc-aware + parsers, and store-key (de)serialization. A document produced by `to_json` + shares no mutable state with the model that produced it. +- **Optional Pydantic integration** (`zarr_metadata.pydantic`, requires + Pydantic 2.13 or newer): each model as a Pydantic field type that validates + raw documents through the same strict parser. ## What this is for -These types describe the JSON shape of Zarr metadata. They are -intended for libraries that **read, write, validate, or transform** -Zarr metadata. Pair them with a runtime validator like -[pydantic](https://docs.pydantic.dev/) to check JSON loaded from disk: +The public `TypedDict` definitions describe the static JSON shape of Zarr +metadata. For strict, loc-aware validation of JSON loaded from disk, use the +model parser: ```python import json -from pydantic import TypeAdapter -from zarr_metadata.v3.array import ArrayMetadataV3 +from zarr_metadata.model import ZarrV3ArrayMetadata with open("zarr.json", "rb") as f: raw = json.load(f) -metadata = TypeAdapter(ArrayMetadataV3).validate_python(raw) +metadata = ZarrV3ArrayMetadata.from_json(raw) +``` + +The optional Pydantic integration delegates raw input to the same strict +parser and returns the same normalized model class: + +```python +from pydantic import TypeAdapter +import zarr_metadata.pydantic as zmp + +metadata = TypeAdapter(zmp.ZarrV3ArrayMetadata).validate_python(raw) +encoded = metadata.to_key_value()["zarr.json"] ``` -## What this is *not* +A bare `TypeAdapter` over a public document `TypedDict` is a coercive shape +adapter, not a Zarr conformance validator; it may coerce values or discard +members that the strict model parser rejects. + +## Validation boundary -- Not a parser or builder. There are no `make_array_metadata(...)` factories — - that surface belongs to consumer libraries. -- Not a runtime validator on its own. Pair with `pydantic`, `msgspec`, or - similar to enforce shapes at decode time. +The model validators enforce the declared document structure and a small set +of context-free consistency rules, including fixed format literals, finite +JSON numbers, non-negative dimensions, non-empty v3 codec pipelines, and one +`dimension_names` entry per array dimension. They do not interpret extension +names or configurations, resolve codec pipelines, or decide whether a data +type, chunk grid, codec, or storage transformer is supported. Those decisions +belong to consumer implementations. -Even with a runtime validator, these types only describe **structural** -shape — they will not flag *semantically* invalid metadata, like a 3D v3 -array whose `dimension_names` has 4 entries instead of 3. That's a job -for downstream validator routines. +The Pydantic integration's generated JSON Schemas express independently +checkable document structure and field constraints, but they are not a +replacement for runtime model validation. Standard JSON Schema treats a +mathematically integral number such as `1.0` as an integer, while the runtime +boundary requires Python `int` values, and it cannot express arbitrary +same-length relations such as `dimension_names` versus `shape` or v2 `chunks` +versus `shape`. Consumers should run the model parser after schema validation. ## Scope At minimum, this library supports what Zarr-Python needs: the complete Zarr v2 and v3 specs, consolidated metadata, and a subset of the metadata defined in `zarr-extensions`. We are generally open to contributions that -add types for Zarr metadata with a published spec. +add types, models, or structural validation for Zarr metadata with a +published spec. + +Runtime array behavior is out of scope: nothing here encodes or decodes +chunks, resolves codec or data type names to implementations, or performs +store I/O. The models begin and end at the metadata documents themselves — +`from_key_value` / `to_key_value` map documents to store keys and bytes, +and everything past that belongs to consumer libraries. ## Releasing diff --git a/packages/zarr-metadata/changes/4119.feature.md b/packages/zarr-metadata/changes/4119.feature.md new file mode 100644 index 0000000000..b9d0bb508c --- /dev/null +++ b/packages/zarr-metadata/changes/4119.feature.md @@ -0,0 +1,92 @@ +Added `zarr_metadata.model`: frozen-dataclass models (`ZarrV2ArrayMetadata`, +`ZarrV3ArrayMetadata`, `ZarrV2GroupMetadata`, `ZarrV3GroupMetadata`, +`ZarrV2ConsolidatedMetadata`, `ZarrV3ConsolidatedMetadata`, `ZarrV3NamedConfig`) +that are canonical, semantically lossless representations of Zarr metadata +documents, plus structural validators (`validate_*` / `is_*` / `parse_*`). +Every v3 extension point (data type, chunk grid, chunk key encoding, codecs, +storage transformers) is held as `ZarrV3NamedConfig`: a name, configuration, +and `must_understand` obligation; nothing is interpreted. On the wire, an +empty configuration with the default obligation uses the spec's plain-string +shorthand. Model fields are annotated with the role alias +`ZarrV3MetadataField` (today exactly `ZarrV3NamedConfig`), so annotations +convey the logical meaning and stay put if the spec adds another field form. + +Validation is strict about what the types declare: v2 `dtype` / `order` / +`compressor` / `filters` / `dimension_separator` shapes and the fixed +`zarr_format` / `node_type` literals are all enforced. Every +`ValidationProblem` carries a machine-readable `kind` +(`missing_key` / `invalid_type` / `invalid_value` / `invalid_json`) so +consumers can dispatch on the failure mode without matching message strings, +and every ingestion failure — including missing store keys and undecodable +bytes in `from_key_value` — surfaces as `MetadataValidationError`. An +adversarial review added further structural checks: JSON booleans are not +accepted as dimension lengths, dimensions are non-negative, +`dimension_names` must have one entry per dimension of `shape`, `attributes` +and `configuration` values are JSON-checked recursively (like `fill_value`), +non-finite floats and non-standard JSON constants are rejected, abstract +mappings and sequences normalize to encoder-safe canonical containers, +v2 `shape` and `chunks` must have the same rank, non-null v2 filter pipelines +contain at least one filter, document `TypeIs` guards only narrow values that +already use the declared canonical containers, +and the inline consolidated-metadata envelope and entries are deep-validated +so the group validator's verdict always agrees with the model constructor. + +The v3 models expose `must_understand_fields`: the subset of `extra_fields` +not explicitly waived with `must_understand: false` (fields are implicitly +must-understand per the spec). Readers discharge the spec's fail-to-open +duty by subtracting the extension names they recognize; the model only +partitions by obligation, since recognition is reader-specific. + +Optional pydantic integration ships as `zarr_metadata.pydantic` (importing it +requires pydantic 2.13 or newer; the core package does not depend on it): one +`Annotated` +field type per model, validating raw documents through `from_json`, passing +core-model instances through unchanged, serializing via `to_json`, and +publishing JSON Schemas derived from private constrained document types that +mirror the independently expressible runtime rules. Cross-field cardinality +relations still require runtime validation. The instances are the core model +classes, so values interoperate freely with non-pydantic code. + +`create_default` keeps its output self-consistent: overriding `shape` without +a chunk grid derives one regular chunk covering the array (v3 +`chunk_shape == shape`; v2 `chunks == shape`) instead of silently keeping the +scalar default's 0-d grid. + +A v2 `.zarray` that omits `dimension_separator` is interpreted with the v2 +convention's default `"."` (the model previously normalized absence to `"/"`, +which would misaddress the chunks of real-world default-separator arrays). +The value is never null: absent, `"."`, or `"/"` are the only spellings. + +Optional document keys use `UNSET` — a PEP 661 sentinel +(`typing_extensions.Sentinel`), usable directly in type expressions — never +`None`: in a model, `None` always corresponds to a JSON `null` in the +document (a v2 `compressor`, an unnamed dimension inside `dimension_names`), +and `UNSET` always means the key is absent. Checker note: ty types the +sentinel exactly; pyright needs `<= 1.1.404` until microsoft/pyright#11115 +is fixed (this package's CI pins it); mypy users need a `cast` or +`type: ignore` at narrowing sites until python/mypy#21647 merges. This keeps semantically distinct spellings +distinct — an absent `dimension_names` ("there are no dimension names") and +an explicit `[null, null]` ("every dimension has a name, which is null") are +different documents and round-trip as such. The `consolidated_metadata: null` +written by a historical zarr-python bug is the one deliberate exception to +faithful round-tripping: those stores remain readable, but the bug spelling +is repaired to absence on read and never written back. + +The v2 models treat the `.zattrs` file's presence as part of the store: +`attributes` is `UNSET` when no `.zattrs` file exists (and `to_key_value` +emits none), while an explicit empty `.zattrs` is `{}` and round-trips as a +file. Previously `to_key_value` always emitted `.zattrs`, silently adding a +file to stores that never had one. + +The store-key `Literal` aliases (`ZarrV2ArrayMetadataStoreKey`, +`ZarrV2AttributesStoreKey`, ...) are exported from `zarr_metadata.model` +alongside their constants, and each `to_key_value` return type is keyed by +them, so the set of store keys a model can emit is visible in its signature. +`from_key_value` deliberately keeps `Mapping[str, bytes]` input: it accepts +any string-keyed store mapping and ignores unrelated keys. + +`to_json` returns a document that shares no mutable state with the model: +every value that can hold a mutable container (attributes, configurations, +extra fields, v2 codec configurations, fill values, consolidated entries) is +deep-copied on the way out, so editing a serialized document can never +silently mutate the frozen model that produced it. diff --git a/packages/zarr-metadata/changes/4119.removal.md b/packages/zarr-metadata/changes/4119.removal.md new file mode 100644 index 0000000000..2a9a6f84c4 --- /dev/null +++ b/packages/zarr-metadata/changes/4119.removal.md @@ -0,0 +1,41 @@ +The document (TypedDict) types are renamed to put the format version at the +front of the name and to mark the JSON-document form with a `JSON` suffix, +so a format version can never be misread as a class revision and the bare +entity names are reserved for the `zarr_metadata.model` dataclasses: + +- `ArrayMetadataV2` → `ZarrV2ArrayMetadataJSON` (and `...Partial` accordingly) +- `ArrayMetadataV3` → `ZarrV3ArrayMetadataJSON` (and `...Partial` accordingly) +- `GroupMetadataV2` → `ZarrV2GroupMetadataJSON` (and `...Partial` accordingly) +- `GroupMetadataV3` → `ZarrV3GroupMetadataJSON` (and `...Partial` accordingly) +- `ConsolidatedMetadataV2` → `ZarrV2ConsolidatedMetadataJSON` +- `ConsolidatedMetadataV3` → `ZarrV3ConsolidatedMetadataJSON` +- `NamedConfigV3` → `ZarrV3NamedConfigJSON` +- `MetadataV3` → `ZarrV3MetadataFieldJSON` (the union of the bare-name and + named-configuration spellings of one metadata field) +- `ExtensionFieldV3` → `ZarrV3ExtensionField` +- `CodecMetadataV2` → `ZarrV2CodecMetadata` +- `DataTypeMetadataV2` → `ZarrV2DataTypeMetadata` +- `ArrayOrderV2` → `ZarrV2ArrayOrder` +- `ArrayDimensionSeparatorV2` → `ZarrV2ArrayDimensionSeparator` +- `ZArrayMetadata` → `ZarrV2ZArrayJSON` (the strict on-disk `.zarray` document) +- `ZGroupMetadata` → `ZarrV2ZGroupJSON` (the strict on-disk `.zgroup` document) +- `ZAttrsMetadata` → `ZarrV2ZAttrsJSON` (the `.zattrs` document) + +The old names are removed, not aliased. The `zarr_metadata.pydantic` field +types take the bare entity names (`ZarrV3ArrayMetadata`, ...), matching the +model classes they validate into. + +The conventions, stated once for future additions: CamelCase type names put +the format version first (`ZarrV2ArrayMetadataJSON`, +`ZarrV3ArrayMetadataStoreKey`), while SCREAMING_SNAKE constants and +snake_case functions put it last (`ARRAY_METADATA_STORE_KEY_V2`, +`validate_array_metadata_v3`). The `JSON` suffix marks a raw-document type +whose bare name is taken by (or reserved for) a `zarr_metadata.model` +dataclass; raw field-level types the models hold verbatim +(`ZarrV2CodecMetadata`, `ZarrV3ExtensionField`) keep their bare names. +Extension-entity types put the registered entity name first and end in +exactly one role suffix (`BloscCodecMetadata`, `Uint8DataTypeName`) — the +`V2` in `V2ChunkKeyEncodingMetadata` is that encoding's entity name, not a +format version, which is always spelled `ZarrV2`/`ZarrV3`. Every public +type name is checked against this grammar by +`tests/test_public_api.py::test_public_type_names_comply_with_naming_grammar`. diff --git a/packages/zarr-metadata/pyproject.toml b/packages/zarr-metadata/pyproject.toml index 05667d59e3..edc4b696a6 100644 --- a/packages/zarr-metadata/pyproject.toml +++ b/packages/zarr-metadata/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] name = "zarr-metadata" dynamic = ["version"] -description = "Spec-defined metadata types for Zarr v2 and v3." +description = "Spec-defined metadata types, models, and validators for Zarr v2 and v3." readme = "README.md" requires-python = ">=3.11" license = "MIT" @@ -32,7 +32,11 @@ classifiers = [ ] keywords = ["zarr"] dependencies = [ - "typing_extensions>=4.13", + # >=4.16: first release where `Sentinel` pickles by reference + # (`__reduce__` returns the sentinel's name), so `UNSET` — and any model + # holding it — can cross process boundaries and be deep-copied with its + # singleton identity intact. 4.15 and earlier refuse to pickle sentinels. + "typing_extensions>=4.16", ] [project.urls] @@ -43,7 +47,7 @@ Changelog = "https://github.com/zarr-developers/zarr-python/blob/main/packages/z Documentation = "https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-metadata/README.md" [dependency-groups] -test = ["pytest", "pydantic>=2"] +test = ["pytest", "pydantic>=2.13", "jsonschema"] [tool.hatch.version] source = "vcs" @@ -67,9 +71,9 @@ xfail_strict = true addopts = ["-ra", "--strict-config", "--strict-markers"] filterwarnings = [ "error", - # pydantic warns about ReadOnly TypedDict items not being enforced at runtime. - # That's expected here — we rely on type-checker enforcement, not pydantic mutation guards. - "ignore::UserWarning:pydantic._internal._generate_schema", + # Pydantic validates these public immutable-shape TypedDicts correctly but + # cannot enforce the type checker's ReadOnly mutation restriction. + "ignore:Items? .* using the `ReadOnly` qualifier.*:UserWarning:pydantic._internal._generate_schema", ] [tool.numpydoc_validation] @@ -82,6 +86,9 @@ checks = [ "PR06", ] +# CI pins pyright==1.1.404: later versions regress PEP 661 sentinel typing in +# class attributes (microsoft/pyright#11115), which zarr_metadata.model._sentinel +# relies on. Use the same pin locally; unpin when the fix lands. [tool.pyright] include = ["src"] enableExperimentalFeatures = true diff --git a/packages/zarr-metadata/src/zarr_metadata/__init__.py b/packages/zarr-metadata/src/zarr_metadata/__init__.py index 46949570a2..b5e52e976d 100644 --- a/packages/zarr-metadata/src/zarr_metadata/__init__.py +++ b/packages/zarr-metadata/src/zarr_metadata/__init__.py @@ -1,22 +1,48 @@ from importlib.metadata import version -from zarr_metadata._common import JSONValue, NamedConfigV3 +from zarr_metadata._common import JSONValue, ZarrV3NamedConfigJSON +from zarr_metadata.model import ( + UNSET, + MetadataValidationError, + ProblemKind, + ValidationProblem, + ZarrV2ArrayMetadata, + ZarrV2ArrayMetadataPartial, + ZarrV2ConsolidatedMetadata, + ZarrV2GroupMetadata, + ZarrV2GroupMetadataPartial, + ZarrV3ArrayMetadata, + ZarrV3ArrayMetadataPartial, + ZarrV3ConsolidatedMetadata, + ZarrV3GroupMetadata, + ZarrV3GroupMetadataPartial, + ZarrV3MetadataField, + ZarrV3NamedConfig, +) from zarr_metadata.v2.array import ( ARRAY_DIMENSION_SEPARATOR_V2, ARRAY_ORDER_V2, - ArrayDimensionSeparatorV2, - ArrayMetadataV2, - ArrayMetadataV2Partial, - ArrayOrderV2, - DataTypeMetadataV2, - ZArrayMetadata, -) -from zarr_metadata.v2.attributes import ZAttrsMetadata -from zarr_metadata.v2.codec import CodecMetadataV2 -from zarr_metadata.v2.consolidated import ConsolidatedMetadataV2 -from zarr_metadata.v2.group import GroupMetadataV2, GroupMetadataV2Partial, ZGroupMetadata -from zarr_metadata.v3._common import MetadataV3 -from zarr_metadata.v3.array import ArrayMetadataV3, ArrayMetadataV3Partial, ExtensionFieldV3 + ZarrV2ArrayDimensionSeparator, + ZarrV2ArrayMetadataJSON, + ZarrV2ArrayMetadataJSONPartial, + ZarrV2ArrayOrder, + ZarrV2DataTypeMetadata, + ZarrV2ZArrayJSON, +) +from zarr_metadata.v2.attributes import ZarrV2ZAttrsJSON +from zarr_metadata.v2.codec import ZarrV2CodecMetadata +from zarr_metadata.v2.consolidated import ZarrV2ConsolidatedMetadataJSON +from zarr_metadata.v2.group import ( + ZarrV2GroupMetadataJSON, + ZarrV2GroupMetadataJSONPartial, + ZarrV2ZGroupJSON, +) +from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON +from zarr_metadata.v3.array import ( + ZarrV3ArrayMetadataJSON, + ZarrV3ArrayMetadataJSONPartial, + ZarrV3ExtensionField, +) from zarr_metadata.v3.chunk_grid.rectilinear import ( RECTILINEAR_CHUNK_GRID_NAME, RectilinearChunkGridMetadata, @@ -86,7 +112,7 @@ TransposeCodecName, ) from zarr_metadata.v3.codec.zstd import ZSTD_CODEC_NAME, ZstdCodecMetadata, ZstdCodecName -from zarr_metadata.v3.consolidated import ConsolidatedMetadataV3 +from zarr_metadata.v3.consolidated import ZarrV3ConsolidatedMetadataJSON from zarr_metadata.v3.data_type.bool import ( BOOL_DATA_TYPE_NAME, BoolDataTypeName, @@ -185,7 +211,7 @@ Uint64DataTypeName, Uint64FillValue, ) -from zarr_metadata.v3.group import GroupMetadataV3, GroupMetadataV3Partial +from zarr_metadata.v3.group import ZarrV3GroupMetadataJSON, ZarrV3GroupMetadataJSONPartial __version__ = version("zarr-metadata") @@ -231,15 +257,10 @@ "UINT16_DATA_TYPE_NAME", "UINT32_DATA_TYPE_NAME", "UINT64_DATA_TYPE_NAME", + "UNSET", "V2_CHUNK_KEY_ENCODING_NAME", "V2_CHUNK_KEY_ENCODING_SEPARATOR", "ZSTD_CODEC_NAME", - "ArrayDimensionSeparatorV2", - "ArrayMetadataV2", - "ArrayMetadataV2Partial", - "ArrayMetadataV3", - "ArrayMetadataV3Partial", - "ArrayOrderV2", "BloscCName", "BloscCodecMetadata", "BloscCodecName", @@ -254,31 +275,22 @@ "CastRoundingMode", "CastValueCodecMetadata", "CastValueCodecName", - "CodecMetadataV2", "Complex64DataTypeName", "Complex64FillValue", "Complex128DataTypeName", "Complex128FillValue", - "ConsolidatedMetadataV2", - "ConsolidatedMetadataV3", "Crc32cCodecMetadata", "Crc32cCodecName", - "DataTypeMetadataV2", "DefaultChunkKeyEncodingMetadata", "DefaultChunkKeyEncodingName", "DefaultChunkKeyEncodingSeparator", "Endianness", - "ExtensionFieldV3", "Float16DataTypeName", "Float16FillValue", "Float32DataTypeName", "Float32FillValue", "Float64DataTypeName", "Float64FillValue", - "GroupMetadataV2", - "GroupMetadataV2Partial", - "GroupMetadataV3", - "GroupMetadataV3Partial", "GzipCodecMetadata", "GzipCodecName", "Int8DataTypeName", @@ -290,13 +302,13 @@ "Int64DataTypeName", "Int64FillValue", "JSONValue", - "MetadataV3", - "NamedConfigV3", + "MetadataValidationError", "NumpyDatetime64DataTypeName", "NumpyDatetime64FillValue", "NumpyTimeUnit", "NumpyTimedelta64DataTypeName", "NumpyTimedelta64FillValue", + "ProblemKind", "RawBytesDataTypeName", "RawBytesFillValue", "RectilinearChunkGridMetadata", @@ -325,9 +337,39 @@ "V2ChunkKeyEncodingMetadata", "V2ChunkKeyEncodingName", "V2ChunkKeyEncodingSeparator", - "ZArrayMetadata", - "ZAttrsMetadata", - "ZGroupMetadata", + "ValidationProblem", + "ZarrV2ArrayDimensionSeparator", + "ZarrV2ArrayMetadata", + "ZarrV2ArrayMetadataJSON", + "ZarrV2ArrayMetadataJSONPartial", + "ZarrV2ArrayMetadataPartial", + "ZarrV2ArrayOrder", + "ZarrV2CodecMetadata", + "ZarrV2ConsolidatedMetadata", + "ZarrV2ConsolidatedMetadataJSON", + "ZarrV2DataTypeMetadata", + "ZarrV2GroupMetadata", + "ZarrV2GroupMetadataJSON", + "ZarrV2GroupMetadataJSONPartial", + "ZarrV2GroupMetadataPartial", + "ZarrV2ZArrayJSON", + "ZarrV2ZAttrsJSON", + "ZarrV2ZGroupJSON", + "ZarrV3ArrayMetadata", + "ZarrV3ArrayMetadataJSON", + "ZarrV3ArrayMetadataJSONPartial", + "ZarrV3ArrayMetadataPartial", + "ZarrV3ConsolidatedMetadata", + "ZarrV3ConsolidatedMetadataJSON", + "ZarrV3ExtensionField", + "ZarrV3GroupMetadata", + "ZarrV3GroupMetadataJSON", + "ZarrV3GroupMetadataJSONPartial", + "ZarrV3GroupMetadataPartial", + "ZarrV3MetadataField", + "ZarrV3MetadataFieldJSON", + "ZarrV3NamedConfig", + "ZarrV3NamedConfigJSON", "ZstdCodecMetadata", "ZstdCodecName", "__version__", diff --git a/packages/zarr-metadata/src/zarr_metadata/_common.py b/packages/zarr-metadata/src/zarr_metadata/_common.py index 598a12e80c..f3259f7b73 100644 --- a/packages/zarr-metadata/src/zarr_metadata/_common.py +++ b/packages/zarr-metadata/src/zarr_metadata/_common.py @@ -13,7 +13,14 @@ JSONValue = TypeAliasType( "JSONValue", - "int | float | bool | None | str | list[JSONValue] | tuple[JSONValue, ...] | Mapping[str, JSONValue]", # type: ignore[reportInvalidTypeForm] + int + | float + | bool + | str + | list["JSONValue"] + | tuple["JSONValue", ...] + | Mapping[str, "JSONValue"] + | None, ) """A recursive type alias for JSON-encodable values. @@ -24,13 +31,14 @@ """ -class NamedConfigV3(TypedDict): +class ZarrV3NamedConfigJSON(TypedDict): """ Externally-tagged union member for a metadata field. - The `configuration` mapping holds arbitrary JSON-encodable values; - it is typed as `Mapping[str, JSONValue]`. + The optional `configuration` mapping holds arbitrary JSON-encodable + values. `must_understand` is implicitly true when absent. """ name: str configuration: NotRequired[Mapping[str, JSONValue]] + must_understand: NotRequired[bool] diff --git a/packages/zarr-metadata/src/zarr_metadata/_pydantic_schema.py b/packages/zarr-metadata/src/zarr_metadata/_pydantic_schema.py new file mode 100644 index 0000000000..e9792d6931 --- /dev/null +++ b/packages/zarr-metadata/src/zarr_metadata/_pydantic_schema.py @@ -0,0 +1,114 @@ +"""Private input types used only to generate accurate Pydantic JSON schemas.""" + +from __future__ import annotations + +from collections.abc import Mapping # noqa: TC003 # resolved by Pydantic at runtime +from typing import Annotated, Literal, NotRequired + +from pydantic import Field +from typing_extensions import TypedDict + +from zarr_metadata._common import JSONValue +from zarr_metadata.v2.array import ( # noqa: TC001 # resolved by Pydantic at runtime + ZarrV2DataTypeMetadata, +) +from zarr_metadata.v2.codec import ( # resolved by Pydantic at runtime + ZarrV2CodecMetadata, +) + +NonNegativeInt = Annotated[int, Field(ge=0)] + + +class ZarrV3NamedConfigJSON(TypedDict, closed=True): + """Closed v3 named configuration accepted at optional extension points.""" + + name: str + configuration: NotRequired[Mapping[str, JSONValue]] + must_understand: NotRequired[bool] + + +class ZarrV3MandatoryNamedConfigJSON(TypedDict, closed=True): + """Closed named configuration accepted where understanding is mandatory.""" + + name: str + configuration: NotRequired[Mapping[str, JSONValue]] + must_understand: NotRequired[Literal[True]] + + +ZarrV3MetadataFieldJSON = str | ZarrV3NamedConfigJSON +ZarrV3MandatoryMetadataFieldJSON = str | ZarrV3MandatoryNamedConfigJSON +ZarrV3CodecPipelineJSON = Annotated[tuple[ZarrV3MetadataFieldJSON, ...], Field(min_length=1)] +ZarrV2FilterPipelineJSON = Annotated[tuple[ZarrV2CodecMetadata, ...], Field(min_length=1)] + + +class ZarrV3ArrayMetadataJSON(TypedDict, extra_items=JSONValue): + """Schema input for a v3 array document, including arbitrary extensions.""" + + zarr_format: Literal[3] + node_type: Literal["array"] + data_type: ZarrV3MandatoryMetadataFieldJSON + shape: tuple[NonNegativeInt, ...] + chunk_grid: ZarrV3MandatoryMetadataFieldJSON + chunk_key_encoding: ZarrV3MandatoryMetadataFieldJSON + fill_value: JSONValue + codecs: ZarrV3CodecPipelineJSON + attributes: NotRequired[Mapping[str, JSONValue]] + storage_transformers: NotRequired[tuple[ZarrV3MetadataFieldJSON, ...]] + dimension_names: NotRequired[tuple[str | None, ...]] + + +class ZarrV3ConsolidatedMetadataJSON(TypedDict, closed=True): + """Schema input for the closed inline consolidated-metadata envelope.""" + + kind: Literal["inline"] + must_understand: Literal[False] + metadata: Mapping[str, ZarrV3ArrayMetadataJSON | ZarrV3GroupMetadataJSON] + + +class ZarrV3GroupMetadataJSON(TypedDict, extra_items=JSONValue): + """Schema input for a v3 group document, including arbitrary extensions.""" + + zarr_format: Literal[3] + node_type: Literal["group"] + attributes: NotRequired[Mapping[str, JSONValue]] + consolidated_metadata: NotRequired[ZarrV3ConsolidatedMetadataJSON | None] + + +class ZarrV2ArrayMetadataJSON(TypedDict, closed=True): + """Schema input for the closed, merged v2 array representation.""" + + zarr_format: Literal[2] + shape: tuple[NonNegativeInt, ...] + chunks: tuple[NonNegativeInt, ...] + dtype: ZarrV2DataTypeMetadata + compressor: ZarrV2CodecMetadata | None + fill_value: JSONValue + order: Literal["C", "F"] + filters: ZarrV2FilterPipelineJSON | None + dimension_separator: NotRequired[Literal[".", "/"]] + attributes: NotRequired[Mapping[str, JSONValue]] + + +class ZarrV2GroupMetadataJSON(TypedDict, closed=True): + """Schema input for the closed, merged v2 group representation.""" + + zarr_format: Literal[2] + attributes: NotRequired[Mapping[str, JSONValue]] + + +class ZarrV2ConsolidatedMetadataJSON(TypedDict, closed=True): + """Schema input matching the v2 consolidated model's structural parser.""" + + zarr_consolidated_format: Literal[1] + metadata: Mapping[str, JSONValue] + + +__all__ = [ + "ZarrV2ArrayMetadataJSON", + "ZarrV2ConsolidatedMetadataJSON", + "ZarrV2GroupMetadataJSON", + "ZarrV3ArrayMetadataJSON", + "ZarrV3ConsolidatedMetadataJSON", + "ZarrV3GroupMetadataJSON", + "ZarrV3MetadataFieldJSON", +] diff --git a/packages/zarr-metadata/src/zarr_metadata/model/__init__.py b/packages/zarr-metadata/src/zarr_metadata/model/__init__.py new file mode 100644 index 0000000000..e726c54d3e --- /dev/null +++ b/packages/zarr-metadata/src/zarr_metadata/model/__init__.py @@ -0,0 +1,132 @@ +"""In-memory models for Zarr metadata documents. + +Models are frozen dataclasses that hold a canonical, semantically lossless +representation of the JSON documents; they never interpret extension points +(codecs, chunk grids, data types). Validators check JSON structure, not domain validity. +Each document concept gets a `validate_*` function returning every problem +found (a `list[ValidationProblem]`, each with a machine-readable `kind`), an +`is_*` type guard, and a `parse_*` function that narrows or raises +`MetadataValidationError`. Model `from_json` / `from_key_value` constructors +raise `MetadataValidationError` for every ingestion failure, including +missing store keys and undecodable bytes. +""" + +from zarr_metadata.model._array import ( + ARRAY_METADATA_STORE_KEY_V2, + ARRAY_METADATA_STORE_KEY_V3, + ATTRIBUTES_STORE_KEY_V2, + ZarrV2ArrayMetadata, + ZarrV2ArrayMetadataPartial, + ZarrV2ArrayMetadataStoreKey, + ZarrV2AttributesStoreKey, + ZarrV3ArrayMetadata, + ZarrV3ArrayMetadataPartial, + ZarrV3ArrayMetadataStoreKey, + ZarrV3MetadataField, + ZarrV3NamedConfig, +) +from zarr_metadata.model._group import ( + CONSOLIDATED_METADATA_KEY_V3, + CONSOLIDATED_METADATA_STORE_KEY_V2, + GROUP_METADATA_STORE_KEY_V2, + GROUP_METADATA_STORE_KEY_V3, + ZarrV2ConsolidatedMetadata, + ZarrV2ConsolidatedMetadataStoreKey, + ZarrV2GroupMetadata, + ZarrV2GroupMetadataPartial, + ZarrV2GroupMetadataStoreKey, + ZarrV3ConsolidatedMetadata, + ZarrV3GroupMetadata, + ZarrV3GroupMetadataPartial, + ZarrV3GroupMetadataStoreKey, +) +from zarr_metadata.model._sentinel import UNSET +from zarr_metadata.model._validation import ( + ARRAY_METADATA_OPTIONAL_KEYS_V3, + ARRAY_METADATA_REQUIRED_KEYS_V2, + ARRAY_METADATA_REQUIRED_KEYS_V3, + ARRAY_METADATA_STANDARD_KEYS_V3, + GROUP_METADATA_OPTIONAL_KEYS_V3, + GROUP_METADATA_REQUIRED_KEYS_V2, + GROUP_METADATA_REQUIRED_KEYS_V3, + GROUP_METADATA_STANDARD_KEYS_V3, + MetadataValidationError, + ProblemKind, + ValidationProblem, + is_array_metadata_v2, + is_array_metadata_v3, + is_group_metadata_v2, + is_group_metadata_v3, + is_json, + is_metadata_field_v3, + parse_array_metadata_v2, + parse_array_metadata_v3, + parse_group_metadata_v2, + parse_group_metadata_v3, + parse_json, + parse_metadata_field_v3, + validate_array_metadata_v2, + validate_array_metadata_v3, + validate_group_metadata_v2, + validate_group_metadata_v3, + validate_json, + validate_metadata_field_v3, +) + +__all__ = [ + "ARRAY_METADATA_OPTIONAL_KEYS_V3", + "ARRAY_METADATA_REQUIRED_KEYS_V2", + "ARRAY_METADATA_REQUIRED_KEYS_V3", + "ARRAY_METADATA_STANDARD_KEYS_V3", + "ARRAY_METADATA_STORE_KEY_V2", + "ARRAY_METADATA_STORE_KEY_V3", + "ATTRIBUTES_STORE_KEY_V2", + "CONSOLIDATED_METADATA_KEY_V3", + "CONSOLIDATED_METADATA_STORE_KEY_V2", + "GROUP_METADATA_OPTIONAL_KEYS_V3", + "GROUP_METADATA_REQUIRED_KEYS_V2", + "GROUP_METADATA_REQUIRED_KEYS_V3", + "GROUP_METADATA_STANDARD_KEYS_V3", + "GROUP_METADATA_STORE_KEY_V2", + "GROUP_METADATA_STORE_KEY_V3", + "UNSET", + "MetadataValidationError", + "ProblemKind", + "ValidationProblem", + "ZarrV2ArrayMetadata", + "ZarrV2ArrayMetadataPartial", + "ZarrV2ArrayMetadataStoreKey", + "ZarrV2AttributesStoreKey", + "ZarrV2ConsolidatedMetadata", + "ZarrV2ConsolidatedMetadataStoreKey", + "ZarrV2GroupMetadata", + "ZarrV2GroupMetadataPartial", + "ZarrV2GroupMetadataStoreKey", + "ZarrV3ArrayMetadata", + "ZarrV3ArrayMetadataPartial", + "ZarrV3ArrayMetadataStoreKey", + "ZarrV3ConsolidatedMetadata", + "ZarrV3GroupMetadata", + "ZarrV3GroupMetadataPartial", + "ZarrV3GroupMetadataStoreKey", + "ZarrV3MetadataField", + "ZarrV3NamedConfig", + "is_array_metadata_v2", + "is_array_metadata_v3", + "is_group_metadata_v2", + "is_group_metadata_v3", + "is_json", + "is_metadata_field_v3", + "parse_array_metadata_v2", + "parse_array_metadata_v3", + "parse_group_metadata_v2", + "parse_group_metadata_v3", + "parse_json", + "parse_metadata_field_v3", + "validate_array_metadata_v2", + "validate_array_metadata_v3", + "validate_group_metadata_v2", + "validate_group_metadata_v3", + "validate_json", + "validate_metadata_field_v3", +] diff --git a/packages/zarr-metadata/src/zarr_metadata/model/_array.py b/packages/zarr-metadata/src/zarr_metadata/model/_array.py new file mode 100644 index 0000000000..c4c967f891 --- /dev/null +++ b/packages/zarr-metadata/src/zarr_metadata/model/_array.py @@ -0,0 +1,498 @@ +"""In-memory models for Zarr array metadata documents.""" + +from __future__ import annotations + +import copy +import dataclasses +from collections.abc import Mapping +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, Final, Literal, TypeAlias, cast + +from typing_extensions import TypedDict, Unpack + +from zarr_metadata.model._sentinel import UNSET +from zarr_metadata.model._validation import ( + ARRAY_METADATA_STANDARD_KEYS_V3, + MetadataValidationError, + ValidationProblem, + arrays_to_tuples, + dump_store_json, + load_store_json, + parse_array_metadata_v2, + parse_array_metadata_v3, + parse_metadata_field_v3, +) + +if TYPE_CHECKING: + from zarr_metadata._common import JSONValue, ZarrV3NamedConfigJSON + from zarr_metadata.v2.array import ( + ZarrV2ArrayDimensionSeparator, + ZarrV2ArrayMetadataJSON, + ZarrV2ArrayOrder, + ZarrV2DataTypeMetadata, + ) + from zarr_metadata.v2.codec import ZarrV2CodecMetadata + from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON + from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON, ZarrV3ExtensionField + +ZarrV3ArrayMetadataStoreKey = Literal["zarr.json"] +ARRAY_METADATA_STORE_KEY_V3: Final[ZarrV3ArrayMetadataStoreKey] = "zarr.json" + +ZarrV2ArrayMetadataStoreKey = Literal[".zarray"] +ARRAY_METADATA_STORE_KEY_V2: Final[ZarrV2ArrayMetadataStoreKey] = ".zarray" + +ZarrV2AttributesStoreKey = Literal[".zattrs"] +ATTRIBUTES_STORE_KEY_V2: Final[ZarrV2AttributesStoreKey] = ".zattrs" + + +@dataclass(frozen=True, slots=True, kw_only=True) +class ZarrV3NamedConfig: + """A normalized v3 metadata field with its reader obligation. + + Bare names and missing configurations normalize to an empty configuration. + Bare names and missing `must_understand` members normalize to the spec's + implicit `True` value. + """ + + name: str + configuration: dict[str, JSONValue] + must_understand: bool = True + + def to_json(self) -> ZarrV3MetadataFieldJSON: + if not self.configuration and self.must_understand: + return self.name + out: ZarrV3NamedConfigJSON = {"name": self.name} + if self.configuration: + # to_json output shares no mutable state with the model. + out["configuration"] = copy.deepcopy(self.configuration) + if not self.must_understand: + out["must_understand"] = False + return out + + @classmethod + def from_json(cls, data: object) -> ZarrV3NamedConfig: + field = parse_metadata_field_v3(data) + if isinstance(field, str): + return cls(name=field, configuration={}, must_understand=True) + # Sound cast: parse_metadata_field_v3 checked the configuration is a + # string-keyed mapping of JSON values; arrays_to_tuples only converts + # lists to tuples within that shape. + configuration = cast( + "dict[str, JSONValue]", arrays_to_tuples(dict(field.get("configuration", {}))) + ) + return cls( + name=field["name"], + configuration=configuration, + must_understand=field.get("must_understand", True), + ) + + +ZarrV3MetadataField: TypeAlias = ZarrV3NamedConfig +"""The in-memory model of one field of a v3 metadata document. + +This is the role-named alias for annotation positions: model fields and +consumer signatures should say `ZarrV3MetadataField` (the logical meaning) +rather than `ZarrV3NamedConfig` (the serialized form the field currently +takes). Today every metadata field normalizes to a named configuration plus +its reader obligation, so the alias is exactly `ZarrV3NamedConfig`; if a future +spec revision adds a field form that cannot be normalized to those values, +this alias widens to a union and annotation sites do not change. Mirrors the +raw-layer split between `ZarrV3NamedConfigJSON` (shape) and +`ZarrV3MetadataFieldJSON` (field union). +""" + + +def must_understand_subset( + extra_fields: Mapping[str, ZarrV3ExtensionField], +) -> dict[str, ZarrV3ExtensionField]: + """The subset of `extra_fields` the reader is obligated to understand. + + Per the v3 spec, an extension field is implicitly `must_understand: True` + unless it explicitly says otherwise, and an implementation MUST fail to + open a group or array carrying fields it does not recognize that are not + explicitly `must_understand: false`. A non-mapping field value cannot + carry the explicit waiver, so it always requires understanding (the + runtime isinstance check defends against values looser than the declared + `ZarrV3ExtensionField`). + """ + fields = cast("Mapping[str, object]", extra_fields) + return cast( + "dict[str, ZarrV3ExtensionField]", + { + name: value + for name, value in fields.items() + if not ( + isinstance(value, Mapping) + and cast("Mapping[str, object]", value).get("must_understand") is False + ) + }, + ) + + +class ZarrV3ArrayMetadataPartial(TypedDict, total=False): + """ + Partial form of the constructor-settable fields of `ZarrV3ArrayMetadata`. + + Every key is optional and typed with the model's own (not serialized) + value types, so it describes valid keyword arguments to + `ZarrV3ArrayMetadata.update`. The `init=False` fields `zarr_format` and + `node_type` are intentionally excluded, since they cannot be passed to + `dataclasses.replace`. + + Drift between this type and the model's settable fields is prevented by + `tests/model/test_array.py::test_partial_keys_match_settable_model_fields`. + """ + + shape: tuple[int, ...] + fill_value: JSONValue + data_type: ZarrV3MetadataField + chunk_grid: ZarrV3MetadataField + codecs: tuple[ZarrV3MetadataField, ...] + chunk_key_encoding: ZarrV3MetadataField + dimension_names: tuple[str | None, ...] | UNSET + attributes: dict[str, JSONValue] + storage_transformers: tuple[ZarrV3MetadataField, ...] + extra_fields: dict[str, ZarrV3ExtensionField] + + +@dataclass(frozen=True, slots=True, kw_only=True) +class ZarrV3ArrayMetadata: + """In-memory model of a v3 array metadata document. + + A canonical, semantically lossless representation of the `zarr.json` + content for an array. Extension points (`data_type`, `chunk_grid`, + `chunk_key_encoding`, `codecs`, `storage_transformers`) are held as + `ZarrV3MetadataField` values (currently `ZarrV3NamedConfig` name, + configuration, and obligation records) and are never interpreted; + `fill_value` is held verbatim in its JSON form. Equivalent extension + spellings normalize to shorthand strings when configuration is empty and + understanding is required. + """ + + zarr_format: Literal[3] = field(default=3, init=False) + node_type: Literal["array"] = field(default="array", init=False) + shape: tuple[int, ...] + fill_value: JSONValue + data_type: ZarrV3MetadataField + chunk_grid: ZarrV3MetadataField + codecs: tuple[ZarrV3MetadataField, ...] + chunk_key_encoding: ZarrV3MetadataField + dimension_names: tuple[str | None, ...] | UNSET + attributes: dict[str, JSONValue] + storage_transformers: tuple[ZarrV3MetadataField, ...] + extra_fields: dict[str, ZarrV3ExtensionField] + + @classmethod + def create_default(cls, **overrides: Unpack[ZarrV3ArrayMetadataPartial]) -> ZarrV3ArrayMetadata: + """ + Create a default (empty) v3 array metadata model, with optional overrides. + + The default is a structurally-valid scalar `uint8` array — the array + analog of `list()` returning `[]`. Any field can be overridden by keyword + (the same fields accepted by `update`). Overriding `shape` without + `chunk_grid` derives a consistent default grid: one regular chunk + covering the array (`chunk_shape` equal to `shape`). + + The derivation is deliberately one-way. A user-supplied `chunk_grid` + is an extension point and is taken verbatim — deriving `shape` from + it would require interpreting the grid's configuration, which this + layer never does (and cannot do for unrecognized grid names). So + overriding `chunk_grid` without `shape` keeps the scalar default + `shape=()`, and consistency between the two is the caller's + responsibility. + """ + if "shape" in overrides and "chunk_grid" not in overrides: + overrides["chunk_grid"] = ZarrV3NamedConfig( + name="regular", configuration={"chunk_shape": tuple(overrides["shape"])} + ) + default = cls( + shape=(), + fill_value=0, + data_type=ZarrV3NamedConfig(name="uint8", configuration={}), + chunk_grid=ZarrV3NamedConfig(name="regular", configuration={"chunk_shape": ()}), + codecs=(ZarrV3NamedConfig(name="bytes", configuration={}),), + chunk_key_encoding=ZarrV3NamedConfig(name="default", configuration={}), + dimension_names=UNSET, + attributes={}, + storage_transformers=(), + extra_fields={}, + ) + return default.update(**overrides) + + def update(self, **kwargs: Unpack[ZarrV3ArrayMetadataPartial]) -> ZarrV3ArrayMetadata: + """ + Return a new `ZarrV3ArrayMetadata` with the given fields updated. + + Only the constructor-settable fields listed in + `ZarrV3ArrayMetadataPartial` can be updated; any attempt to update + other fields (including the fixed `zarr_format` / `node_type`) is + rejected at the type level. Each given field fully replaces its + previous value, including `extra_fields`. + + This is useful for test fixtures that want to override a few fields of a + base template without having to re-specify the entire document. + + No re-validation is performed (`update` is `dataclasses.replace`), so + a repair or edit can produce an invalid document; validity is checked + on `from_json`, not on field replacement. + """ + return dataclasses.replace(self, **kwargs) + + def __post_init__(self) -> None: + overlap = set(self.extra_fields.keys()).intersection(ARRAY_METADATA_STANDARD_KEYS_V3) + if overlap: + raise MetadataValidationError( + [ + ValidationProblem( + ("extra_fields",), + "Extra fields cannot overlap with standard Zarr V3 array metadata fields", + "invalid_value", + ) + ] + ) + + def to_json(self) -> ZarrV3ArrayMetadataJSON: + # to_json output shares no mutable state with the model: every value + # that can hold a mutable container is deep-copied. + out: ZarrV3ArrayMetadataJSON = { + "zarr_format": self.zarr_format, + "node_type": self.node_type, + "shape": self.shape, + "fill_value": copy.deepcopy(self.fill_value), + "data_type": self.data_type.to_json(), + "chunk_grid": self.chunk_grid.to_json(), + "codecs": tuple(codec.to_json() for codec in self.codecs), + "chunk_key_encoding": self.chunk_key_encoding.to_json(), + } + if self.dimension_names is not UNSET: + out["dimension_names"] = self.dimension_names + if len(self.attributes) > 0: + out["attributes"] = copy.deepcopy(self.attributes) + if len(self.storage_transformers) > 0: + out["storage_transformers"] = tuple( + transformer.to_json() for transformer in self.storage_transformers + ) + # Extra fields are the TypedDict's `extra_items` (PEP 728). Assign them + # by key rather than `out.update(**...)`: type checkers understand the + # indexed-write path against `extra_items`, but not the `update(**...)` + # overload. + for key, value in self.extra_fields.items(): + out[key] = copy.deepcopy(value) + return out + + @classmethod + def from_json(cls, data: object) -> ZarrV3ArrayMetadata: + parsed = parse_array_metadata_v3(arrays_to_tuples(data)) + # Sound cast: the TypedDict types all non-standard keys as its + # `extra_items` (`ZarrV3ExtensionField`); the comprehension's inferred value + # type is the union over ALL keys because the key filter cannot narrow it. + extra_fields = cast( + "dict[str, ZarrV3ExtensionField]", + {k: v for k, v in parsed.items() if k not in ARRAY_METADATA_STANDARD_KEYS_V3}, + ) + return cls( + shape=parsed["shape"], + fill_value=parsed["fill_value"], + data_type=ZarrV3NamedConfig.from_json(parsed["data_type"]), + chunk_grid=ZarrV3NamedConfig.from_json(parsed["chunk_grid"]), + codecs=tuple(ZarrV3NamedConfig.from_json(c) for c in parsed["codecs"]), + chunk_key_encoding=ZarrV3NamedConfig.from_json(parsed["chunk_key_encoding"]), + dimension_names=parsed.get("dimension_names", UNSET), + attributes=dict(parsed.get("attributes", {})), + storage_transformers=tuple( + ZarrV3NamedConfig.from_json(t) for t in parsed.get("storage_transformers", ()) + ), + extra_fields=extra_fields, + ) + + @property + def must_understand_fields(self) -> dict[str, ZarrV3ExtensionField]: + """Extra fields the reader is obligated to understand. + + Everything in `extra_fields` not explicitly waived with + `must_understand: false` (the spec's implicit-true rule). A compliant + reader MUST fail to open the array if this contains any field it does + not recognize; the model layer only partitions by obligation, since + recognition is reader-specific. + """ + return must_understand_subset(self.extra_fields) + + @classmethod + def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV3ArrayMetadata: + return cls.from_json(load_store_json(mapping, ARRAY_METADATA_STORE_KEY_V3)) + + def to_key_value( + self, *, indent: int | str | None = None + ) -> Mapping[ZarrV3ArrayMetadataStoreKey, bytes]: + return {ARRAY_METADATA_STORE_KEY_V3: dump_store_json(self.to_json(), indent=indent)} + + +class ZarrV2ArrayMetadataPartial(TypedDict, total=False): + """ + Partial form of the constructor-settable fields of `ZarrV2ArrayMetadata`. + + Every key is optional and typed with the model's own value types, so it + describes valid keyword arguments to `ZarrV2ArrayMetadata.update` and + `create_default`. The `init=False` field `zarr_format` is intentionally + excluded, since it cannot be passed to `dataclasses.replace`. + + Drift between this type and the model's settable fields is prevented by + `tests/model/test_array.py::test_v2_partial_keys_match_settable_model_fields`. + """ + + shape: tuple[int, ...] + dtype: ZarrV2DataTypeMetadata + chunks: tuple[int, ...] + fill_value: JSONValue + order: ZarrV2ArrayOrder + compressor: ZarrV2CodecMetadata | None + filters: tuple[ZarrV2CodecMetadata, ...] | None + dimension_separator: ZarrV2ArrayDimensionSeparator + attributes: dict[str, JSONValue] | UNSET + + +@dataclass(frozen=True, slots=True, kw_only=True) +class ZarrV2ArrayMetadata: + """In-memory model of a v2 array metadata document. + + A canonical, lossless representation of the `.zarray` content plus the + sibling `.zattrs` attributes. `dtype`, `compressor`, and `filters` are + held in their raw JSON forms and are never interpreted; `fill_value` is + held verbatim in its JSON form. `attributes` is `UNSET` when no + `.zattrs` file (or merged `attributes` key) exists — distinct from an + explicit empty `.zattrs`, which is `{}` and round-trips as a file. One + spelling normalization: a `.zarray` that omits `dimension_separator` + means `"."` by the v2 convention, and the model holds and re-emits that + value explicitly. + """ + + zarr_format: Literal[2] = field(default=2, init=False) + shape: tuple[int, ...] + dtype: ZarrV2DataTypeMetadata + chunks: tuple[int, ...] + fill_value: JSONValue + order: ZarrV2ArrayOrder + compressor: ZarrV2CodecMetadata | None + filters: tuple[ZarrV2CodecMetadata, ...] | None + # "." is the v2 convention's default for an ABSENT dimension_separator key; + # from_json normalizes absence to it (a semantics-preserving spelling + # normalization, like the v3 bare-string metadata-field form). The value + # is never None: the document grammar has no null spelling for this field. + dimension_separator: ZarrV2ArrayDimensionSeparator = field(default=".") + attributes: dict[str, JSONValue] | UNSET + + def update(self, **kwargs: Unpack[ZarrV2ArrayMetadataPartial]) -> ZarrV2ArrayMetadata: + """ + Return a new `ZarrV2ArrayMetadata` with the given fields updated. + + Only the constructor-settable fields listed in + `ZarrV2ArrayMetadataPartial` can be updated; the fixed `zarr_format` is + rejected at the type level. Each given field fully replaces its previous + value. + """ + return dataclasses.replace(self, **kwargs) + + @classmethod + def create_default(cls, **overrides: Unpack[ZarrV2ArrayMetadataPartial]) -> ZarrV2ArrayMetadata: + """ + Create a default (empty) v2 array metadata model, with optional overrides. + + The default is a structurally-valid scalar `uint8` (`"|u1"`) array — the + array analog of `list()` returning `[]`. Any field can be overridden by + keyword (the same fields accepted by `update`). Overriding `shape` + without `chunks` derives `chunks` equal to `shape` (one chunk covering + the array). + + The derivation is deliberately one-way, matching the v3 model: + overriding `chunks` without `shape` keeps the scalar default + `shape=()`, and consistency between the two is the caller's + responsibility. + """ + if "shape" in overrides and "chunks" not in overrides: + overrides["chunks"] = tuple(overrides["shape"]) + default = cls( + shape=(), + dtype="|u1", + chunks=(), + fill_value=0, + order="C", + compressor=None, + filters=None, + attributes=UNSET, + ) + return default.update(**overrides) + + def to_json(self) -> ZarrV2ArrayMetadataJSON: + """Return the merged in-memory document form. + + `attributes` is included when set (even empty). This is not the + on-disk `.zarray` content: a conforming `.zarray` must exclude + `attributes` (they live in the sibling `.zattrs` file). Use + `to_key_value` to produce the spec-conforming split for storage. + """ + # to_json output shares no mutable state with the model: every value + # that can hold a mutable container is deep-copied. + out: ZarrV2ArrayMetadataJSON = { + "zarr_format": self.zarr_format, + "shape": self.shape, + "dtype": self.dtype, + "order": self.order, + "chunks": self.chunks, + "fill_value": copy.deepcopy(self.fill_value), + "dimension_separator": self.dimension_separator, + "compressor": copy.deepcopy(self.compressor), + "filters": copy.deepcopy(self.filters), + } + if self.attributes is not UNSET: + out["attributes"] = copy.deepcopy(self.attributes) + return out + + @classmethod + def from_json(cls, data: object) -> ZarrV2ArrayMetadata: + parsed = parse_array_metadata_v2(arrays_to_tuples(data)) + return cls( + shape=parsed["shape"], + dtype=parsed["dtype"], + chunks=parsed["chunks"], + fill_value=parsed["fill_value"], + order=parsed["order"], + compressor=parsed["compressor"], + filters=parsed["filters"], + dimension_separator=parsed.get("dimension_separator", "."), + attributes=(dict(parsed["attributes"]) if "attributes" in parsed else UNSET), + ) + + @classmethod + def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV2ArrayMetadata: + zarray_raw = cast("object", load_store_json(mapping, ARRAY_METADATA_STORE_KEY_V2)) + if not isinstance(zarray_raw, Mapping): + return cls.from_json(zarray_raw) + zarray = cast("Mapping[str, object]", zarray_raw) + if "attributes" in zarray: + raise MetadataValidationError( + [ + ValidationProblem( + ("attributes",), + "unexpected document member", + "invalid_value", + ) + ] + ) + if ATTRIBUTES_STORE_KEY_V2 in mapping: + zattrs = cast("object", load_store_json(mapping, ATTRIBUTES_STORE_KEY_V2)) + return cls.from_json({**zarray, "attributes": zattrs}) + return cls.from_json(zarray) + + def to_key_value( + self, *, indent: int | str | None = None + ) -> Mapping[ZarrV2ArrayMetadataStoreKey | ZarrV2AttributesStoreKey, bytes]: + # Attributes live only in the sibling `.zattrs` file; the `.zarray` + # document must exclude them. The `.zattrs` key is present exactly + # when attributes are set (even empty) — UNSET emits no file. + zarray = {k: v for k, v in self.to_json().items() if k != "attributes"} + out: dict[ZarrV2ArrayMetadataStoreKey | ZarrV2AttributesStoreKey, bytes] = { + ARRAY_METADATA_STORE_KEY_V2: dump_store_json(zarray, indent=indent) + } + if self.attributes is not UNSET: + out[ATTRIBUTES_STORE_KEY_V2] = dump_store_json(self.attributes, indent=indent) + return out diff --git a/packages/zarr-metadata/src/zarr_metadata/model/_group.py b/packages/zarr-metadata/src/zarr_metadata/model/_group.py new file mode 100644 index 0000000000..d576833c26 --- /dev/null +++ b/packages/zarr-metadata/src/zarr_metadata/model/_group.py @@ -0,0 +1,442 @@ +"""In-memory models for Zarr group and consolidated metadata documents.""" + +from __future__ import annotations + +import copy +import dataclasses +from collections.abc import Mapping +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, Final, Literal, cast + +from typing_extensions import TypedDict, Unpack + +from zarr_metadata.model._array import ( + ATTRIBUTES_STORE_KEY_V2, + ZarrV3ArrayMetadata, + must_understand_subset, +) +from zarr_metadata.model._sentinel import UNSET +from zarr_metadata.model._validation import ( + GROUP_METADATA_STANDARD_KEYS_V3, + MetadataValidationError, + ValidationProblem, + arrays_to_tuples, + dump_store_json, + load_store_json, + parse_group_metadata_v2, + parse_group_metadata_v3, + validate_consolidated_metadata_v3, + validate_json, +) + +if TYPE_CHECKING: + from zarr_metadata._common import JSONValue + from zarr_metadata.model._array import ZarrV2AttributesStoreKey + from zarr_metadata.v2.group import ZarrV2GroupMetadataJSON + from zarr_metadata.v3.array import ZarrV3ExtensionField + from zarr_metadata.v3.consolidated import ZarrV3ConsolidatedMetadataJSON + from zarr_metadata.v3.group import ZarrV3GroupMetadataJSON + +ZarrV3GroupMetadataStoreKey = Literal["zarr.json"] +GROUP_METADATA_STORE_KEY_V3: Final[ZarrV3GroupMetadataStoreKey] = "zarr.json" + +ZarrV2GroupMetadataStoreKey = Literal[".zgroup"] +GROUP_METADATA_STORE_KEY_V2: Final[ZarrV2GroupMetadataStoreKey] = ".zgroup" + +ZarrV2ConsolidatedMetadataStoreKey = Literal[".zmetadata"] +CONSOLIDATED_METADATA_STORE_KEY_V2: Final[ZarrV2ConsolidatedMetadataStoreKey] = ".zmetadata" + +# The key under which consolidated metadata is embedded in a v3 group document. +# This is a reference-implementation convention (not a spec artifact), stored +# as an extension field on the group's `zarr.json`. +CONSOLIDATED_METADATA_KEY_V3: Final = "consolidated_metadata" + + +class ZarrV3GroupMetadataPartial(TypedDict, total=False): + """ + Partial form of the constructor-settable fields of `ZarrV3GroupMetadata`. + + Every key is optional and typed with the model's own value types, so it + describes valid keyword arguments to `ZarrV3GroupMetadata.update` and + `create_default`. The `init=False` fields `zarr_format` and `node_type` + are intentionally excluded, since they cannot be passed to + `dataclasses.replace`. + + Drift between this type and the model's settable fields is prevented by + `tests/model/test_group.py::test_group_partial_keys_match_settable_model_fields`. + """ + + attributes: dict[str, JSONValue] + consolidated_metadata: ZarrV3ConsolidatedMetadata | UNSET + extra_fields: dict[str, ZarrV3ExtensionField] + + +@dataclass(frozen=True, slots=True, kw_only=True) +class ZarrV3GroupMetadata: + """In-memory model of a v3 group metadata document. + + A canonical, semantically lossless representation of the `zarr.json` + content for a group. The `consolidated_metadata` reference-implementation + convention is modeled as a typed field holding thin child models; every + other unknown top-level key lands in `extra_fields` verbatim. + """ + + zarr_format: Literal[3] = field(default=3, init=False) + node_type: Literal["group"] = field(default="group", init=False) + attributes: dict[str, JSONValue] + consolidated_metadata: ZarrV3ConsolidatedMetadata | UNSET + extra_fields: dict[str, ZarrV3ExtensionField] + + def __post_init__(self) -> None: + reserved = GROUP_METADATA_STANDARD_KEYS_V3 | {CONSOLIDATED_METADATA_KEY_V3} + if set(self.extra_fields.keys()).intersection(reserved): + raise MetadataValidationError( + [ + ValidationProblem( + ("extra_fields",), + "Extra fields cannot overlap with standard Zarr V3 group metadata fields", + "invalid_value", + ) + ] + ) + + @classmethod + def create_default(cls, **overrides: Unpack[ZarrV3GroupMetadataPartial]) -> ZarrV3GroupMetadata: + """ + Create a default (empty) v3 group metadata model, with optional overrides. + + The default is a structurally-valid group with no attributes — the group + analog of `list()` returning `[]`. Any field can be overridden by keyword + (the same fields accepted by `update`). + """ + default = cls(attributes={}, consolidated_metadata=UNSET, extra_fields={}) + return default.update(**overrides) + + def update(self, **kwargs: Unpack[ZarrV3GroupMetadataPartial]) -> ZarrV3GroupMetadata: + """ + Return a new `ZarrV3GroupMetadata` with the given fields updated. + + Only the constructor-settable fields listed in + `ZarrV3GroupMetadataPartial` can be updated; the fixed `zarr_format` / + `node_type` are rejected at the type level. Each given field fully + replaces its previous value, including `extra_fields`. + """ + return dataclasses.replace(self, **kwargs) + + def to_json(self) -> ZarrV3GroupMetadataJSON: + # to_json output shares no mutable state with the model: every value + # that can hold a mutable container is deep-copied. + out: ZarrV3GroupMetadataJSON = { + "zarr_format": self.zarr_format, + "node_type": self.node_type, + } + if len(self.attributes) > 0: + out["attributes"] = copy.deepcopy(self.attributes) + if self.consolidated_metadata is not UNSET: + # Consolidated metadata is a known non-core top-level JSON field. + out[CONSOLIDATED_METADATA_KEY_V3] = cast( + "ZarrV3ExtensionField", self.consolidated_metadata.to_json() + ) + for key, value in self.extra_fields.items(): + out[key] = copy.deepcopy(value) + return out + + @classmethod + def from_json(cls, data: object) -> ZarrV3GroupMetadata: + parsed = parse_group_metadata_v3(arrays_to_tuples(data)) + # Cast for narrowing across standard and arbitrary extra TypedDict items. + consolidated_raw = cast("object", parsed.get(CONSOLIDATED_METADATA_KEY_V3, UNSET)) + consolidated: ZarrV3ConsolidatedMetadata | UNSET + if consolidated_raw is UNSET or consolidated_raw is None: + # consolidated_metadata: null was written by a historical + # zarr-python bug; it gets no model representation. It is read as + # absence and never written back — repaired, not preserved. + consolidated = UNSET + else: + consolidated = ZarrV3ConsolidatedMetadata.from_json(consolidated_raw) + # Sound cast: the TypedDict types all non-standard keys as its + # `extra_items` (`ZarrV3ExtensionField`); the comprehension's inferred value + # type is the union over ALL keys because the key filter cannot narrow it. + extra_fields = cast( + "dict[str, ZarrV3ExtensionField]", + { + k: v + for k, v in parsed.items() + if k not in GROUP_METADATA_STANDARD_KEYS_V3 and k != CONSOLIDATED_METADATA_KEY_V3 + }, + ) + return cls( + attributes=dict(parsed.get("attributes", {})), + consolidated_metadata=consolidated, + extra_fields=extra_fields, + ) + + @property + def must_understand_fields(self) -> dict[str, ZarrV3ExtensionField]: + """Extra fields the reader is obligated to understand. + + Everything in `extra_fields` not explicitly waived with + `must_understand: false` (the spec's implicit-true rule). A compliant + reader MUST fail to open the group if this contains any field it does + not recognize; the model layer only partitions by obligation, since + recognition is reader-specific. + """ + return must_understand_subset(self.extra_fields) + + @classmethod + def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV3GroupMetadata: + return cls.from_json(load_store_json(mapping, GROUP_METADATA_STORE_KEY_V3)) + + def to_key_value( + self, *, indent: int | str | None = None + ) -> Mapping[ZarrV3GroupMetadataStoreKey, bytes]: + return {GROUP_METADATA_STORE_KEY_V3: dump_store_json(self.to_json(), indent=indent)} + + +@dataclass(frozen=True, slots=True, kw_only=True) +class ZarrV3ConsolidatedMetadata: + """In-memory model of v3 inline consolidated metadata. + + Models the reference-implementation convention where consolidated metadata + is embedded as an extension field on a group's `zarr.json`. Each entry in + `metadata` is a complete child document, held as a thin array or group + model. `must_understand` is typed permissively as `bool` to mirror the + document shape, but only `False` is valid; this is enforced at runtime. + """ + + kind: Literal["inline"] = field(default="inline", init=False) + must_understand: bool = False + metadata: dict[str, ZarrV3ArrayMetadata | ZarrV3GroupMetadata] + + def __post_init__(self) -> None: + if self.must_understand is not False: + raise MetadataValidationError( + [ + ValidationProblem( + ("must_understand",), + f"Invalid value for 'must_understand'. Expected False. " + f"Got {self.must_understand!r}.", + "invalid_value", + ) + ] + ) + + def to_json(self) -> ZarrV3ConsolidatedMetadataJSON: + # `must_understand` is emitted as the literal False: the field is typed + # permissively as `bool`, but `__post_init__` guarantees the value. + return { + "kind": self.kind, + "must_understand": False, + "metadata": {key: node.to_json() for key, node in self.metadata.items()}, + } + + @classmethod + def from_json(cls, data: object) -> ZarrV3ConsolidatedMetadata: + normalized = arrays_to_tuples(data) + problems = validate_consolidated_metadata_v3(normalized) + if problems: + raise MetadataValidationError(problems) + env = cast("Mapping[str, object]", normalized) + entries: dict[str, ZarrV3ArrayMetadata | ZarrV3GroupMetadata] = {} + for key, entry in cast("Mapping[str, object]", env["metadata"]).items(): + node_type = cast("Mapping[str, object]", entry).get("node_type") + if node_type == "array": + entries[key] = ZarrV3ArrayMetadata.from_json(entry) + else: + entries[key] = ZarrV3GroupMetadata.from_json(entry) + return cls(metadata=entries) + + +class ZarrV2GroupMetadataPartial(TypedDict, total=False): + """ + Partial form of the constructor-settable fields of `ZarrV2GroupMetadata`. + + Every key is optional and typed with the model's own value types, so it + describes valid keyword arguments to `ZarrV2GroupMetadata.update` and + `create_default`. The `init=False` field `zarr_format` is intentionally + excluded, since it cannot be passed to `dataclasses.replace`. + + Drift between this type and the model's settable fields is prevented by + `tests/model/test_group.py::test_group_partial_keys_match_settable_model_fields`. + """ + + attributes: dict[str, JSONValue] | UNSET + + +@dataclass(frozen=True, slots=True, kw_only=True) +class ZarrV2GroupMetadata: + """In-memory model of a v2 group metadata document. + + A canonical, lossless representation of the `.zgroup` content plus the + sibling `.zattrs` attributes, folded into a single in-memory value + (mirroring the merged `ZarrV2GroupMetadataJSON` document form). `attributes` is + `UNSET` when no `.zattrs` file (or merged `attributes` key) exists — + distinct from an explicit empty `.zattrs`, which is `{}` and round-trips + as a file. + """ + + zarr_format: Literal[2] = field(default=2, init=False) + attributes: dict[str, JSONValue] | UNSET + + @classmethod + def create_default(cls, **overrides: Unpack[ZarrV2GroupMetadataPartial]) -> ZarrV2GroupMetadata: + """ + Create a default (empty) v2 group metadata model, with optional overrides. + + The default is a structurally-valid group with no attributes — the group + analog of `list()` returning `[]`. Any field can be overridden by keyword + (the same fields accepted by `update`). + """ + default = cls(attributes=UNSET) + return default.update(**overrides) + + def update(self, **kwargs: Unpack[ZarrV2GroupMetadataPartial]) -> ZarrV2GroupMetadata: + """ + Return a new `ZarrV2GroupMetadata` with the given fields updated. + + Only the constructor-settable fields listed in + `ZarrV2GroupMetadataPartial` can be updated; the fixed `zarr_format` + is rejected at the type level. Each given field fully replaces its + previous value. + """ + return dataclasses.replace(self, **kwargs) + + def to_json(self) -> ZarrV2GroupMetadataJSON: + """Return the merged in-memory document form. + + `attributes` is included when set (even empty). This is not the + on-disk `.zgroup` content: a conforming `.zgroup` must exclude + `attributes` (they live in the sibling `.zattrs` file). Use + `to_key_value` to produce the spec-conforming split for storage. + """ + # to_json output shares no mutable state with the model. + out: ZarrV2GroupMetadataJSON = {"zarr_format": self.zarr_format} + if self.attributes is not UNSET: + out["attributes"] = copy.deepcopy(self.attributes) + return out + + @classmethod + def from_json(cls, data: object) -> ZarrV2GroupMetadata: + parsed = parse_group_metadata_v2(arrays_to_tuples(data)) + return cls(attributes=(dict(parsed["attributes"]) if "attributes" in parsed else UNSET)) + + @classmethod + def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV2GroupMetadata: + zgroup_raw = cast("object", load_store_json(mapping, GROUP_METADATA_STORE_KEY_V2)) + if not isinstance(zgroup_raw, Mapping): + return cls.from_json(zgroup_raw) + zgroup = cast("Mapping[str, object]", zgroup_raw) + if "attributes" in zgroup: + raise MetadataValidationError( + [ + ValidationProblem( + ("attributes",), + "unexpected document member", + "invalid_value", + ) + ] + ) + if ATTRIBUTES_STORE_KEY_V2 in mapping: + zattrs = cast("object", load_store_json(mapping, ATTRIBUTES_STORE_KEY_V2)) + return cls.from_json({**zgroup, "attributes": zattrs}) + return cls.from_json(zgroup) + + def to_key_value( + self, *, indent: int | str | None = None + ) -> Mapping[ZarrV2GroupMetadataStoreKey | ZarrV2AttributesStoreKey, bytes]: + # Attributes live only in the sibling `.zattrs` file; the `.zgroup` + # document must exclude them. The `.zattrs` key is present exactly + # when attributes are set (even empty) — UNSET emits no file. + zgroup = {k: v for k, v in self.to_json().items() if k != "attributes"} + out: dict[ZarrV2GroupMetadataStoreKey | ZarrV2AttributesStoreKey, bytes] = { + GROUP_METADATA_STORE_KEY_V2: dump_store_json(zgroup, indent=indent) + } + if self.attributes is not UNSET: + out[ATTRIBUTES_STORE_KEY_V2] = dump_store_json(self.attributes, indent=indent) + return out + + +@dataclass(frozen=True, slots=True, kw_only=True) +class ZarrV2ConsolidatedMetadata: + """In-memory model of a v2 `.zmetadata` document. + + The `metadata` map holds the flat file-keyed entries (`"path/.zarray"`, + `"path/.zattrs"`, ...) verbatim, preserving the normalized JSON tree. + Entries are deliberately NOT merged into per-node models: which nodes had + a `.zattrs` file at all is information the canonical representation must + keep. Interpreting entries into node models is consumer work. + """ + + zarr_consolidated_format: Literal[1] = field(default=1, init=False) + metadata: dict[str, JSONValue] + + def to_json(self) -> dict[str, JSONValue]: + # to_json output shares no mutable state with the model. + return { + "zarr_consolidated_format": self.zarr_consolidated_format, + "metadata": copy.deepcopy(self.metadata), + } + + @classmethod + def from_json(cls, data: object) -> ZarrV2ConsolidatedMetadata: + normalized = arrays_to_tuples(data) + if not isinstance(normalized, Mapping): + raise MetadataValidationError( + [ValidationProblem((), "expected a mapping", "invalid_type")] + ) + doc = cast("Mapping[str, object]", normalized) + problems: list[ValidationProblem] = [ + ValidationProblem((key,), "missing required key", "missing_key") + for key in ("zarr_consolidated_format", "metadata") + if key not in doc + ] + problems.extend( + ValidationProblem((key,), "unexpected document member", "invalid_value") + for key in doc.keys() - {"zarr_consolidated_format", "metadata"} + ) + if "zarr_consolidated_format" in doc and ( + not isinstance(doc["zarr_consolidated_format"], int) + or isinstance(doc["zarr_consolidated_format"], bool) + or doc["zarr_consolidated_format"] != 1 + ): + problems.append( + ValidationProblem( + ("zarr_consolidated_format",), + f"expected 1, got {doc['zarr_consolidated_format']!r}", + "invalid_value", + ) + ) + if "metadata" in doc: + entries = doc["metadata"] + if not isinstance(entries, Mapping) or not all( + isinstance(k, str) for k in cast("Mapping[object, object]", entries) + ): + problems.append( + ValidationProblem( + ("metadata",), "expected a mapping with string keys", "invalid_type" + ) + ) + else: + for key, value in cast("Mapping[str, object]", entries).items(): + problems.extend( + ValidationProblem( + ("metadata", key, *problem.loc), problem.message, problem.kind + ) + for problem in validate_json(value) + ) + if problems: + raise MetadataValidationError(problems) + entries_tupled = cast( + "dict[str, JSONValue]", + arrays_to_tuples(dict(cast("Mapping[str, object]", doc["metadata"]))), + ) + return cls(metadata=entries_tupled) + + @classmethod + def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV2ConsolidatedMetadata: + return cls.from_json(load_store_json(mapping, CONSOLIDATED_METADATA_STORE_KEY_V2)) + + def to_key_value( + self, *, indent: int | str | None = None + ) -> Mapping[ZarrV2ConsolidatedMetadataStoreKey, bytes]: + return {CONSOLIDATED_METADATA_STORE_KEY_V2: dump_store_json(self.to_json(), indent=indent)} diff --git a/packages/zarr-metadata/src/zarr_metadata/model/_sentinel.py b/packages/zarr-metadata/src/zarr_metadata/model/_sentinel.py new file mode 100644 index 0000000000..ad71e216fa --- /dev/null +++ b/packages/zarr-metadata/src/zarr_metadata/model/_sentinel.py @@ -0,0 +1,37 @@ +"""The absence sentinel for optional metadata-document keys. + +The models observe one invariant: `None` in a model always corresponds to a +JSON `null` in the document (a v2 `compressor`/`filters` value, an unnamed +dimension inside `dimension_names`), and `UNSET` always means the document +key is absent. The two are never interchangeable, so a model value can never +leak into a document as a spelling the writer did not intend. + +Check with identity: `if model.dimension_names is UNSET: ...`. + +Because the contract is identity, the sentinel must never be reconstructed +from state: pickling and copying work by *reference* (typing_extensions >= +4.16 implements `Sentinel.__reduce__` as a lookup of the sentinel's name on +its defining module), so `pickle.loads(pickle.dumps(UNSET)) is UNSET` holds +across process boundaries, and models holding `UNSET` pickle and deep-copy +freely. Earlier typing_extensions releases refused to pickle sentinels +outright — hence the `>=4.16` floor in this package's dependencies. + +Checker support (PEP 661 is Final; stdlib `sentinel` arrives in Python +3.15): ty types this spelling exactly, including `is`/`is not` narrowing. +Pyright supports it but a regression (1.1.405+, tracked as +https://github.com/microsoft/pyright/issues/11115) degrades class-attribute +reads to `Unknown`, so this package pins pyright to the last good version +until the fix lands. Mypy support is in review +(https://github.com/python/mypy/pull/21647); until it merges, mypy-checked +consumers of these fields need a `cast` or `type: ignore` at narrowing +sites. This is a deliberate short-term cost: the sentinel is the standard, +and the checkers are converging on it. +""" + +from __future__ import annotations + +from typing_extensions import Sentinel + +UNSET = Sentinel("UNSET") +"""Marks a metadata-document key as absent (PEP 661 sentinel; usable directly +in type expressions, e.g. `tuple[str, ...] | UNSET`). Test with `is UNSET`.""" diff --git a/packages/zarr-metadata/src/zarr_metadata/model/_validation.py b/packages/zarr-metadata/src/zarr_metadata/model/_validation.py new file mode 100644 index 0000000000..a12e1911b1 --- /dev/null +++ b/packages/zarr-metadata/src/zarr_metadata/model/_validation.py @@ -0,0 +1,875 @@ +"""Structural validation for Zarr metadata documents. + +Validators check JSON structure (key presence, value shapes, and fixed +literals like `zarr_format`), not domain validity. Each concept gets a +`validate_*` function returning every problem found, an `is_*` type guard, +and a `parse_*` function that narrows or raises `MetadataValidationError`. + +Every `ValidationProblem` carries a machine-readable `kind` alongside its +human-readable `message`, so consumers can dispatch on the failure mode +(`missing_key`, `invalid_type`, `invalid_value`, `invalid_json`) without +string-matching messages. +""" + +from __future__ import annotations + +import json +import math +from collections.abc import Mapping, Sequence +from dataclasses import dataclass +from typing import Any, Final, Literal, NoReturn, cast + +from typing_extensions import TypeIs + +from zarr_metadata._common import JSONValue +from zarr_metadata.v2.array import ZarrV2ArrayMetadataJSON +from zarr_metadata.v2.group import ZarrV2GroupMetadataJSON +from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON +from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON +from zarr_metadata.v3.group import ZarrV3GroupMetadataJSON + +ProblemKind = Literal["missing_key", "invalid_type", "invalid_value", "invalid_json"] +"""Machine-readable classification of a `ValidationProblem`. + +- `missing_key`: a required key (document key or store key) is absent. +- `invalid_type`: a value has the wrong structural type (e.g. a string where + a mapping is required, a non-JSON-serializable object). +- `invalid_value`: a value has an acceptable type but an invalid content + (e.g. `zarr_format: 2` in a v3 document, `order: "Q"`). +- `invalid_json`: bytes that do not decode as JSON. +""" + + +@dataclass(frozen=True, slots=True) +class ValidationProblem: + """A single structural problem found while validating a metadata document. + + `loc` is the path from the document root to the offending value, e.g. + `("codecs", 0, "name")`. An empty `loc` refers to the document as a whole. + `kind` classifies the failure mode for programmatic dispatch; `message` + is the human-readable description. + """ + + loc: tuple[str | int, ...] + message: str + kind: ProblemKind + + def __str__(self) -> str: + location = ".".join(str(part) for part in self.loc) if self.loc else "" + return f"{location}: {self.message}" + + +class MetadataValidationError(ValueError): + """Raised when a value fails structural metadata validation. + + Carries every problem found (not just the first) in `.problems`. + """ + + def __init__(self, problems: list[ValidationProblem]) -> None: + self.problems = problems + super().__init__("\n".join(str(problem) for problem in problems)) + + +def _prefix(loc_head: str | int, problems: list[ValidationProblem]) -> list[ValidationProblem]: + """Prepend `loc_head` to the `loc` of every problem (for nested validators).""" + return [ValidationProblem((loc_head, *p.loc), p.message, p.kind) for p in problems] + + +def validate_json(value: object) -> list[ValidationProblem]: + """Return every reason `value` is not JSON-serializable (recursively).""" + if isinstance(value, float): + if math.isfinite(value): + return [] + return [ValidationProblem((), f"non-finite float {value!r} is not JSON", "invalid_value")] + if isinstance(value, (str, int, bool)) or value is None: + return [] + problems: list[ValidationProblem] = [] + if isinstance(value, Mapping): + for key, item in cast("Mapping[object, object]", value).items(): + if not isinstance(key, str): + problems.append( + ValidationProblem((), f"non-string key {key!r} in JSON object", "invalid_type") + ) + continue + problems.extend(_prefix(key, validate_json(item))) + return problems + if isinstance(value, Sequence) and not isinstance(value, (bytes, bytearray)): + for index, item in enumerate(cast("Sequence[object]", value)): + problems.extend(_prefix(index, validate_json(item))) + return problems + return [ValidationProblem((), f"not a JSON-serializable value: {value!r}", "invalid_type")] + + +def _is_canonical_json(value: object) -> TypeIs[JSONValue]: + """Whether `value` already uses the concrete containers in `JSONValue`.""" + if isinstance(value, float): + return math.isfinite(value) + if isinstance(value, (str, int, bool)) or value is None: + return True + if isinstance(value, (list, tuple)): + sequence = cast("list[object] | tuple[object, ...]", value) + return all(_is_canonical_json(item) for item in sequence) + if isinstance(value, dict): + mapping = cast("dict[object, object]", value) + return all( + isinstance(key, str) and _is_canonical_json(item) for key, item in mapping.items() + ) + return False + + +def is_json(value: object) -> TypeIs[JSONValue]: + """Whether `value` is a canonical JSON structure (recursively).""" + return _is_canonical_json(value) + + +def parse_json(value: object) -> JSONValue: + """Return a canonical `JSONValue`, or raise `MetadataValidationError`.""" + normalized = arrays_to_tuples(value) + problems = validate_json(normalized) + if problems: + raise MetadataValidationError(problems) + return cast(JSONValue, normalized) + + +# The standard top-level keys of a v3 array metadata document. Anything outside +# this set is an extension field. Built from the TypedDict's required/optional +# key sets (which resolve inherited keys, unlike `__annotations__`). +ARRAY_METADATA_REQUIRED_KEYS_V3: Final[frozenset[str]] = frozenset( + ZarrV3ArrayMetadataJSON.__required_keys__ +) +ARRAY_METADATA_OPTIONAL_KEYS_V3: Final[frozenset[str]] = frozenset( + ZarrV3ArrayMetadataJSON.__optional_keys__ +) +ARRAY_METADATA_STANDARD_KEYS_V3: Final[frozenset[str]] = ( + ARRAY_METADATA_REQUIRED_KEYS_V3 | ARRAY_METADATA_OPTIONAL_KEYS_V3 +) + +ARRAY_METADATA_REQUIRED_KEYS_V2: Final[frozenset[str]] = frozenset( + ZarrV2ArrayMetadataJSON.__required_keys__ +) +ARRAY_METADATA_OPTIONAL_KEYS_V2: Final[frozenset[str]] = frozenset( + ZarrV2ArrayMetadataJSON.__optional_keys__ +) +ARRAY_METADATA_STANDARD_KEYS_V2: Final[frozenset[str]] = ( + ARRAY_METADATA_REQUIRED_KEYS_V2 | ARRAY_METADATA_OPTIONAL_KEYS_V2 +) + +# The standard top-level keys of a v3 group metadata document. Anything outside +# this set is an extension field. +GROUP_METADATA_REQUIRED_KEYS_V3: Final[frozenset[str]] = frozenset( + ZarrV3GroupMetadataJSON.__required_keys__ +) +GROUP_METADATA_OPTIONAL_KEYS_V3: Final[frozenset[str]] = frozenset( + ZarrV3GroupMetadataJSON.__optional_keys__ +) +GROUP_METADATA_STANDARD_KEYS_V3: Final[frozenset[str]] = ( + GROUP_METADATA_REQUIRED_KEYS_V3 | GROUP_METADATA_OPTIONAL_KEYS_V3 +) + +GROUP_METADATA_REQUIRED_KEYS_V2: Final[frozenset[str]] = frozenset( + ZarrV2GroupMetadataJSON.__required_keys__ +) +GROUP_METADATA_OPTIONAL_KEYS_V2: Final[frozenset[str]] = frozenset( + ZarrV2GroupMetadataJSON.__optional_keys__ +) +GROUP_METADATA_STANDARD_KEYS_V2: Final[frozenset[str]] = ( + GROUP_METADATA_REQUIRED_KEYS_V2 | GROUP_METADATA_OPTIONAL_KEYS_V2 +) + + +def _missing_keys(required: frozenset[str], doc: Mapping[str, object]) -> list[ValidationProblem]: + """One `missing_key` problem per required key absent from `doc`.""" + return [ + ValidationProblem((key,), "missing required key", "missing_key") + for key in sorted(required - doc.keys()) + ] + + +def _unexpected_keys( + allowed: frozenset[str], doc: Mapping[object, object] +) -> list[ValidationProblem]: + """One problem per member outside a closed document's declared shape.""" + problems: list[ValidationProblem] = [] + for key in doc: + if not isinstance(key, str): + problems.append( + ValidationProblem((), f"non-string document key {key!r}", "invalid_type") + ) + elif key not in allowed: + problems.append( + ValidationProblem((key,), "unexpected document member", "invalid_value") + ) + return problems + + +def _check_literal( + doc: Mapping[str, object], key: str, expected: object +) -> list[ValidationProblem]: + """One `invalid_value` problem if `doc[key]` is present but not `expected`.""" + if key in doc and (type(doc[key]) is not type(expected) or doc[key] != expected): + return [ + ValidationProblem((key,), f"expected {expected!r}, got {doc[key]!r}", "invalid_value") + ] + return [] + + +def _validate_extension_fields_v3( + doc: Mapping[object, object], + standard_keys: frozenset[str], + *, + additional_reserved_keys: frozenset[str] = frozenset(), +) -> list[ValidationProblem]: + """Validate v3 top-level key types and unknown-field JSON payloads.""" + problems: list[ValidationProblem] = [] + reserved_keys = standard_keys | additional_reserved_keys + for key, value in doc.items(): + if not isinstance(key, str): + problems.append( + ValidationProblem((), f"non-string top-level key {key!r}", "invalid_type") + ) + continue + if key in reserved_keys: + continue + problems.extend(_prefix(key, validate_json(value))) + return problems + + +def validate_metadata_field_v3( + value: object, *, allow_must_understand_false: bool = True +) -> list[ValidationProblem]: + """Return every reason `value` is not a v3 metadata field. + + A metadata field is a bare name string or a mapping containing `name` and + optional `configuration` and `must_understand` members. + """ + if isinstance(value, str): + return [] + if not isinstance(value, Mapping): + return [ + ValidationProblem( + (), + "expected a metadata field (string or extension object)", + "invalid_type", + ) + ] + field = cast("Mapping[object, object]", value) + problems: list[ValidationProblem] = [] + allowed_keys = frozenset({"name", "configuration", "must_understand"}) + for key in field: + if not isinstance(key, str): + problems.append( + ValidationProblem((), f"non-string metadata field key {key!r}", "invalid_type") + ) + elif key not in allowed_keys: + problems.append( + ValidationProblem((key,), "unexpected metadata field member", "invalid_value") + ) + if not isinstance(field.get("name"), str): + problems.append(ValidationProblem(("name",), "expected a string name", "invalid_type")) + if "configuration" in field: + configuration = field["configuration"] + if not isinstance(configuration, Mapping): + problems.append( + ValidationProblem(("configuration",), "expected a mapping", "invalid_type") + ) + elif not all(isinstance(k, str) for k in cast("Mapping[object, object]", configuration)): + problems.append( + ValidationProblem(("configuration",), "expected string keys", "invalid_type") + ) + else: + for key, item in cast("Mapping[str, object]", configuration).items(): + problems.extend(_prefix("configuration", _prefix(key, validate_json(item)))) + if "must_understand" in field: + must_understand = field["must_understand"] + if not isinstance(must_understand, bool): + problems.append( + ValidationProblem(("must_understand",), "expected a boolean", "invalid_type") + ) + elif not allow_must_understand_false and not must_understand: + problems.append( + ValidationProblem( + ("must_understand",), + "false is not supported at this extension point", + "invalid_value", + ) + ) + return problems + + +def is_metadata_field_v3(value: object) -> TypeIs[ZarrV3MetadataFieldJSON]: + """Whether `value` is a v3 metadata field: a bare name or a named config.""" + if isinstance(value, str): + return True + if not isinstance(value, dict): + return False + field = cast("dict[object, object]", value) + return _is_canonical_json(field) and not validate_metadata_field_v3(field) + + +def parse_metadata_field_v3(value: object) -> ZarrV3MetadataFieldJSON: + """Return `value` narrowed to `ZarrV3MetadataFieldJSON`, or raise `MetadataValidationError`.""" + normalized = arrays_to_tuples(value) + problems = validate_metadata_field_v3(normalized) + if problems: + raise MetadataValidationError(problems) + return cast(ZarrV3MetadataFieldJSON, normalized) + + +def _is_int_sequence(value: object) -> bool: + """Whether `value` is a non-string sequence of integers. + + JSON booleans decode to `bool`, which is an `int` subclass in Python but + is not an integer in a metadata document, so booleans are excluded. + """ + return ( + not isinstance(value, (str, bytes, bytearray)) + and isinstance(value, Sequence) + and all( + isinstance(item, int) and not isinstance(item, bool) + for item in cast("Sequence[object]", value) + ) + ) + + +def _validate_dim_sequence(doc: Mapping[str, object], key: str) -> list[ValidationProblem]: + """Validate a dimension sequence (`shape` / `chunks`) if present in `doc`. + + Dimension lengths are non-negative integers. + """ + if key not in doc: + return [] + value = doc[key] + if not _is_int_sequence(value): + return [ValidationProblem((key,), "expected a sequence of int", "invalid_type")] + if any(item < 0 for item in cast("Sequence[int]", value)): + return [ValidationProblem((key,), "expected non-negative integers", "invalid_value")] + return [] + + +def _is_dtype_v2(value: object) -> bool: + """Whether `value` is shaped like a v2 dtype: a string or field records. + + A field record is a `(name, dtype)` or `(name, dtype, shape)` sequence, + where `dtype` is itself a string or nested field records and `shape` is a + sequence of int. The string content is NOT interpreted — whether the + string names a real dtype is domain validity, not structure. + """ + if isinstance(value, str): + return True + if not isinstance(value, Sequence): + return False + for record in cast("Sequence[object]", value): + if isinstance(record, str) or not isinstance(record, Sequence): + return False + fields = cast("Sequence[object]", record) + if len(fields) not in (2, 3): + return False + if not isinstance(fields[0], str): + return False + if not _is_dtype_v2(fields[1]): + return False + if len(fields) == 3 and not _is_int_sequence(fields[2]): + return False + return True + + +def _is_canonical_dtype_v2(value: object) -> bool: + """Whether a validated v2 dtype uses the tuple-backed public representation.""" + if isinstance(value, str): + return True + if not isinstance(value, tuple): + return False + for record in cast("tuple[object, ...]", value): + if not isinstance(record, tuple): + return False + fields = cast("tuple[object, ...]", record) + if not _is_canonical_dtype_v2(fields[1]): + return False + if len(fields) == 3 and not isinstance(fields[2], tuple): + return False + return True + + +def _is_canonical_metadata_field_v3(value: object) -> bool: + """Whether a validated v3 metadata field has its declared runtime container type.""" + return isinstance(value, (str, dict)) + + +def _is_canonical_array_metadata_v3(value: object) -> bool: + """Whether a validated v3 array document matches `ZarrV3ArrayMetadataJSON` at runtime.""" + if not isinstance(value, dict): + return False + doc = cast("dict[str, object]", value) + if not isinstance(doc["shape"], tuple) or not isinstance(doc["codecs"], tuple): + return False + if "storage_transformers" in doc and not isinstance(doc["storage_transformers"], tuple): + return False + if "dimension_names" in doc and not isinstance(doc["dimension_names"], tuple): + return False + if not all( + _is_canonical_metadata_field_v3(doc[key]) + for key in ("data_type", "chunk_grid", "chunk_key_encoding") + ): + return False + if not all( + _is_canonical_metadata_field_v3(item) for item in cast("tuple[object, ...]", doc["codecs"]) + ): + return False + return "storage_transformers" not in doc or all( + _is_canonical_metadata_field_v3(item) + for item in cast("tuple[object, ...]", doc["storage_transformers"]) + ) + + +def _is_canonical_array_metadata_v2(value: object) -> bool: + """Whether a validated v2 array document matches `ZarrV2ArrayMetadataJSON` at runtime.""" + if not isinstance(value, dict): + return False + doc = cast("dict[str, object]", value) + if not isinstance(doc["shape"], tuple) or not isinstance(doc["chunks"], tuple): + return False + if not _is_canonical_dtype_v2(doc["dtype"]): + return False + compressor = doc["compressor"] + if compressor is not None and not isinstance(compressor, dict): + return False + filters = doc["filters"] + return filters is None or ( + isinstance(filters, tuple) + and all(isinstance(item, dict) for item in cast("tuple[object, ...]", filters)) + ) + + +def _is_codec_v2(value: object) -> bool: + """Whether `value` is shaped like a v2 codec config: a mapping with a string `id`.""" + return isinstance(value, Mapping) and isinstance( + cast("Mapping[object, object]", value).get("id"), str + ) + + +def _validate_codec_v2(value: object) -> list[ValidationProblem]: + """Validate a v2 codec's required shape and JSON-valued configuration.""" + if not _is_codec_v2(value): + return [ + ValidationProblem( + (), "expected a codec configuration with a string 'id'", "invalid_type" + ) + ] + return validate_json(value) + + +def _validate_attributes(value: object) -> list[ValidationProblem]: + """Validate an `attributes` value: a mapping with string keys. + + Returns a problem at `("attributes",)` if it is not, else `[]`. Shared by the + v2 and v3 validators. Unlike the other `validate_*` functions (which + return value-relative locs for the caller to `_prefix`), this emits the + already-parent-relative `("attributes",)` loc, since it is only ever called + with a document's `attributes` value. + """ + if not isinstance(value, Mapping) or not all( + isinstance(k, str) for k in cast("Mapping[object, object]", value) + ): + return [ + ValidationProblem( + ("attributes",), "expected a mapping with string keys", "invalid_type" + ) + ] + problems: list[ValidationProblem] = [] + for key, item in cast("Mapping[str, object]", value).items(): + problems.extend(_prefix("attributes", _prefix(key, validate_json(item)))) + return problems + + +def validate_array_metadata_v3(value: object) -> list[ValidationProblem]: + """Return every reason `value` is not a structurally-valid v3 array doc. + + Checks structure, not domain validity. Unknown top-level keys are allowed + (they map to `extra_fields`). + """ + if not isinstance(value, Mapping): + return [ValidationProblem((), "expected a mapping", "invalid_type")] + doc = cast("Mapping[str, object]", value) + problems: list[ValidationProblem] = _missing_keys(ARRAY_METADATA_REQUIRED_KEYS_V3, doc) + problems.extend( + _validate_extension_fields_v3( + cast("Mapping[object, object]", value), ARRAY_METADATA_STANDARD_KEYS_V3 + ) + ) + problems.extend(_check_literal(doc, "zarr_format", 3)) + problems.extend(_check_literal(doc, "node_type", "array")) + problems.extend(_validate_dim_sequence(doc, "shape")) + if "fill_value" in doc: + problems.extend(_prefix("fill_value", validate_json(doc["fill_value"]))) + for key in ("data_type", "chunk_grid", "chunk_key_encoding"): + if key in doc: + problems.extend( + _prefix( + key, + validate_metadata_field_v3(doc[key], allow_must_understand_false=False), + ) + ) + for key in ("codecs", "storage_transformers"): + if key in doc: + entries = doc[key] + if isinstance(entries, str) or not isinstance(entries, Sequence): + problems.append(ValidationProblem((key,), "expected a sequence", "invalid_type")) + else: + if key == "codecs" and len(cast("Sequence[object]", entries)) == 0: + problems.append( + ValidationProblem( + ("codecs",), "expected at least one codec", "invalid_value" + ) + ) + for index, entry in enumerate(cast("Sequence[object]", entries)): + problems.extend(_prefix(key, _prefix(index, validate_metadata_field_v3(entry)))) + if "attributes" in doc: + problems.extend(_validate_attributes(doc["attributes"])) + if "dimension_names" in doc: + # Simple typed sequences (dimension_names, shape, chunks) report a single + # field-level loc, not per-bad-item locs; per-index locs are reserved for + # the metadata-field lists (codecs, storage_transformers). + names = doc["dimension_names"] + if isinstance(names, str) or not isinstance(names, Sequence): + problems.append( + ValidationProblem(("dimension_names",), "expected a sequence", "invalid_type") + ) + elif not all( + item is None or isinstance(item, str) for item in cast("Sequence[object]", names) + ): + problems.append( + ValidationProblem( + ("dimension_names",), "expected items of str or None", "invalid_type" + ) + ) + elif _is_int_sequence(doc.get("shape")) and len(cast("Sequence[object]", names)) != len( + cast("Sequence[int]", doc["shape"]) + ): + problems.append( + ValidationProblem( + ("dimension_names",), + "expected one name per dimension of shape", + "invalid_value", + ) + ) + return problems + + +def is_array_metadata_v3(value: object) -> TypeIs[ZarrV3ArrayMetadataJSON]: + """Whether `value` is a structurally-valid v3 array metadata document.""" + return ( + _is_canonical_json(value) + and not validate_array_metadata_v3(value) + and _is_canonical_array_metadata_v3(value) + ) + + +def parse_array_metadata_v3(value: object) -> ZarrV3ArrayMetadataJSON: + """Return `value` as `ZarrV3ArrayMetadataJSON`, or raise `MetadataValidationError`.""" + normalized = arrays_to_tuples(value) + problems = validate_array_metadata_v3(normalized) + if problems: + raise MetadataValidationError(problems) + return cast("ZarrV3ArrayMetadataJSON", normalized) + + +def validate_array_metadata_v2(value: object) -> list[ValidationProblem]: + """Return every reason `value` is not a structurally-valid v2 array doc. + + Checks structure, not domain validity: `dtype` must be a string or field + records, but the string content is not interpreted; `compressor` and + `filters` are required keys that may be `None`, and otherwise must be + codec configurations (mappings with a string `id`). + """ + if not isinstance(value, Mapping): + return [ValidationProblem((), "expected a mapping", "invalid_type")] + doc = cast("Mapping[str, object]", value) + problems: list[ValidationProblem] = _missing_keys(ARRAY_METADATA_REQUIRED_KEYS_V2, doc) + problems.extend( + _unexpected_keys(ARRAY_METADATA_STANDARD_KEYS_V2, cast("Mapping[object, object]", value)) + ) + problems.extend(_check_literal(doc, "zarr_format", 2)) + shape_problems = _validate_dim_sequence(doc, "shape") + chunks_problems = _validate_dim_sequence(doc, "chunks") + problems.extend(shape_problems) + problems.extend(chunks_problems) + if ( + not shape_problems + and not chunks_problems + and _is_int_sequence(doc.get("shape")) + and _is_int_sequence(doc.get("chunks")) + ): + shape = cast("Sequence[int]", doc["shape"]) + chunks = cast("Sequence[int]", doc["chunks"]) + if len(shape) != len(chunks): + problems.append( + ValidationProblem( + ("chunks",), + "expected the same number of dimensions as shape", + "invalid_value", + ) + ) + if "dtype" in doc and not _is_dtype_v2(doc["dtype"]): + problems.append( + ValidationProblem( + ("dtype",), + "expected a v2 dtype string or a sequence of field records", + "invalid_type", + ) + ) + if "order" in doc and doc["order"] not in ("C", "F"): + problems.append( + ValidationProblem( + ("order",), f"expected 'C' or 'F', got {doc['order']!r}", "invalid_value" + ) + ) + if "compressor" in doc: + compressor = doc["compressor"] + if compressor is not None: + problems.extend(_prefix("compressor", _validate_codec_v2(compressor))) + if "filters" in doc: + filters = doc["filters"] + if filters is not None and ( + isinstance(filters, str) + or not isinstance(filters, Sequence) + or not all(_is_codec_v2(item) for item in cast("Sequence[object]", filters)) + ): + problems.append( + ValidationProblem( + ("filters",), + "expected null or a sequence of codec configurations with string 'id's", + "invalid_type", + ) + ) + elif filters is not None: + if len(cast("Sequence[object]", filters)) == 0: + problems.append( + ValidationProblem(("filters",), "expected at least one filter", "invalid_value") + ) + for index, item in enumerate(cast("Sequence[object]", filters)): + problems.extend(_prefix("filters", _prefix(index, validate_json(item)))) + if "dimension_separator" in doc and doc["dimension_separator"] not in (".", "/"): + problems.append( + ValidationProblem( + ("dimension_separator",), + f"expected '.' or '/', got {doc['dimension_separator']!r}", + "invalid_value", + ) + ) + if "fill_value" in doc: + problems.extend(_prefix("fill_value", validate_json(doc["fill_value"]))) + if "attributes" in doc: + problems.extend(_validate_attributes(doc["attributes"])) + return problems + + +def is_array_metadata_v2(value: object) -> TypeIs[ZarrV2ArrayMetadataJSON]: + """Whether `value` is a structurally-valid v2 array metadata document.""" + return ( + _is_canonical_json(value) + and not validate_array_metadata_v2(value) + and _is_canonical_array_metadata_v2(value) + ) + + +def parse_array_metadata_v2(value: object) -> ZarrV2ArrayMetadataJSON: + """Return `value` as `ZarrV2ArrayMetadataJSON`, or raise `MetadataValidationError`.""" + normalized = arrays_to_tuples(value) + problems = validate_array_metadata_v2(normalized) + if problems: + raise MetadataValidationError(problems) + return cast("ZarrV2ArrayMetadataJSON", normalized) + + +def validate_consolidated_metadata_v3(value: object) -> list[ValidationProblem]: + """Return every reason `value` is not a valid inline consolidated envelope. + + Locs are value-relative (the caller prefixes with `consolidated_metadata` + where appropriate). Entries recurse into the array and group document + validators, so a validator verdict always agrees with what + `ZarrV3ConsolidatedMetadata.from_json` accepts. + """ + if not isinstance(value, Mapping): + return [ValidationProblem((), "expected a mapping", "invalid_type")] + env = cast("Mapping[str, object]", value) + problems: list[ValidationProblem] = [ + ValidationProblem((key,), "missing required key", "missing_key") + for key in ("kind", "must_understand", "metadata") + if key not in env + ] + problems.extend( + _unexpected_keys( + frozenset({"kind", "must_understand", "metadata"}), + cast("Mapping[object, object]", value), + ) + ) + problems.extend(_check_literal(env, "kind", "inline")) + if "must_understand" in env and env["must_understand"] is not False: + problems.append(ValidationProblem(("must_understand",), "expected False", "invalid_value")) + if "metadata" in env: + entries = env["metadata"] + if not isinstance(entries, Mapping): + problems.append(ValidationProblem(("metadata",), "expected a mapping", "invalid_type")) + else: + for key, entry in cast("Mapping[object, object]", entries).items(): + if not isinstance(key, str): + problems.append( + ValidationProblem(("metadata",), f"non-string key {key!r}", "invalid_type") + ) + continue + entry_obj: object = entry + node_type: object = None + if isinstance(entry, Mapping): + node_type = cast("Mapping[str, object]", entry).get("node_type") + if node_type == "array": + problems.extend( + _prefix("metadata", _prefix(key, validate_array_metadata_v3(entry_obj))) + ) + elif node_type == "group": + problems.extend( + _prefix("metadata", _prefix(key, validate_group_metadata_v3(entry_obj))) + ) + else: + problems.append( + ValidationProblem( + ("metadata", key, "node_type"), + "expected 'array' or 'group'", + "invalid_value", + ) + ) + return problems + + +def validate_group_metadata_v3(value: object) -> list[ValidationProblem]: + """Return every reason `value` is not a structurally-valid v3 group doc. + + Checks structure, not domain validity. Unknown top-level keys are allowed + (they map to `extra_fields`); a `consolidated_metadata` key, if present, + is deep-validated (envelope and entries) via + `validate_consolidated_metadata_v3`. + """ + if not isinstance(value, Mapping): + return [ValidationProblem((), "expected a mapping", "invalid_type")] + doc = cast("Mapping[str, object]", value) + problems: list[ValidationProblem] = _missing_keys(GROUP_METADATA_REQUIRED_KEYS_V3, doc) + problems.extend( + _validate_extension_fields_v3( + cast("Mapping[object, object]", value), + GROUP_METADATA_STANDARD_KEYS_V3, + additional_reserved_keys=frozenset({"consolidated_metadata"}), + ) + ) + problems.extend(_check_literal(doc, "zarr_format", 3)) + problems.extend(_check_literal(doc, "node_type", "group")) + if "attributes" in doc: + problems.extend(_validate_attributes(doc["attributes"])) + if "consolidated_metadata" in doc and doc["consolidated_metadata"] is not None: + # consolidated_metadata: null (a historical zarr-python bug) is + # structurally accepted so those stores remain readable, but the model + # repairs it to absence on read and never writes it back. + problems.extend( + _prefix( + "consolidated_metadata", + validate_consolidated_metadata_v3(doc["consolidated_metadata"]), + ) + ) + return problems + + +def is_group_metadata_v3(value: object) -> TypeIs[ZarrV3GroupMetadataJSON]: + """Whether `value` is a structurally-valid v3 group metadata document.""" + return _is_canonical_json(value) and not validate_group_metadata_v3(value) + + +def parse_group_metadata_v3(value: object) -> ZarrV3GroupMetadataJSON: + """Return `value` narrowed to `ZarrV3GroupMetadataJSON`, or raise `MetadataValidationError`.""" + normalized = arrays_to_tuples(value) + problems = validate_group_metadata_v3(normalized) + if problems: + raise MetadataValidationError(problems) + return cast(ZarrV3GroupMetadataJSON, normalized) + + +def validate_group_metadata_v2(value: object) -> list[ValidationProblem]: + """Return every reason `value` is not a structurally-valid v2 group doc. + + Validates the in-memory merged form: the `.zgroup` fields plus an + optional `attributes` mapping folded in from `.zattrs`. + """ + if not isinstance(value, Mapping): + return [ValidationProblem((), "expected a mapping", "invalid_type")] + doc = cast("Mapping[str, object]", value) + problems: list[ValidationProblem] = _missing_keys(GROUP_METADATA_REQUIRED_KEYS_V2, doc) + problems.extend( + _unexpected_keys(GROUP_METADATA_STANDARD_KEYS_V2, cast("Mapping[object, object]", value)) + ) + problems.extend(_check_literal(doc, "zarr_format", 2)) + if "attributes" in doc: + problems.extend(_validate_attributes(doc["attributes"])) + return problems + + +def is_group_metadata_v2(value: object) -> TypeIs[ZarrV2GroupMetadataJSON]: + """Whether `value` is a structurally-valid v2 group metadata document.""" + return _is_canonical_json(value) and not validate_group_metadata_v2(value) + + +def parse_group_metadata_v2(value: object) -> ZarrV2GroupMetadataJSON: + """Return `value` narrowed to `ZarrV2GroupMetadataJSON`, or raise `MetadataValidationError`.""" + normalized = arrays_to_tuples(value) + problems = validate_group_metadata_v2(normalized) + if problems: + raise MetadataValidationError(problems) + return cast(ZarrV2GroupMetadataJSON, normalized) + + +def _reject_json_constant(constant: str) -> NoReturn: + """Reject the JavaScript constants accepted by Python's JSON decoder.""" + raise ValueError(f"non-standard JSON constant {constant!r}") + + +def load_store_json(mapping: Mapping[str, bytes], key: str) -> Any: + """Decode the JSON document stored at `key` in `mapping`. + + Every ingestion failure surfaces as `MetadataValidationError`: a missing + store key is a `missing_key` problem and undecodable bytes are an + `invalid_json` problem, rather than leaking `KeyError` / + `json.JSONDecodeError` to callers. + """ + if key not in mapping: + raise MetadataValidationError( + [ValidationProblem((key,), "missing store key", "missing_key")] + ) + try: + return json.loads(mapping[key], parse_constant=_reject_json_constant) + except (UnicodeDecodeError, ValueError) as exc: + raise MetadataValidationError( + [ValidationProblem((key,), f"invalid JSON: {exc}", "invalid_json")] + ) from exc + + +def dump_store_json(value: object, *, indent: int | str | None = None) -> bytes: + """Encode a metadata document as strict RFC 8259 JSON bytes.""" + return json.dumps(value, indent=indent, allow_nan=False).encode("utf-8") + + +def arrays_to_tuples(obj: object) -> object: + """Recursively materialize mappings and convert array-like values to tuples.""" + if isinstance(obj, Sequence) and not isinstance(obj, (str, bytes, bytearray)): + sequence = cast("Sequence[object]", obj) + converted_sequence = tuple(arrays_to_tuples(item) for item in sequence) + if isinstance(obj, tuple) and all( + converted is original + for converted, original in zip(converted_sequence, sequence, strict=True) + ): + return cast("tuple[object, ...]", obj) + return converted_sequence + if isinstance(obj, Mapping): + mapping = cast("Mapping[object, object]", obj) + converted: dict[object, object] = { + key: arrays_to_tuples(value) for key, value in mapping.items() + } + if isinstance(obj, dict) and all(converted[key] is value for key, value in mapping.items()): + return cast("object", obj) + return converted + return obj diff --git a/packages/zarr-metadata/src/zarr_metadata/pydantic.py b/packages/zarr-metadata/src/zarr_metadata/pydantic.py new file mode 100644 index 0000000000..8584efa570 --- /dev/null +++ b/packages/zarr-metadata/src/zarr_metadata/pydantic.py @@ -0,0 +1,176 @@ +"""Optional pydantic (v2) integration: field types over the core models. + +Importing this module requires pydantic; the core package deliberately does +not depend on it, so this module is never imported by `zarr_metadata` itself. + +Each exported name is an `Annotated` field type over the corresponding core +model class — the instances ARE the core classes, so values interoperate +freely with non-pydantic code (equality, isinstance, nesting). Validation +delegates to the library: a raw document routes through `from_json` (the +single source of truth for structural validation and normalization, so +pydantic's field-level coercion can never bypass it), an existing model +instance passes through unchanged, and serialization emits the canonical +document via `to_json`. `MetadataValidationError` subclasses `ValueError`, +so a failed parse surfaces as a pydantic `ValidationError` carrying the +loc-annotated problem messages. + +Usage: + + import zarr_metadata.pydantic as zmp + + class ArrayManifest(BaseModel): + path: str + metadata: zmp.ZarrV3ArrayMetadata + +Static type checkers see each field type as its core model class, so +`manifest.metadata` is a `zarr_metadata.model.ZarrV3ArrayMetadata`. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Annotated, TypeVar + +from pydantic import BeforeValidator, InstanceOf, PlainSerializer + +from zarr_metadata import model as _model +from zarr_metadata._pydantic_schema import ( + ZarrV2ArrayMetadataJSON as _ZarrV2ArrayMetadataSchema, +) +from zarr_metadata._pydantic_schema import ( + ZarrV2ConsolidatedMetadataJSON as _ZarrV2ConsolidatedMetadataSchema, +) +from zarr_metadata._pydantic_schema import ( + ZarrV2GroupMetadataJSON as _ZarrV2GroupMetadataSchema, +) +from zarr_metadata._pydantic_schema import ( + ZarrV3ArrayMetadataJSON as _ZarrV3ArrayMetadataSchema, +) +from zarr_metadata._pydantic_schema import ( + ZarrV3ConsolidatedMetadataJSON as _ZarrV3ConsolidatedMetadataSchema, +) +from zarr_metadata._pydantic_schema import ( + ZarrV3GroupMetadataJSON as _ZarrV3GroupMetadataSchema, +) +from zarr_metadata._pydantic_schema import ( + ZarrV3MetadataFieldJSON as _ZarrV3MetadataFieldSchema, +) +from zarr_metadata.v2.array import ZarrV2ArrayMetadataJSON as _ZarrV2ArrayMetadataJSON +from zarr_metadata.v2.consolidated import ( + ZarrV2ConsolidatedMetadataJSON as _ZarrV2ConsolidatedMetadataJSON, +) +from zarr_metadata.v2.group import ZarrV2GroupMetadataJSON as _ZarrV2GroupMetadataJSON +from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON as _ZarrV3MetadataFieldJSON +from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON as _ZarrV3ArrayMetadataJSON +from zarr_metadata.v3.consolidated import ( + ZarrV3ConsolidatedMetadataJSON as _ZarrV3ConsolidatedMetadataJSON, +) +from zarr_metadata.v3.group import ZarrV3GroupMetadataJSON as _ZarrV3GroupMetadataJSON + +if TYPE_CHECKING: + from collections.abc import Callable + +_M = TypeVar("_M") + + +def _coerce_to(cls: type[_M], parse: Callable[[object], _M]) -> Callable[[object], _M]: + """A validator that passes instances of `cls` through and parses anything else.""" + + def coerce(value: object) -> _M: + if isinstance(value, cls): + return value + return parse(value) + + return coerce + + +ZarrV3ArrayMetadata = Annotated[ + InstanceOf[_model.ZarrV3ArrayMetadata], + BeforeValidator( + _coerce_to(_model.ZarrV3ArrayMetadata, _model.ZarrV3ArrayMetadata.from_json), + json_schema_input_type=_ZarrV3ArrayMetadataSchema, + ), + PlainSerializer(_model.ZarrV3ArrayMetadata.to_json, return_type=_ZarrV3ArrayMetadataJSON), +] +"""Field type for a v3 array metadata document (`zarr.json` content).""" + +ZarrV2ArrayMetadata = Annotated[ + InstanceOf[_model.ZarrV2ArrayMetadata], + BeforeValidator( + _coerce_to(_model.ZarrV2ArrayMetadata, _model.ZarrV2ArrayMetadata.from_json), + json_schema_input_type=_ZarrV2ArrayMetadataSchema, + ), + PlainSerializer(_model.ZarrV2ArrayMetadata.to_json, return_type=_ZarrV2ArrayMetadataJSON), +] +"""Field type for a v2 array metadata document (merged `.zarray` + `.zattrs` form).""" + +ZarrV3GroupMetadata = Annotated[ + InstanceOf[_model.ZarrV3GroupMetadata], + BeforeValidator( + _coerce_to(_model.ZarrV3GroupMetadata, _model.ZarrV3GroupMetadata.from_json), + json_schema_input_type=_ZarrV3GroupMetadataSchema, + ), + PlainSerializer(_model.ZarrV3GroupMetadata.to_json, return_type=_ZarrV3GroupMetadataJSON), +] +"""Field type for a v3 group metadata document (`zarr.json` content).""" + +ZarrV2GroupMetadata = Annotated[ + InstanceOf[_model.ZarrV2GroupMetadata], + BeforeValidator( + _coerce_to(_model.ZarrV2GroupMetadata, _model.ZarrV2GroupMetadata.from_json), + json_schema_input_type=_ZarrV2GroupMetadataSchema, + ), + PlainSerializer(_model.ZarrV2GroupMetadata.to_json, return_type=_ZarrV2GroupMetadataJSON), +] +"""Field type for a v2 group metadata document (merged `.zgroup` + `.zattrs` form).""" + +ZarrV3ConsolidatedMetadata = Annotated[ + InstanceOf[_model.ZarrV3ConsolidatedMetadata], + BeforeValidator( + _coerce_to( + _model.ZarrV3ConsolidatedMetadata, + _model.ZarrV3ConsolidatedMetadata.from_json, + ), + json_schema_input_type=_ZarrV3ConsolidatedMetadataSchema, + ), + PlainSerializer( + _model.ZarrV3ConsolidatedMetadata.to_json, + return_type=_ZarrV3ConsolidatedMetadataJSON, + ), +] +"""Field type for v3 inline consolidated metadata.""" + +ZarrV2ConsolidatedMetadata = Annotated[ + InstanceOf[_model.ZarrV2ConsolidatedMetadata], + BeforeValidator( + _coerce_to( + _model.ZarrV2ConsolidatedMetadata, + _model.ZarrV2ConsolidatedMetadata.from_json, + ), + json_schema_input_type=_ZarrV2ConsolidatedMetadataSchema, + ), + PlainSerializer( + _model.ZarrV2ConsolidatedMetadata.to_json, + return_type=_ZarrV2ConsolidatedMetadataJSON, + ), +] +"""Field type for a v2 `.zmetadata` document.""" + +ZarrV3MetadataField = Annotated[ + InstanceOf[_model.ZarrV3NamedConfig], + BeforeValidator( + _coerce_to(_model.ZarrV3NamedConfig, _model.ZarrV3NamedConfig.from_json), + json_schema_input_type=_ZarrV3MetadataFieldSchema, + ), + PlainSerializer(_model.ZarrV3NamedConfig.to_json, return_type=_ZarrV3MetadataFieldJSON), +] +"""Field type for one normalized v3 metadata extension envelope.""" + +__all__ = [ + "ZarrV2ArrayMetadata", + "ZarrV2ConsolidatedMetadata", + "ZarrV2GroupMetadata", + "ZarrV3ArrayMetadata", + "ZarrV3ConsolidatedMetadata", + "ZarrV3GroupMetadata", + "ZarrV3MetadataField", +] diff --git a/packages/zarr-metadata/src/zarr_metadata/v2/__init__.py b/packages/zarr-metadata/src/zarr_metadata/v2/__init__.py index 4e9a76125b..b9001d168e 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v2/__init__.py +++ b/packages/zarr-metadata/src/zarr_metadata/v2/__init__.py @@ -1,26 +1,26 @@ """Zarr v2 metadata types.""" from zarr_metadata.v2.array import ( - ArrayDimensionSeparatorV2, - ArrayMetadataV2, - ArrayOrderV2, - DataTypeMetadataV2, - ZArrayMetadata, + ZarrV2ArrayDimensionSeparator, + ZarrV2ArrayMetadataJSON, + ZarrV2ArrayOrder, + ZarrV2DataTypeMetadata, + ZarrV2ZArrayJSON, ) -from zarr_metadata.v2.attributes import ZAttrsMetadata -from zarr_metadata.v2.codec import CodecMetadataV2 -from zarr_metadata.v2.consolidated import ConsolidatedMetadataV2 -from zarr_metadata.v2.group import GroupMetadataV2, ZGroupMetadata +from zarr_metadata.v2.attributes import ZarrV2ZAttrsJSON +from zarr_metadata.v2.codec import ZarrV2CodecMetadata +from zarr_metadata.v2.consolidated import ZarrV2ConsolidatedMetadataJSON +from zarr_metadata.v2.group import ZarrV2GroupMetadataJSON, ZarrV2ZGroupJSON __all__ = [ - "ArrayDimensionSeparatorV2", - "ArrayMetadataV2", - "ArrayOrderV2", - "CodecMetadataV2", - "ConsolidatedMetadataV2", - "DataTypeMetadataV2", - "GroupMetadataV2", - "ZArrayMetadata", - "ZAttrsMetadata", - "ZGroupMetadata", + "ZarrV2ArrayDimensionSeparator", + "ZarrV2ArrayMetadataJSON", + "ZarrV2ArrayOrder", + "ZarrV2CodecMetadata", + "ZarrV2ConsolidatedMetadataJSON", + "ZarrV2DataTypeMetadata", + "ZarrV2GroupMetadataJSON", + "ZarrV2ZArrayJSON", + "ZarrV2ZAttrsJSON", + "ZarrV2ZGroupJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v2/array.py b/packages/zarr-metadata/src/zarr_metadata/v2/array.py index 999c341dc7..84b6446bcb 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v2/array.py +++ b/packages/zarr-metadata/src/zarr_metadata/v2/array.py @@ -3,18 +3,27 @@ from collections.abc import Mapping from typing import Final, Literal, NotRequired -from typing_extensions import TypedDict +from typing_extensions import TypeAliasType, TypedDict from zarr_metadata._common import JSONValue -from zarr_metadata.v2.codec import CodecMetadataV2 - -DataTypeMetadataV2 = str | tuple[tuple[str, str] | tuple[str, str, tuple[int, ...]], ...] +from zarr_metadata.v2.codec import ZarrV2CodecMetadata + +ZarrV2DataTypeMetadata = TypeAliasType( + "ZarrV2DataTypeMetadata", + str + | tuple[ + tuple[str, "ZarrV2DataTypeMetadata"] + | tuple[str, "ZarrV2DataTypeMetadata", tuple[int, ...]], + ..., + ], +) """The v2 dtype representation. Either a numpy-style dtype string (e.g. `"/.zarray` for a v2 array. User attributes live in a sibling `.zattrs` file and are - NOT part of this type; see `ZAttrsMetadata`. + NOT part of this type; see `ZarrV2ZAttrsJSON`. See https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html """ @@ -60,15 +69,15 @@ class ZArrayMetadata(TypedDict): zarr_format: Literal[2] shape: tuple[int, ...] chunks: tuple[int, ...] - dtype: DataTypeMetadataV2 - compressor: CodecMetadataV2 | None + dtype: ZarrV2DataTypeMetadata + compressor: ZarrV2CodecMetadata | None fill_value: JSONValue - order: ArrayOrderV2 - filters: tuple[CodecMetadataV2, ...] | None - dimension_separator: NotRequired[ArrayDimensionSeparatorV2] + order: ZarrV2ArrayOrder + filters: tuple[ZarrV2CodecMetadata, ...] | None + dimension_separator: NotRequired[ZarrV2ArrayDimensionSeparator] -class ArrayMetadataV2(TypedDict): +class ZarrV2ArrayMetadataJSON(TypedDict): """ Zarr v2 array metadata document, in-memory merged form. @@ -78,7 +87,7 @@ class ArrayMetadataV2(TypedDict): `attributes` field so a single TypedDict represents the complete in-memory state of a v2 array node. Consumers that read or write a real `.zarray` file should split / merge `attributes` accordingly, - or use `ZArrayMetadata` (strict on-disk) plus `ZAttrsMetadata` directly. + or use `ZarrV2ZArrayJSON` (strict on-disk) plus `ZarrV2ZAttrsJSON` directly. See https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html """ @@ -86,12 +95,12 @@ class ArrayMetadataV2(TypedDict): zarr_format: Literal[2] shape: tuple[int, ...] chunks: tuple[int, ...] - dtype: DataTypeMetadataV2 - compressor: CodecMetadataV2 | None + dtype: ZarrV2DataTypeMetadata + compressor: ZarrV2CodecMetadata | None fill_value: JSONValue - order: ArrayOrderV2 - filters: tuple[CodecMetadataV2, ...] | None - dimension_separator: NotRequired[ArrayDimensionSeparatorV2] + order: ZarrV2ArrayOrder + filters: tuple[ZarrV2CodecMetadata, ...] | None + dimension_separator: NotRequired[ZarrV2ArrayDimensionSeparator] attributes: NotRequired[Mapping[str, JSONValue]] """User attributes from the sibling `.zattrs` file (not part of `.zarray`). @@ -99,11 +108,11 @@ class ArrayMetadataV2(TypedDict): """ -class ArrayMetadataV2Partial(TypedDict, total=False): +class ZarrV2ArrayMetadataJSONPartial(TypedDict, total=False): """ - Partial form of `ArrayMetadataV2`: every field is `NotRequired`. + Partial form of `ZarrV2ArrayMetadataJSON`: every field is `NotRequired`. - Field annotations mirror `ArrayMetadataV2` exactly. The only difference is + Field annotations mirror `ZarrV2ArrayMetadataJSON` exactly. The only difference is `total=False`, which makes every key optional at the type level. Use this when typing dicts that intentionally hold a subset of a complete @@ -113,26 +122,26 @@ class ArrayMetadataV2Partial(TypedDict, total=False): The `NotRequired[...]` wrappers on `dimension_separator` and `attributes` are intentional: keeping them preserves byte-identical `__annotations__` - with `ArrayMetadataV2` so the `==` check in + with `ZarrV2ArrayMetadataJSON` so the `==` check in `tests/test_partial_equivalence.py` passes without special-casing those fields (PEP 655 explicitly permits `NotRequired` inside `total=False`). Note: v2 array metadata has no `extra_items` setting (the v2 spec has no extension-field concept), so this partial inherits the same closed shape. - Drift between this type and `ArrayMetadataV2` is prevented by + Drift between this type and `ZarrV2ArrayMetadataJSON` is prevented by `tests/test_partial_equivalence.py`. """ zarr_format: Literal[2] shape: tuple[int, ...] chunks: tuple[int, ...] - dtype: DataTypeMetadataV2 - compressor: CodecMetadataV2 | None + dtype: ZarrV2DataTypeMetadata + compressor: ZarrV2CodecMetadata | None fill_value: JSONValue - order: ArrayOrderV2 - filters: tuple[CodecMetadataV2, ...] | None - dimension_separator: NotRequired[ArrayDimensionSeparatorV2] + order: ZarrV2ArrayOrder + filters: tuple[ZarrV2CodecMetadata, ...] | None + dimension_separator: NotRequired[ZarrV2ArrayDimensionSeparator] attributes: NotRequired[Mapping[str, JSONValue]] """User attributes from the sibling `.zattrs` file (not part of `.zarray`). @@ -143,10 +152,10 @@ class ArrayMetadataV2Partial(TypedDict, total=False): __all__ = [ "ARRAY_DIMENSION_SEPARATOR_V2", "ARRAY_ORDER_V2", - "ArrayDimensionSeparatorV2", - "ArrayMetadataV2", - "ArrayMetadataV2Partial", - "ArrayOrderV2", - "DataTypeMetadataV2", - "ZArrayMetadata", + "ZarrV2ArrayDimensionSeparator", + "ZarrV2ArrayMetadataJSON", + "ZarrV2ArrayMetadataJSONPartial", + "ZarrV2ArrayOrder", + "ZarrV2DataTypeMetadata", + "ZarrV2ZArrayJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v2/attributes.py b/packages/zarr-metadata/src/zarr_metadata/v2/attributes.py index 18b8ded9da..f7cc31babe 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v2/attributes.py +++ b/packages/zarr-metadata/src/zarr_metadata/v2/attributes.py @@ -7,16 +7,16 @@ from zarr_metadata._common import JSONValue -ZAttrsMetadata = Mapping[str, JSONValue] +ZarrV2ZAttrsJSON = Mapping[str, JSONValue] """On-disk `.zattrs` file content. A JSON object holding user-defined attributes for a v2 array or group. Spec-defined keys for arrays / groups live in sibling `.zarray` / `.zgroup` -files (modeled by `ZArrayMetadata` / `ZGroupMetadata`). This type does not +files (modeled by `ZarrV2ZArrayJSON` / `ZarrV2ZGroupJSON`). This type does not constrain the keys or values of the attributes mapping. """ __all__ = [ - "ZAttrsMetadata", + "ZarrV2ZAttrsJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v2/codec.py b/packages/zarr-metadata/src/zarr_metadata/v2/codec.py index 6d194b7e29..69125544e6 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v2/codec.py +++ b/packages/zarr-metadata/src/zarr_metadata/v2/codec.py @@ -10,7 +10,7 @@ from zarr_metadata._common import JSONValue -class CodecMetadataV2(TypedDict, extra_items=JSONValue): # type: ignore[call-arg] +class ZarrV2CodecMetadata(TypedDict, extra_items=JSONValue): """ A numcodecs configuration dict, used as a v2 compressor or filter. @@ -25,5 +25,5 @@ class CodecMetadataV2(TypedDict, extra_items=JSONValue): # type: ignore[call-ar __all__ = [ - "CodecMetadataV2", + "ZarrV2CodecMetadata", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v2/consolidated.py b/packages/zarr-metadata/src/zarr_metadata/v2/consolidated.py index 61a5527085..6b586bb92e 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v2/consolidated.py +++ b/packages/zarr-metadata/src/zarr_metadata/v2/consolidated.py @@ -10,12 +10,12 @@ from typing_extensions import TypedDict -from zarr_metadata.v2.array import ZArrayMetadata -from zarr_metadata.v2.attributes import ZAttrsMetadata -from zarr_metadata.v2.group import ZGroupMetadata +from zarr_metadata.v2.array import ZarrV2ZArrayJSON +from zarr_metadata.v2.attributes import ZarrV2ZAttrsJSON +from zarr_metadata.v2.group import ZarrV2ZGroupJSON -class ConsolidatedMetadataV2(TypedDict): +class ZarrV2ConsolidatedMetadataJSON(TypedDict): """ `.zmetadata` file contents. @@ -24,9 +24,9 @@ class ConsolidatedMetadataV2(TypedDict): that path. The keys include the filename suffix, not just the node path; the value's shape is determined by which file the key points at: - - `/.zarray` -> `ZArrayMetadata` - - `/.zgroup` -> `ZGroupMetadata` - - `/.zattrs` -> `ZAttrsMetadata` + - `/.zarray` -> `ZarrV2ZArrayJSON` + - `/.zgroup` -> `ZarrV2ZGroupJSON` + - `/.zattrs` -> `ZarrV2ZAttrsJSON` The TypedDict cannot discriminate the value shape on the key suffix at the type level; consumers should narrow at runtime by inspecting @@ -34,9 +34,9 @@ class ConsolidatedMetadataV2(TypedDict): """ zarr_consolidated_format: int - metadata: Mapping[str, ZArrayMetadata | ZGroupMetadata | ZAttrsMetadata] + metadata: Mapping[str, ZarrV2ZArrayJSON | ZarrV2ZGroupJSON | ZarrV2ZAttrsJSON] __all__ = [ - "ConsolidatedMetadataV2", + "ZarrV2ConsolidatedMetadataJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v2/group.py b/packages/zarr-metadata/src/zarr_metadata/v2/group.py index 5f456fe8d3..50f2482e6f 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v2/group.py +++ b/packages/zarr-metadata/src/zarr_metadata/v2/group.py @@ -11,14 +11,14 @@ from zarr_metadata._common import JSONValue -class ZGroupMetadata(TypedDict): +class ZarrV2ZGroupJSON(TypedDict): """ On-disk `.zgroup` file content. Strict shape of the JSON document persisted at `/.zgroup` for a v2 group. The spec defines exactly one field. User attributes live in a sibling `.zattrs` file and are NOT part of this type; see - `ZAttrsMetadata`. + `ZarrV2ZAttrsJSON`. See https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html """ @@ -26,7 +26,7 @@ class ZGroupMetadata(TypedDict): zarr_format: Literal[2] -class GroupMetadataV2(TypedDict): +class ZarrV2GroupMetadataJSON(TypedDict): """ Zarr v2 group metadata document, in-memory merged form. @@ -34,8 +34,8 @@ class GroupMetadataV2(TypedDict): and `.zattrs` (user attributes). On disk these are persisted as two separate files; this type folds them so a single TypedDict represents the complete in-memory state of a v2 group node. Consumers that read - or write the real on-disk files should use `ZGroupMetadata` (strict - `.zgroup`) plus `ZAttrsMetadata` directly. + or write the real on-disk files should use `ZarrV2ZGroupJSON` (strict + `.zgroup`) plus `ZarrV2ZAttrsJSON` directly. See https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html """ @@ -44,11 +44,11 @@ class GroupMetadataV2(TypedDict): attributes: NotRequired[Mapping[str, JSONValue]] -class GroupMetadataV2Partial(TypedDict, total=False): +class ZarrV2GroupMetadataJSONPartial(TypedDict, total=False): """ - Partial form of `GroupMetadataV2`: every field is `NotRequired`. + Partial form of `ZarrV2GroupMetadataJSON`: every field is `NotRequired`. - Field annotations mirror `GroupMetadataV2` exactly. The only difference is + Field annotations mirror `ZarrV2GroupMetadataJSON` exactly. The only difference is `total=False`, which makes every key optional at the type level. Use this when typing dicts that intentionally hold a subset of a complete @@ -58,7 +58,7 @@ class GroupMetadataV2Partial(TypedDict, total=False): `*Partial` types; the practical effect is that `zarr_format` becomes optional. The `NotRequired[...]` wrapper on `attributes` is intentional: keeping it - preserves byte-identical `__annotations__` with `GroupMetadataV2` so the + preserves byte-identical `__annotations__` with `ZarrV2GroupMetadataJSON` so the `==` check in `tests/test_partial_equivalence.py` passes without special-casing that field (PEP 655 explicitly permits `NotRequired` inside `total=False`). @@ -66,7 +66,7 @@ class GroupMetadataV2Partial(TypedDict, total=False): Note: v2 group metadata has no `extra_items` setting (the v2 spec has no extension-field concept), so this partial inherits the same closed shape. - Drift between this type and `GroupMetadataV2` is prevented by + Drift between this type and `ZarrV2GroupMetadataJSON` is prevented by `tests/test_partial_equivalence.py`. """ @@ -75,7 +75,7 @@ class GroupMetadataV2Partial(TypedDict, total=False): __all__ = [ - "GroupMetadataV2", - "GroupMetadataV2Partial", - "ZGroupMetadata", + "ZarrV2GroupMetadataJSON", + "ZarrV2GroupMetadataJSONPartial", + "ZarrV2ZGroupJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/__init__.py b/packages/zarr-metadata/src/zarr_metadata/v3/__init__.py index c897f20d52..4e335f9573 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/__init__.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/__init__.py @@ -1,14 +1,14 @@ """Zarr v3 metadata types.""" -from zarr_metadata.v3._common import MetadataV3 -from zarr_metadata.v3.array import ArrayMetadataV3, ExtensionFieldV3 -from zarr_metadata.v3.consolidated import ConsolidatedMetadataV3 -from zarr_metadata.v3.group import GroupMetadataV3 +from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON +from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON, ZarrV3ExtensionField +from zarr_metadata.v3.consolidated import ZarrV3ConsolidatedMetadataJSON +from zarr_metadata.v3.group import ZarrV3GroupMetadataJSON __all__ = [ - "ArrayMetadataV3", - "ConsolidatedMetadataV3", - "ExtensionFieldV3", - "GroupMetadataV3", - "MetadataV3", + "ZarrV3ArrayMetadataJSON", + "ZarrV3ConsolidatedMetadataJSON", + "ZarrV3ExtensionField", + "ZarrV3GroupMetadataJSON", + "ZarrV3MetadataFieldJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/_common.py b/packages/zarr-metadata/src/zarr_metadata/v3/_common.py index 3424587a43..406b76b723 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/_common.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/_common.py @@ -2,14 +2,14 @@ This module is private (underscore-prefixed) and exists to avoid circular imports between leaf modules and sub-package `__init__.py` re-exports. -Public consumers should import `MetadataV3` from `zarr_metadata.v3`. +Public consumers should import `ZarrV3MetadataFieldJSON` from `zarr_metadata.v3`. """ -from zarr_metadata._common import NamedConfigV3 +from zarr_metadata._common import ZarrV3NamedConfigJSON -MetadataV3 = str | NamedConfigV3 +ZarrV3MetadataFieldJSON = str | ZarrV3NamedConfigJSON """The JSON shape of any v3 metadata extension-point entry: either a bare -short-hand name string or a `{name, configuration}` envelope. +short-hand name string or a `{name, configuration, must_understand}` envelope. Used for `data_type`, `chunk_grid`, `chunk_key_encoding`, individual codec entries, and `storage_transformers` in v3 array metadata, and for @@ -19,5 +19,5 @@ __all__ = [ - "MetadataV3", + "ZarrV3MetadataFieldJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/array.py b/packages/zarr-metadata/src/zarr_metadata/v3/array.py index a8b0fa3358..96341f73ca 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/array.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/array.py @@ -1,73 +1,49 @@ """Zarr v3 array metadata types.""" from collections.abc import Mapping -from typing import Literal, NotRequired +from typing import Literal, NotRequired, TypeAlias from typing_extensions import TypedDict from zarr_metadata._common import JSONValue -from zarr_metadata.v3._common import MetadataV3 +from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON +ZarrV3ExtensionField: TypeAlias = JSONValue +"""The JSON value of an unknown top-level v3 metadata field. -class ExtensionFieldV3(TypedDict, extra_items=JSONValue): # type: ignore[call-arg] - """ - Required shape of any extension field on a v3 metadata document. - - The Zarr v3 spec permits extra keys on array and group metadata - documents, provided each value is an object with a `must_understand` - boolean key. This TypedDict captures that constraint and is used as - the `extra_items=` parameter on `ArrayMetadataV3` and `GroupMetadataV3`. - - `must_understand` is typed as `bool` rather than `Literal[False]` so - that applications which understand a particular extension can produce - or consume it with `must_understand: true` (signalling that readers - that don't recognize the extension MUST refuse to open the document). - The common case is still `false`, signalling that unknown readers may - safely ignore the field. - - Spec interpretation: this type follows the original Zarr v3.0 reading - of the spec, under which any object with a `must_understand` key is a - valid extension field. The v3.1 spec rewrite added language requiring - extension fields to also include a `name: str` key (the "Extension - definition" form). Under the strict v3.1 reading, real-world extension - fields written by zarr-python and zarrs (notably `consolidated_metadata`, - which has no `name` field) are out of spec. The community consensus at - the time of writing is that this is a regression to be reverted; this - package models the v3.0 / pre-revert interpretation. See - https://github.com/zarr-developers/zarr-specs/issues/371 for the - ongoing discussion. - """ - - must_understand: bool +An object carrying the literal member `must_understand: false` may be ignored. +Every other JSON shape implicitly requires understanding; recognition itself +belongs to the reader rather than this structural type. +""" -class ArrayMetadataV3(TypedDict, extra_items=ExtensionFieldV3): # type: ignore[call-arg] +class ZarrV3ArrayMetadataJSON(TypedDict, extra_items=ZarrV3ExtensionField): """ Zarr v3 array metadata document (the `zarr.json` content for an array). - Extra keys are permitted if they conform to `ExtensionFieldV3`. + Extra keys may contain arbitrary JSON values. See https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html#array-metadata """ zarr_format: Literal[3] node_type: Literal["array"] - data_type: MetadataV3 + data_type: ZarrV3MetadataFieldJSON shape: tuple[int, ...] - chunk_grid: MetadataV3 - chunk_key_encoding: MetadataV3 + chunk_grid: ZarrV3MetadataFieldJSON + chunk_key_encoding: ZarrV3MetadataFieldJSON fill_value: JSONValue - codecs: tuple[MetadataV3, ...] + codecs: tuple[ZarrV3MetadataFieldJSON, ...] attributes: NotRequired[Mapping[str, JSONValue]] - storage_transformers: NotRequired[tuple[MetadataV3, ...]] + storage_transformers: NotRequired[tuple[ZarrV3MetadataFieldJSON, ...]] dimension_names: NotRequired[tuple[str | None, ...]] -class ArrayMetadataV3Partial(TypedDict, total=False, extra_items=ExtensionFieldV3): # type: ignore[call-arg] +class ZarrV3ArrayMetadataJSONPartial(TypedDict, total=False, extra_items=ZarrV3ExtensionField): """ - Partial form of `ArrayMetadataV3`: every field is `NotRequired`. + Partial form of `ZarrV3ArrayMetadataJSON`: every field is `NotRequired`. - Field annotations and `extra_items=` mirror `ArrayMetadataV3` exactly. + Field annotations and `extra_items=` mirror `ZarrV3ArrayMetadataJSON` exactly. The only difference is `total=False`, which makes every key optional at the type level. @@ -78,29 +54,29 @@ class ArrayMetadataV3Partial(TypedDict, total=False, extra_items=ExtensionFieldV The `NotRequired[...]` wrappers on `attributes`, `storage_transformers`, and `dimension_names` are intentional: keeping them preserves byte-identical - `__annotations__` with `ArrayMetadataV3` so the `==` check in + `__annotations__` with `ZarrV3ArrayMetadataJSON` so the `==` check in `tests/test_partial_equivalence.py` passes without special-casing those fields (PEP 655 explicitly permits `NotRequired` inside `total=False`). - Drift between this type and `ArrayMetadataV3` is prevented by + Drift between this type and `ZarrV3ArrayMetadataJSON` is prevented by `tests/test_partial_equivalence.py`. """ zarr_format: Literal[3] node_type: Literal["array"] - data_type: MetadataV3 + data_type: ZarrV3MetadataFieldJSON shape: tuple[int, ...] - chunk_grid: MetadataV3 - chunk_key_encoding: MetadataV3 + chunk_grid: ZarrV3MetadataFieldJSON + chunk_key_encoding: ZarrV3MetadataFieldJSON fill_value: JSONValue - codecs: tuple[MetadataV3, ...] + codecs: tuple[ZarrV3MetadataFieldJSON, ...] attributes: NotRequired[Mapping[str, JSONValue]] - storage_transformers: NotRequired[tuple[MetadataV3, ...]] + storage_transformers: NotRequired[tuple[ZarrV3MetadataFieldJSON, ...]] dimension_names: NotRequired[tuple[str | None, ...]] __all__ = [ - "ArrayMetadataV3", - "ArrayMetadataV3Partial", - "ExtensionFieldV3", + "ZarrV3ArrayMetadataJSON", + "ZarrV3ArrayMetadataJSONPartial", + "ZarrV3ExtensionField", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/chunk_key_encoding/v2.py b/packages/zarr-metadata/src/zarr_metadata/v3/chunk_key_encoding/v2.py index fef5793626..e2783d296d 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/chunk_key_encoding/v2.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/chunk_key_encoding/v2.py @@ -4,6 +4,12 @@ Intended only to allow existing v2 arrays to be converted to v3 without having to rename chunks. Not recommended for new arrays. +Naming note: these are Zarr **v3** types. The leading `V2` in +`V2ChunkKeyEncodingMetadata` (and friends) is the encoding's registered +*entity name* (`"v2"`), not the format-version marker that `ZarrV2...` +names carry — this package's version-prefixed names always spell it +`ZarrV2` / `ZarrV3`. + See https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html#chunk-key-encoding """ diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/codec/__init__.py b/packages/zarr-metadata/src/zarr_metadata/v3/codec/__init__.py index b4f357117f..c8a9a150fc 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/codec/__init__.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/codec/__init__.py @@ -11,7 +11,7 @@ `CodecConfiguration`, etc., import directly from the leaf submodule. For the field-level "any codec entry" alias (used in array metadata's -`codecs` list and in sharding's inner pipelines), import `MetadataV3` +`codecs` list and in sharding's inner pipelines), import `ZarrV3MetadataFieldJSON` from `zarr_metadata.v3`. See https://zarr-specs.readthedocs.io/en/latest/v3/codecs/index.html diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/codec/cast_value.py b/packages/zarr-metadata/src/zarr_metadata/v3/codec/cast_value.py index 7e9b071669..96c39e5916 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/codec/cast_value.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/codec/cast_value.py @@ -9,7 +9,7 @@ from typing_extensions import TypedDict from zarr_metadata._common import JSONValue -from zarr_metadata.v3._common import MetadataV3 +from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON CAST_VALUE_CODEC_NAME: Final = "cast_value" """The `name` field value of the `cast_value` codec.""" @@ -71,7 +71,7 @@ class CastValueCodecConfiguration(TypedDict): bare-string primitive name or a `{name, configuration}` envelope. """ - data_type: MetadataV3 + data_type: ZarrV3MetadataFieldJSON rounding: NotRequired[CastRoundingMode] out_of_range: NotRequired[CastOutOfRangeMode] scalar_map: NotRequired[ScalarMap] diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/codec/crc32c.py b/packages/zarr-metadata/src/zarr_metadata/v3/codec/crc32c.py index ea35ae5f1d..6b9b46c43d 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/codec/crc32c.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/codec/crc32c.py @@ -18,7 +18,7 @@ """Literal type of the `name` field of the `crc32c` codec.""" -class Empty(TypedDict, closed=True): # type: ignore[call-arg] +class Empty(TypedDict, closed=True): """An empty mapping""" diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/codec/sharding_indexed.py b/packages/zarr-metadata/src/zarr_metadata/v3/codec/sharding_indexed.py index a1488f7c30..a8c9247ec4 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/codec/sharding_indexed.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/codec/sharding_indexed.py @@ -8,7 +8,7 @@ from typing_extensions import TypedDict -from zarr_metadata.v3._common import MetadataV3 +from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON SHARDING_INDEXED_CODEC_NAME: Final = "sharding_indexed" """The `name` field value of the `sharding_indexed` codec.""" @@ -40,8 +40,8 @@ class ShardingIndexedCodecConfiguration(TypedDict): """ chunk_shape: tuple[int, ...] - codecs: tuple[MetadataV3, ...] - index_codecs: tuple[MetadataV3, ...] + codecs: tuple[ZarrV3MetadataFieldJSON, ...] + index_codecs: tuple[ZarrV3MetadataFieldJSON, ...] index_location: NotRequired[ShardingIndexLocation] diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/consolidated.py b/packages/zarr-metadata/src/zarr_metadata/v3/consolidated.py index 486a0897a5..bcbe675947 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/consolidated.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/consolidated.py @@ -5,14 +5,10 @@ implementation (and zarrs), where consolidated metadata is embedded as an extension field on a group's `zarr.json`. -The shape modeled here (`{kind, must_understand, metadata}` with no `name` -field) reflects the original Zarr v3.0 reading of the extension-field -rules. Under the strict Zarr v3.1 reading, every extension field must -also include a `name: str` key, which would make this shape — and every -real-world consolidated metadata document in the wild — out of spec. -See `ExtensionFieldV3` and -https://github.com/zarr-developers/zarr-specs/issues/371 for the -ongoing discussion. +This is a known non-core interoperability extension. Its +`{kind, must_understand, metadata}` payload is an unknown top-level JSON value +to the core document model; implementations that recognize the convention may +interpret it through this dedicated type. """ from collections.abc import Mapping @@ -20,24 +16,24 @@ from typing_extensions import TypedDict -from zarr_metadata.v3.array import ArrayMetadataV3 -from zarr_metadata.v3.group import GroupMetadataV3 +from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON +from zarr_metadata.v3.group import ZarrV3GroupMetadataJSON -class ConsolidatedMetadataV3(TypedDict): +class ZarrV3ConsolidatedMetadataJSON(TypedDict): """ Inline consolidated metadata embedded in a v3 group. - The `metadata` map contains only v3 array and group entries - v2 - entries are excluded by design. Mixing v2 entries into a v3 - consolidated metadata document is invalid per spec. + The `metadata` map contains only v3 array and group entries. V2 entries + are excluded from this interoperability convention by design; the v3 core + specification does not define consolidated metadata. """ kind: Literal["inline"] must_understand: Literal[False] - metadata: Mapping[str, ArrayMetadataV3 | GroupMetadataV3] + metadata: Mapping[str, ZarrV3ArrayMetadataJSON | ZarrV3GroupMetadataJSON] __all__ = [ - "ConsolidatedMetadataV3", + "ZarrV3ConsolidatedMetadataJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/data_type/struct.py b/packages/zarr-metadata/src/zarr_metadata/v3/data_type/struct.py index 5291e5c309..b1b6b50308 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/data_type/struct.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/data_type/struct.py @@ -10,7 +10,7 @@ from typing_extensions import ReadOnly, TypedDict from zarr_metadata._common import JSONValue -from zarr_metadata.v3._common import MetadataV3 +from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON STRUCT_DATA_TYPE_NAME: Final = "struct" """The `name` field value of the `struct` data type.""" @@ -33,7 +33,7 @@ class StructField(TypedDict): """ name: ReadOnly[str] - data_type: ReadOnly[MetadataV3] + data_type: ReadOnly[ZarrV3MetadataFieldJSON] class StructConfiguration(TypedDict): diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/group.py b/packages/zarr-metadata/src/zarr_metadata/v3/group.py index 27186b6059..033e91ff8c 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/group.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/group.py @@ -9,14 +9,14 @@ from typing_extensions import TypedDict from zarr_metadata._common import JSONValue -from zarr_metadata.v3.array import ExtensionFieldV3 +from zarr_metadata.v3.array import ZarrV3ExtensionField -class GroupMetadataV3(TypedDict, extra_items=ExtensionFieldV3): # type: ignore[call-arg] +class ZarrV3GroupMetadataJSON(TypedDict, extra_items=ZarrV3ExtensionField): """ Zarr v3 group metadata document (the `zarr.json` content for a group). - Extra keys are permitted if they conform to `ExtensionFieldV3`. + Extra keys may contain arbitrary JSON values. See https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html#group-metadata """ @@ -26,11 +26,11 @@ class GroupMetadataV3(TypedDict, extra_items=ExtensionFieldV3): # type: ignore[ attributes: NotRequired[Mapping[str, JSONValue]] -class GroupMetadataV3Partial(TypedDict, total=False, extra_items=ExtensionFieldV3): # type: ignore[call-arg] +class ZarrV3GroupMetadataJSONPartial(TypedDict, total=False, extra_items=ZarrV3ExtensionField): """ - Partial form of `GroupMetadataV3`: every field is `NotRequired`. + Partial form of `ZarrV3GroupMetadataJSON`: every field is `NotRequired`. - Field annotations and `extra_items=` mirror `GroupMetadataV3` exactly. + Field annotations and `extra_items=` mirror `ZarrV3GroupMetadataJSON` exactly. The only difference is `total=False`, which makes every key optional at the type level. @@ -40,12 +40,12 @@ class GroupMetadataV3Partial(TypedDict, total=False, extra_items=ExtensionFieldV into a complete document elsewhere. The `NotRequired[...]` wrapper on `attributes` is intentional: keeping it - preserves byte-identical `__annotations__` with `GroupMetadataV3` so the + preserves byte-identical `__annotations__` with `ZarrV3GroupMetadataJSON` so the `==` check in `tests/test_partial_equivalence.py` passes without special-casing that field (PEP 655 explicitly permits `NotRequired` inside `total=False`). - Drift between this type and `GroupMetadataV3` is prevented by + Drift between this type and `ZarrV3GroupMetadataJSON` is prevented by `tests/test_partial_equivalence.py`. """ @@ -55,6 +55,6 @@ class GroupMetadataV3Partial(TypedDict, total=False, extra_items=ExtensionFieldV __all__ = [ - "GroupMetadataV3", - "GroupMetadataV3Partial", + "ZarrV3GroupMetadataJSON", + "ZarrV3GroupMetadataJSONPartial", ] diff --git a/packages/zarr-metadata/tests/model/__init__.py b/packages/zarr-metadata/tests/model/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/zarr-metadata/tests/model/_cases.py b/packages/zarr-metadata/tests/model/_cases.py new file mode 100644 index 0000000000..15faa65539 --- /dev/null +++ b/packages/zarr-metadata/tests/model/_cases.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +import re +from dataclasses import dataclass +from typing import TYPE_CHECKING, Generic, TypeVar + +import pytest + +if TYPE_CHECKING: + from contextlib import AbstractContextManager + +TIn = TypeVar("TIn") +TOut = TypeVar("TOut") + + +@dataclass(frozen=True) +class Expect(Generic[TIn, TOut]): + """A test case with explicit input, expected output, and a human-readable id.""" + + input: TIn + output: TOut + id: str + + +@dataclass(frozen=True) +class ExpectFail(Generic[TIn]): + """A test case that should raise an exception. + + `msg` is a regex matched against the exception text (pytest's native + `match=` semantics). Leave it `None` to assert only the exception type. Set + `escape=True` when `msg` is a literal that contains regex metacharacters + such as `(`, `[`, or `.`; `escape` has no effect when `msg` is `None`. + """ + + input: TIn + exception: type[Exception] + id: str + msg: str | None = None + escape: bool = False + + def raises(self) -> AbstractContextManager[pytest.ExceptionInfo[Exception]]: + if self.msg is None: + return pytest.raises(self.exception) + pattern = re.escape(self.msg) if self.escape else self.msg + return pytest.raises(self.exception, match=pattern) + + +def mutate_nested_containers(value: object) -> None: + """Recursively mutate every mutable container reachable inside `value`. + + Adds a marker key to every dict and appends a marker to every list, + descending through tuples. Used to prove a `to_json` document shares no + mutable state with the model that produced it. + """ + if isinstance(value, dict): + for item in value.values(): + mutate_nested_containers(item) + value["__mutated__"] = "__mutated__" + elif isinstance(value, list): + for item in value: + mutate_nested_containers(item) + value.append("__mutated__") + elif isinstance(value, tuple): + for item in value: + mutate_nested_containers(item) diff --git a/packages/zarr-metadata/tests/model/test_array.py b/packages/zarr-metadata/tests/model/test_array.py new file mode 100644 index 0000000000..467ef1e2ad --- /dev/null +++ b/packages/zarr-metadata/tests/model/test_array.py @@ -0,0 +1,1738 @@ +"""Tests for the metadata models in ``zarr_metadata.model``.""" + +import copy +import dataclasses +import json +from collections import UserDict +from collections.abc import Callable +from typing import TYPE_CHECKING, get_args + +import pytest +from typing_extensions import Unpack + +from tests.model._cases import Expect, ExpectFail, mutate_nested_containers +from zarr_metadata.model import ( + ARRAY_METADATA_OPTIONAL_KEYS_V3, + ARRAY_METADATA_REQUIRED_KEYS_V3, + ARRAY_METADATA_STANDARD_KEYS_V3, + UNSET, + MetadataValidationError, + ValidationProblem, + ZarrV2ArrayMetadata, + ZarrV2ArrayMetadataPartial, + ZarrV3ArrayMetadata, + ZarrV3ArrayMetadataPartial, + ZarrV3MetadataField, + ZarrV3NamedConfig, + is_array_metadata_v2, + is_array_metadata_v3, + is_json, + is_metadata_field_v3, + parse_array_metadata_v2, + parse_array_metadata_v3, + parse_json, + parse_metadata_field_v3, + validate_array_metadata_v2, + validate_array_metadata_v3, + validate_json, + validate_metadata_field_v3, +) +from zarr_metadata.model._validation import _prefix, arrays_to_tuples + +if TYPE_CHECKING: + from zarr_metadata._common import JSONValue + from zarr_metadata.v2 import ZarrV2CodecMetadata + +# --- public exports -------------------------------------------------------- + + +def test_guards_exported_from_package() -> None: + """The wire-type guard/parser functions are exported from the package.""" + import zarr_metadata.model + + for name in ( + "is_json", + "parse_json", + "is_metadata_field_v3", + "parse_metadata_field_v3", + "is_array_metadata_v3", + "parse_array_metadata_v3", + "is_array_metadata_v2", + "parse_array_metadata_v2", + ): + assert name in zarr_metadata.model.__all__ + assert hasattr(zarr_metadata.model, name) + + +def test_store_key_pairs_exported_from_package() -> None: + """Each store-key constant is exported together with its Literal type + alias, and the pair cannot drift apart.""" + import zarr_metadata.model as m + + pairs = [ + ("ARRAY_METADATA_STORE_KEY_V2", "ZarrV2ArrayMetadataStoreKey"), + ("ARRAY_METADATA_STORE_KEY_V3", "ZarrV3ArrayMetadataStoreKey"), + ("ATTRIBUTES_STORE_KEY_V2", "ZarrV2AttributesStoreKey"), + ("GROUP_METADATA_STORE_KEY_V2", "ZarrV2GroupMetadataStoreKey"), + ("GROUP_METADATA_STORE_KEY_V3", "ZarrV3GroupMetadataStoreKey"), + ("CONSOLIDATED_METADATA_STORE_KEY_V2", "ZarrV2ConsolidatedMetadataStoreKey"), + ] + for const_name, alias_name in pairs: + assert const_name in m.__all__ + assert alias_name in m.__all__ + assert (getattr(m, const_name),) == get_args(getattr(m, alias_name)) + + +def test_validation_diagnostics_exported_from_package() -> None: + """The validation-diagnostic types and validators are exported from the package.""" + import zarr_metadata.model + + for name in ( + "ValidationProblem", + "MetadataValidationError", + "validate_json", + "validate_metadata_field_v3", + "validate_array_metadata_v3", + "validate_array_metadata_v2", + ): + assert name in zarr_metadata.model.__all__ + assert hasattr(zarr_metadata.model, name) + + +def test_expect_expectfail_smoke() -> None: + """The Expect/ExpectFail test-case dataclasses behave as expected.""" + e = Expect(input=1, output=2, id="x") + assert (e.input, e.output, e.id) == (1, 2, "x") + f = ExpectFail(input=1, exception=ValueError, id="y", msg="boom") + with f.raises(): + raise ValueError("boom") + + +def test_v3_from_json_error_lists_all_problems() -> None: + """A malformed v3 document surfaces every problem via MetadataValidationError.problems.""" + doc: dict[str, object] = dict(ZarrV3ArrayMetadata.create_default().to_json()) + del doc["shape"] + doc["data_type"] = 5 + with pytest.raises(MetadataValidationError) as exc_info: + ZarrV3ArrayMetadata.from_json(doc) + locs = {p.loc for p in exc_info.value.problems} + assert ("shape",) in locs + assert ("data_type",) in locs + + +# --- JSON type / fill_value contract --------------------------------------- + + +def test_json_value_type_accepts_json_shapes() -> None: + # JSONValue is the package's public JSON type alias; assigning JSON-shaped + # values to it is valid. + """The JSONValue type alias accepts JSON-shaped values.""" + value: JSONValue = {"a": [1, 2.0, "x", True, None]} + assert value == {"a": [1, 2.0, "x", True, None]} + + +def test_string_nan_fill_value_roundtrips() -> None: + # Non-finite floats are represented as the spec strings ("NaN", "Infinity", + # "-Infinity") by the caller — the metadata layer does not interpret dtypes. + # The string form round-trips cleanly under default dataclass equality, + # unlike a raw float('nan') (which is an invalid fill_value the caller must + # not pass). + """A string 'NaN' fill_value round-trips cleanly (non-finite floats are the caller's responsibility).""" + m = ZarrV3ArrayMetadata.create_default(fill_value="NaN") + assert ZarrV3ArrayMetadata.from_json(m.to_json()) == m + assert ZarrV3ArrayMetadata.from_json(m.to_json()).fill_value == "NaN" + + +# --- ZarrV3NamedConfig.to_json ------------------------------------------------ + +ZARR_TO_JSON_CASES = [ + Expect( + ZarrV3NamedConfig(name="regular", configuration={"chunk_shape": [1]}), + {"name": "regular", "configuration": {"chunk_shape": [1]}}, + id="with-configuration", + ), + Expect( + ZarrV3NamedConfig(name="bytes", configuration={}), + "bytes", + id="empty-configuration-shorthand", + ), +] + + +@pytest.mark.parametrize("case", ZARR_TO_JSON_CASES, ids=lambda c: c.id) +def test_zarr_metadata_v3_to_json(case: Expect[ZarrV3NamedConfig, object]) -> None: + """ZarrV3NamedConfig.to_json emits the canonical extension form.""" + assert case.input.to_json() == case.output + + +def test_zarr_metadata_v3_to_json_preserves_false_obligation() -> None: + """An empty optional extension stays an object so false is not lost.""" + model = ZarrV3NamedConfig(name="optional", configuration={}, must_understand=False) + assert model.to_json() == {"name": "optional", "must_understand": False} + + +# --- ZarrV3NamedConfig.from_json ----------------------------------------------- + +ZARR_FROM_JSON_CASES = [ + Expect("bytes", ZarrV3NamedConfig(name="bytes", configuration={}), id="bare-string"), + Expect( + {"name": "regular", "configuration": {"chunk_shape": [1]}}, + ZarrV3NamedConfig(name="regular", configuration={"chunk_shape": (1,)}), + id="object-with-config", + ), + Expect( + {"name": "bytes"}, + ZarrV3NamedConfig(name="bytes", configuration={}), + id="object-without-config", + ), +] + + +@pytest.mark.parametrize("case", ZARR_FROM_JSON_CASES, ids=lambda c: c.id) +def test_zarr_metadata_v3_from_json(case: Expect[object, ZarrV3NamedConfig]) -> None: + """ZarrV3NamedConfig.from_json parses both the bare-string and object forms.""" + assert ZarrV3NamedConfig.from_json(case.input) == case.output + + +def test_zarr_metadata_v3_from_json_preserves_false_obligation() -> None: + """Explicit false is represented on the normalized model.""" + model = ZarrV3NamedConfig.from_json({"name": "optional", "must_understand": False}) + assert model.must_understand is False + + +# --- V3 baseline ----------------------------------------------------------- + + +def test_v3_to_json_emits_canonical_document() -> None: + """V3 to_json emits exactly the expected document (which covers every + spec-required key by construction).""" + out = ZarrV3ArrayMetadata.create_default( + shape=(10,), data_type=ZarrV3NamedConfig(name="int32", configuration={}) + ).to_json() + assert out == { + "zarr_format": 3, + "node_type": "array", + "shape": (10,), + "fill_value": 0, + "data_type": "int32", + "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": (10,)}}, + "codecs": ("bytes",), + "chunk_key_encoding": "default", + } + + +def test_v3_dimension_names_included_when_present() -> None: + """V3 to_json includes dimension_names when they are set.""" + out: dict[str, object] = dict( + ZarrV3ArrayMetadata.create_default(dimension_names=("x",)).to_json() + ) + assert out["dimension_names"] == ("x",) + + +def test_v3_dimension_names_omitted_when_none() -> None: + """V3 to_json omits dimension_names when they are UNSET.""" + out = ZarrV3ArrayMetadata.create_default(dimension_names=UNSET).to_json() + assert "dimension_names" not in out + + +# --- BUG 1: attributes gated on dimension_names ---------------------------- + + +def test_v3_attributes_included_when_dimension_names_is_none() -> None: + """Attributes must be emitted regardless of dimension_names. + + Regression: attributes were gated on ``dimension_names is not None``, + so non-empty attributes were silently dropped when there were no + dimension names. + """ + out: dict[str, object] = dict( + ZarrV3ArrayMetadata.create_default( + dimension_names=UNSET, attributes={"foo": "bar"} + ).to_json() + ) + assert out["attributes"] == {"foo": "bar"} + + +# --- BUG 2: single storage transformer dropped ----------------------------- + + +def test_v3_single_storage_transformer_included() -> None: + """A single storage transformer must be emitted. + + Regression: the guard used ``> 1`` instead of ``> 0``, dropping a + lone storage transformer. + """ + st = ZarrV3NamedConfig(name="some_transformer", configuration={}) + out: dict[str, object] = dict( + ZarrV3ArrayMetadata.create_default(storage_transformers=(st,)).to_json() + ) + assert out["storage_transformers"] == ("some_transformer",) + + +def test_v3_no_storage_transformers_omitted() -> None: + """V3 to_json omits storage_transformers when empty.""" + out = ZarrV3ArrayMetadata.create_default(storage_transformers=()).to_json() + assert "storage_transformers" not in out + + +# --- V3 extra fields ------------------------------------------------------- + + +def test_v3_extra_fields_merged() -> None: + """V3 to_json merges extra_fields into the top-level document.""" + out = ZarrV3ArrayMetadata.create_default( + extra_fields={"my_ext": {"must_understand": False}} + ).to_json() + assert out["my_ext"] == {"must_understand": False} + + +def test_v3_extra_fields_overlapping_standard_field_rejected() -> None: + """Constructing a V3 model with an extra field that collides with a standard key is rejected.""" + with pytest.raises(ValueError): + ZarrV3ArrayMetadata.create_default(extra_fields={"shape": {"must_understand": False}}) + + +# --- V3 key/value ---------------------------------------------------------- + + +def test_v3_to_key_value_is_valid_json_under_zarr_json() -> None: + """V3 to_key_value produces valid JSON bytes under the zarr.json key.""" + kv = ZarrV3ArrayMetadata.create_default(attributes={"a": 1}).to_key_value() + assert set(kv) == {"zarr.json"} + parsed = json.loads(kv["zarr.json"].decode("utf-8")) + assert parsed["zarr_format"] == 3 + assert parsed["attributes"] == {"a": 1} + + +# --- V3 standard-key sets -------------------------------------------------- + + +def test_standard_keys_is_union_of_required_and_optional() -> None: + """The standard-key set is the union of the required and optional key sets.""" + assert ( + ARRAY_METADATA_STANDARD_KEYS_V3 + == ARRAY_METADATA_REQUIRED_KEYS_V3 | ARRAY_METADATA_OPTIONAL_KEYS_V3 + ) + + +def test_standard_keys_contains_known_fields_and_excludes_extensions() -> None: + """The standard-key set contains known fields and excludes extension keys.""" + assert { + "zarr_format", + "node_type", + "shape", + "codecs", + } <= ARRAY_METADATA_STANDARD_KEYS_V3 + assert "my_ext" not in ARRAY_METADATA_STANDARD_KEYS_V3 + + +# --- create_default -------------------------------------------------------- + + +def test_v3_create_default_is_valid_empty_array() -> None: + """V3 create_default builds a structurally valid empty array that round-trips.""" + m = ZarrV3ArrayMetadata.create_default() + assert m.shape == () + assert m.data_type == ZarrV3NamedConfig(name="uint8", configuration={}) + assert m.fill_value == 0 + assert m.attributes == {} + assert m.extra_fields == {} + # the default document is structurally valid and round-trips + assert validate_array_metadata_v3(m.to_json()) == [] + assert ZarrV3ArrayMetadata.from_json(m.to_json()) == m + + +def test_v3_create_default_applies_overrides() -> None: + """V3 create_default applies keyword overrides over the defaults.""" + m = ZarrV3ArrayMetadata.create_default(shape=(4, 4), attributes={"a": 1}) + assert m.shape == (4, 4) + assert m.attributes == {"a": 1} + # un-overridden fields keep their defaults + assert m.data_type == ZarrV3NamedConfig(name="uint8", configuration={}) + + +def test_v2_create_default_is_valid_empty_array() -> None: + """V2 create_default builds a structurally valid empty array that round-trips.""" + m = ZarrV2ArrayMetadata.create_default() + assert m.shape == () + assert m.chunks == () + assert m.fill_value == 0 + assert m.compressor is None + assert m.filters is None + assert m.attributes is UNSET + assert validate_array_metadata_v2(m.to_json()) == [] + assert ZarrV2ArrayMetadata.from_json(m.to_json()) == m + + +def test_v2_create_default_applies_overrides() -> None: + """V2 create_default applies keyword overrides over the defaults.""" + m = ZarrV2ArrayMetadata.create_default(shape=(8,), attributes={"k": "v"}) + assert m.shape == (8,) + assert m.attributes == {"k": "v"} + assert m.dtype == "|u1" # default dtype unchanged + + +# --- V3 update ------------------------------------------------------------- + +# Cluster 3: update same-shape pairs across versions — parametrized + +UPDATE_NEW_INSTANCE_PARAMS = [ + pytest.param(ZarrV3ArrayMetadata, id="v3"), + pytest.param(ZarrV2ArrayMetadata, id="v2"), +] + + +@pytest.mark.parametrize("model_cls", UPDATE_NEW_INSTANCE_PARAMS) +def test_update_returns_new_instance( + model_cls: type[ZarrV3ArrayMetadata | ZarrV2ArrayMetadata], +) -> None: + """update returns a new instance with the field replaced, leaving the original unchanged.""" + base = model_cls.create_default(shape=(10,)) + updated = base.update(shape=(20,)) + assert updated.shape == (20,) + assert base.shape == (10,) # original unchanged + assert isinstance(updated, model_cls) + + +UPDATE_NO_ARGS_PARAMS = [ + pytest.param(ZarrV3ArrayMetadata, id="v3"), + pytest.param(ZarrV2ArrayMetadata, id="v2"), +] + + +@pytest.mark.parametrize("model_cls", UPDATE_NO_ARGS_PARAMS) +def test_update_no_args_returns_equal_model( + model_cls: type[ZarrV3ArrayMetadata | ZarrV2ArrayMetadata], +) -> None: + """update with no arguments returns a model equal to the original.""" + base = model_cls.create_default() + assert base.update() == base + + +# V3-only update tests — kept direct (extra_fields is v3-specific) + + +def test_update_can_replace_extra_fields() -> None: + """update can replace the extra_fields mapping.""" + base = ZarrV3ArrayMetadata.create_default(extra_fields={}) + updated = base.update(extra_fields={"my_ext": {"must_understand": False}}) + assert updated.extra_fields == {"my_ext": {"must_understand": False}} + + +def test_update_replaces_extra_fields_rather_than_merging() -> None: + """update replaces extra_fields wholesale rather than merging.""" + base = ZarrV3ArrayMetadata.create_default(extra_fields={"a": {"must_understand": False}}) + updated = base.update(extra_fields={"b": {"must_understand": True}}) + assert updated.extra_fields == {"b": {"must_understand": True}} + + +def test_partial_keys_match_settable_model_fields() -> None: + """The partial TypedDict must list exactly the constructor-settable fields. + + Guards against drift: adding/removing a settable field on the model + without updating ``ZarrV3ArrayMetadataPartial`` fails here. + """ + settable = {f.name for f in dataclasses.fields(ZarrV3ArrayMetadata) if f.init} + assert set(ZarrV3ArrayMetadataPartial.__annotations__) == settable + + +# --- V2 model -------------------------------------------------------------- + + +def test_v2_partial_keys_match_settable_model_fields() -> None: + """The v2 partial TypedDict must list exactly the settable fields.""" + settable = {f.name for f in dataclasses.fields(ZarrV2ArrayMetadata) if f.init} + assert set(ZarrV2ArrayMetadataPartial.__annotations__) == settable + + +def test_v2_to_key_value_splits_zarray_and_zattrs() -> None: + """V2 to_key_value splits the document into .zarray and .zattrs.""" + kv = ZarrV2ArrayMetadata.create_default(attributes={"a": 1}).to_key_value() + assert set(kv) == {".zarray", ".zattrs"} + zarray = json.loads(kv[".zarray"].decode("utf-8")) + zattrs = json.loads(kv[".zattrs"].decode("utf-8")) + assert zarray["zarr_format"] == 2 + assert zattrs == {"a": 1} + + +def test_v2_zarray_excludes_attributes() -> None: + """The on-disk ``.zarray`` document must not contain user attributes. + + In v2, attributes live only in the sibling ``.zattrs`` file. The bundled + ``ZarrV2ArrayMetadataJSON`` / ``to_json()`` carry attributes for convenience, but + ``to_key_value()`` must split them out. + """ + kv = ZarrV2ArrayMetadata.create_default(attributes={"a": 1}).to_key_value() + zarray = json.loads(kv[".zarray"].decode("utf-8")) + assert "attributes" not in zarray + + +def test_v2_to_json_still_includes_attributes() -> None: + """``to_json()`` is the bundled in-memory form and keeps attributes.""" + out: dict[str, object] = dict(ZarrV2ArrayMetadata.create_default(attributes={"a": 1}).to_json()) + assert out["attributes"] == {"a": 1} + + +# --- arrays_to_tuples helper ---------------------------------------------- + +ARRAYS_TO_TUPLES_CASES = [ + Expect([1, 2, 3], (1, 2, 3), id="top-level-list"), + Expect({"a": [1, [2, 3]], "b": "x"}, {"a": (1, (2, 3)), "b": "x"}, id="nested-in-dict"), + Expect(5, 5, id="scalar-int"), + Expect("s", "s", id="scalar-str"), + Expect(None, None, id="scalar-none"), + Expect( + {"name": "bytes", "configuration": {"nums": [1, 2]}}, + {"name": "bytes", "configuration": {"nums": (1, 2)}}, + id="dict-keys-preserved", + ), +] + + +@pytest.mark.parametrize("case", ARRAYS_TO_TUPLES_CASES, ids=lambda c: c.id) +def test_arrays_to_tuples(case: Expect[object, object]) -> None: + """arrays_to_tuples recursively converts JSON arrays to tuples.""" + assert arrays_to_tuples(case.input) == case.output + + +# --- ZarrV3ArrayMetadata.from_json ---------------------------------------- + + +def test_v3_from_json_reconstructs_required_fields() -> None: + """V3 from_json reconstructs the required fields from a document.""" + doc = ZarrV3ArrayMetadata.create_default( + shape=(7,), + attributes={"a": 1}, + data_type=ZarrV3NamedConfig(name="int32", configuration={}), + ).to_json() + model = ZarrV3ArrayMetadata.from_json(doc) + assert model.shape == (7,) + assert model.data_type == ZarrV3NamedConfig(name="int32", configuration={}) + assert model.attributes == {"a": 1} + + +def test_v3_from_json_defaults_for_omitted_optionals() -> None: + """V3 from_json supplies defaults for omitted optional fields.""" + doc = ZarrV3ArrayMetadata.create_default( + attributes={}, storage_transformers=(), dimension_names=UNSET + ).to_json() + # to_json omits these entirely; from_json must restore defaults + model = ZarrV3ArrayMetadata.from_json(doc) + assert model.attributes == {} + assert model.storage_transformers == () + assert model.dimension_names is UNSET + + +def test_v3_from_json_routes_unknown_keys_to_extra_fields() -> None: + """V3 from_json routes unknown top-level keys into extra_fields.""" + doc = ZarrV3ArrayMetadata.create_default( + extra_fields={"my_ext": {"must_understand": False}} + ).to_json() + model = ZarrV3ArrayMetadata.from_json(doc) + assert model.extra_fields == {"my_ext": {"must_understand": False}} + + +def test_v3_from_json_standard_keys_not_in_extra_fields() -> None: + """V3 from_json keeps standard keys out of extra_fields.""" + doc = ZarrV3ArrayMetadata.create_default( + shape=(10,), attributes={"a": 1}, dimension_names=("x",) + ).to_json() + model = ZarrV3ArrayMetadata.from_json(doc) + assert model.extra_fields == {} + + +def test_v3_from_json_nested_arrays_in_attributes_become_tuples() -> None: + """V3 from_json converts nested arrays in attributes into tuples.""" + doc = ZarrV3ArrayMetadata.create_default(attributes={"scale": [[1, 2], [3, 4]]}).to_json() + model = ZarrV3ArrayMetadata.from_json(doc) + assert model.attributes == {"scale": ((1, 2), (3, 4))} + + +# --- ZarrV3ArrayMetadata.from_key_value ---------------------------------- + + +def test_v3_from_key_value_parses_zarr_json() -> None: + """V3 from_key_value parses the zarr.json entry into a model.""" + kv = ZarrV3ArrayMetadata.create_default(shape=(3,)).to_key_value() + model = ZarrV3ArrayMetadata.from_key_value(kv) + assert model.shape == (3,) + + +# --- Cluster 2: from_key_value missing-key raises (parametrized) ----------- + +FROM_KEY_VALUE_MISSING_PARAMS = [ + pytest.param( + ZarrV3ArrayMetadata, + ExpectFail({}, MetadataValidationError, id="v3-missing-zarr-json", msg="missing store key"), + id="v3-missing-zarr-json", + ), + pytest.param( + ZarrV2ArrayMetadata, + ExpectFail({}, MetadataValidationError, id="v2-missing-zarray", msg="missing store key"), + id="v2-missing-zarray", + ), +] + + +@pytest.mark.parametrize(("model_cls", "case"), FROM_KEY_VALUE_MISSING_PARAMS) +def test_from_key_value_missing_key_raises( + model_cls: type[ZarrV3ArrayMetadata | ZarrV2ArrayMetadata], + case: ExpectFail[dict[str, bytes]], +) -> None: + """from_key_value raises MetadataValidationError when the required store key is absent.""" + with case.raises(): + model_cls.from_key_value(case.input) + + +# --- Cluster 1: round-trips (model → json → model, parametrized) ----------- + +ROUNDTRIP_MODEL_JSON_PARAMS = [ + pytest.param( + ZarrV3ArrayMetadata, + ZarrV3ArrayMetadata.create_default( + shape=(10,), + attributes={"a": 1}, + dimension_names=("x",), + storage_transformers=(ZarrV3NamedConfig(name="t", configuration={}),), + extra_fields={"ext": {"must_understand": False}}, + ), + id="v3-full", + ), + pytest.param( + ZarrV3ArrayMetadata, + ZarrV3ArrayMetadata.create_default( + attributes={}, + dimension_names=UNSET, + storage_transformers=(), + extra_fields={}, + ), + id="v3-empty-optionals", + ), + pytest.param( + ZarrV2ArrayMetadata, + ZarrV2ArrayMetadata.create_default(attributes={"a": 1}, filters=None, compressor=None), + id="v2-basic", + ), +] + + +@pytest.mark.parametrize(("model_cls", "model"), ROUNDTRIP_MODEL_JSON_PARAMS) +def test_roundtrip_model_json_model( + model_cls: type[ZarrV3ArrayMetadata | ZarrV2ArrayMetadata], + model: ZarrV3ArrayMetadata | ZarrV2ArrayMetadata, +) -> None: + """A model round-trips through to_json/from_json back to an equal model.""" + assert model_cls.from_json(model.to_json()) == model + + +# --- Round-trips (model → key_value → model, parametrized) ----------------- + +ROUNDTRIP_KEY_VALUE_PARAMS = [ + pytest.param( + ZarrV3ArrayMetadata, + ZarrV3ArrayMetadata.create_default(attributes={"a": 1}), + id="v3", + ), + pytest.param( + ZarrV2ArrayMetadata, + ZarrV2ArrayMetadata.create_default(attributes={"a": 1}), + id="v2", + ), +] + + +@pytest.mark.parametrize(("model_cls", "model"), ROUNDTRIP_KEY_VALUE_PARAMS) +def test_roundtrip_via_key_value( + model_cls: type[ZarrV3ArrayMetadata | ZarrV2ArrayMetadata], + model: ZarrV3ArrayMetadata | ZarrV2ArrayMetadata, +) -> None: + """A model round-trips through to_key_value/from_key_value back to an equal model.""" + assert model_cls.from_key_value(model.to_key_value()) == model + + +# --- Round-trips (json → model → json, direction distinct — kept direct) --- + + +def test_v3_roundtrip_json_model_json() -> None: + """A v3 document round-trips through from_json/to_json back to an equal document.""" + doc = ZarrV3ArrayMetadata.create_default( + shape=(10,), attributes={"a": 1}, dimension_names=("x",) + ).to_json() + assert ZarrV3ArrayMetadata.from_json(doc).to_json() == doc + + +def test_v2_roundtrip_json_model_json() -> None: + """A v2 document round-trips through from_json/to_json back to an equal document.""" + doc = ZarrV2ArrayMetadata.create_default(attributes={"a": 1}).to_json() + assert ZarrV2ArrayMetadata.from_json(doc).to_json() == doc + + +# --- to_json shares no mutable state with the model ------------------------ + +TO_JSON_NO_ALIASING_PARAMS = [ + pytest.param( + ZarrV3ArrayMetadata.create_default( + shape=(2,), + attributes={"a": {"b": [1]}}, + codecs=(ZarrV3NamedConfig(name="blosc", configuration={"opts": {"level": 1}}),), + extra_fields={"ext": {"must_understand": False, "cfg": {"x": [1]}}}, + ), + id="v3", + ), + pytest.param( + ZarrV2ArrayMetadata.create_default( + attributes={"a": {"b": [1]}}, + compressor={"id": "zstd", "opts": {"level": 1}}, + filters=({"id": "delta", "cfg": [1]},), + fill_value=[0, 0], + ), + id="v2", + ), +] + + +@pytest.mark.parametrize("model", TO_JSON_NO_ALIASING_PARAMS) +def test_to_json_shares_no_mutable_state_with_model( + model: ZarrV3ArrayMetadata | ZarrV2ArrayMetadata, +) -> None: + """Mutating a document returned by to_json leaves the model unchanged.""" + baseline = copy.deepcopy(model.to_json()) + mutate_nested_containers(model.to_json()) + assert model.to_json() == baseline + + +def test_v3_parser_accepts_bare_string_data_type() -> None: + """V3 from_json accepts a bare-string data_type and re-serializes it canonically.""" + doc = ZarrV3ArrayMetadata.create_default().to_json() + doc["data_type"] = "int32" + model = ZarrV3ArrayMetadata.from_json(doc) + assert model.data_type == ZarrV3NamedConfig(name="int32", configuration={}) + assert model.to_json()["data_type"] == "int32" + + +@pytest.mark.parametrize("name", ["bytes", "ANY string", "urn:example:codec"]) +def test_metadata_field_accepts_any_string_name(name: str) -> None: + """The structural layer checks the name type, not syntax or registration.""" + assert validate_metadata_field_v3({"name": name}) == [] + + +@pytest.mark.parametrize("value", [0, 1, "false", None]) +def test_metadata_field_must_understand_must_be_boolean(value: object) -> None: + """must_understand is a JSON boolean, not a truthy scalar.""" + problems = validate_metadata_field_v3({"name": "x", "must_understand": value}) + assert [(problem.loc, problem.kind) for problem in problems] == [ + (("must_understand",), "invalid_type") + ] + + +def test_metadata_field_rejects_unknown_envelope_member() -> None: + """Unknown envelope keys cannot be silently discarded during normalization.""" + problems = validate_metadata_field_v3({"name": "x", "typo": 1}) + assert [(problem.loc, problem.kind) for problem in problems] == [(("typo",), "invalid_value")] + + +@pytest.mark.parametrize("field", ["codecs", "storage_transformers"]) +def test_optional_extension_points_allow_must_understand_false(field: str) -> None: + """Codecs and storage transformers may be explicitly ignorable.""" + doc: dict[str, object] = dict(ZarrV3ArrayMetadata.create_default().to_json()) + doc[field] = ({"name": "optional", "must_understand": False},) + assert validate_array_metadata_v3(doc) == [] + + +@pytest.mark.parametrize("field", ["data_type", "chunk_grid", "chunk_key_encoding"]) +def test_required_extension_points_reject_must_understand_false(field: str) -> None: + """Core extension points needed to locate or decode chunks cannot be ignored.""" + doc: dict[str, object] = dict(ZarrV3ArrayMetadata.create_default().to_json()) + doc[field] = {"name": "optional", "must_understand": False} + assert [(problem.loc, problem.kind) for problem in validate_array_metadata_v3(doc)] == [ + ((field, "must_understand"), "invalid_value") + ] + + +def test_v3_codecs_cannot_be_empty() -> None: + """The core document requires at least one array-to-bytes codec.""" + doc: dict[str, object] = dict(ZarrV3ArrayMetadata.create_default().to_json()) + doc["codecs"] = () + assert [(problem.loc, problem.kind) for problem in validate_array_metadata_v3(doc)] == [ + (("codecs",), "invalid_value") + ] + + +def test_v2_roundtrip_with_compressor_and_filters() -> None: + # Non-None compressor/filters must round-trip; extra assertion on .compressor. + """A v2 model with non-None compressor and filters round-trips.""" + compressor: ZarrV2CodecMetadata = {"id": "blosc", "clevel": 5} + filters: tuple[ZarrV2CodecMetadata, ...] = ({"id": "delta"},) + m = ZarrV2ArrayMetadata.create_default(compressor=compressor, filters=filters) + restored = ZarrV2ArrayMetadata.from_json(m.to_json()) + assert restored == m + assert restored.compressor == {"id": "blosc", "clevel": 5} + + +# --- ZarrV2ArrayMetadata.from_json ---------------------------------------- + + +def test_v2_from_json_reconstructs_fields() -> None: + """V2 from_json reconstructs the fields from a document.""" + doc = ZarrV2ArrayMetadata.create_default(shape=(4,), attributes={"a": 1}, dtype=" None: + """V2 from_json reads an absent attributes key as UNSET, distinct from an + explicit empty mapping.""" + absent = ZarrV2ArrayMetadata.from_json(ZarrV2ArrayMetadata.create_default().to_json()) + explicit = ZarrV2ArrayMetadata.from_json( + ZarrV2ArrayMetadata.create_default(attributes={}).to_json() + ) + assert absent.attributes is UNSET + assert explicit.attributes == {} + assert absent != explicit + + +# --- ZarrV2ArrayMetadata.from_key_value -------------------------------- + + +def test_v2_from_key_value_remerges_zattrs() -> None: + """V2 from_key_value re-merges .zattrs back into attributes.""" + kv = ZarrV2ArrayMetadata.create_default(attributes={"a": 1}, shape=(10,)).to_key_value() + model = ZarrV2ArrayMetadata.from_key_value(kv) + assert model.attributes == {"a": 1} + assert model.shape == (10,) + + +@pytest.mark.parametrize("extra_key", ["attributes", "vendor_extension"]) +def test_v2_from_key_value_rejects_zarray_extra_members(extra_key: str) -> None: + """Raw `.zarray` documents reject every non-spec member.""" + doc: dict[str, object] = dict(ZarrV2ArrayMetadata.create_default().to_json()) + doc.pop("attributes", None) + doc[extra_key] = {} + + with pytest.raises(MetadataValidationError) as exc_info: + ZarrV2ArrayMetadata.from_key_value({".zarray": json.dumps(doc).encode()}) + + assert [(problem.loc, problem.kind) for problem in exc_info.value.problems] == [ + ((extra_key,), "invalid_value") + ] + + +def test_v2_zattrs_presence_round_trips() -> None: + """The .zattrs file's presence is part of the store: an absent file reads + as UNSET and emits no .zattrs; an explicit empty file reads as {} and + emits .zattrs — the two stores stay distinct through a round-trip.""" + explicit_kv = dict(ZarrV2ArrayMetadata.create_default(attributes={}).to_key_value()) + assert ".zattrs" in explicit_kv + absent_kv = dict(explicit_kv) + del absent_kv[".zattrs"] + + absent = ZarrV2ArrayMetadata.from_key_value(absent_kv) + explicit = ZarrV2ArrayMetadata.from_key_value(explicit_kv) + assert absent.attributes is UNSET + assert explicit.attributes == {} + assert ".zattrs" not in absent.to_key_value() + assert ".zattrs" in explicit.to_key_value() + + +def test_v2_from_json_nested_arrays_in_attributes_become_tuples() -> None: + """V2 from_json converts nested arrays in attributes into tuples.""" + doc = ZarrV2ArrayMetadata.create_default(attributes={"axes": [[0, 1], [2, 3]]}).to_json() + model = ZarrV2ArrayMetadata.from_json(doc) + assert model.attributes == {"axes": ((0, 1), (2, 3))} + + +# --- scalar wire-type guards (is_/validate_/parse_) ------------------------ +# +# Each value is modelled once as Expect[object, frozenset[tuple[str | int, ...]]] +# where `output` is the set of expected problem locs validate_* must report — +# frozenset() means VALID. Valid iff output == frozenset(). + +JSON_VALIDATE_CASES: list[Expect[object, frozenset[tuple[str | int, ...]]]] = [ + Expect("s", frozenset(), id="str"), + Expect(1, frozenset(), id="int"), + Expect(1.5, frozenset(), id="float"), + Expect(True, frozenset(), id="bool"), + Expect(None, frozenset(), id="none"), + Expect({"a": [1, {"b": None}], "c": "x"}, frozenset(), id="nested-containers"), + Expect((1, 2, 3), frozenset(), id="tuple-array"), + Expect(float("nan"), frozenset({()}), id="nan"), + Expect(float("inf"), frozenset({()}), id="inf"), + Expect(float("-inf"), frozenset({()}), id="negative-inf"), + Expect(object(), frozenset({()}), id="object"), + Expect(b"abc", frozenset({()}), id="bytes"), + Expect(bytearray(b"abc"), frozenset({()}), id="bytearray"), + Expect({1: "x"}, frozenset({()}), id="non-str-key"), + Expect([1, object()], frozenset({(1,)}), id="non-json-list-item"), + Expect({"ok": object()}, frozenset({("ok",)}), id="non-json-value"), +] + + +@pytest.mark.parametrize("case", JSON_VALIDATE_CASES, ids=lambda c: c.id) +def test_is_json(case: Expect[object, frozenset[tuple[str | int, ...]]]) -> None: + """is_json reports whether a value is JSON-serializable.""" + assert is_json(case.input) is (case.output == frozenset()) + + +@pytest.mark.parametrize("case", JSON_VALIDATE_CASES, ids=lambda c: c.id) +def test_validate_json(case: Expect[object, frozenset[tuple[str | int, ...]]]) -> None: + """validate_json reports the problems (and their locs) for a value.""" + problems = validate_json(case.input) + assert (problems == []) is (case.output == frozenset()) + assert {p.loc for p in problems} >= case.output + + +@pytest.mark.parametrize("case", JSON_VALIDATE_CASES, ids=lambda c: c.id) +def test_parse_json(case: Expect[object, frozenset[tuple[str | int, ...]]]) -> None: + """parse_json returns valid JSON values and raises on invalid ones.""" + if case.output == frozenset(): + parsed = parse_json(case.input) + assert arrays_to_tuples(parsed) == arrays_to_tuples(case.input) + else: + with pytest.raises(MetadataValidationError): + parse_json(case.input) + + +def test_parse_json_materializes_abstract_containers() -> None: + """Accepted Mapping and Sequence values normalize to JSON encoder containers.""" + value = UserDict({"values": range(3)}) + + parsed = parse_json(value) + + assert parsed == {"values": (0, 1, 2)} + assert type(parsed) is dict + assert type(parsed["values"]) is tuple + json.dumps(parsed, allow_nan=False) + + +def test_json_type_guard_rejects_abstract_sequence() -> None: + """A guard cannot narrow an abstract sequence that only the parser materializes.""" + assert not is_json(range(3)) + assert parse_json(range(3)) == (0, 1, 2) + + +def test_parse_metadata_field_materializes_abstract_containers() -> None: + """Named-config parsing produces canonical containers at every nesting level.""" + value = UserDict({"name": "example", "configuration": UserDict({"values": range(2)})}) + + parsed = parse_metadata_field_v3(value) + + assert isinstance(parsed, dict) + assert parsed == {"name": "example", "configuration": {"values": (0, 1)}} + assert type(parsed["configuration"]) is dict + + +def test_metadata_field_type_guard_rejects_abstract_mapping() -> None: + """A metadata-field guard only narrows concrete TypedDict-shaped objects.""" + value = UserDict({"name": "bytes"}) + + assert not is_metadata_field_v3(value) + assert parse_metadata_field_v3(value) == {"name": "bytes"} + + +def test_validate_json_reports_json_in_message() -> None: + """validate_json's message for a non-JSON value mentions JSON.""" + problems = validate_json(object()) + assert problems[0].loc == () + assert "JSON" in problems[0].message + + +METADATA_FIELD_VALIDATE_CASES: list[Expect[object, frozenset[tuple[str | int, ...]]]] = [ + Expect("bytes", frozenset(), id="bare-string"), + Expect({"name": "x", "configuration": {"a": 1}}, frozenset(), id="named-config"), + Expect({"name": "bytes"}, frozenset(), id="name-only"), + Expect(5, frozenset({()}), id="not-str-or-mapping"), + Expect({"configuration": {}}, frozenset({("name",)}), id="missing-name"), + Expect({"name": 3}, frozenset({("name",)}), id="non-str-name"), + Expect( + {"name": "x", "configuration": [1]}, + frozenset({("configuration",)}), + id="config-not-mapping", + ), + Expect( + {"name": "x", "configuration": {1: "y"}}, + frozenset({("configuration",)}), + id="config-non-str-key", + ), +] + + +@pytest.mark.parametrize("case", METADATA_FIELD_VALIDATE_CASES, ids=lambda c: c.id) +def test_is_metadata_field_v3(case: Expect[object, frozenset[tuple[str | int, ...]]]) -> None: + """is_metadata_field_v3 reports whether a value is a v3 metadata field.""" + assert is_metadata_field_v3(case.input) is (case.output == frozenset()) + + +@pytest.mark.parametrize("case", METADATA_FIELD_VALIDATE_CASES, ids=lambda c: c.id) +def test_validate_metadata_field_v3( + case: Expect[object, frozenset[tuple[str | int, ...]]], +) -> None: + """validate_metadata_field_v3 reports the problems for a metadata-field value.""" + problems = validate_metadata_field_v3(case.input) + assert (problems == []) is (case.output == frozenset()) + assert {p.loc for p in problems} >= case.output + + +@pytest.mark.parametrize("case", METADATA_FIELD_VALIDATE_CASES, ids=lambda c: c.id) +def test_parse_metadata_field_v3( + case: Expect[object, frozenset[tuple[str | int, ...]]], +) -> None: + """parse_metadata_field_v3 returns valid fields and raises on invalid ones.""" + if case.output == frozenset(): + assert parse_metadata_field_v3(case.input) is case.input + else: + with pytest.raises(MetadataValidationError): + parse_metadata_field_v3(case.input) + + +# --- array-document wire-type guards (is_/validate_/parse_) ---------------- +# +# Each case starts from a valid document (built by `make`) and applies a +# mutation. `expected_locs` are loc paths `validate_*` must report for the +# invalid cases (a subset check, so accumulation of OTHER problems is allowed). + + +def _build_v3(**overrides: Unpack[ZarrV3ArrayMetadataPartial]) -> dict[str, object]: + return dict(ZarrV3ArrayMetadata.create_default(**overrides).to_json()) + + +def _build_v2(**overrides: Unpack[ZarrV2ArrayMetadataPartial]) -> dict[str, object]: + return dict(ZarrV2ArrayMetadata.create_default(**overrides).to_json()) + + +def _mutate(build: Callable[[], dict], mutate: Callable[[dict], object]) -> Callable[[], dict]: + def _factory() -> dict: + doc = build() + mutate(doc) + return doc + + return _factory + + +def _del(key: str) -> Callable[[dict], object]: + return lambda doc: doc.pop(key) + + +def _set(key: str, value: object) -> Callable[[dict], object]: + return lambda doc: doc.__setitem__(key, value) + + +V3_DOC_CASES: list[Expect[Callable[[], object], frozenset[tuple[str | int, ...]]]] = [ + Expect(_build_v3, frozenset(), id="valid"), + Expect( + lambda: _build_v3(shape=(10,), attributes={"a": 1}, dimension_names=("x",)), + frozenset(), + id="valid-with-attributes-and-dim-names", + ), + Expect( + lambda: _build_v3(extra_fields={"my_ext": {"must_understand": False}}), + frozenset(), + id="valid-with-extra-fields", + ), + Expect(_mutate(_build_v3, _del("shape")), frozenset({("shape",)}), id="missing-shape"), + Expect( + _mutate(_build_v3, _set("data_type", 5)), + frozenset({("data_type",)}), + id="bad-data-type", + ), + Expect( + _mutate(_build_v3, _set("shape", "not-a-shape")), + frozenset({("shape",)}), + id="shape-not-sequence", + ), + Expect( + _mutate(_build_v3, _set("shape", [1, "x"])), + frozenset({("shape",)}), + id="shape-non-int-item", + ), + Expect( + _mutate(_build_v3, _set("codecs", (5,))), + frozenset({("codecs", 0)}), + id="bad-codec-entry", + ), + Expect(lambda: [1, 2, 3], frozenset({()}), id="non-mapping-list"), + Expect(lambda: "nope", frozenset({()}), id="non-mapping-str"), + Expect( + _mutate(_mutate(_build_v3, _del("shape")), _set("data_type", 5)), + frozenset({("shape",), ("data_type",)}), + id="missing-shape-and-bad-data-type", + ), +] + +V2_DOC_CASES: list[Expect[Callable[[], object], frozenset[tuple[str | int, ...]]]] = [ + Expect(_build_v2, frozenset(), id="valid"), + Expect(lambda: _build_v2(attributes={"a": 1}), frozenset(), id="valid-with-attributes"), + Expect( + lambda: _build_v2(compressor=None, filters=None), + frozenset(), + id="valid-none-compressor-filters", + ), + Expect( + _mutate(_build_v2, _del("chunks")), + frozenset({("chunks",)}), + id="missing-chunks", + ), + Expect( + _mutate(_build_v2, _set("shape", [1, "x"])), + frozenset({("shape",)}), + id="bad-shape", + ), + Expect( + _mutate(_mutate(_build_v2, _del("chunks")), _set("shape", [1, "x"])), + frozenset({("chunks",), ("shape",)}), + id="missing-chunks-and-bad-shape", + ), +] + +ALL_DOC_CASES = [ + *( + pytest.param( + is_array_metadata_v3, + validate_array_metadata_v3, + parse_array_metadata_v3, + c, + id=f"v3-{c.id}", + ) + for c in V3_DOC_CASES + ), + *( + pytest.param( + is_array_metadata_v2, + validate_array_metadata_v2, + parse_array_metadata_v2, + c, + id=f"v2-{c.id}", + ) + for c in V2_DOC_CASES + ), +] + + +@pytest.mark.parametrize(("is_fn", "validate_fn", "parse_fn", "case"), ALL_DOC_CASES) +def test_array_metadata_guards( + is_fn: Callable[[object], bool], + validate_fn: Callable[[object], list[ValidationProblem]], + parse_fn: Callable[[object], object], + case: Expect[Callable[[], object], frozenset[tuple[str | int, ...]]], +) -> None: + """is_/validate_/parse_ array-metadata guards agree on validity and locs for each case.""" + doc = case.input() + valid = case.output == frozenset() + assert is_fn(doc) is valid + problems = validate_fn(doc) + assert (problems == []) is valid + assert {p.loc for p in problems} >= case.output + if valid: + assert parse_fn(doc) is doc + else: + with pytest.raises(MetadataValidationError): + parse_fn(doc) + + +# --- strict from_json validation ------------------------------------------- + + +FROM_JSON_REJECT_PARAMS = [ + pytest.param( + ZarrV3ArrayMetadata, + ExpectFail(lambda: {"zarr_format": 3}, MetadataValidationError, id="x"), + id="v3-missing-required", + ), + pytest.param( + ZarrV3ArrayMetadata, + ExpectFail(_mutate(_build_v3, _set("data_type", 5)), MetadataValidationError, id="x"), + id="v3-bad-field-type", + ), + pytest.param( + ZarrV2ArrayMetadata, + ExpectFail(lambda: {"zarr_format": 2}, MetadataValidationError, id="x"), + id="v2-missing-required", + ), + pytest.param( + ZarrV3NamedConfig, + ExpectFail(lambda: 5, MetadataValidationError, id="x"), + id="zarr-metadata-bad-input", + ), +] + + +@pytest.mark.parametrize(("model", "case"), FROM_JSON_REJECT_PARAMS) +def test_from_json_rejects_malformed( + model: type[ZarrV3ArrayMetadata | ZarrV2ArrayMetadata | ZarrV3NamedConfig], + case: ExpectFail[Callable[[], object]], +) -> None: + """from_json raises MetadataValidationError on a malformed document.""" + with case.raises(): + model.from_json(case.input()) + + +# --- ValidationProblem / MetadataValidationError / _prefix ----------------- +# Small structural tests — not "parametrize over inputs" shaped, kept direct. + + +def test_validation_problem_str_with_loc() -> None: + """ValidationProblem.__str__ renders a non-empty loc as a dotted path.""" + p = ValidationProblem(loc=("codecs", 0, "name"), message="expected str", kind="invalid_type") + assert str(p) == "codecs.0.name: expected str" + + +def test_validation_problem_str_empty_loc() -> None: + """ValidationProblem.__str__ renders an empty loc as .""" + p = ValidationProblem(loc=(), message="not a mapping", kind="invalid_type") + assert str(p) == ": not a mapping" + + +def test_validation_problem_is_frozen() -> None: + """ValidationProblem is immutable (frozen dataclass).""" + p = ValidationProblem(loc=("shape",), message="x", kind="invalid_type") + with pytest.raises(dataclasses.FrozenInstanceError): + # setattr: assigning to a frozen field is an intentional runtime error, + # spelled dynamically so it is not also a static type error. + setattr(p, "message", "y") # noqa: B010 + + +def test_metadata_validation_error_holds_problems() -> None: + """MetadataValidationError carries its problem list and renders them in its message.""" + problems = [ + ValidationProblem(loc=("shape",), message="missing required key", kind="missing_key"), + ValidationProblem( + loc=("data_type",), message="expected a metadata field", kind="invalid_type" + ), + ] + err = MetadataValidationError(problems) + assert err.problems == problems + assert "shape: missing required key" in str(err) + assert "data_type: expected a metadata field" in str(err) + + +def test_prefix_prepends_loc_head() -> None: + """_prefix prepends a loc head to each problem's loc.""" + problems = [ValidationProblem(loc=("name",), message="expected str", kind="invalid_type")] + prefixed = _prefix(0, problems) + assert prefixed == [ + ValidationProblem(loc=(0, "name"), message="expected str", kind="invalid_type") + ] + + +# --- Stricter v2/v3 field validation and error kinds ------------------------- + + +def test_v2_dtype_must_be_string_or_records() -> None: + """A non-string, non-records v2 dtype is rejected with an invalid_type problem.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"dtype": 42} + problems = validate_array_metadata_v2(doc) + assert [(p.loc, p.kind) for p in problems] == [(("dtype",), "invalid_type")] + + +def test_v2_structured_dtype_records_accepted() -> None: + """A structured v2 dtype (field records, optionally nested/shaped) validates.""" + dtype = (("a", " None: + """A field record with the wrong arity is rejected.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"dtype": (("a",),)} + problems = validate_array_metadata_v2(doc) + assert [p.loc for p in problems] == [("dtype",)] + + +def test_v2_order_literal_enforced() -> None: + """An order other than 'C' or 'F' is rejected with an invalid_value problem.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"order": "Q"} + problems = validate_array_metadata_v2(doc) + assert [(p.loc, p.kind) for p in problems] == [(("order",), "invalid_value")] + + +def test_v2_compressor_must_be_codec_or_none() -> None: + """A compressor that is not null or a codec config mapping is rejected.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"compressor": "zlib"} + problems = validate_array_metadata_v2(doc) + assert [(p.loc, p.kind) for p in problems] == [(("compressor",), "invalid_type")] + + +def test_v2_compressor_requires_string_id() -> None: + """A compressor mapping without a string id is rejected.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"compressor": {"level": 3}} + problems = validate_array_metadata_v2(doc) + assert [p.loc for p in problems] == [("compressor",)] + + +def test_v2_filters_must_be_codec_sequence_or_none() -> None: + """Filters that are not null or a sequence of codec configs are rejected.""" + for bad in (7, (5,), "gzip"): + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"filters": bad} + problems = validate_array_metadata_v2(doc) + assert [(p.loc, p.kind) for p in problems] == [(("filters",), "invalid_type")], bad + + +def test_v2_shape_and_chunks_must_have_equal_rank() -> None: + """Raw v2 metadata requires one chunk length per array dimension.""" + doc = dict(ZarrV2ArrayMetadata.create_default(shape=(2, 3)).to_json()) + doc["chunks"] = (1,) + + assert [(p.loc, p.kind) for p in validate_array_metadata_v2(doc)] == [ + (("chunks",), "invalid_value") + ] + with pytest.raises(MetadataValidationError, match="same number of dimensions"): + ZarrV2ArrayMetadata.from_key_value({".zarray": json.dumps(doc).encode()}) + + +def test_v2_filters_must_be_nonempty_when_present() -> None: + """A non-null v2 filter sequence contains one or more codec configurations.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) + doc["filters"] = () + + assert [(p.loc, p.kind) for p in validate_array_metadata_v2(doc)] == [ + (("filters",), "invalid_value") + ] + with pytest.raises(MetadataValidationError, match="at least one filter"): + ZarrV2ArrayMetadata.from_key_value({".zarray": json.dumps(doc).encode()}) + + +def test_v2_dimension_separator_literal_enforced() -> None: + """A dimension_separator other than '.' or '/' is rejected.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"dimension_separator": "-"} + problems = validate_array_metadata_v2(doc) + assert [(p.loc, p.kind) for p in problems] == [(("dimension_separator",), "invalid_value")] + + +def test_v2_zarr_format_literal_enforced() -> None: + """A v2 document claiming zarr_format 3 is rejected with an invalid_value problem.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"zarr_format": 3} + problems = validate_array_metadata_v2(doc) + assert [(p.loc, p.kind) for p in problems] == [(("zarr_format",), "invalid_value")] + + +def test_v3_zarr_format_literal_enforced() -> None: + """A v3 document claiming zarr_format 2 is rejected with an invalid_value problem.""" + doc = dict(ZarrV3ArrayMetadata.create_default().to_json()) | {"zarr_format": 2} + problems = validate_array_metadata_v3(doc) + assert [(p.loc, p.kind) for p in problems] == [(("zarr_format",), "invalid_value")] + + +@pytest.mark.parametrize( + ("document", "validate"), + [ + pytest.param( + dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"zarr_format": 2.0}, + validate_array_metadata_v2, + id="v2", + ), + pytest.param( + dict(ZarrV3ArrayMetadata.create_default().to_json()) | {"zarr_format": 3.0}, + validate_array_metadata_v3, + id="v3", + ), + ], +) +def test_array_zarr_format_rejects_float( + document: object, validate: Callable[[object], list[ValidationProblem]] +) -> None: + """Integer-valued floats do not satisfy integer format literals.""" + assert [(p.loc, p.kind) for p in validate(document)] == [(("zarr_format",), "invalid_value")] + + +def test_array_v2_rejects_unknown_document_member() -> None: + """The closed v2 merged-document shape rejects undeclared members.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"unexpected": 1} + + assert [(p.loc, p.kind) for p in validate_array_metadata_v2(doc)] == [ + (("unexpected",), "invalid_value") + ] + + +def test_array_v3_from_json_materializes_abstract_containers() -> None: + """A flexible input mapping becomes the canonical dict/tuple model shape.""" + doc = UserDict(dict(ZarrV3ArrayMetadata.create_default(shape=(2,)).to_json())) + doc["shape"] = range(2) + + model = ZarrV3ArrayMetadata.from_json(doc) + + assert model.shape == (0, 1) + assert type(model.shape) is tuple + + +def test_from_key_value_rejects_non_standard_json_constant() -> None: + """Store JSON decoding rejects JavaScript NaN/Infinity constants.""" + doc = dict(ZarrV3ArrayMetadata.create_default().to_json()) + doc["fill_value"] = float("nan") + raw = json.dumps(doc) + + with pytest.raises(MetadataValidationError, match="invalid JSON"): + ZarrV3ArrayMetadata.from_key_value({"zarr.json": raw.encode()}) + + +def test_to_key_value_rejects_non_finite_model_value() -> None: + """Strict encoding prevents directly-constructed models from writing invalid JSON.""" + model = ZarrV3ArrayMetadata.create_default(fill_value=float("nan")) + + with pytest.raises(ValueError, match="JSON compliant"): + model.to_key_value() + + +def test_v3_node_type_literal_enforced() -> None: + """A v3 array document claiming node_type 'group' is rejected.""" + doc = dict(ZarrV3ArrayMetadata.create_default().to_json()) | {"node_type": "group"} + problems = validate_array_metadata_v3(doc) + assert [(p.loc, p.kind) for p in problems] == [(("node_type",), "invalid_value")] + + +def test_missing_key_kind_is_machine_readable() -> None: + """A missing required key is distinguishable by kind, without message matching.""" + doc = dict(ZarrV3ArrayMetadata.create_default().to_json()) + del doc["chunk_key_encoding"] + problems = validate_array_metadata_v3(doc) + assert problems == [ + ValidationProblem(("chunk_key_encoding",), "missing required key", "missing_key") + ] + + +# --- Unified error channels --------------------------------------------------- + + +def test_from_key_value_invalid_json_raises_metadata_error() -> None: + """Undecodable store bytes raise MetadataValidationError (kind invalid_json), not JSONDecodeError.""" + with pytest.raises(MetadataValidationError) as exc_info: + ZarrV3ArrayMetadata.from_key_value({"zarr.json": b"{not json"}) + assert [p.kind for p in exc_info.value.problems] == ["invalid_json"] + + +def test_from_key_value_invalid_utf8_raises_metadata_error() -> None: + """Invalid UTF-8 store bytes use the same invalid_json error channel.""" + with pytest.raises(MetadataValidationError) as exc_info: + ZarrV3ArrayMetadata.from_key_value({"zarr.json": b"\x80"}) + assert [p.kind for p in exc_info.value.problems] == ["invalid_json"] + + +def test_v2_from_key_value_scalar_root_raises_metadata_error() -> None: + """A scalar .zarray document fails through the unified metadata error channel.""" + with pytest.raises(MetadataValidationError) as exc_info: + ZarrV2ArrayMetadata.from_key_value({".zarray": b"null"}) + assert [(problem.loc, problem.kind) for problem in exc_info.value.problems] == [ + ((), "invalid_type") + ] + + +def test_from_key_value_missing_key_kind() -> None: + """A missing store key surfaces as a missing_key problem at the store-key loc.""" + with pytest.raises(MetadataValidationError) as exc_info: + ZarrV2ArrayMetadata.from_key_value({}) + assert exc_info.value.problems == [ + ValidationProblem((".zarray",), "missing store key", "missing_key") + ] + + +def test_extra_fields_overlap_raises_metadata_error() -> None: + """The extra-fields overlap invariant raises MetadataValidationError (a ValueError).""" + with pytest.raises(MetadataValidationError, match="Extra fields") as exc_info: + ZarrV3ArrayMetadata.create_default(extra_fields={"shape": {"must_understand": False}}) + assert [p.kind for p in exc_info.value.problems] == ["invalid_value"] + + +def test_extension_point_fields_annotated_with_role_alias() -> None: + """Extension-point fields are annotated with ZarrV3MetadataField (the + logical role), not ZarrV3NamedConfig (the current serialized form), so a + future widening of the field union does not move annotation sites.""" + assert ZarrV3MetadataField is ZarrV3NamedConfig + annotations = ZarrV3ArrayMetadata.__annotations__ + for field_name in ("data_type", "chunk_grid", "chunk_key_encoding"): + assert annotations[field_name] == "ZarrV3MetadataField" + for field_name in ("codecs", "storage_transformers"): + assert annotations[field_name] == "tuple[ZarrV3MetadataField, ...]" + + +# --- Adversarial-probe fixes: documents that used to pass validation --------- + + +def test_shape_rejects_json_booleans() -> None: + """JSON booleans are not integers: shape/chunks containing true/false are + rejected (bool is an int subclass in Python, so isinstance alone passes).""" + v3 = dict(ZarrV3ArrayMetadata.create_default().to_json()) | {"shape": (True, True)} + assert [p.loc for p in validate_array_metadata_v3(v3)] == [("shape",)] + v2 = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"chunks": (True,)} + assert [p.loc for p in validate_array_metadata_v2(v2)] == [("chunks",)] + + +def test_shape_rejects_negative_dimensions() -> None: + """Dimension lengths must be non-negative; a negative entry is invalid_value.""" + v3 = dict(ZarrV3ArrayMetadata.create_default().to_json()) | {"shape": (-1,)} + assert [(p.loc, p.kind) for p in validate_array_metadata_v3(v3)] == [ + (("shape",), "invalid_value") + ] + v2 = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"chunks": (-5,)} + assert [(p.loc, p.kind) for p in validate_array_metadata_v2(v2)] == [ + (("chunks",), "invalid_value") + ] + + +def test_dimension_names_length_must_match_shape() -> None: + """dimension_names must have one entry per dimension of shape.""" + doc = dict(ZarrV3ArrayMetadata.create_default(shape=(10,)).to_json()) | { + "dimension_names": ("x", "y", "z") + } + assert [(p.loc, p.kind) for p in validate_array_metadata_v3(doc)] == [ + (("dimension_names",), "invalid_value") + ] + + +def test_attributes_values_must_be_json() -> None: + """Attribute values are JSON-checked recursively (like fill_value), so a + non-serializable value is a validation problem, not a later TypeError.""" + doc = dict(ZarrV3ArrayMetadata.create_default().to_json()) | {"attributes": {"a": {1, 2}}} + problems = validate_array_metadata_v3(doc) + assert [(p.loc, p.kind) for p in problems] == [(("attributes", "a"), "invalid_type")] + + +def test_configuration_values_must_be_json() -> None: + """Configuration values are JSON-checked recursively, so an int-keyed dict + cannot pass validation and be silently rewritten by json.dumps.""" + doc = dict(ZarrV3ArrayMetadata.create_default().to_json()) | { + "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": {1: 2}}} + } + problems = validate_array_metadata_v3(doc) + assert [(p.loc, p.kind) for p in problems] == [ + (("chunk_grid", "configuration", "chunk_shape"), "invalid_type") + ] + + +def test_v3_extension_keys_must_be_strings() -> None: + """A non-string top-level key cannot be represented by a v3 document type.""" + doc: dict[object, object] = dict(ZarrV3ArrayMetadata.create_default().to_json()) + doc[1] = {"must_understand": False} + assert [(problem.loc, problem.kind) for problem in validate_array_metadata_v3(doc)] == [ + ((), "invalid_type") + ] + + +def test_v3_extension_values_must_be_json() -> None: + """Extension payloads are JSON-checked before a model is constructed.""" + doc = dict(ZarrV3ArrayMetadata.create_default().to_json()) + doc["ext"] = {"must_understand": False, "payload": object()} + assert [(problem.loc, problem.kind) for problem in validate_array_metadata_v3(doc)] == [ + (("ext", "payload"), "invalid_type") + ] + + +def test_v3_json_extension_without_waiver_is_preserved_as_must_understand() -> None: + """A JSON extension without an explicit false waiver remains must-understand.""" + doc = dict(ZarrV3ArrayMetadata.create_default().to_json()) + doc["ext"] = 1 + parsed = parse_array_metadata_v3(doc) + assert is_array_metadata_v3(parsed) + model = ZarrV3ArrayMetadata.from_json(doc) + assert model.extra_fields["ext"] == 1 + assert model.must_understand_fields == {"ext": 1} + + +def test_v2_codec_configuration_values_must_be_json() -> None: + """Non-JSON codec parameters are rejected for compressors and filters.""" + for field, value, expected_loc in ( + ("compressor", {"id": "x", "payload": object()}, ("compressor", "payload")), + ("filters", ({"id": "x", "payload": object()},), ("filters", 0, "payload")), + ): + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) + doc[field] = value + assert [(problem.loc, problem.kind) for problem in validate_array_metadata_v2(doc)] == [ + (expected_loc, "invalid_type") + ] + + +def test_dimension_sequences_reject_binary_values() -> None: + """Binary buffers are not JSON arrays even though they are integer sequences.""" + v3 = dict(ZarrV3ArrayMetadata.create_default().to_json()) | {"shape": b"\x02"} + v2 = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"chunks": b"\x02"} + assert [(problem.loc, problem.kind) for problem in validate_array_metadata_v3(v3)] == [ + (("shape",), "invalid_type") + ] + assert [(problem.loc, problem.kind) for problem in validate_array_metadata_v2(v2)] == [ + (("chunks",), "invalid_type") + ] + + +def test_array_parsers_normalize_json_lists_before_narrowing() -> None: + """Parsers return tuple-backed document types while guards reject raw list forms.""" + v3_raw = json.loads(json.dumps(ZarrV3ArrayMetadata.create_default(shape=(2,)).to_json())) + v2_raw = json.loads(json.dumps(ZarrV2ArrayMetadata.create_default(shape=(2,)).to_json())) + + assert validate_array_metadata_v3(v3_raw) == [] + assert validate_array_metadata_v2(v2_raw) == [] + assert not is_array_metadata_v3(v3_raw) + assert not is_array_metadata_v2(v2_raw) + + v3_parsed = parse_array_metadata_v3(v3_raw) + v2_parsed = parse_array_metadata_v2(v2_raw) + assert isinstance(v3_parsed["shape"], tuple) + assert isinstance(v3_parsed["codecs"], tuple) + assert isinstance(v2_parsed["shape"], tuple) + assert isinstance(v2_parsed["chunks"], tuple) + + +def test_array_guards_reject_noncanonical_nested_json() -> None: + """Document guards cannot narrow values that only parsers can materialize.""" + v3 = dict(ZarrV3ArrayMetadata.create_default().to_json()) + v3["fill_value"] = range(2) + v2 = dict(ZarrV2ArrayMetadata.create_default().to_json()) + v2["fill_value"] = range(2) + + assert not is_array_metadata_v3(v3) + assert not is_array_metadata_v2(v2) + assert parse_array_metadata_v3(v3)["fill_value"] == (0, 1) + assert parse_array_metadata_v2(v2)["fill_value"] == (0, 1) + + +# --- must_understand partition (spec: MUST fail to open unrecognized fields) -- + + +def test_must_understand_fields_partition() -> None: + """must_understand_fields contains every extra field not explicitly waived + with must_understand: false, including implicitly-true and non-mapping + fields, so a reader can discharge the spec's fail-to-open duty by + subtracting the extensions it recognizes.""" + model = ZarrV3ArrayMetadata.create_default( + extra_fields={ + "ext_a": {"name": "a", "must_understand": False}, + "ext_b": {"name": "b"}, + "ext_c": {"name": "c", "must_understand": True}, + "ext_d": 123, + } + ) + assert set(model.must_understand_fields) == {"ext_b", "ext_c", "ext_d"} + recognized = {"ext_b"} + assert model.must_understand_fields.keys() - recognized == {"ext_c", "ext_d"} + + +def test_must_understand_fields_empty_when_all_waived() -> None: + """must_understand_fields is empty when every extra field is explicitly waived.""" + model = ZarrV3ArrayMetadata.create_default( + extra_fields={"ext_a": {"name": "a", "must_understand": False}} + ) + assert model.must_understand_fields == {} + + +def test_dimension_names_null_field_rejected() -> None: + """A dimension_names field whose VALUE is null is invalid: the spec permits + null as an element (an unnamed dimension), never as the field value — "not + specified" is spelled by omitting the key. Consumers bridging from an + in-memory None sentinel must drop the key, not write null.""" + doc = dict(ZarrV3ArrayMetadata.create_default().to_json()) | {"dimension_names": None} + problems = validate_array_metadata_v3(doc) + assert [(p.loc, p.kind) for p in problems] == [(("dimension_names",), "invalid_type")] + # and the model's own None spelling correctly maps to key absence + assert ( + "dimension_names" not in ZarrV3ArrayMetadata.create_default(dimension_names=UNSET).to_json() + ) + + +# --- create_default derives the chunk grid from shape ------------------------ + + +def test_v3_create_default_chunk_grid_follows_shape() -> None: + """Overriding shape without chunk_grid derives a consistent default grid: + one chunk covering the array (chunk_shape == shape), instead of silently + keeping the scalar default's 0-d grid.""" + model = ZarrV3ArrayMetadata.create_default(shape=(100, 100)) + assert model.chunk_grid == ZarrV3NamedConfig( + name="regular", configuration={"chunk_shape": (100, 100)} + ) + + +def test_v3_create_default_explicit_chunk_grid_respected() -> None: + """An explicit chunk_grid override wins over the shape-derived default.""" + grid = ZarrV3NamedConfig(name="regular", configuration={"chunk_shape": (10, 10)}) + model = ZarrV3ArrayMetadata.create_default(shape=(100, 100), chunk_grid=grid) + assert model.chunk_grid == grid + + +def test_v2_create_default_chunks_follow_shape() -> None: + """Overriding shape without chunks derives chunks == shape.""" + model = ZarrV2ArrayMetadata.create_default(shape=(100, 100)) + assert model.chunks == (100, 100) + + +def test_v2_create_default_explicit_chunks_respected() -> None: + """An explicit chunks override wins over the shape-derived default.""" + model = ZarrV2ArrayMetadata.create_default(shape=(100, 100), chunks=(10, 10)) + assert model.chunks == (10, 10) + + +def test_v3_create_default_zero_length_dimensions() -> None: + """chunk_shape == shape is spec-sound even with zero-length dimensions: + 'The chunk shape elements are non-zero when the corresponding dimensions + of the arrays have non-zero length' — the constraint is conditional, so a + zero chunk length is permitted exactly where the dimension is empty.""" + model = ZarrV3ArrayMetadata.create_default(shape=(0, 3)) + assert model.chunk_grid.configuration["chunk_shape"] == (0, 3) + + +def test_create_default_derivation_is_one_way() -> None: + """Overriding the chunk grid (v3) or chunks (v2) without shape leaves the + scalar default shape=() untouched: a user-supplied chunk_grid is an + extension point taken verbatim, and deriving shape from it would require + interpreting grid configurations, which the model layer never does.""" + grid = ZarrV3NamedConfig(name="regular", configuration={"chunk_shape": (10, 10)}) + v3 = ZarrV3ArrayMetadata.create_default(chunk_grid=grid) + assert v3.shape == () + assert v3.chunk_grid == grid + v2 = ZarrV2ArrayMetadata.create_default(chunks=(10, 10)) + assert v2.shape == () + assert v2.chunks == (10, 10) + + +# --- v2 dimension_separator default (roborev job 426) ------------------------- + + +def test_v2_absent_dimension_separator_means_dot() -> None: + """A .zarray that omits dimension_separator uses the v2 convention default + '.', not '/': chunk keys of real-world default-separator v2 arrays look + like '0.0'. The model normalizes the absent key to an explicit '.' — a + semantics-preserving spelling normalization.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) + del doc["dimension_separator"] + model = ZarrV2ArrayMetadata.from_json(doc) + assert model.dimension_separator == "." + assert model.to_json()["dimension_separator"] == "." + + +def test_v2_from_key_value_without_separator_means_dot() -> None: + """The .zarray store-file path applies the same '.' default for an absent + dimension_separator key.""" + doc = { + k: v + for k, v in ZarrV2ArrayMetadata.create_default().to_json().items() + if k not in ("dimension_separator", "attributes") + } + import json as _json + + model = ZarrV2ArrayMetadata.from_key_value({".zarray": _json.dumps(doc).encode()}) + assert model.dimension_separator == "." + + +def test_v2_null_dimension_separator_rejected() -> None: + """dimension_separator may be absent, '.', or '/' — never null: the + document grammar has no null spelling for this field.""" + doc = dict(ZarrV2ArrayMetadata.create_default().to_json()) | {"dimension_separator": None} + problems = validate_array_metadata_v2(doc) + assert [(p.loc, p.kind) for p in problems] == [(("dimension_separator",), "invalid_value")] + + +def test_dimension_names_absent_and_all_null_are_distinct() -> None: + """An absent dimension_names field and an explicit all-null one are + semantically different documents: the explicit form says every dimension + has a name, which is null; absence says there are no dimension names. + The model preserves the distinction (UNSET vs a tuple of Nones), and both + spellings round-trip faithfully.""" + absent_doc = dict(ZarrV3ArrayMetadata.create_default(shape=(2, 3)).to_json()) + explicit_doc = absent_doc | {"dimension_names": (None, None)} + + absent = ZarrV3ArrayMetadata.from_json(absent_doc) + explicit = ZarrV3ArrayMetadata.from_json(explicit_doc) + + assert absent.dimension_names is UNSET + assert explicit.dimension_names == (None, None) + assert absent != explicit + assert "dimension_names" not in absent.to_json() + assert absent.to_json() == absent_doc + assert explicit.to_json() == explicit_doc diff --git a/packages/zarr-metadata/tests/model/test_group.py b/packages/zarr-metadata/tests/model/test_group.py new file mode 100644 index 0000000000..4b8c22b84d --- /dev/null +++ b/packages/zarr-metadata/tests/model/test_group.py @@ -0,0 +1,572 @@ +"""Tests for the group and consolidated metadata models in `zarr_metadata.model`.""" + +import copy +import dataclasses +import json +from collections import UserDict +from collections.abc import Callable + +import pytest + +from tests.model._cases import mutate_nested_containers +from zarr_metadata.model import UNSET +from zarr_metadata.model._array import ZarrV3ArrayMetadata +from zarr_metadata.model._group import ( + ZarrV2ConsolidatedMetadata, + ZarrV2GroupMetadata, + ZarrV2GroupMetadataPartial, + ZarrV3ConsolidatedMetadata, + ZarrV3GroupMetadata, + ZarrV3GroupMetadataPartial, +) +from zarr_metadata.model._validation import ( + MetadataValidationError, + ValidationProblem, + is_group_metadata_v2, + is_group_metadata_v3, + parse_group_metadata_v2, + parse_group_metadata_v3, + validate_group_metadata_v2, + validate_group_metadata_v3, +) + +# --- ZarrV3GroupMetadata --------------------------------------------------- + + +def test_group_v3_roundtrip() -> None: + """A v3 group document round-trips through the model unchanged.""" + doc = {"zarr_format": 3, "node_type": "group", "attributes": {"a": (1, 2)}} + model = ZarrV3GroupMetadata.from_json(doc) + assert model.to_json() == doc + + +def test_group_v3_omits_empty_attributes() -> None: + """to_json omits the attributes key when attributes is empty.""" + model = ZarrV3GroupMetadata.create_default() + assert "attributes" not in model.to_json() + + +def test_group_v3_lists_become_tuples() -> None: + """from_json converts JSON arrays in attributes to tuples.""" + doc = {"zarr_format": 3, "node_type": "group", "attributes": {"a": [1, 2]}} + model = ZarrV3GroupMetadata.from_json(doc) + assert model.attributes == {"a": (1, 2)} + + +def test_group_v3_extra_fields_roundtrip() -> None: + """Unknown top-level keys land in extra_fields and reappear in to_json.""" + doc = { + "zarr_format": 3, + "node_type": "group", + "my_extension": {"name": "thing", "must_understand": False}, + } + model = ZarrV3GroupMetadata.from_json(doc) + assert model.extra_fields == {"my_extension": {"name": "thing", "must_understand": False}} + assert model.to_json() == doc + + +def test_group_v3_json_extra_field_roundtrips_as_must_understand() -> None: + """A non-object extra field is preserved and implicitly requires understanding.""" + doc = {"zarr_format": 3, "node_type": "group", "ext": [1, 2]} + model = ZarrV3GroupMetadata.from_json(doc) + assert model.to_json()["ext"] == (1, 2) + assert model.must_understand_fields == {"ext": (1, 2)} + + +def test_group_v3_extra_fields_overlap_rejected() -> None: + """Constructing a v3 group model with extra_fields shadowing a standard key raises.""" + with pytest.raises(ValueError, match="Extra fields"): + ZarrV3GroupMetadata( + attributes={}, + consolidated_metadata=UNSET, + extra_fields={"node_type": {"name": "x", "must_understand": False}}, + ) + + +def test_group_v3_consolidated_extra_field_rejected() -> None: + """extra_fields may not shadow the consolidated_metadata convention key.""" + with pytest.raises(ValueError, match="Extra fields"): + ZarrV3GroupMetadata( + attributes={}, + consolidated_metadata=UNSET, + extra_fields={"consolidated_metadata": {"name": "x", "must_understand": False}}, + ) + + +def test_group_v3_missing_required_key() -> None: + """parse_group_metadata_v3 reports each missing required key.""" + with pytest.raises(MetadataValidationError, match="node_type"): + parse_group_metadata_v3({"zarr_format": 3}) + + +def test_group_v3_bad_attributes() -> None: + """parse_group_metadata_v3 rejects a non-mapping attributes value.""" + with pytest.raises(MetadataValidationError, match="attributes"): + parse_group_metadata_v3({"zarr_format": 3, "node_type": "group", "attributes": 5}) + + +@pytest.mark.parametrize( + ("document", "validate"), + [ + pytest.param( + {"zarr_format": 2.0}, + validate_group_metadata_v2, + id="v2", + ), + pytest.param( + {"zarr_format": 3.0, "node_type": "group"}, + validate_group_metadata_v3, + id="v3", + ), + ], +) +def test_group_zarr_format_rejects_float( + document: object, validate: Callable[[object], list[ValidationProblem]] +) -> None: + """Integer-valued floats do not satisfy integer format literals.""" + assert [(p.loc, p.kind) for p in validate(document)] == [(("zarr_format",), "invalid_value")] + + +def test_group_v2_rejects_unknown_document_member() -> None: + """The closed v2 merged-document shape rejects undeclared members.""" + assert [(p.loc, p.kind) for p in validate_group_metadata_v2({"zarr_format": 2, "x": 1})] == [ + (("x",), "invalid_value") + ] + + +@pytest.mark.parametrize( + ("parse", "document"), + [ + pytest.param(parse_group_metadata_v2, {"zarr_format": 2}, id="v2"), + pytest.param( + parse_group_metadata_v3, + {"zarr_format": 3, "node_type": "group"}, + id="v3", + ), + ], +) +def test_group_parser_materializes_abstract_mapping( + parse: Callable[[object], object], document: dict[str, object] +) -> None: + """A successful group parser always returns the declared concrete TypedDict shape.""" + parsed = parse(UserDict(document)) + + assert type(parsed) is dict + assert parsed == document + + +def test_group_guards_reject_noncanonical_nested_json() -> None: + """Document guards cannot narrow values that only parsers can materialize.""" + v3 = {"zarr_format": 3, "node_type": "group", "extension": range(2)} + v2 = {"zarr_format": 2, "attributes": {"values": range(2)}} + + assert not is_group_metadata_v3(v3) + assert not is_group_metadata_v2(v2) + assert parse_group_metadata_v3(v3)["extension"] == (0, 1) + assert parse_group_metadata_v2(v2)["attributes"] == {"values": (0, 1)} + + +def test_group_v3_extension_fields_are_validated() -> None: + """Group extension payloads must be JSON values with a must-understand flag.""" + doc = { + "zarr_format": 3, + "node_type": "group", + "ext": {"must_understand": False, "payload": object()}, + } + assert [(problem.loc, problem.kind) for problem in validate_group_metadata_v3(doc)] == [ + (("ext", "payload"), "invalid_type") + ] + + +def test_group_v3_key_value_roundtrip() -> None: + """from_key_value(to_key_value()) is the identity for v3 groups.""" + model = ZarrV3GroupMetadata.create_default(attributes={"a": 1}) + assert ZarrV3GroupMetadata.from_key_value(model.to_key_value()) == model + + +def test_group_v3_update() -> None: + """update replaces the given fields and returns a new instance.""" + base = ZarrV3GroupMetadata.create_default() + updated = base.update(attributes={"a": 1}) + assert updated.attributes == {"a": 1} + assert base.attributes == {} + + +# --- ZarrV2GroupMetadata --------------------------------------------------- + + +def test_group_v2_key_value_split() -> None: + """v2 to_key_value writes .zgroup and .zattrs; from_key_value merges them.""" + model = ZarrV2GroupMetadata.create_default(attributes={"a": 1}) + kv = model.to_key_value() + assert set(kv) == {".zgroup", ".zattrs"} + assert json.loads(kv[".zgroup"]) == {"zarr_format": 2} + assert ZarrV2GroupMetadata.from_key_value(kv) == model + + +@pytest.mark.parametrize("extra_key", ["attributes", "vendor_extension"]) +def test_v2_group_from_key_value_rejects_zgroup_extra_members(extra_key: str) -> None: + """Raw `.zgroup` documents reject every non-spec member.""" + doc: dict[str, object] = {"zarr_format": 2, extra_key: {}} + + with pytest.raises(MetadataValidationError) as exc_info: + ZarrV2GroupMetadata.from_key_value({".zgroup": json.dumps(doc).encode()}) + + assert [(problem.loc, problem.kind) for problem in exc_info.value.problems] == [ + ((extra_key,), "invalid_value") + ] + + +def test_group_v2_zattrs_presence_round_trips() -> None: + """A v2 group with no .zattrs file parses with UNSET attributes and emits + no .zattrs; an explicit empty .zattrs stays a file — the stores remain + distinct through a round-trip.""" + absent = ZarrV2GroupMetadata.from_key_value({".zgroup": b'{"zarr_format": 2}'}) + assert absent.attributes is UNSET + assert ".zattrs" not in absent.to_key_value() + explicit = ZarrV2GroupMetadata.from_key_value( + {".zgroup": b'{"zarr_format": 2}', ".zattrs": b"{}"} + ) + assert explicit.attributes == {} + assert ".zattrs" in explicit.to_key_value() + assert absent != explicit + + +def test_group_v2_json_roundtrip() -> None: + """A merged-form v2 group document round-trips through the model unchanged.""" + doc = {"zarr_format": 2, "attributes": {"a": 1}} + model = ZarrV2GroupMetadata.from_json(doc) + assert model.to_json() == doc + + +def test_group_v2_omits_empty_attributes() -> None: + """to_json omits the attributes key when attributes is empty.""" + assert "attributes" not in ZarrV2GroupMetadata.create_default().to_json() + + +def test_group_v2_not_a_mapping() -> None: + """parse_group_metadata_v2 rejects a non-mapping document.""" + with pytest.raises(MetadataValidationError, match="expected a mapping"): + parse_group_metadata_v2([1, 2, 3]) + + +def test_group_v2_missing_required_key() -> None: + """parse_group_metadata_v2 reports a missing zarr_format key.""" + with pytest.raises(MetadataValidationError, match="zarr_format"): + parse_group_metadata_v2({}) + + +# --- Partial TypedDict drift guards ----------------------------------------- + + +def test_group_partial_keys_match_settable_model_fields() -> None: + """Each group partial TypedDict must list exactly the settable model fields. + + Guards against drift: adding/removing a settable field on a group model + without updating its `*Partial` TypedDict fails here. + """ + for model_cls, partial_cls in ( + (ZarrV3GroupMetadata, ZarrV3GroupMetadataPartial), + (ZarrV2GroupMetadata, ZarrV2GroupMetadataPartial), + ): + settable = {f.name for f in dataclasses.fields(model_cls) if f.init} + assert set(partial_cls.__annotations__) == settable + + +# --- ZarrV3ConsolidatedMetadata -------------------------------------------- + + +def test_consolidated_v3_roundtrip() -> None: + """A v3 group with inline consolidated metadata round-trips, with child + entries parsed into array/group models.""" + child = ZarrV3ArrayMetadata.create_default(shape=(2,)).to_json() + doc = { + "zarr_format": 3, + "node_type": "group", + "consolidated_metadata": { + "kind": "inline", + "must_understand": False, + "metadata": {"a": child, "g": {"zarr_format": 3, "node_type": "group"}}, + }, + } + model = ZarrV3GroupMetadata.from_json(doc) + assert isinstance(model.consolidated_metadata, ZarrV3ConsolidatedMetadata) + assert isinstance(model.consolidated_metadata.metadata["a"], ZarrV3ArrayMetadata) + assert isinstance(model.consolidated_metadata.metadata["g"], ZarrV3GroupMetadata) + assert model.to_json() == doc + + +def test_consolidated_v3_must_understand_true_rejected() -> None: + """ZarrV3ConsolidatedMetadata enforces must_understand=False at runtime.""" + with pytest.raises(ValueError, match="must_understand"): + ZarrV3ConsolidatedMetadata(must_understand=True, metadata={}) + + +def test_consolidated_v3_from_json_must_understand_true_rejected() -> None: + """from_json rejects a consolidated document carrying must_understand=true.""" + with pytest.raises(MetadataValidationError, match="must_understand"): + ZarrV3ConsolidatedMetadata.from_json( + {"kind": "inline", "must_understand": True, "metadata": {}} + ) + + +def test_consolidated_v3_entry_without_node_type_rejected() -> None: + """from_json rejects a consolidated entry lacking a recognizable node_type.""" + with pytest.raises(MetadataValidationError, match="node_type"): + ZarrV3ConsolidatedMetadata.from_json( + {"kind": "inline", "must_understand": False, "metadata": {"a": {"zarr_format": 3}}} + ) + + +def test_consolidated_v3_not_a_mapping() -> None: + """from_json rejects a non-mapping consolidated document.""" + with pytest.raises(MetadataValidationError, match="expected a mapping"): + ZarrV3ConsolidatedMetadata.from_json(5) + + +# --- ZarrV2ConsolidatedMetadata -------------------------------------------- + + +def test_consolidated_v2_verbatim_roundtrip() -> None: + """The v2 .zmetadata model holds the flat file-keyed map verbatim, + including nodes that have no .zattrs entry.""" + doc = { + "zarr_consolidated_format": 1, + "metadata": { + ".zgroup": {"zarr_format": 2}, + "a/.zarray": { + "zarr_format": 2, + "shape": (2,), + "chunks": (2,), + "dtype": "|u1", + "fill_value": 0, + "order": "C", + "compressor": None, + "filters": None, + }, + }, + } + model = ZarrV2ConsolidatedMetadata.from_json(doc) + assert model.to_json() == doc + + +def test_consolidated_v2_key_value_roundtrip() -> None: + """from_key_value(to_key_value()) is the identity for .zmetadata documents.""" + model = ZarrV2ConsolidatedMetadata.from_json( + {"zarr_consolidated_format": 1, "metadata": {".zgroup": {"zarr_format": 2}}} + ) + assert ZarrV2ConsolidatedMetadata.from_key_value(model.to_key_value()) == model + + +def test_consolidated_v2_lists_become_tuples() -> None: + """from_json converts JSON arrays inside entries to tuples.""" + doc = { + "zarr_consolidated_format": 1, + "metadata": {"a/.zarray": {"shape": [2, 3]}}, + } + model = ZarrV2ConsolidatedMetadata.from_json(doc) + assert model.metadata == {"a/.zarray": {"shape": (2, 3)}} + + +def test_consolidated_v2_envelope_validation() -> None: + """from_json rejects a .zmetadata document missing the metadata key.""" + with pytest.raises(MetadataValidationError, match="metadata"): + ZarrV2ConsolidatedMetadata.from_json({"zarr_consolidated_format": 1}) + + +def test_consolidated_v2_not_a_mapping() -> None: + """from_json rejects a non-mapping .zmetadata document.""" + with pytest.raises(MetadataValidationError, match="expected a mapping"): + ZarrV2ConsolidatedMetadata.from_json([1]) + + +def test_consolidated_v2_format_literal_enforced() -> None: + """A .zmetadata document must declare consolidated format 1.""" + with pytest.raises(MetadataValidationError) as exc_info: + ZarrV2ConsolidatedMetadata.from_json({"zarr_consolidated_format": 2, "metadata": {}}) + assert [(problem.loc, problem.kind) for problem in exc_info.value.problems] == [ + (("zarr_consolidated_format",), "invalid_value") + ] + + +def test_consolidated_v2_metadata_values_must_be_json() -> None: + """Non-JSON values in the flat metadata map are rejected during ingestion.""" + with pytest.raises(MetadataValidationError) as exc_info: + ZarrV2ConsolidatedMetadata.from_json( + {"zarr_consolidated_format": 1, "metadata": {".zgroup": object()}} + ) + assert [(problem.loc, problem.kind) for problem in exc_info.value.problems] == [ + (("metadata", ".zgroup"), "invalid_type") + ] + + +def test_group_v2_from_key_value_scalar_root_raises_metadata_error() -> None: + """A scalar .zgroup document fails through the unified metadata error channel.""" + with pytest.raises(MetadataValidationError) as exc_info: + ZarrV2GroupMetadata.from_key_value({".zgroup": b"null"}) + assert [(problem.loc, problem.kind) for problem in exc_info.value.problems] == [ + ((), "invalid_type") + ] + + +# --- Literal-value enforcement ----------------------------------------------- + + +def test_group_v3_literals_enforced() -> None: + """A v3 group doc with wrong zarr_format or node_type is rejected with invalid_value.""" + base = ZarrV3GroupMetadata.create_default().to_json() + for key, bad in (("zarr_format", 2), ("node_type", "array")): + problems = validate_group_metadata_v3(dict(base) | {key: bad}) + assert [(p.loc, p.kind) for p in problems] == [((key,), "invalid_value")], key + + +def test_group_v2_zarr_format_literal_enforced() -> None: + """A v2 group doc claiming zarr_format 3 is rejected with invalid_value.""" + problems = validate_group_metadata_v2({"zarr_format": 3}) + assert [(p.loc, p.kind) for p in problems] == [(("zarr_format",), "invalid_value")] + + +# --- Consolidated envelope validated by the group validator ------------------ + + +def test_group_v3_validator_agrees_with_from_json_on_consolidated() -> None: + """The group validator validates the consolidated envelope and entries, so + is_group_metadata_v3 never vouches for a document from_json would reject.""" + bad_docs = ( + # empty envelope: missing kind/must_understand/metadata + {"zarr_format": 3, "node_type": "group", "consolidated_metadata": {}}, + # entry without a recognizable node_type + { + "zarr_format": 3, + "node_type": "group", + "consolidated_metadata": { + "kind": "inline", + "must_understand": False, + "metadata": {"a": {"zarr_format": 3}}, + }, + }, + # must_understand: true + { + "zarr_format": 3, + "node_type": "group", + "consolidated_metadata": { + "kind": "inline", + "must_understand": True, + "metadata": {}, + }, + }, + ) + for doc in bad_docs: + assert validate_group_metadata_v3(doc) != [], doc + with pytest.raises(MetadataValidationError): + ZarrV3GroupMetadata.from_json(doc) + + +def test_group_v3_valid_consolidated_passes_validator() -> None: + """A well-formed consolidated group validates cleanly (control case).""" + child = ZarrV3ArrayMetadata.create_default(shape=(2,)).to_json() + doc = { + "zarr_format": 3, + "node_type": "group", + "consolidated_metadata": { + "kind": "inline", + "must_understand": False, + "metadata": {"a": child, "g": {"zarr_format": 3, "node_type": "group"}}, + }, + } + assert validate_group_metadata_v3(doc) == [] + + +def test_v3_consolidated_rejects_unknown_envelope_member() -> None: + """The inline consolidated envelope is closed and never drops accepted members.""" + doc = { + "kind": "inline", + "must_understand": False, + "metadata": {}, + "unexpected": 1, + } + + with pytest.raises(MetadataValidationError, match="unexpected"): + ZarrV3ConsolidatedMetadata.from_json(doc) + + +def test_v2_consolidated_rejects_unknown_document_member() -> None: + """The v2 consolidated document is closed and never drops accepted members.""" + doc = {"zarr_consolidated_format": 1, "metadata": {}, "unexpected": 1} + + with pytest.raises(MetadataValidationError, match="unexpected"): + ZarrV2ConsolidatedMetadata.from_json(doc) + + +# --- must_understand partition ------------------------------------------------ + + +def test_group_must_understand_fields_partition() -> None: + """The group model partitions extra fields by the spec's implicit-true rule, + like the array model.""" + model = ZarrV3GroupMetadata.create_default( + extra_fields={ + "waived": {"name": "w", "must_understand": False}, + "implicit": {"name": "i"}, + } + ) + assert set(model.must_understand_fields) == {"implicit"} + + +def test_group_v3_null_consolidated_metadata_repaired_to_absence() -> None: + """consolidated_metadata: null was written by a historical zarr-python bug. + Those stores must remain readable, but the bug spelling is not honored: + it is read as absence (UNSET) and never written back — the round-trip + deliberately repairs the document rather than preserving the bug.""" + null_doc = {"zarr_format": 3, "node_type": "group", "consolidated_metadata": None} + assert validate_group_metadata_v3(null_doc) == [] + model = ZarrV3GroupMetadata.from_json(null_doc) + assert model.consolidated_metadata is UNSET + assert "consolidated_metadata" not in model.to_json() + assert model == ZarrV3GroupMetadata.from_json({"zarr_format": 3, "node_type": "group"}) + + +# --- to_json shares no mutable state with the model ------------------------ + +TO_JSON_NO_ALIASING_PARAMS = [ + pytest.param( + ZarrV3GroupMetadata.create_default( + attributes={"a": {"b": [1]}}, + consolidated_metadata=ZarrV3ConsolidatedMetadata( + metadata={ + "child": ZarrV3ArrayMetadata.create_default(attributes={"x": {"y": 1}}), + "grp": ZarrV3GroupMetadata.create_default(attributes={"x": {"y": 1}}), + } + ), + extra_fields={"ext": {"must_understand": False, "cfg": {"x": [1]}}}, + ), + id="v3-group", + ), + pytest.param( + ZarrV2GroupMetadata.create_default(attributes={"a": {"b": [1]}}), + id="v2-group", + ), + pytest.param( + ZarrV3ConsolidatedMetadata( + metadata={"child": ZarrV3ArrayMetadata.create_default(attributes={"x": {"y": 1}})} + ), + id="v3-consolidated", + ), + pytest.param( + ZarrV2ConsolidatedMetadata(metadata={"a/.zarray": {"nested": {"x": [1]}}}), + id="v2-consolidated", + ), +] + + +@pytest.mark.parametrize("model", TO_JSON_NO_ALIASING_PARAMS) +def test_to_json_shares_no_mutable_state_with_model( + model: ZarrV3GroupMetadata + | ZarrV2GroupMetadata + | ZarrV3ConsolidatedMetadata + | ZarrV2ConsolidatedMetadata, +) -> None: + """Mutating a document returned by to_json leaves the model unchanged.""" + baseline = copy.deepcopy(model.to_json()) + mutate_nested_containers(model.to_json()) + assert model.to_json() == baseline diff --git a/packages/zarr-metadata/tests/model/test_pydantic.py b/packages/zarr-metadata/tests/model/test_pydantic.py new file mode 100644 index 0000000000..e5714bb8fb --- /dev/null +++ b/packages/zarr-metadata/tests/model/test_pydantic.py @@ -0,0 +1,302 @@ +"""Executable example: integrating the metadata models with pydantic (v2). + +Pydantic's native dataclass introspection CAN be made to work (see +`test_native_dataclass_introspection_is_possible_but_diverges`): the models +keep their annotation-only imports behind `TYPE_CHECKING`, so a bare +`TypeAdapter(ZarrV3ArrayMetadata)` raises `class-not-fully-defined`, but +`rebuild(_types_namespace=...)` with the names supplied resolves the schema. +It is still the wrong tool: it validates the MODEL SHAPE, not the DOCUMENT — +no `from_json` normalization (a bare-string `data_type` is rejected), and +pydantic's lax coercion silently re-opens holes the library's validators +close (`shape=[True, -5]` coerces to `(1, -5)`; a wrong `dimension_names` +count passes). The recommended integration delegates wholesale — treat the +model as an opaque value: + +- `InstanceOf` makes pydantic's core schema an is-instance check (no field + introspection), +- validation goes through `from_json` (the single source of truth for what + a well-formed document is, including normalization: bare-string metadata + fields, arrays-to-tuples), +- serialization goes through `to_json` (the canonical document form). + +`MetadataValidationError` subclasses `ValueError`, so pydantic converts a +failed parse into its own `ValidationError` with the loc-annotated problem +messages intact. +""" + +from collections.abc import Mapping +from typing import Annotated, Generic, TypeVar + +import pytest +from pydantic import ( + BaseModel, + BeforeValidator, + ConfigDict, + InstanceOf, + PlainSerializer, + PydanticSchemaGenerationError, + PydanticUserError, + TypeAdapter, + ValidationError, + model_validator, +) + +from zarr_metadata import JSONValue +from zarr_metadata.model import ZarrV3ArrayMetadata, ZarrV3NamedConfig + +# --- the integration (this is the example) ----------------------------------- + + +def _as_array_metadata_v3(value: object) -> ZarrV3ArrayMetadata: + """Accept an existing model instance or a raw metadata document.""" + if isinstance(value, ZarrV3ArrayMetadata): + return value + return ZarrV3ArrayMetadata.from_json(value) + + +# return_type is explicit because to_json's own annotation (`ZarrV3ArrayMetadataJSON`) +# is a TYPE_CHECKING-only name pydantic cannot resolve at runtime. +ArrayMetadataV3Field = Annotated[ + InstanceOf[ZarrV3ArrayMetadata], + BeforeValidator(_as_array_metadata_v3), + PlainSerializer(ZarrV3ArrayMetadata.to_json, return_type=dict), +] +"""A pydantic-ready field type for v3 array metadata. + +Validates raw documents via `from_json`, passes model instances through, +and serializes to the canonical document form via `to_json`. +""" + + +class ArrayManifest(BaseModel): + """Example consumer model: a named array with its metadata document.""" + + path: str + metadata: ArrayMetadataV3Field + + +# --- tests pinning the example ------------------------------------------------ + +VALID_DOC = { + "zarr_format": 3, + "node_type": "array", + "shape": [10], + "data_type": "uint8", + "fill_value": 0, + "chunk_grid": {"name": "regular", "configuration": {"chunk_shape": [5]}}, + "chunk_key_encoding": {"name": "default"}, + "codecs": [{"name": "bytes"}], +} + + +def test_raw_document_is_validated_into_a_model() -> None: + """A raw metadata document on a pydantic field is parsed by from_json, + with the library's normalization applied (tuples, canonical field form).""" + manifest = ArrayManifest.model_validate({"path": "a/b", "metadata": VALID_DOC}) + assert isinstance(manifest.metadata, ZarrV3ArrayMetadata) + assert manifest.metadata.shape == (10,) + assert manifest.metadata.data_type.name == "uint8" + + +def test_model_instance_passes_through() -> None: + """An already-constructed model instance is accepted unchanged.""" + model = ZarrV3ArrayMetadata.from_json(VALID_DOC) + manifest = ArrayManifest(path="a/b", metadata=model) + assert manifest.metadata is model + + +def test_invalid_document_surfaces_problems_in_validation_error() -> None: + """A structurally-invalid document fails pydantic validation, carrying the + loc-annotated problem messages from MetadataValidationError.""" + doc = dict(VALID_DOC) + del doc["chunk_key_encoding"] + with pytest.raises(ValidationError) as exc_info: + ArrayManifest.model_validate({"path": "a/b", "metadata": doc}) + assert "chunk_key_encoding: missing required key" in str(exc_info.value) + + +def test_dump_emits_canonical_document() -> None: + """model_dump serializes the field via to_json — the canonical document, + not pydantic's field-by-field view of the dataclass.""" + manifest = ArrayManifest.model_validate({"path": "a/b", "metadata": VALID_DOC}) + dumped = manifest.model_dump() + assert dumped["metadata"] == manifest.metadata.to_json() + # Empty configurations use the extension-definition shorthand form. + assert dumped["metadata"]["data_type"] == "uint8" + + +def test_json_roundtrip_through_pydantic() -> None: + """model_dump_json output re-validates to an equal manifest (JSON emits + tuples as arrays; from_json converts them back).""" + manifest = ArrayManifest.model_validate({"path": "a/b", "metadata": VALID_DOC}) + revived = ArrayManifest.model_validate_json(manifest.model_dump_json()) + assert revived == manifest + + +def test_type_adapter_standalone() -> None: + """The annotated alias also works without a BaseModel, via TypeAdapter.""" + adapter = TypeAdapter(ArrayMetadataV3Field) + model = adapter.validate_python(VALID_DOC) + assert isinstance(model, ZarrV3ArrayMetadata) + assert adapter.dump_python(model) == model.to_json() + + +# --- the road not taken: native dataclass introspection ---------------------- + + +def test_native_dataclass_introspection_is_not_supported() -> None: + """Pydantic cannot field-introspect the model dataclasses: the UNSET + sentinel (PEP 661, typing_extensions.Sentinel) in the optional-field + annotations has no pydantic schema (as of pydantic 2.13), so even the + rebuild-with-namespace recipe fails. Introspection was already the wrong + tool before the sentinel existed — it validated the model shape rather + than the document, and its lax coercion re-opened validator holes (e.g. + shape=[True, -5] coerced to (1, -5)) — so the delegation patterns above + are the only supported integrations. If this test ever fails because + pydantic learned to handle sentinels, revisit whether the introspection + path needs its divergences documented again.""" + from zarr_metadata._common import JSONValue + from zarr_metadata.model import UNSET + from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON + from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON, ZarrV3ExtensionField + + def build_and_use() -> None: + adapter = TypeAdapter(ZarrV3ArrayMetadata) + adapter.rebuild( + force=True, + _types_namespace={ + "JSONValue": JSONValue, + "ZarrV3ExtensionField": ZarrV3ExtensionField, + "ZarrV3MetadataFieldJSON": ZarrV3MetadataFieldJSON, + "ZarrV3ArrayMetadataJSON": ZarrV3ArrayMetadataJSON, + "ZarrV3NamedConfig": ZarrV3NamedConfig, + "ZarrV3MetadataField": ZarrV3NamedConfig, + "UNSET": UNSET, + }, + ) + adapter.validate_python({}) + + with pytest.raises((AttributeError, PydanticSchemaGenerationError, PydanticUserError)): + build_and_use() + + +# --- a first-class pydantic model, engine-backed (the pydantic-zarr pattern) -- +# +# When a consumer wants a real BaseModel — JSON schema generation, and +# generics for typed attributes, as in pydantic-zarr's ArraySpec — the model +# fields are pydantic-native, but validation and serialization still route +# through the library: a mode="before" validator canonicalizes every input +# document with from_json(...).to_json(), so the structural validators and +# normalization run BEFORE pydantic parses fields (no coercion divergence), +# and the document form is the bridge in both directions. + +AttrsT = TypeVar("AttrsT") + + +class NamedConfig(BaseModel): + """Pydantic mirror of a normalized metadata extension envelope.""" + + name: str + configuration: dict[str, JSONValue] = {} + must_understand: bool = True + + +class ArrayMetadataV3Spec(BaseModel, Generic[AttrsT]): + """A pydantic-native, attribute-typed view of a v3 array metadata document. + + The library is the engine: every input is canonicalized and structurally + validated by `ZarrV3ArrayMetadata.from_json` before pydantic sees the + fields, and `to_document` / `to_metadata_model` emit through the library. + """ + + model_config = ConfigDict(frozen=True) + + zarr_format: int = 3 + node_type: str = "array" + shape: tuple[int, ...] + data_type: NamedConfig + chunk_grid: NamedConfig + chunk_key_encoding: NamedConfig + fill_value: JSONValue + codecs: tuple[NamedConfig, ...] + attributes: AttrsT + dimension_names: tuple[str | None, ...] | None = None + storage_transformers: tuple[NamedConfig, ...] = () + + @model_validator(mode="before") + @classmethod + def _canonicalize(cls, data: object) -> object: + """Route every input document through the library's validation and + normalization; pydantic then parses only canonical documents.""" + if isinstance(data, Mapping): + doc = dict(ZarrV3ArrayMetadata.from_json(data).to_json()) + for key in ("data_type", "chunk_grid", "chunk_key_encoding"): + if isinstance(doc[key], str): + doc[key] = {"name": doc[key]} + for key in ("codecs", "storage_transformers"): + doc[key] = tuple( + {"name": item} if isinstance(item, str) else item for item in doc.get(key, ()) + ) + doc.setdefault("attributes", {}) + return doc + return data + + def to_metadata_model(self) -> ZarrV3ArrayMetadata: + """Bridge back to the canonical model, via the document form. + + In the document, "no dimension names" is key-absence, not null; the + pydantic-side None translates to dropping the key. + """ + doc = self.model_dump() + if doc["dimension_names"] is None: + del doc["dimension_names"] + return ZarrV3ArrayMetadata.from_json(doc) + + def to_document(self) -> dict[str, object]: + """The canonical document (omit-empty conventions applied).""" + return dict(self.to_metadata_model().to_json()) + + +class MicroscopyAttrs(BaseModel): + """Example of consumer-typed attributes, pydantic-zarr style.""" + + resolution_um: float + + +def test_spec_typed_attributes() -> None: + """The generic parameter types the attributes, so consumers get validated, + attribute-level access — the pydantic-zarr ArraySpec pattern.""" + doc = dict(VALID_DOC) | {"attributes": {"resolution_um": 0.5}} + spec = ArrayMetadataV3Spec[MicroscopyAttrs].model_validate(doc) + assert spec.attributes.resolution_um == 0.5 + assert spec.data_type == NamedConfig(name="uint8") + + +def test_spec_engine_validates_before_pydantic() -> None: + """The library's structural validation runs before pydantic's parsing, so + coercion cannot re-open validator holes (contrast with the native + introspection test above, where [True, -5] coerced to (1, -5)).""" + with pytest.raises(ValidationError, match="shape"): + ArrayMetadataV3Spec[MicroscopyAttrs].model_validate( + dict(VALID_DOC) | {"shape": [True, -5], "attributes": {"resolution_um": 0.5}} + ) + + +def test_spec_bridges_to_canonical_model_and_document() -> None: + """to_metadata_model / to_document round-trip through the document form, + and the emitted document matches what the library itself would emit.""" + doc = dict(VALID_DOC) | {"attributes": {"resolution_um": 0.5}} + spec = ArrayMetadataV3Spec[MicroscopyAttrs].model_validate(doc) + model = spec.to_metadata_model() + assert isinstance(model, ZarrV3ArrayMetadata) + assert spec.to_document() == dict(model.to_json()) + # and back: the document revalidates to an equal spec + assert ArrayMetadataV3Spec[MicroscopyAttrs].model_validate(spec.to_document()) == spec + + +def test_spec_json_schema_generation() -> None: + """A real BaseModel means model_json_schema works — the capability the + opaque InstanceOf pattern cannot provide.""" + schema = ArrayMetadataV3Spec[MicroscopyAttrs].model_json_schema() + assert schema["properties"]["shape"]["type"] == "array" + assert "MicroscopyAttrs" in schema["$defs"] diff --git a/packages/zarr-metadata/tests/model/test_pydantic_module.py b/packages/zarr-metadata/tests/model/test_pydantic_module.py new file mode 100644 index 0000000000..d15b3f118c --- /dev/null +++ b/packages/zarr-metadata/tests/model/test_pydantic_module.py @@ -0,0 +1,264 @@ +"""Tests for `zarr_metadata.pydantic`, the optional pydantic field-type module. + +The hand-rolled recipes in `test_pydantic.py` document how the integration +works; this module ships it. Instances are the CORE model classes (no +parallel hierarchy), so values interoperate freely with non-pydantic code. +""" + +import json +import warnings + +import pytest +from jsonschema import Draft202012Validator +from pydantic import BaseModel, TypeAdapter, ValidationError + +import zarr_metadata.pydantic as zmp +from zarr_metadata.model import ( + ZarrV2ArrayMetadata, + ZarrV2ConsolidatedMetadata, + ZarrV2GroupMetadata, + ZarrV3ArrayMetadata, + ZarrV3ConsolidatedMetadata, + ZarrV3GroupMetadata, + ZarrV3NamedConfig, +) + +V3_ARRAY_DOC = dict(ZarrV3ArrayMetadata.create_default(shape=(4,)).to_json()) +V2_ARRAY_DOC = dict(ZarrV2ArrayMetadata.create_default(shape=(4,), chunks=(2,)).to_json()) +V3_GROUP_DOC = {"zarr_format": 3, "node_type": "group", "attributes": {"a": 1}} +V2_GROUP_DOC = {"zarr_format": 2, "attributes": {"a": 1}} +V3_CONSOLIDATED_DOC = { + "kind": "inline", + "must_understand": False, + "metadata": {"a": dict(V3_ARRAY_DOC)}, +} +V2_CONSOLIDATED_DOC = { + "zarr_consolidated_format": 1, + "metadata": {".zgroup": {"zarr_format": 2}}, +} + +FIELD_CASES = [ + pytest.param(zmp.ZarrV3ArrayMetadata, ZarrV3ArrayMetadata, V3_ARRAY_DOC, id="array-v3"), + pytest.param(zmp.ZarrV2ArrayMetadata, ZarrV2ArrayMetadata, V2_ARRAY_DOC, id="array-v2"), + pytest.param(zmp.ZarrV3GroupMetadata, ZarrV3GroupMetadata, V3_GROUP_DOC, id="group-v3"), + pytest.param(zmp.ZarrV2GroupMetadata, ZarrV2GroupMetadata, V2_GROUP_DOC, id="group-v2"), + pytest.param( + zmp.ZarrV3ConsolidatedMetadata, + ZarrV3ConsolidatedMetadata, + V3_CONSOLIDATED_DOC, + id="consolidated-v3", + ), + pytest.param( + zmp.ZarrV2ConsolidatedMetadata, + ZarrV2ConsolidatedMetadata, + V2_CONSOLIDATED_DOC, + id="consolidated-v2", + ), + pytest.param(zmp.ZarrV3MetadataField, ZarrV3NamedConfig, {"name": "bytes"}, id="field-v3"), +] + + +@pytest.mark.parametrize(("field_type", "model_cls", "doc"), FIELD_CASES) +def test_field_type_validates_and_dumps_canonically( + field_type: object, model_cls: type, doc: dict[str, object] +) -> None: + """Each field type parses its raw document into the CORE model class, + passes existing instances through unchanged, and dumps the canonical + document via to_json.""" + adapter = TypeAdapter(field_type) + model = adapter.validate_python(doc) + assert type(model) is model_cls + assert adapter.validate_python(model) is model + assert adapter.dump_python(model) == model.to_json() + + +def test_core_instances_interoperate() -> None: + """A core model instance (e.g. handed out by zarr-python) drops straight + into a pydantic field — the reason the module ships Annotated aliases over + the core classes rather than pydantic-aware subclasses.""" + + class Manifest(BaseModel): + metadata: zmp.ZarrV3ArrayMetadata + + core = ZarrV3ArrayMetadata.from_json(V3_ARRAY_DOC) + manifest = Manifest(metadata=core) + assert manifest.metadata is core + + +def test_validation_error_carries_problems() -> None: + """A defective document fails with the library's loc-annotated messages.""" + + class Manifest(BaseModel): + metadata: zmp.ZarrV3ArrayMetadata + + doc = dict(V3_ARRAY_DOC) + del doc["chunk_key_encoding"] + with pytest.raises(ValidationError, match="chunk_key_encoding: missing required key"): + Manifest.model_validate({"metadata": doc}) + + +def test_json_schema_generation() -> None: + """model_json_schema works, describing the document form each field accepts.""" + + class Manifest(BaseModel): + metadata: zmp.ZarrV3ArrayMetadata + codec: zmp.ZarrV3MetadataField + + schema = Manifest.model_json_schema() + metadata_schema = schema["$defs"]["ZarrV3ArrayMetadataJSON"] + assert schema["properties"]["metadata"]["$ref"] == "#/$defs/ZarrV3ArrayMetadataJSON" + assert metadata_schema["required"] == [ + "zarr_format", + "node_type", + "data_type", + "shape", + "chunk_grid", + "chunk_key_encoding", + "fill_value", + "codecs", + ] + assert metadata_schema["properties"]["zarr_format"] == { + "const": 3, + "title": "Zarr Format", + "type": "integer", + } + assert schema["properties"]["codec"]["anyOf"] == [ + {"type": "string"}, + {"$ref": "#/$defs/ZarrV3NamedConfigJSON"}, + ] + + +def test_json_schema_generation_emits_no_warnings() -> None: + """Consumers can generate every public integration schema without warning filters.""" + field_types = ( + zmp.ZarrV3ArrayMetadata, + zmp.ZarrV2ArrayMetadata, + zmp.ZarrV3GroupMetadata, + zmp.ZarrV2GroupMetadata, + zmp.ZarrV3ConsolidatedMetadata, + zmp.ZarrV2ConsolidatedMetadata, + zmp.ZarrV3MetadataField, + ) + + with warnings.catch_warnings(): + warnings.simplefilter("error") + for field_type in field_types: + TypeAdapter(field_type).json_schema() + + +def test_v2_recursive_structured_dtype_is_in_pydantic_schema() -> None: + """The schema accepts nested structured dtypes supported by the v2 specification.""" + doc = json.loads(json.dumps(V2_ARRAY_DOC)) + doc["dtype"] = [["outer", [["inner", " None: + adapter = TypeAdapter(field_type) + with pytest.raises(ValidationError): + adapter.validate_python(document) + assert list(Draft202012Validator(adapter.json_schema()).iter_errors(document)) + + +def test_v3_array_schema_rejects_empty_codecs() -> None: + """The generated schema mirrors the runtime non-empty codec pipeline rule.""" + doc = json.loads(json.dumps(V3_ARRAY_DOC)) + doc["codecs"] = [] + + _assert_runtime_and_schema_reject(zmp.ZarrV3ArrayMetadata, doc) + + +def test_array_schemas_reject_negative_dimensions() -> None: + """Both array schemas mirror the runtime non-negative dimension rule.""" + for field_type, source in ( + (zmp.ZarrV3ArrayMetadata, V3_ARRAY_DOC), + (zmp.ZarrV2ArrayMetadata, V2_ARRAY_DOC), + ): + doc = json.loads(json.dumps(source)) + doc["shape"] = [-1] + _assert_runtime_and_schema_reject(field_type, doc) + + +def test_v2_array_schema_rejects_empty_filters() -> None: + """The v2 schema mirrors the runtime one-or-more filter rule.""" + doc = json.loads(json.dumps(V2_ARRAY_DOC)) + doc["filters"] = [] + + _assert_runtime_and_schema_reject(zmp.ZarrV2ArrayMetadata, doc) + + +@pytest.mark.parametrize("field", ["data_type", "chunk_grid", "chunk_key_encoding"]) +def test_v3_array_schema_rejects_false_at_mandatory_extension_points(field: str) -> None: + """Mandatory v3 extension points cannot opt out of understanding.""" + doc = json.loads(json.dumps(V3_ARRAY_DOC)) + doc[field] = {"name": "example", "must_understand": False} + + _assert_runtime_and_schema_reject(zmp.ZarrV3ArrayMetadata, doc) + + +def test_metadata_field_schema_rejects_unknown_members() -> None: + """Named-configuration envelopes are closed in both runtime and schema validation.""" + _assert_runtime_and_schema_reject( + zmp.ZarrV3MetadataField, + {"name": "example", "unexpected": 1}, + ) + + +@pytest.mark.parametrize( + ("field_type", "source"), + [ + (zmp.ZarrV2ArrayMetadata, V2_ARRAY_DOC), + (zmp.ZarrV2GroupMetadata, V2_GROUP_DOC), + (zmp.ZarrV2ConsolidatedMetadata, V2_CONSOLIDATED_DOC), + ], +) +def test_v2_schema_rejects_unknown_document_members( + field_type: object, source: dict[str, object] +) -> None: + """Closed v2 merged documents expose their runtime boundary in JSON Schema.""" + doc = json.loads(json.dumps(source)) + doc["unexpected"] = 1 + + _assert_runtime_and_schema_reject(field_type, doc) + + +def test_v3_array_schema_allows_unknown_extension_fields() -> None: + """Schema constraints do not close the v3 top-level extension namespace.""" + doc = json.loads(json.dumps(V3_ARRAY_DOC)) + doc["vendor_extension"] = {"anything": [1, 2]} + adapter = TypeAdapter(zmp.ZarrV3ArrayMetadata) + + assert adapter.validate_python(doc).extra_fields == {"vendor_extension": {"anything": (1, 2)}} + assert Draft202012Validator(adapter.json_schema()).is_valid(doc) + + +def test_json_roundtrip() -> None: + """model_dump_json output re-validates to an equal pydantic model.""" + + class Manifest(BaseModel): + metadata: zmp.ZarrV3ArrayMetadata + + manifest = Manifest.model_validate({"metadata": V3_ARRAY_DOC}) + assert Manifest.model_validate_json(manifest.model_dump_json()) == manifest + + +def test_metadata_field_serializes_shorthand_and_false_object() -> None: + """The optional integration exposes the core model's canonical extension form.""" + adapter = TypeAdapter(zmp.ZarrV3MetadataField) + assert adapter.dump_python(adapter.validate_python({"name": "bytes"})) == "bytes" + assert adapter.dump_python( + adapter.validate_python({"name": "optional", "must_understand": False}) + ) == {"name": "optional", "must_understand": False} + + +def test_core_package_does_not_import_pydantic() -> None: + """Importing zarr_metadata (in a fresh interpreter) must not import + pydantic: the integration is opt-in via zarr_metadata.pydantic.""" + import subprocess + import sys + + code = "import sys, zarr_metadata; assert 'pydantic' not in sys.modules, 'leaked'" + subprocess.run([sys.executable, "-c", code], check=True) diff --git a/packages/zarr-metadata/tests/model/test_sentinel.py b/packages/zarr-metadata/tests/model/test_sentinel.py new file mode 100644 index 0000000000..252a4cdd30 --- /dev/null +++ b/packages/zarr-metadata/tests/model/test_sentinel.py @@ -0,0 +1,89 @@ +"""Tests for the pickling and copying behavior of the `UNSET` sentinel. + +The sentinel's contract is identity, so it must never be reconstructed from +state. typing_extensions >= 4.16 pickles sentinels by reference (a lookup of +the sentinel's name on its defining module), which preserves the singleton +across process boundaries; these tests pin that behavior, since models hold +`UNSET` as field values and must survive pickling and deep-copying. + +The model round-trip tests compare whole structures: dataclass equality +compares every field, and `UNSET` compares by identity, so an impostor +sentinel produced by state-based pickling would fail the equality check. +""" + +from __future__ import annotations + +import copy +import pickle + +import pytest +from typing_extensions import Sentinel + +from zarr_metadata.model import ( + UNSET, + ZarrV2ArrayMetadata, + ZarrV2GroupMetadata, + ZarrV3ArrayMetadata, + ZarrV3ConsolidatedMetadata, + ZarrV3GroupMetadata, +) + +# Whole-model cases covering the states we know are problematic for +# serialization: every optional-key field in the UNSET (absent) state, the +# same fields in the present state (including present-but-empty, which must +# stay distinct from absent), and UNSET nested inside consolidated metadata. +MODEL_CASES = { + "array-v3-dimension-names-unset": ZarrV3ArrayMetadata.create_default(shape=(4,)), + "array-v3-dimension-names-set": ZarrV3ArrayMetadata.create_default(shape=(2, 2)).update( + dimension_names=("x", None) + ), + "array-v2-attributes-unset": ZarrV2ArrayMetadata.create_default(shape=(4,)), + "array-v2-attributes-empty": ZarrV2ArrayMetadata.create_default(shape=(4,), attributes={}), + "group-v2-attributes-unset": ZarrV2GroupMetadata.create_default(), + "group-v2-attributes-set": ZarrV2GroupMetadata.create_default(attributes={"a": 1}), + "group-v3-consolidated-unset": ZarrV3GroupMetadata.create_default(), + "group-v3-consolidated-with-unset-inside": ZarrV3GroupMetadata.create_default( + consolidated_metadata=ZarrV3ConsolidatedMetadata( + metadata={ + "child": ZarrV3ArrayMetadata.create_default(shape=(4,)), + "subgroup": ZarrV3GroupMetadata.create_default(), + } + ) + ), +} + + +def test_unset_pickle_round_trip_preserves_identity() -> None: + restored = pickle.loads(pickle.dumps(UNSET)) + assert restored is UNSET + + +def test_unset_copy_preserves_identity() -> None: + assert copy.copy(UNSET) is UNSET + assert copy.deepcopy(UNSET) is UNSET + + +@pytest.mark.parametrize("model", MODEL_CASES.values(), ids=MODEL_CASES.keys()) +def test_model_pickle_round_trip( + model: ZarrV2ArrayMetadata | ZarrV3ArrayMetadata | ZarrV2GroupMetadata | ZarrV3GroupMetadata, +) -> None: + restored = pickle.loads(pickle.dumps(model)) + assert restored == model + + +@pytest.mark.parametrize("model", MODEL_CASES.values(), ids=MODEL_CASES.keys()) +def test_model_deepcopy( + model: ZarrV2ArrayMetadata | ZarrV3ArrayMetadata | ZarrV2GroupMetadata | ZarrV3GroupMetadata, +) -> None: + assert copy.deepcopy(model) == model + + +def test_non_importable_sentinel_fails_to_pickle() -> None: + """Sentinels pickle by reference, never by state. A sentinel that is not + an importable attribute of its module has no reference to pickle, so + dumping it must fail loudly — a successful dump here would mean the + implementation regressed to state-based pickling, which would produce + identity-breaking impostor objects on the receiving side.""" + local_sentinel = Sentinel("local_sentinel") + with pytest.raises((pickle.PicklingError, TypeError)): + pickle.dumps(local_sentinel) diff --git a/packages/zarr-metadata/tests/test_partial_equivalence.py b/packages/zarr-metadata/tests/test_partial_equivalence.py index 995a6a21e1..33492b2356 100644 --- a/packages/zarr-metadata/tests/test_partial_equivalence.py +++ b/packages/zarr-metadata/tests/test_partial_equivalence.py @@ -14,17 +14,17 @@ import pytest -from zarr_metadata.v2.array import ArrayMetadataV2, ArrayMetadataV2Partial -from zarr_metadata.v2.group import GroupMetadataV2, GroupMetadataV2Partial -from zarr_metadata.v3.array import ArrayMetadataV3, ArrayMetadataV3Partial -from zarr_metadata.v3.group import GroupMetadataV3, GroupMetadataV3Partial +from zarr_metadata.v2.array import ZarrV2ArrayMetadataJSON, ZarrV2ArrayMetadataJSONPartial +from zarr_metadata.v2.group import ZarrV2GroupMetadataJSON, ZarrV2GroupMetadataJSONPartial +from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON, ZarrV3ArrayMetadataJSONPartial +from zarr_metadata.v3.group import ZarrV3GroupMetadataJSON, ZarrV3GroupMetadataJSONPartial # (full, partial) pairs to check. Add new pairs here as more are introduced. PAIRS: list[tuple[type, type]] = [ - (ArrayMetadataV3, ArrayMetadataV3Partial), - (GroupMetadataV3, GroupMetadataV3Partial), - (ArrayMetadataV2, ArrayMetadataV2Partial), - (GroupMetadataV2, GroupMetadataV2Partial), + (ZarrV3ArrayMetadataJSON, ZarrV3ArrayMetadataJSONPartial), + (ZarrV3GroupMetadataJSON, ZarrV3GroupMetadataJSONPartial), + (ZarrV2ArrayMetadataJSON, ZarrV2ArrayMetadataJSONPartial), + (ZarrV2GroupMetadataJSON, ZarrV2GroupMetadataJSONPartial), ] diff --git a/packages/zarr-metadata/tests/test_public_api.py b/packages/zarr-metadata/tests/test_public_api.py index d3270579c3..e65c680fd1 100644 --- a/packages/zarr-metadata/tests/test_public_api.py +++ b/packages/zarr-metadata/tests/test_public_api.py @@ -1,5 +1,7 @@ """Test that the curated front-door names are accessible from the top-level zarr_metadata package.""" +import importlib +import pkgutil import re from typing import get_args @@ -21,26 +23,43 @@ def _group_rank(s: str) -> int: EXPECTED = [ # Category A — metadata-document types - "ArrayMetadataV2", - "ArrayMetadataV2Partial", - "ZArrayMetadata", - "GroupMetadataV2", - "GroupMetadataV2Partial", - "ZGroupMetadata", - "ConsolidatedMetadataV2", - "ZAttrsMetadata", - "CodecMetadataV2", - "ArrayMetadataV3", - "ArrayMetadataV3Partial", - "ExtensionFieldV3", - "GroupMetadataV3", - "GroupMetadataV3Partial", - "ConsolidatedMetadataV3", - "NamedConfigV3", - "MetadataV3", + "ZarrV2ArrayMetadataJSON", + "ZarrV2ArrayMetadataJSONPartial", + "ZarrV2ZArrayJSON", + "ZarrV2GroupMetadataJSON", + "ZarrV2GroupMetadataJSONPartial", + "ZarrV2ZGroupJSON", + "ZarrV2ConsolidatedMetadataJSON", + "ZarrV2ZAttrsJSON", + "ZarrV2CodecMetadata", + "ZarrV3ArrayMetadataJSON", + "ZarrV3ArrayMetadataJSONPartial", + "ZarrV3ExtensionField", + "ZarrV3GroupMetadataJSON", + "ZarrV3GroupMetadataJSONPartial", + "ZarrV3ConsolidatedMetadataJSON", + "ZarrV3NamedConfigJSON", + "ZarrV3MetadataFieldJSON", "JSONValue", + # Category A' — metadata models (in-memory dataclasses over the documents) + "ZarrV2ArrayMetadata", + "ZarrV2ArrayMetadataPartial", + "ZarrV3ArrayMetadata", + "ZarrV3ArrayMetadataPartial", + "ZarrV2GroupMetadata", + "ZarrV2GroupMetadataPartial", + "ZarrV3GroupMetadata", + "ZarrV3GroupMetadataPartial", + "ZarrV2ConsolidatedMetadata", + "ZarrV3ConsolidatedMetadata", + "ZarrV3NamedConfig", + "ZarrV3MetadataField", + "ValidationProblem", + "MetadataValidationError", + "ProblemKind", + "UNSET", # v2 data-type encoding union - "DataTypeMetadataV2", + "ZarrV2DataTypeMetadata", # Category B — codec canonical unions "BloscCodecMetadata", "BytesCodecMetadata", @@ -129,9 +148,9 @@ def _group_rank(s: str) -> int: "RawBytesFillValue", # Category E — constant+Literal pairs "ARRAY_ORDER_V2", - "ArrayOrderV2", + "ZarrV2ArrayOrder", "ARRAY_DIMENSION_SEPARATOR_V2", - "ArrayDimensionSeparatorV2", + "ZarrV2ArrayDimensionSeparator", "ENDIANNESS", "Endianness", "BYTES_CODEC_NAME", @@ -200,6 +219,109 @@ def test_all_is_grouped_and_unique() -> None: assert len(zm.__all__) == len(set(zm.__all__)) +# --- naming grammar --------------------------------------------------------- + +# Core document/model names: the format version comes first (`ZarrV2` / +# `ZarrV3`), then the CamelCase entity, then an optional role suffix +# (`JSON`, `JSONPartial`, `Partial`, `StoreKey`) — validated loosely here +# because `JSON` decomposes into single-letter words under any strict +# word-splitting regex. +_CORE_NAME = re.compile(r"^ZarrV[23](?:[A-Z][a-z0-9]*)+$") + +# Zarr v3 extension-entity names: the registered entity comes first (`Blosc`, +# `Uint8`, ... — `V2` here is the *entity name* of the v2-compatibility chunk +# key encoding, not a format-version marker, which is always spelled +# `ZarrV2`/`ZarrV3`), followed by exactly one role suffix. +_EXTENSION_ROLES = ( + "CodecConfiguration", + "CodecMetadata", + "CodecName", + "CodecObject", + "ChunkGridConfiguration", + "ChunkGridMetadata", + "ChunkGridName", + "ChunkGridObject", + "ChunkKeyEncodingConfiguration", + "ChunkKeyEncodingMetadata", + "ChunkKeyEncodingName", + "ChunkKeyEncodingObject", + "ChunkKeyEncodingSeparator", + "DataTypeName", + "FillValue", + "Configuration", + "Component", +) +_EXTENSION_NAME = re.compile(r"^(?:[A-Z][a-z0-9]*)+?(?:" + "|".join(_EXTENSION_ROLES) + r")$") + +# Standalone vocabulary: scalar Literal aliases, structural helper shapes, and +# the validation diagnostics. Closed by hand — a new name belongs here only if +# it is genuinely role-less; anything document- or entity-shaped must fit the +# grammars above instead. +_STANDALONE_VOCAB = frozenset( + { + "Base64Bytes", + "BloscCName", + "BloscShuffle", + "CastOutOfRangeMode", + "CastRoundingMode", + "Endianness", + "HexFloat16", + "HexFloat32", + "HexFloat64", + "JSONValue", + "MetadataValidationError", + "NumpyDatetime64", + "NumpyTimeUnit", + "NumpyTimedelta64", + "ProblemKind", + "RectilinearDimSpec", + "ScalarMap", + "ScalarMapEntry", + "ShardingIndexLocation", + "Struct", + "StructField", + "ValidationProblem", + } +) + + +def _public_type_names() -> set[tuple[str, str]]: + """Every (module, CamelCase name) pair exported via a public `__all__`.""" + module_names = {"zarr_metadata"} + for info in pkgutil.walk_packages(zm.__path__, prefix="zarr_metadata."): + if not any(part.startswith("_") for part in info.name.split(".")[1:]): + module_names.add(info.name) + out: set[tuple[str, str]] = set() + for module_name in module_names: + module = importlib.import_module(module_name) + for name in getattr(module, "__all__", ()): + if name.startswith("_") or name.isupper() or name.islower(): + continue + out.add((module_name, name)) + return out + + +def test_public_type_names_comply_with_naming_grammar() -> None: + """Every public type name parses against the package naming grammar: + version-first core names, entity-plus-role extension names, or the closed + standalone vocabulary.""" + exported = _public_type_names() + violations = [ + f"{module}.{name}" + for module, name in sorted(exported) + if name not in _STANDALONE_VOCAB + and not _CORE_NAME.match(name) + and not _EXTENSION_NAME.match(name) + ] + assert not violations, f"names outside the naming grammar: {violations}" + + +def test_standalone_vocab_is_not_stale() -> None: + """Every allowlisted vocabulary name is still actually exported.""" + exported_names = {name for _, name in _public_type_names()} + assert exported_names >= _STANDALONE_VOCAB + + def test_promoted_pairs_drift() -> None: pairs = [ (zm.ENDIANNESS, zm.Endianness), @@ -209,7 +331,7 @@ def test_promoted_pairs_drift() -> None: (zm.NUMPY_TIME_UNIT, zm.NumpyTimeUnit), (zm.CAST_ROUNDING_MODE, zm.CastRoundingMode), (zm.CAST_OUT_OF_RANGE_MODE, zm.CastOutOfRangeMode), - (zm.ARRAY_ORDER_V2, zm.ArrayOrderV2), + (zm.ARRAY_ORDER_V2, zm.ZarrV2ArrayOrder), ] for const, lit in pairs: assert set(const) == set(get_args(lit)) diff --git a/packages/zarr-metadata/tests/v2/array/test_fixtures.py b/packages/zarr-metadata/tests/v2/array/test_fixtures.py index 1576aae8db..578d3647ab 100644 --- a/packages/zarr-metadata/tests/v2/array/test_fixtures.py +++ b/packages/zarr-metadata/tests/v2/array/test_fixtures.py @@ -1,7 +1,7 @@ """Decode v2 array metadata fixtures via pydantic. Each `*.json` file in this directory is a representative on-disk -`.zarray` that should validate cleanly as `ZArrayMetadata` (the strict +`.zarray` that should validate cleanly as `ZarrV2ZArrayJSON` (the strict on-disk shape). User attributes live in sibling `.zattrs` files and are not part of these fixtures. @@ -17,11 +17,11 @@ import pytest from pydantic import TypeAdapter -from zarr_metadata.v2.array import ZArrayMetadata +from zarr_metadata.v2.array import ZarrV2ZArrayJSON FIXTURES_DIR = Path(__file__).parent FIXTURES = sorted(FIXTURES_DIR.glob("*.json")) -ADAPTER = TypeAdapter(ZArrayMetadata) +ADAPTER = TypeAdapter(ZarrV2ZArrayJSON) @pytest.mark.parametrize("fixture", FIXTURES, ids=lambda p: p.stem) diff --git a/packages/zarr-metadata/tests/v2/consolidated/test_fixtures.py b/packages/zarr-metadata/tests/v2/consolidated/test_fixtures.py index 9dad66d074..e802c5bef8 100644 --- a/packages/zarr-metadata/tests/v2/consolidated/test_fixtures.py +++ b/packages/zarr-metadata/tests/v2/consolidated/test_fixtures.py @@ -8,11 +8,11 @@ import pytest from pydantic import TypeAdapter -from zarr_metadata.v2.consolidated import ConsolidatedMetadataV2 +from zarr_metadata.v2.consolidated import ZarrV2ConsolidatedMetadataJSON FIXTURES_DIR = Path(__file__).parent FIXTURES = sorted(FIXTURES_DIR.glob("*.json")) -ADAPTER = TypeAdapter(ConsolidatedMetadataV2) +ADAPTER = TypeAdapter(ZarrV2ConsolidatedMetadataJSON) @pytest.mark.parametrize("fixture", FIXTURES, ids=lambda p: p.stem) diff --git a/packages/zarr-metadata/tests/v2/group/test_fixtures.py b/packages/zarr-metadata/tests/v2/group/test_fixtures.py index 1ad88a577b..29652185b2 100644 --- a/packages/zarr-metadata/tests/v2/group/test_fixtures.py +++ b/packages/zarr-metadata/tests/v2/group/test_fixtures.py @@ -1,7 +1,7 @@ """Decode v2 group metadata fixtures via pydantic. Each `*.json` file in this directory is a representative on-disk -`.zgroup` that should validate cleanly as `ZGroupMetadata` (the strict +`.zgroup` that should validate cleanly as `ZarrV2ZGroupJSON` (the strict on-disk shape). User attributes live in sibling `.zattrs` files and are not part of these fixtures. """ @@ -14,11 +14,11 @@ import pytest from pydantic import TypeAdapter -from zarr_metadata.v2.group import ZGroupMetadata +from zarr_metadata.v2.group import ZarrV2ZGroupJSON FIXTURES_DIR = Path(__file__).parent FIXTURES = sorted(FIXTURES_DIR.glob("*.json")) -ADAPTER = TypeAdapter(ZGroupMetadata) +ADAPTER = TypeAdapter(ZarrV2ZGroupJSON) @pytest.mark.parametrize("fixture", FIXTURES, ids=lambda p: p.stem) diff --git a/packages/zarr-metadata/tests/v3/array/test_fixtures.py b/packages/zarr-metadata/tests/v3/array/test_fixtures.py index fccd00d481..c84cc4042b 100644 --- a/packages/zarr-metadata/tests/v3/array/test_fixtures.py +++ b/packages/zarr-metadata/tests/v3/array/test_fixtures.py @@ -1,7 +1,7 @@ """Decode v3 array metadata fixtures via pydantic. Each `*.json` file in this directory is a representative on-disk -`zarr.json` that should validate cleanly as `ArrayMetadataV3`. +`zarr.json` that should validate cleanly as `ZarrV3ArrayMetadataJSON`. Fixtures are named for the variant they exercise (regular vs rectilinear grid, blosc/gzip/zstd/sharding_indexed codecs, named-config dtypes, optional fields, extra fields). @@ -15,11 +15,11 @@ import pytest from pydantic import TypeAdapter -from zarr_metadata.v3.array import ArrayMetadataV3 +from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON FIXTURES_DIR = Path(__file__).parent FIXTURES = sorted(FIXTURES_DIR.glob("*.json")) -ADAPTER = TypeAdapter(ArrayMetadataV3) +ADAPTER = TypeAdapter(ZarrV3ArrayMetadataJSON) @pytest.mark.parametrize("fixture", FIXTURES, ids=lambda p: p.stem) diff --git a/packages/zarr-metadata/tests/v3/array/with_extra_field.json b/packages/zarr-metadata/tests/v3/array/with_extra_field.json index 46a7f0f235..bd7a9f5b45 100644 --- a/packages/zarr-metadata/tests/v3/array/with_extra_field.json +++ b/packages/zarr-metadata/tests/v3/array/with_extra_field.json @@ -16,6 +16,6 @@ ], "my_custom_extension": { "must_understand": false, - "purpose": "exercise the extra_items=ExtensionFieldV3 path" + "purpose": "exercise the extra_items=ZarrV3ExtensionField path" } } diff --git a/packages/zarr-metadata/tests/v3/consolidated/test_fixtures.py b/packages/zarr-metadata/tests/v3/consolidated/test_fixtures.py index 4d9e300bae..d052b16986 100644 --- a/packages/zarr-metadata/tests/v3/consolidated/test_fixtures.py +++ b/packages/zarr-metadata/tests/v3/consolidated/test_fixtures.py @@ -8,11 +8,11 @@ import pytest from pydantic import TypeAdapter -from zarr_metadata.v3.consolidated import ConsolidatedMetadataV3 +from zarr_metadata.v3.consolidated import ZarrV3ConsolidatedMetadataJSON FIXTURES_DIR = Path(__file__).parent FIXTURES = sorted(FIXTURES_DIR.glob("*.json")) -ADAPTER = TypeAdapter(ConsolidatedMetadataV3) +ADAPTER = TypeAdapter(ZarrV3ConsolidatedMetadataJSON) @pytest.mark.parametrize("fixture", FIXTURES, ids=lambda p: p.stem) diff --git a/packages/zarr-metadata/tests/v3/group/test_fixtures.py b/packages/zarr-metadata/tests/v3/group/test_fixtures.py index 2015d5ce96..ffcdedef2b 100644 --- a/packages/zarr-metadata/tests/v3/group/test_fixtures.py +++ b/packages/zarr-metadata/tests/v3/group/test_fixtures.py @@ -8,11 +8,11 @@ import pytest from pydantic import TypeAdapter -from zarr_metadata.v3.group import GroupMetadataV3 +from zarr_metadata.v3.group import ZarrV3GroupMetadataJSON FIXTURES_DIR = Path(__file__).parent FIXTURES = sorted(FIXTURES_DIR.glob("*.json")) -ADAPTER = TypeAdapter(GroupMetadataV3) +ADAPTER = TypeAdapter(ZarrV3GroupMetadataJSON) @pytest.mark.parametrize("fixture", FIXTURES, ids=lambda p: p.stem) From 0c07bf5ed6619b7e5c0b01aece7a93fc88de07b6 Mon Sep 17 00:00:00 2001 From: Goutam Adwant <8672451+goutamadwant@users.noreply.github.com> Date: Tue, 28 Jul 2026 22:24:08 +0200 Subject: [PATCH 09/61] fix: let open_like create arrays by default (#4146) * fix: let open_like create arrays by default * test: cover open_like read-only mode --------- Co-authored-by: Davis Bennett --- changes/3352.bugfix.md | 3 +++ src/zarr/api/asynchronous.py | 6 ++++- src/zarr/api/synchronous.py | 6 +++-- tests/test_api.py | 47 ++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 changes/3352.bugfix.md diff --git a/changes/3352.bugfix.md b/changes/3352.bugfix.md new file mode 100644 index 0000000000..7461486776 --- /dev/null +++ b/changes/3352.bugfix.md @@ -0,0 +1,3 @@ +Fix `zarr.api.asynchronous.open_like` so it can create a new array by default when the +target path does not already exist. It now defaults to `mode="a"`; when using a read-only +store to open an existing array, pass `mode="r"` explicitly. diff --git a/src/zarr/api/asynchronous.py b/src/zarr/api/asynchronous.py index c751d6a31c..f5e614a051 100644 --- a/src/zarr/api/asynchronous.py +++ b/src/zarr/api/asynchronous.py @@ -1292,7 +1292,9 @@ async def open_like(a: ArrayLike, path: str, **kwargs: Any) -> AnyAsyncArray: path : str The path to the new array. **kwargs - Any keyword arguments to pass to the array constructor. + Additional keyword arguments passed to `open_array`. + If `mode` is omitted or `None`, it defaults to `"a"`. Pass `mode="r"` when + opening an existing array from a read-only store. Returns ------- @@ -1300,6 +1302,8 @@ async def open_like(a: ArrayLike, path: str, **kwargs: Any) -> AnyAsyncArray: The opened array. """ like_kwargs = _like_args(a) | kwargs + if like_kwargs.get("mode") is None: + like_kwargs["mode"] = "a" return await open_array(path=path, **like_kwargs) # type: ignore[arg-type] diff --git a/src/zarr/api/synchronous.py b/src/zarr/api/synchronous.py index 3231837a04..dc12d5f7af 100644 --- a/src/zarr/api/synchronous.py +++ b/src/zarr/api/synchronous.py @@ -1399,11 +1399,13 @@ def open_like(a: ArrayLike, path: str, **kwargs: Any) -> AnyArray: path : str The path to the new array. **kwargs - Any keyword arguments to pass to the array constructor. + Additional keyword arguments passed to `open_array`. + If `mode` is omitted or `None`, it defaults to `"a"`. Pass `mode="r"` when + opening an existing array from a read-only store. Returns ------- - AsyncArray + Array The opened array. """ return Array(sync(async_api.open_like(a, path=path, **kwargs))) diff --git a/tests/test_api.py b/tests/test_api.py index 1b4414ae63..cbe8ea3b44 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -168,6 +168,53 @@ async def test_array_like_creation( assert np.all(Array(new_arr)[:] == expect_fill) +@pytest.mark.parametrize("mode_kwargs", [{}, {"mode": None}]) +async def test_open_like_creates_array_by_default( + zarr_format: ZarrFormat, mode_kwargs: dict[str, None] +) -> None: + ref_arr = zarr.create_array( + store={}, + shape=(11, 12), + dtype="uint8", + chunks=(11, 12), + zarr_format=zarr_format, + fill_value=100, + ) + + new_arr = await zarr.api.asynchronous.open_like( + ref_arr, + path="foo", + store={}, + zarr_format=zarr_format, + **mode_kwargs, + ) + + assert new_arr.shape == ref_arr.shape + assert new_arr.chunks == ref_arr.chunks + assert new_arr.dtype == ref_arr.dtype + assert np.all(Array(new_arr)[:] == ref_arr.fill_value) + + +async def test_open_like_default_mode_rejects_read_only_store( + zarr_format: ZarrFormat, +) -> None: + ref_arr = zarr.create_array( + store={}, + shape=(11, 12), + dtype="uint8", + chunks=(11, 12), + zarr_format=zarr_format, + ) + + with pytest.raises(ValueError, match="Store is read-only but mode is 'a'"): + await zarr.api.asynchronous.open_like( + ref_arr, + path="foo", + store=MemoryStore(read_only=True), + zarr_format=zarr_format, + ) + + # TODO: parametrize over everything this function takes @pytest.mark.parametrize("store", ["memory"], indirect=True) def test_create_array(store: Store, zarr_format: ZarrFormat) -> None: From bd24f4f4a28212bcceb52edf07fb4b10a738651d Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 29 Jul 2026 12:53:53 +0200 Subject: [PATCH 10/61] fix: keep FusedCodecPipeline compute off the event-loop thread (#4194) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: byte-order handling for structured dtypes in the bytes codec (#220) * fix: byte-order handling for structured dtypes in the bytes codec The bytes codec neither byte-swapped structured-dtype fields to its configured endian on encode (numpy reports byteorder '|' for void dtypes, so the top-level byteorder comparison never detected a mismatch) nor honored its endian when decoding, silently corrupting any structured data whose field byte order differed from the stored one (e.g. virtual references to external big-endian data). Encode now detects byte-order mismatches by comparing full dtypes via newbyteorder, and decode reinterprets raw bytes in the stored byte order before converting to the data type's declared byte order, so the stored layout (codec state) and the in-memory layout (array data type) are independent. Closes #4141 Assisted-by: ClaudeCode:claude-fable-5 * test: fold structured byte-order cases into existing bytes codec tests Extend test_endian's parametrization with structured dtypes and test_bytes_codec_sync_roundtrip with endian/dtype parametrization plus stored-layout and decoded-dtype assertions, instead of adding parallel test functions for the same properties. Assisted-by: ClaudeCode:claude-fable-5 * refactor: rename stored_dtype to view_dtype in BytesCodec decode The variable is the dtype used to view the raw chunk bytes (byte order from the codec's endian configuration), not a property of the stored data or of the returned buffer, which always carries the array's declared dtype. Assisted-by: ClaudeCode:claude-fable-5 * docs: note that the decode-side byte-order conversion copies the chunk Assisted-by: ClaudeCode:claude-fable-5 * fix(codec_pipeline): keep FusedCodecPipeline compute off the event-loop thread FusedCodecPipeline.read/write ran their synchronous fast path inline on the coroutine servicing the request — i.e. on the global zarr_io event loop thread. Single-chunk batches decoded inline on the loop and multi-chunk batches blocked the loop in pool.map, so every sync-API call from every user thread serialized behind each other's codec compute. The blocked window scales with codec cost, which is why users reported the fused pipeline as "slower for zstd-compressed data" under multi-threaded (dask-style, one chunk per call) access: at 8 reader threads on 4 MiB zstd chunks it was 3.4x slower than BatchedCodecPipeline, and throughput did not scale with threads at all (336 -> 439 ms from 1 to 8 threads, versus 669 -> 121 ms for batched). Offload the synchronous batch to a worker thread with asyncio.to_thread: one hop per batch, not per chunk, preserving the fused pipeline's win over per-chunk async scheduling while keeping the loop free. After the fix the same workload scales 625 -> 109 ms from 1 to 8 threads, beating batched at every thread count; single-threaded performance is unchanged (the hop costs ~75 us per batch). The regression test asserts deterministically (no timing) that codec compute never runs on a thread with a running event loop, covering single- and multi-chunk reads and writes through the sync API. A new benchmark covers the many-threads/one-chunk-per-call access pattern. Assisted-by: ClaudeCode:claude-fable-5 * docs: rename change note to upstream PR number (4194) towncrier's issue_format links to zarr-developers/zarr-python issues, so 247 (the fork PR number) would render a link to an unrelated old issue. Assisted-by: ClaudeCode:claude-fable-5 * test: guard event-loop test against vacuity if the sync fast path stops triggering The test asserts a negative (compute never ran on the loop thread). If a refactor made the sync fast path stop triggering, the traced ChunkTransform methods would never be called (the async fallback uses AsyncChunkTransform) and the test would pass while guarding nothing. Assert the traced hooks actually ran. Assisted-by: ClaudeCode:claude-fable-5 --- changes/4194.bugfix.md | 10 ++++++ src/zarr/core/codec_pipeline.py | 16 +++++++-- tests/benchmarks/test_e2e.py | 48 ++++++++++++++++++++++++++ tests/test_fused_pipeline.py | 61 +++++++++++++++++++++++++++++++++ 4 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 changes/4194.bugfix.md diff --git a/changes/4194.bugfix.md b/changes/4194.bugfix.md new file mode 100644 index 0000000000..21a4924664 --- /dev/null +++ b/changes/4194.bugfix.md @@ -0,0 +1,10 @@ +`FusedCodecPipeline` no longer runs chunk IO and codec compute on the thread +driving zarr's internal event loop. Previously each read/write executed its +synchronous fast path inline on that loop thread, and because every sync-API +call from every user thread is serviced by the same loop, concurrent +operations serialized behind each other's codec work — reported as the fused +pipeline being slower than `BatchedCodecPipeline` for zstd-compressed data +under multi-threaded (e.g. dask) access. The synchronous batch now runs on a +worker thread (one hop per batch, not per chunk), keeping the loop free. +Multi-threaded single-chunk reads of zstd data are ~4.5x faster than before +and now scale with reader threads; single-threaded performance is unchanged. diff --git a/src/zarr/core/codec_pipeline.py b/src/zarr/core/codec_pipeline.py index 2e3f1ed122..4b8831bc7b 100644 --- a/src/zarr/core/codec_pipeline.py +++ b/src/zarr/core/codec_pipeline.py @@ -1182,7 +1182,15 @@ async def read( (isinstance(first_bg, StorePath) and isinstance(first_bg.store, SupportsGetSync)) or (not isinstance(first_bg, StorePath) and isinstance(first_bg, SyncByteGetter)) ): - return self.read_sync(batch, out, drop_axes, max_workers=_resolve_max_workers()) + # One thread hop for the WHOLE batch — not per chunk, so the fused + # design's win over per-chunk async scheduling is preserved. Running + # read_sync inline here would block the event loop for the duration + # of the batch's IO+compute; every sync-API call from every user + # thread shares this one loop, so inline execution serializes + # concurrent callers behind each other's codec compute. + return await asyncio.to_thread( + self.read_sync, batch, out, drop_axes, max_workers=_resolve_max_workers() + ) # Non-sync store (e.g. ZipStore): can't use the sync fast path. But if the # array-bytes codec supports partial decoding (sharding), still route @@ -1235,7 +1243,11 @@ async def write( (isinstance(first_bs, StorePath) and isinstance(first_bs.store, SupportsSetSync)) or (not isinstance(first_bs, StorePath) and isinstance(first_bs, SyncByteSetter)) ): - self.write_sync(batch, value, drop_axes, max_workers=_resolve_max_workers()) + # One thread hop for the whole batch; see the matching comment in + # `read` for why write_sync must not run inline on the event loop. + await asyncio.to_thread( + self.write_sync, batch, value, drop_axes, max_workers=_resolve_max_workers() + ) return await _async_write_fallback(self, batch, value, drop_axes) diff --git a/tests/benchmarks/test_e2e.py b/tests/benchmarks/test_e2e.py index 9d60d9a2fb..487485e262 100644 --- a/tests/benchmarks/test_e2e.py +++ b/tests/benchmarks/test_e2e.py @@ -190,3 +190,51 @@ def setup() -> tuple[tuple[zarr.Array, EllipsisType], dict]: # type: ignore[typ return (arr, Ellipsis), {} benchmark.pedantic(getitem, setup=setup, rounds=3) # type: ignore[no-untyped-call] + + +_CONCURRENT_READ_THREADS = 8 +_concurrent_layout = Layout(shape=(64_000_000,), chunks=(4_000_000,), shards=None) + + +@pytest.mark.parametrize("pipeline", ["batched", "fused_full_threaded"], indirect=True) +@pytest.mark.parametrize("compression_name", ["zstd", None]) +@pytest.mark.parametrize("store", ["local"], indirect=["store"]) +def test_read_array_concurrent( + bench_store: Store, + compression_name: CompressorName, + pipeline: str, + benchmark: BenchmarkFixture, +) -> None: + """Dask-style access: several user threads each reading one chunk per call. + + All sync-API calls are serviced by the one global event loop, so this + measures how much of each read's IO+compute the pipeline runs while + holding the loop: anything inline serializes the readers. + """ + from concurrent.futures import ThreadPoolExecutor + + layout = _concurrent_layout + arr = create_array( + bench_store, + dtype="uint8", + shape=layout.shape, + chunks=layout.chunks, + shards=layout.shards, + compressors=compressors[compression_name], # type: ignore[arg-type] + fill_value=0, + ) + arr[:] = _data(layout.shape) + selections = [ + slice(start, start + layout.chunks[0]) + for start in range(0, layout.shape[0], layout.chunks[0]) + ] + + def read_all_chunks_concurrently() -> None: + with ThreadPoolExecutor(max_workers=_CONCURRENT_READ_THREADS) as executor: + list(executor.map(lambda sel: arr[sel], selections)) + + def setup() -> tuple[tuple[()], dict]: # type: ignore[type-arg] + clear_cache() + return (), {} + + benchmark.pedantic(read_all_chunks_concurrently, setup=setup, rounds=3) # type: ignore[no-untyped-call] diff --git a/tests/test_fused_pipeline.py b/tests/test_fused_pipeline.py index 73c2c6e1c3..09e9241c07 100644 --- a/tests/test_fused_pipeline.py +++ b/tests/test_fused_pipeline.py @@ -34,6 +34,67 @@ def test_construction(codecs: tuple[Any, ...]) -> None: assert pipeline.codecs == codecs +def test_sync_api_compute_off_event_loop(monkeypatch: pytest.MonkeyPatch) -> None: + """Codec compute must never run on the thread driving the event loop. + + Every sync-API call, from every user thread, is serviced by the one global + `zarr_io` event loop. Running decode/encode inline on that loop's thread + turns it into a mutex around codec compute: concurrent readers serialize, + and the penalty grows with codec cost (observed as "fused pipeline is + slower for zstd data" under dask-style multi-threaded single-chunk reads). + """ + import asyncio + + from zarr.core.chunk_utils import ChunkTransform + + compute_on_loop = {"decode": False, "encode": False} + calls = {"decode": 0, "encode": 0} + real_decode = ChunkTransform.decode_chunk + real_encode = ChunkTransform.encode_chunk + + def _running_loop() -> bool: + try: + asyncio.get_running_loop() + except RuntimeError: + return False + return True + + def traced_decode(self: ChunkTransform, chunk_bytes: Any, chunk_spec: Any) -> Any: + calls["decode"] += 1 + compute_on_loop["decode"] = compute_on_loop["decode"] or _running_loop() + return real_decode(self, chunk_bytes, chunk_spec) + + def traced_encode(self: ChunkTransform, chunk_array: Any, chunk_spec: Any) -> Any: + calls["encode"] += 1 + compute_on_loop["encode"] = compute_on_loop["encode"] or _running_loop() + return real_encode(self, chunk_array, chunk_spec) + + monkeypatch.setattr(ChunkTransform, "decode_chunk", traced_decode) + monkeypatch.setattr(ChunkTransform, "encode_chunk", traced_encode) + + with zarr_config.set({"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"}): + arr = zarr.create_array( + MemoryStore(), + shape=(8, 8), + chunks=(4, 4), + dtype="float64", + compressors=ZstdCodec(level=1), + ) + data = np.arange(64, dtype="float64").reshape(8, 8) + arr[:4, :4] = data[:4, :4] # single-chunk write (batch of 1) + arr[:] = data # multi-chunk write + # Guard against vacuity: if the sync fast path stops triggering, the + # traced ChunkTransform methods are never called (the async fallback + # uses AsyncChunkTransform) and the on-loop flags stay trivially False. + assert calls["encode"] > 0 + assert compute_on_loop["encode"] is False + + np.testing.assert_array_equal(arr[:4, :4], data[:4, :4]) # single-chunk read + np.testing.assert_array_equal(arr[:], data) # multi-chunk read + assert calls["decode"] > 0 + assert compute_on_loop["decode"] is False + + def test_evolve_from_array_spec() -> None: """evolve_from_array_spec creates a sync transform.""" from zarr.core.array_spec import ArrayConfig, ArraySpec From aa2b8e298e0b8c245737b1240a5c56c8957998b9 Mon Sep 17 00:00:00 2001 From: Sebastian Hoffmann Date: Wed, 29 Jul 2026 13:43:06 +0200 Subject: [PATCH 11/61] fix(ArraySpec): proper and robust equality semantics for ArraySpec by checking fill_value for byte-identicality, fixes #3054. (#4183) * fix(ArraySpec): proper and robust equality semantics for ArraySpec by checking fill_value for byte-identicality, fixes #3054. * fix: added extra case for unequal types * Update tests/test_array_spec.py * addressed reviewers comments * test: add end-to-end regression test for structured-dtype fills in sharded arrays, and changelog entry The new test exercises the sharding codec's chunk-spec caches with an unhashable np.void fill value (#3054), which the ArraySpec test suite only covers at the unit level. Assisted-by: ClaudeCode:claude-fable-5 --------- Co-authored-by: Davis Bennett Co-authored-by: Davis Bennett --- changes/4183.bugfix.md | 3 + src/zarr/codecs/sharding.py | 8 +- src/zarr/core/array_spec.py | 22 +++- tests/test_array_spec.py | 179 +++++++++++++++++++++++++++++ tests/test_codecs/test_sharding.py | 23 ++++ 5 files changed, 228 insertions(+), 7 deletions(-) create mode 100644 changes/4183.bugfix.md create mode 100644 tests/test_array_spec.py diff --git a/changes/4183.bugfix.md b/changes/4183.bugfix.md new file mode 100644 index 0000000000..809708f596 --- /dev/null +++ b/changes/4183.bugfix.md @@ -0,0 +1,3 @@ +Fixed `TypeError: unhashable type: 'writeable void-scalar'` when writing to sharded arrays whose fill value is a `np.void` scalar, e.g. arrays with a structured dtype. + +`ArraySpec` equality and hashing now compare the fill value by its byte representation rather than numeric equality. As a result, two specs with a `NaN` (or `NaT`) fill value now compare equal, while fill values of `-0.0` and `0.0` now compare unequal. This also restores the sharding codec's per-chunk spec cache, which had been disabled because of this bug. diff --git a/src/zarr/codecs/sharding.py b/src/zarr/codecs/sharding.py index 2d4d63d400..f20979066d 100644 --- a/src/zarr/codecs/sharding.py +++ b/src/zarr/codecs/sharding.py @@ -411,11 +411,7 @@ def __init__( object.__setattr__(self, "subchunk_write_order", subchunk_write_order) # Use instance-local lru_cache to avoid memory leaks - - # numpy void scalars are not hashable, which means an array spec with a fill value that is - # a numpy void scalar will break the lru_cache. This is commented for now but should be - # fixed. See https://github.com/zarr-developers/zarr-python/issues/3054 - # object.__setattr__(self, "_get_chunk_spec", lru_cache()(self._get_chunk_spec)) + object.__setattr__(self, "_get_chunk_spec", lru_cache()(self._get_chunk_spec)) object.__setattr__(self, "_get_index_chunk_spec", lru_cache()(self._get_index_chunk_spec)) object.__setattr__(self, "_get_chunks_per_shard", lru_cache()(self._get_chunks_per_shard)) object.__setattr__(self, "_shard_index_size", lru_cache()(self._shard_index_size)) @@ -441,7 +437,7 @@ def __setstate__(self, state: dict[str, Any]) -> None: object.__setattr__(self, "subchunk_write_order", state["subchunk_write_order"]) # Use instance-local lru_cache to avoid memory leaks - # object.__setattr__(self, "_get_chunk_spec", lru_cache()(self._get_chunk_spec)) + object.__setattr__(self, "_get_chunk_spec", lru_cache()(self._get_chunk_spec)) object.__setattr__(self, "_get_index_chunk_spec", lru_cache()(self._get_index_chunk_spec)) object.__setattr__(self, "_get_chunks_per_shard", lru_cache()(self._get_chunks_per_shard)) object.__setattr__(self, "_shard_index_size", lru_cache()(self._shard_index_size)) diff --git a/src/zarr/core/array_spec.py b/src/zarr/core/array_spec.py index 89163f7d83..1f4ffd6f09 100644 --- a/src/zarr/core/array_spec.py +++ b/src/zarr/core/array_spec.py @@ -3,6 +3,8 @@ from dataclasses import dataclass, fields from typing import TYPE_CHECKING, Any, Literal, Self, TypedDict, cast +import numpy as np + from zarr.core.common import ( MemoryOrder, parse_bool, @@ -132,7 +134,7 @@ def parse_array_config(data: ArrayConfigLike | None) -> ArrayConfig: return ArrayConfig.from_dict(data) -@dataclass(frozen=True) +@dataclass(frozen=True, eq=False) class ArraySpec: shape: tuple[int, ...] dtype: ZDType[TBaseDType, TBaseScalar] @@ -157,6 +159,24 @@ def __init__( object.__setattr__(self, "config", config) object.__setattr__(self, "prototype", prototype) + def _key(self) -> tuple[object, ...]: + """Returns the tuple used for equality/hash identity.""" + fill_value = self.fill_value + if isinstance(fill_value, np.generic): + # fill_values should be byte-identical, otherwise they correspond to different values in memory / on disk. + # Importantly, this ensures np.nan == np.nan, NaT == NaT, and -0.0 != 0.0. + # It also fixes np.void fill_values being unhashable (#3054). + fill_value = fill_value.tobytes() + return (self.shape, self.dtype, fill_value, self.config, self.prototype) + + def __eq__(self, other: object) -> bool: + if not isinstance(other, ArraySpec): + return NotImplemented + return self._key() == other._key() + + def __hash__(self) -> int: + return hash(self._key()) + @property def ndim(self) -> int: return len(self.shape) diff --git a/tests/test_array_spec.py b/tests/test_array_spec.py new file mode 100644 index 0000000000..4fbc0b1205 --- /dev/null +++ b/tests/test_array_spec.py @@ -0,0 +1,179 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +import numpy as np +import pytest + +from zarr.core.array_spec import ArrayConfig, ArraySpec +from zarr.core.buffer import BufferPrototype, default_buffer_prototype +from zarr.core.buffer.cpu import NDBuffer +from zarr.core.dtype import get_data_type_from_native_dtype + +if TYPE_CHECKING: + from collections.abc import Callable + + from zarr.core.common import MemoryOrder + + +def _make_spec( + *, + shape: tuple[int, ...] = (4, 4), + native_dtype: Any = "int16", + fill_value: Any = 0, + order: MemoryOrder = "C", + write_empty_chunks: bool = False, + prototype: BufferPrototype | None = None, +) -> ArraySpec: + """Creates an ArraySpec with common defaults""" + zdtype = get_data_type_from_native_dtype(np.dtype(native_dtype)) + fill_value = zdtype.cast_scalar(fill_value) # mirrors ArrayV3Metadata's fill_value + return ArraySpec( + shape=shape, + dtype=zdtype, + fill_value=fill_value, + config=ArrayConfig(order=order, write_empty_chunks=write_empty_chunks), + prototype=prototype if prototype is not None else default_buffer_prototype(), + ) + + +class _AltNDBuffer(NDBuffer): + """A distinct NDBuffer subclass""" + + +_ALT_PROTOTYPE = BufferPrototype( + buffer=default_buffer_prototype().buffer, + nd_buffer=_AltNDBuffer, +) # a distinct BufferPrototype with a different nd_buffer subclass + + +# Difficult / important cases: +# issue #3054: np.void is unhashable when writeable +# nan/NaT aren't self-equal yet must compare equal for a ArraySpec +SPECS = [ + pytest.param({"native_dtype": "int16", "fill_value": 7}, id="int16"), + pytest.param({"native_dtype": "float64", "fill_value": 1.5}, id="float64"), + pytest.param({"native_dtype": "float64", "fill_value": float("nan")}, id="float64-nan"), + pytest.param({"native_dtype": "float64", "fill_value": -0.0}, id="float64-negzero"), + pytest.param({"native_dtype": "complex128", "fill_value": 1 + 2j}, id="complex128"), + pytest.param( + {"native_dtype": "complex128", "fill_value": complex(-0.0, -0.0)}, + id="complex128-negzero", + ), + pytest.param({"native_dtype": "bool", "fill_value": True}, id="bool"), + pytest.param( + {"native_dtype": "datetime64[s]", "fill_value": np.datetime64("2020-01-01")}, + id="datetime64", + ), + pytest.param( + {"native_dtype": "datetime64[s]", "fill_value": np.datetime64("NaT", "s")}, + id="datetime64-NaT", + ), + pytest.param( + {"native_dtype": [("a", "f8"), ("b", "i8")], "fill_value": (1.0, 2)}, + id="structured-void", + ), + pytest.param({"native_dtype": "U5", "fill_value": "hello"}, id="fixed-string"), + pytest.param({"shape": ()}, id="scalar-shape"), + pytest.param({"shape": (0,)}, id="zero-size"), + pytest.param({"order": "F"}, id="order-F"), +] + + +# Mutations: each mutate kwargs to an unequal version +def _grow_shape(kw: dict[str, Any]) -> dict[str, Any]: + return {"shape": (*kw.get("shape", (4, 4)), 1)} + + +def _flip_order(kw: dict[str, Any]) -> dict[str, Any]: + return {"order": "F" if kw.get("order", "C") == "C" else "C"} + + +def _swap_prototype(_kw: dict[str, Any]) -> dict[str, Any]: + return {"prototype": _ALT_PROTOTYPE} + + +MUTATIONS = [ + pytest.param(_grow_shape, id="shape"), + pytest.param(_flip_order, id="order"), + pytest.param(_swap_prototype, id="prototype"), +] + + +@pytest.mark.parametrize("kwargs", SPECS) +def test_hashable(kwargs: dict[str, Any]) -> None: + """Every ArraySpec is hashable, including structured (np.void) fill values.""" + assert isinstance(hash(_make_spec(**kwargs)), int) + + +@pytest.mark.parametrize("kwargs", SPECS) +def test_equal_specs_hash_equal(kwargs: dict[str, Any]) -> None: + """Independently built specs with identical fields are equal and hash equal.""" + a = _make_spec(**kwargs) + b = _make_spec(**kwargs) + assert a == b + assert hash(a) == hash(b) + + +@pytest.mark.parametrize("kwargs", SPECS) +@pytest.mark.parametrize("mutate", MUTATIONS) +def test_distinct_specs_unequal( + mutate: Callable[[dict[str, Any]], dict[str, Any]], + kwargs: dict[str, Any], +) -> None: + """Changing one dtype-independent field makes a spec unequal to its base.""" + base = _make_spec(**kwargs) + variant = _make_spec(**{**kwargs, **mutate(kwargs)}) + assert base != variant + + +@pytest.mark.parametrize( + ("base", "variant"), + [ + pytest.param({"fill_value": 0}, {"fill_value": 1}, id="fill_value"), + pytest.param({"native_dtype": "int16"}, {"native_dtype": "int32"}, id="dtype"), + pytest.param( + {"native_dtype": "float32", "fill_value": 1.0}, + {"native_dtype": "float64", "fill_value": 1.0}, + id="dtype-float-promote", + ), + ], +) +def test_dtype_and_fill_value_matter(base: dict[str, Any], variant: dict[str, Any]) -> None: + """dtype and fill_value participate in equality; they can't join the cross + product because fill_value is coupled to dtype.""" + assert _make_spec(**base) != _make_spec(**variant) + + +@pytest.mark.parametrize( + ("native_dtype", "neg_fill", "pos_fill"), + [ + pytest.param("float16", -0.0, 0.0, id="float16"), + pytest.param("float32", -0.0, 0.0, id="float32"), + pytest.param("float64", -0.0, 0.0, id="float64"), + pytest.param("complex128", complex(-0.0, -0.0), 0j, id="complex128-both"), + pytest.param("complex128", complex(0.0, -0.0), 0j, id="complex128-imag"), + pytest.param("complex128", complex(-0.0, 0.0), 0j, id="complex128-real"), + pytest.param([("a", "f8")], (-0.0,), (0.0,), id="structured"), + ], +) +def test_signed_zero_fills_are_distinct(native_dtype: Any, neg_fill: Any, pos_fill: Any) -> None: + """A -0.0 fill writes different bytes than +0.0, so the specs are not equal.""" + neg = _make_spec(native_dtype=native_dtype, fill_value=neg_fill) + pos = _make_spec(native_dtype=native_dtype, fill_value=pos_fill) + assert neg != pos + + +@pytest.mark.parametrize( + ("obj"), + [ + pytest.param(None, id="None"), + pytest.param(42, id="int"), + pytest.param("hello", id="str"), + pytest.param([1, 2, 3], id="list"), + pytest.param({"a": 1}, id="dict"), + ], +) +def test_unequal_with_invalid_type(obj: Any) -> None: + assert (_make_spec() == obj) is False + assert _make_spec() != obj diff --git a/tests/test_codecs/test_sharding.py b/tests/test_codecs/test_sharding.py index 9e6bebd8df..de576dbef5 100644 --- a/tests/test_codecs/test_sharding.py +++ b/tests/test_codecs/test_sharding.py @@ -734,6 +734,29 @@ async def test_delete_empty_shards(store: Store) -> None: assert len(chunk_bytes) == 16 * 2 + 8 * 8 * 2 + 4 +def test_structured_dtype_fill_value() -> None: + """Sharded arrays with a structured dtype are writable and readable even though + the fill value is an (unhashable) ``np.void`` scalar: the sharding codec's + chunk-spec caches key on ``ArraySpec``, whose hash must handle void fills + (see https://github.com/zarr-developers/zarr-python/issues/3054).""" + dtype = np.dtype([("a", "i4"), ("b", "f4")]) + arr = zarr.create_array( + MemoryStore(), + shape=(8,), + chunks=(2,), + shards=(4,), + dtype=dtype, + fill_value=(1, 2.0), + ) + data = np.array([(i, i / 2) for i in range(8)], dtype=dtype) + arr[:4] = data[:4] + + expected = np.zeros(8, dtype=dtype) + expected[:4] = data[:4] + expected[4:] = (1, 2.0) # untouched shard reads back as the fill value + assert np.array_equal(arr[:], expected) + + def test_pickle() -> None: """ShardingCodec round-trips through pickle, including the non-serialized ``subchunk_write_order`` (which ``to_dict`` omits and which must not silently From b213b548d2ecc8ab060a5fa5c22e97856c708361 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 29 Jul 2026 13:43:37 +0200 Subject: [PATCH 12/61] fix: make benchmark page-cache clearing opt-in, never prompt for sudo (#4200) * fix: byte-order handling for structured dtypes in the bytes codec (#220) * fix: byte-order handling for structured dtypes in the bytes codec The bytes codec neither byte-swapped structured-dtype fields to its configured endian on encode (numpy reports byteorder '|' for void dtypes, so the top-level byteorder comparison never detected a mismatch) nor honored its endian when decoding, silently corrupting any structured data whose field byte order differed from the stored one (e.g. virtual references to external big-endian data). Encode now detects byte-order mismatches by comparing full dtypes via newbyteorder, and decode reinterprets raw bytes in the stored byte order before converting to the data type's declared byte order, so the stored layout (codec state) and the in-memory layout (array data type) are independent. Closes #4141 Assisted-by: ClaudeCode:claude-fable-5 * test: fold structured byte-order cases into existing bytes codec tests Extend test_endian's parametrization with structured dtypes and test_bytes_codec_sync_roundtrip with endian/dtype parametrization plus stored-layout and decoded-dtype assertions, instead of adding parallel test functions for the same properties. Assisted-by: ClaudeCode:claude-fable-5 * refactor: rename stored_dtype to view_dtype in BytesCodec decode The variable is the dtype used to view the raw chunk bytes (byte order from the codec's endian configuration), not a property of the stored data or of the returned buffer, which always carries the array's declared dtype. Assisted-by: ClaudeCode:claude-fable-5 * docs: note that the decode-side byte-order conversion copies the chunk Assisted-by: ClaudeCode:claude-fable-5 * fix: make benchmark page-cache clearing opt-in, never prompt for sudo clear_cache() in tests/benchmarks/test_e2e.py ran sudo unconditionally in every benchmark's setup, so a plain `pytest` run blocked on a password prompt (#4199). It is now a no-op unless ZARR_BENCHMARK_CLEAR_CACHE is set, uses `sudo -n` so it can never block interactively, and the broken Darwin invocation ("&&" passed as an argument to sync) is fixed. The benchmark CI jobs set the variable to keep clearing caches. Closes #4199 Assisted-by: ClaudeCode:claude-fable-5 --- .github/workflows/codspeed.yml | 2 ++ .github/workflows/test.yml | 2 ++ changes/4199.bugfix.md | 1 + tests/benchmarks/test_e2e.py | 23 ++++++++++++++++++++--- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 changes/4199.bugfix.md diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 39cd8eb261..427262d598 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -33,6 +33,8 @@ jobs: version: '1.16.5' - name: Run the benchmarks uses: CodSpeedHQ/action@f99becdce5e5d51fd556489ebef684f4ecfd6286 # v4.18.5 + env: + ZARR_BENCHMARK_CLEAR_CACHE: '1' with: mode: walltime run: hatch run test.py3.12-minimal:pytest tests/benchmarks --codspeed diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab78cfbe2b..ce6b7e3eba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -178,6 +178,8 @@ jobs: - name: Install Hatch run: python -m pip install hatch==1.16.5 - name: Run Benchmarks + env: + ZARR_BENCHMARK_CLEAR_CACHE: '1' run: | hatch env run --env "test.py3.13-minimal" run-benchmark diff --git a/changes/4199.bugfix.md b/changes/4199.bugfix.md new file mode 100644 index 0000000000..d0c522cd7e --- /dev/null +++ b/changes/4199.bugfix.md @@ -0,0 +1 @@ +The end-to-end benchmarks no longer invoke `sudo` to drop the OS page cache during a regular `pytest` run. Cache clearing is now opt-in via the `ZARR_BENCHMARK_CLEAR_CACHE` environment variable, which the benchmark CI jobs set. diff --git a/tests/benchmarks/test_e2e.py b/tests/benchmarks/test_e2e.py index 487485e262..de69fca59b 100644 --- a/tests/benchmarks/test_e2e.py +++ b/tests/benchmarks/test_e2e.py @@ -4,8 +4,10 @@ from __future__ import annotations +import os import platform import subprocess +import warnings from functools import lru_cache from operator import getitem, setitem from typing import TYPE_CHECKING, Any, Literal @@ -21,12 +23,27 @@ def clear_cache() -> None: + """Drop the OS page cache between benchmark rounds. + + Requires passwordless sudo, so it is opt-in: set `ZARR_BENCHMARK_CLEAR_CACHE=1` + to enable it (as the benchmark CI jobs do). By default this is a no-op, so a + plain `pytest` run never prompts for a sudo password (see issue #4199). + `sudo -n` guarantees we fail instead of blocking on a password prompt even + when the variable is set. + """ + if os.environ.get("ZARR_BENCHMARK_CLEAR_CACHE", "") not in ("1", "true"): + return if platform.system() == "Darwin": - subprocess.call(["sync", "&&", "sudo", "purge"]) + subprocess.call(["sync"]) + subprocess.call(["sudo", "-n", "purge"]) elif platform.system() == "Linux": - subprocess.call(["sudo", "sh", "-c", "sync; echo 3 > /proc/sys/vm/drop_caches"]) + subprocess.call(["sudo", "-n", "sh", "-c", "sync; echo 3 > /proc/sys/vm/drop_caches"]) else: - raise Exception("Unsupported platform") # noqa: TRY002 + warnings.warn( + f"ZARR_BENCHMARK_CLEAR_CACHE is set but cache clearing is not supported on " + f"{platform.system()}; skipping.", + stacklevel=2, + ) if TYPE_CHECKING: From 401e597bed1e6bfd43be75adabbbf92a3ddf2e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Selman=20=C3=96zleyen?= <32667648+selmanozleyen@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:13:47 +0200 Subject: [PATCH 13/61] perf(indexing): speed up sorted 1-D coordinate selections (#4172) * perf(indexing): sorted 1-D fast path * clean up comments * name changelog file * rename changes file * add guard for uint and add test case for it * apply suggestions * add test_coordinate_indexer_1d_last_chunk_boundary_does_not_overflow and it's fix * add path whenever the requests are sparse * first == last edge case and do the cost check inside the active path not before (duh) * update the changelog file * rewording --------- Co-authored-by: Davis Bennett --- changes/4172.misc.md | 7 +++ src/zarr/core/indexing.py | 54 +++++++++++++++++++ tests/test_indexing.py | 110 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 changes/4172.misc.md diff --git a/changes/4172.misc.md b/changes/4172.misc.md new file mode 100644 index 0000000000..0be7226476 --- /dev/null +++ b/changes/4172.misc.md @@ -0,0 +1,7 @@ +Improved `CoordinateIndexer` construction for large, sorted, in-bounds, one-dimensional integer +coordinate selections over regular chunk grids (e.g. `arr.get_coordinate_selection(sorted_idx)`, +`arr.vindex[sorted_idx]`, and the gather behind sparse/CSR row selections). When boundary searching +is estimated to be cheaper than processing every coordinate, per-chunk projections are now built +with `searchsorted`, making index construction ~15x faster for large gathers. Sparse sorted +selections spanning many chunks relative to their coordinate count, as well as unsorted, negative, +multi-dimensional, and irregular-grid selections, continue to use the existing implementation. diff --git a/src/zarr/core/indexing.py b/src/zarr/core/indexing.py index f6eb495cd9..875c22fbd3 100644 --- a/src/zarr/core/indexing.py +++ b/src/zarr/core/indexing.py @@ -22,6 +22,7 @@ import numpy as np import numpy.typing as npt +from zarr.core.chunk_grids import FixedDimension from zarr.core.common import ceildiv, product from zarr.core.metadata.v2 import ArrayV2Metadata from zarr.core.metadata.v3 import ArrayV3Metadata @@ -1206,6 +1207,59 @@ def __init__( f"got {selection!r}" ) + # Optimization for a single sorted, in-bounds, 1-D integer coordinate array over a + # regular (fixed-size) chunk grid. The general path below makes several full passes over + # the flat selection. For sufficiently dense selections, locating the internal chunk + # boundaries with searchsorted is cheaper. + if len(selection_normalized) == 1: + (coords,) = selection_normalized + g0 = dim_grids[0] + # coords is an integer ndarray here: is_coordinate_selection() validated above, and + # the normalization turned ints/lists into arrays. Only the sorted-1D-over-regular-grid + # shape is special-cased; everything else falls through to the general path below. + if ( + isinstance(g0, FixedDimension) + and g0.size > 0 # guard the divide below + and coords.ndim == 1 + and coords.size > 0 + and coords[0] >= 0 + and coords[-1] < shape[0] + and coords[0] <= coords[-1] + ): + size = g0.size + first = int(coords[0]) // size + last = int(coords[-1]) // size + chunk_span = last - first + 1 + # searchsorted does O(log n) work per chunk in the spanned range. Fall through + # when directly processing the coordinates is expected to be cheaper. + if ( + chunk_span * coords.size.bit_length() < coords.size + and bool((coords[:-1] <= coords[1:]).all()) # sorted -> grouped by chunk + ): + # Search only internal boundaries. Derive the first and last counts from the + # selection bounds so that the boundary after the last chunk cannot overflow. + if first == last: + counts = np.array([coords.size], dtype=np.intp) + else: + edges = np.arange(first + 1, last + 1, dtype=coords.dtype) * size + cuts = np.searchsorted(coords, edges) + counts = np.diff(cuts, prepend=0, append=coords.size) + chunk_rixs = (first + np.nonzero(counts)[0]).astype(np.intp) + chunk_nitems = np.zeros(nchunks, dtype=np.intp) + chunk_nitems[first : last + 1] = counts + chunk_nitems_cumsum = np.cumsum(chunk_nitems) + + object.__setattr__(self, "sel_shape", coords.shape) + object.__setattr__(self, "selection", (coords,)) + object.__setattr__(self, "sel_sort", None) + object.__setattr__(self, "chunk_nitems_cumsum", chunk_nitems_cumsum) + object.__setattr__(self, "chunk_rixs", chunk_rixs) + object.__setattr__(self, "chunk_mixs", (chunk_rixs,)) + object.__setattr__(self, "dim_grids", dim_grids) + object.__setattr__(self, "shape", coords.shape) + object.__setattr__(self, "drop_axes", ()) + return + # handle wraparound, boundscheck for dim_sel, dim_len in zip(selection_normalized, shape, strict=True): # handle wraparound diff --git a/tests/test_indexing.py b/tests/test_indexing.py index 3d80f6364c..04fbdad8c6 100644 --- a/tests/test_indexing.py +++ b/tests/test_indexing.py @@ -14,8 +14,10 @@ from tests.conftest import Expect, ExpectFail from zarr import Array from zarr.core.buffer import default_buffer_prototype +from zarr.core.chunk_grids import ChunkGrid from zarr.core.indexing import ( BasicSelection, + CoordinateIndexer, CoordinateSelection, OrthogonalSelection, Selection, @@ -1047,8 +1049,15 @@ def _test_get_coordinate_selection( Expect(input=[3, 25, 8, 17], output=None, id="out-of-order"), Expect(input=[1, 8, 15, 29], output=None, id="sorted"), Expect(input=[29, 15, 8, 1], output=None, id="reversed"), + Expect(input=np.array([29, 15, 8, 1], dtype=np.uint32), output=None, id="reversed-uint"), Expect(input=[2, 2, 8, 8], output=None, id="duplicates"), Expect(input=np.array([[2, 4], [6, 8]]), output=None, id="multi-dim"), + # sorted-1D fast path (chunk_shape=(7,)): boundaries, contiguous runs, single chunk, full + Expect(input=[0, 6, 7, 13, 14, 28, 29], output=None, id="sorted-chunk-boundaries"), + Expect(input=[0, 1, 2, 8, 9, 10, 21, 22, 23], output=None, id="sorted-contiguous-runs"), + Expect(input=[1, 2, 3, 4, 5, 6], output=None, id="sorted-single-chunk"), + Expect(input=list(range(30)), output=None, id="sorted-full"), + Expect(input=[0, 0, 7, 7, 7, 29], output=None, id="sorted-duplicates-boundaries"), ] # get_coordinate_selection and vindex word their errors differently for these @@ -1141,6 +1150,107 @@ def test_get_coordinate_selection_1d( _test_get_coordinate_selection(a, z, case.input) +@pytest.mark.parametrize( + ("chunks", "shards"), + [((7,), None), ((7,), (21,))], + ids=["chunked", "sharded"], +) +def test_get_coordinate_selection_1d_fast_path( + store: StorePath, chunks: tuple[int, ...], shards: tuple[int, ...] | None +) -> None: + """The sorted-1D-runs fast path in CoordinateIndexer matches numpy on chunked and sharded arrays. + + Exercises the boundary/run/single-chunk/full-array cases that the fast path optimizes, plus + the sharded case where the top-level (shard) grid drives chunk assignment. + """ + a = np.arange(210, dtype=int) + z = zarr.create_array( + store=store / str(uuid4()), + shape=a.shape, + dtype=a.dtype, + chunks=chunks, + shards=shards, + ) + z[:] = a + rng = np.random.default_rng(0) + selections = [ + np.sort(rng.choice(210, 60, replace=False)), # scattered sorted + np.array([0, 6, 7, 20, 21, 209]), # chunk/shard boundaries + np.concatenate([np.arange(s, s + 5) for s in (0, 33, 100, 180)]), # contiguous runs + np.array([0, 0, 7, 7, 209]), # sorted with duplicates + np.arange(210), # whole array + np.array([5]), # single element + ] + for sel in selections: + assert_array_equal(a[sel], z.get_coordinate_selection(sel)) + assert_array_equal(a[sel], z.vindex[sel]) + + +def test_coordinate_indexer_1d_last_chunk_boundary_does_not_overflow() -> None: + max_intp = np.iinfo(np.intp).max + chunk_size = max_intp // 2 + 1 + coords = np.arange(max_intp - 4, max_intp, dtype=np.intp) + chunk_grid = ChunkGrid.from_sizes((max_intp,), (chunk_size,)) + + (projection,) = tuple(CoordinateIndexer((coords,), (max_intp,), chunk_grid)) + + assert projection.chunk_coords == (1,) + assert_array_equal(projection.chunk_selection[0], coords - chunk_size) + assert projection.out_selection == slice(0, 4) + + +@pytest.mark.parametrize("coord_dtype", [np.int8, np.uint8, np.uint32]) +def test_coordinate_selection_1d_narrow_dtype_large_chunk( + store: StorePath, coord_dtype: type[np.integer[Any]] +) -> None: + source = np.arange(1_000) + coords = np.arange(10, dtype=coord_dtype) + z = zarr_array_from_numpy_array(store, source, chunk_shape=(1_000,)) + + assert_array_equal(z.get_coordinate_selection(coords), source[coords]) + assert_array_equal(z.vindex[coords], source[coords]) + assert_array_equal(z[coords], source[coords]) + + expected = source.copy() + expected[coords] = -1 + z.set_coordinate_selection(coords, -1) + assert_array_equal(z[:], expected) + z[:] = source + z.vindex[coords] = -1 + assert_array_equal(z[:], expected) + + +def test_coordinate_indexer_1d_sparse_selection_uses_general_path( + monkeypatch: pytest.MonkeyPatch, +) -> None: + coords = np.array([0, 99]) + chunk_grid = ChunkGrid.from_sizes((100,), (1,)) + + def unexpected_searchsorted(*args: Any, **kwargs: Any) -> None: + pytest.fail("sparse coordinate selection should not call searchsorted") + + monkeypatch.setattr(np, "searchsorted", unexpected_searchsorted) + projections = tuple(CoordinateIndexer((coords,), (100,), chunk_grid)) + + assert tuple(projection.chunk_coords for projection in projections) == ((0,), (99,)) + + +def test_get_coordinate_selection_1d_irregular_grid(store: StorePath) -> None: + """Coordinate selections on an irregular (rectilinear) chunk grid bypass the sorted-1D fast + path (which requires a regular grid) and still match numpy via the general path.""" + a = np.arange(30, dtype=int) + with zarr.config.set({"array.rectilinear_chunks": True}): + z = zarr.create_array( + store=store / str(uuid4()), + shape=a.shape, + dtype=a.dtype, + chunks=((3, 3, 4, 5, 5, 5, 5),), + ) + z[:] = a + for sel in (np.array([1, 8, 15, 29]), np.array([0, 3, 3, 29]), np.arange(30)): + assert_array_equal(a[sel], z.get_coordinate_selection(sel)) + + @pytest.mark.parametrize("case", _COORD_1D_BAD_CASES, ids=lambda c: c.id) def test_get_coordinate_selection_1d_raises(store: StorePath, case: ExpectFail[Any]) -> None: """get_coordinate_selection and vindex both raise IndexError for invalid 1D selections.""" From 123268a7e467945c7d6a88e8d67d96c4ebb26809 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 29 Jul 2026 15:20:39 +0200 Subject: [PATCH 14/61] fix: FusedCodecPipeline falls back to async path for sharded arrays with async-only inner codecs (#4179) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ShardingCodec structurally satisfies SupportsSyncCodec, but its sync methods delegate to the configured inner and index codec chains — so a shard whose inner or index chain contains a codec implementing only the async codec interface passed the fused pipeline's sync gate and then raised TypeError mid-IO in ChunkTransform construction. Sync capability is now answered by _codec_supports_sync, which combines the structural protocol check with a per-instance _sync_capable opt-out (absent means capable). ShardingCodec reports False when any codec in its inner or index chain is not sync-capable (recursively, so a nested shard propagates its opt-out outward), which makes ChunkTransform construction raise at pipeline evolve time and the pipeline decline the sync fast path — such arrays route through the async paths, matching BatchedCodecPipeline. Fully sync-capable chains keep the fast path. Closes #4178 Assisted-by: ClaudeCode:claude-fable-5 --- changes/4179.bugfix.md | 1 + src/zarr/abc/codec.py | 14 ++++++ src/zarr/codecs/sharding.py | 26 ++++++++++- src/zarr/core/chunk_utils.py | 10 +++- tests/test_fused_pipeline.py | 88 ++++++++++++++++++++++++++++++++++++ 5 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 changes/4179.bugfix.md diff --git a/changes/4179.bugfix.md b/changes/4179.bugfix.md new file mode 100644 index 0000000000..e02523114c --- /dev/null +++ b/changes/4179.bugfix.md @@ -0,0 +1 @@ +Fixed the opt-in `FusedCodecPipeline` for sharded arrays whose inner or index codec chain contains a codec implementing only the async codec interface (no `SupportsSyncCodec`). Such arrays previously raised `TypeError: All codecs must implement SupportsSyncCodec` on both read and write; the pipeline now declines its synchronous fast path for them and falls back to the async path, matching the behavior of the default `BatchedCodecPipeline`. Fully sync-capable codec chains keep the fast path unchanged. diff --git a/src/zarr/abc/codec.py b/src/zarr/abc/codec.py index 61c5dc9948..34d349e6d1 100644 --- a/src/zarr/abc/codec.py +++ b/src/zarr/abc/codec.py @@ -82,6 +82,20 @@ def _decode_sync(self, chunk_data: CO, chunk_spec: ArraySpec) -> CI: ... def _encode_sync(self, chunk_data: CI, chunk_spec: ArraySpec) -> CO | None: ... +def _codec_supports_sync(codec: object) -> bool: + """Whether `codec` can actually run on a synchronous (no event loop) path. + + Structural membership in `SupportsSyncCodec` is necessary but not always + sufficient: a codec can provide `_decode_sync`/`_encode_sync` whose ability + to run depends on runtime configuration the type system cannot see. + `ShardingCodec` is the canonical case — its sync methods delegate to its + configured inner and index codec chains, so they only work when every codec + in those chains is itself sync-capable. Such codecs opt out dynamically via + a `_sync_capable` attribute/property (absent means capable). + """ + return isinstance(codec, SupportsSyncCodec) and getattr(codec, "_sync_capable", True) + + class BaseCodec[CI: CodecInput, CO: CodecOutput](Metadata): """Generic base class for codecs. diff --git a/src/zarr/codecs/sharding.py b/src/zarr/codecs/sharding.py index f20979066d..8f23606011 100644 --- a/src/zarr/codecs/sharding.py +++ b/src/zarr/codecs/sharding.py @@ -14,7 +14,7 @@ ArrayBytesCodecPartialEncodeMixin, Codec, CodecPipeline, - SupportsSyncCodec, + _codec_supports_sync, ) from zarr.abc.store import ( ByteGetter, @@ -1402,8 +1402,30 @@ def _is_complete_shard_write( is_complete_chunk for *_, is_complete_chunk in indexed_chunks ) + @property + def _sync_capable(self) -> bool: + """Dynamic opt-out consulted by `_codec_supports_sync` / `ChunkTransform`. + + This codec structurally satisfies `SupportsSyncCodec`, but every sync + method (`_decode_sync`, `_encode_sync`, `_decode_partial_sync`, + `_encode_partial_sync`) delegates to the inner and index codec chains + through `ChunkTransform`, so it can only run synchronously when every + codec in BOTH chains is itself sync-capable. Reporting False here makes + `ChunkTransform` construction raise, which in turn makes + `FusedCodecPipeline.evolve_from_array_spec` set `sync_transform=None` — + the whole pipeline then declines the sync fast path and routes through + the async paths (partial shard decode / async fallback write), exactly + as it does for an async-only TOP-level codec or a non-sync store. + """ + return self._inner_codecs_sync_capable() and self._index_codecs_sync_capable() + + def _inner_codecs_sync_capable(self) -> bool: + # _codec_supports_sync (not bare isinstance) so a nested sharding codec + # with an async-only inner chain propagates its opt-out outward. + return all(_codec_supports_sync(c) for c in self.codecs) + def _index_codecs_sync_capable(self) -> bool: - return all(isinstance(c, SupportsSyncCodec) for c in self.index_codecs) + return all(_codec_supports_sync(c) for c in self.index_codecs) async def _decode_shard_index( self, index_bytes: Buffer, chunks_per_shard: tuple[int, ...] diff --git a/src/zarr/core/chunk_utils.py b/src/zarr/core/chunk_utils.py index ee42e60cce..d93793f853 100644 --- a/src/zarr/core/chunk_utils.py +++ b/src/zarr/core/chunk_utils.py @@ -3,7 +3,7 @@ from dataclasses import dataclass, field from typing import TYPE_CHECKING, Any, cast -from zarr.abc.codec import GetResult, SupportsSyncCodec +from zarr.abc.codec import GetResult, SupportsSyncCodec, _codec_supports_sync from zarr.core.indexing import is_scalar if TYPE_CHECKING: @@ -240,7 +240,13 @@ class ChunkTransform: def __post_init__(self) -> None: from zarr.core.codec_pipeline import codecs_from_list - non_sync = [c for c in self.codecs if not isinstance(c, SupportsSyncCodec)] + # _codec_supports_sync, not a bare isinstance check: a codec can satisfy + # the SupportsSyncCodec protocol structurally yet be unable to run + # synchronously (ShardingCodec whose inner/index chain contains an + # async-only codec). Such codecs opt out via `_sync_capable`, and the + # TypeError here is what makes FusedCodecPipeline.evolve_from_array_spec + # decline the sync fast path and fall back to the async pipeline. + non_sync = [c for c in self.codecs if not _codec_supports_sync(c)] if non_sync: names = ", ".join(type(c).__name__ for c in non_sync) raise TypeError( diff --git a/tests/test_fused_pipeline.py b/tests/test_fused_pipeline.py index 09e9241c07..02b4026fd9 100644 --- a/tests/test_fused_pipeline.py +++ b/tests/test_fused_pipeline.py @@ -8,6 +8,7 @@ import pytest import zarr +from zarr.abc.codec import BytesBytesCodec from zarr.codecs.bytes import BytesCodec from zarr.codecs.gzip import GzipCodec from zarr.codecs.transpose import TransposeCodec @@ -643,6 +644,93 @@ def spy_write_sync(self: Any, *args: Any, **kwargs: Any) -> Any: ) +# --------------------------------------------------------------------------- +# Async-only codecs inside a shard's inner codec chain +# --------------------------------------------------------------------------- + + +class _AsyncOnlyNoopCodec(BytesBytesCodec): # type: ignore[misc,unused-ignore] + """A no-op BB codec implementing ONLY the async codec interface. + + Deliberately does NOT satisfy `SupportsSyncCodec` (no `_decode_sync` / + `_encode_sync`), modelling a third-party codec that predates the sync + protocol. Class-level counters prove the codec actually ran. + """ + + is_fixed_size = True + encode_calls = 0 + decode_calls = 0 + + def to_dict(self) -> dict[str, Any]: + return {"name": "test-async-only-noop", "configuration": {}} + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> _AsyncOnlyNoopCodec: + return cls() + + def compute_encoded_size(self, input_byte_length: int, _spec: Any) -> int: + return input_byte_length + + async def _encode_single(self, chunk_bytes: Any, chunk_spec: Any) -> Any: + type(self).encode_calls += 1 + return chunk_bytes + + async def _decode_single(self, chunk_bytes: Any, chunk_spec: Any) -> Any: + type(self).decode_calls += 1 + return chunk_bytes + + +def test_sharded_roundtrip_with_async_only_inner_codec() -> None: + """A sharded array whose INNER codec chain contains an async-only codec + round-trips under FusedCodecPipeline (full write, partial write, full read, + partial read). + + Regression: the pipeline's top-level guard (evolve_from_array_spec -> + sync_transform=None) only inspected the top-level chain. ShardingCodec + structurally satisfies SupportsSyncCodec, so a sync transform was built and + the sync fast path dove into ShardingCodec's sync shard paths, which raised + TypeError from the inner ChunkTransform. The pipeline must instead decline + the sync fast path and fall back to the async inner pipeline, like + BatchedCodecPipeline. + """ + _AsyncOnlyNoopCodec.encode_calls = 0 + _AsyncOnlyNoopCodec.decode_calls = 0 + + with zarr_config.set({"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"}): + store = MemoryStore() + arr = zarr.create_array( + store=store, + shape=(16, 16), + shards=(8, 8), + chunks=(4, 4), + dtype="int32", + compressors=[_AsyncOnlyNoopCodec()], + fill_value=-1, + ) + assert isinstance(arr._async_array.codec_pipeline, FusedCodecPipeline) + + data = np.arange(256, dtype="int32").reshape(16, 16) + arr[:] = data # full write + np.testing.assert_array_equal(arr[:], data) # full read + np.testing.assert_array_equal(arr[2:11, 3:14], data[2:11, 3:14]) # partial read + + arr[5:7, 5:13] = 0 # partial write (read-merge-write of existing shards) + data[5:7, 5:13] = 0 + np.testing.assert_array_equal(arr[:], data) + + assert _AsyncOnlyNoopCodec.encode_calls > 0, "async-only inner codec never encoded" + assert _AsyncOnlyNoopCodec.decode_calls > 0, "async-only inner codec never decoded" + + # The stored bytes are valid for the default pipeline too: read them back + # under BatchedCodecPipeline (default codec_pipeline.path). Opening from + # metadata needs the codec name in the registry. + from zarr.registry import register_codec + + register_codec("test-async-only-noop", _AsyncOnlyNoopCodec) + reread = zarr.open_array(store=store, mode="r") + np.testing.assert_array_equal(reread[:], data) + + # --------------------------------------------------------------------------- # AsyncChunkTransform: the async per-chunk codec chain used on the async # fallback path. It is the async mirror of ChunkTransform, so it must produce From 80880a0425243406e145a69b722d7411c1dc6563 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 29 Jul 2026 17:54:21 +0200 Subject: [PATCH 15/61] fix: fused pipeline falls back for partial-mixin codecs without sync partial methods (#4201) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The partial dispatch in FusedCodecPipeline.read_sync/write_sync asserted the private _decode_partial_sync/_encode_partial_sync methods, which only ShardingCodec implements. A codec advertising the public partial mixins (ArrayBytesCodecPartialDecodeMixin/-EncodeMixin) with only the documented async partial methods died with a bare AssertionError — or, under python -O, an AttributeError mid-IO. The asserts are now capability gates: codecs without the sync partial methods take the full-chunk sync path instead. The related crash for sharded arrays with async-only inner codecs is fixed separately in zarr-developers/zarr-python#4179. Assisted-by: ClaudeCode:claude-fable-5 --- changes/4201.bugfix.md | 1 + src/zarr/core/codec_pipeline.py | 24 ++++-- tests/test_fused_pipeline.py | 141 +++++++++++++++++++++++++++++++- 3 files changed, 155 insertions(+), 11 deletions(-) create mode 100644 changes/4201.bugfix.md diff --git a/changes/4201.bugfix.md b/changes/4201.bugfix.md new file mode 100644 index 0000000000..d837a8a9e2 --- /dev/null +++ b/changes/4201.bugfix.md @@ -0,0 +1 @@ +Fixed the opt-in `FusedCodecPipeline` for serializers that advertise the partial-decode/encode mixins with only the documented async partial methods: the partial dispatch previously asserted on the private `_decode_partial_sync`/`_encode_partial_sync` hooks (an `AssertionError`, or an `AttributeError` mid-IO under `python -O`); such codecs now take the full-chunk sync path. diff --git a/src/zarr/core/codec_pipeline.py b/src/zarr/core/codec_pipeline.py index 4b8831bc7b..56a06b906c 100644 --- a/src/zarr/core/codec_pipeline.py +++ b/src/zarr/core/codec_pipeline.py @@ -1039,10 +1039,14 @@ def read_sync( # Partial-decode fast path: the AB codec owns IO (read only the # byte ranges needed for the requested selection). Same condition - # and dispatch as BatchedCodecPipeline.read_batch. - if self.supports_partial_decode: - codec = self.array_bytes_codec - assert hasattr(codec, "_decode_partial_sync") + # and dispatch as BatchedCodecPipeline.read_batch, plus a gate on the + # sync partial method: the public partial-decode contract + # (`ArrayBytesCodecPartialDecodeMixin`) only requires the async + # `_decode_partial_single`, so a codec may support partial decode + # without `_decode_partial_sync` — such codecs take the full-chunk + # path below instead. + codec = self.array_bytes_codec + if self.supports_partial_decode and hasattr(codec, "_decode_partial_sync"): def _read_one( item: tuple[Any, ArraySpec, SelectorTuple, SelectorTuple, bool], @@ -1111,10 +1115,14 @@ def write_sync( # Partial-encode path: the AB codec owns IO (read, merge, encode, # write). Same condition and calling convention as - # BatchedCodecPipeline.write_batch. - if self.supports_partial_encode: - codec = self.array_bytes_codec - assert hasattr(codec, "_encode_partial_sync") + # BatchedCodecPipeline.write_batch, plus a gate on the sync partial + # method: the public partial-encode contract + # (`ArrayBytesCodecPartialEncodeMixin`) only requires the async + # `_encode_partial_single`, so a codec may support partial encode + # without `_encode_partial_sync` — such codecs take the full-chunk + # path below instead. + codec = self.array_bytes_codec + if self.supports_partial_encode and hasattr(codec, "_encode_partial_sync"): scalar = len(value.shape) == 0 def _write_one( diff --git a/tests/test_fused_pipeline.py b/tests/test_fused_pipeline.py index 02b4026fd9..fd86936853 100644 --- a/tests/test_fused_pipeline.py +++ b/tests/test_fused_pipeline.py @@ -2,21 +2,32 @@ from __future__ import annotations -from typing import Any +from dataclasses import dataclass, field, replace +from typing import TYPE_CHECKING, Any import numpy as np import pytest import zarr -from zarr.abc.codec import BytesBytesCodec +from zarr.abc.codec import ( + ArrayBytesCodec, + ArrayBytesCodecPartialDecodeMixin, + ArrayBytesCodecPartialEncodeMixin, + BytesBytesCodec, +) from zarr.codecs.bytes import BytesCodec from zarr.codecs.gzip import GzipCodec from zarr.codecs.transpose import TransposeCodec from zarr.codecs.zstd import ZstdCodec from zarr.core.codec_pipeline import FusedCodecPipeline from zarr.core.config import config as zarr_config +from zarr.registry import register_codec from zarr.storage import MemoryStore, StorePath +if TYPE_CHECKING: + from zarr.core.array_spec import ArraySpec + from zarr.core.buffer import Buffer, NDBuffer + @pytest.mark.parametrize( "codecs", @@ -261,7 +272,7 @@ def test_chunk_transform_uses_runtime_prototype() -> None: """ from zarr.abc.codec import BytesBytesCodec from zarr.core.array_spec import ArrayConfig, ArraySpec - from zarr.core.buffer import Buffer, BufferPrototype, default_buffer_prototype + from zarr.core.buffer import BufferPrototype, default_buffer_prototype from zarr.core.chunk_utils import ChunkTransform from zarr.core.dtype import get_data_type_from_native_dtype @@ -831,3 +842,127 @@ def test_async_decode_encode_passes_through_none_chunks() -> None: assert decoded[1] is None assert decoded[0] is not None np.testing.assert_array_equal(decoded[0].as_numpy_array(), data) + + +# --------------------------------------------------------------------------- +# Graceful fallback for partial-mixin codecs without private sync-partial hooks +# +# The public partial-decode/encode contract (`ArrayBytesCodecPartialDecodeMixin` +# / `ArrayBytesCodecPartialEncodeMixin`) only requires the async +# `_decode_partial_single` / `_encode_partial_single`. The fused pipeline must +# route such codecs through its full-chunk sync path instead of asserting on +# the private `_decode_partial_sync` / `_encode_partial_sync` hooks. The double +# below is a minimal conforming implementer of that contract; it guards the +# public extension API, so it must not grow the private sync-partial methods. +# --------------------------------------------------------------------------- + + +@dataclass(frozen=True) +class PartialMixinCodec( + ArrayBytesCodec, ArrayBytesCodecPartialDecodeMixin, ArrayBytesCodecPartialEncodeMixin +): + """Serializer with sync whole-chunk methods plus ONLY async partial methods. + + This is the pre-fused public contract for partial-capable codecs: the + mixins' `_decode_partial_single` / `_encode_partial_single`. It must not + implement `_decode_partial_sync` / `_encode_partial_sync`. + """ + + inner: BytesCodec = field(default_factory=BytesCodec) + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> PartialMixinCodec: + return cls() + + def to_dict(self) -> dict[str, Any]: + return {"name": "test-partial-mixin"} + + def evolve_from_array_spec(self, array_spec: ArraySpec) -> PartialMixinCodec: + return replace(self, inner=self.inner.evolve_from_array_spec(array_spec)) + + def compute_encoded_size(self, input_byte_length: int, chunk_spec: ArraySpec) -> int: + return self.inner.compute_encoded_size(input_byte_length, chunk_spec) + + def _decode_sync(self, chunk_bytes: Buffer, chunk_spec: ArraySpec) -> NDBuffer: + return self.inner._decode_sync(chunk_bytes, chunk_spec) + + def _encode_sync(self, chunk_array: NDBuffer, chunk_spec: ArraySpec) -> Buffer | None: + return self.inner._encode_sync(chunk_array, chunk_spec) + + async def _decode_single(self, chunk_bytes: Buffer, chunk_spec: ArraySpec) -> NDBuffer: + return self._decode_sync(chunk_bytes, chunk_spec) + + async def _encode_single(self, chunk_array: NDBuffer, chunk_spec: ArraySpec) -> Buffer | None: + return self._encode_sync(chunk_array, chunk_spec) + + async def _decode_partial_single( + self, byte_getter: Any, selection: Any, chunk_spec: ArraySpec + ) -> NDBuffer | None: + chunk_bytes = await byte_getter.get(prototype=chunk_spec.prototype) + if chunk_bytes is None: + return None + return self._decode_sync(chunk_bytes, chunk_spec)[selection] + + async def _encode_partial_single( + self, byte_setter: Any, chunk_array: NDBuffer, selection: Any, chunk_spec: ArraySpec + ) -> None: + existing = await byte_setter.get(prototype=chunk_spec.prototype) + if existing is None: + full = chunk_spec.prototype.nd_buffer.create( + shape=chunk_spec.shape, + dtype=chunk_spec.dtype.to_native_dtype(), + fill_value=chunk_spec.fill_value, + ) + else: + full = self._decode_sync(existing, chunk_spec) + full[selection] = chunk_array + encoded = self._encode_sync(full, chunk_spec) + assert encoded is not None + await byte_setter.set(encoded) + + +register_codec("test-partial-mixin", PartialMixinCodec) + +_FUSED = {"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"} +_BATCHED = {"codec_pipeline.path": "zarr.core.codec_pipeline.BatchedCodecPipeline"} + + +@pytest.mark.filterwarnings("ignore::zarr.errors.UnstableSpecificationWarning") +@pytest.mark.parametrize("dtype", ["uint8", "float64"]) +def test_partial_mixin_codec_async_partial_only_round_trip(dtype: str) -> None: + """A serializer advertising the partial mixins with only async partial + methods must round-trip under the fused pipeline: full write, full read, + partial read, partial write, plus cross-pipeline parity with + BatchedCodecPipeline.""" + data = np.arange(64, dtype=dtype).reshape(8, 8) + + with zarr_config.set(_FUSED): + store = MemoryStore() + arr = zarr.create_array( + store, + shape=(8, 8), + chunks=(4, 4), + dtype=dtype, + serializer=PartialMixinCodec(), + compressors=None, + filters=None, + fill_value=0, + ) + + pipeline = arr._async_array.codec_pipeline + assert isinstance(pipeline, FusedCodecPipeline) + assert pipeline.supports_partial_decode + assert pipeline.supports_partial_encode + assert pipeline.sync_transform is not None + + arr[:] = data + np.testing.assert_array_equal(arr[:], data) + np.testing.assert_array_equal(arr[1:5, 2:7], data[1:5, 2:7]) + + expected = data.copy() + expected[2:6, 1:3] = 7 + arr[2:6, 1:3] = expected[2:6, 1:3] + np.testing.assert_array_equal(arr[:], expected) + + with zarr_config.set(_BATCHED): + np.testing.assert_array_equal(zarr.open_array(store, mode="r")[:], expected) From ba832363cd8b517a4545528c54230c43a2c5f95e Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 29 Jul 2026 17:55:26 +0200 Subject: [PATCH 16/61] fix: FusedCodecPipeline must apply outer AA/BB codecs on partial paths (#4202) FusedCodecPipeline.supports_partial_decode/supports_partial_encode passed require_no_aa_bb=False, unlike BatchedCodecPipeline (True). With an outer array-array or bytes-bytes codec around a sharding serializer (e.g. compressors=[GzipCodec()], or filters=[TransposeCodec()]), the fused pipeline's partial read/write branches called ShardingCodec's partial sync methods directly on the raw stored value, skipping those outer codecs entirely. That wrote non-conforming bytes for an outer BB codec (unreadable by BatchedCodecPipeline or any conforming reader) and silently produced wrong data for an outer AA codec. Pass require_no_aa_bb=True in both fused properties so these chains fall through to the full-chunk fused path instead, matching batched behavior. Adds cross-pipeline parity coverage (full and partial read/write) for sharding with an outer compressor and with an outer transpose filter, and removes the "known limitation" exclusion that previously kept the sharding+compressor case out of the nested-sharding parity matrix. Assisted-by: ClaudeCode:claude-sonnet-5 --- changes/4202.bugfix.md | 10 +++ src/zarr/core/codec_pipeline.py | 18 ++--- tests/test_pipeline_parity.py | 133 ++++++++++++++++++++++++++++---- 3 files changed, 135 insertions(+), 26 deletions(-) create mode 100644 changes/4202.bugfix.md diff --git a/changes/4202.bugfix.md b/changes/4202.bugfix.md new file mode 100644 index 0000000000..6130fc5b33 --- /dev/null +++ b/changes/4202.bugfix.md @@ -0,0 +1,10 @@ +Fixed `FusedCodecPipeline` (the opt-in synchronous pipeline) silently skipping +array-array/bytes-bytes codecs placed outside a sharding serializer on its +partial-decode/partial-encode fast paths. With an outer compressor (e.g. +`compressors=[GzipCodec()]` around a `ShardingCodec` serializer), the fused +pipeline wrote non-conforming stored bytes that `BatchedCodecPipeline` (and any +other conforming reader) could not read, and could fail to read data that +`BatchedCodecPipeline` had written. With an outer array-array codec (e.g. +`TransposeCodec`), it silently returned wrong data in both directions with no +error. Only the opt-in `FusedCodecPipeline` was affected; the default +`BatchedCodecPipeline` was never impacted. diff --git a/src/zarr/core/codec_pipeline.py b/src/zarr/core/codec_pipeline.py index 56a06b906c..ca760ece59 100644 --- a/src/zarr/core/codec_pipeline.py +++ b/src/zarr/core/codec_pipeline.py @@ -143,10 +143,10 @@ def pipeline_supports_partial_decode( selection non-contiguous, a BB codec can rewrite the bytes), making partial decode infeasible. - NOTE: the two pipelines currently pass different ``require_no_aa_bb`` values - (Batched: True; Fused: False). That divergence is intentional-for-now and - tracked separately; this function centralizes the predicate without changing - either pipeline's behavior. + Both pipelines pass `require_no_aa_bb=True`: an outer AA/BB codec (e.g. a + compressor wrapping a sharding serializer) must see every byte of the + chunk, so a partial branch that only re-decodes/re-encodes the inner + sharding codec would silently bypass it. """ if require_no_aa_bb and (len(array_array_codecs) + len(bytes_bytes_codecs)) != 0: return False @@ -162,8 +162,7 @@ def pipeline_supports_partial_encode( ) -> bool: """Whether a codec pipeline can encode a partial selection without a full rewrite. - Mirror of ``pipeline_supports_partial_decode`` for encoding. See its note re: - the per-pipeline ``require_no_aa_bb`` divergence. + Mirror of `pipeline_supports_partial_decode` for encoding. """ if require_no_aa_bb and (len(array_array_codecs) + len(bytes_bytes_codecs)) != 0: return False @@ -934,14 +933,11 @@ def __iter__(self) -> Iterator[Codec]: @property def supports_partial_decode(self) -> bool: - # NOTE: unlike BatchedCodecPipeline this does NOT require the AA/BB codec - # lists to be empty (require_no_aa_bb=False). That divergence is tracked - # separately; see pipeline_supports_partial_decode. return pipeline_supports_partial_decode( self.array_bytes_codec, array_array_codecs=self.array_array_codecs, bytes_bytes_codecs=self.bytes_bytes_codecs, - require_no_aa_bb=False, + require_no_aa_bb=True, ) @property @@ -950,7 +946,7 @@ def supports_partial_encode(self) -> bool: self.array_bytes_codec, array_array_codecs=self.array_array_codecs, bytes_bytes_codecs=self.bytes_bytes_codecs, - require_no_aa_bb=False, + require_no_aa_bb=True, ) def validate( diff --git a/tests/test_pipeline_parity.py b/tests/test_pipeline_parity.py index 717f0f48f1..94d95c4c24 100644 --- a/tests/test_pipeline_parity.py +++ b/tests/test_pipeline_parity.py @@ -33,6 +33,8 @@ from __future__ import annotations +import warnings +from contextlib import contextmanager from typing import TYPE_CHECKING, Any import numpy as np @@ -48,7 +50,9 @@ ShardingCodec, SubchunkWriteOrder, ) +from zarr.codecs.transpose import TransposeCodec from zarr.core.config import config as zarr_config +from zarr.errors import ZarrUserWarning from zarr.storage import MemoryStore if TYPE_CHECKING: @@ -107,11 +111,15 @@ def _store_snapshot(store: MemoryStore) -> dict[str, bytes]: ("2d-unsharded", {"shape": (20, 20), "chunks": (5, 5), "shards": None}), ("2d-sharded", {"shape": (20, 20), "chunks": (5, 5), "shards": (10, 10)}), # Nested sharding: outer chunk (10,10) sharded into inner chunks (5,5). - # Restricted to bytes-only codec because combining an outer ShardingCodec - # with a compressor (gzip) triggers a ZarrUserWarning and results in a - # checksum mismatch inside the inner shard index — a known limitation, not - # a pipeline-parity bug. The bytes-only path still exercises the full - # two-level shard encoding/decoding in both pipelines. + # Restricted to the codec configs that don't set their own `serializer` + # (bytes-only, gzip): this layout supplies an explicit nested-ShardingCodec + # `serializer`, and a codec config that also sets `serializer` (e.g. + # bytes-big-endian) would silently clobber it via dict merge, dropping + # sharding from the test entirely rather than exercising it. The gzip + # config applies as an outer bytes-bytes codec around the outer + # ShardingCodec -- this is the regression coverage for the fused pipeline + # applying outer AA/BB codecs around sharding (see + # `pipeline_supports_partial_decode`/`pipeline_supports_partial_encode`). ( "2d-nested-sharded", { @@ -122,9 +130,7 @@ def _store_snapshot(store: MemoryStore) -> dict[str, bytes]: chunk_shape=(10, 10), codecs=[ShardingCodec(chunk_shape=(5, 5))], ), - # Only run with the bytes-only codec config; gzip is incompatible - # with nested sharding (see comment above). - "_codec_ids": {"bytes-only"}, + "_codec_ids": {"bytes-only", "gzip"}, }, ), ] @@ -226,6 +232,23 @@ def _matrix() -> Iterator[Any]: # --------------------------------------------------------------------------- +@contextmanager +def _ignore_sharding_combo_warning() -> Iterator[None]: + """Suppress the "combining sharding_indexed disables partial reads" warning. + + Only the nested-sharded-plus-outer-codec matrix cell emits this; scoping the + ignore filter to just its message/category (rather than blanket-disabling + warnings) keeps every other warning in the run promoted to an error as usual. + """ + with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", + message=r"Combining a `sharding_indexed` codec.*", + category=ZarrUserWarning, + ) + yield + + def _write_under_pipeline( pipeline_path: str, codec_kwargs: CodecConfig, @@ -244,12 +267,13 @@ def _write_under_pipeline( create_kwargs = {"dtype": "float64", **array_layout, **codec_kwargs} store = MemoryStore() with zarr_config.set({"codec_pipeline.path": pipeline_path}): - arr = zarr.create_array( - store=store, - fill_value=0, - config={"write_empty_chunks": write_empty_chunks}, - **create_kwargs, - ) + with _ignore_sharding_combo_warning(): + arr = zarr.create_array( + store=store, + fill_value=0, + config={"write_empty_chunks": write_empty_chunks}, + **create_kwargs, + ) for sel, val in sequence: arr[sel] = val contents = arr[...] @@ -259,7 +283,8 @@ def _write_under_pipeline( def _read_under_pipeline(pipeline_path: str, store: MemoryStore) -> Any: """Re-open an existing store under the chosen pipeline and read it whole.""" with zarr_config.set({"codec_pipeline.path": pipeline_path}): - arr = zarr.open_array(store=store, mode="r") + with _ignore_sharding_combo_warning(): + arr = zarr.open_array(store=store, mode="r") return arr[...] @@ -418,3 +443,81 @@ def run(pipeline_path: str) -> tuple[dict[str, bytes], Any]: f"(index_location={index_location!r}) — byte-range write fast path likely assumed " f"the wrong physical chunk order" ) + + +# --------------------------------------------------------------------------- +# Outer array-array / bytes-bytes codecs around a sharding serializer +# --------------------------------------------------------------------------- +# +# Regression coverage for FusedCodecPipeline.supports_partial_decode/encode: +# it used to allow AA/BB codecs outside the sharding codec, so its partial +# branches called ShardingCodec._decode_partial_sync/_encode_partial_sync +# directly on the raw stored value, skipping any outer filter/compressor. +# That corrupted on-disk bytes for an outer bytes-bytes codec (unreadable by +# the other pipeline) and silently produced wrong data for an outer +# array-array codec. Both configs below force the partial branches: a +# region write and a region read are included alongside the full ones. + +_OUTER_AA_BB_CONFIGS: list[tuple[str, CodecConfig]] = [ + ( + "outer-gzip-around-sharding", + { + "serializer": ShardingCodec(chunk_shape=(2, 2)), + "compressors": [GzipCodec(level=1)], + }, + ), + ( + "outer-transpose-around-sharding", + { + "filters": [TransposeCodec(order=(1, 0))], + "serializer": ShardingCodec(chunk_shape=(2, 2)), + "compressors": None, + }, + ), +] + + +@pytest.mark.parametrize(("config_id", "codec_kwargs"), _OUTER_AA_BB_CONFIGS) +@pytest.mark.parametrize( + ("writer", "reader"), + [(_BATCHED, _FUSED), (_FUSED, _BATCHED)], + ids=["batched-write-fused-read", "fused-write-batched-read"], +) +def test_pipeline_parity_outer_aa_bb_codecs( + config_id: str, + codec_kwargs: CodecConfig, + writer: str, + reader: str, +) -> None: + """Data written under one pipeline with outer AA/BB codecs must read back + correctly under the other, including through a partial write and a + partial read. + """ + shape = (8, 8) + data = (np.arange(int(np.prod(shape))).reshape(shape) + 1).astype("uint16") + store = MemoryStore() + + with zarr_config.set({"codec_pipeline.path": writer}): + with _ignore_sharding_combo_warning(): + arr = zarr.create_array( + store=store, + shape=shape, + chunks=(4, 4), + dtype=data.dtype, + fill_value=0, + **codec_kwargs, + ) + arr[...] = data + arr[2:5, 1:3] = 99 # region write -- exercises the partial-encode branch + + expected = data.copy() + expected[2:5, 1:3] = 99 + + with zarr_config.set({"codec_pipeline.path": reader}): + with _ignore_sharding_combo_warning(): + arr2 = zarr.open_array(store=store, mode="r") + full = arr2[...] + partial = arr2[1:3, 2:7] # region read -- exercises the partial-decode branch + + np.testing.assert_array_equal(full, expected) + np.testing.assert_array_equal(partial, expected[1:3, 2:7]) From bf818318d25c216721d8078d8a585dc734192be6 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 29 Jul 2026 19:27:52 +0200 Subject: [PATCH 17/61] fix: gate bulk full-shard decode on identity reads; harden shard-index density check (#4203) The FusedCodecPipeline's vectorized whole-shard decode accepted any indexer without `sel_shape` whose output shape matched the shard shape. An OrthogonalIndexer from `arr[perm, :]` / `arr.oindex[...]` satisfies that, so reordering or duplicating fancy-index reads on uncompressed, crc-free sharded arrays silently returned the shard in natural order. The bulk path now requires an identity full read: one whole-dimension, step-1 slice per dimension (structural, not a BasicIndexer type check, since `arr[:]` arrives as an OrthogonalIndexer). Also: - decline structured dtypes in the bulk path, which lacks the Struct byte-order branch of BytesCodec._decode_sync (latent until #3054 is fixed); - `_ShardIndex.is_dense` now requires offsets to exactly tile the data section instead of merely being unique, so corrupt indexes with overlapping or out-of-range offsets (e.g. pointing into an index_location='start' index region) cannot be served as array data. Assisted-by: ClaudeCode:claude-fable-5 --- changes/4203.bugfix.md | 1 + src/zarr/codecs/sharding.py | 96 +++++++--- tests/test_codecs/test_sharding_unit.py | 234 +++++++++++++++++++++++- tests/test_fastpath_equivalence.py | 90 +++++---- 4 files changed, 358 insertions(+), 63 deletions(-) create mode 100644 changes/4203.bugfix.md diff --git a/changes/4203.bugfix.md b/changes/4203.bugfix.md new file mode 100644 index 0000000000..42ca977193 --- /dev/null +++ b/changes/4203.bugfix.md @@ -0,0 +1 @@ +Fixed silent data corruption in the experimental `FusedCodecPipeline`: reordering or duplicating fancy-index reads (e.g. `arr[perm, :]`, `arr.oindex[[0, 0, 1], :]`) on uncompressed, crc-free sharded arrays could return the shard in natural order because the vectorized whole-shard decode accepted any selection whose output shape matched the shard shape. The bulk decode now fires only for identity full-shard reads, declines structured dtypes (whose byte-order handling it lacks), and requires shard-index offsets to exactly tile the data section, so corrupt indexes with overlapping or out-of-range offsets can no longer be served as array data. diff --git a/src/zarr/codecs/sharding.py b/src/zarr/codecs/sharding.py index 8f23606011..cdfdae6c89 100644 --- a/src/zarr/codecs/sharding.py +++ b/src/zarr/codecs/sharding.py @@ -53,10 +53,12 @@ from zarr.core.config import config as zarr_config from zarr.core.dtype.common import HasEndianness from zarr.core.dtype.npy.int import UInt64 +from zarr.core.dtype.npy.structured import Struct from zarr.core.indexing import ( BasicIndexer, ChunkProjection, SelectorTuple, + SliceDimIndexer, _lexicographic_order, colexicographic_order_coords, get_indexer, @@ -109,6 +111,32 @@ class ShardingCodecIndexLocation(metaclass=_DeprecatedStrEnumMeta): ) +def _is_identity_full_read(indexer: Any, shard_shape: tuple[int, ...]) -> bool: + """True when `indexer` selects every element of a `shard_shape` array in + natural order: one whole-dimension, step-1 `SliceDimIndexer` per dimension. + + Structural on purpose, not `isinstance(indexer, BasicIndexer)`: a full + `arr[:]` read reaches the shard as an `OrthogonalIndexer`, so a type gate + would silently disable the bulk fast path for the most common case. Any + gather (integer-array / boolean / coordinate selection), subset, strided, + or integer-scalar selection fails the per-dimension check — output shape + alone is not enough, because a reordering or duplicating selection can have + the same shape as the shard while requiring `chunk_selection` / + `out_selection` to be honored. + """ + dim_indexers = getattr(indexer, "dim_indexers", None) + if dim_indexers is None or len(dim_indexers) != len(shard_shape): + return False + return all( + isinstance(dim_indexer, SliceDimIndexer) + and dim_indexer.dim_len == dim_len + and dim_indexer.start == 0 + and dim_indexer.stop == dim_len + and dim_indexer.step == 1 + for dim_indexer, dim_len in zip(dim_indexers, shard_shape, strict=True) + ) + + def _parse_index_location(data: object) -> IndexLocation: if isinstance(data, str) and data in INDEX_LOCATION: return data # type: ignore[return-value] @@ -192,12 +220,17 @@ def is_all_empty(self) -> bool: def get_full_chunk_map(self) -> npt.NDArray[np.bool_]: return np.not_equal(self.offsets_and_lengths[..., 0], MAX_UINT_64) - def is_dense(self, chunk_byte_length: int) -> bool: - """True when every chunk is present, fixed-length, and uniquely placed. - - Used to gate the vectorized whole-shard decode: a dense fixed-size shard - is a regular grid of equal-length payloads, so it can be reshaped/scattered - in bulk rather than decoded chunk-by-chunk. + def is_dense(self, chunk_byte_length: int, *, data_section_start: int) -> bool: + """True when the chunk payloads exactly tile the shard's data section. + + Every chunk must be present with length `chunk_byte_length`, and the + sorted offsets must be exactly `data_section_start + i * chunk_byte_length` + for `i` in `0..n_chunks-1`: no gaps, no overlaps, and nothing outside the + data section (a corrupt index could otherwise point chunks into the + index region or out of the blob). Used to gate the vectorized + whole-shard decode: a dense fixed-size shard is a regular grid of + equal-length payloads, so it can be reshaped/scattered in bulk rather + than decoded chunk-by-chunk. """ offsets = self.offsets_and_lengths[..., 0].reshape(-1) lengths = self.offsets_and_lengths[..., 1].reshape(-1) @@ -207,8 +240,10 @@ def is_dense(self, chunk_byte_length: int) -> bool: # all the same fixed length if not bool(np.all(lengths == chunk_byte_length)): return False - # offsets unique (no two chunks share a slot) - return int(np.unique(offsets).size) == int(offsets.size) + expected = np.uint64(data_section_start) + np.arange( + offsets.size, dtype=np.uint64 + ) * np.uint64(chunk_byte_length) + return bool(np.array_equal(np.sort(offsets), expected)) def get_chunk_slice(self, chunk_coords: tuple[int, ...]) -> tuple[int, int] | None: localized_chunk = self._localize_chunk(chunk_coords) @@ -1086,8 +1121,12 @@ def _decode_full_shard_bulk_if_uncompressed( dtype/endian view with no reordering. A trailing crc32c is NOT accepted (the bulk path can't verify per-chunk checksums, so crc shards keep the per-chunk path's corruption detection); + - the data type is not structured (the byte-order handling below has no + `Struct` branch); + - `indexer` is an identity full-shard read (`_is_identity_full_read`); - the stored index is dense (every chunk present, equal fixed length, - contiguous) so the data section is a regular grid of chunk payloads. + exactly tiling the data section) so the data section is a regular + grid of chunk payloads. Chunk positions are read from the stored index, so this is correct for any `subchunk_write_order` (morton / lexicographic / colexicographic / @@ -1107,27 +1146,29 @@ def _decode_full_shard_bulk_if_uncompressed( return None ab_codec = self.codecs[0] + # The byte-order handling below lacks the structured-dtype branch of + # `BytesCodec._decode_sync` (which applies `newbyteorder` to multi-byte + # struct fields), so structured dtypes must take the per-chunk path. + if isinstance(shard_spec.dtype, Struct): + return None + chunks_per_shard = self._get_chunks_per_shard(shard_spec) chunk_spec = self._get_chunk_spec(shard_spec) n_chunks = product(chunks_per_shard) if n_chunks == 0: return None - # Only valid for a plain contiguous full-shard read, where each chunk - # lands at its natural grid position. The `sel_shape` check is - # load-bearing: a gather indexer (CoordinateIndexer, from vindex / an - # oindex with an integer-array selection) reorders points and exposes - # `sel_shape`, but its `.shape` is the FLATTENED point count, which can - # equal the shard shape by coincidence (trivially in 1-D). Gating on - # shape alone lets such a selection through, and the bulk path then - # returns the shard in natural order, silently dropping the reordering. - # A contiguous full read (BasicIndexer, or a non-gathering - # OrthogonalIndexer from `arr[:]`) has no `sel_shape` and is served here. - # Anything that gathers must fall through to the per-chunk path so + # Only valid for an identity full-shard read, where each chunk lands at + # its natural grid position. The per-dimension check is load-bearing: + # a gather selection (an `OrthogonalIndexer` with an integer-array or + # boolean dimension, from `arr[perm, :]` / `arr.oindex[...]`, or a + # `CoordinateIndexer` from vindex) can have an output `.shape` equal to + # the shard shape while reordering or duplicating points — serving it + # from the bulk path would return the shard in natural order, silently + # dropping the reordering. Anything that is not a full-slice-per- + # dimension read falls through to the per-chunk path so # chunk_selection / out_selection are honored. - if getattr(indexer, "sel_shape", None) is not None: - return None - if tuple(indexer.shape) != tuple(shard_spec.shape): + if not _is_identity_full_read(indexer, shard_spec.shape): return None chunk_byte_length = self._inner_chunk_byte_length(chunk_spec) @@ -1141,7 +1182,8 @@ def _decode_full_shard_bulk_if_uncompressed( else: index_bytes = shard_bytes[-shard_index_size:] index = self._decode_shard_index_sync(index_bytes, chunks_per_shard) - if not index.is_dense(chunk_byte_length): + data_section_start = shard_index_size if self.index_location == "start" else 0 + if not index.is_dense(chunk_byte_length, data_section_start=data_section_start): return None # --- bulk reconstruct --- @@ -1227,9 +1269,9 @@ def _decode_partial_sync( return None bulk = self._decode_full_shard_bulk_if_uncompressed(shard_bytes, shard_spec, indexer) if bulk is not None: - # The bulk path only fires for a contiguous full-shard read (it - # returns None for any gather indexer that exposes `sel_shape`), - # so the result is already shard-shaped — no reshape needed. + # The bulk path only fires for an identity full-shard read + # (`_is_identity_full_read`), so the result is already + # shard-shaped and in natural order — no reshape needed. return bulk shard_reader = self._shard_reader_from_bytes_sync(shard_bytes, chunks_per_shard) shard_dict: ShardMapping = shard_reader diff --git a/tests/test_codecs/test_sharding_unit.py b/tests/test_codecs/test_sharding_unit.py index 34d468fa05..d8b8242a28 100644 --- a/tests/test_codecs/test_sharding_unit.py +++ b/tests/test_codecs/test_sharding_unit.py @@ -2,12 +2,14 @@ import asyncio from dataclasses import dataclass, replace -from typing import TYPE_CHECKING, Any, cast +from typing import TYPE_CHECKING, Any, Literal, cast from unittest.mock import AsyncMock import numpy as np +import numpy.typing as npt import pytest +import zarr from zarr.abc.codec import ArrayArrayCodec, ArrayBytesCodec from zarr.codecs.bytes import BytesCodec from zarr.codecs.crc32c_ import Crc32cCodec @@ -24,8 +26,10 @@ from zarr.core.buffer import NDBuffer, default_buffer_prototype from zarr.core.buffer.cpu import Buffer from zarr.core.buffer.cpu import NDBuffer as CPUNDBuffer +from zarr.core.chunk_grids import ChunkGrid from zarr.core.config import config from zarr.core.dtype import get_data_type_from_native_dtype +from zarr.core.indexing import BasicIndexer from zarr.storage._common import StorePath from zarr.storage._memory import MemoryStore @@ -910,3 +914,231 @@ async def mock_load_index( kwargs = store_mock.get_ranges.call_args.kwargs assert kwargs["max_gap_bytes"] == 12345 assert kwargs["max_coalesced_bytes"] == 67890 + + +# ============================================================================ +# Bulk full-shard decode: identity-read gating and dtype gating +# ============================================================================ + +_FUSED_PIPELINE = "zarr.core.codec_pipeline.FusedCodecPipeline" + + +def _fused_uncompressed_array( + index_location: Literal["start", "end"], +) -> tuple[Any, npt.NDArray[np.int32]]: + """Sharded `(8, 8)` array whose inner chain is a bare BytesCodec (no crc), + one shard covering the whole array, filled with `arange` data. Callers must + be inside a config context selecting the fused pipeline.""" + shards: ShardsConfigParam = {"shape": (8, 8), "index_location": index_location} + arr = zarr.create_array( + store=MemoryStore(), + shape=(8, 8), + chunks=(2, 2), + shards=shards, + dtype="int32", + compressors=None, + filters=None, + fill_value=0, + config={"write_empty_chunks": True}, + ) + ref = np.arange(64, dtype="int32").reshape(8, 8) + arr[:] = ref + return arr, ref + + +def _spy_on_bulk_decode(monkeypatch: pytest.MonkeyPatch) -> list[bool]: + """Record, per call, whether `_decode_full_shard_bulk_if_uncompressed` + engaged (returned non-None).""" + engaged: list[bool] = [] + orig = ShardingCodec._decode_full_shard_bulk_if_uncompressed + + def spy(self: ShardingCodec, shard_bytes: Any, shard_spec: Any, indexer: Any) -> Any: + result = orig(self, shard_bytes, shard_spec, indexer) + engaged.append(result is not None) + return result + + monkeypatch.setattr(ShardingCodec, "_decode_full_shard_bulk_if_uncompressed", spy) + return engaged + + +_PERM_8 = np.array([7, 2, 5, 0, 3, 6, 1, 4]) +_DUP_8 = np.array([0, 0, 1, 2, 3, 4, 5, 6]) + + +@pytest.mark.parametrize("index_location", ["start", "end"]) +@pytest.mark.parametrize( + ("read", "expected", "expect_bulk"), + [ + pytest.param(lambda a: a[:], lambda r: r, True, id="full-slice"), + pytest.param(lambda a: a[...], lambda r: r, True, id="ellipsis"), + pytest.param( + lambda a: a[_PERM_8, :], lambda r: r[_PERM_8, :], False, id="fancy-permutation" + ), + pytest.param(lambda a: a[_DUP_8, :], lambda r: r[_DUP_8, :], False, id="fancy-duplicates"), + pytest.param( + lambda a: a.oindex[_PERM_8, :], + lambda r: r[_PERM_8, :], + False, + id="oindex-permutation", + ), + pytest.param( + lambda a: a.oindex[_DUP_8, :], lambda r: r[_DUP_8, :], False, id="oindex-duplicates" + ), + pytest.param(lambda a: a[1:7, :], lambda r: r[1:7, :], False, id="subset-slice"), + ], +) +def test_bulk_decode_engagement_and_correctness( + monkeypatch: pytest.MonkeyPatch, + index_location: Literal["start", "end"], + read: Any, + expected: Any, + expect_bulk: bool, +) -> None: + """Under the fused pipeline on an uncompressed crc-free shard, the bulk + whole-shard decode fires exactly for identity full reads — and every read + returns what numpy returns. The engagement assertions keep the correctness + half non-vacuous: a gate that simply disabled the fast path would pass the + value checks but fail here.""" + engaged = _spy_on_bulk_decode(monkeypatch) + with config.set({"codec_pipeline.path": _FUSED_PIPELINE}): + arr, ref = _fused_uncompressed_array(index_location) + engaged.clear() + np.testing.assert_array_equal(read(arr), expected(ref)) + if expect_bulk: + assert len(engaged) > 0, "bulk fast path was never reached for a full read" + assert all(engaged), "bulk fast path did not engage for a full read" + else: + assert not any(engaged), "bulk fast path engaged for a non-identity selection" + + +@pytest.mark.parametrize("index_location", ["start", "end"]) +def test_multi_shard_permutation_read(index_location: Literal["start", "end"]) -> None: + """A row permutation crossing shard boundaries must return permuted data + under the fused pipeline (each shard sees a gather selection whose shape + coincides with the shard shape).""" + shards: ShardsConfigParam = {"shape": (8, 8), "index_location": index_location} + with config.set({"codec_pipeline.path": _FUSED_PIPELINE}): + arr = zarr.create_array( + store=MemoryStore(), + shape=(16, 16), + chunks=(2, 2), + shards=shards, + dtype="int32", + compressors=None, + filters=None, + fill_value=0, + config={"write_empty_chunks": True}, + ) + ref = np.arange(256, dtype="int32").reshape(16, 16) + arr[:] = ref + perm = np.array([9, 3, 12, 0, 15, 6, 10, 1, 14, 5, 8, 2, 13, 7, 11, 4]) + np.testing.assert_array_equal(arr[perm, :8], ref[perm, :8]) + np.testing.assert_array_equal(arr.oindex[perm, :8], ref[perm, :8]) + + +def _dense_shard_blob( + codec: ShardingCodec, data: np.ndarray[Any, np.dtype[Any]], chunk_len: int +) -> Buffer: + """Hand-assemble a dense `index_location="end"` shard blob for 1-D `data`: + natural-order chunk payloads followed by the encoded index.""" + n_chunks = data.shape[0] // chunk_len + chunk_nbytes = chunk_len * data.dtype.itemsize + index = _ShardIndex.create_empty((n_chunks,)) + for i in range(n_chunks): + index.set_chunk_slice((i,), slice(i * chunk_nbytes, (i + 1) * chunk_nbytes)) + index_bytes = codec._encode_shard_index_sync(index) + return Buffer.from_bytes(data.tobytes() + index_bytes.to_bytes()) + + +def _identity_indexer(shape: tuple[int, ...], chunk_shape: tuple[int, ...]) -> BasicIndexer: + return BasicIndexer( + tuple(slice(0, s) for s in shape), + shape=shape, + chunk_grid=ChunkGrid.from_sizes(shape, chunk_shape), + ) + + +def _spec_for(data: np.ndarray[Any, np.dtype[Any]]) -> ArraySpec: + zdt = get_data_type_from_native_dtype(data.dtype) + return ArraySpec( + shape=data.shape, + dtype=zdt, + fill_value=zdt.cast_scalar(0), + config=ArrayConfig(order="C", write_empty_chunks=True), + prototype=default_buffer_prototype(), + ) + + +def test_bulk_decode_declines_structured_dtype() -> None: + """The bulk path has no structured-dtype byte-order handling (the `Struct` + branch of `BytesCodec._decode_sync`), so it must decline structured specs. + The plain-dtype control on an identically constructed blob proves the + decline comes from the dtype gate, not from a malformed blob.""" + codec = ShardingCodec(chunk_shape=(2,), codecs=[BytesCodec(endian="little")]) + + # control: same construction with a plain dtype engages the bulk path + plain = np.arange(4, dtype=" None: + """`is_dense` accepts every layout whose fixed-size payloads exactly tile + the data section, wherever that section starts and in whatever order the + chunks were laid out.""" + chunk_len = 24 + n = int(np.prod(chunks_per_shard)) + slots = np.arange(n) + if layout_order == "reversed": + slots = slots[::-1] + offsets = data_section_start + slots * chunk_len + index = _ShardIndex.create_empty(chunks_per_shard) + for coord, off in zip(np.ndindex(chunks_per_shard), offsets, strict=True): + index.set_chunk_slice(tuple(coord), slice(int(off), int(off) + chunk_len)) + assert index.is_dense(chunk_len, data_section_start=data_section_start) is True + + +def test_shard_index_is_dense_rejects_overlapping_offsets() -> None: + """Unique but overlapping offsets (second payload starts inside the first) + are not dense.""" + chunk_len = 24 + index = _ShardIndex.create_empty((2,)) + index.set_chunk_slice((0,), slice(0, chunk_len)) + index.set_chunk_slice((1,), slice(12, 12 + chunk_len)) + assert index.is_dense(chunk_len, data_section_start=0) is False + + +def test_shard_index_is_dense_rejects_out_of_range_offsets() -> None: + """An offset outside the data section (here: chunk 0 pointing into an + `index_location="start"` index region) is not dense, even though offsets + are unique and non-overlapping.""" + chunk_len = 24 + data_section_start = 16 + index = _ShardIndex.create_empty((2,)) + index.set_chunk_slice((0,), slice(0, chunk_len)) + index.set_chunk_slice( + (1,), slice(data_section_start + chunk_len, data_section_start + 2 * chunk_len) + ) + assert index.is_dense(chunk_len, data_section_start=data_section_start) is False diff --git a/tests/test_fastpath_equivalence.py b/tests/test_fastpath_equivalence.py index 317b8742f1..9a2f782d13 100644 --- a/tests/test_fastpath_equivalence.py +++ b/tests/test_fastpath_equivalence.py @@ -196,34 +196,43 @@ def test_merge_complete_chunk_returns_view_and_write_does_not_mutate_source() -> # --------------------------------------------------------------------------- # Whole-shard bulk decode under arbitrary indexing: the bulk decode only fires -# for a *contiguous full-shard* read, but it is reached through the partial-read -# path (`_decode_partial_sync`), whose only gate is `indexer.shape == -# shard_spec.shape`. A reordering coordinate/orthogonal selection that happens -# to touch every chunk (so the flattened point count equals the shard shape) -# must NOT be served by the bulk path in natural order — it must honor the -# selection. This pins the END-TO-END read (the gate lives in the array read -# path, not in `_decode_full_shard_bulk_if_uncompressed` itself), which -# `test_bulk_shard_decode_equals_general_decode` (BasicIndexer only) cannot -# reach. See the vindex-on-uncompressed-shard corruption bug. +# for an *identity full-shard* read (every dimension a whole-dim step-1 slice), +# but it is reached through the partial-read path (`_decode_partial_sync`) for +# any indexer. A reordering or duplicating coordinate/orthogonal selection can +# have an output shape equal to the shard shape — trivially in 1-D (any +# selection of `shard_len` points), and in >=2-D whenever an axis-0 index array +# has exactly `shard_shape[0]` entries — and must NOT be served by the bulk +# path in natural order; it must honor the selection. This pins the END-TO-END +# read, which `test_bulk_shard_decode_equals_general_decode` (identity +# BasicIndexer only) cannot reach. See the vindex- and +# oindex-on-uncompressed-shard corruption bugs. # --------------------------------------------------------------------------- @st.composite def _uncompressed_shard_index_cases(draw: st.DrawFn) -> dict[str, Any]: - # 1-D is where the trigger is easiest: a CoordinateIndexer's `.shape` is the - # flattened point count, which equals a 1-D shard shape exactly when the - # selection visits `shard_len` points. - chunk = draw(st.integers(1, 4)) - grid = draw(st.integers(1, 4)) - shard_len = chunk * grid + ndim = draw(st.integers(1, 2)) + chunk_shape = tuple(draw(st.integers(1, 4)) for _ in range(ndim)) + grid = tuple(draw(st.integers(1, 4)) for _ in range(ndim)) + shard_shape = tuple(c * g for c, g in zip(chunk_shape, grid, strict=True)) dtype = draw(_DTYPES) - data = draw(npst.arrays(dtype=np.dtype(dtype), shape=(shard_len,))) - perm = draw(st.permutations(list(range(shard_len)))) + data = draw(npst.arrays(dtype=np.dtype(dtype), shape=shard_shape)) + dim0 = shard_shape[0] + # axis-0 index array sized to the dimension: either a permutation + # (reordering, no duplicates) or an arbitrary list (duplicates likely) — + # both keep the output shape equal to the shard shape. + if draw(st.booleans()): + idx = np.array(draw(st.permutations(list(range(dim0)))), dtype=np.intp) + else: + idx = np.array( + draw(st.lists(st.integers(0, dim0 - 1), min_size=dim0, max_size=dim0)), + dtype=np.intp, + ) return { - "chunk": chunk, - "shard_len": shard_len, + "chunk_shape": chunk_shape, + "shard_shape": shard_shape, "data": data, - "perm": np.array(perm), + "idx": idx, "endian": draw(st.sampled_from(["little", "big"])), "index_location": draw(st.sampled_from(["start", "end"])), "subchunk_write_order": draw( @@ -235,33 +244,44 @@ def _uncompressed_shard_index_cases(draw: st.DrawFn) -> dict[str, Any]: @settings(max_examples=200, deadline=None) @given(case=_uncompressed_shard_index_cases()) def test_reordering_read_on_uncompressed_shard_honors_selection(case: dict[str, Any]) -> None: - """A reordering vindex/oindex over a full uncompressed shard must return the - permuted data, not the shard in natural order — under the Fused pipeline - (where the bulk-decode fast path engages) exactly as under numpy.""" - perm = case["perm"] + """A reordering or duplicating fancy/vindex/oindex read over a full + uncompressed shard must return the selected data, not the shard in natural + order — under the Fused pipeline (where the bulk-decode fast path engages) + exactly as under numpy.""" + idx = case["idx"] data = case["data"] + ndim = data.ndim serializer = BytesCodec(endian=case["endian"]) with zarr.config.set({"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"}): arr = zarr.create_array( store=MemoryStore(), - shape=(case["shard_len"],), - chunks=(case["chunk"],), - shards=(case["shard_len"],), + shape=case["shard_shape"], + chunks=case["chunk_shape"], + shards={"shape": case["shard_shape"], "index_location": case["index_location"]}, dtype=data.dtype, serializer=serializer, compressors=None, filters=None, fill_value=0, ) - arr[:] = data - - # vindex with a full-coverage permutation: flattened point count == - # shard shape, so the buggy gate would mis-classify this as a contiguous - # full-shard read and return data unpermuted. - np.testing.assert_array_equal(arr.vindex[perm], data[perm]) - # oindex with a single reordering index list along the only axis. - np.testing.assert_array_equal(arr.oindex[perm], data[perm]) + arr[...] = data + + # axis-0 index array (rest full slices): an OrthogonalIndexer whose + # output shape equals the shard shape but which reorders/duplicates rows. + rest = (slice(None),) * (ndim - 1) + np.testing.assert_array_equal(arr[(idx, *rest)], data[idx]) + np.testing.assert_array_equal(arr.oindex[(idx, *rest)], data[idx]) + if ndim == 1: + # coordinate selection: flattened point count == shard shape. + np.testing.assert_array_equal(arr.vindex[idx], data[idx]) + else: + # 2-D broadcast index arrays: full-coverage coordinate selection + # whose shape equals the shard shape. + cols = np.arange(case["shard_shape"][1]) + np.testing.assert_array_equal( + arr.vindex[idx[:, None], cols[None, :]], data[idx[:, None], cols[None, :]] + ) # --------------------------------------------------------------------------- From b2ece6f82c5281d02a8a4408fb13f791870c65bd Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 29 Jul 2026 19:40:02 +0200 Subject: [PATCH 18/61] docs(zarr-metadata): standalone documentation site; add package justfile (#4208) * docs(zarr-metadata): add API reference to the docs site Add mkdocstrings pages for every public zarr_metadata module (model, pydantic, v2, and v3 with its chunk_grid, chunk_key_encoding, codec, and data_type subpackages) under a new zarr-metadata group in the API Reference nav. griffe documents the package statically from packages/zarr-metadata/src, so the docs build environment does not need the package installed. Point the package's Documentation URL at the rendered reference instead of the README. Assisted-by: ClaudeCode:claude-fable-5 * chore(zarr-metadata): add justfile with package-scoped dev recipes Recipes mirror the zarr-metadata CI jobs (pytest, ruff, pyright pinned to the version CI uses, on CI's python) plus changelog-draft and docs-serve conveniences. Recipes run from the package directory regardless of where just is invoked, and remain reachable from the repo root as 'just packages/zarr-metadata/'; a future root justfile can namespace them with a 'mod' declaration. Assisted-by: ClaudeCode:claude-fable-5 * chore(zarr-metadata): make docs-serve robust to a busy port With no argument, docs-serve now binds port 8000 if free and otherwise falls back to an ephemeral free port. An explicitly requested port is used as-is so a conflict fails loudly. Assisted-by: ClaudeCode:claude-fable-5 * chore(zarr-metadata): point docs-serve at the package docs, fix cleanup Print the zarr-metadata API reference URL once the server accepts connections, since mkdocs's own 'Serving on' line points at the zarr-python site root. Run the server in its own process group so stopping the recipe kills the whole uv->mkdocs tree instead of leaving an orphaned server holding the port. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-metadata): make the package docs a standalone site Move the zarr-metadata API reference out of the zarr-python site into a self-contained mkdocs site under packages/zarr-metadata (own mkdocs.yml, landing page, and .readthedocs.yaml for a dedicated RTD project), so the package presents as a separate project with docs versioned by its own zarr_metadata-v* release tags rather than zarr-python's. The zarr-python API Reference nav now links out to the standalone site instead of embedding the pages. The package gains a pinned docs dependency group, a docs build job in its CI workflow, and docs-check / docs-serve justfile recipes targeting the package site. Assisted-by: ClaudeCode:claude-fable-5 * update index.md * ci(zarr-metadata): delegate workflow steps to the justfile The workflow duplicated every command the justfile defines; jobs now run 'just test/lint/typecheck/docs-check' so the justfile is the single source of truth for the package's verbs. CI keeps only its own concerns: the python matrix sync for pytest, and uv caching. The pyright job's python/sync steps are dropped because the typecheck recipe pins the interpreter and pyright version itself. Assisted-by: ClaudeCode:claude-fable-5 --- .github/workflows/zarr-metadata.yml | 45 ++++++-- mkdocs.yml | 1 + packages/zarr-metadata/.readthedocs.yaml | 20 ++++ packages/zarr-metadata/README.md | 19 ++++ packages/zarr-metadata/docs/api/index.md | 31 ++++++ packages/zarr-metadata/docs/api/model.md | 5 + packages/zarr-metadata/docs/api/pydantic.md | 5 + packages/zarr-metadata/docs/api/v2.md | 17 +++ .../zarr-metadata/docs/api/v3/chunk_grid.md | 11 ++ .../docs/api/v3/chunk_key_encoding.md | 11 ++ packages/zarr-metadata/docs/api/v3/codec.md | 25 +++++ .../zarr-metadata/docs/api/v3/data_type.md | 45 ++++++++ packages/zarr-metadata/docs/api/v3/index.md | 15 +++ packages/zarr-metadata/docs/index.md | 102 +++++++++++++++++ packages/zarr-metadata/justfile | 58 ++++++++++ packages/zarr-metadata/mkdocs.yml | 103 ++++++++++++++++++ packages/zarr-metadata/pyproject.toml | 13 ++- 17 files changed, 514 insertions(+), 12 deletions(-) create mode 100644 packages/zarr-metadata/.readthedocs.yaml create mode 100644 packages/zarr-metadata/docs/api/index.md create mode 100644 packages/zarr-metadata/docs/api/model.md create mode 100644 packages/zarr-metadata/docs/api/pydantic.md create mode 100644 packages/zarr-metadata/docs/api/v2.md create mode 100644 packages/zarr-metadata/docs/api/v3/chunk_grid.md create mode 100644 packages/zarr-metadata/docs/api/v3/chunk_key_encoding.md create mode 100644 packages/zarr-metadata/docs/api/v3/codec.md create mode 100644 packages/zarr-metadata/docs/api/v3/data_type.md create mode 100644 packages/zarr-metadata/docs/api/v3/index.md create mode 100644 packages/zarr-metadata/docs/index.md create mode 100644 packages/zarr-metadata/justfile create mode 100644 packages/zarr-metadata/mkdocs.yml diff --git a/.github/workflows/zarr-metadata.yml b/.github/workflows/zarr-metadata.yml index df7d96cc1c..b5f56dd508 100644 --- a/.github/workflows/zarr-metadata.yml +++ b/.github/workflows/zarr-metadata.yml @@ -1,5 +1,8 @@ name: zarr-metadata +# Job steps delegate to packages/zarr-metadata/justfile, the single source of +# truth for this package's verbs; CI owns only the python matrix and caching. + on: push: branches: [main] @@ -39,12 +42,14 @@ jobs: uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 with: enable-cache: true + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 - name: Set up Python ${{ matrix.python-version }} run: uv python install ${{ matrix.python-version }} - name: Sync test dependency group run: uv sync --group test --python ${{ matrix.python-version }} - name: Run pytest - run: uv run --group test pytest tests + run: just test ruff: name: ruff @@ -59,8 +64,10 @@ jobs: persist-credentials: false - name: Install uv uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 - name: Run ruff - run: uvx ruff check . + run: just lint pyright: name: pyright @@ -77,19 +84,35 @@ jobs: uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 with: enable-cache: true - - name: Set up Python - run: uv python install 3.11 - - name: Sync test dependency group - run: uv sync --group test --python 3.11 + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 - name: Run pyright - # Pinned to the last version that types PEP 661 sentinels in class - # attributes correctly; 1.1.405+ regressed (microsoft/pyright#11115). - # Unpin when the fix lands. - run: uv run --group test --with 'pyright==1.1.404' pyright src + # The pyright version and interpreter pins live in the justfile. + run: just typecheck + + docs: + name: docs + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: packages/zarr-metadata + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - name: Install uv + uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + with: + enable-cache: true + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 + - name: Build docs + run: just docs-check zarr-metadata-complete: name: zarr-metadata complete - needs: [test, ruff, pyright] + needs: [test, ruff, pyright, docs] if: always() runs-on: ubuntu-latest steps: diff --git a/mkdocs.yml b/mkdocs.yml index 46bfc1764c..87aaf23430 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -92,6 +92,7 @@ nav: - ' zarr.testing.utils': api/zarr/testing/utils.md - ' zarr.zeros': api/zarr/functions/zeros.md - ' zarr.zeros_like': api/zarr/functions/zeros_like.md + - 'zarr-metadata ↪': https://zarr-metadata.readthedocs.io/ - release-notes.md - contributing.md hooks: diff --git a/packages/zarr-metadata/.readthedocs.yaml b/packages/zarr-metadata/.readthedocs.yaml new file mode 100644 index 0000000000..b89846f570 --- /dev/null +++ b/packages/zarr-metadata/.readthedocs.yaml @@ -0,0 +1,20 @@ +# Read the Docs configuration for the zarr-metadata docs site, separate from +# the zarr-python site configured by the repo-root .readthedocs.yaml. The RTD +# project for zarr-metadata must set its configuration-file path to +# packages/zarr-metadata/.readthedocs.yaml. +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.12" + jobs: + install: + - pip install --upgrade pip + - pip install ./packages/zarr-metadata --group packages/zarr-metadata/pyproject.toml:docs + build: + html: + - mkdocs build --strict -f packages/zarr-metadata/mkdocs.yml --site-dir $READTHEDOCS_OUTPUT/html + +mkdocs: + configuration: packages/zarr-metadata/mkdocs.yml diff --git a/packages/zarr-metadata/README.md b/packages/zarr-metadata/README.md index 69b80d7332..6b6b172aec 100644 --- a/packages/zarr-metadata/README.md +++ b/packages/zarr-metadata/README.md @@ -2,6 +2,8 @@ Python types, models, and validators for Zarr v2 and v3 metadata. +Documentation: + ## What this is Two layers and an optional integration: @@ -82,6 +84,23 @@ store I/O. The models begin and end at the metadata documents themselves — `from_key_value` / `to_key_value` map documents to store keys and bytes, and everything past that belongs to consumer libraries. +## Developing + +Package-scoped development commands live in the [`justfile`](./justfile) +(requires [just](https://github.com/casey/just)): + +``` +just test # run the test suite (extra args go to pytest) +just lint # ruff, same invocation as CI +just typecheck # pyright, pinned to the version CI uses +just docs-check # strict build of the docs site +just check # all of the above +just docs-serve # serve the docs site locally +``` + +Run them from this directory, or from anywhere in the repository as +`just packages/zarr-metadata/`. + ## Releasing The package version is derived from git tags by `hatch-vcs`. Tags must diff --git a/packages/zarr-metadata/docs/api/index.md b/packages/zarr-metadata/docs/api/index.md new file mode 100644 index 0000000000..2aa39ab161 --- /dev/null +++ b/packages/zarr-metadata/docs/api/index.md @@ -0,0 +1,31 @@ +--- +title: API reference +--- + +# API reference + +The package is organized to mirror the structure of the Zarr specifications: + +- [`zarr_metadata.model`](model.md) — frozen-dataclass document models, + structural validators, loc-aware parsers, and the `UNSET` sentinel +- [`zarr_metadata.pydantic`](pydantic.md) — optional Pydantic field types + over the models +- [`zarr_metadata.v2`](v2.md) — `TypedDict` shapes for Zarr v2 documents + (`.zarray`, `.zgroup`, `.zattrs`, `.zmetadata`) +- [`zarr_metadata.v3`](v3/index.md) — `TypedDict` shapes for Zarr v3 + documents, with subpackages for [chunk grids](v3/chunk_grid.md), + [chunk key encodings](v3/chunk_key_encoding.md), [codecs](v3/codec.md), + and [data types](v3/data_type.md) + +Every public name is also re-exported at the top level, so +`from zarr_metadata import ZarrV3ArrayMetadataJSON` and +`from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON` are equivalent. + +## Common types + +A few cross-cutting aliases are exported only from the top-level +`zarr_metadata` namespace: + +::: zarr_metadata.JSONValue + +::: zarr_metadata.ZarrV3NamedConfigJSON diff --git a/packages/zarr-metadata/docs/api/model.md b/packages/zarr-metadata/docs/api/model.md new file mode 100644 index 0000000000..c82ba98f2d --- /dev/null +++ b/packages/zarr-metadata/docs/api/model.md @@ -0,0 +1,5 @@ +--- +title: model +--- + +::: zarr_metadata.model diff --git a/packages/zarr-metadata/docs/api/pydantic.md b/packages/zarr-metadata/docs/api/pydantic.md new file mode 100644 index 0000000000..edecb416a7 --- /dev/null +++ b/packages/zarr-metadata/docs/api/pydantic.md @@ -0,0 +1,5 @@ +--- +title: pydantic +--- + +::: zarr_metadata.pydantic diff --git a/packages/zarr-metadata/docs/api/v2.md b/packages/zarr-metadata/docs/api/v2.md new file mode 100644 index 0000000000..2fe5b6ec56 --- /dev/null +++ b/packages/zarr-metadata/docs/api/v2.md @@ -0,0 +1,17 @@ +--- +title: v2 +--- + +::: zarr_metadata.v2 + options: + members: false + +::: zarr_metadata.v2.array + +::: zarr_metadata.v2.group + +::: zarr_metadata.v2.attributes + +::: zarr_metadata.v2.codec + +::: zarr_metadata.v2.consolidated diff --git a/packages/zarr-metadata/docs/api/v3/chunk_grid.md b/packages/zarr-metadata/docs/api/v3/chunk_grid.md new file mode 100644 index 0000000000..724b1c9d8d --- /dev/null +++ b/packages/zarr-metadata/docs/api/v3/chunk_grid.md @@ -0,0 +1,11 @@ +--- +title: chunk_grid +--- + +::: zarr_metadata.v3.chunk_grid + options: + members: false + +::: zarr_metadata.v3.chunk_grid.regular + +::: zarr_metadata.v3.chunk_grid.rectilinear diff --git a/packages/zarr-metadata/docs/api/v3/chunk_key_encoding.md b/packages/zarr-metadata/docs/api/v3/chunk_key_encoding.md new file mode 100644 index 0000000000..bb063deb25 --- /dev/null +++ b/packages/zarr-metadata/docs/api/v3/chunk_key_encoding.md @@ -0,0 +1,11 @@ +--- +title: chunk_key_encoding +--- + +::: zarr_metadata.v3.chunk_key_encoding + options: + members: false + +::: zarr_metadata.v3.chunk_key_encoding.default + +::: zarr_metadata.v3.chunk_key_encoding.v2 diff --git a/packages/zarr-metadata/docs/api/v3/codec.md b/packages/zarr-metadata/docs/api/v3/codec.md new file mode 100644 index 0000000000..cb96d2c7d5 --- /dev/null +++ b/packages/zarr-metadata/docs/api/v3/codec.md @@ -0,0 +1,25 @@ +--- +title: codec +--- + +::: zarr_metadata.v3.codec + options: + members: false + +::: zarr_metadata.v3.codec.blosc + +::: zarr_metadata.v3.codec.bytes + +::: zarr_metadata.v3.codec.cast_value + +::: zarr_metadata.v3.codec.crc32c + +::: zarr_metadata.v3.codec.gzip + +::: zarr_metadata.v3.codec.scale_offset + +::: zarr_metadata.v3.codec.sharding_indexed + +::: zarr_metadata.v3.codec.transpose + +::: zarr_metadata.v3.codec.zstd diff --git a/packages/zarr-metadata/docs/api/v3/data_type.md b/packages/zarr-metadata/docs/api/v3/data_type.md new file mode 100644 index 0000000000..f482c33201 --- /dev/null +++ b/packages/zarr-metadata/docs/api/v3/data_type.md @@ -0,0 +1,45 @@ +--- +title: data_type +--- + +::: zarr_metadata.v3.data_type + options: + members: false + +::: zarr_metadata.v3.data_type.bool + +::: zarr_metadata.v3.data_type.int8 + +::: zarr_metadata.v3.data_type.int16 + +::: zarr_metadata.v3.data_type.int32 + +::: zarr_metadata.v3.data_type.int64 + +::: zarr_metadata.v3.data_type.uint8 + +::: zarr_metadata.v3.data_type.uint16 + +::: zarr_metadata.v3.data_type.uint32 + +::: zarr_metadata.v3.data_type.uint64 + +::: zarr_metadata.v3.data_type.float16 + +::: zarr_metadata.v3.data_type.float32 + +::: zarr_metadata.v3.data_type.float64 + +::: zarr_metadata.v3.data_type.complex64 + +::: zarr_metadata.v3.data_type.complex128 + +::: zarr_metadata.v3.data_type.raw + +::: zarr_metadata.v3.data_type.bytes + +::: zarr_metadata.v3.data_type.string + +::: zarr_metadata.v3.data_type.numpy_datetime64 + +::: zarr_metadata.v3.data_type.numpy_timedelta64 diff --git a/packages/zarr-metadata/docs/api/v3/index.md b/packages/zarr-metadata/docs/api/v3/index.md new file mode 100644 index 0000000000..f20267d372 --- /dev/null +++ b/packages/zarr-metadata/docs/api/v3/index.md @@ -0,0 +1,15 @@ +--- +title: v3 +--- + +::: zarr_metadata.v3 + options: + members: false + +::: zarr_metadata.v3.ZarrV3MetadataFieldJSON + +::: zarr_metadata.v3.array + +::: zarr_metadata.v3.group + +::: zarr_metadata.v3.consolidated diff --git a/packages/zarr-metadata/docs/index.md b/packages/zarr-metadata/docs/index.md new file mode 100644 index 0000000000..2004f2dc54 --- /dev/null +++ b/packages/zarr-metadata/docs/index.md @@ -0,0 +1,102 @@ +--- +title: zarr-metadata +--- + +# zarr-metadata + +Basic tools for modelling Zarr metadata, with minimal dependencies. + +`zarr-metadata` is developed in the +[zarr-python repository](https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-metadata) +and released independently of `zarr` itself. Install it with: + +``` +pip install zarr-metadata +``` + +## Who needs this + +This library might be useful to you if your software interacts with Zarr metadata documents. + +## What this is + +This library is *not* a full Zarr implementation. Instead, it's a collection of data structures and routines that +closely model the content of the Zarr specifications, such as: + +- **Typed JSON shapes** ([`zarr_metadata.v2`](api/v2.md) and + [`zarr_metadata.v3`](api/v3/index.md)): `TypedDict` definitions and + `Literal` aliases for the JSON documents specified by the + [Zarr v2](https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html) and + [Zarr v3](https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html) + specifications, plus types for + [zarr-extensions](https://github.com/zarr-developers/zarr-extensions/) and a + few widely-used-but-unspecified entities (e.g. consolidated metadata). +- **Document models** ([`zarr_metadata.model`](api/model.md)): canonical + frozen-dataclass models of whole metadata documents, with structural + validators, loc-aware parsers, and store-key (de)serialization. A document + produced by `to_json` shares no mutable state with the model that produced + it. +- **Optional Pydantic integration** ([`zarr_metadata.pydantic`](api/pydantic.md), + requires Pydantic 2.13 or newer): each model as a Pydantic field type that + validates raw documents through the same strict parser. + +## What this is for + +The public `TypedDict` definitions describe the static JSON shape of Zarr +metadata. For strict, loc-aware validation of JSON loaded from disk, use the +model parser: + +```python +import json +from zarr_metadata.model import ZarrV3ArrayMetadata + +with open("zarr.json", "rb") as f: + raw = json.load(f) + +metadata = ZarrV3ArrayMetadata.from_json(raw) +``` + +The optional Pydantic integration delegates raw input to the same strict +parser and returns the same normalized model class: + +```python +from pydantic import TypeAdapter +import zarr_metadata.pydantic as zmp + +metadata = TypeAdapter(zmp.ZarrV3ArrayMetadata).validate_python(raw) +encoded = metadata.to_key_value()["zarr.json"] +``` + +A bare `TypeAdapter` over a public document `TypedDict` is a coercive shape +adapter, not a Zarr conformance validator; it may coerce values or discard +members that the strict model parser rejects. + +## Validation boundary + +The model validators enforce the declared document structure and a small set +of context-free consistency rules, including fixed format literals, finite +JSON numbers, non-negative dimensions, non-empty v3 codec pipelines, and one +`dimension_names` entry per array dimension. They do not interpret extension +names or configurations, resolve codec pipelines, or decide whether a data +type, chunk grid, codec, or storage transformer is supported. Those decisions +belong to consumer implementations. + +## Scope + +At minimum, this library supports what Zarr-Python needs: the complete +Zarr v2 and v3 specs, consolidated metadata, and a subset of the metadata +defined in `zarr-extensions`. We are generally open to contributions that +add types, models, or structural validation for Zarr metadata with a +published spec. + +Runtime array behavior is out of scope: nothing here encodes or decodes +chunks, resolves codec or data type names to implementations, or performs +store I/O. The models begin and end at the metadata documents themselves — +`from_key_value` / `to_key_value` map documents to store keys and bytes, +and everything past that belongs to consumer libraries. + +## Reference + +- [API reference](api/index.md) +- [Changelog](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-metadata/CHANGELOG.md) +- [License (MIT)](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-metadata/LICENSE.txt) diff --git a/packages/zarr-metadata/justfile b/packages/zarr-metadata/justfile new file mode 100644 index 0000000000..0f1861ed7d --- /dev/null +++ b/packages/zarr-metadata/justfile @@ -0,0 +1,58 @@ +# Development verbs for the zarr-metadata package. Recipes run with this +# directory as the working directory regardless of where `just` is invoked. + +# List available recipes +default: + @just --list + +# Run the test suite; extra args are passed to pytest +test *args: + uv run --group test pytest tests {{ args }} + +# Lint with the same invocation CI uses +lint: + uvx ruff check . + +# Pinned to the last pyright that types PEP 661 sentinels in class attributes +# correctly; 1.1.405+ regressed (microsoft/pyright#11115). Unpin when fixed. +pyright_version := "1.1.404" + +# CI runs pyright on python 3.11; the pinned pyright predates 3.14, whose +# stdlib it cannot parse, so pin the interpreter to match CI. +# Type-check the package sources +typecheck: + uv run --python 3.11 --group test --with 'pyright=={{ pyright_version }}' pyright src + +# Run everything CI runs for this package +check: lint typecheck test docs-check + +# Preview the changelog that the next release would generate +changelog-draft: + uvx towncrier build --draft --version Unreleased + +# Build this package's documentation site, warnings as errors +docs-check: + env DISABLE_MKDOCS_2_WARNING=true uv run --group docs mkdocs build --strict + +# With no argument, uses port 8000 if free, otherwise an ephemeral free port; +# an explicitly requested port is used as-is so a conflict fails loudly. +# Serve this package's documentation site +docs-serve port="": + #!/usr/bin/env bash + set -euo pipefail + port="{{ port }}" + if [ -z "$port" ]; then + port=$(uv run --group docs python -c ' + import socket + s = socket.socket() + try: + s.bind(("127.0.0.1", 8000)) + except OSError: + s.close() + s = socket.socket() + s.bind(("127.0.0.1", 0)) + print(s.getsockname()[1]) + s.close() + ') + fi + exec env DISABLE_MKDOCS_2_WARNING=true uv run --group docs mkdocs serve -a "localhost:$port" diff --git a/packages/zarr-metadata/mkdocs.yml b/packages/zarr-metadata/mkdocs.yml new file mode 100644 index 0000000000..40912d6251 --- /dev/null +++ b/packages/zarr-metadata/mkdocs.yml @@ -0,0 +1,103 @@ +site_name: zarr-metadata +repo_name: zarr-developers/zarr-python +repo_url: https://github.com/zarr-developers/zarr-python +edit_uri: edit/main/packages/zarr-metadata/docs/ +site_description: Spec-defined metadata types, models, and validators for Zarr v2 and v3. +site_author: Davis Bennett +site_url: !ENV [READTHEDOCS_CANONICAL_URL, 'https://zarr-metadata.readthedocs.io/'] +docs_dir: docs +use_directory_urls: true + +nav: + - index.md + - API Reference: + - api/index.md + - ' zarr_metadata.model': api/model.md + - ' zarr_metadata.pydantic': api/pydantic.md + - ' zarr_metadata.v2': api/v2.md + - ' zarr_metadata.v3': + - api/v3/index.md + - ' zarr_metadata.v3.chunk_grid': api/v3/chunk_grid.md + - ' zarr_metadata.v3.chunk_key_encoding': api/v3/chunk_key_encoding.md + - ' zarr_metadata.v3.codec': api/v3/codec.md + - ' zarr_metadata.v3.data_type': api/v3/data_type.md + - Changelog: https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-metadata/CHANGELOG.md + +watch: + - src + +theme: + language: en + name: material + + palette: + # Light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to light mode + + font: + text: Roboto + code: Roboto Mono + + features: + - content.code.annotate + - content.code.copy + - navigation.indexes + - navigation.instant + - navigation.tracking + - search.suggest + - search.share + +plugins: + - autorefs + - search + - mkdocstrings: + enable_inventory: true + handlers: + python: + paths: [src] + options: + allow_inspection: true + docstring_section_style: list + docstring_style: numpy + inherited_members: true + line_length: 60 + separate_signature: true + show_root_heading: true + show_signature_annotations: true + show_source: true + show_symbol_type_toc: true + signature_crossrefs: true + show_if_no_docstring: true + extensions: + - griffe_inherited_docstrings + + inventories: + - https://docs.python.org/3/objects.inv + - https://zarr.readthedocs.io/en/stable/objects.inv + +markdown_extensions: + - admonition + - attr_list + - def_list + - footnotes + - md_in_html + - pymdownx.details + - pymdownx.superfences + - toc: + permalink: true + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite diff --git a/packages/zarr-metadata/pyproject.toml b/packages/zarr-metadata/pyproject.toml index edc4b696a6..6e97d26409 100644 --- a/packages/zarr-metadata/pyproject.toml +++ b/packages/zarr-metadata/pyproject.toml @@ -44,10 +44,21 @@ Homepage = "https://github.com/zarr-developers/zarr-python" Source = "https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-metadata" Issues = "https://github.com/zarr-developers/zarr-python/issues" Changelog = "https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-metadata/CHANGELOG.md" -Documentation = "https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-metadata/README.md" +Documentation = "https://zarr-metadata.readthedocs.io/" [dependency-groups] test = ["pytest", "pydantic>=2.13", "jsonschema"] +docs = [ + # Pins match the zarr-python docs environment in the repo-root + # pyproject.toml so the two sites render with the same toolchain. + "mkdocs-material==9.7.6", + "mkdocs==1.6.1", + "mkdocstrings==1.0.4", + "mkdocstrings-python==2.0.5", + "griffe-inherited-docstrings==1.1.3", + # mkdocstrings uses ruff to format rendered signatures + "ruff==0.15.20", +] [tool.hatch.version] source = "vcs" From 69ca264664bd74ba55c594490acdd49cd70b7fe8 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 29 Jul 2026 21:36:59 +0200 Subject: [PATCH 19/61] docs(zarr-metadata): docs-site polish: repo link, titles, RTD build skips, branding (#4210) * docs(zarr-metadata): point the site's repo link at the package directory The material header source widget linked to the zarr-python repository root, presenting the site as zarr-python's. Link the package directory and label it zarr-python/packages/zarr-metadata instead. edit_uri becomes absolute because mkdocs would append it to repo_url's subpath. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-metadata): drop redundant frontmatter title on the homepage Material appends the site name to explicit frontmatter titles, so the homepage browser title rendered as 'zarr-metadata - zarr-metadata'. Without the frontmatter it falls back to the site name alone. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-metadata): skip unrelated RTD PR builds; add site logo and favicon Both Read the Docs projects rebuilt on every pull request regardless of what changed. Each config now cancels PR builds via exit code 183 when the diff against origin/main does not touch its half of the repo: the zarr-metadata project skips PRs that leave packages/zarr-metadata untouched, and the zarr-python project skips PRs confined to it. Scoped to external versions because origin/main is only a meaningful diff base for PR builds. The package site also gets the zarr logo and favicon, copied from the zarr-python docs, instead of stock Material icons. Assisted-by: ClaudeCode:claude-fable-5 * fix(docs): quote-free exclude pathspec in RTD build-skip rule Read the Docs strips shell quoting from build commands, so the quoted ':(exclude)packages/zarr-metadata' pathspec reached /bin/sh unquoted and the bare parenthesis was a syntax error, failing every zarr PR build. Use git's quote-free :! exclude form, which survives the stripping; reproduced the mangling and verified both forms against dash locally. Assisted-by: ClaudeCode:claude-fable-5 --- .readthedocs.yaml | 13 +++++++++++++ packages/zarr-metadata/.readthedocs.yaml | 10 ++++++++++ .../docs/_static/favicon-96x96.png | Bin 0 -> 12714 bytes packages/zarr-metadata/docs/_static/logo_bw.png | Bin 0 -> 45208 bytes packages/zarr-metadata/docs/index.md | 4 ---- packages/zarr-metadata/mkdocs.yml | 11 ++++++++--- 6 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 packages/zarr-metadata/docs/_static/favicon-96x96.png create mode 100644 packages/zarr-metadata/docs/_static/logo_bw.png diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1edd099ebd..55b5d6fed0 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -5,6 +5,19 @@ build: tools: python: "3.12" jobs: + post_checkout: + # Cancel pull request builds whose changes are confined to the + # zarr-metadata package, which has its own Read the Docs project. Exit + # code 183 cancels the build and reports success to the Git provider. + # Scoped to PR builds ("external" versions) because origin/main is only + # a meaningful diff base there. Read the Docs strips shell quoting from + # commands, so the exclude pathspec must use the quote-free :! form, + # not ':(exclude)'. + - | + if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- :!packages/zarr-metadata; + then + exit 183; + fi install: - pip install --upgrade pip - pip install .[remote] --group docs diff --git a/packages/zarr-metadata/.readthedocs.yaml b/packages/zarr-metadata/.readthedocs.yaml index b89846f570..ace6ccddfd 100644 --- a/packages/zarr-metadata/.readthedocs.yaml +++ b/packages/zarr-metadata/.readthedocs.yaml @@ -9,6 +9,16 @@ build: tools: python: "3.12" jobs: + post_checkout: + # Cancel pull request builds that do not touch this package. Exit code + # 183 cancels the build and reports success to the Git provider. Scoped + # to PR builds ("external" versions) because origin/main is only a + # meaningful diff base there. + - | + if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- packages/zarr-metadata; + then + exit 183; + fi install: - pip install --upgrade pip - pip install ./packages/zarr-metadata --group packages/zarr-metadata/pyproject.toml:docs diff --git a/packages/zarr-metadata/docs/_static/favicon-96x96.png b/packages/zarr-metadata/docs/_static/favicon-96x96.png new file mode 100644 index 0000000000000000000000000000000000000000..e77977ccf41426c35a768ea73ed20e05d2676dd5 GIT binary patch literal 12714 zcmV;bF;&iqP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H1AOJ~3 zK~#90-F3TWhscfoy={Ravrt z)mGbDaM!N|6a)bkEvSfq;)-mtg)E=~30t;v=6!yD+$3bVL2JR~_k2F*lbds%GiS~- zGw;m2vm7CbUmEfsOgmc?cSkhjxbhO*YmAwH+PyPA{Hf#h-$H&#;_nMi>T1C>A#Z}< zP((4?ltr=*xFNc>6^ z+?O^2!gH1KT*3o0zxWZO{9nO*H|592H^KDw1^1;rWyEX(Fd`g>WPYjZdLpLthTCuV z*JYSb025U(HFfO1;H0jnILbc=zMnb*)sY)ajdNTCMdTI$Awda1D*lF$M_{@E_LfCQ zGr|@Zw{97@dGD0;qSo7XEXKTf764#@gomcD1F)`ON?PxNdsD}XPgb;^I&;sD{$lmu zXJK{auVKG<*N+*K0(r!WtTEJk0CW`MFJW6dT337kC`d~iAwYYGd;_wShLK9M zL&zi}a;)`?koZ;nNvUH&Bv3IoJ|iRVCaUIBWjOtPl{i`b4x_pmOQ3Rdl;hss6U9D%#n4`w5hXowfcp9^n~PN_psKm;y;Cka^q=&hj41MmP?OZdv1FHiz6Liw~f7(to^Z32Og<;3YA_9*N* z1<9#BVXzvI>WK>gIBn+4FY{B<&J#)pQ1?LOjJ?Te=cwq1rn&(j84oPQuwhPqQitE| zO-Tzty*aJ3v-h7=k#LgD&i>TYCi&yjrZjM|i^RRK2#HYhP@niVsPals8bJ9vtlR*F z3Bv^ls5R?hUV_!G^k2Xq`Rt zT>$SEj8E=QFoJ5_f_qYKg|RE*X3feCakY|;gxMME0jw{$C#8>wiM0w8+?_gB$#)YT z$@~fc)G9>9#?Q`JgkaE@SEPgU$EP-F=#?ytee}`8|Eq5QQ_kOedoU{h?$imk-03gM z86cWfRfv@!D3pal3^2sE2An5WT7mG_s6dbNLCBj_UI~?rs`9v6Z4aVh4Sp@NQi-_P zS#KF@0swo0BJ_Nh6x@??>+U;K>QuA<5chEA`>Hri$j$%&F+B_JP96L8T@%~Zc*fMJ zUc$o}uSELsN{KWak$+F>-3P~wYx+aA1Ad_RyT=3@16ph20qY7cfO4xTW$~AE@QBMh_2o~@=xSYg( zp>gVv6#(UfxW8n~H6Fi)lAbYr#bOsM8&;>5x~@ks5{l1C*x-u1Kc(IL?VZ8KKSam> z%Is_(H!d;?4S(lvjC4Tas=5e@TI~~gOMz_1N)wXvAyqA%diYqY8@wJT~5+ z{BbFxt>?U&^!SXz+V2?mw~Q4Kk-R&TucR1j$d(0vN*&{Ke9Kz?W!l%3@i!`N>&G(Y zZyz@<(ik0*H!juZltnFU{m-ez-&fD?CH|&i!HDSQ#kV#z4f06*wGQEU({VL~86bK% zz|#Qk2GFFIaK{A&KBnPxQ6vdu2FS+&G^-Q-@%uLum?lIM5lr2`r+9@lkRAj-DaWzv z^8T1sjt1om4I--Q0sz3gc{Tx9n15%=C<=aMJlWtt2j}0J!pKrthz3&2^pOc7%k%C? zz6(ZLgWT@A?iKlWrWkSjZ_%~` zLh(1;e!IW5FEA>)Ii>(;D=wogqhtuNs4Ha{5j<=>uq%V`qWLW?<2geo5owe9Ywup9;#Ff@--kqJffs_S)| znp;KrN2(m7CmB@!4a)fHHoOMkA_vN;fXRoIG*ae5(Y^*BK&z~*V+oJXe7>QtWFah6 zU6VsaWZoSq*Vgd$SCod1k3L!!_xG7EG1B`tJyR~qy|8Rva7WsR-D85so2ZrVJawv< z@L0wxMf;;(5H+O+*e9@U^Z$@Cs)oH+0C0*E9-sN5bIdOBMV4Hbe@EJ|O~Zl_;bgAq z+Zi^@$q%%7m-WEt5-%g}O$hY%EE#J=X(?*bbF^sGeg%N|o z)`h#4L}$Q0PR8-5Vq8+alRI-cTnUoiOHhu%8<7* zyg5?cFEA4b%>j@O$azrghVbohd;p=GS?9q3XjVDatW@LuR;@HCXxjD`T2l@Q(?+!b zMcym}R!3T14PnEm;s!Sna=1>DHV;5kKxmd4*M8#qoS`D>r;WHughd{;h7zSFqSSA_ zrcn9#G>yI?Z*0o3grr8VV(L`SFp=cK#{mCj*{zaod^?~LaZ!D14v%oRnu zdd-DmuMo*jnSKq$?PB?YD7)6%WK|+2vH*(nPGG){h~kmvNl_($iO(C8 zeo1XHVS&@0oc?XxoXjVccpDZls=J`(^xRw1uBhSbuP`s||2gwe{M^iE;X1F;Le-j0 zqDU$jojMr7psB$J(CXQ&V+l{rd_EHLvawXU*lLvB@^4MOuFBjMhxnf2Q2gA?XSLM% zPkv7EO?kH@4>eGkN5z@7Y;DDF$rmekiIp_5@@J}^0Y#@e;vE-fzfh8?dZ#LeQFs;< z=hVli%3)F556UPgFK~#yu(CrG?Tg6Xl;Ak0bL&rKaYOPW^Q_e*81j55zy6^^BKHlHac%q%2iHG zw7{Z9iEBPL)R{-{eH638lsC8N3=Db^yhx+I_)x%GEVMby6lNrwdPD5X~o}xky z33(5|JPOhQoC_jUJ=f2lB1S%^GF4#u04S}`91%Qf1T#s#1IpbH-Y>vD0xQFiA!15J z@K=yaK>33TUI$PF0Alfu^;%$t2M{<)0%TwnQ_q-=spiUDFkCg$Iq+N)Ns z0stgDGdn--`OGJcweQlS0$6KZ?VLBVmbt6ow|+5uf828!Pr0RBK@T3qZ18#7Gw;Tf z0afPC0zN7Mq6oml0(`6n$=1VG5!Q?d0Hs#mTMXiFbj*Lm>NpqP22r`Jb}bs}$Pxg` z0sPA-7pXBLDB6$Y;OcY&5K&arS5|=M0C`@)%Sd}QEN-ZiIrj^yx!Mq4&}d_BtKuFa zx{~C-;WOhBo)0rJ6$~1GX+(cghteRQ$}2&vhvCt@8lCXV(uXjL?|(4hwXESQwr5b6tdKSe-zc^3Vojl#}|qV!CWE!kKkw(c>|V* zA@W|>){a1-_&;O#q*AU2xZD8wM4chTs&~-p@~r?b zmAk(8{eJH%g0BPc)!SSQ`7&2ndapSW(M>I011cPF_2b>6u~Dw?$g!b$Ulcz;%6gw; z2DY9TW?oJ(XmYJw3&HKI8N&xNd^REtvI54L*Q2^RjjU zn3I3agidsv(|k}2I>8Hi0zLK^;shcpAqyO%|FYH$^!eONpr~(3NCjjm z$wx)xT%Y&`Q#q~{>@Sbs>%`pL5sEF-V)K-0@EAB0uaXl++QCb!ZoDH5Mfs+<_gVH&zRwD z7tYvShd*qXlkc{>k!(9jz-?A^WYWUy4Rv_c!?$%$3t@zK4;CcY&cO86a(@#cYKU2# zujDd^zDR|3HIN=)L`x{j>V$8B+Ts(!mmLS|)WdHGE=BF)Unj9-xsr;*R?M=9Uy}77h)C|h)XT-#2!*rO zSnZ#Cb?VNqwaiVZ1f=Dp5T69pQgLVwy1$ZA$&~ z0enTGU*fVb)BG+C`f{U=-7Ha<1jXk985X}JYqBaafI=x*eax7fku8CadrL`DGIGyx!DGXh{JwA9s2?4#6l5c zjd!JZXaa+<=8M+&NnH+yiJ-*MaV~}8LLV&N2k??8qN}oLcysZg&*l4`-+4vAIRsi9 z4?P^8TaEhPQt@J;d>B9iLph@;%*Yf-6j;YwY}8*SlqnQl56FPTH?zK~9rC7O!HA}X zM{jA>EIL(Od}JMGNYd*wzpVS($5HT`2|d*K?(j$Glvcnu0I>Vgdjh@)|8!6vH3~O= zMb@J2SB;B|w2?zWX&~0DQnA0;J2?13>%|o#RCxdz0kl3%S}}7GE)Dwfe8;W^#1Y8H zMse}>tHyoRaapwib_>vPn7C}_as-2>V9n8i0(|6yMX+vC)e!S@A*WHKl{%)ESZ03* z|0@xh1_jl4{YCM39e#E3iCi(9Mo5w4`sV;RC}Ic4ub8zhoaoU9kB(_dNdaW7QU@o! zmA&aiqUZLX_$$!dD{uyha(Jt^v%aak<~aUG#NtV)DXpx`Ixc&(48TiYUy-@6(D)3ChZ(7gVsp5M_$C_!jg zr?Ny;3~lE2Paff8m|{{ANiE#!R_9T<*R9r>3eU#Kwm z0wxhaF@cv7R%OnwN|Z}ehk)oqgT<<7##+Nlt=`No&g+*PNlFftO#u@b={39&k?PhS z%mILM(lZtfRm=vXHi{O3$2T&9l*L_QfyGV=@%1czn2<7Frt7dJjEqZRhlshAjHrN89 zm$7z0(yGjnClWsQl9Y>bFHTvZioc6;u5mFEik4FD-Broick!eauzZ-rU)7Z;()&uA+0PG=Tnt>LBvY&$GbzhA`0I3|Y`kKTH00nSZDk_U>kxL;M4dSJW z{|f=m0^~!0v4B)AT-Yy$gQ)T#fMyEb$B4#n`^t~~4!{HgD}~Oqgf(?5-0H~hn|i4# z?}JDaKp#w8lf8J;nfLn}M;}{f1d|h1XI72O?dg-U0OabVHCcbj>pebR;rq2Qh@e6t z$V+@b^G%3IUhm|)l(H#l&GC_}+`g%CAg&-aLLe@T>`#0@>a{(6OQVh2o7L!=r1y^Z zDfV2H-X7NW1=vu;lnZz`A)?W%x#dT%^TDD(C^KmIt&o!m>0TjneeZcdh)hDZi7*X7 zPbh|jWePyz2!MwTunv$31SXQ^ZmFD^MlfMr);a)}=Uy=JVq;_)N{+oi;AJ@Yb>jOc zUO|%EE9G*4_X6Tq^1(LivzCD*kcB3_QtqXPj}q1$7e4R8)SHB8mbk9*qX3YwW_JFb zUa1YJ@QJWoRa)itO1V`pn7G@i-qfsoC3OoyUt`kj1=y5|=)4P#j*)UH4%gaYNok4W zL^LJv84Nq9O5&8L=2g>S%a;36|YqSuqmC+DDOr*+3VgNe+VQLRj{!m#-|b zaMp>d*Nf$^Xt|V@mxZp|Dqi(LD2HC?Y=bF0E(vs_+9hW8AmGbWtsCYSp3Ja{B_=W z$!AsFP%XD6Y?!@0;iK$1>hWW-Or(XEcmBlN^3G50d0fon{P?vQc?ln8%@xQe#xqHx zFnQ-DkIg$brC$wxdFW?{&$7NrT%Yw+sKTun@2qizB2)q^vtZ>~u{eh+%fyqY6Y$HS z_&bT;(&}l(VhLR|frW&<$HI!mb5PbC0;eOewZxa8$vZpc+T61zegfhlS~&F3LR^kA zR&Hzm(ab~D=}zI%X>esl!iQO_D$ngXXTtB`!4FD4J)^KVEAQ-yx9vV_VrPUgFG-)w z+AJz9M70@QKs|QKJA2}7TH-smD#KNec9}0f#Ai7y1xc=T@{YF+?LkrY8 z%A`y-Q8Ad7ZE5+sS`1``XkqvsJlROdd!P3y}Og;j`>HVx7&_ z0`RoGTHQj=v;12c(#2FaxKT23&>L-=c_?WSiFG~Po&jQ zi^V<#N<7poN9|c+H9KDfuviWL;;6I)u~;e=!x6X=RtDsDOfF)+~ie3@rTh@F5n{rD;s61Oyr`#fnEwF3` z%OY4buEux8no$Y4HRnSXdr_I<$^3+k8S5+0<#syqXYtT7!sVMa%wz@HY|L0GibPm; zhXOv=>zC6x<<`7T_r!%WFLFdbgq5~X(;6ytXfMb)W8!Ua-S*+!^H$t#^w?G`{7}I0 zO!u75$zw_BVn7UlMJd!QhstQ!3QuRa!@~}-GC-{ChGH=lcflgEKE5ixqALSwFR_adma{;)zrp=bDx$sy3 zH3}Eq#MNB7PTe{CEfca z6_*Bm#>F!r|NKp}BTHKxj2A4KmEhZJYF4 z8a*m1347X2yv2CBBq6tAahx8HPtuNAZ$m_K+fKNehDU@<%xRxImXxJ!cV+HFF+#?> zqA#4ZJ@b74@8@<%9&c(F{~D%1@eUP(V6jG(FTvILTE)Ni@e!5RQn?TwA2%vVu!yO{ ztIEmzQas)$9_LVTFFZLD7N^zEM+w#3Qr#sC06x$A3oPa&?3i8UPR`kNBn?)!Chp2! zblyk*bdz>w&Zk8?B`*+b7KkT9V5AGk zX90v3g4H((N|^^E!y(d2h`#}7jT20o0+eW;@&-<=Ef!c7GeTcOi$xtzd~z{ z2wK3<62}kyn5x&&)nZjXK~HDUGPd%%wLnciHdA@CQ7xy{EPDDVEn6Sw+gg0?R;%}r zIH;;q;Nf4iXiG~_301Am^6qn>5y|;@{M_k;~S^YsFeT!5i3bVK~&b@1EG?WpS|dt z{6jB@WvP0)hpOH8w4N|(Ym3w-l~FP909b6KCpW;wlW^q`b)Amz&=MX{&#{A+V`z~D z7Y}%z(;l8A)!}K??>xHvBRxzK54W*Q&Jq`=*WtSWJa}U9jAKn#@wm{c87D69wPn6B zHCzG!%F6K=TzNR*o6M>Kmxx0V_rt@N;z|rGN-U*GPK$}R<;Es=tE%WLaK^V8N0Ro= zde&H;4HrGsMWbddn%R#5lSD)|_iBJ5e>lE0f{7TTU2mOG_f4 z74J}i^Y~AfuD%Ux&V?&+YGES9yEdoA#G6Dl$|oL1!AJv;GXV+tG3qfF2C^T*+d&os zG8w2?!B-#Om;9n@H@m$DE<0Mu`39jg93ih`-m_3;^EeOQ6EzEwVhVU&@PJ_yHOW&=P zj~snKtH9R&F*I72UPd0J-OahJ0-_~?u^9X|p#wR05{7c2@*8X5k$J=%p7inT5t|xJWKt6`h zZ;#I(ssXF|h6A%x!OO(pH1CKrN&wfb$MND(7e)A;y`HOA3MAI^crA$1@-UOE3?Zm? z941WA2zQVeppZorxv=uO7gDbJQLG}_bg+$L&apJh2x1f%+7+98Gl9cx3$tFWett)@35g0!f$RT$m5|NGH5HL3puP#V@YuaR z$9zh0Tm!FL+rq41b>TNjFk)wH${i-qV2jZ7q?*f>=02r~CCu)fF)6q1Za%SdB|l^? zd}vdYwX0oG)?9kJo)GIfe9tJmZf}-+VJ$fU0Eypb6tpYKnoBXOlq{!l)*98GI|9j< zRV69_Uq#(_4CJG9~&=^b4EILx0KuJR#&_0C$k)Tz~_^MB+W#avWsh65D^BF=aQ1v@o2?jWB||x50hwQjXnv=QxWQ( zm2jx$HZ7YZ7||f6_|^sirjT4MDwnrA6lx*u45TIzI71Xysc=2jG}{@Ia;s@JVNLBm zQ2WEPw&f*`&(&l8u_|Z@YRS%+lrErr?t|G;+qKjF;LJTaE$&(DS#vGG7#fss4(xd`rpBE7=6{5_oTM#Qzi6Hv|<$QX)Lcs}`T9lk(e^a}vpNz-0D9Z4fg zJJd2Sbp(z{o&)gijt6RPEU`T%Tu_=QD97f3BJnPHue0chS+M@fT zkB*55NU9R=8*2x2I9zv1iU>D%D9oC?EjslABfOd->!_v~)oi0MrZ&GKs&A5dOzE5l zqn%x#7eh-KYoHh*Yft06qT*Sjrmv;66+t&2#UucHgE(HB3k+&aOt%1@mvY|*`0e!& zE@!m`)V25uVxBnmLDJVwlzr52=@~^?VRL$QY>P>`6O=DI70z5${rvVoN(YME?b54S zu(74-q-KsIfAz%l?p#=Nmf8ln-QOfSX0$)RG{AgdEv`J{a7K-p5tZ-&NX4EfoeqU| zBH7+7`9fM}5FP!1F#EO#QpZ}w>dG)G3q+^FS)Ty-%r_zr zl4z^extT_no>7$fouXHW*~vJ#B_h!9q8b+@Xfz;CLFCU}tCjLgpbxgjrt}fzKs8(~#0PCt~j z?u$VBwn#cR2pFUEox3%VdZCi!&23?k$; z5Rm|uhwF0Cn$6a)XZeY?YUL&vF6&g3@x4R`fK?LowGQZ9rTIhKT{V}>ZwZv%1CcGA z56-Nb%Ca?(HVi=08HaY=1cXFy932?dI1rN#a=kbh)MeSgMxioP|v^jZX%Y=E_J zd_z0!e<=S%w{!~i9p2j#lhV)7xx%Ba6k++cK>BSSv8wB#nsbWID9l(1VC9xT`sD(R zpvZb3amn^(sfRiqIKDKeXzS-umObsG>(j{E<6CV3Y4UgvZhNl;Wx!h8Y9GSAm~Do zk10B&>wy!`PKE@{mYCAv3}6C)cj=SCUA~>Z_lL$A0M00!wi3X~&4Kj(N?c(CZ(5qB zfaC~l-F?^$BLS`;O*;shIevQuA$@!xmMHiXfabMFyDNVRxX_9dG_-B3%0)1;yz37z zFSSu}sB{7e*LtRgY1@jluwom>`XIxcO)(ut zAi(h;R;lX@>{h*ha1zj^XvSLr-r5*QzuW+q2=sLkM>fTz-)f0f-HSr2P!s?J+V$Y{ z#j7OfYZWN{EhuYcV<0_T6MYC_77An$VS^%0oGLCdhReGioc`X)iu|U)m$8#ag!Ao?;_NcSxmM6x)ETa@uXq0+ z%u9W+hK@k~-tFM@J2%HnX=BOjJn9^QY&-MN^ct%MyB(ZSdw1~~SS3MUi$K{;odX^J zOu-7z#eg2Q{6eQ1T@TE79l+}wV2fRz+LpcCueG!;+nBb+~I}iz)FQVORn+2F=fz>|0cU9MKe*8_T ztE1b&X-fet{UUI0e~1huu!t&U8)GKlYE<9tdT7S>O5Y9vECCUO!E9jf$$iB!V|x!v!NZhng| z(BdutOZ@7;tm~nvr)vJp;k4Z~Hn^KF!<^G&Iu9q&MFsQDJNUpU z{mjwlv6H)5$~}Ob1Hl|8qV!oUi|kLz@Fs^2jX4|>eVY)!2l%pz_sDs*Mx=fT*d)P- zvS@E41&K=Ev*#C0ty+N|_RA6TWth`3rqeK`=_+F9pL=lH=ch7)8=3~2!{_}@h#Lgl zN1z=b#RASRH~vR^9+>(+ZyNn$V}so8H-T0o0kl!_+4G7Xth37I#Gmbup!q1q4l^p< zL^!`k;RD}qN&OGRDhc`;M|(pI(5}Q^{*ON2R?MaR1!05S?w3HTn+UXXl+T}Y=)pRR zxGVAfzL_FH^I?n*6yPFNJMV&`hkh~NAN;YfL2mbJOsnCd=mO=l=O2DB?BGpx{C6L$ z5s?pL?i(bKzO=gFSBD<>#eIqMq(g${qi7wfkaHcMJa^vyso!JprsCEg^tGUhL?EQE zvGVfyho-Lo?wkHUg9OdGXdMc{g#tcz!4ELW|J$dUsuBTx)N*03Ll3O`;eq`^AVIS( z8rMLymw|cySA|nQ{lP()5xJn^Q`V`)` z^1JW&nL&bPZHx>gc(GCQQqQ7$>))g8hd$y|f1Yn`AlP38SAtmDyJ+fvPU*u=1_ZJ? z=7B*Dc#$gR^(mTq%9_J_l~@%! zt*@b8LE-v-rzjCt1s>`zqE``S@g;>*R-KAx{5Sa7h+m0SvD5krc{xNr?00bTNlAo| z=)4l(YyEyk&EB7#_?1`{JFPFt%gz6g2$iB+%F@eq9mt=MUOjdB2t zth?+anXFTZUyS&b_)oKGz18w61Np2n5#EZO))&eF<`*J*C4O<@S7Jr%j6P5f6i@_w k``1NN-ukKI^xxwD0dx|tMUqFQ>i_@%07*qoM6N<$f_TPca{vGU literal 0 HcmV?d00001 diff --git a/packages/zarr-metadata/docs/_static/logo_bw.png b/packages/zarr-metadata/docs/_static/logo_bw.png new file mode 100644 index 0000000000000000000000000000000000000000..df1979d3cc3317a36feaf5e7aab7c32998bdbfc7 GIT binary patch literal 45208 zcmYg%cQ{*b+eGtTnL*e6vTC-FKl8TMP3q9PdSl+!|iF&flimbbZ*^ zYjLm3OtsO3Cm=Roz?aI+ig5NVu7xT1#*POe; z>LRlF7c-xu?xONHe!xzzIJX2e#r0oPN!WG{Dr4GsMoE0}-h@DkNn!{_ItQoS%@SCe zj(KT98(@6!Mho;v;m=7+xrp{nDkY|A`barQ@1OK{w!plS6d*X+d2PHu<{=dnOntLD zZ>ot>OKeJfPb=te)b?09NA6AD6wsDe$-lNDGUfbWiC=rbZo9TFizHPvdn0G>JzBxX znK)~S0N>Jdz5lvY`~vAYpA56TtFx>>gH70?#$oQ*_cR!~R&WKfRPp@eVa|eIz3^yRCrJ?L`r$v3N1x1>0Htr*i1OfABST6AR|wv2)8# zHldDWR$@_lv%aUF)QML5NQ0?;hPx-h(nP5y22u5cR;U*lijWd1MLt(>qk6?7BFPH* z)JOt5Z7|&ko~oI3K?Lk(Pxw3?uhum(EkhFhfG_Ls!=qEi>}%VXVRnEGn|-&2Dwy)XJVt^Qf_1&!bND+^B`&-NMrWJ z=8j)D;@K>pX&YWz)D{dC=7sy#{+r0-e-Cq%9n0C{v*h~BgKmdv+2xWy*@qyb19y{J zyJ+)ShUP{#-JPdmgF#@s(N`(-?+<}}A}@HuGlmPI({^47ZJ?^=fG?=Qm8D<$FDkB? zxHRl&ACnuUgh=(8mSR(h6q}@~#HUYdiv7xX0|p{}pjteXj~zYqx;#{|2GyX4)9Q1irjg~^S(Zrf zA@eeMo0UwRK>tKY1r=|GcS1hDU?6O9ored=tOYI^9&^>32IlIZN?QGrilO&6Z(+QeDSDNxe26c%;|p(U6<{2^ zFFq&(PfgPzQ*n&1(u@9W*Dz+}3xi{}V4C`nQ4&bx9SK(gyQD1_Dk#5=DUx#Ih8)bPnbd`x2WM(2W6B zV&WpS{Vc)%p_E#WM++Nhl6ni-qAs%5uUwc4Y-`OI;Mvs_xi<@%17fXW(*@`3Xf_B7 zgQVO|9VCxI2WwlQ2n0BHH15O%!F2DPv)GY0#m8glr{fn$t!U1^b_BPdV7=NT$>r-L zL(*Q-=j(sOztt*yO9hrGRU(!J?re6h((z(|89iZmdf_XHGUJVz%n5^AwAROI-Aixi z>zi^Q53_FYT^ZIqh$ni0n94zLoQ0qgbfnb2Tm z9o3d_Y`S;WbcN5n{gt z5@mY=5dw$nz=NWJ4;Gyk(*>)Z`?{;E1nY+fZ_??3>~ft;xTYY#I-AidQHG{!x=UCe^hj)0 z%S>4Ot_I6QoeU%{qsss_m65YAgY?rbf4S#{m|fFIjDg3!ns_+dm5t)PolDc^`bv3J zB;^tqn6*~s$+{5OdFh%pHOQMu716{y!chZz zDDL|~kQ%j5$PRP-%dmlFgixn5O7nOS5!wk0eoJIYl3{Ns_YO{9s7QJauuy@qJ57f79eR!de?^guaj$=KTOf!7mN4h0Qz*gcd$8Hf2 z5WJ~sVLXt1F+#s4&n|GW#irlI+TIHrH|`9(MxASdzlFFka>=-uHaHjS`AC7fhost) zpodyK;hN4^wF-NU)wO!OJlqmgdAx3qvGr}JX`#rtH#e%j`WXBa`$9Ni($H~sRc#hw zZfW3Ph*$1oTH4UO^z8KleY_#gY&8*UFC3RHP!*a8XR5C$|I$Zft2mCO4n98`75t7(nJneB5{G(e9C|K-He> z)e9I0PF%x>)=qyV+}%_j-~Bn+ZS*FHrI8XxsPj@4uF>g}7^2I$@};ZjTcL~@YB!$3H5>YXAiA}R_C;VK7tS)Z{yIg4g%a+#`nWNoPZkz zVy20A#|#P2i7(Q66@RjGNIF1Mc}Eczn<bARW-wMLqnk&1bd}n5o8#ehJg!&k{BX zb!O9tYRJ%;_+iqeKDEnchg+hzwN`Ao^FLlsoIr)GR97C0BR86XBf0}vQXhX@DCxL2 zRKgqT=%~=BsI3a#anqkRMz! zzPVU?CrCLzBJ)SETN)M$k9)lqF%~0<=nD}+s=#XQE;Pi6hp=e~dj018*S|N}gYcYP z;_H1>cCTj*?p1m%02Cex`o6FH6?LgGQC%cu(yoQVNiYK*7ZE&X1g@#JcpRmsEfUz> zLhKCC$R}pvvb0l=yh>8dB9u}xdrqX5O_dDiSnAr4^0VH+2OpyQ22tCz(3OkZj(D}$3mYSOE-_I00=-gQ?3qM%6QS-KDJb3 zym7KQE|G|yVFjQ@M;@2?q!h4ZzSA!?ZHWgKSJcmI4TtAm4>^_x6CY}@Z#@Hm%U#`q zczf7k?B#4uZF}+8#W)J*`kPlX@q;8b^vk`q6v74)S#Buau^OZ=9`}6m%5;v|Kg@qy z?0Dk@<H_La2yzHNf9mJ4-D!6;udp)LBz;)ITWB%n!_?oM=^>j1~ z;RlCcwHa=gOA9r&4fjnXUJT%;sYcxB--b$;1y#W+t;BAy$jcGxuu5Opmu`p$) znnMsRqn#K%Lx*NfM|Dmh?oS2Qu47CExT|^1qK-G5=&HSAA_y6``3+~y@nSG93ljB9 z$HYPZAaC*(kO!*_JI+NW`n(_69?IR4G+opc72q6?OaHReUX**w%=-Lf_A63p5%+8< zrYqNgNJr3T53Dl+TfTs;-AqHew7s}F82dDG%R|^%-1ir?|B*ES=2-OZQc*Gm5}|0O z{%cE%Ju7&or6i!M4P-}tu56&y0pV9qVUI!!fM*;@udtkON?vBy+*1+MPFt60&lBG> zVFCk()`%k-N6=85eRA4UI5AQr@Lk&jPAmj3+Y?fu_jeZ2(P`S>wXe{T6cJ3Dt>_hX zTRhyb(4OFP8F&B!Vk-Xe#R7@^Rz>uFrAa0MK|wKLq*vM>4vTx#Qe0aG+AbcxBc}5@ z^l0icOfoat^`4C;AIxwTCI+Cye^tTf;l2di86$xVsZIA|RCKCXGS}f@ihUAnf0{j1 zRZt$lCN$@A5%QH*cSdD`G}CwImw~pQM?nc>aj9f8e-t=;~p{k6oe4fY7;01-%a-YqThe7=(!|Eq+_0 zo#yk4F)KM3;%ToND!JeXnYyooi;vMh`EBE#9a@ax&L@6tVS{=7jH;HXC<~M!Y!lQU z38a*whN?3RJ2dfsYH*%PcCf0!F`qzo=; zzJ}I|3LY*X3)FcdRO%sG-~^%ZFNR}p7fIT7sF90pCV20$(+mtj!l;I#mi;o+ z$j-B6F}zH1JOpvK2b!k9UAD@ns`hH&zIH_>*iET{`jGCIZ^H?ARK-n=U^g*+M)OU` z&5F$`@jm(NPOTA5qH-$oNEq&Wmn3c17%gy<_qF*#p&L!T1^(BpHhs0B(X zoM?_3m3Jen5Q^dSQ=Dkh$`R$q-M~74?4twA$+%hKFT<*>q?D7jEd=*=5L{~B(DAi5 z08hBh_ovT9WO*oXS%L%&pHPQNttXjZ`QR%@e!MVEv50t-9WL&b>LY@8)2aOxeR4XV zPTu=mu7nPpJWJya>=pLH{v z_V|*@Fd3=zx35@>;CK5{r`4xOsUsFKA+QE*F`Z@S(uOM#{x)m8A^W;Ziy~}4!JF>1 zls$9?XQ1=;eM^sXnpemMXu4~Pw31|!_&l-yD_x-@W9q#RU;FNCo)?eHz7W(bH3kKe zARV&lH?>blNNc0y)uIT)dEcdfBt5-iM%2B&dxJCNIABfO^i0MrpjV^&sw|l=n@#08Xo_8) zp3FY4!*9D!?*Q!~4Ynx4Z8fbbP_qZPMJpi-XPO4+&ND28XroP691Z)Y3CTdSb1p)n zzIpcSAriytiB109Y`oe1pP{FJ8~3FvQ>V}*?uqZDrWNXK&$PEVTHtg(qY?kU-)&(R zaxBB)E?o+z=vZD+>3Oa6#S;PltB9iRAj2sZc&4>ng4N~QVzNTrTKEL(cej6uBB;L8 za*jkbKRz7iNWy$!0(O9!tdRtb3;h#8>-X{5LW%8nn^yQOYHf_<7evN8>1Wih^p~1d z)!wqE-Y#B;M@#?kR8GEn08jDMGjM>hv?RcexrjQbjvLRs7X3KAB3aSndh9g8sP{5UlF7$48Neq(bRZt z$;SPj(g?}7W$}S&IP=VA`+&@bDlL_yH<^o2r^P@On>})ij|$hMbk`sym>aTmBU>Pa z5fd-s`)Y18hO@+TKOez&_CR;WDSb}do37+fL}&?TAF$uDpR^~f{_c?3WqmC2-9>kr zTv@ue&eT))lou*oSp7$Ar1@MiH|$Fd=o3fOu%}?6Kk3~&qE(}I<$2tY*KjxJ!j+Lv zzRNTvif2m*P@QJExB3&G&^hV-HTo9U);Q`06^e59%z6dpLNI_7=z4jraF5EE=j{3R zVtN8o4o%{-_w3xmn-pcK#Lu<3w#3ObXe-_S;uT}~YsAavl2;_m;QnYAE!AV;WGBzw zhrTV1a?|i)BaaqNuzd!7T638PT@Sta8ET zYa}}d7U8kaG|MuKm>l?xX>0UBp0#P4t8aW`-VwcD=@25>mTr|Sj_yxON1j=0SSnrq zle-A#;F5;9>stx)O89Qck=3u475xr*XK0D|HS{Of8}tE1MS6z&b|mI$=n1HV=J*E~ zdQP`(=9UcX#&r$TUr&VtF8dFg^H_XsSJeV-{b(^)nYu<%(*H~1`}*0{a~o8$>KRK@ z7k+Q+WJPi39Y05j2#w#3y;lhRF+FF$<*=8Q>>sT49L5&}U0G5@82*0L6OpJKN?s939;z!pAP%e_)UZvx<5AL}oE5Ca zcTH#PNg>*_7fpwc5KGtFDNR(VP~BAiOs6zT+XCy?-@ovS&Fr-s;vrtjnPJz4k+O#vJygFrs~b`&ckrVg87+2MxazWQo?2 z8vpDk{|tP0#rfGy!FSA$s~Qqmdx?Lk#|~LceyC7j$#YRTh6={;%JK~Q-|O3tBnlAM7)m6eFtJLw*$CG(ijPJuSeeyHVh za%GZZkSb?8-TE>KhjM73Ls#X(Go!Wbqa^#gUdE&SxPmi}Rh!@cZ?Gq3e@Wo%yV@COJ4Lmk_`Uc`K*dW9F zLFfBJuA*DZqPjmRD+`Zo7!{}3QF__%e6fA5F;0lVtRB8ymta8$)n4?QT^J@ofw(yu zbg;A)`Aj%^Ihh57ki&(Yk!|2_3k%1AZmNVAGhJ|CbcPsdcw-*vWlVUB2U3L!;h4$` za>@#D;%vL5^k_9k!`O1!(AQ@AL7Eaps1h}{VyFBZO10}xa(->QXvaQ$B+|<%r-h$_ z58ffm6EuXu%Zdn|9N5^6;>zO~n&h5`M&ix!dVFJazz8kzH9cZ(A4-T{mkr%`2{E&L zFXF^}J&??+ZT??Vg7zFMpe@xVjPjkennly)Z(0v#Il-jiQTS z`P#L=8P`2e@}gY}A7u;%_>LKBcuwc=QE_Hirh_D5n&l39EMk@Rr&p5%&6H(cTtb!P zeY=TJK9h6DW(LQ1hlt^FS-+#GAo{tIYh?J%Uy`Qm(^!tW%c`%&5t;PkJc&GL(}$k# zSrD&34YlxpQ-6kgsLgeHuVlqAFXUo<4Y6j_vg^ z;IO6re~kTJJws$tW6lKW$6*drlONK1L|R&#RE|89% zNw&XQS3b*#9AYz^m9M#5)S~tnyya>Z79e%5g}=E|W)$EwORcnmvCYN}WtQw(-wfJW z+wR{?drlWbMIbDUlLlu}F}Bb4y`wM0N^)md>ddJR79|+ba&`}di3Q5|-a?i`*Zmhu zzJ4dw?tiu~6u`dk=>!;A8!(X4L0oxVeO#x+_x(^R#Vh4dH?o!;4pk>HGT!kfdZ-S% zHgq8V)x(zV;LP~;U(Sb!#u!LdEdyF4owuS(cb1+GnuPrecQ&~lIlKn!-L1v1hRU>D$#)|7Q%b2wA z34T$aG3=ALbq9U9M_@fg@A#Wz&mT;nEwXRzDPiMo^1x{ZxZ_Dq*aK|yn5<0M2Mytq z`Onbkk7Zv)jE19x+;8MvI&8%{!UJ5wS05l6KW~4XaKKGE)KfBv&Wv#nKVzJKq&1e8 zc@Fe7t`_%QtEnSW^L;JcPK+-Q?e={CnaYMVq*XSkDMS$6%zLX>>R^0(>uFxq)-5WS z`CnTaBL5531R+P`+kXn0?B+k*Nbwo2VtF^2Z4-jv(EdL!z|>8txGto|!uCw!2QX{{ z|1u+3aLc$%d9fQko8ILT^dzjP`eWb7{(&V$X~np2`wsQ4Dn+&4a6;CRBjmbO#r*2V zU(>SCN9fU>D9UB;#+8D}!YJv5W{@mE0u`AzJ zr{A2q7;}6w;BYq!Rp4rR1{NRyK*N5g;Wtfr!@T~UqY!$@SG(u-q{_j_m#xy7Ngr4w z+DB@n%$vF1ZFX@r#zzVAb4Z>cm{!Z5f28?GHL6I(V@$q|evov(~WFXzDf{lwUyGRas6e(zbjO{bdtr4`%doBjX&~}`8brEixhS!?w(lRAk=Y#OpWo+al=+e7DFnAmrZd ziu5rm7om_YvqkGkfq-H$b#>2^ZTqVhddHUlBXIV&4k2 z_BeK(p0~!e5GzIm0~6%50QBSQ#i`OW$FtG0i0+ly53_W#Q=t$J9%H$zRPQJ>JR@K|T-3Dm;~gO3(GT;p zcda&lw<$63$|SnBmG~>9VuipQs@cJ1&p3miyuu8#>Z4asm6^;0$dS4yAle6*=}IG7Io6(T3Bltx-_vGr>1zkZ?=`hYOLplFlops^JT*u zE3%kVNnc%%UGk8tfbHEWpcZsNmuvmaaWRJMb1%8?p0BVVunL50N(>#72YEt<=$Ac9 z7``&edkud;C#@h}4&-BlEFi6C6>rlBW&#d0&wvCg&KW}9Cd6}gpa{iAeYd^BZs>%8 z)e5=x0h#rP_mbs`1&~0K-|X<_wR;#Qce9%;K7qxqLpi_i8@;v}az%~LcB1Jc*bKOB zVA_XYNZTlN-9>?k*q_BsL_hyJ{c83`herf>fPL-+=WV1SFH!qArZ*mvR3bB2j27>^ zW>eOsjlC%CO~w^$N0}lQ1-VGipT+FNK4Pc1OaiKR)65?Dn_5f}(@7e@_4h`!K;+#k zoUIW6zcv=5L_ScWq}HOw5>kE0YSJt%WdcTaeQOL*2bMe~ij1(-cf;NJJ3V$|AqU9g zN7(GNrgzi?e(cISYQY;g<=uker#OF=-}JCj@1S1is8XySyvFs}Jfje}VmPZujgs!W zj|K~~Sj+w8Hfm?8YMj|)YB6i3u!iNS6`LN)_NPUl--p%{fB1LPkIio$>6Fm@`PPz3 zh-Xzfd6AbtSDdT#CMXrdU2H*Gtk-rr04CS-b+Lwt%l*ws%V z_%&jiEHD53a6XLBc%VyBgr1P)84^>ra>6V=93|GivN^>0D+Vgj5hI)qa~ING3M9PX zkWFbt=YGTDRuu?Z+bTohlxr8~hHaG@ zptWVH>%|R6^>J^BQfS=70s3IY6xq2xJ|YBYD+YMFXLXGvUhSvhnMD5IUc=Xoj<01M zlN?KsH|=++M*ZRd9s4I(6GIZNEIdP4YKmV`f89uZm_`%@%mM0VKOdewQlJWB2I}vp z^bM9BX+X+dX3DN@^)EIaa55`z8_EyAMb1XtxsO_(H;(?Jgxs5s*I;Sshkj)%v)a4s zEsqPnbg^s{@jQV=l}t0J@ga19iu%x3oV zEwMD9``rJiBH)dKp1ZoUQ#$@$J;#TO4g{d2DupUT-e{5mNJ zZaTplIBvWLg!Li8Yw03JD$4)Gb;>R-uHnK9W<=(TFArz)zFY-_)2oC4#g%--%e4B> zk?v@_oO=~kXrCxi;e)U0h>>IW@4qA@)L~2&pf3jJRJ?`{*qc`59fKUUmwigIFSagP z;|GC9gzP)gE-B@!{-%^c8HIEa_OB# z2^S1kf^I)TXCxVc&!YZ@F6QsZE37+suMEwvUV!G^@cye7`((9n?9GN`!O&al`$WZH z=K5RNlwv^<2tS0gFqNjsX3;xHL7YgRW0-JuKJp#^iesT+Rn9IVWGZp)ln$M@VGRpE z_HnC?U-&SOy#Pf#x1(|0{Cq^u5rSnyYwcaVOSDKlO5_Iw2>ai2)c?N#K|V6h0S$@7 z{;_}feXgAn%As2<^E%;?D~%E9M|3OA#n)%UvuT&dA8kMK(JfAYs>tyNm+gU1GWs1@ z-L286$MHTjg>S7#MX}A5X0xVQ9s^bvq*kgLZ%^%i;g)b6wG^#g)HKOPt`wQm0lt~K zz3@Hpv4#ElsUec`HI=Gqf0tqIKb3+vIn#vJX{vIz`&^biiE8u{8SM5%-KFXkB2#tS z4OY7k2@Xo9Fk6PibedKktbGXQHl>v>YO0XE3cbF&4ZXd~_v)m@hrf1A2GBgbL0LYT zf7?2!rl%EXtk+Bulz#b|oG>oiIZcq>o6d-W)}5YNR_5w*8n;DGwsf`v>X(SsBp5gFu7~)$?VOhKmw~N}WW2nqMzb`>29x zu|9ue-mqHbdUmZJdb0#Ao|V}_WNhiCEzqrf{tR0KX!Vk-Ck(LR1fab5CNd-%beWqW zbw$Gp<N08)T3_LE>piK(P190EMzE z_9N{R^c|LzPVUicH$vmPk@>+Q#jG%)?2DZPZB)}=NEiJVp93^L0AS}nhHv_8AH*aL z6BhbN=>Si9XwZ=Y{<7`xkAy0@GrnsfCMefDvVpYno5>keefr%~gE_4Ml!g1gB#M0r zjKWdEHsYeoq0Myc{Pfi6-6ugFswqQmlXE4m!d}Ux6|2AboN{bTIWLs1E5GFk+Ax~5(QEgA<}OpSLgmHC_bs}H`7!WPcD~_=}Kqs z6}uitr_c(NP~SGPaegNyh>H8BUhr}r-eJ$WOR^{Msx+sG|6xX5j7j*mJ2d_Qnv(7} zed_oG6fG2(z};}W_Ck60=TW{$Xz#W-Ml^)X-Z4-tYUV?8+xokf>8AoL9WUxUuR3_~1KDPZVPK4UO>N zPceZTX z<{v2A<&EjCYl@N5g_fw|mnrhXHo3;rZIwigw+Y`#b{3 zQan_tfIMIwz3x;q!pN0R%4ntN_AbUrEZ@x&@VyDlv3==u1r_nfvX>aH2}|+z=Qm{U zEkg{fAd&i2y7E#rm)`*B>yu5_ia+TDygViKk@+Tr2l(vJp+%;jrKn$AyuRsu(|H*; zUSn!j;r!Xc7d$sEW`)u32xld@=ym%6{P$=@Vp_dFoAf;@gbYoLB8O%<<$SE{>*=5m z?pAp;wz$PEcgZmGH)o|({({8MxipVAl(%1OLH#OIw-jgOCbDbu7lr@)t!faL)!_w9 zyZ7L;F5QN09!yqim2`H|>zf8R^EPb@foA*Jv)t0dKhZLB^0(MqzmW2v?PPKXu6gv$JLPi5_0E0S)R^>iUiI(?=%>5PB-tI z-;pojANiUQ;NLGYk;RhYAG z8|a>BT1lWt@`Fxowz;%nXm-tgpt|1~xEa4lQnub_DXI*a7Dp%yDY?TNIO};W?gw*1 zJj7Tm0U-!I@OBu~Du!cKFedZ2bV}ShxLqQJsK_*s3YF|96t4Jd{>Wb$s;gF6xwE!svaa@)d-$$&@=F(3<(~vP$s&RV zR5t6T0A;?cG1upDqW z`A^)J3wDtimQ7r}wxeY6_}B~#V*gK=w8n{`qo0!q%kApMR(s3K>w$ z;+*{DY`lFcy5@2KpK`}$kl2i-{HECyLyOP7=@@ZG2=>RYbeLX8FRksnc~y3#(t#7^ z9slQwu3Lu6{mIe3&5rIV9|g!e)AW1PeHmLJ2hNjI5)%26bP(*e-2vS?e)hrY@0ftuGXoWuxOXleP;NJ5H}Wbz>2~Rzc@IxG zUPrz3dfKp`5lbz5RsIiOz7}mAdz?w7_i!jX%{OKiT(>>Kyy+{K?0pLN@{hprW^O&& z_RshF(e*&kkh`#43{qi+LljSV~yA;Exdmd9i=NicDPz|VB#^l!L zW*$9So8hA>TD0dN-%6#57emQdT?NkKN&&d?)Pz)~jTfC%@)GLxyzLH`#j#DTDME|| zqrC^5!rgzJc3b?90`!vb&`GX^>=W-N48$+fX7HgCf`lj~2FXF*>9oyV07_6Nedp>% z4@QCk(B-GKbUt}{K_GUzSdhEC)8cbc4ip%kH$!c$$6}1lXRp9IMu1>d9W3Xwh$hdq zd%?d2vB__qDKnGQ$t(0>)6|;?iVn>^L($*X}&ej@Xq9%!hQd|?%FDPN*lw?M5ZT`@E#h}hn4}g+l*4GT@w=3J z*|iZ8vSl%uHH56gcrYMy#lWRDHL@7oF_o{jZFcA{Bd|~PEiD5av7FYz)(kiX*?Xk> zIO2q}2gmwm&JA>o>_PHU-*?q*T+4D#Z zTR=K-i=nmf3!$xN8FgI&9)@3Uz&^t;$9F|CyUiDGq{D!PX5SPQXrj`$Js&K#t!Mlu@M%~lcKBXIZ?yWj9f~S`LA)66pW?dKuCnO&P}@F!!{qT& zfcuUUZk^8yxmdGO9Q40e1+2UsE7$oD)+XxKKU4>;#jbZ|Kw^#0?KF?iw7lZL^#}dC z#_|Nh-u3-fpMcdyw2Z}%gYj?a!A&fp7@_r30!Mdx-fDr#zJl^CZf%_o+pkP^8`acc#a2Tv{rw&bPRGV?yMz3@Pfns*cq|N?DyBBqk3d6iw0~*w9JN*Ljnn zudkWj4#~9WiEgKa-~Z@*YEdOUJ#TdTn-;Crn8x~dn}f_N`;Uu1$$!(NozYnT6HY%& zeyf~dk6MDls&1!qAJj8u)mUu51qyKHN6zC$zEU()119X6onK#|!#>h{@jM&N122?3 z)V@>?mUVfjpZ-;d^G{UKx9z*=xzk>hK*Rv`*R81vW4?=DiNoMq*EqGg3djeFbP%nr zTxGu-D}ar@sbPC}pJIXV$1+3SA=}J;*X@=h6oNSpelpks2aH*mpi{{@U*mq;=a|TJ z7Q3FC>J%7L*8?`?@abPyoq;2=uqbqg(Da+U$qxWXUFz!Lv zsWu>0`-hwKUkVdx&SPw~)4OADAsAGi+GIY#*!1$-GndnzG=b!;KH`Buaz)=-6raXDG)?3Z}UguRB3!*bcACC zD)FYxmf3C32^Cl144`t)B-Vodn7XC%70H;<28}T9M#CPh4)@WDR!tAD?5uoTEB~o3 zQvf8y!PbvavJ~=A9-;VRxeVt&rM~#}%86IB#-D})pgvLQx*rR7bZxce(5m^h$-3sb zJ}mEmq-}Q6>?~BX3#t)LW_dFY^)xA2F^aIk%?FeTP`lf-UmPuLnvD9U31WtD&iqZA zFb->&Yk9shm_b)J2E?S$!$v#x1lr3xS^>@u2HZ*Hw{igI|J=A1u}`&pftz&zKpa6^ zCzl}Avpq4Z*Z+;mm3^yZ3asd?o-k>q@qx>fRK zd$ivr$oSE626me^Ge8&e-l7j{kh1;G);5QcS}Dz)(e0MI?YuKv^@~I)a^&d^$U8lL zU@6x&gPs4Fp>C&BDn_rSvoA#{s}bVu?8iX=vRqV&&W1i>V4tU_T0Z_mkVUz(A%7hq z=-;gnnCBs7zaT>}oNuUOUjB|BJtS7!fO@iDy}jc7!H6X6jeV~vxM<&-> zQW3(YgX$vjE3T>x3MV&MXUR6CbV;|Kb*U`IWqoIKvnYA9Lk!&7rFUzJcM&zCt;4ec z9fihem(TTyS6P)Bepif;28x+QU$Tok`KSE2fTB!02WRWl)07Ly`0S?OF!@QmCce;>>z`rT08@qn7Zp|R<(2%HU)R0YU$SO0G9s%UFBL#F)xm4gb`Xt~-N zKAi$`!KIQrQIqOU<;y^?2X_#$!#zpi@jTv;rtN$a!I;RxhfuApxm2CSXqINC(nOYk z?c3zj%@390AFn;C(EJh_=n=yV$Qi>`rUAO`zm%I4S~rxf+bSDa#wq~!J@SQ7NA}GI zDaXI_&%uL9Ni7Lm<2l%D1H(vfXrAHX>z1@R`Mx`$41@@|_vaM%Z<7jJS_P9Ecqeu+ zlZIqbf;uW#enA`iz$|lLK3l&aUNS3(bxl#yHvoB7J_3s$5>#uaUY1r%O72^G`<}tv zH0p~ZYG&_V%k~gZIEc&seqbD4gNU85Yxe9HfFG!?MGXP3nuO{WU0)Q~l@Y#$soeIWz4`@sBNdkT zOE~={?175ogrJDK*T(F^3@J|PY83!inK!7A;xgH-+*O`R7lSX6U@_0`3FHISa% zpRXCyoznl0n?*Dr;lb*(O4^t2d17nk$Oqr%bC#)|P?1_XLnbzr$+9=JtS`qd;99eX-(|`|T#c$Q6iTcO^Eh7&HXcnvedsUtDD&N=Q!b_~PpG$&~-!{NHF z?tDmnX#5&Lp*HgL2h7mKmuXpF60o^m=rPmF(b7NMzb*DIc zM6EF*4}W`jT^ILX)Wo`P8MF7AVDyj<8bp4Nn4ps1UL0C{Y(}$H;`DZ0{)>Sz63Of? z40OYytCG3M+*UntbBlL&I>h}Y%d)%^LXmWG=W4x-<@h; zIl#bf(Yb1D4RJZdgIA@UhogOJMTSR&N5y)c?8B`W`Sobg`sQytBY~7+4oln}k6+Oc zOlz<;q8<6hsVVQ!4nr~1*9tr7#z3!R90+UQROAh9CB8y%A2B1$TOOy>D>r=0yVRzw zyv#+&5V3T8in@Qo%2f=01+OXq@`){?(P3gUY8L^T@qaVWv?6(^)OLq-qZ|A5O`W!l z$UB5}ue6FM$$xp%!5{-`{Q~ zVhO}Ci|dAMHIuqm)5=%G=k6$`e=e}oYF!Xn1VU3ugIwfd1S`h_W z>v_j4d^FsRocjPSIV`LG@>7{X1uNxBn<;1Y1SAdfN}Gtx<2sk-L{(j55XYw@w^rq{ zm7sb40&7E@=2!5`uzJcX;v+`*+vT25h@L}j;I_uW!^@^?y1*a}He7 zol#;T?+qW=i)Vjy4O)^vuF=n2$Pz*=dg@j7|0J;qG$#tU8`fd0*4E1@ERff)LJ4OX z=>6Z>8*^1?!!s9oNOkCZ2a{*qe8)bY*~R=9?4MU_6{CY%0Ps=ub@HF>LqS^zS9I=H z&_6t)IxePRCNuj!g{SI2{lU1*P~eKQgkR=#VHe^Oc&Q1IW2VNlC}i7j#Odk5wk`Dk zX!^>ysGc`ox@+kMmy!mh8(EM>V(FCb?nZ>AO97=DmRhfY%z8x8n`Q#BO+d1 zT${EOU5Oi%Bu~Gx7A<-?`&Rw{5XcJ)mOu2Q1@tPwP8mf7nssh%#C+17Z~%5gV>1TJ z@-H8XWEWRZTEhu|I}?6Oj)|AD>^$Ln<={#U2vfLFL7uUdo=;l2h9-ESQ>mdb=sKGl zxrXMb0?bRFGlT}q2LppR!?TMh!}0E;=|foiI#q_LzCnyFEQybZq-ra^gOrmbCZ~}4 zt4^QU!6w_1EGBIOA$oq8FkO@*;|UD<1wnMyp@kU7IuV| zb`gqLO}oTApfCxaMrF3xaIasZV8#gAp7YPBrFSgzm41yZr(%F@*kx>ciR&n_Y$0xgg z>HpgkbB~@BMOsmA`*G(B@x8m)zwa9y?i5zDnwj?H_Bf>?Jl<^gn23*|kO4*A% z5k{@AXJL8t@pdm@nC_8_SA_hcuqLnD6c%1*kJXc9xp#O!SV#}mMBd+hEZ1XaUWzF2 zdh%14BjqSycaC`d<0h>1{p~LhbiXs~N0*btT+cZ^NelVRjhmW=gr4iutMZ@BXhb+F z8n-!mm;=mKwee;&pIR7eNy>i9aqIoJ%6GAz0jJPVT7_1w>90pgl#M4dhrwJxh(T-6 zLud8oa7A|Tfa%1fD2DV6AX_$XU!C#QaHt$hpJQ?XD8@R} z+PK%v%kY3fsgSC^*A;^>Y42O#>XQ)uM7&f~SPuUC;-=U)&~{8D!J3DApck2hiATH` z0^G0%qH@aw!&ELZQSSeH$pHVwI$4;x{$0y;G6g>rpa%WCl-KoAwl3o_1sQ%~e_Qi+ zA&TX=f~@<>ZhG(cBOY`^~;^q2jA?A;oRYI)R!X%oAqJZS)Ya`T1=psD>dpxXTy zYS2BsXC&!caTgMOyKSQjO1EfSMdTkcsMv+uZ~xj_d+Y|Kum8;ik3z=Rs;ho|cDHAZ zIgIPUih!_O%FcJHm_V#4MHiMKHJ=^%47xNN zKcq~9gx=E=*n>27lki^!B`&;R>xg{z)+;23z$SvTV?YQv&eS48#nD8g7XHQO4xwGt zr&8`%qzrX0u?FUj`W6ayM7Cdep7Z^>>du9n_&tju#lxuHm0NyqOmbzH{yY<}oA>L| z=i{8qn|dc;XZA`9;&Q$pMbL>rUJPyc)?lDTBQrWB5~DOT``TLkx`>$ieFe0AOOj6! z@q32bj}5HWsyXi0!9`XZ_sQojhuxe{f5M(o4+Ax>JesPRmFAhxtMc+*FNDt{vb?_Y zspCV6^AKS~T~pdI3#lb~t{HuZOW){drkWGEnhq*OtRl1=ilgG%6C3?k(NOWl=ZSca zO2mC8rPsGqeG-uwATM!PcuJ^oM&edry>GuJ#_qU|I1MwzoX@Ia1QliJdd}DFktr})sfStrkrK7TS zDxil@UJolQzyd|bOj7!y)FLmX4%*Y}#n|ZkE54FtAxD7N)o;sej^^LpU$a7j3vIyH zPXaLVKC(uxwHy=o5!%dd>w@dI>c{6_5?HU-!M+0nr+yZ@eCm{V{jVn=#iPEDLVaVK z<%V7ZNR2$e=b;BWb`(i(S?E0V|I^<)z-7jpP^@u^JCDMAt|(c-O{G&08cM(G$lf-s zD}p`+x`*`~7+nyZ4u9&yV+i#YoUDpO)C}s}1~(|i9dMjQGuK8@~Qc})_)cwu)qG$881hn2={%|r`PZ9?weB#zB)en=?46#QNUpF z?uYl$(P7t5)b&z*9*f^z+2PEMnF^NZv5i{kT(C>QN&lY$uAkS5oKYrGjbx>wm&fh|YP_BQTddky z|B-)kFctZkyLBkyR4PL(L~&))5jbvP`+94`uTX$^{tu&HM9lLG#vf@1qRFVp|6QJhBnd9c%uNlPzy^Z zplj*IVOJx{Pp~EcE4KJOVnbLKrTzPjM9}Sm7xcTkI@IeE!th^j}A+v`Y%dfC(le)7wuWpzwtWps~Tmby|BRmXj-gasdD+Z z^Bk%X8QPCTCJ>BJxjzl5SwD||2g#{1wf+Mx#oSR?@oB$3d#Y&ges16(URacsp zuPy5k0 z%KWQ{tFUNPCufl+*;m~UJ#0>>ruW{X7I&TZ+GqJ$2|=SyKqa8k&#$hIB-nGY**Bt3kj5Ly}tYvSg zgPJ^`QkHca@dn;X;W(;tNO zG9^0(t$OED13ONeORt*Df#96~i`i!?3u6bK>N{PCCJC>Ea?!hx4V5of2CE3NcYjL0 z@@xsK(P)^;(fC;sE`4%(_~CqIA>tO9uj+39_G1hEFOu#TG`L+8SDYZ}{F*`ki6hb0 zigvM}+8nuC8Qsdw8uhH{+frG{$d@ArE%lbSPBg+vertyy>$a-jSKlcc#n-FS9I#+- z;Icc|{4NDA2{CBqh(FNcrRfAL^qln6eA^dTRZ%wmo8fWHmdE#9X)2)Bl||)hJ}x+c zD)2EMff)~|jY-41o+1!=7T)?Tn_0Y|tX3kNE8*vb+cnqkl%jk2Py|!JYu$&_8T{BE zp%mB{s)8}Bc(E+XuqfjYBY zcP8)cT$BmJ&p3{aH;&7?G8V@;aANRtqy46L^f*5$5 zHc}V4Ya3OjPL$4OB4~V&qyEqQlpa-zb!sLAIIXMmG8H4d#y&71vz;z(1YdrWpm*3z zOQ$Au3Dm;U?v@AcH3LNoe}%ivWIK2sP+1AJXB}gPI;%E3 z#SZ=!ntwAcYpqrGw`;WCGv=Vqe7IZhAUUzEX5jt4ah{a>*&+4MilAQ6iwc1ztN4dy zsfq`2p_!8O3ReL)QQ7EBbVaY@`z7EnCL)+N{s5SqejUM0M~1Z+D%Of${suk$kd@T; zi6uyZOjLsC{PD(f^!5%1iyOuK+o23uO^*>6LvFLOc-d?fCf&Q83*mNsJh{_Pc1Vh% z_q!^3&28B=ou~a=mpr+!WG?kbD)RxfN;$ll0an{0>QTdDn*v8$kp`B`X=NGGzmY@b z6+0sMT~aU40oF-zSwi1NuVL7r@j1~cd0QepPHV9SncE^lVd6>*86wQxiNQ~U8BUuPCzHRGTxNlEIj)D-?QqPdaCc$J% z=7IF|{yS5mq|}0?@`r<{lrs-$#9c0C3(ZJYknyPXJ`R0l>!9D*FVXFZ+#0H+Y2t%0 z+8j#aq~880cAFKsh1K)844B^okuiHb;v<7Fv5M@CFQ0q+bzIU>u$irkppN!{-{>Ra z+Z&vz_@<4%qvLJFLgqYSg4h>dK;ws!r!I8GVK^|`8fuc+=%FqcHJG&;2}DMU*CGP` zyJ9Gu`y<&g_(HDTY;oQgrcnlp*l;S8d@oWNA)PYXl}I`HuT$}7dx(h;_*?WsW9RT0 zmag_4j(<4Y?z%^QQ{<)w-MMRJK8?d*IA9eX%V%+pIhNtIQ;5fxTVmDq@M3^bOW+$ zteGX^ZL-wM?*1Ov@wYg=l`iXSC~`d99;>--m#P~Pea1B!%soc)h4VCl_Bo>x4GH!| zI+UDn@3yRGv)eP@ugrJ&rVe!?-7ep#L4{5hZBqQ3$r~A>7QtYF--J@mc|;27iN)-r zV=OoWAF1#hI>#zxas_{JihU!-ns4gmEmFTzeK*iEAs6Cmu(=|lV^oNwU$frg-yNOV z;k@?efCVtK=rs~l4$FVuJFdIV$_(gL?u$%A2K5#oR?6kjADQ66T<#7-u4Wgh?+*EwJ{caM5wpaf$)JwZ_a(|pzMR@1(QF4YN|7Cnn$CHik#WILK z6~{l22umL}(c*CzZNGKijQ~y@tbUSd) z-O=J9r2!S9QmW4Dgst&9{s_X|+WamR9Inv!d`bNu?dP5rImjtX;0H0f7KYeMO|8%w zrk`C#28g@zYSKLOBI?(F8O5Swqqb7+vtR|kgR!OWcv2zk(GRND zhD{f=f0#sX?NMX;+RlBd3kxP$qVjFA_?hxfrCfSm2yVFE!>vDLASPedB|gtDV!h!~ z_E;f=X=A)OOLup#hDc^3!RNQuA-X~jxBE-wKmN#hvc8k% zt?ciTgPvPLN||RUAZ61F)nz36ca@z|cuuM&emtO&=v~CAu+{O$nHihm z?X#KhoEgn%L+<4|g|61TKOELZ?a^bTqwDpLZ8*qzdRq^gF@{o@NEW`U{lPV(8o>Os zvRltG(s%dLi3F`9<5kg$vYC7$vH+wK^>u;Sroa=$mYv;+NTFXbS35&U*4gs8h~bf1|?I3SjE!v}THL{LZXNfCU#IWjFoN#DydcE(KGotU+_2#ppDXg{_}}^2cIvUnc*8%#|GxRox9>&J2&*EYIlvr5YGr{zG-SU}xqYn)DQCn8dm<<1trGHMa z>rs-GH%ynJFL^L1qYn+!$~w|_^^smVS3TA#2uTeWGsR%Xy}x|O$_Gk@f`tMnH1cG& zod0@fz@H`U@|3TX*>s$z4m7VDR%CgG@()7cy>-wF)nlT8fj2?%HUmfEqzV^?_&j07(W7 zybi)PEMOny(d{d?a5{>IuoP(OYRtrhzDDhm{IQVD!Fm;I*Xj(&q_M;j~W!PG6?mJ0bb0TGgR? z9zJ&g<$f%QW{2j{M_>At&b@s|sdqm)-nm*!t-iT3f+JombTKqCCbRX4%%c~*_Bc^F_bkxc!Y4COHaSXrqt{Se zZG`)B>cXF#_+=3@u#a>7#?X~l-5*bHgYG}z;DPKcI#$Ec=FvM$pNF9x7E6+^C5^k~ z(({yC^_hYNzr8`^=VB^K91H5hdAsXh)=DUJGV1Gxk-l`=I8rtF>4R9Sf%brMJa{;O zRe_s-LTGQaIwzNZFhv@JPXep%BtAuIB#iHaF9pC4GJ66~VwGauWAcb+Kp*b*5RWz< z9@D}vx1HdBW$ZgwGjAeLeTgvl+mFA}fX&5_{3wphTj9zie!VlCm@mp8G0Kcc8{~BB z`Z2rP2<7Au^ww{BJpnG>XxmzEvSX(ic%&>0<2E<&?}k1ym$|P2T2|KufkqIvD$*V6 zshKAhpidRVZFX}*j2hfWpVa(>L#+^K);Z~oSc|P0Eo6IEwORRG;J2~Cr6G77>--`w zMiwC*mu`GA$+IzREed|Ht(NzXg=0pqJ=#wxdtr-4?A1I*LGH19O{9~3vQ`~4P-i#; zn-d_(qeLFgR}I&~f{F0;%@XsZisA7Vd1qvvY;(2eS|BX&Z`Rx8h(>?LF8h+g{7Puf z+vAxY%meH4BLp^Ltz1QWfTO*q%Mj!N$VegF_ha|SIX9a6^T0HfvF!m^=9EBKf*;8D zJmk@nF1xHi{pO&ec@Wt14V+l`Oa0|!FJ=%)lD35jII=c1$Q<?JRK6I2=W-|l^4^J9J$jIEQ8{{wNv|*c*}3?=-D|_qvLB`d$G14 z4t&8f>Om!UZe^=GB5i|qT@1Nb1{rGAl%AAA^}&~mxg}==d_n+J8IBj63r-c^i%uz@ za{{_7L1NE~C;fj1NJf4=#Iz0vf#kS>wLQMaZ{RaF+b7{uf5HL*I~Q6z9M7wG#$P{c zsD{#ntk*&KSb<}4)dRV2;oG^$4Rv@vX^SkDPaIblvdw7$ z{KY1}8*<d!6{O}t5pfnx6_F+ZM zD%!%}@`%Vkf|!t&z&^n3i@YU>8e+J4hn9z?0~zN4HoJAWU%!zdKAZ>oq(Z`gBY%1s zD^t7lKtJ6KO%z{XZKDNif+E;}MObg(uHeg-+!PlQ;Nl9ff=FR&;wVQSZUsf!p#eUb zfk;NswrIaq$>HzHYA&`XLmwAHUnY#Z0h?(Y#w3_D%*9@+>!2$71qjrivU~T$J0T|f zVG*{z9Fd!G5;kSLziX76I6E0BoUhVYj#MA-9oLP(%wYXV zjAyS9Z1^d5mRFz_8effMKvh)|xA?^!%~#0pkgUSL&%DtABw^tK(! zoN{@Zvs5mx4brB}z{YG_B*(Ro`qE%bX5tE~Nf%4j66=zGTWRkz2;ZjCu(pZLK?d=0&}S?H2{@$9ZW$ zxjAHLpYxW*%EX@j=h#Q^B`)+f?3?6yqAGRHZ}aFue)6lYhI2HTk6~lB-t0YZdEVE; z3?@?S++70mX41nyTCz=J?%n@E6xARLP!&p^N2zqv1(iz==!f=~s_{e*yu~?iRJLOQ ze6j!!!>_q>zuD(Q@_|6Yz||QUW$@-3xKh(~1ard50WIK@4p?4OH&m7zI8gaB-7>ct z2?EOkLZ`WG+Y6e81ROs@AE}M$7=~ScB~M>C>*k9_o0|VF_bsF>iMvht`dp-c_?CqL zIiA!jC*VET#l3`P&eM%sCgPD0ky9b3jC6Nkt)OMP1$M) zsl!Mk=W5~jjO}$_?QML#iT#fxS=0VMp4JC5r!Vyy29pQnb>WLPakqA%n&Cdrr~@nw zKgCsOTk3)Xjo>uaaXH_98h?(NR9n=|QKmfDrib3j5|`SI#MFC?=$%YcSablzGQN*% z%qix5`frCZvgVR{=f^Nfk&8Q_N(A%35IZO@P|!Aj_w@9Nf%6}JnGNaa!wjhOUl{bz zID}nfQs>MW82I->kCW-9JikDU3IQ1wAUnf)i}0t<t!kGlj5Ds`AQtsSKVO3GgWlY3>OB)|J13793~IGD<;raI%_OJQN<5 z!T#N&qoPPUMry;D?|0KY{9G0!xtAwX_E6^fx;=QkcM0k7Dl0+;D~v+JDS)b=f<}k; z8bj&a^qEWZ+i+PIM0&D++sj7W+L5^2x!<#H}cKN-!>hYlcf*wzgi)pIo_a@yzKh;v_$W~&sbv!jfFsdH8 z;Wl^NXY8^KZ(`CmM0>+mvi2=l%Vp@noTANFdT3`wIo!DydofFMifuiZ2~+Whit4KI znDXKDCno)|pqvv)-yp*-z`V6I*38;9dB)0Q!8sGT|J3Oq2Hjl|uM%DR-2+woYHjHB zQq1iew-RBx)mc$?)O7mRq6S~;zyWF2A**-3PHcRAXfgYPn?jdrVWiL0lr1Za6ukKV zE`JC$CNz^p1d}e#DKw^bxyKI5xa2~Bihnw@-Fpkap^u~ubYuj;Ox4JHj zf~LAyH45TY{QFau8}E@`< zMiyu1%dPG5#RPM<|2Mk&!Z+aV>rgp-$%ppY)AamD%qivICV`a+BCL&nov*S~1SU?) zE;&3|J8_JA6rbd0-#zl)U=C>wst_Ol5;`-H73cB4s5EBP3Yxx}JslCkjkz{mo8Mc4 zb})rZYio>wj@`oyhHJ#TPd+wH>*(s_NzO4%GU3GpD6Nc2`8W0$dHOZ5X`K`o6zYQC zwoA{zBxH7jocy#oP-9Ce^r5y5NcCnP{rzmg2Ot>L_0*rlFQqaYy^=(vAjI^Kkb7sv z*ry_6=t*$mW*dBl8KY8*(8>Bkk;K{P3HHF1%kd%g#fl760xy5h{r6J)dra5g_hSPm z5l<4-HtWe`k5XGtF^|_6$(ukuo4vn7Bqb4ue=IMeh{Yyk7~wb9TR}5XtWMj^n!FyE6y&uJSVwEXy6TtvYkKRhF67A z-pHoURY#`lAr2by?n#&L{Ff&zt+ohgd~saX@L*rMjp7rHs(68OFGe3J2q#(a-MD~# z$29-K9|$63`@jltkex;%^jr{&mtu+KL15fD_d@!ZK!c| zuxS4lEwST5JrT=MYHSm*_Pp>(d|S=s=Qq|F)@|92n@{ij{Yyt)IEHSLvV@1vo|RYkIr+Z!l7&S>J!+uW|E)7WplhYC^~LT_?W|De z{*VYt8VRrg?rJ(0j4F`6>p^k}x8vnQ86r#{JdmihB_812XC&B=Kxfo396)$CYZfwX z1WS_=_paU0s9E1NZ-5R=zCoBbObd12b-2Vnw@-h7#X6r;oMKgHR7NssK*i!9B7HFC z#c$HkZprp{p)?xd;c1XCfC6|7iX_QR`6b4eH~13RTnqW|9{to?Yka?GDC$5MaMKPU z(q*f90^lQtz1g`{kO4a>obqWGW=>=zf+`-7*n9W}^z8*WXF}~EmO3dr7-#@G0U*s= z0iRWUkAQYZSaA&;e0he3Mop7}f)nnf1i%g>IBrwj=cB|xA!DXVh8BJYJZZ>A?KY)8 zyf?$QFWy?(R(uj$3N7Q;Q-uVigkG?;Y&JW2It#dhJo=7XV%9h zk}X`o;D|GYei-=TO@s7%Z)WY2OU_*V=oDPZz_q}|22 z2eR}}Pn|EJi<-|un=pgdJIES4kip+9vamE;=xBx(=9yMw;1YzHuK*eFIp)HTEANsv`Y{7K9KW)|qFJS(l zJ02|x!p9G!5fWP9+J=?erWnrHHo<-OeJZgs)jb4(=LzG&OR~)BUCYa_LZ-98{$_4- zE2K$$Eb+m%d<%#Od+ob5h13x_PQe))0Ni9JC)Zo%gCxjKO%(rpF%rXU`J>805Qe~L z6zT-aFBccNyxqPkwWz-f{_4k^Z=-(-TdKy^NJ6JYQ3DQ1L)8u5)UkooY;1mnhMUc= zec`^912ymiwOHXJwOP7+^sZAHrm+2PgI)z!a9DW!$Mx6U6W#GXY^8*qIrud=0f6&Kgt~GVQQmN9SOG& zfcEgBsH3_F{4hR=NNTqXvAD-j;(p^Uj8__(OQCNgqS5_Rd!K=-m2BonQ z>DRpXPxTqw8*=0Jd@BI0x^>)6ouQZECB;L2;;V!-Lj}@H!s9G(~`-& zdgt_nvdZxBN)a;TEi+of=F z=0o9=EjZV3X&Dl5PJPZg`9yT zSaq3;v9xOl6J2Q?vZFuU)#oR=1!;Qn(}*#1w9RK6k$uvRqEo)*&#pl<;gdvIiWa^$ z3!fUZ(q;Go1?T?Bgk?65jU=m6*myCwac^hmXKZ`&H_3N1zc_KTcpas3vI%8TkYQaC z50%yy`S@EXX|uQ+qhzv0Ax!7>u{ihHmWIN4^$mrseaQoIGn>&ihp)WrA1u*^a0h3i zmGyDp*ELogj{GLk)=za=*57(o@>f{9Ys#@q1B?-=x&u|#%$_OJR(QVX`LxNk!SA+z zm6mEV%_~3oV8#?r2df5QZ~|&hgxVHKa>G68_d-^vsYo5p@ICy-(3_T{K4N0c`>j1G_Y6} zn2wF7GLPM2nv~`shlE><+12@S^WE7SBLMD}JgM!sG5X!uU-dw8IWCQBBEz#7NG6e4VR%IA1*So*&3?QahUkwed)|lQy8$6Jk;ctG&Z^z>Qp)@!F z5=M0g>C+rF{H6cW;Ev6uMwF{dN*<;9hAkytn*f%rKzlz-=Pt5fOl!sfNej?72@=E? z5p)y;G6sCIN@+iJBlo!#w83ATrpVAspMU*=NdG34Dx)ZAyws(MdSK{G?*VPn=RO^B zuLd#{Xl{8!!WzUPfsGl(2EOEnF$w^iDfZg^1=?zxnkOjh(uxe=;bri1abZEorp+VV zo@(IIQW+d*2tR#{GA7CH@m|BkzHDT=sl8kBp#Yd*tgluT1KsY!lN0$Qy((RayUf*iF_V zhd!sTk^(Z^o8afl3soWlS+Q$Gp-`j-N)&cW<>|rZc6d$8maP|zD#RLS zye*yU%vYkqnS}9)xz&Zug7GH$68m!L0yEgtc?i^_PHnorLis<(;gDV>f`p7P_?wcwN?1HWWTw)D&%Qc!~yV zhI&*%Z6DA9%jTftAw0vM0?>Ev-!5|(Cx1e3VNbdsF|v#U;fUW_iAeMK=A`*N1Sjw; zoKG+_C&8{mo-sywEhLy`NzyYf&eY@6dea|7o=_ef1?}>TA8*ACF3H?p$Py;?M{Z~t zJZL`6zF8ozJW4t$ZyXFjpGh1a(muNEho)j=k2*1+pr)cDWc+Q4>v569mMl)*-^lkh zSP#C1Gw5G#X#X&wxnapX0}cQ(?C;<+s1$}lCez?C^wugD9nEUk=g8{4{Vi{;=Ggd= zkuTccWO-I#5k z?#(Pq^EP3u*L>TrXZ@!nkv{%=HDrS!JgK|Bg+dn|4?kOMOp>%TkK3>8@QosC_IqHO ztPml|>r{URy-kKj6rpk-pHKwK<1(DqK}mvzfhLD)aXUm8Ze-xk;`U{LvFt+_>a<-A z;p3v@3c!AsOV^^pUr)`*{w!$fIZ8pN2KsPmi?46X*?n|Hd52<9sbRPlNRBrf{fydr z`%B1TVXM-NiD5)ShY;q~)l$3UVU^Bvabbj5V3`=*%0X_`Yih~V6?Xr|`N$PDgG;%# z`%4Dv+1to3K^Xmjii3qp$dc`o2p3 zZxC?{^V-MRN>(rR!EbL4JOdVQ{4P$7ZyN5T7o%PnIXXbqT?Qtqs=2DH$Z2vDyB7O3 z^L8%WTMG!m9Bmi5Gq!|jB}1prW~HBq-P7kgW<8G4?GxR(ZH;<<{0pLJhw`?p#dfv+ zMERx9fRV!nCT5pC`b^)XA4$RC%TN5fRfzl&3_Y4yTxv*s4fqv#Uc8Wniw6*>BqZuk z&G1wJwJa=|7Fkil)~3kNPZD#1BKbeV{IpP3)FTR2_Q|h*w5m#F7g(a>*2#Dw2_jeBl6_ zu?N$)o^MwdVwkbwTXi!s-wP!LNmymtL-#np-3Nx zWH`gouC`?wznCXce}co#g`mxGUd?~Y38y#<(M$#IWn&kein994J0YI#C35$q`I-=7#Q z0J+7G-{i%GOZ|PH>>m-0D#`ii8Qd`%ASUY%OjfVUfA^Q9UANk*l8#K89YdmkcIgvS8)LoiwTI8>j@09wC-(s;*wpy`$VUKwBL!OobQ zDn3V)n?=^K8e_#0T$HLqR))CeZs#Fh-t`!5AMHwj5RDi@N)wd?t%v5h+2K8-uh<;yl1y9a76d^=@3jBuLtT;l>I{cg{S#GkY3F+#!5B% zCTgt%5VA%zGQQvFBMhiU7C^hP_wde0IM}Pw?1;Cd09_`aM^c4@iG9JLjQQ6|&}N9y z%=e(_m8g76&=pxmHsMf!=b0tn=2aY2>K&Iq8ZC>`DN0gPu0?Q|{}`op%M)oGlxxqV zfyp(LLvx@=5g5D*WmIbw%9n)gTs=b>=!&d`G$( zmfvY97QY3fiKy0$$d1$sTSbR=X13IXV>q9(Oag*8s#^09cFe zR6iTclbXNL*ssBPVl505Pa5|JHp?v`%_w|s5vs}4n|zZ3TN$_cV6dZ01AmoUM}Wz<`a)ccu7`74|KBd$wTP@H_~yokytPNsDcaUj=%Xox z&s~@Djm^1UD!Q~Pr|^fgwM=l%Xc%_wLk{BYt;d%o)Xw#)BZy1BcK+v{%XzcAy7 z{EuiTodCR!h8b(p1iwBy6{xljrZ59XVxO~i52Jr^L|Yi&AAr>KjoRA&0|1uWK~Y{g z(A2@gb3V|F32M@!u=n@a#;ungDQM5WL#`zpAoZs>gQ~Bli#LL3veR=bRc%iRY4!Cr zZ#u~8yHf7dEH|f&Wzf%a6DE!jKG#j1;4^1jQ(?vgo{{70QFC_cG)s%J) zFYaIb^QE>DJe1sW+F2xPTM+3E=4wY<&5q@HBiz_l&#)kw#(?W-v$+wRyV1`z`n&ol z?yE@dk+b;J`RKs;ZrOqO*u}{svv@-4^_1};(p6oPqBp5(J$MlS7_;_f74O_8#azW1 z3vuBK@NZ|Y^q#rt=bQ=lzmBN1CH%)Egr;^$ukMdKEP-Z<9wn%ZsR)&(#Yea@e)wRR zh|1~?Dh`^@%1$K&V}Au9ytxVR)Z{IKEegrETK6heNd7G;k5-RBhKEd*z_T zDJj*Lcz0y_3=TEEi0Vz2x6W$x1@g5F!?rQ5D3`^<>k)&!cZ9`SnzVu$FSQJx*E0Tk zA+sbIB_tA-Uhi|Qj;&ulebo)q6CwkhyybGk6(aVfv*M6KoU>c1%CQ)6M-4Ka?_3lz zpBD`}miqo2J`?56W`4THQuxcK(ktxhHw!c-fNPH*C1J!EHGzG4ZwYR6SKZ5=vj$PT zOrNIsk3t8G2TUB@5o75)lcK5U5~3lk)^be4cd3=>QpPRmp+6vT{wuybIgR`jf^?oX6GRVqZAFQXN9Vzzrbn744;*2Bg z9 z9*B>YkIDDZ$0J|mEhFIh-i1v8!}<&pmidy!f_UsontBty-%pZ*PgL`L@k#GyMQ~!@ zH{m-2Q#Roud_vB{0w?vh({J5Q{ju6%pJKg%e9Y?z?c)a?4vd(sZX4roe{!1MPb&|; z81hE%N14wb$x-p;b-pD=Novg4$pj4HXszhg--L*=w#Q!ZJ{K9E@&i(GtukO$MLrt! zE#+6-6kn#7#M<)y%P?!<{3^C}7eeH?h+F2ODOvY-Oq}b)L>f;I>W1R;N|? zCi%S~0V`xL3sZH$5`lUU155(E=%^|DkvxeBex)_MpeVXMUnC*E*L>{|kI7q)vaF6h zy;_EaPKuuPeyD6lv3AF!qP>&3$(Ppzc=z9&mO0;f2)n=&vV<)Hc+jvGN1WMJb}ye{ zyYodYr+*2E$ZeYb2uqN!^DWB1JusRsp?4K&Q`zfWi@(VgPlB+-M;lG9Q`4bj0^4Vq zM4wM=W)}!?#vJh<`x%n1tSYm_KDQR&UWi)q=KF;I%oA_BR&MBM57WbPpsqxmG$MN}#IXTj*NyV$| zqQ}VS=U&52M2r~vQfiLqV?-p;6yGeCdL)N!t;o^m3Q9RTPEm_t`vR-=p9L&A2%z*0 zniWQQuj>{k5zc#$2>R^Zz}@8QbV3xW_@26~|KQsnMU)L3tX-IQhNf-ogmrR2D>(f*1CPJb#d*Y|9xH;-nm7Qc9vulfO&X?j;U zQv?4jO`1vpf5*TLqmTI=dCF<-r#kk#{{5l*&aUx zwT-hMZhH`-#e}FRyR&@okE&{IqP-O8FyU&^=|NEb?9$hMxU^*X9snV=8U5BCz_RpJ zB-8YV7H^sG8B5WVTp%mnZ7aKj9Sh4w=-=x#W9wfG9{CS3B-?6#{zGYk$H-0Le^2*A zr#87`R?yk5@BddsGH*_+{8*>(_gQ;|1rYg{Y-@GUDrWN=0T#=zm@+-)`)mmom+L2# zxY&c{CDn%JrE=fD!Wi2m_{49g>bzE7F!1_1IC%8dVXX9cSgLWVq$na;95X6D+I_ro zZUy5XO`FPjr_6ggAC~gh3R}qJZM+6{AI!0Q#eZgCW9(W23vV*f9XbYNIA_%j#4Co_*=*#tjwn$e=gDMc}((rn*} zVnxmWAxHas;hNJcH(i{SY?dfNd6G#pTq!Ha_^1Yb~ucExL71rEb zA9vny4zwJI+LB*5!#aG$@4gMp-l0FVKeIgQncqFuCjw_M^|G(Zv>M5?NSi8)JU0 zNgXc-O^Ny&K@SskhHB1AdWBEQbO)MAs{M6IA-yNTFVTXCa%RO(9Ouiec&#Zs*K(@X zPWw^5?oeWmEn$6A=e@*GSCVbdoEkfyg|}&TX_U3|^^<*clJMPNq&L36y8{}uR4!qu zBF#RdU&UB4`%60}Iq$FuLz&nAPf1rD5Y_X<-vxI^A0RDoASiLPf|5r!(xTK6(%q?d zv;u-ON-9z!A<`lTD4_@vqLL@5bSMo1zvuVIfAE&s-P!kMXJ$X2*(ay}VX4(49ct2) zT1}sNBtfA?Utiqh-*Whh-;p7(>kRpGg!-wrQvLwMgx1%%6f=Hbw!9K-w0LM-aP}-F zUy1GNvvq%vJ~0yeWi@&|U$xQBx-f8&S=BZb5`9+IYoBogg-U7*zxa^fJ%8*!vd(t4 z-`t2+DgWD28TMZhAOzaC55bH+$Y%|@*WpSJL<(`BG+`G^HtcB`#lBeV?sKBbfX=c* zI=l{c>%(f&Twmb#R_7D=Da-DzN7%&Xq-EjcU&}Fqf%HVH!0xLIFXNl({5BDpy_;*4 zgQgWl@`Qr|Sz!>e?dxeX*#BbV<^S zqzutZXcLOXsBO0#&SvaSK)|$Dss6>Tq;-&H0MdxA+=7w5@n>|Y>z_TUsvW$#6ny_E z%#VIDm*N8rdsD!zUOCoMC5MwWnHtXM`tMhgn8K*^-cI-csJSrf*JCltr?KrdMi|r( z<(R56PVw4_zvcLv7Qg(|_YKPu9NK#EW^b9J&VhR`Q1K z!yV6*{?{yMPN?z6PS1?bGa#CL6r}y6m#5EDix-1US^p*O`;XR?HoD~Qjc$CZZQ)uk)ovYtHr(=RG%7fD% z>%KR9)g#x*thkWsnl=D_5|1dn6k{BBS3hqXF6ST#^qe~bm-v#lHzP2i3Zbb94}VO# z<*L`kyt)1BLUHybvc;1Ed6~_@)l=>`jpJW`{tnzrCEQv}PpB`5tk`=rbFxY#WBs*z zR8tA$VEjyGud36~q-HIV%wS>>@wG3Idv~OCCi69s1S4%-6pwUcEHo96)ZV25qMPoX z-`yYQekIAt^7mX*fM>6qvSt*=cAHZuf4$g80H4fR%k`{m=<8W91apOz4m9tb!!d{5 zE(o|ke_2WPCH!R}LW;oDHr8hD;#1uR`S;u^f@C}C7w*%i4&M*60>k&`>ze8pKG{dK zLc0`6tfm|{>9$P{1fxKt!C7Rpgh~inDQir~1$eF4` z;B5V4NlioC7DlDFCsXtO53F}{a!Hp3R|C0ED1KWIuZi{>q^GW2^nG~!m6l>$DKin!IR$VYZusQ}5$Ir?Bd?%(huet~!!;esa zik)HdQPDlRmnxhAMnwhNgybMGHO1!L?`%M1N;tEbWpAtB=Uwm8q|@H`vzEwM2+n3D zgJrjuCT^BOK^9khmjBL*={8Ut2LdKeG<;d?uAk8H%E&b{rx@now$2H?85%Fk5`6^1 ztil-d=s7c{#0fve!g9dDv_lBDXSVl%tq1Kz*4l&ZY_B;@o-@8q;bzm8ELz>VIWs+k z{8ajecf1_l%4v0Q8AkZcHs}8hAWO-?3B{*q)T#cwsyvrf+=Rw>`zm-K+opiY*Ms4T z+5UusyO2qsHwgL(Vg>OXf`7u_jax}xi!yy0pgY3_Azo@O5~$+m2O%Zd%qZKg(XQSf zd)p4Jx~l%iF98*KpzeJ3Wk zlz}&lZap4nltcA4O7A$muE+p+s;kSv9&&0;QsI}6-L5P6a6ry~lm5l@L;SCG4#{gL z&Dv{5S29E?!0jv20;{$f%9um8T;CNS+lH)*wp``r0J@&%7I{@Gx(CghjQP>9C*g& z3p#L_Je~Bz4QK#0=|ctY3Jbt*$KTyo5{(f4DTqKR^V+9y@|<54LBkj0JY9o+>{za( zuS<&eu)8e^LBKzPNWG9gitRr;v)*6Y!(0$(eP8j522uX#f`?O}ue53Z=7-yly>>?) z|8}n(Ce#C08P~dTl0CN9itSSt0*HQN%RS?ABkaiPRXuta|HcbMF_rk09wd?ImsQr( zGET7?UOORn5X_Pm3U24M@b_B%>tov)xtWxEa)opuZ;-L=F>_RqX!74Q+812@N1aBD z;3m7@l%JzxG9=D*o)wF<$VC+NPzrvI?(Jrs)LE8AzfS$xfAcCBD@rPFc=xaW3uTIZK0LpR-qFLo$dMKTcA#kHW0lQRS6~w=nJ{W zkbk52t}4L~#J0>Lze{-TGP&HsilD1;rQyD^`%&0(y=Jc+D%3^CYpNV&L8MVXYfUKN zgRgYeqXfDFsPagKn;Lg3hmW@z*}X2XeKWLNw92KbFVZAG6Jh}1CsaiIs#wiF)5GSz zu%~P81~uObV!t#Cg_%5#>VK<6sFc6n#ge~?-)l+xml$mJKNF_~Ny`a4xrL6AVA2D7 znp%=OLOwiyvE3Hdb%EAhu8M+ z#sts5Rvy#Q@ffu)cx+U3=H9NP)NTUBed^Q)BR6SQ=QLW#_v@r8gQ2r~^2$t@G$u*f zMg@pZn@>Pt=C%UbTKx|DtpMIKUcaonoUo>%?<~*o-rABUw(LYw#&ay!On&N~XZF@} z!GGJKMQ`=rJF4MareCr+faudro|$d&@NvWZ{l$E6nPQg1dgP=l^WbrML{^F{vgP@?F)W<)hWBJP>&bj>7H7PJqM6XC>abJSV693oh|e?#q&M zJyO6AnXo-7)JpZ7%E|N5!Vh+xL=rv08K|RbWWQ+Ay*p5aOhJhxxsgpzpGAwIBYEnQqnF+CBVdeP|>+IA}kfLwI|ue&4H<@2W3_B%nf z#|l1a#Kzsie0`a)9y_q2fVsS&lbiGwrN|769T$we&s$sj!6p918!dbMR?YF9Nq>mT zMR@eML=g7j=@dDVE>%Nl{{hXSx})bzY#lw2qa(?Y6vd9cM3na$yI z96w$z7Y}V}Zc5&GuaBSv;QM1YFp0gEVg#HYuI|}tU*Mn+FCtb$5}g|xhLXwW%mrDP zh|%RAN(PSp$9zOQBTM+KKE*3U+2kML;xqg3kNUkIU!KGMR5{S!TTM*F4K%+oLuPKV@-2R2Up?w#rs{`BE7n*GFZ(W_U*6q8Sguw zYjop`_d1D59h*1~@@RoyiIZ%vaK6Z`)=a|}y3tQk{*i+J(iLaXl4Zvyfd}>k@H%O5 zH{bC-Rr6td&y^=-+h(C?FV=gOyb>9`=3b`K2=m>){P?(Lez2xUyzY8H#v3(PII2fm zD(UEyKBVvH-yTsCyda77aMd>4WMwjy^r?#RBakrg==M>>xnFub;iH#Dzv5Xv`+)NPDQ9qX!RQfb$rjdQ*24ybz69gj zV}|8jglQM5zGpG;X6od%Ywn9}p=*Jbb7)4fTXq{IYN}z3K(6Xhi`$3t4*j^d6b;4> z19urHbh2LH^Hfv$AaI`45#RK_QHco7Zh?EKA zZR9Y6OYi!N)Z_zB2zqEFm~nyZr~}12GMsQI5f#2Bw+bQGsw*_Z zI`EloeQBkd`%RC>_cc{3wyC%-{(Xw1xt*)KEl)D#$8_8ZG}Jac!`L_{2wcL1(&?dO zUa4HTjj2tAkS{-ikz6W11|Bj-4PCd3SB=7bVcNm7#xlevh*j2(#@3d6lv~(g-JE}| z$&s&|KLMm&lf6?kHwXRdbYSuRB=kwHneafDiT2frIl5WLON38S6jv2XtKKe2hLCW7 z(-DiF4_a@CID0G!&c-C;w)lkpzWBQ0ctSn{x$xkWZPH2fcT=NoR|xBMS&Z)^h8?IB zjW}C=Gnytgm8yFhFSd=#^RA7Or@vdeZ+F1~YJ1#);ro*VY!U4}dxT>bP7)DI&Dn8- zF}^pOfIGXE;T(1QYH>WNHT2zPZk+#D>k2~g?x~iI&|L|D!kyxr{w8R zzgkTh{5&CZ`}YrPjD4yjZN;12zLw3GkLS zY3sCG^19EtqKo!zsS1B{fORG0)7LB&Fyp0NUCBdJh`F7h@d#cpI%$@at-cI={h*kr z$rQwZ+fwQU#yydBkZjJrFWU;nLtA+rMw=bmJ=~1}VNWH;Zbxl9$ltFUnuC4#6pr*& zf_Wgf{Ak9NTz!>0oq@0`Sta=3EGCI^sK9_|Q((;YVzJDW8+gujK6POEI*f(-!7w!W zt>C?KM|Oq@-#!x}S#cl7k}M~6?(3DGjv^eWH##1`SM(Ie;c8KUtQ`cm9cndX0pjJI`Y3#{!?-=#8#yD|=N*Ua2D_(Ej}Vw81h3TK{b@ zHc6&+`K-r3@W7*Yg#YUcVd=uD=BF+v$J~uf<(MZ%rDp z7JFKWl%Q8952Tlq^RlU}Fon*UYV6lpA6tSLfM?a4+wl6 zAYJ6AQRW7MOOYzqV>((ECsqoQ12&y(+P3(*Ex7EXWHWf9#F`>buA8~&&3JvI%I0ch z5Sf$D-M7_?F0DFuM92E>G7B#zUk5g2K!y4HP$sxH45nhV`I29y5ln*K%k>Ftu*O}e zkcDnqKyYQmI=zI=J&OH8%~#TSj?ZU4%|-EjyNA2OHogcWAQ&&?E;boXL0%`V11#9K zBJ<^?f}aDksBtSfB9R$z z;(@m#hIb{g^dCAzXY<6x<&3@x(w>{fcZ#?DLb4wp>&QAI=IJnHGPEBaTLLZ{vC8Jl ztMaxq+aLBvW@p<)u8cvN)V>zn>O5`Z>c%5LW9iC*l8Fu%FLpTf%x_Gv6Bp4rhZzb{@GT6{jMTFI+wll&zq$*7kg-#Bo4%xw4ix3-&i7#`AU{BZZ&-HTh=f+w@x z4l_T=t1?`RK#BwWmvjPn;Wf&DDqex1mG_;8jk3zjb?Jm_8Hk^OHAE-gZhzp?g*;?ma! zjLlc5S-u7#bf8`IuIUO)4ZPJqPxs`bqx@I&K$`ugeIXxEv9fajXE;nxoWA$7;ARmV zurU2RS8ijfGt8f}Ut7gw22z4f6tZ7Bd`e36JvkwIo06tA~~a~t+wh^T!|MT zfN0eU3c{T0ZJ3}*I0XK2jRIy7?H4IhMo0BCj0Ug>lqXOD!fsY(yI0H=;ZIGt;#$)- z5XsCBr5$j-^09Nkb3CDr(btCsx5R>)q#(5G0AxR5K=5(wrm{HZK(IVqmse=vYUW}E zP@JC6Pl1ld2fr?asg~nD2?5o5P@o93UV)?3we=8sxWmiF#A!XL2Wsr8VNIf&0J-N) z$jfvU5eNpG`mvcC-3y|7734bEG1X&+kJk<1>rj#+KhKaOsGH!*U^p=pAf4x~fzGG) zx69O$lNVrnwjx5E6)So}6|bQ(XG5y%bR{;pmKtWvD`>PKge+|aNTijr;v~qPAm{ll zgmeO?t>xt2O*IMw6{TP?4RL26_F=AMn-JzQc$7!uz03lTn}^&0qcBL8o%0G85k~N; zua98PW)sVNUt_N0#t*|(>r&$qi6ka2@fR$Vf1N`=c@=bCgami_kz+>pFs)4 z3!^b|dYu>0{|X@RXZNiPTehtkarX*Z-KYii^il^viP#UU#ixHogDn2IC);Ycugpny zEn4cQ4}MBLYQ9(mVgcxvb<|bNAn-fLy5uVEZvfELYjW<4){<%A$}F9wmHAnXnEs1& zh(O0zhRop6bN@;(z?w!o;nKZve^4@IUrauCS~#|)OC?o-gwKdHwyXq)0h*!^`Pf&a zSJXsiNzQIzOY#LZLeXd>vW|8O-4tZY844T-mqCy8cI#blaPI|;t3NnG7xq!!+)a5E}^hT)-)1K>-+(iN<% z>D&3B%GNvz8>5P7Ou?zg-|H_Vv3XJ}D#-m5!|R#b+%T`L>Y)UbgsRP{DvBu|e`l zfzbx==1JA+^Oeq{*)Cn-o|XH-sRr9x0DHj)xR2<*KUADsj@V6-V=4~AOrDHyPA6rx5d=;-f~ZVQ(2MWDr?J2 z(4>pTbZcVx0`B!gEZ-+=OF#>Zyx}s&pBb0|GpPn}ZJ*<-T>=~lU?~R>gMKrig{jEs z^GAt7vd8qjMf_>y@%{eu@1|7+6tf{6V3CqKac9`UHBDN!_v@rZvmj~nj#j&qs?v0@ zu+3oHHFeLmJ0@7-d{)(w@yGi{<~}z*zmP1e^N@HmIVO3rAVvho7AS=w;?#cy0}?D+ zhpYwu@^yJrkmQY^yTX;F)r_LqhDes4Uwc7jK^{R0$jT~+dB+%}`&RBqC_{3>nCti4(Qk;NRh>1dUzP8VY4Xu;Cp@uE2>U)t z6bbDA7;y%rsrv!Gm~6fo7>U`E?4t&3jgEjC0Xd?z_P;4QDOkEqOb@ua|ISRS3&iOh zoaP|Gf<8zMr{?69PW=^LB+v&8L$!eKL#Fl2LoQ}PoaRx2dRAFxQfUHTA;}bm?_SB= zL2enCN4_#}w8eE(gxZs~1<`EDHD zY5{8S=c&Abxr^6!n+A~w7U59nQKH|+_?D}-Dm7%ZNLQHMbDqUL0zld$@SSQ(7Un$5 zEpHUM;p$GzWHhYPTmt?c-Txl zoW5%XB_?8_=Mx1;_d~#dUvy)n>d5JNlSrkLL{cJ6kBKf1EtUu&DH9ycc28?oKT6x` zt7pH1G6y4^1t77e^O2fanR@C@s5<8CYWHnKxnjz@9P8q$P1(xTAbl^C0f9vP1i6eP zJT=>`4BmX2u8VlOLj{2KLy}1L3^x%|yrH;Ulr=oRLWp1XKS>7qirY~ums}-g@9Po9 z%!4A|@7AWZ1W!PSda3Qo2suB`_h#hOT&kr!nr34i0hp}`01WDFq$vP+P5F*N3@=|# zJ^h^!efkq6UtZtzsyCAj@gf5n>P|{npTkqOc4O=qam124gZ-Pl#t)5j1!ZXhPCdKZ z4A*X-$DsBb*fKTe%GfM0GZ`SIUj%$Bs%CQ{B2Kgg`1$l4g$ZnE&@Z_WK10$CS}eY32`+Z0{3tZ;XNqSdX-MQ3`I< zVo}51xhcDjxwK^ALF%Qh!e%>le`AK5i~&r4Au{&*U4cV=l`D6TXG?VDvTwdDJ~^_` z5xAZ95<*J8lLbM&PVAoty$E`&)aOmKp~>gP`>Qtv3KI3Myp+z)Sh;LoVC0(v+5jVl zhu?HO0VO&xzOR4$nA5e{L>RLL^1B=n11EK;&+nUGr-LuLugL@#4*Lua73X`2E))Ah zAU`z#FOw`!TC)oA(#yajAY zVF;w8#K9N=EqS&N26h7c&%p*%IYcVJ7I6+8N(p?&B)@p?(y!3Q3{m?}tgX~12 z?Dhe>7c2JGx5Xbrq8IG`d-muugm3}DXR|^;K*b@L^U=3Eb_l+n;@bh>cm$+#t^x-# z+0?E#_qPcYfOrh_pGK@nHT;Ki#j!QFz(IqrR@c9-nbDzc>D@s_uV3kc3Q-0L9>h%} zYM|LshVYnr)pAHm@V_~gh;Od5VW!Q@I>A=y{$Pb4Eqk|dd-O0@37&)j83u?;Q-HJDiTtgnbj#dFu-ft8lM<;0C?O}03iTQ;exgmz*jSvZr^&m) zI#K_x_u5f7@WAXdC)jV%?J{uQU6`v-%h?lah$?6({VRcD3ukxC)_lMD8whxb?8r&v zC0|B}Pz0zEsk&$PWbkEhK%5y3X9T+aNV*$~2?QqM2N4{&5=0?p;BpRlZp#nEIuf&H zhUsCKjQ*3#2CiLJA0ESuzRZ9`S=kfnvX2jq!P{!2%nNMI=KjsL*93xdF@dOX^6^0< z*^|Vqr%wK|ZAp_us^nf&yfFv$ea{T|RA7etM1&K3&(%FRKJ+7>6aLq4cj-MOo&xaF zrhwbr2l;&L50w}0ghSahC{S5uqq1P%=4q}-P`0KY!B?TK@YwA<0>xUnq7@fZ4ce)C zGa#+j440OX*pI@}*)#2rg_52A6FkkowImO|JN_9|D1R0tst@|OwWttgh#WHiOrNxJ z1JsujD7~*@Wj8L!GY#xtkr8YK6a^?N(&r=c%d0Z}--@3SAcx{9_5-pI7hNg|#eMU@ zcl_WKicCRfH6s}52+)GA->EJIJc^Ow8+yTPkFdqJ6+n(OFEF$01GS?LDn}BWK#_*} z1d{FoB=$=kSGPE*bSLL5D&T$=6^e?H;U*I-)(5HzMY&Y1AT{=0r0X6D&`O=nLh`L4 zxU*7dbhL)L62*B#D2j>DK(wn^Y5%WLxBxSdsV9sPya(DROW$N<>=&XPq`Y!P{=dh6 z(y4&=Ld@t)eRZcRWDL2Tge7s3ZjzR(j)EUXfuEN*ICOtK3b+6>!%gM@`CY=6m@nPl zcW_z*gf!>1yP$L}P{qMsMtpxCRP%$vDdv?zRGQ^(Gmtn7@ZTihgEPS^0Pk$u3R@3{f{jzCa>icOlmy&u31Kll3w< zMBw-q)({*!%oQW-rmTKxkx0LEt2C1oV(t>c> z8>nsrl9D>Q@RAsN)WZNT6B{aAyC7WD-Z=pxiw@!70{+r^@`29^!Dn1lIC&wssH1ZN zR2JF{MUK*T-wHXyE>7|nsRF$O=}}9FD`i~qv%xj=y#I(O$ZQZJYv8lmeLl3xu%DNf zcF5qTD1LV?I$OFy<1OoZ(-?`hjiO)Hk9V%?07{r(lqqmalNSvPdfp|6&qrw@nN&jK zuBv@a5AYh5ry}TU@uulesaPVgPdH;4Lhi~gPCA`ZLD(pU^c^X1Kpajt_uC!P6%rL0 zMIz=9jYIBU0$c2z1M+C&aL!K7$Ivf~J_?HI-ss-xll6R$41X%ZV4NzZ!35RqPp-Jk zjkIVx{^bc4mDPpTWrfP7K`~<{C?~@~PjRv^9)49WrH{xPa#v)k`&JE_z<}4`5CNn_ zsEC6}dFzzcv^223(%*2uoDq-KiO(`rgq>(r3^gcPnEdr}A*N6*^vajEM~09zTN702 zB@?vRr6KeKy#>m7v8TU1sXZ{#?dL4DWC0$=O@s;HWP1*}EF?VzYl*(9c2z0mQX<#b zE589~DKJfupQQ;3k5$D)8Kb(?mxy_t69lAOsfaXYyeLP~fLrw?+e2j_1nN>g zqD4{^1V&w`h)%{Y8Qxovm2L%-AM*mkEytap^cSFX3xWNf5V5$+N4N?=+guQCLK%ml z8S9Xl?T0;uV$7eSwSVdd6#r#w;S8OaIU8uIqc8!$bRM*_I*@Elo&Q+Vj!`A_rJ;)U zSsxean%g+#V<;x882qoiZzl8CVv|OfMCO^Pv*@Csm>{q_uTo4hgtdI+3rUk~95R>Z zVPh%;n8;EQ#|^2v1$}imqF|l?cfh`~bd4S)?G~uwCKGfvQwS%-6FDJG#^`U`^j>=V zOoRgGuELu(DcwMwsF)?Ma=_BU6FNO}wzM#34wN#SgSyd3%hR_MggSg9@FYsdBE#9? z6u3v4ylK6X4e!*^Vvhc3?!f&y)~!~(dw_K=xDuDaWlp*6Tn-aiMts*IGvGVg&twvY z^Ee1Y+ceifEyAgYmkaX>G}m$`D7&wddPsHvZ3c^Rjor4*FKl{Ttzg|2HHk Date: Wed, 29 Jul 2026 22:16:48 +0200 Subject: [PATCH 20/61] chore(zarr-metadata): build 0.4.0 changelog (#4211) Consume the pending news fragments (the #4119 model layer's feature and removal notes, plus a new doc fragment for the standalone documentation site and justfile from #4208/#4210) into CHANGELOG.md via towncrier for the zarr_metadata-v0.4.0 release. Assisted-by: ClaudeCode:claude-fable-5 --- packages/zarr-metadata/CHANGELOG.md | 153 ++++++++++++++++++ .../zarr-metadata/changes/4119.feature.md | 92 ----------- .../zarr-metadata/changes/4119.removal.md | 41 ----- 3 files changed, 153 insertions(+), 133 deletions(-) delete mode 100644 packages/zarr-metadata/changes/4119.feature.md delete mode 100644 packages/zarr-metadata/changes/4119.removal.md diff --git a/packages/zarr-metadata/CHANGELOG.md b/packages/zarr-metadata/CHANGELOG.md index a3ff1177a0..981c7706bf 100644 --- a/packages/zarr-metadata/CHANGELOG.md +++ b/packages/zarr-metadata/CHANGELOG.md @@ -2,6 +2,159 @@ +## 0.4.0 (2026-07-29) + +### Features + +- Added `zarr_metadata.model`: frozen-dataclass models (`ZarrV2ArrayMetadata`, + `ZarrV3ArrayMetadata`, `ZarrV2GroupMetadata`, `ZarrV3GroupMetadata`, + `ZarrV2ConsolidatedMetadata`, `ZarrV3ConsolidatedMetadata`, `ZarrV3NamedConfig`) + that are canonical, semantically lossless representations of Zarr metadata + documents, plus structural validators (`validate_*` / `is_*` / `parse_*`). + Every v3 extension point (data type, chunk grid, chunk key encoding, codecs, + storage transformers) is held as `ZarrV3NamedConfig`: a name, configuration, + and `must_understand` obligation; nothing is interpreted. On the wire, an + empty configuration with the default obligation uses the spec's plain-string + shorthand. Model fields are annotated with the role alias + `ZarrV3MetadataField` (today exactly `ZarrV3NamedConfig`), so annotations + convey the logical meaning and stay put if the spec adds another field form. + + Validation is strict about what the types declare: v2 `dtype` / `order` / + `compressor` / `filters` / `dimension_separator` shapes and the fixed + `zarr_format` / `node_type` literals are all enforced. Every + `ValidationProblem` carries a machine-readable `kind` + (`missing_key` / `invalid_type` / `invalid_value` / `invalid_json`) so + consumers can dispatch on the failure mode without matching message strings, + and every ingestion failure — including missing store keys and undecodable + bytes in `from_key_value` — surfaces as `MetadataValidationError`. An + adversarial review added further structural checks: JSON booleans are not + accepted as dimension lengths, dimensions are non-negative, + `dimension_names` must have one entry per dimension of `shape`, `attributes` + and `configuration` values are JSON-checked recursively (like `fill_value`), + non-finite floats and non-standard JSON constants are rejected, abstract + mappings and sequences normalize to encoder-safe canonical containers, + v2 `shape` and `chunks` must have the same rank, non-null v2 filter pipelines + contain at least one filter, document `TypeIs` guards only narrow values that + already use the declared canonical containers, + and the inline consolidated-metadata envelope and entries are deep-validated + so the group validator's verdict always agrees with the model constructor. + + The v3 models expose `must_understand_fields`: the subset of `extra_fields` + not explicitly waived with `must_understand: false` (fields are implicitly + must-understand per the spec). Readers discharge the spec's fail-to-open + duty by subtracting the extension names they recognize; the model only + partitions by obligation, since recognition is reader-specific. + + Optional pydantic integration ships as `zarr_metadata.pydantic` (importing it + requires pydantic 2.13 or newer; the core package does not depend on it): one + `Annotated` + field type per model, validating raw documents through `from_json`, passing + core-model instances through unchanged, serializing via `to_json`, and + publishing JSON Schemas derived from private constrained document types that + mirror the independently expressible runtime rules. Cross-field cardinality + relations still require runtime validation. The instances are the core model + classes, so values interoperate freely with non-pydantic code. + + `create_default` keeps its output self-consistent: overriding `shape` without + a chunk grid derives one regular chunk covering the array (v3 + `chunk_shape == shape`; v2 `chunks == shape`) instead of silently keeping the + scalar default's 0-d grid. + + A v2 `.zarray` that omits `dimension_separator` is interpreted with the v2 + convention's default `"."` (the model previously normalized absence to `"/"`, + which would misaddress the chunks of real-world default-separator arrays). + The value is never null: absent, `"."`, or `"/"` are the only spellings. + + Optional document keys use `UNSET` — a PEP 661 sentinel + (`typing_extensions.Sentinel`), usable directly in type expressions — never + `None`: in a model, `None` always corresponds to a JSON `null` in the + document (a v2 `compressor`, an unnamed dimension inside `dimension_names`), + and `UNSET` always means the key is absent. Checker note: ty types the + sentinel exactly; pyright needs `<= 1.1.404` until microsoft/pyright#11115 + is fixed (this package's CI pins it); mypy users need a `cast` or + `type: ignore` at narrowing sites until python/mypy#21647 merges. This keeps semantically distinct spellings + distinct — an absent `dimension_names` ("there are no dimension names") and + an explicit `[null, null]` ("every dimension has a name, which is null") are + different documents and round-trip as such. The `consolidated_metadata: null` + written by a historical zarr-python bug is the one deliberate exception to + faithful round-tripping: those stores remain readable, but the bug spelling + is repaired to absence on read and never written back. + + The v2 models treat the `.zattrs` file's presence as part of the store: + `attributes` is `UNSET` when no `.zattrs` file exists (and `to_key_value` + emits none), while an explicit empty `.zattrs` is `{}` and round-trips as a + file. Previously `to_key_value` always emitted `.zattrs`, silently adding a + file to stores that never had one. + + The store-key `Literal` aliases (`ZarrV2ArrayMetadataStoreKey`, + `ZarrV2AttributesStoreKey`, ...) are exported from `zarr_metadata.model` + alongside their constants, and each `to_key_value` return type is keyed by + them, so the set of store keys a model can emit is visible in its signature. + `from_key_value` deliberately keeps `Mapping[str, bytes]` input: it accepts + any string-keyed store mapping and ignores unrelated keys. + + `to_json` returns a document that shares no mutable state with the model: + every value that can hold a mutable container (attributes, configurations, + extra fields, v2 codec configurations, fill values, consolidated entries) is + deep-copied on the way out, so editing a serialized document can never + silently mutate the frozen model that produced it. ([#4119](https://github.com/zarr-developers/zarr-python/issues/4119)) + +### Improved Documentation + +- `zarr-metadata` now has a standalone documentation site at + , with a comprehensive API reference + covering every public module, versioned by this package's release tags. The + package also gained a `justfile` collecting its development commands + (`test`, `lint`, `typecheck`, `docs-check`, `docs-serve`, `changelog-draft`), + which the package CI workflow now delegates to. ([#4208](https://github.com/zarr-developers/zarr-python/issues/4208)) + +### Deprecations and Removals + +- The document (TypedDict) types are renamed to put the format version at the + front of the name and to mark the JSON-document form with a `JSON` suffix, + so a format version can never be misread as a class revision and the bare + entity names are reserved for the `zarr_metadata.model` dataclasses: + + - `ArrayMetadataV2` → `ZarrV2ArrayMetadataJSON` (and `...Partial` accordingly) + - `ArrayMetadataV3` → `ZarrV3ArrayMetadataJSON` (and `...Partial` accordingly) + - `GroupMetadataV2` → `ZarrV2GroupMetadataJSON` (and `...Partial` accordingly) + - `GroupMetadataV3` → `ZarrV3GroupMetadataJSON` (and `...Partial` accordingly) + - `ConsolidatedMetadataV2` → `ZarrV2ConsolidatedMetadataJSON` + - `ConsolidatedMetadataV3` → `ZarrV3ConsolidatedMetadataJSON` + - `NamedConfigV3` → `ZarrV3NamedConfigJSON` + - `MetadataV3` → `ZarrV3MetadataFieldJSON` (the union of the bare-name and + named-configuration spellings of one metadata field) + - `ExtensionFieldV3` → `ZarrV3ExtensionField` + - `CodecMetadataV2` → `ZarrV2CodecMetadata` + - `DataTypeMetadataV2` → `ZarrV2DataTypeMetadata` + - `ArrayOrderV2` → `ZarrV2ArrayOrder` + - `ArrayDimensionSeparatorV2` → `ZarrV2ArrayDimensionSeparator` + - `ZArrayMetadata` → `ZarrV2ZArrayJSON` (the strict on-disk `.zarray` document) + - `ZGroupMetadata` → `ZarrV2ZGroupJSON` (the strict on-disk `.zgroup` document) + - `ZAttrsMetadata` → `ZarrV2ZAttrsJSON` (the `.zattrs` document) + + The old names are removed, not aliased. The `zarr_metadata.pydantic` field + types take the bare entity names (`ZarrV3ArrayMetadata`, ...), matching the + model classes they validate into. + + The conventions, stated once for future additions: CamelCase type names put + the format version first (`ZarrV2ArrayMetadataJSON`, + `ZarrV3ArrayMetadataStoreKey`), while SCREAMING_SNAKE constants and + snake_case functions put it last (`ARRAY_METADATA_STORE_KEY_V2`, + `validate_array_metadata_v3`). The `JSON` suffix marks a raw-document type + whose bare name is taken by (or reserved for) a `zarr_metadata.model` + dataclass; raw field-level types the models hold verbatim + (`ZarrV2CodecMetadata`, `ZarrV3ExtensionField`) keep their bare names. + Extension-entity types put the registered entity name first and end in + exactly one role suffix (`BloscCodecMetadata`, `Uint8DataTypeName`) — the + `V2` in `V2ChunkKeyEncodingMetadata` is that encoding's entity name, not a + format version, which is always spelled `ZarrV2`/`ZarrV3`. Every public + type name is checked against this grammar by + `tests/test_public_api.py::test_public_type_names_comply_with_naming_grammar`. + + ([#4119](https://github.com/zarr-developers/zarr-python/issues/4119)) + + ## 0.3.0 (2026-06-19) ### Deprecations and Removals diff --git a/packages/zarr-metadata/changes/4119.feature.md b/packages/zarr-metadata/changes/4119.feature.md deleted file mode 100644 index b9d0bb508c..0000000000 --- a/packages/zarr-metadata/changes/4119.feature.md +++ /dev/null @@ -1,92 +0,0 @@ -Added `zarr_metadata.model`: frozen-dataclass models (`ZarrV2ArrayMetadata`, -`ZarrV3ArrayMetadata`, `ZarrV2GroupMetadata`, `ZarrV3GroupMetadata`, -`ZarrV2ConsolidatedMetadata`, `ZarrV3ConsolidatedMetadata`, `ZarrV3NamedConfig`) -that are canonical, semantically lossless representations of Zarr metadata -documents, plus structural validators (`validate_*` / `is_*` / `parse_*`). -Every v3 extension point (data type, chunk grid, chunk key encoding, codecs, -storage transformers) is held as `ZarrV3NamedConfig`: a name, configuration, -and `must_understand` obligation; nothing is interpreted. On the wire, an -empty configuration with the default obligation uses the spec's plain-string -shorthand. Model fields are annotated with the role alias -`ZarrV3MetadataField` (today exactly `ZarrV3NamedConfig`), so annotations -convey the logical meaning and stay put if the spec adds another field form. - -Validation is strict about what the types declare: v2 `dtype` / `order` / -`compressor` / `filters` / `dimension_separator` shapes and the fixed -`zarr_format` / `node_type` literals are all enforced. Every -`ValidationProblem` carries a machine-readable `kind` -(`missing_key` / `invalid_type` / `invalid_value` / `invalid_json`) so -consumers can dispatch on the failure mode without matching message strings, -and every ingestion failure — including missing store keys and undecodable -bytes in `from_key_value` — surfaces as `MetadataValidationError`. An -adversarial review added further structural checks: JSON booleans are not -accepted as dimension lengths, dimensions are non-negative, -`dimension_names` must have one entry per dimension of `shape`, `attributes` -and `configuration` values are JSON-checked recursively (like `fill_value`), -non-finite floats and non-standard JSON constants are rejected, abstract -mappings and sequences normalize to encoder-safe canonical containers, -v2 `shape` and `chunks` must have the same rank, non-null v2 filter pipelines -contain at least one filter, document `TypeIs` guards only narrow values that -already use the declared canonical containers, -and the inline consolidated-metadata envelope and entries are deep-validated -so the group validator's verdict always agrees with the model constructor. - -The v3 models expose `must_understand_fields`: the subset of `extra_fields` -not explicitly waived with `must_understand: false` (fields are implicitly -must-understand per the spec). Readers discharge the spec's fail-to-open -duty by subtracting the extension names they recognize; the model only -partitions by obligation, since recognition is reader-specific. - -Optional pydantic integration ships as `zarr_metadata.pydantic` (importing it -requires pydantic 2.13 or newer; the core package does not depend on it): one -`Annotated` -field type per model, validating raw documents through `from_json`, passing -core-model instances through unchanged, serializing via `to_json`, and -publishing JSON Schemas derived from private constrained document types that -mirror the independently expressible runtime rules. Cross-field cardinality -relations still require runtime validation. The instances are the core model -classes, so values interoperate freely with non-pydantic code. - -`create_default` keeps its output self-consistent: overriding `shape` without -a chunk grid derives one regular chunk covering the array (v3 -`chunk_shape == shape`; v2 `chunks == shape`) instead of silently keeping the -scalar default's 0-d grid. - -A v2 `.zarray` that omits `dimension_separator` is interpreted with the v2 -convention's default `"."` (the model previously normalized absence to `"/"`, -which would misaddress the chunks of real-world default-separator arrays). -The value is never null: absent, `"."`, or `"/"` are the only spellings. - -Optional document keys use `UNSET` — a PEP 661 sentinel -(`typing_extensions.Sentinel`), usable directly in type expressions — never -`None`: in a model, `None` always corresponds to a JSON `null` in the -document (a v2 `compressor`, an unnamed dimension inside `dimension_names`), -and `UNSET` always means the key is absent. Checker note: ty types the -sentinel exactly; pyright needs `<= 1.1.404` until microsoft/pyright#11115 -is fixed (this package's CI pins it); mypy users need a `cast` or -`type: ignore` at narrowing sites until python/mypy#21647 merges. This keeps semantically distinct spellings -distinct — an absent `dimension_names` ("there are no dimension names") and -an explicit `[null, null]` ("every dimension has a name, which is null") are -different documents and round-trip as such. The `consolidated_metadata: null` -written by a historical zarr-python bug is the one deliberate exception to -faithful round-tripping: those stores remain readable, but the bug spelling -is repaired to absence on read and never written back. - -The v2 models treat the `.zattrs` file's presence as part of the store: -`attributes` is `UNSET` when no `.zattrs` file exists (and `to_key_value` -emits none), while an explicit empty `.zattrs` is `{}` and round-trips as a -file. Previously `to_key_value` always emitted `.zattrs`, silently adding a -file to stores that never had one. - -The store-key `Literal` aliases (`ZarrV2ArrayMetadataStoreKey`, -`ZarrV2AttributesStoreKey`, ...) are exported from `zarr_metadata.model` -alongside their constants, and each `to_key_value` return type is keyed by -them, so the set of store keys a model can emit is visible in its signature. -`from_key_value` deliberately keeps `Mapping[str, bytes]` input: it accepts -any string-keyed store mapping and ignores unrelated keys. - -`to_json` returns a document that shares no mutable state with the model: -every value that can hold a mutable container (attributes, configurations, -extra fields, v2 codec configurations, fill values, consolidated entries) is -deep-copied on the way out, so editing a serialized document can never -silently mutate the frozen model that produced it. diff --git a/packages/zarr-metadata/changes/4119.removal.md b/packages/zarr-metadata/changes/4119.removal.md deleted file mode 100644 index 2a9a6f84c4..0000000000 --- a/packages/zarr-metadata/changes/4119.removal.md +++ /dev/null @@ -1,41 +0,0 @@ -The document (TypedDict) types are renamed to put the format version at the -front of the name and to mark the JSON-document form with a `JSON` suffix, -so a format version can never be misread as a class revision and the bare -entity names are reserved for the `zarr_metadata.model` dataclasses: - -- `ArrayMetadataV2` → `ZarrV2ArrayMetadataJSON` (and `...Partial` accordingly) -- `ArrayMetadataV3` → `ZarrV3ArrayMetadataJSON` (and `...Partial` accordingly) -- `GroupMetadataV2` → `ZarrV2GroupMetadataJSON` (and `...Partial` accordingly) -- `GroupMetadataV3` → `ZarrV3GroupMetadataJSON` (and `...Partial` accordingly) -- `ConsolidatedMetadataV2` → `ZarrV2ConsolidatedMetadataJSON` -- `ConsolidatedMetadataV3` → `ZarrV3ConsolidatedMetadataJSON` -- `NamedConfigV3` → `ZarrV3NamedConfigJSON` -- `MetadataV3` → `ZarrV3MetadataFieldJSON` (the union of the bare-name and - named-configuration spellings of one metadata field) -- `ExtensionFieldV3` → `ZarrV3ExtensionField` -- `CodecMetadataV2` → `ZarrV2CodecMetadata` -- `DataTypeMetadataV2` → `ZarrV2DataTypeMetadata` -- `ArrayOrderV2` → `ZarrV2ArrayOrder` -- `ArrayDimensionSeparatorV2` → `ZarrV2ArrayDimensionSeparator` -- `ZArrayMetadata` → `ZarrV2ZArrayJSON` (the strict on-disk `.zarray` document) -- `ZGroupMetadata` → `ZarrV2ZGroupJSON` (the strict on-disk `.zgroup` document) -- `ZAttrsMetadata` → `ZarrV2ZAttrsJSON` (the `.zattrs` document) - -The old names are removed, not aliased. The `zarr_metadata.pydantic` field -types take the bare entity names (`ZarrV3ArrayMetadata`, ...), matching the -model classes they validate into. - -The conventions, stated once for future additions: CamelCase type names put -the format version first (`ZarrV2ArrayMetadataJSON`, -`ZarrV3ArrayMetadataStoreKey`), while SCREAMING_SNAKE constants and -snake_case functions put it last (`ARRAY_METADATA_STORE_KEY_V2`, -`validate_array_metadata_v3`). The `JSON` suffix marks a raw-document type -whose bare name is taken by (or reserved for) a `zarr_metadata.model` -dataclass; raw field-level types the models hold verbatim -(`ZarrV2CodecMetadata`, `ZarrV3ExtensionField`) keep their bare names. -Extension-entity types put the registered entity name first and end in -exactly one role suffix (`BloscCodecMetadata`, `Uint8DataTypeName`) — the -`V2` in `V2ChunkKeyEncodingMetadata` is that encoding's entity name, not a -format version, which is always spelled `ZarrV2`/`ZarrV3`. Every public -type name is checked against this grammar by -`tests/test_public_api.py::test_public_type_names_comply_with_naming_grammar`. From 020e5c3494c7bb794da1a94b970c326ddbdbca7a Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Thu, 30 Jul 2026 00:45:46 -0400 Subject: [PATCH 21/61] docs: fix link checker error and update redirected links; run checker weekly (#4214) --- .github/workflows/links.yml | 2 +- README.md | 22 +- docs/contributing.md | 2 +- docs/quick-start.md | 4 +- docs/release-notes.md | 406 +++++++++++++------------- docs/user-guide/arrays.md | 6 +- docs/user-guide/installation.md | 8 +- docs/user-guide/storage.md | 11 +- packages/zarr-metadata/CHANGELOG.md | 20 +- packages/zarr-metadata/README.md | 2 +- packages/zarr-metadata/pyproject.toml | 2 +- pyproject.toml | 2 +- 12 files changed, 242 insertions(+), 245 deletions(-) diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index f606f12a3e..0af76deece 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: # pull_request: schedule: - - cron: "00 18 * * *" + - cron: "00 18 * * 1" # weekly, Mondays at 18:00 UTC jobs: linkChecker: diff --git a/README.md b/README.md index fb0890d18c..7557936b6f 100644 --- a/README.md +++ b/README.md @@ -8,24 +8,24 @@ [![CondaForge](https://anaconda.org/conda-forge/zarr/badges/version.svg)](https://anaconda.org/anaconda/zarr/) [![Package Status](https://img.shields.io/pypi/status/zarr.svg)](https://pypi.org/project/zarr/) [![License](https://img.shields.io/pypi/l/zarr.svg)](https://github.com/zarr-developers/zarr-python/blob/main/LICENSE.txt) -[![Coverage](https://codecov.io/gh/zarr-developers/zarr-python/branch/main/graph/badge.svg)](https://codecov.io/gh/zarr-developers/zarr-python) -[![Downloads](https://pepy.tech/badge/zarr)](https://zarr.readthedocs.io) +[![Coverage](https://codecov.io/gh/zarr-developers/zarr-python/branch/main/graph/badge.svg)](https://app.codecov.io/gh/zarr-developers/zarr-python) +[![Downloads](https://static.pepy.tech/badge/zarr)](https://zarr.readthedocs.io/en/stable/) [![Developer Chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://ossci.zulipchat.com/#narrow/channel/423692-Zarr-Python) [![Citation](https://zenodo.org/badge/DOI/10.5281/zenodo.3773450.svg)](https://doi.org/10.5281/zenodo.3773450) ## What is it? -Zarr is a Python package providing an implementation of compressed, chunked, N-dimensional arrays, designed for use in parallel computing. See the [documentation](https://zarr.readthedocs.io) for more information. +Zarr is a Python package providing an implementation of compressed, chunked, N-dimensional arrays, designed for use in parallel computing. See the [documentation](https://zarr.readthedocs.io/en/stable/) for more information. ## Main Features -- [**Create**](https://zarr.readthedocs.io/en/stable/user-guide/arrays.html#creating-an-array) N-dimensional arrays with any NumPy `dtype`. -- [**Chunk arrays**](https://zarr.readthedocs.io/en/stable/user-guide/performance.html#chunk-optimizations) along any dimension. -- [**Compress**](https://zarr.readthedocs.io/en/stable/user-guide/arrays.html#compressors) and/or filter chunks using any NumCodecs codec. -- [**Store arrays**](https://zarr.readthedocs.io/en/stable/user-guide/storage.html) in memory, on disk, inside a zip file, on S3, etc... -- [**Read**](https://zarr.readthedocs.io/en/stable/user-guide/arrays.html#reading-and-writing-data) an array [**concurrently**](https://zarr.readthedocs.io/en/stable/user-guide/performance.html#parallel-computing-and-synchronization) from multiple threads or processes. -- [**Write**](https://zarr.readthedocs.io/en/stable/user-guide/arrays.html#reading-and-writing-data) to an array concurrently from multiple threads or processes. -- Organize arrays into hierarchies via [**groups**](https://zarr.readthedocs.io/en/stable/quickstart.html#hierarchical-groups). +- [**Create**](https://zarr.readthedocs.io/en/stable/user-guide/arrays/#creating-an-array) N-dimensional arrays with any NumPy `dtype`. +- [**Chunk arrays**](https://zarr.readthedocs.io/en/stable/user-guide/performance/#chunk-optimizations) along any dimension. +- [**Compress**](https://zarr.readthedocs.io/en/stable/user-guide/arrays/#compressors) and/or filter chunks using any NumCodecs codec. +- [**Store arrays**](https://zarr.readthedocs.io/en/stable/user-guide/storage/) in memory, on disk, inside a zip file, on S3, etc... +- [**Read**](https://zarr.readthedocs.io/en/stable/user-guide/arrays/#reading-and-writing-data) an array [**concurrently**](https://zarr.readthedocs.io/en/stable/user-guide/performance/#parallel-computing-and-synchronization) from multiple threads or processes. +- [**Write**](https://zarr.readthedocs.io/en/stable/user-guide/arrays/#reading-and-writing-data) to an array concurrently from multiple threads or processes. +- Organize arrays into hierarchies via [**groups**](https://zarr.readthedocs.io/en/stable/quick-start/#hierarchical-groups). ## Where to get it @@ -41,4 +41,4 @@ or via `conda`: conda install -c conda-forge zarr ``` -For more details, including how to install from source, see the [installation documentation](https://zarr.readthedocs.io/en/stable/index.html#installation). +For more details, including how to install from source, see the [installation documentation](https://zarr.readthedocs.io/en/stable/#installation). diff --git a/docs/contributing.md b/docs/contributing.md index aeb88e6ce1..dea7256c36 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -419,4 +419,4 @@ performance benchmarks as part of our test suite. The benchmarks are found in `t By default pytest is configured to run these benchmarks as plain tests (i.e., no benchmarking). To run a benchmark with timing measurements, use the `--benchmark-enable` when invoking `pytest`. -The benchmarks are run as part of the continuous integration suite through [codspeed](https://codspeed.io/zarr-developers/zarr-python). +The benchmarks are run as part of the continuous integration suite through [codspeed](https://app.codspeed.io/zarr-developers/zarr-python). diff --git a/docs/quick-start.md b/docs/quick-start.md index 17cb1c599a..123f05d5e9 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -164,8 +164,8 @@ print(z[:]) ``` Zarr also integrates seamlessly with cloud object storage such as Amazon S3 and Google -Cloud Storage using external libraries like [s3fs](https://s3fs.readthedocs.io) or -[gcsfs](https://gcsfs.readthedocs.io). Remote storage support requires the `remote` +Cloud Storage using external libraries like [s3fs](https://s3fs.readthedocs.io/en/latest/) or +[gcsfs](https://gcsfs.readthedocs.io/en/latest/). Remote storage support requires the `remote` optional dependencies (`pip install "zarr[remote]"`) as well as a filesystem library for your storage service, such as `s3fs` for S3: diff --git a/docs/release-notes.md b/docs/release-notes.md index 3fd8a5f360..7b147a30bd 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -11,12 +11,12 @@ - Optimizes reading multiple chunks from a shard. Serial calls to `Store.get()` in the sharding codec have been replaced with a single call to `Store.get_ranges()`, which coalesces nearby byte ranges and fetches them - concurrently. ([#3004](https://github.com/zarr-developers/zarr-python/issues/3004)) -- Added a `subchunk_write_order` option to `ShardingCodec` to control the physical order of subchunks within a shard. Supported values are `morton`, `unordered`, `lexicographic`, and `colexicographic`. `unordered` makes no guarantee about subchunk layout. This setting affects only on-disk layout, not the data read back, and is not persisted in array metadata: it applies per codec instance and is not recovered when reopening a sharded array. ([#3826](https://github.com/zarr-developers/zarr-python/issues/3826)) -- Added `SyncByteGetter` and `SyncByteSetter` runtime-checkable protocols and a `get_ranges_sync` method on the `Store` ABC. These let custom byte getters/setters opt into the synchronous codec pipeline's fast path for in-memory IO, which the sharding codec uses for its inner chunks. ([#3885](https://github.com/zarr-developers/zarr-python/issues/3885)) -- Added `FusedCodecPipeline`, an opt-in codec pipeline that runs codec compute synchronously and in bulk (avoiding the per-chunk async scheduling overhead of the default `BatchedCodecPipeline`), giving large speedups for sharded arrays (up to ~24x writes / ~14x reads on many-chunks-per-shard layouts, more with compression) and no regressions on compute-bound workloads. The default `BatchedCodecPipeline` is unchanged for standard configurations, so existing code keeps working unless you opt in; enable the new pipeline with `zarr.config.set({"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"})`. ([#3885](https://github.com/zarr-developers/zarr-python/issues/3885)) -- Add `zarr.abc.store.Store.get_ranges` for concurrent, coalesced multi-range reads from a single key. The method is defined on the `Store` ABC with a default implementation built on `Store.get`, so every store inherits a working version; stores with native multi-range backends (e.g. `FsspecStore`) can override for efficiency. Coalescing knobs (`max_concurrency`, `max_gap_bytes`, `max_coalesced_bytes`) are passed as keyword arguments to `get_ranges`. Failures from underlying fetches surface as a `BaseExceptionGroup` (PEP 654); callers should use `except*` to filter for specific exception types such as `FileNotFoundError`. ([#3925](https://github.com/zarr-developers/zarr-python/issues/3925)) -- Two new fields on `ArrayConfig` control how the sharding codec coalesces partial-shard reads: `sharding_coalesce_max_gap_bytes` (default 1 MiB) and `sharding_coalesce_max_bytes` (default 16 MiB). When reading multiple chunks from the same shard, nearby byte ranges are merged into a single request to the store if separated by no more than `sharding_coalesce_max_gap_bytes` and the merged read stays within `sharding_coalesce_max_bytes`. Defaults are seeded from the matching `array.sharding_coalesce_max_gap_bytes` / `array.sharding_coalesce_max_bytes` keys in [`zarr.config`][] at array-creation time, and can be overridden per array by passing `config={...}` to [`zarr.create_array`][]. ([#3987](https://github.com/zarr-developers/zarr-python/issues/3987)) + concurrently. ([#3004](https://github.com/zarr-developers/zarr-python/pull/3004)) +- Added a `subchunk_write_order` option to `ShardingCodec` to control the physical order of subchunks within a shard. Supported values are `morton`, `unordered`, `lexicographic`, and `colexicographic`. `unordered` makes no guarantee about subchunk layout. This setting affects only on-disk layout, not the data read back, and is not persisted in array metadata: it applies per codec instance and is not recovered when reopening a sharded array. ([#3826](https://github.com/zarr-developers/zarr-python/pull/3826)) +- Added `SyncByteGetter` and `SyncByteSetter` runtime-checkable protocols and a `get_ranges_sync` method on the `Store` ABC. These let custom byte getters/setters opt into the synchronous codec pipeline's fast path for in-memory IO, which the sharding codec uses for its inner chunks. ([#3885](https://github.com/zarr-developers/zarr-python/pull/3885)) +- Added `FusedCodecPipeline`, an opt-in codec pipeline that runs codec compute synchronously and in bulk (avoiding the per-chunk async scheduling overhead of the default `BatchedCodecPipeline`), giving large speedups for sharded arrays (up to ~24x writes / ~14x reads on many-chunks-per-shard layouts, more with compression) and no regressions on compute-bound workloads. The default `BatchedCodecPipeline` is unchanged for standard configurations, so existing code keeps working unless you opt in; enable the new pipeline with `zarr.config.set({"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"})`. ([#3885](https://github.com/zarr-developers/zarr-python/pull/3885)) +- Add `zarr.abc.store.Store.get_ranges` for concurrent, coalesced multi-range reads from a single key. The method is defined on the `Store` ABC with a default implementation built on `Store.get`, so every store inherits a working version; stores with native multi-range backends (e.g. `FsspecStore`) can override for efficiency. Coalescing knobs (`max_concurrency`, `max_gap_bytes`, `max_coalesced_bytes`) are passed as keyword arguments to `get_ranges`. Failures from underlying fetches surface as a `BaseExceptionGroup` (PEP 654); callers should use `except*` to filter for specific exception types such as `FileNotFoundError`. ([#3925](https://github.com/zarr-developers/zarr-python/pull/3925)) +- Two new fields on `ArrayConfig` control how the sharding codec coalesces partial-shard reads: `sharding_coalesce_max_gap_bytes` (default 1 MiB) and `sharding_coalesce_max_bytes` (default 16 MiB). When reading multiple chunks from the same shard, nearby byte ranges are merged into a single request to the store if separated by no more than `sharding_coalesce_max_gap_bytes` and the merged read stays within `sharding_coalesce_max_bytes`. Defaults are seeded from the matching `array.sharding_coalesce_max_gap_bytes` / `array.sharding_coalesce_max_bytes` keys in [`zarr.config`][] at array-creation time, and can be overridden per array by passing `config={...}` to [`zarr.create_array`][]. ([#3987](https://github.com/zarr-developers/zarr-python/pull/3987)) ### Bugfixes @@ -27,24 +27,24 @@ - Fixed `BytesCodec.from_dict` so that `BytesCodec` instances roundtrip to / from their dict representation. `BytesCodec.from_dict` now interprets a missing `endian` configuration as `endian=None` (matching what `BytesCodec.to_dict` - emits), instead of falling back to the system's native byte order. ([#3417](https://github.com/zarr-developers/zarr-python/issues/3417)) + emits), instead of falling back to the system's native byte order. ([#3417](https://github.com/zarr-developers/zarr-python/pull/3417)) - Fixed `save_array`, `Group.__setitem__`, and `load` for 0-dimensional arrays. ([#3469](https://github.com/zarr-developers/zarr-python/issues/3469)) -- Fixed inner-codec spec evolution for sharded arrays. The sharding codec now threads the array spec through its inner codec chain when evolving codecs, so a codec that changes the dtype upstream of `BytesCodec` no longer leaves the inner chain evolved against the wrong spec (which previously failed at decode time). This runs on the default `BatchedCodecPipeline` as well. Standard inner chains (`[BytesCodec]`, `[BytesCodec, ZstdCodec]`, transpose + bytes) are byte-identical to before. Restores the behavior of #2179. ([#3885](https://github.com/zarr-developers/zarr-python/issues/3885)) +- Fixed inner-codec spec evolution for sharded arrays. The sharding codec now threads the array spec through its inner codec chain when evolving codecs, so a codec that changes the dtype upstream of `BytesCodec` no longer leaves the inner chain evolved against the wrong spec (which previously failed at decode time). This runs on the default `BatchedCodecPipeline` as well. Standard inner chains (`[BytesCodec]`, `[BytesCodec, ZstdCodec]`, transpose + bytes) are byte-identical to before. Restores the behavior of #2179. ([#3885](https://github.com/zarr-developers/zarr-python/pull/3885)) - Make chunk normalization properly handle `-1` as a compact representation of the length of an entire axis. Reject several previously-accepted but ill-defined chunk specifications: `chunks=True` (previously silently produced size-1 chunks), chunk tuples shorter than the array's number of dimensions (previously padded to the array's shape), and `None` as a per-dimension chunk size. These all now raise informative errors. Also fix chunk handling for 0-length array dimensions, - and add explicit rejection of 0-length chunks. ([#3899](https://github.com/zarr-developers/zarr-python/issues/3899)) + and add explicit rejection of 0-length chunks. ([#3899](https://github.com/zarr-developers/zarr-python/pull/3899)) - Handle missing consolidated metadata in leaf Group nodes. ([#3954](https://github.com/zarr-developers/zarr-python/issues/3954)) - Corrected the JSON type definitions for the `numpy.datetime64` and `numpy.timedelta64` data types in Zarr V3 metadata: the `configuration` object (holding `unit` and `scale_factor`) is now required, matching the published specifications for these data types. Also updated the specification links in - the docstrings to point to the zarr-extensions repository. ([#3955](https://github.com/zarr-developers/zarr-python/issues/3955)) + the docstrings to point to the zarr-extensions repository. ([#3955](https://github.com/zarr-developers/zarr-python/pull/3955)) - Fixed writing to 0-dimensional arrays that use the sharding codec. Previously - assigning to a 0-dimensional sharded array raised an error. ([#3966](https://github.com/zarr-developers/zarr-python/issues/3966)) + assigning to a 0-dimensional sharded array raised an error. ([#3966](https://github.com/zarr-developers/zarr-python/pull/3966)) - Fix flaky stateful test bookkeeping when `delete_dir` matches string prefixes instead of true directory descendants. Previously a path such as `6/faNT…` could be incorrectly removed when deleting `6/f`. (See [issue #3977](https://github.com/zarr-developers/zarr-python/issues/3977).) ([#3977](https://github.com/zarr-developers/zarr-python/issues/3977)) - `FsspecStore.from_url()` and `from_mapper()` now close the async filesystem they create when `store.close()` is called. Previously the underlying aiohttp @@ -64,7 +64,7 @@ s3fs with ``cache_regions=True``) may internally refresh and replace their client during I/O operations, abandoning prior sessions before ``store.close()`` is invoked. Those intermediate sessions are outside the scope of this fix and - are an issue in the upstream filesystem library. ([#4003](https://github.com/zarr-developers/zarr-python/issues/4003)) + are an issue in the upstream filesystem library. ([#4003](https://github.com/zarr-developers/zarr-python/pull/4003)) - Fixed an invalid `zarr.create_array` example in the quick-start documentation (it passed an unsupported `mode` argument) and made the cloud-storage example execute against a mock S3 backend in CI. Added a test ensuring every Python code block in the documentation is either executed or explicitly opted out with a documented reason, so an invalid example can no longer go untested. ([#4016](https://github.com/zarr-developers/zarr-python/issues/4016)) - Fixed `ObjectStore.list_dir` for object-store listings that include a directory-marker object matching the requested non-root prefix. ([#4032](https://github.com/zarr-developers/zarr-python/issues/4032)) @@ -77,9 +77,9 @@ - `ZipStore.close()` no longer raises `AttributeError` when the store was created but never opened (including when used as a context manager without any I/O). - `codecs_from_list` now raises a descriptive `TypeError` when a `BytesBytesCodec` immediately follows an `ArrayArrayCodec`, instead of a misleading "Required ArrayBytesCodec was not found" `ValueError`. - ([#4074](https://github.com/zarr-developers/zarr-python/issues/4074)) + ([#4074](https://github.com/zarr-developers/zarr-python/pull/4074)) -- Fixed writing Fortran-ordered (F-contiguous) arrays through the variable-length string and bytes codecs and through numcodecs array-array filters such as `Delta`, `FixedScaleOffset` and `PackBits`. Chunks are now passed to numcodecs as C-contiguous arrays, so elements are no longer stored in transposed order. ([#4116](https://github.com/zarr-developers/zarr-python/issues/4116)) +- Fixed writing Fortran-ordered (F-contiguous) arrays through the variable-length string and bytes codecs and through numcodecs array-array filters such as `Delta`, `FixedScaleOffset` and `PackBits`. Chunks are now passed to numcodecs as C-contiguous arrays, so elements are no longer stored in transposed order. ([#4116](https://github.com/zarr-developers/zarr-python/pull/4116)) - Fix silent byte-order corruption for structured dtypes with the `bytes` codec: multi-byte fields are now byte-swapped to the codec's configured `endian` on write and decoded honoring it on read, so non-native-endian structured data (e.g. big-endian fields, as produced by virtual references to external data) round-trips correctly. ([#4141](https://github.com/zarr-developers/zarr-python/issues/4141)) ### Improved Documentation @@ -88,7 +88,7 @@ - Clarify the difference between `zarr.load` and `zarr.open` in their docstrings. `load` eagerly reads data into an in-memory array, while `open` returns a lazy `Array` or `Group` backed by the store, with `See Also` cross-references - linking the two. ([#3984](https://github.com/zarr-developers/zarr-python/issues/3984)) + linking the two. ([#3984](https://github.com/zarr-developers/zarr-python/pull/3984)) - Updated the custom dtype example in `examples/custom_dtype/custom_dtype.py` to use only the public API, eliminating all non-public imports, illustrating what users should do. @@ -109,16 +109,16 @@ `DataTypeValidationError` was *moved* to `zarr.errors`. Importing it from `zarr.core.dtype.common` (its original location), `zarr.core.dtype`, or `zarr.dtype` still works but now raises a `ZarrDeprecationWarning`. The remaining - types and functions are simply re-exported from the listed public module. ([#4052](https://github.com/zarr-developers/zarr-python/issues/4052)) + types and functions are simply re-exported from the listed public module. ([#4052](https://github.com/zarr-developers/zarr-python/pull/4052)) -- Document a self-merge policy in the contributor guide, describing when a core developer may merge their own pull request without a second reviewer and which changes warrant more caution. ([#4053](https://github.com/zarr-developers/zarr-python/issues/4053)) +- Document a self-merge policy in the contributor guide, describing when a core developer may merge their own pull request without a second reviewer and which changes warrant more caution. ([#4053](https://github.com/zarr-developers/zarr-python/pull/4053)) - Fixed many documentation errors found in a full review of the user guide, including prose contradicted by rendered example output on the performance page, invisible code blocks, an incorrect S3 example, stale "not yet implemented" claims in the v3 migration guide, and undocumented optional dependency groups. Also improved navigation order, cross-linking between pages, and coverage of group member - enumeration, bulk attribute updates, and the `use_consolidated` keyword. ([#4132](https://github.com/zarr-developers/zarr-python/issues/4132)) -- Fixed the documented default of ``max_age_seconds`` in the ``CacheStore`` docstring: the default is ``"infinity"`` (no expiration), not ``None``, which is rejected. Also noted that ``cache_store`` must support deletes. ([#4133](https://github.com/zarr-developers/zarr-python/issues/4133)) + enumeration, bulk attribute updates, and the `use_consolidated` keyword. ([#4132](https://github.com/zarr-developers/zarr-python/pull/4132)) +- Fixed the documented default of ``max_age_seconds`` in the ``CacheStore`` docstring: the default is ``"infinity"`` (no expiration), not ``None``, which is rejected. Also noted that ``cache_store`` must support deletes. ([#4133](https://github.com/zarr-developers/zarr-python/pull/4133)) ### Deprecations and Removals @@ -133,7 +133,7 @@ aliases ``Shuffle`` and ``CName`` are now ``BloscShuffleLiteral`` and ``BloscCnameLiteral``, the constant ``SHUFFLE`` is now ``BLOSC_SHUFFLE`` (with a new ``BLOSC_CNAME`` alongside it), and ``BloscShuffle.from_int`` - now returns a literal string rather than an enum member. ([#3963](https://github.com/zarr-developers/zarr-python/issues/3963)) + now returns a literal string rather than an enum member. ([#3963](https://github.com/zarr-developers/zarr-python/pull/3963)) - The ``Endian`` (``zarr.codecs.bytes.Endian``) and ``ShardingCodecIndexLocation`` (``zarr.codecs.ShardingCodecIndexLocation``) enums are now deprecated. Pass the @@ -156,13 +156,13 @@ Additionally, the module-level function ``zarr.codecs.sharding.parse_index_location`` was made private as part of this change. - ([#3968](https://github.com/zarr-developers/zarr-python/issues/3968)) + ([#3968](https://github.com/zarr-developers/zarr-python/pull/3968)) -- Removed the NumPy 1.x implementation of the `VariableLengthUTF8` data type because NumPy 1.x is no longer supported under [SPEC0](https://scientific-python.org/specs/spec-0000/). ([#3973](https://github.com/zarr-developers/zarr-python/issues/3973)) +- Removed the NumPy 1.x implementation of the `VariableLengthUTF8` data type because NumPy 1.x is no longer supported under [SPEC0](https://scientific-python.org/specs/spec-0000/). ([#3973](https://github.com/zarr-developers/zarr-python/pull/3973)) ### Misc -- [#214](https://github.com/zarr-developers/zarr-python/issues/214), [#215](https://github.com/zarr-developers/zarr-python/issues/215), [#3908](https://github.com/zarr-developers/zarr-python/issues/3908), [#3972](https://github.com/zarr-developers/zarr-python/issues/3972), [#3975](https://github.com/zarr-developers/zarr-python/issues/3975), [#3979](https://github.com/zarr-developers/zarr-python/issues/3979), [#3990](https://github.com/zarr-developers/zarr-python/issues/3990), [#3998](https://github.com/zarr-developers/zarr-python/issues/3998), [#4000](https://github.com/zarr-developers/zarr-python/issues/4000), [#4001](https://github.com/zarr-developers/zarr-python/issues/4001), [#4046](https://github.com/zarr-developers/zarr-python/issues/4046), [#4054](https://github.com/zarr-developers/zarr-python/issues/4054), [#4073](https://github.com/zarr-developers/zarr-python/issues/4073), [#4086](https://github.com/zarr-developers/zarr-python/issues/4086), [#4138](https://github.com/zarr-developers/zarr-python/issues/4138) +- [#214](https://github.com/zarr-developers/zarr-python/issues/214), [#215](https://github.com/zarr-developers/zarr-python/pull/215), [#3908](https://github.com/zarr-developers/zarr-python/pull/3908), [#3972](https://github.com/zarr-developers/zarr-python/pull/3972), [#3975](https://github.com/zarr-developers/zarr-python/pull/3975), [#3979](https://github.com/zarr-developers/zarr-python/pull/3979), [#3990](https://github.com/zarr-developers/zarr-python/pull/3990), [#3998](https://github.com/zarr-developers/zarr-python/pull/3998), [#4000](https://github.com/zarr-developers/zarr-python/pull/4000), [#4001](https://github.com/zarr-developers/zarr-python/pull/4001), [#4046](https://github.com/zarr-developers/zarr-python/pull/4046), [#4054](https://github.com/zarr-developers/zarr-python/pull/4054), [#4073](https://github.com/zarr-developers/zarr-python/issues/4073), [#4086](https://github.com/zarr-developers/zarr-python/issues/4086), [#4138](https://github.com/zarr-developers/zarr-python/pull/4138) ## 3.2.1 (2026-05-05) @@ -172,17 +172,17 @@ - Fixed a `CastValue` validation bug where the "can we use an out-of-range mode" check inspected the source dtype instead of the target dtype. This meant arrays with a float source dtype and an integer target dtype incorrectly raised a `ValueError` - when configured with a `wrap` out-of-range mode. ([#3938](https://github.com/zarr-developers/zarr-python/issues/3938)) + when configured with a `wrap` out-of-range mode. ([#3938](https://github.com/zarr-developers/zarr-python/pull/3938)) - Fixed a bug where the codec pipeline evolved each codec against the original array spec instead of the spec produced by upstream array-to-array codecs. This caused failures whenever an upstream codec changed the dtype between codec boundaries — e.g. arrays using `CastValue` to convert a single-byte source dtype (`int8`) to a multi-byte target dtype (`int16`) raised a `ValueError` from - `BytesCodec` about a missing `endian` configuration. ([#3941](https://github.com/zarr-developers/zarr-python/issues/3941)) + `BytesCodec` about a missing `endian` configuration. ([#3941](https://github.com/zarr-developers/zarr-python/pull/3941)) - Fixed breakage in existing fsspec-dependent workflows caused by associating the "memory" URL scheme with instances of `ManagedMemoryStore` instead of fsspec's memory-backed store. After this change, store URLs with a "memory" scheme are handled differently when `fsspec` is installed: with `fsspec`, a `FsspecStore` backed by a `MemoryFileSystem` is used. Without `fsspec`, -a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr-python/issues/3944)) +a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr-python/pull/3944)) ## 3.2.0 (2026-04-30) @@ -190,9 +190,9 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr - Adds a new in-memory storage backend called `ManagedMemoryStore`. Instances of `ManagedMemoryStore` function similarly to `MemoryStore`, but instances of `ManagedMemoryStore` can be constructed from - a URL like `memory://store`. ([#3679](https://github.com/zarr-developers/zarr-python/issues/3679)) -- Added `array.read_missing_chunks` configuration option. When set to `False`, reading missing chunks raises a `ChunkNotFoundError` instead of filling them with the array's fill value. ([#3748](https://github.com/zarr-developers/zarr-python/issues/3748)) -- Added `Struct` class (subclass of `Structured`) implementing the zarr-extensions `struct` dtype spec. Uses object-style field format and dict fill values. Legacy `Structured` remains available for backward compatibility. ([#3781](https://github.com/zarr-developers/zarr-python/issues/3781)) + a URL like `memory://store`. ([#3679](https://github.com/zarr-developers/zarr-python/pull/3679)) +- Added `array.read_missing_chunks` configuration option. When set to `False`, reading missing chunks raises a `ChunkNotFoundError` instead of filling them with the array's fill value. ([#3748](https://github.com/zarr-developers/zarr-python/pull/3748)) +- Added `Struct` class (subclass of `Structured`) implementing the zarr-extensions `struct` dtype spec. Uses object-style field format and dict fill values. Legacy `Structured` remains available for backward compatibility. ([#3781](https://github.com/zarr-developers/zarr-python/pull/3781)) - Add support for rectilinear (variable-sized) chunk grids. This feature is experimental and must be explicitly enabled via `zarr.config.set({'array.rectilinear_chunks': True})`. @@ -208,37 +208,37 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr **Breaking change**: The `validate` method on `BaseCodec` and `CodecPipeline` now receives a `ChunkGridMetadata` instance instead of a `ChunkGrid` instance for the `chunk_grid` parameter. Third-party codecs that override `validate` and inspect the chunk grid will need to - update their type annotations. No known downstream packages were using this parameter. ([#3802](https://github.com/zarr-developers/zarr-python/issues/3802)) + update their type annotations. No known downstream packages were using this parameter. ([#3802](https://github.com/zarr-developers/zarr-python/pull/3802)) -- Add `cast_value` and `scale_offset` codecs. ([#3874](https://github.com/zarr-developers/zarr-python/issues/3874)) +- Add `cast_value` and `scale_offset` codecs. ([#3874](https://github.com/zarr-developers/zarr-python/pull/3874)) ### Bugfixes - Fix `SyncError` raised when assigning a `zarr.Array` as the value in a `__setitem__` call (e.g. `dst[:] = src` where `src` is a zarr array). The source array is now converted to a NumPy array before entering the async codec pipeline. ([#3611](https://github.com/zarr-developers/zarr-python/issues/3611)) - Fix an issue that prevents the correct parsing of special NumPy `uint32` dtypes resulting e.g. - from bit wise operations on `uint32` arrays on Windows. ([#3797](https://github.com/zarr-developers/zarr-python/issues/3797)) + from bit wise operations on `uint32` arrays on Windows. ([#3797](https://github.com/zarr-developers/zarr-python/pull/3797)) - Fix `ZipStore.list()`, `list_dir()`, and `exists()` to auto-open the zip file when called before `open()`, consistent with the existing behavior of `get()` and `set()`. ([#3846](https://github.com/zarr-developers/zarr-python/issues/3846)) -- Fix handling of `NaT` default fill values for `datetime64` and `timedelta64` data types. Equality checks now use `numpy.isnat` so that the default fill value compares correctly against `NaT`. ([#3863](https://github.com/zarr-developers/zarr-python/issues/3863)) -- Use the unit associated with the `Datetime64` data type when creating the default `Nat` scalar value. ([#3920](https://github.com/zarr-developers/zarr-python/issues/3920)) +- Fix handling of `NaT` default fill values for `datetime64` and `timedelta64` data types. Equality checks now use `numpy.isnat` so that the default fill value compares correctly against `NaT`. ([#3863](https://github.com/zarr-developers/zarr-python/pull/3863)) +- Use the unit associated with the `Datetime64` data type when creating the default `Nat` scalar value. ([#3920](https://github.com/zarr-developers/zarr-python/pull/3920)) ### Improved Documentation - Document removal of `zarr.storage.init_group` in v3 migration guide, with replacement using `zarr.open_group`/`zarr.create_group`. ([#2720](https://github.com/zarr-developers/zarr-python/issues/2720)) - Document the `threading.max_workers` configuration option in the performance guide. ([#3492](https://github.com/zarr-developers/zarr-python/issues/3492)) - Corrects the type annotation reported for the `batch_info` parameter in the `CodecPipeline.write` - method docstring. ([#3836](https://github.com/zarr-developers/zarr-python/issues/3836)) -- Remove result="ansi" from code blocks in the user guide that were causing empty output cells in the rendered documentation. ([#3845](https://github.com/zarr-developers/zarr-python/issues/3845)) + method docstring. ([#3836](https://github.com/zarr-developers/zarr-python/pull/3836)) +- Remove result="ansi" from code blocks in the user guide that were causing empty output cells in the rendered documentation. ([#3845](https://github.com/zarr-developers/zarr-python/pull/3845)) ### Deprecations and Removals -- Remove deprecated `zarr.convenience` and `zarr.creation` modules. ([#3900](https://github.com/zarr-developers/zarr-python/issues/3900)) -- Remove the deprecated `zarr_version` parameter from several functions and methods. That parameter is replaced with `zarr_format`. ([#3901](https://github.com/zarr-developers/zarr-python/issues/3901)) -- Remove deprecated `Group` methods `array`, `require_dataset`, and `create_dataset`. ([#3902](https://github.com/zarr-developers/zarr-python/issues/3902)) -- Remove deprecated `AsyncArray.create` and `Array.create` methods. ([#3903](https://github.com/zarr-developers/zarr-python/issues/3903)) +- Remove deprecated `zarr.convenience` and `zarr.creation` modules. ([#3900](https://github.com/zarr-developers/zarr-python/pull/3900)) +- Remove the deprecated `zarr_version` parameter from several functions and methods. That parameter is replaced with `zarr_format`. ([#3901](https://github.com/zarr-developers/zarr-python/pull/3901)) +- Remove deprecated `Group` methods `array`, `require_dataset`, and `create_dataset`. ([#3902](https://github.com/zarr-developers/zarr-python/pull/3902)) +- Remove deprecated `AsyncArray.create` and `Array.create` methods. ([#3903](https://github.com/zarr-developers/zarr-python/pull/3903)) ### Misc -- [#3546](https://github.com/zarr-developers/zarr-python/issues/3546), [#3793](https://github.com/zarr-developers/zarr-python/issues/3793), [#3800](https://github.com/zarr-developers/zarr-python/issues/3800), [#3828](https://github.com/zarr-developers/zarr-python/issues/3828), [#3830](https://github.com/zarr-developers/zarr-python/issues/3830), [#3833](https://github.com/zarr-developers/zarr-python/issues/3833), [#3837](https://github.com/zarr-developers/zarr-python/issues/3837), [#3897](https://github.com/zarr-developers/zarr-python/issues/3897) +- [#3546](https://github.com/zarr-developers/zarr-python/issues/3546), [#3793](https://github.com/zarr-developers/zarr-python/pull/3793), [#3800](https://github.com/zarr-developers/zarr-python/pull/3800), [#3828](https://github.com/zarr-developers/zarr-python/pull/3828), [#3830](https://github.com/zarr-developers/zarr-python/pull/3830), [#3833](https://github.com/zarr-developers/zarr-python/pull/3833), [#3837](https://github.com/zarr-developers/zarr-python/pull/3837), [#3897](https://github.com/zarr-developers/zarr-python/pull/3897) ## 3.1.6 (2026-03-19) @@ -246,42 +246,42 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr ### Features - Exposes the array runtime configuration as an attribute called `config` on the `Array` and - `AsyncArray` classes. The previous `AsyncArray._config` attribute is now a deprecated alias for `AsyncArray.config`. ([#3668](https://github.com/zarr-developers/zarr-python/issues/3668)) -- Adds a method for creating a new `Array` / `AsyncArray` instance with a new runtime configuration, and fixes inaccurate documentation about the `write_empty_chunks` configuration parameter. ([#3668](https://github.com/zarr-developers/zarr-python/issues/3668)) + `AsyncArray` classes. The previous `AsyncArray._config` attribute is now a deprecated alias for `AsyncArray.config`. ([#3668](https://github.com/zarr-developers/zarr-python/pull/3668)) +- Adds a method for creating a new `Array` / `AsyncArray` instance with a new runtime configuration, and fixes inaccurate documentation about the `write_empty_chunks` configuration parameter. ([#3668](https://github.com/zarr-developers/zarr-python/pull/3668)) - Adds synchronous methods to stores that do not benefit from an async event loop. The shape of these methods is defined by protocol classes to support structural subtyping. ([#3725](https://github.com/zarr-developers/zarr-python/pull/3725)) - Fix near-miss penalty in `_morton_order` with hybrid ceiling+argsort strategy. ([#3718](https://github.com/zarr-developers/zarr-python/pull/3718)) ### Bugfixes -- Correct the target bytes number for auto-chunking when auto-sharding. ([#3603](https://github.com/zarr-developers/zarr-python/issues/3603)) -- Fixed a bug in the sharding codec that prevented nested shard reads in certain cases. ([#3655](https://github.com/zarr-developers/zarr-python/issues/3655)) -- Fix obstore `_transform_list_dir` implementation to correctly relativize paths (removing `lstrip` usage). ([#3657](https://github.com/zarr-developers/zarr-python/issues/3657)) -- Raise error when trying to encode `numpy.dtypes.StringDType` with `na_object` set. ([#3695](https://github.com/zarr-developers/zarr-python/issues/3695)) -- `CacheStore`, `LoggingStore` and `LatencyStore` now support with_read_only. ([#3700](https://github.com/zarr-developers/zarr-python/issues/3700)) -- Skip chunk coordinate enumeration in resize when the array is only growing, avoiding unbounded memory usage for large arrays. ([#3702](https://github.com/zarr-developers/zarr-python/issues/3702)) -- Fix a performance bug in morton curve generation. ([#3705](https://github.com/zarr-developers/zarr-python/issues/3705)) -- Add a dedicated in-memory cache for byte-range requests to the experimental `CacheStore`. ([#3710](https://github.com/zarr-developers/zarr-python/issues/3710)) +- Correct the target bytes number for auto-chunking when auto-sharding. ([#3603](https://github.com/zarr-developers/zarr-python/pull/3603)) +- Fixed a bug in the sharding codec that prevented nested shard reads in certain cases. ([#3655](https://github.com/zarr-developers/zarr-python/pull/3655)) +- Fix obstore `_transform_list_dir` implementation to correctly relativize paths (removing `lstrip` usage). ([#3657](https://github.com/zarr-developers/zarr-python/pull/3657)) +- Raise error when trying to encode `numpy.dtypes.StringDType` with `na_object` set. ([#3695](https://github.com/zarr-developers/zarr-python/pull/3695)) +- `CacheStore`, `LoggingStore` and `LatencyStore` now support with_read_only. ([#3700](https://github.com/zarr-developers/zarr-python/pull/3700)) +- Skip chunk coordinate enumeration in resize when the array is only growing, avoiding unbounded memory usage for large arrays. ([#3702](https://github.com/zarr-developers/zarr-python/pull/3702)) +- Fix a performance bug in morton curve generation. ([#3705](https://github.com/zarr-developers/zarr-python/pull/3705)) +- Add a dedicated in-memory cache for byte-range requests to the experimental `CacheStore`. ([#3710](https://github.com/zarr-developers/zarr-python/pull/3710)) - `BaseFloat._check_scalar` rejects invalid string values. ([#3586](https://github.com/zarr-developers/zarr-python/issues/3586)) -- Apply drop_axes squeeze in partial decode path for sharding. ([#3763](https://github.com/zarr-developers/zarr-python/issues/3763)) -- Set `copy=False` in reshape operation. ([#3649](https://github.com/zarr-developers/zarr-python/issues/3649)) -- Validate that dask-style chunks have regular shapes. ([#3779](https://github.com/zarr-developers/zarr-python/issues/3779)) +- Apply drop_axes squeeze in partial decode path for sharding. ([#3763](https://github.com/zarr-developers/zarr-python/pull/3763)) +- Set `copy=False` in reshape operation. ([#3649](https://github.com/zarr-developers/zarr-python/pull/3649)) +- Validate that dask-style chunks have regular shapes. ([#3779](https://github.com/zarr-developers/zarr-python/pull/3779)) ### Improved Documentation - Add documentation example for creating uncompressed arrays in the Compression section of the user guide. ([#3464](https://github.com/zarr-developers/zarr-python/issues/3464)) -- Add AI-assisted code policy to the contributing guide. ([#3769](https://github.com/zarr-developers/zarr-python/issues/3769)) -- Added a glossary. ([#3767](https://github.com/zarr-developers/zarr-python/issues/3767)) +- Add AI-assisted code policy to the contributing guide. ([#3769](https://github.com/zarr-developers/zarr-python/pull/3769)) +- Added a glossary. ([#3767](https://github.com/zarr-developers/zarr-python/pull/3767)) ### Misc -- [#3562](https://github.com/zarr-developers/zarr-python/issues/3562), [#3605](https://github.com/zarr-developers/zarr-python/issues/3605), [#3619](https://github.com/zarr-developers/zarr-python/issues/3619), [#3623](https://github.com/zarr-developers/zarr-python/issues/3623), [#3636](https://github.com/zarr-developers/zarr-python/issues/3636), [#3648](https://github.com/zarr-developers/zarr-python/issues/3648), [#3656](https://github.com/zarr-developers/zarr-python/issues/3656), [#3658](https://github.com/zarr-developers/zarr-python/issues/3658), [#3673](https://github.com/zarr-developers/zarr-python/issues/3673), [#3704](https://github.com/zarr-developers/zarr-python/issues/3704), [#3706](https://github.com/zarr-developers/zarr-python/issues/3706), [#3708](https://github.com/zarr-developers/zarr-python/issues/3708), [#3712](https://github.com/zarr-developers/zarr-python/issues/3712), [#3713](https://github.com/zarr-developers/zarr-python/issues/3713), [#3717](https://github.com/zarr-developers/zarr-python/issues/3717), [#3721](https://github.com/zarr-developers/zarr-python/issues/3721), [#3728](https://github.com/zarr-developers/zarr-python/issues/3728), [#3778](https://github.com/zarr-developers/zarr-python/issues/3778) +- [#3562](https://github.com/zarr-developers/zarr-python/pull/3562), [#3605](https://github.com/zarr-developers/zarr-python/pull/3605), [#3619](https://github.com/zarr-developers/zarr-python/pull/3619), [#3623](https://github.com/zarr-developers/zarr-python/pull/3623), [#3636](https://github.com/zarr-developers/zarr-python/pull/3636), [#3648](https://github.com/zarr-developers/zarr-python/pull/3648), [#3656](https://github.com/zarr-developers/zarr-python/pull/3656), [#3658](https://github.com/zarr-developers/zarr-python/pull/3658), [#3673](https://github.com/zarr-developers/zarr-python/pull/3673), [#3704](https://github.com/zarr-developers/zarr-python/pull/3704), [#3706](https://github.com/zarr-developers/zarr-python/pull/3706), [#3708](https://github.com/zarr-developers/zarr-python/pull/3708), [#3712](https://github.com/zarr-developers/zarr-python/pull/3712), [#3713](https://github.com/zarr-developers/zarr-python/pull/3713), [#3717](https://github.com/zarr-developers/zarr-python/pull/3717), [#3721](https://github.com/zarr-developers/zarr-python/pull/3721), [#3728](https://github.com/zarr-developers/zarr-python/pull/3728), [#3778](https://github.com/zarr-developers/zarr-python/pull/3778) ## 3.1.5 (2025-11-21) ### Bugfixes -- Fix formatting errors in the release notes section of the docs. ([#3594](https://github.com/zarr-developers/zarr-python/issues/3594)) +- Fix formatting errors in the release notes section of the docs. ([#3594](https://github.com/zarr-developers/zarr-python/pull/3594)) ## 3.1.4 (2025-11-20) @@ -289,31 +289,31 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr ### Features - The `Array` class can now also be parametrized in the same manner as the `AsyncArray` class, allowing Zarr format v2 and v3 `Array`s to be distinguished. - New types have been added to `zarr.types` to help with this. ([#3304](https://github.com/zarr-developers/zarr-python/issues/3304)) -- Adds `zarr.experimental.cache_store.CacheStore`, a `Store` that implements caching by combining two other `Store` instances. See the [docs page](https://zarr.readthedocs.io/en/latest/user-guide/experimental#cachestore) for more information about this feature. ([#3366](https://github.com/zarr-developers/zarr-python/issues/3366)) -- Adds a `zarr.experimental` module for unstable user-facing features. ([#3490](https://github.com/zarr-developers/zarr-python/issues/3490)) -- Add a `array.target_shard_size_bytes` to [`zarr.config`][] to allow users to set a maximum number of bytes per-shard when `shards="auto"` in, for example, [`zarr.create_array`][]. ([#3547](https://github.com/zarr-developers/zarr-python/issues/3547)) -- Make `async_array` on the [`zarr.Array`][] class public (`_async_array` will remain untouched, but its stability is not guaranteed). ([#3556](https://github.com/zarr-developers/zarr-python/issues/3556)) + New types have been added to `zarr.types` to help with this. ([#3304](https://github.com/zarr-developers/zarr-python/pull/3304)) +- Adds `zarr.experimental.cache_store.CacheStore`, a `Store` that implements caching by combining two other `Store` instances. See the [docs page](https://zarr.readthedocs.io/en/latest/user-guide/experimental#cachestore) for more information about this feature. ([#3366](https://github.com/zarr-developers/zarr-python/pull/3366)) +- Adds a `zarr.experimental` module for unstable user-facing features. ([#3490](https://github.com/zarr-developers/zarr-python/pull/3490)) +- Add a `array.target_shard_size_bytes` to [`zarr.config`][] to allow users to set a maximum number of bytes per-shard when `shards="auto"` in, for example, [`zarr.create_array`][]. ([#3547](https://github.com/zarr-developers/zarr-python/pull/3547)) +- Make `async_array` on the [`zarr.Array`][] class public (`_async_array` will remain untouched, but its stability is not guaranteed). ([#3556](https://github.com/zarr-developers/zarr-python/pull/3556)) ### Bugfixes -- Fix a bug that prevented `PCodec` from being properly resolved when loading arrays using that compressor. ([#3483](https://github.com/zarr-developers/zarr-python/issues/3483)) +- Fix a bug that prevented `PCodec` from being properly resolved when loading arrays using that compressor. ([#3483](https://github.com/zarr-developers/zarr-python/pull/3483)) - Fixed a bug that prevented Zarr Python from opening Zarr V3 array metadata documents that contained - extra keys with permissible values (dicts with a `"must_understand"` key set to `"false"`). ([#3530](https://github.com/zarr-developers/zarr-python/issues/3530)) + extra keys with permissible values (dicts with a `"must_understand"` key set to `"false"`). ([#3530](https://github.com/zarr-developers/zarr-python/pull/3530)) - Fixed a bug where the `"consolidated_metadata"` key was written to metadata documents even when - consolidated metadata was not used, resulting in invalid metadata documents. ([#3535](https://github.com/zarr-developers/zarr-python/issues/3535)) + consolidated metadata was not used, resulting in invalid metadata documents. ([#3535](https://github.com/zarr-developers/zarr-python/pull/3535)) - Improve write performance to large shards by up to 10x. ([#3560](https://github.com/zarr-developers/zarr-python/issues/3560)) ### Improved Documentation -- Use mkdocs-material for Zarr-Python documentation ([#3118](https://github.com/zarr-developers/zarr-python/issues/3118)) +- Use mkdocs-material for Zarr-Python documentation ([#3118](https://github.com/zarr-developers/zarr-python/pull/3118)) - Document different values of StoreLike with examples in the user guide. ([#3303](https://github.com/zarr-developers/zarr-python/issues/3303)) -- Reorganize the top-level `examples` directory to give each example its own sub-directory. Adds content to the docs for each example. ([#3502](https://github.com/zarr-developers/zarr-python/issues/3502)) +- Reorganize the top-level `examples` directory to give each example its own sub-directory. Adds content to the docs for each example. ([#3502](https://github.com/zarr-developers/zarr-python/pull/3502)) - Updated 3.0 Migration Guide to include function signature change to zarr.Array.resize function. ([#3536](https://github.com/zarr-developers/zarr-python/issues/3536)) ### Misc -- [#3515](https://github.com/zarr-developers/zarr-python/issues/3515), [#3532](https://github.com/zarr-developers/zarr-python/issues/3532), [#3533](https://github.com/zarr-developers/zarr-python/issues/3533), [#3553](https://github.com/zarr-developers/zarr-python/issues/3553) +- [#3515](https://github.com/zarr-developers/zarr-python/pull/3515), [#3532](https://github.com/zarr-developers/zarr-python/pull/3532), [#3533](https://github.com/zarr-developers/zarr-python/pull/3533), [#3553](https://github.com/zarr-developers/zarr-python/pull/3553) ## 3.1.3 (2025-09-18) @@ -321,20 +321,20 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr ### Features - Add a command-line interface to migrate v2 Zarr metadata to v3. Corresponding functions are also provided under zarr.metadata. ([#1798](https://github.com/zarr-developers/zarr-python/issues/1798)) -- Add obstore implementation of delete_dir. ([#3310](https://github.com/zarr-developers/zarr-python/issues/3310)) -- Adds a registry for chunk key encodings for extensibility. This allows users to implement a custom `ChunkKeyEncoding`, which can be registered via `register_chunk_key_encoding` or as an entry point under `zarr.chunk_key_encoding`. ([#3436](https://github.com/zarr-developers/zarr-python/issues/3436)) -- Trying to open a group at a path where an array already exists now raises a helpful error. ([#3444](https://github.com/zarr-developers/zarr-python/issues/3444)) +- Add obstore implementation of delete_dir. ([#3310](https://github.com/zarr-developers/zarr-python/pull/3310)) +- Adds a registry for chunk key encodings for extensibility. This allows users to implement a custom `ChunkKeyEncoding`, which can be registered via `register_chunk_key_encoding` or as an entry point under `zarr.chunk_key_encoding`. ([#3436](https://github.com/zarr-developers/zarr-python/pull/3436)) +- Trying to open a group at a path where an array already exists now raises a helpful error. ([#3444](https://github.com/zarr-developers/zarr-python/pull/3444)) ### Bugfixes - Prevents creation of groups (.create_group) or arrays (.create_array) as children of an existing array. ([#2582](https://github.com/zarr-developers/zarr-python/issues/2582)) -- Fix a bug preventing `ones_like`, `full_like`, `empty_like`, `zeros_like` and `open_like` functions from accepting an explicit specification of array attributes like shape, dtype, chunks etc. The functions `full_like`, `empty_like`, and `open_like` now also more consistently infer a `fill_value` parameter from the provided array. ([#2992](https://github.com/zarr-developers/zarr-python/issues/2992)) +- Fix a bug preventing `ones_like`, `full_like`, `empty_like`, `zeros_like` and `open_like` functions from accepting an explicit specification of array attributes like shape, dtype, chunks etc. The functions `full_like`, `empty_like`, and `open_like` now also more consistently infer a `fill_value` parameter from the provided array. ([#2992](https://github.com/zarr-developers/zarr-python/pull/2992)) - LocalStore now uses atomic writes, which should prevent some cases of corrupted data. ([#3411](https://github.com/zarr-developers/zarr-python/issues/3411)) -- Fix a potential race condition when using `zarr.create_array` with the `data` parameter set to a NumPy array. Previously Zarr was iterating over the newly created array with a granularity that was too low. Now Zarr chooses a granularity that matches the size of the stored objects for that array. ([#3422](https://github.com/zarr-developers/zarr-python/issues/3422)) -- Fix ChunkGrid definition (broken in 3.1.2) ([#3425](https://github.com/zarr-developers/zarr-python/issues/3425)) -- Ensure syntax like `root['/subgroup']` works equivalently to `root['subgroup']` when using consolidated metadata. ([#3428](https://github.com/zarr-developers/zarr-python/issues/3428)) -- Creating a new group with `zarr.group` no longer errors. This fixes a regression introduced in version 3.1.2. ([#3431](https://github.com/zarr-developers/zarr-python/issues/3431)) -- Setting `fill_value` to a float like `0.0` when the data type of the array is an integer is a common mistake. This change lets Zarr Python read arrays with this erroneous metadata, although Zarr Python will not create such arrays. ([#3448](https://github.com/zarr-developers/zarr-python/issues/3448)) +- Fix a potential race condition when using `zarr.create_array` with the `data` parameter set to a NumPy array. Previously Zarr was iterating over the newly created array with a granularity that was too low. Now Zarr chooses a granularity that matches the size of the stored objects for that array. ([#3422](https://github.com/zarr-developers/zarr-python/pull/3422)) +- Fix ChunkGrid definition (broken in 3.1.2) ([#3425](https://github.com/zarr-developers/zarr-python/pull/3425)) +- Ensure syntax like `root['/subgroup']` works equivalently to `root['subgroup']` when using consolidated metadata. ([#3428](https://github.com/zarr-developers/zarr-python/pull/3428)) +- Creating a new group with `zarr.group` no longer errors. This fixes a regression introduced in version 3.1.2. ([#3431](https://github.com/zarr-developers/zarr-python/pull/3431)) +- Setting `fill_value` to a float like `0.0` when the data type of the array is an integer is a common mistake. This change lets Zarr Python read arrays with this erroneous metadata, although Zarr Python will not create such arrays. ([#3448](https://github.com/zarr-developers/zarr-python/pull/3448)) ### Deprecations and Removals @@ -342,56 +342,56 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr ### Misc -- [#3376](https://github.com/zarr-developers/zarr-python/issues/3376), [#3390](https://github.com/zarr-developers/zarr-python/issues/3390), [#3403](https://github.com/zarr-developers/zarr-python/issues/3403), [#3449](https://github.com/zarr-developers/zarr-python/issues/3449) +- [#3376](https://github.com/zarr-developers/zarr-python/pull/3376), [#3390](https://github.com/zarr-developers/zarr-python/pull/3390), [#3403](https://github.com/zarr-developers/zarr-python/pull/3403), [#3449](https://github.com/zarr-developers/zarr-python/pull/3449) ## 3.1.2 (2025-08-25) ### Features -- Added support for async vectorized and orthogonal indexing. ([#3083](https://github.com/zarr-developers/zarr-python/issues/3083)) -- Make config param optional in init_array ([#3391](https://github.com/zarr-developers/zarr-python/issues/3391)) +- Added support for async vectorized and orthogonal indexing. ([#3083](https://github.com/zarr-developers/zarr-python/pull/3083)) +- Make config param optional in init_array ([#3391](https://github.com/zarr-developers/zarr-python/pull/3391)) ### Bugfixes - Ensure that -0.0 is not considered equal to 0.0 when checking if all the values in a chunk are equal to an array's fill value. ([#3144](https://github.com/zarr-developers/zarr-python/issues/3144)) -- Fix a bug in `create_array` caused by iterating over chunk-aligned regions instead of shard-aligned regions when writing data. Additionally, the behavior of `nchunks_initialized` has been adjusted. This function consistently reports the number of chunks present in stored objects, even when the array uses the sharding codec. ([#3299](https://github.com/zarr-developers/zarr-python/issues/3299)) -- Opening an array or group with `mode="r+"` will no longer create new arrays or groups. ([#3307](https://github.com/zarr-developers/zarr-python/issues/3307)) -- Added `zarr.errors.ArrayNotFoundError`, which is raised when attempting to open a zarr array that does not exist, and `zarr.errors.NodeNotFoundError`, which is raised when failing to open an array or a group in a context where either an array or a group was expected. ([#3367](https://github.com/zarr-developers/zarr-python/issues/3367)) -- Ensure passing `config` is handled properly when `open`ing an existing array. ([#3378](https://github.com/zarr-developers/zarr-python/issues/3378)) -- Raise a Zarr-specific error class when a codec can't be found by name when deserializing the given codecs. This avoids hiding this error behind a "not part of a zarr hierarchy" warning. ([#3395](https://github.com/zarr-developers/zarr-python/issues/3395)) +- Fix a bug in `create_array` caused by iterating over chunk-aligned regions instead of shard-aligned regions when writing data. Additionally, the behavior of `nchunks_initialized` has been adjusted. This function consistently reports the number of chunks present in stored objects, even when the array uses the sharding codec. ([#3299](https://github.com/zarr-developers/zarr-python/pull/3299)) +- Opening an array or group with `mode="r+"` will no longer create new arrays or groups. ([#3307](https://github.com/zarr-developers/zarr-python/pull/3307)) +- Added `zarr.errors.ArrayNotFoundError`, which is raised when attempting to open a zarr array that does not exist, and `zarr.errors.NodeNotFoundError`, which is raised when failing to open an array or a group in a context where either an array or a group was expected. ([#3367](https://github.com/zarr-developers/zarr-python/pull/3367)) +- Ensure passing `config` is handled properly when `open`ing an existing array. ([#3378](https://github.com/zarr-developers/zarr-python/pull/3378)) +- Raise a Zarr-specific error class when a codec can't be found by name when deserializing the given codecs. This avoids hiding this error behind a "not part of a zarr hierarchy" warning. ([#3395](https://github.com/zarr-developers/zarr-python/pull/3395)) ### Misc -- [#3098](https://github.com/zarr-developers/zarr-python/issues/3098), [#3288](https://github.com/zarr-developers/zarr-python/issues/3288), [#3318](https://github.com/zarr-developers/zarr-python/issues/3318), [#3368](https://github.com/zarr-developers/zarr-python/issues/3368), [#3371](https://github.com/zarr-developers/zarr-python/issues/3371), [#3372](https://github.com/zarr-developers/zarr-python/issues/3372), [#3374](https://github.com/zarr-developers/zarr-python/issues/3374) +- [#3098](https://github.com/zarr-developers/zarr-python/pull/3098), [#3288](https://github.com/zarr-developers/zarr-python/pull/3288), [#3318](https://github.com/zarr-developers/zarr-python/pull/3318), [#3368](https://github.com/zarr-developers/zarr-python/issues/3368), [#3371](https://github.com/zarr-developers/zarr-python/pull/3371), [#3372](https://github.com/zarr-developers/zarr-python/pull/3372), [#3374](https://github.com/zarr-developers/zarr-python/pull/3374) ## 3.1.1 (2025-07-28) ### Features -- Add lightweight implementations of `.getsize()` and `.getsize_prefix()` for ObjectStore. ([#3227](https://github.com/zarr-developers/zarr-python/issues/3227)) +- Add lightweight implementations of `.getsize()` and `.getsize_prefix()` for ObjectStore. ([#3227](https://github.com/zarr-developers/zarr-python/pull/3227)) ### Bugfixes -- Creating a Zarr format 2 array with the `order` keyword argument no longer raises a warning. ([#3112](https://github.com/zarr-developers/zarr-python/issues/3112)) -- Fixed the error message when passing both `config` and `write_empty_chunks` arguments to reflect the current behaviour (`write_empty_chunks` takes precedence). ([#3112](https://github.com/zarr-developers/zarr-python/issues/3112)) -- Creating a Zarr format 3 array with the `order` argument now consistently ignores this argument and raises a warning. ([#3112](https://github.com/zarr-developers/zarr-python/issues/3112)) -- When using [`from_array`][zarr.api.asynchronous.from_array] to copy a Zarr format 2 array to a Zarr format 3 array, if the memory order of the input array is `"F"` a warning is raised and the order ignored. This is because Zarr format 3 arrays are always stored in "C" order. ([#3112](https://github.com/zarr-developers/zarr-python/issues/3112)) -- The `config` argument to [`zarr.create`][zarr.create] (and functions that create arrays) is now used - previously it had no effect. ([#3112](https://github.com/zarr-developers/zarr-python/issues/3112)) -- Ensure that all abstract methods of [`ZDType`][zarr.core.dtype.ZDType] raise a `NotImplementedError` when invoked. ([#3251](https://github.com/zarr-developers/zarr-python/issues/3251)) -- Register 'gpu' marker with pytest for downstream StoreTests. ([#3258](https://github.com/zarr-developers/zarr-python/issues/3258)) +- Creating a Zarr format 2 array with the `order` keyword argument no longer raises a warning. ([#3112](https://github.com/zarr-developers/zarr-python/pull/3112)) +- Fixed the error message when passing both `config` and `write_empty_chunks` arguments to reflect the current behaviour (`write_empty_chunks` takes precedence). ([#3112](https://github.com/zarr-developers/zarr-python/pull/3112)) +- Creating a Zarr format 3 array with the `order` argument now consistently ignores this argument and raises a warning. ([#3112](https://github.com/zarr-developers/zarr-python/pull/3112)) +- When using [`from_array`][zarr.api.asynchronous.from_array] to copy a Zarr format 2 array to a Zarr format 3 array, if the memory order of the input array is `"F"` a warning is raised and the order ignored. This is because Zarr format 3 arrays are always stored in "C" order. ([#3112](https://github.com/zarr-developers/zarr-python/pull/3112)) +- The `config` argument to [`zarr.create`][zarr.create] (and functions that create arrays) is now used - previously it had no effect. ([#3112](https://github.com/zarr-developers/zarr-python/pull/3112)) +- Ensure that all abstract methods of [`ZDType`][zarr.core.dtype.ZDType] raise a `NotImplementedError` when invoked. ([#3251](https://github.com/zarr-developers/zarr-python/pull/3251)) +- Register 'gpu' marker with pytest for downstream StoreTests. ([#3258](https://github.com/zarr-developers/zarr-python/pull/3258)) - Expand the range of types accepted by `parse_data_type` to include strings and Sequences. -- Move the functionality of `zarr.core.dtype.parse_data_type` to a new function called `zarr.dtype.parse_dtype`. This change ensures that nomenclature is consistent across the codebase. `zarr.core.dtype.parse_data_type` remains, so this change is not breaking. ([#3264](https://github.com/zarr-developers/zarr-python/issues/3264)) -- Fix a regression introduced in 3.1.0 that prevented `inf`, `-inf`, and `nan` values from being stored in `attributes`. ([#3280](https://github.com/zarr-developers/zarr-python/issues/3280)) -- Fixes [`Group.nmembers()`][zarr.Group.nmembers] ignoring depth when using consolidated metadata. ([#3287](https://github.com/zarr-developers/zarr-python/issues/3287)) +- Move the functionality of `zarr.core.dtype.parse_data_type` to a new function called `zarr.dtype.parse_dtype`. This change ensures that nomenclature is consistent across the codebase. `zarr.core.dtype.parse_data_type` remains, so this change is not breaking. ([#3264](https://github.com/zarr-developers/zarr-python/pull/3264)) +- Fix a regression introduced in 3.1.0 that prevented `inf`, `-inf`, and `nan` values from being stored in `attributes`. ([#3280](https://github.com/zarr-developers/zarr-python/pull/3280)) +- Fixes [`Group.nmembers()`][zarr.Group.nmembers] ignoring depth when using consolidated metadata. ([#3287](https://github.com/zarr-developers/zarr-python/pull/3287)) ### Improved Documentation -- Expand the data type docs to include a demonstration of the `parse_data_type` function. Expand the docstring for the `parse_data_type` function. ([#3249](https://github.com/zarr-developers/zarr-python/issues/3249)) -- Add a section on codecs to the migration guide. ([#3273](https://github.com/zarr-developers/zarr-python/issues/3273)) +- Expand the data type docs to include a demonstration of the `parse_data_type` function. Expand the docstring for the `parse_data_type` function. ([#3249](https://github.com/zarr-developers/zarr-python/pull/3249)) +- Add a section on codecs to the migration guide. ([#3273](https://github.com/zarr-developers/zarr-python/pull/3273)) ### Misc -- Remove warnings about vlen-utf8 and vlen-bytes codecs ([#3268](https://github.com/zarr-developers/zarr-python/issues/3268)) +- Remove warnings about vlen-utf8 and vlen-bytes codecs ([#3268](https://github.com/zarr-developers/zarr-python/pull/3268)) ## 3.1.0 (2025-07-14) @@ -444,13 +444,13 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr method can be used to generate either a string, or dictionary that has a string `name` field, that represents the string value previously associated with that `enum`. - For more on this new feature, see the [documentation](user-guide/data_types.md) ([#2874](https://github.com/zarr-developers/zarr-python/issues/2874)) + For more on this new feature, see the [documentation](user-guide/data_types.md) ([#2874](https://github.com/zarr-developers/zarr-python/pull/2874)) -- Added `NDBuffer.empty` method for faster ndbuffer initialization. ([#3191](https://github.com/zarr-developers/zarr-python/issues/3191)) +- Added `NDBuffer.empty` method for faster ndbuffer initialization. ([#3191](https://github.com/zarr-developers/zarr-python/pull/3191)) -- The minimum version of NumPy has increased to 1.26. ([#3226](https://github.com/zarr-developers/zarr-python/issues/3226)) +- The minimum version of NumPy has increased to 1.26. ([#3226](https://github.com/zarr-developers/zarr-python/pull/3226)) -- Add an alternate `from_array_metadata_and_store` constructor to `CodecPipeline`. ([#3233](https://github.com/zarr-developers/zarr-python/issues/3233)) +- Add an alternate `from_array_metadata_and_store` constructor to `CodecPipeline`. ([#3233](https://github.com/zarr-developers/zarr-python/pull/3233)) ### Bugfixes @@ -459,28 +459,28 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr - Brings the `VariableLengthUTF8` data type Zarr V3 identifier in alignment with Zarr Python 3.0.8 - Disallows creation of 0-length fixed-length data types - Adds a regression test for the `VariableLengthUTF8` data type that checks against version 3.0.8 - - Allows users to request the `VariableLengthUTF8` data type with `str`, `"str"`, or `"string"`. ([#3170](https://github.com/zarr-developers/zarr-python/issues/3170)) + - Allows users to request the `VariableLengthUTF8` data type with `str`, `"str"`, or `"string"`. ([#3170](https://github.com/zarr-developers/zarr-python/pull/3170)) -- Add human readable size for No. bytes stored to `info_complete` ([#3190](https://github.com/zarr-developers/zarr-python/issues/3190)) +- Add human readable size for No. bytes stored to `info_complete` ([#3190](https://github.com/zarr-developers/zarr-python/pull/3190)) - Restores the ability to create a Zarr V2 array with a `null` fill value by introducing a new class `DefaultFillValue`, and setting the default value of the `fill_value` parameter in array creation routines to an instance of `DefaultFillValue`. For Zarr V3 arrays, `None` will act as an - alias for a `DefaultFillValue` instance, thus preserving compatibility with existing code. ([#3198](https://github.com/zarr-developers/zarr-python/issues/3198)) + alias for a `DefaultFillValue` instance, thus preserving compatibility with existing code. ([#3198](https://github.com/zarr-developers/zarr-python/pull/3198)) - Fix the type of `ArrayV2Metadata.codec` to constrain it to `numcodecs.abc.Codec | None`. Previously the type was more permissive, allowing objects that can be parsed into Codecs (e.g., the codec name). - The constructor of `ArrayV2Metadata` still allows the permissive input when creating new objects. ([#3232](https://github.com/zarr-developers/zarr-python/issues/3232)) + The constructor of `ArrayV2Metadata` still allows the permissive input when creating new objects. ([#3232](https://github.com/zarr-developers/zarr-python/pull/3232)) ### Improved Documentation - Add a self-contained example of data type extension to the `examples` directory, and expanded - the documentation for data types. ([#3157](https://github.com/zarr-developers/zarr-python/issues/3157)) + the documentation for data types. ([#3157](https://github.com/zarr-developers/zarr-python/pull/3157)) - Add a description on how to create a RemoteStore of a specific filesystem to the `Remote Store` section in `docs/user-guide/storage.md`. State in the docstring of `FsspecStore.from_url` that the filesystem type is inferred from the URL scheme. - It should help a user handling the case when the type of FsspecStore doesn't match the URL scheme. ([#3212](https://github.com/zarr-developers/zarr-python/issues/3212)) + It should help a user handling the case when the type of FsspecStore doesn't match the URL scheme. ([#3212](https://github.com/zarr-developers/zarr-python/pull/3212)) ### Deprecations and Removals @@ -499,7 +499,7 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr This change also adds an extra validation step to the creation of Zarr V2 arrays, which ensures that arrays with a `VariableLengthUTF8` or `VariableLengthBytes` data type cannot be created without the - correct "object codec". ([#3228](https://github.com/zarr-developers/zarr-python/issues/3228)) + correct "object codec". ([#3228](https://github.com/zarr-developers/zarr-python/pull/3228)) - Removes support for passing keyword-only arguments positionally to the following functions and methods: `save_array`, `open`, `group`, `open_group`, `create`, `get_basic_selection`, `set_basic_selection`, @@ -516,27 +516,27 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr ### Bugfixes - Removed an unnecessary check from `_fsspec._make_async` that would raise an exception when - creating a read-only store backed by a local file system with `auto_mkdir` set to `False`. ([#3193](https://github.com/zarr-developers/zarr-python/issues/3193)) + creating a read-only store backed by a local file system with `auto_mkdir` set to `False`. ([#3193](https://github.com/zarr-developers/zarr-python/pull/3193)) -- Add missing import for AsyncFileSystemWrapper for _make_async in _fsspec.py ([#3195](https://github.com/zarr-developers/zarr-python/issues/3195)) +- Add missing import for AsyncFileSystemWrapper for _make_async in _fsspec.py ([#3195](https://github.com/zarr-developers/zarr-python/pull/3195)) ## 3.0.9 (2025-06-30) ### Features -- Add `zarr.storage.FsspecStore.from_mapper()` so that `zarr.open()` supports stores of type `fsspec.mapping.FSMap`. ([#2774](https://github.com/zarr-developers/zarr-python/issues/2774)) +- Add `zarr.storage.FsspecStore.from_mapper()` so that `zarr.open()` supports stores of type `fsspec.mapping.FSMap`. ([#2774](https://github.com/zarr-developers/zarr-python/pull/2774)) -- Implemented `move` for `LocalStore` and `ZipStore`. This allows users to move the store to a different root path. ([#3021](https://github.com/zarr-developers/zarr-python/issues/3021)) +- Implemented `move` for `LocalStore` and `ZipStore`. This allows users to move the store to a different root path. ([#3021](https://github.com/zarr-developers/zarr-python/pull/3021)) -- Added `zarr.errors.GroupNotFoundError`, which is raised when attempting to open a group that does not exist. ([#3066](https://github.com/zarr-developers/zarr-python/issues/3066)) +- Added `zarr.errors.GroupNotFoundError`, which is raised when attempting to open a group that does not exist. ([#3066](https://github.com/zarr-developers/zarr-python/pull/3066)) -- Adds `fill_value` to the list of attributes displayed in the output of the `AsyncArray.info()` method. ([#3081](https://github.com/zarr-developers/zarr-python/issues/3081)) +- Adds `fill_value` to the list of attributes displayed in the output of the `AsyncArray.info()` method. ([#3081](https://github.com/zarr-developers/zarr-python/pull/3081)) -- Use `numpy.zeros` instead of `np.full` for a performance speedup when creating a `zarr.core.buffer.NDBuffer` with `fill_value=0`. ([#3082](https://github.com/zarr-developers/zarr-python/issues/3082)) +- Use `numpy.zeros` instead of `np.full` for a performance speedup when creating a `zarr.core.buffer.NDBuffer` with `fill_value=0`. ([#3082](https://github.com/zarr-developers/zarr-python/pull/3082)) -- Port more stateful testing actions from [Icechunk](https://icechunk.io). ([#3130](https://github.com/zarr-developers/zarr-python/issues/3130)) +- Port more stateful testing actions from [Icechunk](https://icechunk.io/en/stable/). ([#3130](https://github.com/zarr-developers/zarr-python/pull/3130)) -- Adds a `with_read_only` convenience method to the `Store` abstract base class (raises `NotImplementedError`) and implementations to the `MemoryStore`, `ObjectStore`, `LocalStore`, and `FsspecStore` classes. ([#3138](https://github.com/zarr-developers/zarr-python/issues/3138)) +- Adds a `with_read_only` convenience method to the `Store` abstract base class (raises `NotImplementedError`) and implementations to the `MemoryStore`, `ObjectStore`, `LocalStore`, and `FsspecStore` classes. ([#3138](https://github.com/zarr-developers/zarr-python/pull/3138)) ### Bugfixes @@ -544,7 +544,7 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr - For Zarr format 2, allow fixed-length string arrays to be created without automatically inserting a `Vlen-UT8` codec in the array of filters. Fixed-length string arrays do not need this codec. This - change fixes a regression where fixed-length string arrays created with Zarr Python 3 could not be read with Zarr Python 2.18. ([#3100](https://github.com/zarr-developers/zarr-python/issues/3100)) + change fixes a regression where fixed-length string arrays created with Zarr Python 3 could not be read with Zarr Python 2.18. ([#3100](https://github.com/zarr-developers/zarr-python/pull/3100)) - When creating arrays without explicitly specifying a chunk size using `zarr.create` and other array creation routines, the chunk size will now set automatically instead of defaulting to the data shape. @@ -552,12 +552,12 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr To retain previous behaviour, explicitly set the chunk shape to the data shape. This fix matches the existing chunking behaviour of - `zarr.save_array` and `zarr.api.asynchronous.AsyncArray.create`. ([#3103](https://github.com/zarr-developers/zarr-python/issues/3103)) + `zarr.save_array` and `zarr.api.asynchronous.AsyncArray.create`. ([#3103](https://github.com/zarr-developers/zarr-python/pull/3103)) - When `zarr.save` has an argument `path=some/path/` and multiple arrays in `args`, the path resulted in `some/path/some/path` due to using the `path` - argument twice while building the array path. This is now fixed. ([#3127](https://github.com/zarr-developers/zarr-python/issues/3127)) + argument twice while building the array path. This is now fixed. ([#3127](https://github.com/zarr-developers/zarr-python/pull/3127)) -- Fix `zarr.open` default for argument `mode` when `store` is `read_only` ([#3128](https://github.com/zarr-developers/zarr-python/issues/3128)) +- Fix `zarr.open` default for argument `mode` when `store` is `read_only` ([#3128](https://github.com/zarr-developers/zarr-python/pull/3128)) - Suppress `FileNotFoundError` when deleting non-existent keys in the `obstore` adapter. @@ -566,9 +566,9 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr raise a `FileNotFoundError` if the chunk doesn't already exist. Since whether or not a delete of a non-existing object raises an error depends on the behavior of the underlying store, suppressing the error in all cases results in consistent behavior across stores, and is also what `zarr` seems to expect - from the store. ([#3140](https://github.com/zarr-developers/zarr-python/issues/3140)) + from the store. ([#3140](https://github.com/zarr-developers/zarr-python/pull/3140)) -- Trying to open a StorePath/Array with `mode='r'` when the store is not read-only creates a read-only copy of the store. ([#3156](https://github.com/zarr-developers/zarr-python/issues/3156)) +- Trying to open a StorePath/Array with `mode='r'` when the store is not read-only creates a read-only copy of the store. ([#3156](https://github.com/zarr-developers/zarr-python/pull/3156)) ## 3.0.8 (2025-05-19) @@ -578,195 +578,195 @@ a `ManagedMemoryStore` is used. ([#3944](https://github.com/zarr-developers/zarr ### Features -- Added a `print_debug_info` function for bug reports. ([#2913](https://github.com/zarr-developers/zarr-python/issues/2913)) +- Added a `print_debug_info` function for bug reports. ([#2913](https://github.com/zarr-developers/zarr-python/pull/2913)) ### Bugfixes -- Fix a bug that prevented the number of initialized chunks being counted properly. ([#2862](https://github.com/zarr-developers/zarr-python/issues/2862)) -- Fixed sharding with GPU buffers. ([#2978](https://github.com/zarr-developers/zarr-python/issues/2978)) +- Fix a bug that prevented the number of initialized chunks being counted properly. ([#2862](https://github.com/zarr-developers/zarr-python/pull/2862)) +- Fixed sharding with GPU buffers. ([#2978](https://github.com/zarr-developers/zarr-python/pull/2978)) - Fix structured `dtype` fill value serialization for consolidated metadata ([#2998](https://github.com/zarr-developers/zarr-python/issues/2998)) - It is now possible to specify no compressor when creating a zarr format 2 array. This can be done by passing `compressor=None` to the various array creation routines. The default behaviour of automatically choosing a suitable default compressor remains if the compressor argument is not given. - To reproduce the behaviour in previous zarr-python versions when `compressor=None` was passed, pass `compressor='auto'` instead. ([#3039](https://github.com/zarr-developers/zarr-python/issues/3039)) + To reproduce the behaviour in previous zarr-python versions when `compressor=None` was passed, pass `compressor='auto'` instead. ([#3039](https://github.com/zarr-developers/zarr-python/pull/3039)) -- Fixed the typing of `dimension_names` arguments throughout so that it now accepts iterables that contain `None` alongside `str`. ([#3045](https://github.com/zarr-developers/zarr-python/issues/3045)) -- Using various functions to open data with `mode='a'` no longer deletes existing data in the store. ([#3062](https://github.com/zarr-developers/zarr-python/issues/3062)) -- Internally use `typesize` constructor parameter for `numcodecs.blosc.Blosc` to improve compression ratios back to the v2-package levels. ([#2962](https://github.com/zarr-developers/zarr-python/issues/2962)) +- Fixed the typing of `dimension_names` arguments throughout so that it now accepts iterables that contain `None` alongside `str`. ([#3045](https://github.com/zarr-developers/zarr-python/pull/3045)) +- Using various functions to open data with `mode='a'` no longer deletes existing data in the store. ([#3062](https://github.com/zarr-developers/zarr-python/pull/3062)) +- Internally use `typesize` constructor parameter for `numcodecs.blosc.Blosc` to improve compression ratios back to the v2-package levels. ([#2962](https://github.com/zarr-developers/zarr-python/pull/2962)) - Specifying the memory order of Zarr format 2 arrays using the `order` keyword argument has been fixed. ([#2950](https://github.com/zarr-developers/zarr-python/issues/2950)) ### Misc -- [#2972](https://github.com/zarr-developers/zarr-python/issues/2972), [#3027](https://github.com/zarr-developers/zarr-python/issues/3027), [#3049](https://github.com/zarr-developers/zarr-python/issues/3049) +- [#2972](https://github.com/zarr-developers/zarr-python/pull/2972), [#3027](https://github.com/zarr-developers/zarr-python/pull/3027), [#3049](https://github.com/zarr-developers/zarr-python/pull/3049) ## 3.0.7 (2025-04-22) ### Features -- Add experimental ObjectStore storage class based on obstore. ([#1661](https://github.com/zarr-developers/zarr-python/issues/1661)) -- Add `zarr.from_array` using concurrent streaming of source data ([#2622](https://github.com/zarr-developers/zarr-python/issues/2622)) +- Add experimental ObjectStore storage class based on obstore. ([#1661](https://github.com/zarr-developers/zarr-python/pull/1661)) +- Add `zarr.from_array` using concurrent streaming of source data ([#2622](https://github.com/zarr-developers/zarr-python/pull/2622)) ### Bugfixes - 0-dimensional arrays are now returning a scalar. Therefore, the return type of `__getitem__` changed to NDArrayLikeOrScalar. This change is to make the behavior of 0-dimensional arrays consistent with - `numpy` scalars. ([#2718](https://github.com/zarr-developers/zarr-python/issues/2718)) -- Fix `fill_value` serialization for `NaN` in `ArrayV2Metadata` and add property-based testing of round-trip serialization ([#2802](https://github.com/zarr-developers/zarr-python/issues/2802)) + `numpy` scalars. ([#2718](https://github.com/zarr-developers/zarr-python/pull/2718)) +- Fix `fill_value` serialization for `NaN` in `ArrayV2Metadata` and add property-based testing of round-trip serialization ([#2802](https://github.com/zarr-developers/zarr-python/pull/2802)) - Fixes `ConsolidatedMetadata` serialization of `nan`, `inf`, and `-inf` to be - consistent with the behavior of `ArrayMetadata`. ([#2996](https://github.com/zarr-developers/zarr-python/issues/2996)) + consistent with the behavior of `ArrayMetadata`. ([#2996](https://github.com/zarr-developers/zarr-python/pull/2996)) ### Improved Documentation -- Updated the 3.0 migration guide to include the removal of "." syntax for getting group members. ([#2991](https://github.com/zarr-developers/zarr-python/issues/2991), [#2997](https://github.com/zarr-developers/zarr-python/issues/2997)) +- Updated the 3.0 migration guide to include the removal of "." syntax for getting group members. ([#2991](https://github.com/zarr-developers/zarr-python/issues/2991), [#2997](https://github.com/zarr-developers/zarr-python/pull/2997)) ### Misc - Define a new versioning policy based on Effective Effort Versioning. This replaces the old Semantic - Versioning-based policy. ([#2924](https://github.com/zarr-developers/zarr-python/issues/2924), [#2910](https://github.com/zarr-developers/zarr-python/issues/2910)) + Versioning-based policy. ([#2924](https://github.com/zarr-developers/zarr-python/issues/2924), [#2910](https://github.com/zarr-developers/zarr-python/pull/2910)) - Make warning filters in the tests more specific, so warnings emitted by tests added in the future - are more likely to be caught instead of ignored. ([#2714](https://github.com/zarr-developers/zarr-python/issues/2714)) -- Avoid an unnecessary memory copy when writing Zarr to a local file ([#2944](https://github.com/zarr-developers/zarr-python/issues/2944)) + are more likely to be caught instead of ignored. ([#2714](https://github.com/zarr-developers/zarr-python/pull/2714)) +- Avoid an unnecessary memory copy when writing Zarr to a local file ([#2944](https://github.com/zarr-developers/zarr-python/pull/2944)) ## 3.0.6 (2025-03-20) ### Bugfixes -- Restore functionality of `del z.attrs['key']` to actually delete the key. ([#2908](https://github.com/zarr-developers/zarr-python/issues/2908)) +- Restore functionality of `del z.attrs['key']` to actually delete the key. ([#2908](https://github.com/zarr-developers/zarr-python/pull/2908)) ## 3.0.5 (2025-03-07) ### Bugfixes - Fixed a bug where `StorePath` creation would not apply standard path normalization to the `path` parameter, - which led to the creation of arrays and groups with invalid keys. ([#2850](https://github.com/zarr-developers/zarr-python/issues/2850)) -- Prevent update_attributes calls from deleting old attributes ([#2870](https://github.com/zarr-developers/zarr-python/issues/2870)) + which led to the creation of arrays and groups with invalid keys. ([#2850](https://github.com/zarr-developers/zarr-python/pull/2850)) +- Prevent update_attributes calls from deleting old attributes ([#2870](https://github.com/zarr-developers/zarr-python/pull/2870)) ### Misc -- [#2796](https://github.com/zarr-developers/zarr-python/issues/2796) +- [#2796](https://github.com/zarr-developers/zarr-python/pull/2796) ## 3.0.4 (2025-02-23) ### Features -- Adds functions for concurrently creating multiple arrays and groups. ([#2665](https://github.com/zarr-developers/zarr-python/issues/2665)) +- Adds functions for concurrently creating multiple arrays and groups. ([#2665](https://github.com/zarr-developers/zarr-python/pull/2665)) ### Bugfixes -- Fixed a bug where `ArrayV2Metadata` could save `filters` as an empty array. ([#2847](https://github.com/zarr-developers/zarr-python/issues/2847)) -- Fix a bug when setting values of a smaller last chunk. ([#2851](https://github.com/zarr-developers/zarr-python/issues/2851)) +- Fixed a bug where `ArrayV2Metadata` could save `filters` as an empty array. ([#2847](https://github.com/zarr-developers/zarr-python/pull/2847)) +- Fix a bug when setting values of a smaller last chunk. ([#2851](https://github.com/zarr-developers/zarr-python/pull/2851)) ### Misc -- [#2828](https://github.com/zarr-developers/zarr-python/issues/2828) +- [#2828](https://github.com/zarr-developers/zarr-python/pull/2828) ## 3.0.3 (2025-02-14) ### Features -- Improves performance of FsspecStore.delete_dir for remote filesystems supporting concurrent/batched deletes, e.g., s3fs. ([#2661](https://github.com/zarr-developers/zarr-python/issues/2661)) -- Added `zarr.config.enable_gpu` to update Zarr's configuration to use GPUs. ([#2751](https://github.com/zarr-developers/zarr-python/issues/2751)) -- Avoid reading chunks during writes where possible. [#757](https://github.com/zarr-developers/zarr-python/issues/757) ([#2784](https://github.com/zarr-developers/zarr-python/issues/2784)) -- `LocalStore` learned to `delete_dir`. This makes array and group deletes more efficient. ([#2804](https://github.com/zarr-developers/zarr-python/issues/2804)) -- Add `zarr.testing.strategies.array_metadata` to generate ArrayV2Metadata and ArrayV3Metadata instances. ([#2813](https://github.com/zarr-developers/zarr-python/issues/2813)) -- Add arbitrary `shards` to Hypothesis strategy for generating arrays. ([#2822](https://github.com/zarr-developers/zarr-python/issues/2822)) +- Improves performance of FsspecStore.delete_dir for remote filesystems supporting concurrent/batched deletes, e.g., s3fs. ([#2661](https://github.com/zarr-developers/zarr-python/pull/2661)) +- Added `zarr.config.enable_gpu` to update Zarr's configuration to use GPUs. ([#2751](https://github.com/zarr-developers/zarr-python/pull/2751)) +- Avoid reading chunks during writes where possible. [#757](https://github.com/zarr-developers/zarr-python/issues/757) ([#2784](https://github.com/zarr-developers/zarr-python/pull/2784)) +- `LocalStore` learned to `delete_dir`. This makes array and group deletes more efficient. ([#2804](https://github.com/zarr-developers/zarr-python/pull/2804)) +- Add `zarr.testing.strategies.array_metadata` to generate ArrayV2Metadata and ArrayV3Metadata instances. ([#2813](https://github.com/zarr-developers/zarr-python/pull/2813)) +- Add arbitrary `shards` to Hypothesis strategy for generating arrays. ([#2822](https://github.com/zarr-developers/zarr-python/pull/2822)) ### Bugfixes -- Fixed bug with Zarr using device memory, instead of host memory, for storing metadata when using GPUs. ([#2751](https://github.com/zarr-developers/zarr-python/issues/2751)) +- Fixed bug with Zarr using device memory, instead of host memory, for storing metadata when using GPUs. ([#2751](https://github.com/zarr-developers/zarr-python/pull/2751)) - The array returned by `zarr.empty` and an empty `zarr.core.buffer.cpu.NDBuffer` will now be filled with the specified fill value, or with zeros if no fill value is provided. - This fixes a bug where Zarr format 2 data with no fill value was written with un-predictable chunk sizes. ([#2755](https://github.com/zarr-developers/zarr-python/issues/2755)) -- Fix zip-store path checking for stores with directories listed as files. ([#2758](https://github.com/zarr-developers/zarr-python/issues/2758)) -- Use removeprefix rather than replace when removing filename prefixes in `FsspecStore.list` ([#2778](https://github.com/zarr-developers/zarr-python/issues/2778)) -- Enable automatic removal of `needs release notes` with labeler action ([#2781](https://github.com/zarr-developers/zarr-python/issues/2781)) -- Use the proper label config ([#2785](https://github.com/zarr-developers/zarr-python/issues/2785)) -- Alters the behavior of `create_array` to ensure that any groups implied by the array's name are created if they do not already exist. Also simplifies the type signature for any function that takes an ArrayConfig-like object. ([#2795](https://github.com/zarr-developers/zarr-python/issues/2795)) -- Enitialise empty chunks to the default fill value during writing and add default fill values for datetime, timedelta, structured, and other (void* fixed size) data types ([#2799](https://github.com/zarr-developers/zarr-python/issues/2799)) -- Ensure utf8 compliant strings are used to construct numpy arrays in property-based tests ([#2801](https://github.com/zarr-developers/zarr-python/issues/2801)) -- Fix pickling for ZipStore ([#2807](https://github.com/zarr-developers/zarr-python/issues/2807)) -- Update numcodecs to not overwrite codec configuration ever. Closes [#2800](https://github.com/zarr-developers/zarr-python/issues/2800). ([#2811](https://github.com/zarr-developers/zarr-python/issues/2811)) -- Fix fancy indexing (e.g. arr[5, [0, 1]]) with the sharding codec ([#2817](https://github.com/zarr-developers/zarr-python/issues/2817)) + This fixes a bug where Zarr format 2 data with no fill value was written with un-predictable chunk sizes. ([#2755](https://github.com/zarr-developers/zarr-python/pull/2755)) +- Fix zip-store path checking for stores with directories listed as files. ([#2758](https://github.com/zarr-developers/zarr-python/pull/2758)) +- Use removeprefix rather than replace when removing filename prefixes in `FsspecStore.list` ([#2778](https://github.com/zarr-developers/zarr-python/pull/2778)) +- Enable automatic removal of `needs release notes` with labeler action ([#2781](https://github.com/zarr-developers/zarr-python/pull/2781)) +- Use the proper label config ([#2785](https://github.com/zarr-developers/zarr-python/pull/2785)) +- Alters the behavior of `create_array` to ensure that any groups implied by the array's name are created if they do not already exist. Also simplifies the type signature for any function that takes an ArrayConfig-like object. ([#2795](https://github.com/zarr-developers/zarr-python/pull/2795)) +- Enitialise empty chunks to the default fill value during writing and add default fill values for datetime, timedelta, structured, and other (void* fixed size) data types ([#2799](https://github.com/zarr-developers/zarr-python/pull/2799)) +- Ensure utf8 compliant strings are used to construct numpy arrays in property-based tests ([#2801](https://github.com/zarr-developers/zarr-python/pull/2801)) +- Fix pickling for ZipStore ([#2807](https://github.com/zarr-developers/zarr-python/pull/2807)) +- Update numcodecs to not overwrite codec configuration ever. Closes [#2800](https://github.com/zarr-developers/zarr-python/issues/2800). ([#2811](https://github.com/zarr-developers/zarr-python/pull/2811)) +- Fix fancy indexing (e.g. arr[5, [0, 1]]) with the sharding codec ([#2817](https://github.com/zarr-developers/zarr-python/pull/2817)) ### Improved Documentation -- Added new user guide on GPU. ([#2751](https://github.com/zarr-developers/zarr-python/issues/2751)) +- Added new user guide on GPU. ([#2751](https://github.com/zarr-developers/zarr-python/pull/2751)) ## 3.0.2 (2025-01-31) ### Features -- Test `getsize()` and `getsize_prefix()` in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) -- Test that a `ValueError` is raised for invalid byte range syntax in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) -- Separate instantiating and opening a store in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) -- Add a test for using Stores as context managers in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) -- Implemented `LoggingStore.open()`. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) -- `LoggingStore` is now a generic class. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) +- Test `getsize()` and `getsize_prefix()` in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) +- Test that a `ValueError` is raised for invalid byte range syntax in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) +- Separate instantiating and opening a store in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) +- Add a test for using Stores as context managers in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) +- Implemented `LoggingStore.open()`. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) +- `LoggingStore` is now a generic class. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) - Change StoreTest's `test_store_repr`, `test_store_supports_writes`, `test_store_supports_partial_writes`, and `test_store_supports_listing` - to be implemented using `@abstractmethod`, rather than raising `NotImplementedError`. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) -- Test the error raised for invalid buffer arguments in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) -- Test that data can be written to a store that's not yet open using the store.set method in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) + to be implemented using `@abstractmethod`, rather than raising `NotImplementedError`. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) +- Test the error raised for invalid buffer arguments in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) +- Test that data can be written to a store that's not yet open using the store.set method in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) - Adds a new function `init_array` for initializing an array in storage, and refactors `create_array` to use `init_array`. `create_array` takes two new parameters: `data`, an optional array-like object, and `write_data`, a bool which defaults to `True`. If `data` is given to `create_array`, then the `dtype` and `shape` attributes of `data` are used to define the corresponding attributes of the resulting Zarr array. Additionally, if `data` is given and `write_data` is `True`, - then the values in `data` will be written to the newly created array. ([#2761](https://github.com/zarr-developers/zarr-python/issues/2761)) + then the values in `data` will be written to the newly created array. ([#2761](https://github.com/zarr-developers/zarr-python/pull/2761)) ### Bugfixes -- Wrap sync fsspec filesystems with `AsyncFileSystemWrapper`. ([#2533](https://github.com/zarr-developers/zarr-python/issues/2533)) -- Added backwards compatibility for Zarr format 2 structured arrays. ([#2681](https://github.com/zarr-developers/zarr-python/issues/2681)) -- Update equality for `LoggingStore` and `WrapperStore` such that 'other' must also be a `LoggingStore` or `WrapperStore` respectively, rather than only checking the types of the stores they wrap. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) -- Ensure that `ZipStore` is open before getting or setting any values. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) -- Use stdout rather than stderr as the default stream for `LoggingStore`. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) -- Match the errors raised by read only stores in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/issues/2693)) +- Wrap sync fsspec filesystems with `AsyncFileSystemWrapper`. ([#2533](https://github.com/zarr-developers/zarr-python/pull/2533)) +- Added backwards compatibility for Zarr format 2 structured arrays. ([#2681](https://github.com/zarr-developers/zarr-python/pull/2681)) +- Update equality for `LoggingStore` and `WrapperStore` such that 'other' must also be a `LoggingStore` or `WrapperStore` respectively, rather than only checking the types of the stores they wrap. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) +- Ensure that `ZipStore` is open before getting or setting any values. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) +- Use stdout rather than stderr as the default stream for `LoggingStore`. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) +- Match the errors raised by read only stores in `StoreTests`. ([#2693](https://github.com/zarr-developers/zarr-python/pull/2693)) - Fixed `ZipStore` to make sure the correct attributes are saved when instances are pickled. - This fixes a previous bug that prevented using `ZipStore` with a `ProcessPoolExecutor`. ([#2762](https://github.com/zarr-developers/zarr-python/issues/2762)) -- Updated the optional test dependencies to include `botocore` and `fsspec`. ([#2768](https://github.com/zarr-developers/zarr-python/issues/2768)) + This fixes a previous bug that prevented using `ZipStore` with a `ProcessPoolExecutor`. ([#2762](https://github.com/zarr-developers/zarr-python/pull/2762)) +- Updated the optional test dependencies to include `botocore` and `fsspec`. ([#2768](https://github.com/zarr-developers/zarr-python/pull/2768)) - Fixed the fsspec tests to skip if `botocore` is not installed. - Previously they would have failed with an import error. ([#2768](https://github.com/zarr-developers/zarr-python/issues/2768)) -- Optimize full chunk writes. ([#2782](https://github.com/zarr-developers/zarr-python/issues/2782)) + Previously they would have failed with an import error. ([#2768](https://github.com/zarr-developers/zarr-python/pull/2768)) +- Optimize full chunk writes. ([#2782](https://github.com/zarr-developers/zarr-python/pull/2782)) ### Improved Documentation - Changed the machinery for creating changelog entries. - Now individual entries should be added as files to the `changes` directory in the `zarr-python` repository, instead of directly to the changelog file. ([#2736](https://github.com/zarr-developers/zarr-python/issues/2736)) + Now individual entries should be added as files to the `changes` directory in the `zarr-python` repository, instead of directly to the changelog file. ([#2736](https://github.com/zarr-developers/zarr-python/pull/2736)) ### Other - Created a type alias `ChunkKeyEncodingLike` to model the union of `ChunkKeyEncoding` instances and the dict form of the parameters of those instances. `ChunkKeyEncodingLike` should be used by high-level functions to provide a convenient - way for creating `ChunkKeyEncoding` objects. ([#2763](https://github.com/zarr-developers/zarr-python/issues/2763)) + way for creating `ChunkKeyEncoding` objects. ([#2763](https://github.com/zarr-developers/zarr-python/pull/2763)) ## 3.0.1 (2025-01-17) -* Implement `zarr.from_array` using concurrent streaming ([#2622](https://github.com/zarr-developers/zarr-python/issues/2622)). +* Implement `zarr.from_array` using concurrent streaming ([#2622](https://github.com/zarr-developers/zarr-python/pull/2622)). ### Bug fixes -* Fixes `order` argument for Zarr format 2 arrays ([#2679](https://github.com/zarr-developers/zarr-python/issues/2679)). +* Fixes `order` argument for Zarr format 2 arrays ([#2679](https://github.com/zarr-developers/zarr-python/pull/2679)). * Fixes a bug that prevented reading Zarr format 2 data with consolidated metadata written using `zarr-python` version 2 ([#2694](https://github.com/zarr-developers/zarr-python/issues/2694)). * Ensure that compressor=None results in no compression when writing Zarr format 2 data ([#2708](https://github.com/zarr-developers/zarr-python/issues/2708)). * Fix for empty consolidated metadata dataset: backwards compatibility with - Zarr-Python 2 ([#2695](https://github.com/zarr-developers/zarr-python/issues/2695)). + Zarr-Python 2 ([#2695](https://github.com/zarr-developers/zarr-python/pull/2695)). ### Documentation -* Add v3.0.0 release announcement banner ([#2677](https://github.com/zarr-developers/zarr-python/issues/2677)). -* Quickstart guide alignment with V3 API ([#2697](https://github.com/zarr-developers/zarr-python/issues/2697)). -* Fix doctest failures related to numcodecs 0.15 ([#2727](https://github.com/zarr-developers/zarr-python/issues/2727)). +* Add v3.0.0 release announcement banner ([#2677](https://github.com/zarr-developers/zarr-python/pull/2677)). +* Quickstart guide alignment with V3 API ([#2697](https://github.com/zarr-developers/zarr-python/pull/2697)). +* Fix doctest failures related to numcodecs 0.15 ([#2727](https://github.com/zarr-developers/zarr-python/pull/2727)). ### Other * Removed some unnecessary files from the source distribution - to reduce its size. ([#2686](https://github.com/zarr-developers/zarr-python/issues/2686)). -* Enable codecov in GitHub actions ([#2682](https://github.com/zarr-developers/zarr-python/issues/2682)). -* Speed up hypothesis tests ([#2650](https://github.com/zarr-developers/zarr-python/issues/2650)). -* Remove multiple imports for an import name ([#2723](https://github.com/zarr-developers/zarr-python/issues/2723)). + to reduce its size. ([#2686](https://github.com/zarr-developers/zarr-python/pull/2686)). +* Enable codecov in GitHub actions ([#2682](https://github.com/zarr-developers/zarr-python/pull/2682)). +* Speed up hypothesis tests ([#2650](https://github.com/zarr-developers/zarr-python/pull/2650)). +* Remove multiple imports for an import name ([#2723](https://github.com/zarr-developers/zarr-python/pull/2723)). ## 3.0.0 (2025-01-09) diff --git a/docs/user-guide/arrays.md b/docs/user-guide/arrays.md index 51b2fa1a17..a192845f9e 100644 --- a/docs/user-guide/arrays.md +++ b/docs/user-guide/arrays.md @@ -199,7 +199,7 @@ print(arr_f.config) A number of different compressors can be used with Zarr. Zarr includes Blosc, Zstandard and Gzip compressors. Additional compressors are available through -a separate package called [NumCodecs](https://numcodecs.readthedocs.io/) which provides various +a separate package called [NumCodecs](https://numcodecs.readthedocs.io/en/stable/) which provides various compressor libraries including LZ4, Zlib, BZ2 and LZMA. Different compressors can be provided via the `compressors` keyword argument accepted by all array creation functions. For example: @@ -256,7 +256,7 @@ z[:] = data print(f"Compressors: {z.compressors}") ``` -Here is an example using LZMA from [NumCodecs](https://numcodecs.readthedocs.io/) with a custom filter pipeline including LZMA's +Here is an example using LZMA from [NumCodecs](https://numcodecs.readthedocs.io/en/stable/) with a custom filter pipeline including LZMA's built-in delta filter: ```python exec="true" session="arrays" source="above" result="ansi" @@ -295,7 +295,7 @@ z = zarr.create_array(store='data/example-9.zarr', shape=data.shape, dtype=data. print(z.info_complete()) ``` -For more information about available filter codecs, see the [Numcodecs](https://numcodecs.readthedocs.io/) documentation. +For more information about available filter codecs, see the [Numcodecs](https://numcodecs.readthedocs.io/en/stable/) documentation. ## Advanced indexing diff --git a/docs/user-guide/installation.md b/docs/user-guide/installation.md index 4af7667a44..a7487e83c8 100644 --- a/docs/user-guide/installation.md +++ b/docs/user-guide/installation.md @@ -5,12 +5,12 @@ Required dependencies include: - [Python](https://docs.python.org/3/) (3.12 or later) -- [packaging](https://packaging.pypa.io) (22.0 or later) +- [packaging](https://packaging.pypa.io/en/stable/) (22.0 or later) - [numpy](https://numpy.org) (2.0 or later) -- [numcodecs](https://numcodecs.readthedocs.io) (0.14 or later) +- [numcodecs](https://numcodecs.readthedocs.io/en/stable/) (0.14 or later) - [google-crc32c](https://github.com/googleapis/python-crc32c) (1.5 or later) -- [typing_extensions](https://typing-extensions.readthedocs.io) (4.14 or later) -- [donfig](https://donfig.readthedocs.io) (0.8 or later) +- [typing_extensions](https://typing-extensions.readthedocs.io/en/latest/) (4.14 or later) +- [donfig](https://donfig.readthedocs.io/en/latest/) (0.8 or later) ## pip diff --git a/docs/user-guide/storage.md b/docs/user-guide/storage.md index 0ba6202c76..b288c9976d 100644 --- a/docs/user-guide/storage.md +++ b/docs/user-guide/storage.md @@ -1,7 +1,7 @@ # Storage guide Zarr-Python supports multiple storage backends, including: local file systems, -Zip files, remote stores via [fsspec](https://filesystem-spec.readthedocs.io) (S3, HTTP, etc.), and in-memory stores. In +Zip files, remote stores via [fsspec](https://filesystem-spec.readthedocs.io/en/latest/) (S3, HTTP, etc.), and in-memory stores. In Zarr-Python 3, stores must implement the abstract store API from [`zarr.abc.store.Store`][]. @@ -12,7 +12,7 @@ Zarr-Python 3, stores must implement the abstract store API from ## Implicit Store Creation In most cases, it is not required to create a `Store` object explicitly. Passing a string -(or other [StoreLike value](#storelike)) to Zarr's top level API will result in the store +(or other [StoreLike value](#user-guide-store-like)) to Zarr's top level API will result in the store being created automatically: ```python exec="true" session="storage" source="above" result="ansi" @@ -41,10 +41,7 @@ group = zarr.create_group(store=data) print(group) ``` - -[](){#user-guide-store-like} - -### StoreLike +### StoreLike {#user-guide-store-like} `StoreLike` values can be: @@ -142,7 +139,7 @@ f.close() The [`zarr.storage.FsspecStore`][] stores the contents of a Zarr hierarchy following the same logical layout as the [`LocalStore`][zarr.storage.LocalStore], except the store is assumed to be on a remote storage system such as cloud object storage (e.g. AWS S3, Google Cloud Storage, Azure Blob Store). The -[`zarr.storage.FsspecStore`][] is backed by [fsspec](https://filesystem-spec.readthedocs.io) and can support any backend +[`zarr.storage.FsspecStore`][] is backed by [fsspec](https://filesystem-spec.readthedocs.io/en/latest/) and can support any backend that implements the [AbstractFileSystem](https://filesystem-spec.readthedocs.io/en/stable/api.html#fsspec.spec.AbstractFileSystem) API. `storage_options` can be used to configure the fsspec backend: diff --git a/packages/zarr-metadata/CHANGELOG.md b/packages/zarr-metadata/CHANGELOG.md index 981c7706bf..ac4ad3535a 100644 --- a/packages/zarr-metadata/CHANGELOG.md +++ b/packages/zarr-metadata/CHANGELOG.md @@ -159,7 +159,7 @@ ### Deprecations and Removals -- Introduces a new `JSONValue` type that models python objects that serialize directly to JSON. This type is used to annotate the contents of `attributes` and `fill_value` fields, replacing the use of the overly wide `object` type. This is technically a breaking change. ([#4037](https://github.com/zarr-developers/zarr-python/issues/4037)) +- Introduces a new `JSONValue` type that models python objects that serialize directly to JSON. This type is used to annotate the contents of `attributes` and `fill_value` fields, replacing the use of the overly wide `object` type. This is technically a breaking change. ([#4037](https://github.com/zarr-developers/zarr-python/pull/4037)) - Promoted a curated "front door" of names to the top-level `zarr_metadata` namespace, so consumers can write e.g. `from zarr_metadata import ArrayMetadataV3, ShardingIndexLocation, BLOSC_CNAME` instead of importing from @@ -180,7 +180,7 @@ `name`-or-`{name, configuration}` shape). Also added the `NUMPY_TIME_UNIT` runtime constant (a `Final` tuple paired with - the `NumpyTimeUnit` Literal) in `zarr_metadata.v3.data_type.numpy_timedelta64`. ([#4083](https://github.com/zarr-developers/zarr-python/issues/4083)) + the `NumpyTimeUnit` Literal) in `zarr_metadata.v3.data_type.numpy_timedelta64`. ([#4083](https://github.com/zarr-developers/zarr-python/pull/4083)) ## 0.2.0 (2026-05-19) @@ -193,13 +193,13 @@ identify the chunk bytes produced by a writer. **Breaking** for consumers that previously typed gzip codec metadata as the bare string or constructed a `GzipCodecConfiguration` without `level`. - ([#3978](https://github.com/zarr-developers/zarr-python/issues/3978)) + ([#3978](https://github.com/zarr-developers/zarr-python/pull/3978)) - `BytesCodecObject.configuration` is now `NotRequired`. The configuration has no required keys (`endian` is conditionally required at runtime based on data type), so the object form may omit it entirely — matching the bare-string short-hand. **Soft-breaking** for consumers that previously relied on `configuration` always being present. - ([#3978](https://github.com/zarr-developers/zarr-python/issues/3978)) + ([#3978](https://github.com/zarr-developers/zarr-python/pull/3978)) - Better modelling of Zarr v2 stored metadata. Zarr v2 splits a node's metadata across two JSON documents (`.zarray`/`.zgroup` and `.zattrs`), but `GroupMetadataV2` had no `attributes` field while `ArrayMetadataV2` @@ -207,7 +207,7 @@ `attributes` field, and `ArrayMetadataV2.attributes` is now `NotRequired` for symmetry. **Soft-breaking** for consumers that relied on `ArrayMetadataV2.attributes` always being present. - ([#3962](https://github.com/zarr-developers/zarr-python/issues/3962)) + ([#3962](https://github.com/zarr-developers/zarr-python/pull/3962)) ### Features @@ -219,7 +219,7 @@ (test fixtures, fragment templates, in-progress builders). An equivalence test pins each `Partial` to the keys and value types of its full sibling so the two cannot drift. - ([#3982](https://github.com/zarr-developers/zarr-python/issues/3982)) + ([#3982](https://github.com/zarr-developers/zarr-python/pull/3982)) - Added three new top-level types modelling the **strict on-disk** shape of Zarr v2 metadata documents: `ZArrayMetadata` (the `.zarray` file), `ZGroupMetadata` (the `.zgroup` file), and `ZAttrsMetadata` (the @@ -227,13 +227,13 @@ what's stored on disk; use the merged `ArrayMetadataV2`/`GroupMetadataV2` when you want the in-memory representation a Python program typically works with. - ([#3962](https://github.com/zarr-developers/zarr-python/issues/3962)) + ([#3962](https://github.com/zarr-developers/zarr-python/pull/3962)) - Added typed constants exposing the spec-permitted values of constrained Literal fields, importable at the per-codec module level. For example, `from zarr_metadata.v3.codec.bytes import ENDIAN` provides `("little", "big")` as a tuple, enabling runtime iteration or validator generation without re-stating the Literal values by hand. - ([#3978](https://github.com/zarr-developers/zarr-python/issues/3978)) + ([#3978](https://github.com/zarr-developers/zarr-python/pull/3978)) ## 0.1.1 (2026-05-06) @@ -242,7 +242,7 @@ - First usable release on PyPI. Version 0.1.0 was uploaded then deleted to reserve the project name; this version is the first one PyPI will install. No source changes from 0.1.0. - ([#3949](https://github.com/zarr-developers/zarr-python/issues/3949)) + ([#3949](https://github.com/zarr-developers/zarr-python/pull/3949)) ## 0.1.0 (2026-05-01) @@ -253,4 +253,4 @@ of `zarr-extensions` types and the un-specified-but-widely-used consolidated metadata documents. Pair with a runtime validator like `pydantic` to check JSON loaded from disk. - ([#3919](https://github.com/zarr-developers/zarr-python/issues/3919)) + ([#3919](https://github.com/zarr-developers/zarr-python/pull/3919)) diff --git a/packages/zarr-metadata/README.md b/packages/zarr-metadata/README.md index 6b6b172aec..34c53988db 100644 --- a/packages/zarr-metadata/README.md +++ b/packages/zarr-metadata/README.md @@ -2,7 +2,7 @@ Python types, models, and validators for Zarr v2 and v3 metadata. -Documentation: +Documentation: ## What this is diff --git a/packages/zarr-metadata/pyproject.toml b/packages/zarr-metadata/pyproject.toml index 6e97d26409..1ef1c31624 100644 --- a/packages/zarr-metadata/pyproject.toml +++ b/packages/zarr-metadata/pyproject.toml @@ -115,5 +115,5 @@ filename = "CHANGELOG.md" package = "zarr_metadata" underlines = ["", "", ""] title_format = "## {version} ({project_date})" -issue_format = "[#{issue}](https://github.com/zarr-developers/zarr-python/issues/{issue})" +issue_format = "[#{issue}](https://github.com/zarr-developers/zarr-python/pull/{issue})" start_string = "\n" diff --git a/pyproject.toml b/pyproject.toml index 727071b5a3..1927ce4d7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -514,7 +514,7 @@ directory = 'changes' filename = "docs/release-notes.md" underlines = ["", "", ""] title_format = "## {version} ({project_date})" -issue_format = "[#{issue}](https://github.com/zarr-developers/zarr-python/issues/{issue})" +issue_format = "[#{issue}](https://github.com/zarr-developers/zarr-python/pull/{issue})" start_string = "\n" [tool.codespell] From a88f88951e7b1bc19f19adad2fb364158851076a Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Thu, 30 Jul 2026 07:10:15 +0200 Subject: [PATCH 22/61] fix: make ManagedMemoryStore/GpuMemoryStore sync methods parity-safe (#4204) ManagedMemoryStore inherited get_sync/set_sync/delete_sync from MemoryStore, which use the raw key, while every async method prefixed keys with self.path. Any code taking the sync fast path (e.g. FusedCodecPipeline) wrote/read chunks outside the store's path prefix, so a fresh handle re-reading through the prefix silently got fill values. Override the three sync methods to prefix like their async counterparts. GpuMemoryStore.set_sync gets the same treatment: it now converts its value to a gpu.Buffer like set does, preserving the store's all-values-are-gpu invariant for the sync API. Also fix ManagedMemoryStore.get_partial_values, which applied self.path twice whenever path was non-empty (it pre-prefixed keys, then delegated to MemoryStore.get_partial_values, which itself dispatches through the already-overridden self.get) -- this made it return None for every key. Discovered via the strengthened test fixture below. Add sync/async parity laws to the shared StoreTests suite so every store subclass exercises this invariant: set through one API and read through the other (including byte_range variants), and confirm delete_sync is visible to async get. These are the tests that would have caught the ManagedMemoryStore bug. TestManagedMemoryStore's raw set/get test helpers now respect self.path, and store_kwargs uses a non-empty path, so prefix handling is actually exercised instead of passing vacuously. Add an end-to-end regression with FusedCodecPipeline writing to a ManagedMemoryStore(path=...) sharing a dict with a fresh handle. Add a LocalStore.delete_sync directory-branch test. Assisted-by: ClaudeCode:claude-sonnet-5 --- changes/4204.bugfix.md | 16 +++++++ src/zarr/storage/_memory.py | 44 +++++++++++++++---- src/zarr/testing/store.py | 65 ++++++++++++++++++++++++++++ tests/test_store/test_local.py | 14 ++++++ tests/test_store/test_memory.py | 76 ++++++++++++++++++++++++++++++--- 5 files changed, 202 insertions(+), 13 deletions(-) create mode 100644 changes/4204.bugfix.md diff --git a/changes/4204.bugfix.md b/changes/4204.bugfix.md new file mode 100644 index 0000000000..90101d1059 --- /dev/null +++ b/changes/4204.bugfix.md @@ -0,0 +1,16 @@ +`ManagedMemoryStore.get_sync`/`set_sync`/`delete_sync` now apply the store's +`path` prefix, matching the async `get`/`set`/`delete` methods. Previously the +sync methods were inherited unchanged from `MemoryStore` and used the raw key, +so code that takes the sync fast path (e.g. `FusedCodecPipeline`) would read +and write chunks outside the store's `path` prefix, silently returning fill +values when the data was re-read through a fresh handle. `GpuMemoryStore.set_sync` +now converts its value to a `gpu.Buffer`, matching `set`, so writes through the +sync API keep the store's all-values-are-GPU invariant. Also fixed +`ManagedMemoryStore.get_partial_values` applying its `path` prefix twice +whenever `path` is non-empty, which made it always return `None` for every +requested key. + +The shared store test suite (`zarr.testing.store.StoreTests`) gained +sync/async parity checks — comparing sync and async observations of the same +key on the same store instance, including with a `byte_range` — so every +store subclass now exercises this invariant. diff --git a/src/zarr/storage/_memory.py b/src/zarr/storage/_memory.py index 97dd355515..f42c38df69 100644 --- a/src/zarr/storage/_memory.py +++ b/src/zarr/storage/_memory.py @@ -314,6 +314,19 @@ async def set(self, key: str, value: Buffer, byte_range: tuple[int, int] | None gpu_value = value if isinstance(value, gpu.Buffer) else gpu.Buffer.from_buffer(value) await super().set(key, gpu_value, byte_range=byte_range) + def set_sync(self, key: str, value: Buffer) -> None: + # docstring inherited + self._check_writable() + assert isinstance(key, str) + if not isinstance(value, Buffer): + raise TypeError( + f"GpuMemoryStore.set(): `value` must be a Buffer instance. Got an instance of {type(value)} instead." + ) + # Convert to gpu.Buffer, mirroring `set` above: every value in this store's + # backing dict must be a gpu.Buffer, regardless of which API wrote it. + gpu_value = value if isinstance(value, gpu.Buffer) else gpu.Buffer.from_buffer(value) + super().set_sync(key, gpu_value) + # ----------------------------------------------------------------------------- # ManagedMemoryStore and its registry @@ -572,25 +585,40 @@ def from_url(cls, url: str, *, read_only: bool = False) -> ManagedMemoryStore: # Override MemoryStore methods to use path prefix and check process - async def get( + def get_sync( self, key: str, + *, prototype: BufferPrototype | None = None, byte_range: ByteRequest | None = None, ) -> Buffer | None: # docstring inherited - return await super().get( + return super().get_sync( _join_paths([self.path, key]), prototype=prototype, byte_range=byte_range ) - async def get_partial_values( + def set_sync(self, key: str, value: Buffer) -> None: + # docstring inherited + super().set_sync(_join_paths([self.path, key]), value) + + def delete_sync(self, key: str) -> None: + # docstring inherited + super().delete_sync(_join_paths([self.path, key])) + + async def get( self, - prototype: BufferPrototype, - key_ranges: Iterable[tuple[str, ByteRequest | None]], - ) -> list[Buffer | None]: + key: str, + prototype: BufferPrototype | None = None, + byte_range: ByteRequest | None = None, + ) -> Buffer | None: # docstring inherited - key_ranges = [(_join_paths([self.path, key]), byte_range) for key, byte_range in key_ranges] - return await super().get_partial_values(prototype, key_ranges) + return await super().get( + _join_paths([self.path, key]), prototype=prototype, byte_range=byte_range + ) + + # get_partial_values is intentionally NOT overridden here: MemoryStore.get_partial_values + # dispatches per-key through `self.get`, which already resolves to the override above. + # Re-prefixing the keys here as well would apply `self.path` twice. async def exists(self, key: str) -> bool: # docstring inherited diff --git a/src/zarr/testing/store.py b/src/zarr/testing/store.py index 46287ccffb..d7011440e0 100644 --- a/src/zarr/testing/store.py +++ b/src/zarr/testing/store.py @@ -618,6 +618,71 @@ def test_delete_sync_missing(self, store: S) -> None: # should not raise deleter.delete_sync("nonexistent_sync") + # ------------------------------------------------------------------- + # Sync/async parity laws + # ------------------------------------------------------------------- + # A store's sync and async methods must observe the same key the same + # way. This is stronger than the individual test_get_sync/test_set_sync/ + # test_delete_sync tests above: those write and read back through the + # *same* API (sync-only or, via `self.set`/`self.get`, bypassing the + # store entirely), so a sync method that skips logic the async method + # applies (e.g. a path prefix) can still pass them. These laws write + # through one API and observe through the other. + + @pytest.mark.parametrize("direction", ["set_async_get_sync", "set_sync_get_async"]) + async def test_sync_async_set_get_parity(self, store: S, direction: str) -> None: + setter = self._require_set_sync(store) + getter = self._require_get_sync(store) + data_buf = self.buffer_cls.from_bytes(b"\x01\x02\x03\x04") + key = "parity_set_get" + if direction == "set_async_get_sync": + await store.set(key, data_buf) + result = getter.get_sync(key) + else: + setter.set_sync(key, data_buf) + result = await store.get(key, prototype=default_buffer_prototype()) + assert result is not None + assert_bytes_equal(result, data_buf) + + async def test_delete_sync_visible_to_async_get(self, store: S) -> None: + deleter = self._require_delete_sync(store) + if not store.supports_deletes: + pytest.skip("store does not support deletes") + data_buf = self.buffer_cls.from_bytes(b"\x01\x02\x03\x04") + key = "parity_delete" + await store.set(key, data_buf) + deleter.delete_sync(key) + result = await store.get(key, prototype=default_buffer_prototype()) + assert result is None + + @pytest.mark.parametrize( + "byte_range", + [ + None, + RangeByteRequest(1, 4), + OffsetByteRequest(1), + SuffixByteRequest(1), + RangeByteRequest(10, 20), + ], + ids=["none", "range", "offset", "suffix", "range-past-eof"], + ) + async def test_get_sync_byte_range_parity( + self, store: S, byte_range: ByteRequest | None + ) -> None: + getter = self._require_get_sync(store) + data_buf = self.buffer_cls.from_bytes(b"\x01\x02\x03\x04") + key = "parity_byte_range" + await store.set(key, data_buf) + sync_result = getter.get_sync(key, byte_range=byte_range) + async_result = await store.get( + key, prototype=default_buffer_prototype(), byte_range=byte_range + ) + if async_result is None: + assert sync_result is None + else: + assert sync_result is not None + assert_bytes_equal(sync_result, async_result) + class LatencyStore(WrapperStore[Store]): """ diff --git a/tests/test_store/test_local.py b/tests/test_store/test_local.py index f65f618d65..61e48a269f 100644 --- a/tests/test_store/test_local.py +++ b/tests/test_store/test_local.py @@ -46,6 +46,20 @@ async def test_empty_with_empty_subdir(self, store: LocalStore) -> None: (store.root / "foo/bar").mkdir(parents=True) assert await store.is_empty("") + def test_delete_sync_directory(self, store: LocalStore) -> None: + """`delete_sync` on a key that is a directory must remove the whole tree. + + Mirrors the async `delete_dir` behavior: deleting `"foo"` where + `"foo"` is a directory containing further nested paths should remove + everything under it, not just fail or delete a single file. + """ + (store.root / "foo" / "bar").mkdir(parents=True) + (store.root / "foo" / "bar" / "baz").write_bytes(b"data") + + store.delete_sync("foo") + + assert not (store.root / "foo").exists() + def test_creates_new_directory(self, tmp_path: pathlib.Path) -> None: target = tmp_path.joinpath("a", "b", "c") assert not target.exists() diff --git a/tests/test_store/test_memory.py b/tests/test_store/test_memory.py index 36265423e6..a976f3738e 100644 --- a/tests/test_store/test_memory.py +++ b/tests/test_store/test_memory.py @@ -11,6 +11,7 @@ from zarr.core.buffer import Buffer, cpu, default_buffer_prototype, gpu from zarr.errors import ZarrUserWarning from zarr.storage import GpuMemoryStore, ManagedMemoryStore, MemoryStore +from zarr.storage._utils import _join_paths from zarr.testing.store import StoreTests from zarr.testing.utils import gpu_test @@ -233,31 +234,48 @@ def test_from_dict(self) -> None: for v in result._store_dict.values(): assert type(v) is gpu.Buffer + def test_set_sync_converts_to_gpu_buffer(self, store: GpuMemoryStore) -> None: + """`set_sync` must convert its value to a `gpu.Buffer`, mirroring `set`. + + `GpuMemoryStore`'s invariant is that every stored value is a + `gpu.Buffer`. Without this override, the inherited `MemoryStore.set_sync` + would store the CPU buffer it was given as-is, breaking that invariant + for whichever code path (e.g. the fused pipeline) uses the sync API. + """ + cpu_value = cpu.Buffer.from_bytes(b"aaaa") + msg = "Creating a zarr.buffer.gpu.Buffer with an array that does not support the __cuda_array_interface__ for zero-copy transfers, falling back to slow copy based path" + with pytest.warns(ZarrUserWarning, match=msg): + store.set_sync("k", cpu_value) + assert type(store._store_dict["k"]) is gpu.Buffer + class TestManagedMemoryStore(StoreTests[ManagedMemoryStore, cpu.Buffer]): store_cls = ManagedMemoryStore buffer_cls = cpu.Buffer async def set(self, store: ManagedMemoryStore, key: str, value: Buffer) -> None: - store._store_dict[key] = value + store._store_dict[_join_paths([store.path, key])] = value async def get(self, store: ManagedMemoryStore, key: str) -> Buffer: - return store._store_dict[key] + return store._store_dict[_join_paths([store.path, key])] @pytest.fixture def store_kwargs(self, request: pytest.FixtureRequest) -> dict[str, Any]: # Use a unique name per test to avoid sharing state between tests # but ensure the name is deterministic for equality tests # Replace '/' with '-' since store names cannot contain '/' + # A non-empty path exercises prefix handling; a store with an + # unprefixed key in its backing dict would pass these tests + # vacuously with path="". sanitized_name = request.node.name.replace("/", "-") - return {"name": f"test-{sanitized_name}"} + return {"name": f"test-{sanitized_name}", "path": "prefix"} @pytest.fixture async def store(self, store_kwargs: dict[str, Any]) -> ManagedMemoryStore: return self.store_cls(**store_kwargs) def test_store_repr(self, store: ManagedMemoryStore) -> None: - assert str(store) == f"memory://{store.name}" + assert str(store) == _join_paths([f"memory://{store.name}", store.path]) async def test_serializable_store(self, store: ManagedMemoryStore) -> None: """ @@ -383,7 +401,10 @@ def test_from_url(self, store: ManagedMemoryStore) -> None: def test_from_url_with_path(self, store: ManagedMemoryStore) -> None: """Test that from_url extracts path component from URL.""" - url = f"{store}/some/path" + # Reconnect to the fixture's dict via its name, but with an empty + # path, so appending "/some/path" below yields exactly that path. + base = ManagedMemoryStore(name=store.name) + url = f"{base}/some/path" store2 = ManagedMemoryStore.from_url(url) assert store2._store_dict is store._store_dict assert store2.path == "some/path" @@ -512,3 +533,48 @@ def test_garbage_collection(self) -> None: # URL should no longer resolve with pytest.raises(ValueError, match="garbage collected"): ManagedMemoryStore.from_url(url) + + def test_sync_methods_respect_path_prefix(self) -> None: + """`get_sync`/`set_sync`/`delete_sync` must prefix keys with `self.path`, + exactly like the async `get`/`set`/`delete` methods. + + `ManagedMemoryStore` used to inherit these from `MemoryStore`, which + writes/reads the raw key. Two stores sharing a dict with different + `path` values would then cross-talk through the sync API. + """ + store = ManagedMemoryStore(name="sync-prefix-test", path="subdir") + data_buf = self.buffer_cls.from_bytes(b"value") + + store.set_sync("key", data_buf) + assert "subdir/key" in store._store_dict + assert "key" not in store._store_dict + + result = store.get_sync("key") + assert result is not None + assert result.to_bytes() == b"value" + + store.delete_sync("key") + assert "subdir/key" not in store._store_dict + + def test_fused_pipeline_respects_path_prefix(self) -> None: + """End-to-end regression: the fused pipeline's sync store fast path must + write chunks under the store's path prefix. + + `FusedCodecPipeline` uses `set_sync`/`get_sync` when a store implements + the sync protocols. If those methods skip the prefix that the async + methods apply, chunk data lands outside `self.path` and a fresh handle + re-reading through the prefix silently sees fill values instead. + """ + with zarr.config.set( + {"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"} + ): + store = ManagedMemoryStore(name="fused-prefix-test", path="subdir") + arr = zarr.create_array(store, shape=(4,), chunks=(4,), dtype="uint8", zarr_format=3) + arr[:] = np.arange(4, dtype="uint8") + + bad_keys = [k for k in store._store_dict if not k.startswith("subdir/")] + assert bad_keys == [], f"keys written outside the store's path prefix: {bad_keys}" + + store2 = ManagedMemoryStore.from_url("memory://fused-prefix-test/subdir") + arr2 = zarr.open_array(store2, mode="r") + np.testing.assert_array_equal(arr2[:], np.arange(4, dtype="uint8")) From 6f9724cb14686e0737ed144be5d945fe1fbde578 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Thu, 30 Jul 2026 11:08:29 +0200 Subject: [PATCH 23/61] fix: minor correctness and hygiene fixes from the sync-pipeline audit (#4205) - Codec construction warnings (e.g. sharding's "disables partial reads") fired twice per array open, and on every decode/encode through the fused pipeline's async fallback. Re-constructions of an already-validated codec chain now go through codecs_from_list_unchecked, which validates structure without repeating first-construction advisory warnings; each warning fires exactly once per open under both pipelines. - concurrent_iter returned a lazy generator while its docstring promised eagerly scheduled tasks; it now materializes the task list so awaiting one at a time cannot serialize the batch. - A garbage codec_pipeline.max_workers value (e.g. from the environment) raised ValueError mid-read; it now warns and falls back to the default, consistent with tolerant handling of config input. - The as-completed pipeline helpers abandoned in-flight tasks when one failed, leaving stray background writes and "Task exception was never retrieved" warnings; failures now cancel and drain outstanding tasks. - Benchmarks: seed the data generator for reproducibility; fix a copy-pasted docstring. - Remove dead commented-out test blocks referencing the removed set_range API. Assisted-by: ClaudeCode:claude-sonnet-5 --- changes/4205.bugfix.md | 9 ++ src/zarr/core/array.py | 6 ++ src/zarr/core/chunk_utils.py | 8 +- src/zarr/core/codec_pipeline.py | 145 +++++++++++++++++++++++++------ src/zarr/core/common.py | 20 ++--- tests/benchmarks/test_e2e.py | 5 +- tests/test_codecs/test_codecs.py | 46 +++++++++- tests/test_common.py | 28 ++++++ tests/test_fused_pipeline.py | 101 ++++++++++++++++++++- tests/test_store/test_local.py | 52 ----------- tests/test_store/test_memory.py | 53 ----------- 11 files changed, 325 insertions(+), 148 deletions(-) create mode 100644 changes/4205.bugfix.md diff --git a/changes/4205.bugfix.md b/changes/4205.bugfix.md new file mode 100644 index 0000000000..0492febb7d --- /dev/null +++ b/changes/4205.bugfix.md @@ -0,0 +1,9 @@ +Fixed several small correctness issues from the codec-pipeline performance work: construction-time +codec warnings (e.g. sharding's "disables partial reads" warning) no longer fire twice per array +open — including for `FusedCodecPipeline`, which previously re-warned via its own codec-chain +reconstruction and, on the async fallback path, on every decode/encode call; `concurrent_iter` now +schedules its tasks eagerly, matching its documented contract; an invalid +`codec_pipeline.max_workers` config/environment value now warns and falls back to the default +instead of raising mid-read; and `FusedCodecPipeline`'s async fallback helpers now cancel +already-spawned fetch/decode/write tasks instead of abandoning them in the background when one +fails. diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index f75ef72415..cd51dad50c 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -228,6 +228,12 @@ def create_codec_pipeline(metadata: ArrayMetadata, *, store: Store | None = None pass if isinstance(metadata, ArrayV3Metadata): + # The pipeline built here is a throwaway: `evolve_from_array_spec` below + # reconstructs codecs against the evolved spec. `from_codecs` is the + # chain's first construction, so its advisory warnings (e.g. sharding's + # "disables partial reads" warning) fire here; `evolve_from_array_spec` + # re-splits the same already-warned-about chain via + # `codecs_from_list_unchecked`, so it does not re-emit them. pipeline = get_pipeline_class().from_codecs(metadata.codecs) from zarr.core.metadata.v3 import RegularChunkGridMetadata diff --git a/src/zarr/core/chunk_utils.py b/src/zarr/core/chunk_utils.py index d93793f853..b26d5478b2 100644 --- a/src/zarr/core/chunk_utils.py +++ b/src/zarr/core/chunk_utils.py @@ -238,7 +238,7 @@ class ChunkTransform: ) def __post_init__(self) -> None: - from zarr.core.codec_pipeline import codecs_from_list + from zarr.core.codec_pipeline import codecs_from_list_unchecked # _codec_supports_sync, not a bare isinstance check: a codec can satisfy # the SupportsSyncCodec protocol structurally yet be unable to run @@ -253,7 +253,11 @@ def __post_init__(self) -> None: f"All codecs must implement SupportsSyncCodec. The following do not: {names}" ) - aa, ab, bb = codecs_from_list(list(self.codecs)) + # `ChunkTransform` is built from a codec chain that already went + # through `codecs_from_list` when the owning pipeline was constructed + # (see `FusedCodecPipeline.evolve_from_array_spec`), so re-splitting it + # here must not re-emit that chain's advisory warnings. + aa, ab, bb = codecs_from_list_unchecked(list(self.codecs)) # SupportsSyncCodec was verified above; the cast is purely for mypy. self._aa_codecs = cast("tuple[SupportsSyncCodec[NDBuffer, NDBuffer], ...]", tuple(aa)) self._ab_codec = cast("SupportsSyncCodec[NDBuffer, Buffer]", ab) diff --git a/src/zarr/core/codec_pipeline.py b/src/zarr/core/codec_pipeline.py index ca760ece59..92fd0970fe 100644 --- a/src/zarr/core/codec_pipeline.py +++ b/src/zarr/core/codec_pipeline.py @@ -4,7 +4,7 @@ import threading from concurrent.futures import ThreadPoolExecutor from dataclasses import dataclass, field -from itertools import batched, pairwise +from itertools import batched, chain, pairwise from typing import TYPE_CHECKING, Any, cast from warnings import warn @@ -54,10 +54,23 @@ def _resolve_max_workers() -> int: """Helper for getting the maximum number of workers available to the `FusedCodecPipeline`""" import os as _os + default = _os.cpu_count() or 1 cfg = config.get("codec_pipeline.max_workers", default=None) if cfg is None: - return _os.cpu_count() or 1 - return max(1, int(cfg)) + return default + try: + return max(1, int(cfg)) + except (TypeError, ValueError): + # This value arrives via the config/env layer (e.g. + # `ZARR_CODEC_PIPELINE__MAX_WORKERS`), so tolerate bad input here + # instead of raising mid-read. + warn( + f"Ignoring invalid `codec_pipeline.max_workers` config value {cfg!r}; " + f"falling back to {default}.", + category=ZarrUserWarning, + stacklevel=2, + ) + return default def _get_pool(max_workers: int) -> ThreadPoolExecutor: @@ -169,6 +182,23 @@ def pipeline_supports_partial_encode( return isinstance(array_bytes_codec, ArrayBytesCodecPartialEncodeMixin) +async def _cancel_and_drain(futures: Iterable[asyncio.Future[Any]]) -> None: + """Cancel every not-yet-done future/task and await its outcome. + + Used to clean up work spawned by a drain loop (`asyncio.as_completed` + + `await`) when the loop exits early via exception. Without this, tasks + already spawned keep running unattended after the caller has moved on, + and an eventual failure surfaces as an unraisable "exception was never + retrieved" warning instead of being observed here. + """ + pending = [f for f in futures if not f.done()] + if len(pending) == 0: + return + for f in pending: + f.cancel() + await asyncio.gather(*pending, return_exceptions=True) + + async def _fetch_and_decode_as_completed( batch: Sequence[tuple[ByteGetter | None, ArraySpec]], transform: ChunkTransform, @@ -201,20 +231,29 @@ def _decode(buffer: Buffer | None, chunk_spec: ArraySpec) -> NDBuffer | None: _fetch, config.get("async.concurrency"), ) - for fetch_coro in asyncio.as_completed(fetch_tasks): - idx, buffer = await fetch_coro - chunk_spec = batch[idx][1] - # Bridge both paths to asyncio.Future so the final collection loop - # can `await` uniformly without blocking the event loop. For the - # pool path that means `wrap_future` (not `pool.submit(...).result()`, - # which would block the loop thread for the duration of every decode - # — freezing any unrelated coroutines sharing this loop). - if pool is None: - decode_futures[idx].set_result(_decode(buffer, chunk_spec)) - else: - decode_futures[idx] = asyncio.wrap_future(pool.submit(_decode, buffer, chunk_spec)) + try: + for fetch_coro in asyncio.as_completed(fetch_tasks): + idx, buffer = await fetch_coro + chunk_spec = batch[idx][1] + # Bridge both paths to asyncio.Future so the final collection loop + # can `await` uniformly without blocking the event loop. For the + # pool path that means `wrap_future` (not `pool.submit(...).result()`, + # which would block the loop thread for the duration of every decode + # — freezing any unrelated coroutines sharing this loop). + if pool is None: + decode_futures[idx].set_result(_decode(buffer, chunk_spec)) + else: + decode_futures[idx] = asyncio.wrap_future(pool.submit(_decode, buffer, chunk_spec)) - return await asyncio.gather(*decode_futures) + return await asyncio.gather(*decode_futures) + finally: + # On the happy path every future here is already done, so this is a + # no-op; on failure it stops abandoned fetches/decodes from + # continuing to run unattended after this function has raised. A + # single call over both iterables (not two sequential calls) so that + # outer-task cancellation during the first drain can't skip the + # second, leaving its futures/tasks unobserved. + await _cancel_and_drain(chain(fetch_tasks, decode_futures)) async def _encode_and_write_as_completed( @@ -263,10 +302,20 @@ async def _write(idx: int, chunk_bytes: Buffer | None) -> None: # Kick off each chunk's write the instant its encode lands, so writes of # already-compressed chunks proceed while the rest are still encoding. write_tasks: list[asyncio.Task[None]] = [] - for encode_coro in asyncio.as_completed(encode_futures): - idx, chunk_bytes = await encode_coro - write_tasks.append(asyncio.ensure_future(_write(idx, chunk_bytes))) - await asyncio.gather(*write_tasks) + try: + for encode_coro in asyncio.as_completed(encode_futures): + idx, chunk_bytes = await encode_coro + write_tasks.append(asyncio.ensure_future(_write(idx, chunk_bytes))) + await asyncio.gather(*write_tasks) + finally: + # On the happy path every future here is already done, so this is a + # no-op; on failure (an encode or a write raising) it stops + # already-spawned writes from continuing in the background after + # this function has raised. A single call over both iterables (not + # two sequential calls) so that outer-task cancellation during the + # first drain can't skip the second, leaving its futures/tasks + # unobserved. + await _cancel_and_drain(chain(write_tasks, encode_futures)) async def _async_read_fallback( @@ -468,7 +517,11 @@ class AsyncChunkTransform: _bb_codecs: tuple[BytesBytesCodec, ...] = field(init=False, repr=False, compare=False) def __post_init__(self) -> None: - aa, ab, bb = codecs_from_list(list(self.codecs)) + # `AsyncChunkTransform` is (re)constructed per decode/encode call from a + # codec chain that already went through `codecs_from_list` when the + # pipeline itself was built, so re-splitting it here must not re-emit + # that chain's advisory warnings on every call. + aa, ab, bb = codecs_from_list_unchecked(list(self.codecs)) self._aa_codecs = aa self._ab_codec = ab self._bb_codecs = bb @@ -532,7 +585,19 @@ class BatchedCodecPipeline(CodecPipeline): batch_size: int def evolve_from_array_spec(self, array_spec: ArraySpec) -> Self: - return type(self).from_codecs(evolve_codecs(self, array_spec)) + # Re-splits an already-`codecs_from_list`-validated (and warned-about) + # chain against the evolved spec, so this uses the quiet variant rather + # than routing through `from_codecs` (which would re-warn). + evolved_codecs = evolve_codecs(self, array_spec) + array_array_codecs, array_bytes_codec, bytes_bytes_codecs = codecs_from_list_unchecked( + evolved_codecs + ) + return type(self)( + array_array_codecs=array_array_codecs, + array_bytes_codec=array_bytes_codec, + bytes_bytes_codecs=bytes_bytes_codecs, + batch_size=self.batch_size, + ) @classmethod def from_codecs(cls, codecs: Iterable[Codec], *, batch_size: int | None = None) -> Self: @@ -794,14 +859,20 @@ async def write( def codecs_from_list( codecs: Iterable[Codec], ) -> tuple[tuple[ArrayArrayCodec, ...], ArrayBytesCodec, tuple[BytesBytesCodec, ...]]: + """Split `codecs` into `(array_array, array_bytes, bytes_bytes)`, validating order. + + Emits user-facing advisory warnings about the codec chain (e.g. sharding's + "disables partial reads" warning). Use this for the FIRST construction of a + codec chain from user-supplied codecs. Use `codecs_from_list_unchecked` when + re-splitting a chain that was already validated and warned about by a prior + `codecs_from_list` call (e.g. `evolve_from_array_spec` re-splitting the same + codecs against an evolved spec) — re-warning there would fire the same + advisory once per reconstruction instead of once per user-facing chain. + """ from zarr.codecs.sharding import ShardingCodec codecs = tuple(codecs) # materialize to avoid generator consumption issues - array_array: tuple[ArrayArrayCodec, ...] = () - array_bytes_maybe: ArrayBytesCodec | None = None - bytes_bytes: tuple[BytesBytesCodec, ...] = () - if any(isinstance(codec, ShardingCodec) for codec in codecs) and len(codecs) > 1: warn( "Combining a `sharding_indexed` codec disables partial reads and " @@ -809,6 +880,23 @@ def codecs_from_list( category=ZarrUserWarning, stacklevel=3, ) + return codecs_from_list_unchecked(codecs) + + +def codecs_from_list_unchecked( + codecs: Iterable[Codec], +) -> tuple[tuple[ArrayArrayCodec, ...], ArrayBytesCodec, tuple[BytesBytesCodec, ...]]: + """Split `codecs` into `(array_array, array_bytes, bytes_bytes)`, validating order. + + Same structural validation as `codecs_from_list` (raises on bad codec + ordering or a missing/duplicate array-bytes codec) but does NOT emit + user-facing advisory warnings. See `codecs_from_list` for when to use each. + """ + codecs = tuple(codecs) # materialize to avoid generator consumption issues + + array_array: tuple[ArrayArrayCodec, ...] = () + array_bytes_maybe: ArrayBytesCodec | None = None + bytes_bytes: tuple[BytesBytesCodec, ...] = () for prev_codec, cur_codec in pairwise((None, *codecs)): if isinstance(cur_codec, ArrayArrayCodec): @@ -911,8 +999,11 @@ def from_codecs(cls, codecs: Iterable[Codec], *, batch_size: int | None = None) ) def evolve_from_array_spec(self, array_spec: ArraySpec) -> Self: + # Re-splits an already-`codecs_from_list`-validated (and warned-about) + # chain against the evolved spec, so this uses the quiet variant to + # avoid re-emitting the same advisory warning on every array open. evolved_codecs = evolve_codecs(self.codecs, array_spec) - aa, ab, bb = codecs_from_list(evolved_codecs) + aa, ab, bb = codecs_from_list_unchecked(evolved_codecs) try: sync_transform: ChunkTransform | None = ChunkTransform(codecs=evolved_codecs) diff --git a/src/zarr/core/common.py b/src/zarr/core/common.py index 4114cb7645..1541683b09 100644 --- a/src/zarr/core/common.py +++ b/src/zarr/core/common.py @@ -93,26 +93,26 @@ def concurrent_iter[T: tuple[Any, ...], V]( items: Iterable[T], func: Callable[..., Awaitable[V]], limit: int | None = None, -) -> Iterator[asyncio.Task[V]]: +) -> list[asyncio.Task[V]]: """Launch `func(*item)` for each item concurrently, returning the tasks. When `limit` is set, no more than `limit` calls are in flight at once. Tasks are returned in input order; callers that want completion order should wrap the result in `asyncio.as_completed`. - Note on `ensure_future`: when the result is passed to `asyncio.gather` or - `asyncio.as_completed`, those already wrap awaitables into tasks, so the - `ensure_future` here is redundant. It matters for callers that iterate and - await tasks one at a time — without eager scheduling, each coroutine would - only start when individually awaited, serializing the work and defeating - the semaphore. It also makes the return type honest (real `Task`s support - `.cancel()`, `.done()`, callbacks) rather than bare coroutines. + Every task is scheduled (via `ensure_future`) before this function + returns, not on first iteration of the result. That matters for callers + that await the returned tasks one at a time — without eager scheduling, + each coroutine would only start when individually awaited, serializing + the work and defeating the semaphore. It also makes the return type + honest (real `Task`s support `.cancel()`, `.done()`, callbacks) rather + than bare coroutines. See https://docs.python.org/3/library/asyncio-task.html#coroutines: "Note that simply calling a coroutine will not schedule it to be executed:" """ if limit is None: - return (asyncio.ensure_future(func(*item)) for item in items) + return [asyncio.ensure_future(func(*item)) for item in items] sem = asyncio.Semaphore(limit) @@ -120,7 +120,7 @@ async def run(item: T) -> V: async with sem: return await func(*item) - return (asyncio.ensure_future(run(item)) for item in items) + return [asyncio.ensure_future(run(item)) for item in items] async def concurrent_map[T: tuple[Any, ...], V]( diff --git a/tests/benchmarks/test_e2e.py b/tests/benchmarks/test_e2e.py index de69fca59b..9720778d8f 100644 --- a/tests/benchmarks/test_e2e.py +++ b/tests/benchmarks/test_e2e.py @@ -63,7 +63,8 @@ def _data(shape: tuple[int]) -> np.ndarray: noise_level = 1 pattern = (np.sin(np.linspace(0, 2 * np.pi, period)) * 50 + 128).round().astype(np.uint8) data = np.tile(pattern, int(np.ceil(n / period)))[:n].astype(np.int16) - data += np.random.randint(-noise_level, noise_level + 1, size=n, dtype=np.int16) + rng = np.random.default_rng(0) + data += rng.integers(-noise_level, noise_level + 1, size=n, dtype=np.int16) return np.clip(data, 0, 255).astype(np.uint8) @@ -189,7 +190,7 @@ def test_read_array( get_data: Callable[[tuple[int]], np.ndarray | int], ) -> None: """ - Test the time required to fill an array with a single value + Test the time required to read the entirety of an array """ arr = create_array( bench_store, diff --git a/tests/test_codecs/test_codecs.py b/tests/test_codecs/test_codecs.py index 01ac02920f..8b4585503c 100644 --- a/tests/test_codecs/test_codecs.py +++ b/tests/test_codecs/test_codecs.py @@ -1,6 +1,7 @@ from __future__ import annotations import json +import warnings from dataclasses import dataclass from typing import TYPE_CHECKING, Any @@ -22,7 +23,7 @@ from zarr.core.metadata.v3 import ArrayV3Metadata from zarr.dtype import UInt8 from zarr.errors import ZarrUserWarning -from zarr.storage import StorePath +from zarr.storage import MemoryStore, StorePath if TYPE_CHECKING: from zarr.abc.codec import Codec @@ -375,6 +376,49 @@ def test_invalid_metadata_create_array() -> None: ) +@pytest.mark.parametrize( + "pipeline_path", + [ + "zarr.core.codec_pipeline.BatchedCodecPipeline", + "zarr.core.codec_pipeline.FusedCodecPipeline", + ], +) +def test_sharding_warning_fires_once_per_open(pipeline_path: str) -> None: + """Construction-time codec warnings (e.g. sharding's partial-reads warning) + must fire exactly once per array open, not once per internal codec-chain + reconstruction. + + `create_codec_pipeline` builds a throwaway pipeline via `from_codecs` (which + warns) and then calls `evolve_from_array_spec` on it, which re-splits the + (already-warned-about) codec chain against the evolved spec. That re-split + goes through `codecs_from_list_unchecked` rather than `codecs_from_list`, so + it does not re-emit the warning. `FusedCodecPipeline` additionally builds a + `ChunkTransform` (and, on the async fallback path, an `AsyncChunkTransform` + per call) from the same evolved codec chain, which must use the same quiet + variant. + """ + with config.set({"codec_pipeline.path": pipeline_path}): + store = MemoryStore() + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + zarr.create_array( + store, + shape=(16, 16), + chunks=(16, 16), + dtype=np.dtype("uint8"), + fill_value=0, + serializer=ShardingCodec(chunk_shape=(8, 8)), + compressors=[GzipCodec()], + ) + + with warnings.catch_warnings(record=True) as caught: + warnings.simplefilter("always") + zarr.open_array(store, mode="r") + + matches = [w for w in caught if "disables partial reads" in str(w.message)] + assert len(matches) == 1 + + @pytest.mark.parametrize("store", ["local", "memory"], indirect=["store"]) async def test_resize(store: Store) -> None: data = np.zeros((16, 18), dtype="uint16") diff --git a/tests/test_common.py b/tests/test_common.py index 2fe0743e14..5d8df326da 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -1,5 +1,6 @@ from __future__ import annotations +import asyncio from collections.abc import Iterable from typing import TYPE_CHECKING, get_args @@ -9,6 +10,7 @@ from zarr.core.common import ( ANY_ACCESS_MODE, AccessModeLiteral, + concurrent_iter, parse_int, parse_name, parse_shapelike, @@ -32,6 +34,32 @@ def test_access_modes() -> None: assert set(ANY_ACCESS_MODE) == set(get_args(AccessModeLiteral)) +async def test_concurrent_iter_schedules_eagerly() -> None: + """`concurrent_iter` must return already-scheduled tasks, not a lazy generator. + + Its docstring promises `func(*item)` is launched concurrently for every + item up front; a caller that awaits the returned tasks one at a time + (rather than via `gather`/`as_completed`, which force iteration) relies + on that eager scheduling to get any overlap at all. + """ + started = [False, False, False] + + async def mark(i: int) -> int: + started[i] = True + return i + + tasks = concurrent_iter([(0,), (1,), (2,)], mark) + + # Give the event loop one chance to run before awaiting anything + # individually. If `concurrent_iter` were lazy, nothing would have been + # scheduled yet and `started` would still be all-False here. + await asyncio.sleep(0) + assert started == [True, True, True] + + results = [await t for t in tasks] + assert results == [0, 1, 2] + + # todo: test def test_concurrent_map() -> None: ... diff --git a/tests/test_fused_pipeline.py b/tests/test_fused_pipeline.py index fd86936853..7fa3ef2277 100644 --- a/tests/test_fused_pipeline.py +++ b/tests/test_fused_pipeline.py @@ -2,6 +2,7 @@ from __future__ import annotations +import asyncio from dataclasses import dataclass, field, replace from typing import TYPE_CHECKING, Any @@ -25,8 +26,9 @@ from zarr.storage import MemoryStore, StorePath if TYPE_CHECKING: + from zarr.abc.store import ByteRequest from zarr.core.array_spec import ArraySpec - from zarr.core.buffer import Buffer, NDBuffer + from zarr.core.buffer import Buffer, BufferPrototype, NDBuffer @pytest.mark.parametrize( @@ -439,6 +441,103 @@ def test_thread_pool_read_worker_exception_propagates() -> None: arr[:] +def test_resolve_max_workers_warns_and_falls_back_on_invalid_config() -> None: + """`codec_pipeline.max_workers` arrives via the config/env layer (e.g. + `ZARR_CODEC_PIPELINE__MAX_WORKERS`), so garbage input should warn and fall + back to the default rather than raising mid-read. + """ + import os + + import zarr.core.codec_pipeline as cp_mod + from zarr.errors import ZarrUserWarning + + default = os.cpu_count() or 1 + with zarr_config.set({"codec_pipeline.max_workers": "fast"}): + with pytest.warns(ZarrUserWarning, match="max_workers"): + result = cp_mod._resolve_max_workers() + assert result == default + + +async def test_encode_and_write_as_completed_cancels_stray_writes_on_failure() -> None: + """A failing write must not leave sibling writes running in the background. + + `_encode_and_write_as_completed` fires one write task per chunk as soon as + its encode completes, then `gather`s them. Plain `gather` (without + `return_exceptions=True`) re-raises the first exception without cancelling + the other in-flight tasks, so a still-running write would keep going after + the caller has already seen the exception -- and its eventual outcome is + never retrieved (an unraisable "Task exception was never retrieved" + warning if it later fails). + """ + from zarr.core.array_spec import ArrayConfig, ArraySpec + from zarr.core.buffer import default_buffer_prototype + from zarr.core.buffer.cpu import NDBuffer as CPUNDBuffer + from zarr.core.chunk_utils import ChunkTransform + from zarr.core.codec_pipeline import _encode_and_write_as_completed + from zarr.core.dtype import get_data_type_from_native_dtype + + write_started = asyncio.Event() + write_finished = False + + class _SlowByteSetter: + async def get( + self, prototype: BufferPrototype, byte_range: ByteRequest | None = None + ) -> Buffer | None: + return None + + async def set(self, value: Buffer) -> None: + nonlocal write_finished + write_started.set() + await asyncio.sleep(0.2) + write_finished = True + + async def delete(self) -> None: + pass + + async def set_if_not_exists(self, default: Buffer) -> None: + pass + + class _FailingByteSetter: + async def get( + self, prototype: BufferPrototype, byte_range: ByteRequest | None = None + ) -> Buffer | None: + return None + + async def set(self, value: Buffer) -> None: + raise RuntimeError("simulated write failure") + + async def delete(self) -> None: + pass + + async def set_if_not_exists(self, default: Buffer) -> None: + pass + + zdtype = get_data_type_from_native_dtype(np.dtype("uint8")) + chunk_spec = ArraySpec( + shape=(1,), + dtype=zdtype, + fill_value=zdtype.cast_scalar(0), + config=ArrayConfig(order="C", write_empty_chunks=True), + prototype=default_buffer_prototype(), + ) + chunk_array = CPUNDBuffer.from_numpy_array(np.zeros(1, dtype="uint8")) + transform = ChunkTransform(codecs=(BytesCodec(),)) + + batch = [ + (_SlowByteSetter(), chunk_array, chunk_spec), + (_FailingByteSetter(), chunk_array, chunk_spec), + ] + + with pytest.raises(RuntimeError, match="simulated write failure"): + await _encode_and_write_as_completed(batch, transform) # type: ignore[arg-type] + + assert write_started.is_set() + # Give the slow write's sleep long enough to finish if it were left + # running unattended in the background instead of being cancelled. + await asyncio.sleep(0.3) + assert not write_finished, "the slow write should have been cancelled, not left running" + + def test_concurrent_reads_shared_transform_with_pool() -> None: """Concurrent decode through the shared ChunkTransform produces correct data. diff --git a/tests/test_store/test_local.py b/tests/test_store/test_local.py index 61e48a269f..90d214ee2c 100644 --- a/tests/test_store/test_local.py +++ b/tests/test_store/test_local.py @@ -122,58 +122,6 @@ async def test_move( ): await store2.move(destination) - # --- byte-range-write tests: disabled --- - # Byte-range-write support (set_range / set_range_sync / SupportsSetRange) - # was removed from this PR pending a decision on the store interface. These - # tests are known-good and kept commented out to restore once that lands. - # def test_supports_set_range(self, store: LocalStore) -> None: - # """LocalStore should implement SupportsSetRange.""" - # assert isinstance(store, SupportsSetRange) - # - # @pytest.mark.parametrize( - # ("start", "patch", "expected"), - # [ - # (0, b"XX", b"XXAAAAAAAA"), - # (3, b"XX", b"AAAXXAAAAA"), - # (8, b"XX", b"AAAAAAAAXX"), - # (0, b"ZZZZZZZZZZ", b"ZZZZZZZZZZ"), - # (5, b"B", b"AAAAABAAAA"), - # (0, b"BCDE", b"BCDEAAAAAA"), - # ], - # ids=["start", "middle", "end", "full-overwrite", "single-byte", "multi-byte-start"], - # ) - # async def test_set_range( - # self, store: LocalStore, start: int, patch: bytes, expected: bytes - # ) -> None: - # """set_range should overwrite bytes at the given offset.""" - # await store.set("test/key", cpu.Buffer.from_bytes(b"AAAAAAAAAA")) - # await store.set_range("test/key", cpu.Buffer.from_bytes(patch), start=start) - # result = await store.get("test/key", prototype=cpu.buffer_prototype) - # assert result is not None - # assert result.to_bytes() == expected - # - # @pytest.mark.parametrize( - # ("start", "patch", "expected"), - # [ - # (0, b"XX", b"XXAAAAAAAA"), - # (3, b"XX", b"AAAXXAAAAA"), - # (8, b"XX", b"AAAAAAAAXX"), - # (0, b"ZZZZZZZZZZ", b"ZZZZZZZZZZ"), - # (5, b"B", b"AAAAABAAAA"), - # (0, b"BCDE", b"BCDEAAAAAA"), - # ], - # ids=["start", "middle", "end", "full-overwrite", "single-byte", "multi-byte-start"], - # ) - # def test_set_range_sync( - # self, store: LocalStore, start: int, patch: bytes, expected: bytes - # ) -> None: - # """set_range_sync should overwrite bytes at the given offset.""" - # sync(store.set("test/key", cpu.Buffer.from_bytes(b"AAAAAAAAAA"))) - # store.set_range_sync("test/key", cpu.Buffer.from_bytes(patch), start=start) - # result = store.get_sync(key="test/key", prototype=cpu.buffer_prototype) - # assert result is not None - # assert result.to_bytes() == expected - @pytest.mark.parametrize("exclusive", [True, False]) def test_atomic_write_successful(tmp_path: pathlib.Path, exclusive: bool) -> None: diff --git a/tests/test_store/test_memory.py b/tests/test_store/test_memory.py index a976f3738e..013dae7044 100644 --- a/tests/test_store/test_memory.py +++ b/tests/test_store/test_memory.py @@ -126,59 +126,6 @@ def test_write_does_not_alias_source_array( np.testing.assert_array_equal(array[:], expected) - # --- byte-range-write tests: disabled --- - # Byte-range-write support (set_range / set_range_sync / SupportsSetRange) - # was removed from this PR pending a decision on the store interface. These - # tests are known-good and kept commented out to restore once that lands. - # def test_supports_set_range(self, store: MemoryStore) -> None: - # """MemoryStore should implement SupportsSetRange.""" - # assert isinstance(store, SupportsSetRange) - # - # @pytest.mark.parametrize( - # ("start", "patch", "expected"), - # [ - # (0, b"XX", b"XXAAAAAAAA"), - # (3, b"XX", b"AAAXXAAAAA"), - # (8, b"XX", b"AAAAAAAAXX"), - # (0, b"ZZZZZZZZZZ", b"ZZZZZZZZZZ"), - # (5, b"B", b"AAAAABAAAA"), - # (0, b"BCDE", b"BCDEAAAAAA"), - # ], - # ids=["start", "middle", "end", "full-overwrite", "single-byte", "multi-byte-start"], - # ) - # async def test_set_range( - # self, store: MemoryStore, start: int, patch: bytes, expected: bytes - # ) -> None: - # """set_range should overwrite bytes at the given offset.""" - # await store.set("test/key", cpu.Buffer.from_bytes(b"AAAAAAAAAA")) - # await store.set_range("test/key", cpu.Buffer.from_bytes(patch), start=start) - # result = await store.get("test/key", prototype=cpu.buffer_prototype) - # assert result is not None - # assert result.to_bytes() == expected - # - # @pytest.mark.parametrize( - # ("start", "patch", "expected"), - # [ - # (0, b"XX", b"XXAAAAAAAA"), - # (3, b"XX", b"AAAXXAAAAA"), - # (8, b"XX", b"AAAAAAAAXX"), - # (0, b"ZZZZZZZZZZ", b"ZZZZZZZZZZ"), - # (5, b"B", b"AAAAABAAAA"), - # (0, b"BCDE", b"BCDEAAAAAA"), - # ], - # ids=["start", "middle", "end", "full-overwrite", "single-byte", "multi-byte-start"], - # ) - # def test_set_range_sync( - # self, store: MemoryStore, start: int, patch: bytes, expected: bytes - # ) -> None: - # """set_range_sync should overwrite bytes at the given offset.""" - # store._is_open = True - # store._store_dict["test/key"] = cpu.Buffer.from_bytes(b"AAAAAAAAAA") - # store.set_range_sync("test/key", cpu.Buffer.from_bytes(patch), start=start) - # result = store.get_sync(key="test/key", prototype=cpu.buffer_prototype) - # assert result is not None - # assert result.to_bytes() == expected - # TODO: fix this warning @pytest.mark.filterwarnings("ignore:Unclosed client session:ResourceWarning") From ec8e70ad86990e4c1bf57478fe13769885e31882 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Jul 2026 12:00:36 +0000 Subject: [PATCH 24/61] chore(deps): bump the python-dependencies group across 1 directory with 11 updates (#4216) * chore(deps): bump the python-dependencies group across 1 directory with 11 updates Bumps the python-dependencies group with 11 updates in the / directory: | Package | From | To | | --- | --- | --- | | [numpy](https://github.com/numpy/numpy) | `2.5.0` | `2.5.1` | | [typer](https://github.com/fastapi/typer) | `0.26.8` | `0.27.0` | | [coverage](https://github.com/coveragepy/coveragepy) | `7.14.3` | `7.15.2` | | [hypothesis](https://github.com/HypothesisWorks/hypothesis) | `6.155.7` | `6.160.0` | | [tomlkit](https://github.com/python-poetry/tomlkit) | `0.15.0` | `0.15.1` | | [uv](https://github.com/astral-sh/uv) | `0.11.26` | `0.11.31` | | [mkdocs-material[imaging]](https://github.com/squidfunk/mkdocs-material) | `9.7.6` | `9.7.7` | | [mkdocstrings](https://github.com/mkdocstrings/mkdocstrings) | `1.0.4` | `1.0.6` | | [markdown-exec[ansi]](https://github.com/pawamoy/markdown-exec) | `1.12.1` | `1.12.3` | | [ruff](https://github.com/astral-sh/ruff) | `0.15.20` | `0.15.22` | | [mypy](https://github.com/python/mypy) | `2.1.0` | `2.3.0` | Updates `numpy` from 2.5.0 to 2.5.1 - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](https://github.com/numpy/numpy/compare/v2.5.0...v2.5.1) Updates `typer` from 0.26.8 to 0.27.0 - [Release notes](https://github.com/fastapi/typer/releases) - [Changelog](https://github.com/fastapi/typer/blob/master/docs/release-notes.md) - [Commits](https://github.com/fastapi/typer/compare/0.26.8...0.27.0) Updates `coverage` from 7.14.3 to 7.15.2 - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.14.3...7.15.2) Updates `hypothesis` from 6.155.7 to 6.160.0 - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](https://github.com/HypothesisWorks/hypothesis/compare/v6.155.7...v6.160.0) Updates `tomlkit` from 0.15.0 to 0.15.1 - [Release notes](https://github.com/python-poetry/tomlkit/releases) - [Changelog](https://github.com/python-poetry/tomlkit/blob/master/CHANGELOG.md) - [Commits](https://github.com/python-poetry/tomlkit/compare/0.15.0...0.15.1) Updates `uv` from 0.11.26 to 0.11.31 - [Release notes](https://github.com/astral-sh/uv/releases) - [Changelog](https://github.com/astral-sh/uv/blob/0.11.31/CHANGELOG.md) - [Commits](https://github.com/astral-sh/uv/compare/0.11.26...0.11.31) Updates `mkdocs-material[imaging]` from 9.7.6 to 9.7.7 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.7.6...9.7.7) Updates `mkdocstrings` from 1.0.4 to 1.0.6 - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/mkdocstrings/compare/1.0.4...1.0.6) Updates `markdown-exec[ansi]` from 1.12.1 to 1.12.3 - [Release notes](https://github.com/pawamoy/markdown-exec/releases) - [Changelog](https://github.com/pawamoy/markdown-exec/blob/main/CHANGELOG.md) - [Commits](https://github.com/pawamoy/markdown-exec/compare/1.12.1...1.12.3) Updates `ruff` from 0.15.20 to 0.15.22 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/0.15.22/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.15.20...0.15.22) Updates `mypy` from 2.1.0 to 2.3.0 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v2.1.0...v2.3.0) --- updated-dependencies: - dependency-name: coverage dependency-version: 7.15.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies - dependency-name: hypothesis dependency-version: 6.160.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies - dependency-name: markdown-exec[ansi] dependency-version: 1.12.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: mkdocs-material[imaging] dependency-version: 9.7.7 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: mkdocstrings dependency-version: 1.0.6 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: mypy dependency-version: 2.3.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies - dependency-name: numpy dependency-version: 2.5.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: ruff dependency-version: 0.15.22 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: tomlkit dependency-version: 0.15.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: typer dependency-version: 0.27.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python-dependencies - dependency-name: uv dependency-version: 0.11.31 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies ... Signed-off-by: dependabot[bot] * fix: satisfy numpy 2.5.1 type stubs in indexing selection normalization numpy 2.5.1 stubs infer np.asarray() as a float64 array, so mypy now rejects the untyped asarray calls in replace_lists and CoordinateIndexer. Pass dtype=np.intp where the integer dtype is guaranteed, and cast to ArrayOfIntOrBool where the list contents are only known at runtime. Assisted-by: ClaudeCode:claude-fable-5 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Davis Bennett --- pyproject.toml | 18 +- src/zarr/core/indexing.py | 5 +- uv.lock | 675 ++++++++++++++++++++------------------ 3 files changed, 371 insertions(+), 327 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1927ce4d7c..684ac80b77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,18 +94,18 @@ homepage = "https://github.com/zarr-developers/zarr-python" # pins deliberately, e.g. via dependabot or `uv lock --upgrade`. [dependency-groups] test = [ - "coverage==7.14.3", + "coverage==7.15.2", "pytest==9.1.1", "pytest-asyncio==1.4.0", "pytest-cov==7.1.0", "pytest-accept==0.3.0", "numpydoc==1.10.0", - "hypothesis==6.155.7", + "hypothesis==6.160.0", "pytest-xdist==3.8.0", "pytest-benchmark==5.2.3", "pytest-codspeed==5.0.3", - "tomlkit==0.15.0", - "uv==0.11.26", + "tomlkit==0.15.1", + "uv==0.11.31", ] remote-tests = [ {include-group = "test"}, @@ -121,15 +121,15 @@ release = [ ] docs = [ # Doc building - "mkdocs-material[imaging]==9.7.6", + "mkdocs-material[imaging]==9.7.7", "mkdocs==1.6.1", - "mkdocstrings==1.0.4", + "mkdocstrings==1.0.6", "mkdocstrings-python==2.0.5", "mike==2.2.0", "mkdocs-redirects==1.2.3", - "markdown-exec[ansi]==1.12.1", + "markdown-exec[ansi]==1.12.3", "griffe-inherited-docstrings==1.1.3", - "ruff==0.15.20", + "ruff==0.15.22", # Changelog generation {include-group = "release"}, # Optional dependencies to run examples @@ -143,7 +143,7 @@ dev = [ {include-group = "remote-tests"}, {include-group = "docs"}, "universal-pathlib", - "mypy==2.1.0", + "mypy==2.3.0", ] [tool.coverage.report] diff --git a/src/zarr/core/indexing.py b/src/zarr/core/indexing.py index 875c22fbd3..a1b050cb7b 100644 --- a/src/zarr/core/indexing.py +++ b/src/zarr/core/indexing.py @@ -512,7 +512,8 @@ def replace_ellipsis(selection: Any, shape: tuple[int, ...]) -> SelectionNormali def replace_lists(selection: SelectionNormalized) -> SelectionNormalized: return tuple( - np.asarray(dim_sel) if isinstance(dim_sel, list) else dim_sel for dim_sel in selection + cast("ArrayOfIntOrBool", np.asarray(dim_sel)) if isinstance(dim_sel, list) else dim_sel + for dim_sel in selection ) @@ -1193,7 +1194,7 @@ def __init__( # some initial normalization selection_normalized = cast("CoordinateSelectionNormalized", ensure_tuple(selection)) selection_normalized = tuple( - np.asarray([i]) if is_integer(i) else i for i in selection_normalized + np.asarray([i], dtype=np.intp) if is_integer(i) else i for i in selection_normalized ) selection_normalized = cast( "CoordinateSelectionNormalized", replace_lists(selection_normalized) diff --git a/uv.lock b/uv.lock index 6035acc616..8eac71caa7 100644 --- a/uv.lock +++ b/uv.lock @@ -193,40 +193,43 @@ wheels = [ [[package]] name = "ast-serialize" -version = "0.3.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a9/9d/912fefab0e30aee6a3af8a62bbea4a81b29afa4ba2c973d31170620a26de/ast_serialize-0.3.0.tar.gz", hash = "sha256:1bc3ca09a63a021376527c4e938deedd11d11d675ce850e6f9c7487f5889992b", size = 60689, upload-time = "2026-04-30T23:24:48.104Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/6f/57/a54d4de491d6cdd7a4e4b0952cc3ca9f60dcefa7b5fb48d6d492debe1649/ast_serialize-0.3.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:3a867927df59f76a18dc1d874a0b2c079b42c58972dca637905576deb0912e14", size = 1182966, upload-time = "2026-04-30T23:23:57.376Z" }, - { url = "https://files.pythonhosted.org/packages/ee/9e/a5db014bb0f91b209236b57c429389e31290c0093532b8436d577699b2fa/ast_serialize-0.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a6fb063bf040abf8321e7b8113a0554eda445ffc508aa51287f8808886a5ae22", size = 1171316, upload-time = "2026-04-30T23:23:59.63Z" }, - { url = "https://files.pythonhosted.org/packages/15/59/fd55133e478c4326f60a11df02573bf7ccb2ac685810b50f1803d0f68053/ast_serialize-0.3.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5075cd8482573d743586779e5f9b652a015e37d4e95132d7e5a9bc5c8f483d8f", size = 1232234, upload-time = "2026-04-30T23:24:01.168Z" }, - { url = "https://files.pythonhosted.org/packages/cc/79/0ca1d26357ecb4a697d74d00b73ef3137f24c140424125393a0de820eb09/ast_serialize-0.3.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:41560b27794f4553b0f77811e9fb325b77db4a2b39018d437e09932275306e66", size = 1233437, upload-time = "2026-04-30T23:24:03.151Z" }, - { url = "https://files.pythonhosted.org/packages/53/3e/7078ec94dd6e124b8e028ac77016a4f13c83fa1c145790f2e68f3816998b/ast_serialize-0.3.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b967c01ca74909c5d90e0fe4393401e2cc5da5ebd9a6262a19e45ffd3757dec8", size = 1440188, upload-time = "2026-04-30T23:24:04.717Z" }, - { url = "https://files.pythonhosted.org/packages/21/16/cca7195ef55a012f8013c3442afa91d287a0a36dcf88b480b262475135b3/ast_serialize-0.3.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:424ebb8f46cd993f7cec4009d119312d8433dd90e6b0df0499cd2c91bdcc5af9", size = 1254211, upload-time = "2026-04-30T23:24:06.18Z" }, - { url = "https://files.pythonhosted.org/packages/a0/0f/f3d4dfae67dee6580534361a6343367d34217e7d25cff858bd1d8f03b8ed/ast_serialize-0.3.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d14b1d566b56e2ee70b11fec1de7e0b94ec7cd83717ec7d189967841a361190e", size = 1255973, upload-time = "2026-04-30T23:24:07.772Z" }, - { url = "https://files.pythonhosted.org/packages/14/41/55fbfe02c42f40fbe3e74eda167d977d555ff720ce1abfa08515236efd88/ast_serialize-0.3.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7ba30b18735f047ec11103d1ab92f4789cf1fea1e0dc89b04a2f5a0632fd79de", size = 1298629, upload-time = "2026-04-30T23:24:09.4Z" }, - { url = "https://files.pythonhosted.org/packages/28/36/7d2501cacc7989fb8504aa9da2a2022a174200a59d4e6639de4367a57fdd/ast_serialize-0.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e6ea0754cb7b0f682ebb005ffb0d18f8d17993490d9c289863cd69cacc4ab8df", size = 1408435, upload-time = "2026-04-30T23:24:11.013Z" }, - { url = "https://files.pythonhosted.org/packages/03/e7/54e3b469c3fa0bf9cd532fa643d1d33b73303f8d70beac3e366b68dd64b7/ast_serialize-0.3.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:a0c5aa1073a5ba7b2abaa4b54abe8b8d75c4d1e2d54a2ff70b0ca6222fea5728", size = 1508174, upload-time = "2026-04-30T23:24:12.635Z" }, - { url = "https://files.pythonhosted.org/packages/b5/2a/9b9621865b02c60539e26d9b114a312b4fa46aa703e33e79317174bfea21/ast_serialize-0.3.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:4e52650d834c1ea7791969a361de2c54c13b2fb4c519ec79445fa8b9021a147d", size = 1502354, upload-time = "2026-04-30T23:24:14.186Z" }, - { url = "https://files.pythonhosted.org/packages/34/dd/f138bc5c43b0c414fdd12eefe15677839323078b6e75301ad7f96cd26d45/ast_serialize-0.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:15bd6af3f136c61dae27805eb6b8f3269e85a545c4c27ffe9e530ead78d2b36d", size = 1450504, upload-time = "2026-04-30T23:24:16.076Z" }, - { url = "https://files.pythonhosted.org/packages/68/cf/97ef9e1c315601db74365955c8edd3292e3055500d6317602815dbdf08ae/ast_serialize-0.3.0-cp314-cp314t-win32.whl", hash = "sha256:d188bfe37b674b49708497683051d4b571366a668799c9b8e8a94513694969d9", size = 1058662, upload-time = "2026-04-30T23:24:17.535Z" }, - { url = "https://files.pythonhosted.org/packages/f8/d6/e2c3483c31580fdb623f92ad38d2f856cde4b9205a3e6bd84760f3de7d82/ast_serialize-0.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:5832c2fdf8f8a6cf682b4cfcf677f5eaf39b4ddbc490f5480cfccdd1e7ce8fa1", size = 1100349, upload-time = "2026-04-30T23:24:18.992Z" }, - { url = "https://files.pythonhosted.org/packages/ab/89/29abcb1fe18a429cda60c6e0bbd1d6e90499339842a2f548d7567542357e/ast_serialize-0.3.0-cp314-cp314t-win_arm64.whl", hash = "sha256:670f177188d128fb7f9f15b5ad0e1b553d22c34e3f584dcb83eb8077600437f0", size = 1072895, upload-time = "2026-04-30T23:24:20.706Z" }, - { url = "https://files.pythonhosted.org/packages/bc/93/72abad83966ed6235647c9f956417dc1e17e997696388521910e3d1fa3f4/ast_serialize-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:2ec2fafa5e4313cc8feed96e436ebe19ac7bc6fa41fbc2827e826c48b9e4c3a9", size = 1190024, upload-time = "2026-04-30T23:24:22.486Z" }, - { url = "https://files.pythonhosted.org/packages/85/4f/eb88584b2f0234e581762011208ca203252bf6c98e59b4769daa571f3576/ast_serialize-0.3.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:ef6d3c08b7b4cd29b48410338e134764a00e76d25841eb02c1084e868c888ecc", size = 1178633, upload-time = "2026-04-30T23:24:24.35Z" }, - { url = "https://files.pythonhosted.org/packages/56/51/cf1ec1ff3e616373d0dcbd5fad502e0029dc541f13ab642259762a7d127f/ast_serialize-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3d841424f41b886e98044abc80769c14a956e6e5ccd5fb5b0d9f5ead72be18a4", size = 1241351, upload-time = "2026-04-30T23:24:25.987Z" }, - { url = "https://files.pythonhosted.org/packages/0d/44/68fcf50478cf1093f2d423f034ae06453122c8b415d8e21a44668eca485d/ast_serialize-0.3.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d21453734ad39367ede5d37efe4f59f830ce1c09f432fc72a90e368f77a4a3e7", size = 1239582, upload-time = "2026-04-30T23:24:27.808Z" }, - { url = "https://files.pythonhosted.org/packages/9d/c1/a6c9fa284eceb5fc6f21347e968445a051d7ca2c4d34e6a04314646dbcee/ast_serialize-0.3.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f5e110cdce2a347e1dd987529c88ef54d26f67848dce3eba1b3b2cc2cf085c94", size = 1448853, upload-time = "2026-04-30T23:24:29.534Z" }, - { url = "https://files.pythonhosted.org/packages/23/5f/8ad3829a09e4e8c5328a53ce7d4711d660944e3e164c5f6abcc2c8f27167/ast_serialize-0.3.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3b6e23a98e57560a055f5c4b68700a0fd5ce483d2814c23140b3638c7f5d1e61", size = 1262204, upload-time = "2026-04-30T23:24:31.482Z" }, - { url = "https://files.pythonhosted.org/packages/25/13/44aa28d97f10e25247e8576b5f6b2795d4fa1a80acc88acc942c508d06f7/ast_serialize-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1c9e763d70293d65ce1e1ea8c943140c68d0953f0268c7ee0998f2e07f77dd0", size = 1266458, upload-time = "2026-04-30T23:24:33.088Z" }, - { url = "https://files.pythonhosted.org/packages/d8/58/b3a8be3777cd3744324fd5cec0d80d37cd96fc7cbb0fb010e03dff1e870f/ast_serialize-0.3.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4388a1796c228f1ce5c391426f7d21a0003ad3b47f677dbeded9bd1a85c7209f", size = 1308700, upload-time = "2026-04-30T23:24:34.657Z" }, - { url = "https://files.pythonhosted.org/packages/13/03/f8312d6b57f5471a9dc7946f22b8798a1fc296d38c25766223aacadec42c/ast_serialize-0.3.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:5283cdcc0c64c3d8b9b688dc6aaa012d9c0cf1380a7f774a6bae6a1c01b3205a", size = 1416724, upload-time = "2026-04-30T23:24:36.562Z" }, - { url = "https://files.pythonhosted.org/packages/50/5d/13fc3789a7abac00559da2e2e9f386db4612aa1f84fc53d09bf714c37545/ast_serialize-0.3.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:f5ef88cc5842a5d7a6ac09dc0d5fc2c98f5d276c1f076f866d55047ce886785b", size = 1515441, upload-time = "2026-04-30T23:24:38.018Z" }, - { url = "https://files.pythonhosted.org/packages/eb/b9/7ab43fc7a23b1f970281093228f5f79bed6edeed7a3e672bde6d7a832a58/ast_serialize-0.3.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:cc14bf402bdc0978594ecce783793de2c7470cd4f5cd7eb286ca97ed8ff7cba9", size = 1510522, upload-time = "2026-04-30T23:24:39.798Z" }, - { url = "https://files.pythonhosted.org/packages/56/ec/d75fc2b788d319f1fad77c14156896f31afdfc68af85b505e5bdebcb9592/ast_serialize-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:11eae0cf1b7b3e0678133cc2daa974ea972caf02eb4b3aa062af6fa9acd52c57", size = 1460917, upload-time = "2026-04-30T23:24:41.305Z" }, - { url = "https://files.pythonhosted.org/packages/95/74/f99c81193a2725911e1911ae567ed27c2f2419332c7f3537366f9d238cac/ast_serialize-0.3.0-cp39-abi3-win32.whl", hash = "sha256:2db3dd99de5e6a5a11d7dda73de8750eb6e5baaf25245adf7bdcfe64b6108ae2", size = 1067804, upload-time = "2026-04-30T23:24:43.091Z" }, - { url = "https://files.pythonhosted.org/packages/16/81/76af00c47daa151e89f98ae21fbbcb2840aaa9f5766579c4da76a3c57188/ast_serialize-0.3.0-cp39-abi3-win_amd64.whl", hash = "sha256:a2cd125adccf7969470621905d302750cd25951f22ea430d9a25b7be031e5549", size = 1105561, upload-time = "2026-04-30T23:24:44.578Z" }, - { url = "https://files.pythonhosted.org/packages/bd/46/d3ec57ad500f598d1554bd14ce4df615960549ab2844961bc4e1f5fbd174/ast_serialize-0.3.0-cp39-abi3-win_arm64.whl", hash = "sha256:0dd00da29985f15f50dc35728b7e1e7c84507bccfea1d9914738530f1c72238a", size = 1077165, upload-time = "2026-04-30T23:24:46.377Z" }, +version = "0.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/58/ad/0d70a3a2d6e01968d985415259e8ec7ad3f777903f9b1c1f3c8c44642c60/ast_serialize-0.6.0.tar.gz", hash = "sha256:aadd3ffcf4858c9726bf3515f7b199c7eadbe504f96028e4a87172c0da65a8fe", size = 61489, upload-time = "2026-06-30T20:02:55.555Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3f/12/3e5f575f156555547c250a8b0d1347517a3a20fc7f4492e9703a69d4f45e/ast_serialize-0.6.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:a7520b672827885bafeae7501f684d14d47d17e5f45256f9df547686cca52264", size = 1177640, upload-time = "2026-06-30T20:02:06.708Z" }, + { url = "https://files.pythonhosted.org/packages/a2/a4/921a9e27951627983b0f368859ea00f8330a551dc0bf4c2fdcb11855a98b/ast_serialize-0.6.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a14191beec7e0c078d2fc1f6edc0aee88bcd4db9f18e1bc9f8052b559c22dddc", size = 1168111, upload-time = "2026-06-30T20:02:08.366Z" }, + { url = "https://files.pythonhosted.org/packages/00/69/950cf404de7b8782cf95e5c1237e25e2aa46177b287f39f9eeddf481fd6f/ast_serialize-0.6.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:32ef62ec34cf6be20ad77d4799556638fbdf187f3ae10698dfb20ef9f2c89516", size = 1227656, upload-time = "2026-06-30T20:02:09.843Z" }, + { url = "https://files.pythonhosted.org/packages/4c/a8/46f8f6a6479d9d2273980957bb091a506c55f5b95d3c029ee58518a78407/ast_serialize-0.6.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:13b7769970a39983b0adf2f38917b1cd3b8946f76df045756c3d741bc689f089", size = 1227706, upload-time = "2026-06-30T20:02:11.367Z" }, + { url = "https://files.pythonhosted.org/packages/b7/b9/9ac415bda0a40e49eab8fea3b2741c19c98bb84d57d62c4cfc6230eb67be/ast_serialize-0.6.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6f7a408601bb3edaefb3bc67a4c01f5235e3253653b6a5729a2ee2382b35341c", size = 1431705, upload-time = "2026-06-30T20:02:12.737Z" }, + { url = "https://files.pythonhosted.org/packages/e5/06/8807115d441444879f7561b5eede5ac18fc80392f11826d61ccf31f503b1/ast_serialize-0.6.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8670bfa51208a2c0c8d138928e40e998fab158f9200d53bb80c088b5b8eda7b8", size = 1249533, upload-time = "2026-06-30T20:02:14.571Z" }, + { url = "https://files.pythonhosted.org/packages/3e/c0/c2ba82ef9618650357d9421a1fdb27ffec862a7f57e8e2de82a3ccd11e12/ast_serialize-0.6.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4826809eb8597a8cd59fd924b6d7c285b8969a1e0007e2cb652cab62376270f", size = 1252619, upload-time = "2026-06-30T20:02:16.219Z" }, + { url = "https://files.pythonhosted.org/packages/0f/a7/fa31d52dd4102cede29fb9634e98d214129b2783b4f95528c6dc6a8f6587/ast_serialize-0.6.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:577a6c189068686869f5f1ddc38363f3ae1808a4753b577266f9202071a7bb66", size = 1242983, upload-time = "2026-06-30T20:02:17.813Z" }, + { url = "https://files.pythonhosted.org/packages/b1/20/ddf742b5ad3c4bafd3466f2265037cfd99bc1b9a5ee46a5d58c90d523242/ast_serialize-0.6.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:085de7f62dc9cc247eb01e965a362707d1d90b1d89a82c5bf78301a60a3c417b", size = 1296148, upload-time = "2026-06-30T20:02:19.146Z" }, + { url = "https://files.pythonhosted.org/packages/24/cb/9f6f217cce8b3b632c5568b478d195a35e79dce4dbe309438cb89ba6ea4f/ast_serialize-0.6.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:9f8a8b78b13173de6a9ec22111d9be674874cd5bdccda04f14ae5ebc2bef403a", size = 1403826, upload-time = "2026-06-30T20:02:20.696Z" }, + { url = "https://files.pythonhosted.org/packages/2d/f8/9d16d4f0107a183924425cc0e7618d8bf76f96b45afa9ff19f924ed1ad57/ast_serialize-0.6.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:f2ff3baffc3a29c1f15bc9098aa0c09763410262d5e6cef42116f7356c184554", size = 1502943, upload-time = "2026-06-30T20:02:22.034Z" }, + { url = "https://files.pythonhosted.org/packages/80/dd/bbc1c38756350dddf7e24acae1c9482ef42051c267417e019aecc1ed4075/ast_serialize-0.6.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:0067b25fce104eaae5b88383de9ab803faeb671831e14ca698b771b356e2600f", size = 1497632, upload-time = "2026-06-30T20:02:23.517Z" }, + { url = "https://files.pythonhosted.org/packages/42/7e/9daffefcf5b97e6bb4c3e0b3c024c1aee9722f23d3cf7cd2ff80d6fb4a40/ast_serialize-0.6.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c617417f9cbb0cb144f6283c3cbe0d2e0f01beaf9f608f662b21191058a626ec", size = 1448858, upload-time = "2026-06-30T20:02:24.889Z" }, + { url = "https://files.pythonhosted.org/packages/e5/1f/f9baaab81a677ea0af7d2458cac2f94ebcc85958f8a3c15ba9d9e5dab653/ast_serialize-0.6.0-cp314-cp314t-win32.whl", hash = "sha256:5337cb256dcea3df9288205213d1601581536526b8f4da44b6974f1180f3252a", size = 1052600, upload-time = "2026-06-30T20:02:26.263Z" }, + { url = "https://files.pythonhosted.org/packages/9e/1f/41b535866519512d8cf6669cb2cff7823b7672bb6279c0333b4ff89d7d9f/ast_serialize-0.6.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2d947e45cafc4b09bd7528917fa84c517654a43de173c79785574b7b3068ac24", size = 1095570, upload-time = "2026-06-30T20:02:27.639Z" }, + { url = "https://files.pythonhosted.org/packages/50/64/e472fe3e3a2d33d874b987e8518aedf24562919e3b6161a4fa1797e89c0f/ast_serialize-0.6.0-cp314-cp314t-win_arm64.whl", hash = "sha256:6e15ec740436e1a0d62de848641abe5f3a2f89a7f94907d534795ac91bbacf14", size = 1067267, upload-time = "2026-06-30T20:02:28.949Z" }, + { url = "https://files.pythonhosted.org/packages/52/19/ac8348ae8711c9b5ae834634f635780cab62a0f5e6f988882e048b89c2ae/ast_serialize-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:093cb8bb91b720d8523580498d031791bb1bbaa048599c3d21085d380e11a596", size = 1185367, upload-time = "2026-06-30T20:02:30.427Z" }, + { url = "https://files.pythonhosted.org/packages/c1/f6/ec7ec652c51db77c2f61d8573338e13e4704303265ccc658cb4031d9f354/ast_serialize-0.6.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:e61580a69faf47e3689795367ed211f2a10fd741478cc0f36a0f128793360aad", size = 1178657, upload-time = "2026-06-30T20:02:31.964Z" }, + { url = "https://files.pythonhosted.org/packages/6f/02/613a7534a41d0122f37d1e0c64aa8ac78bfb831f8c92f6db057a311abb3c/ast_serialize-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:305802f2ce2a7c4e87835078ea85c58b586ddda8095b92fe2ead9364ae19c80a", size = 1238620, upload-time = "2026-06-30T20:02:33.664Z" }, + { url = "https://files.pythonhosted.org/packages/4d/21/087957bba486242afc52f49b2d9e21c9dad00289356cf9efe67084015a9d/ast_serialize-0.6.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c7b8b8f0c42f752ea00b2b7d7c090b3f80d9c1c5c75cadf16423790a0cc74081", size = 1236075, upload-time = "2026-06-30T20:02:34.936Z" }, + { url = "https://files.pythonhosted.org/packages/82/04/78128bbb170071c2c72a210a181f1c00e11cc1cec60a8beef747b07f9201/ast_serialize-0.6.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cd5b91b9e6f2356ace3a556963b0cd783b395fbbb0bb17b4defc283415466e77", size = 1441348, upload-time = "2026-06-30T20:02:36.245Z" }, + { url = "https://files.pythonhosted.org/packages/64/64/62fb99d6faf199b4c3e5b08a07136e9a0d7664bb249c6de3670e5b63e9b6/ast_serialize-0.6.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4d6ef91590258ada18909b9caea344dac4de2013906b035473cd674a43f4b790", size = 1258580, upload-time = "2026-06-30T20:02:37.53Z" }, + { url = "https://files.pythonhosted.org/packages/ca/87/b4d6c38e0ccd5e85dc54cecdf933a152c60b28fe5d993a6d8a72fa6d5896/ast_serialize-0.6.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcbed41e9386059fc0261d602445ede0976c2ecec2939688bcbcb9ed0b6f28b7", size = 1261693, upload-time = "2026-06-30T20:02:39.123Z" }, + { url = "https://files.pythonhosted.org/packages/0e/4b/3676ca2191f39bafb75f93f99b2f429ec464586158fece2165f3572805dc/ast_serialize-0.6.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:cdc4e6f930b9090c2f92c9036ad12ffb8e6e44d4a5ba06f1458a05d60f203f7b", size = 1252517, upload-time = "2026-06-30T20:02:40.511Z" }, + { url = "https://files.pythonhosted.org/packages/f3/58/494ef8c4b4acb2f4a265ac934caf45f792a08fe27d6b853de35ad991941a/ast_serialize-0.6.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:897ac47b5637be41c0c07061c8a912fafa967ef1dc73fa115e4bfa70882a093b", size = 1304843, upload-time = "2026-06-30T20:02:41.961Z" }, + { url = "https://files.pythonhosted.org/packages/b1/f2/13736d920ab3d49bbee80ef1a277dd7b7aaf3b3545efd9d2a8114fe05525/ast_serialize-0.6.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:c4af9a1386166e40ed01464991806f89038a2d89782576c7774876fa77034e32", size = 1413698, upload-time = "2026-06-30T20:02:44.179Z" }, + { url = "https://files.pythonhosted.org/packages/a8/5a/e046f3899e2acba4677d7427b76431443a1aa1a0e583dfb05b55b69d55cf/ast_serialize-0.6.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:c901adbd750029b9ac4ad3d6aa56853e0ad4875119fbf52b7b8298afc223828b", size = 1512209, upload-time = "2026-06-30T20:02:45.584Z" }, + { url = "https://files.pythonhosted.org/packages/cc/c7/e42aaca7bb2d22a7c06d5a8c7930086c5a334e93d716e6fa5e6647a4515f/ast_serialize-0.6.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:3ae22a366b752ab4496191525b78b097b5b72d531752e3c1dd7e383a8f2c8a1a", size = 1508464, upload-time = "2026-06-30T20:02:46.942Z" }, + { url = "https://files.pythonhosted.org/packages/95/93/5524a3dc6c3f593de3228ed9cbef73afa047625b7000ec21b7f58e6eb4d4/ast_serialize-0.6.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:4ed29121da8b3fdc291002801a1de0f76248fa07dce89157a5f277842cf6126e", size = 1457164, upload-time = "2026-06-30T20:02:48.294Z" }, + { url = "https://files.pythonhosted.org/packages/4f/c0/36a6ffb4d653cf621427b4c4928671f53ad800c453474de2b82564a44ad9/ast_serialize-0.6.0-cp39-abi3-pyemscripten_2026_0_wasm32.whl", hash = "sha256:b1dac4e09d341c1300ba69cdcbe62867b32a8c75d90db9bf4d083bec3b039f0b", size = 863014, upload-time = "2026-06-30T20:02:49.742Z" }, + { url = "https://files.pythonhosted.org/packages/09/c7/7d5ad8b49e1278e1c2a1e0274bd7850560b3f09313aa00c13bc8d5544792/ast_serialize-0.6.0-cp39-abi3-win32.whl", hash = "sha256:82c312a7844d2fdeb4d5c48bd3d215bf940dafd4704e1a9bcf252a99010a99b1", size = 1063165, upload-time = "2026-06-30T20:02:50.98Z" }, + { url = "https://files.pythonhosted.org/packages/47/ae/6710c14ecb276031cf10249f6adf5a59e2d3fdb3b5183bd59f70524067ee/ast_serialize-0.6.0-cp39-abi3-win_amd64.whl", hash = "sha256:113b58346f9ceb664352032770caca817d4a3c86f611c6088e6ef65ddaa70f0e", size = 1101444, upload-time = "2026-06-30T20:02:52.554Z" }, + { url = "https://files.pythonhosted.org/packages/66/40/c53deb2cd0c9b0fb636d24d9f40924cf2e65028e6b20b10cd5c1eeb2c730/ast_serialize-0.6.0-cp39-abi3-win_arm64.whl", hash = "sha256:ccd132fe8db56f61fe743b1f644d01b8d65b83248a8da506f3132bda86d6ed5e", size = 1072965, upload-time = "2026-06-30T20:02:54.097Z" }, ] [[package]] @@ -618,71 +621,71 @@ wheels = [ [[package]] name = "coverage" -version = "7.14.3" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b4/91/0a7c28934e50d8ac9a7b117712d176f2953c3170bccced5eaacfa3e96175/coverage-7.14.3.tar.gz", hash = "sha256:1a7563a443f3d53fdeb040ec8c9f7466aed7ca3dc5891aa09d3ca3625fa4387f", size = 924398, upload-time = "2026-06-22T23:10:25.584Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/bd/b0/8a911f6ffe6974dac4df95b468ab9a2899d0e59f0f99a489afeec39f00bc/coverage-7.14.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3d74ff26299c4879ce3a4d826f9d3d4d556fd285fde7bbce3c0ef5a8ab1cec24", size = 220672, upload-time = "2026-06-22T23:08:26.621Z" }, - { url = "https://files.pythonhosted.org/packages/36/16/0fc0cb52538783dbbae0934b834f5a58fd5354380ee6cad4a07b15dc845d/coverage-7.14.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:96150a9cf3468ea20f0bc5d0e21b3df8972c31480ef90fa7614b773cc6429665", size = 221035, upload-time = "2026-06-22T23:08:28.372Z" }, - { url = "https://files.pythonhosted.org/packages/77/e2/421ccfbb48335ac49e93301478cf5d623b0c2bf1c0cadd8e2b2fc6c0c710/coverage-7.14.3-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:27d07a46500ba23515b838dbcf52512026af04090755cf6cc64166d88c9b9a1a", size = 252540, upload-time = "2026-06-22T23:08:30.226Z" }, - { url = "https://files.pythonhosted.org/packages/06/c2/05b8c890097c61a7f4406b35396b997a635200ded0339eda83dfbe526c5f/coverage-7.14.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:621e13c6108234d7960aaf5762ab5c3c00f33c30c15af06dcbff0c73bf112727", size = 255274, upload-time = "2026-06-22T23:08:31.876Z" }, - { url = "https://files.pythonhosted.org/packages/dc/be/b6d9efe447f8ba3c3c854195f326bd64c54b907d936cd2fdebf8767ec72e/coverage-7.14.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4b60ca6d8af70473491a15a343cbabab2e8f9ea66a4376e81c7aa24876a6f977", size = 256389, upload-time = "2026-06-22T23:08:33.843Z" }, - { url = "https://files.pythonhosted.org/packages/d4/3c/f26e50acc429e608bc534ac06f0a3c169019c798178ec5e9de3dbc0df9c9/coverage-7.14.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c90a7cdd5e380e1ce02f19792e2ac2fbfbf177e35a27e69fd3e873b30d895c0c", size = 258648, upload-time = "2026-06-22T23:08:35.481Z" }, - { url = "https://files.pythonhosted.org/packages/9e/a2/01c1fabf816c8e1dae197e258edf878a3d3ddc86fbda34b76e5794277d8f/coverage-7.14.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5d788e5fd55347eef06ca0732c77d04a264de67e8ff24631270cdff3767a60cf", size = 252949, upload-time = "2026-06-22T23:08:37.562Z" }, - { url = "https://files.pythonhosted.org/packages/89/c6/941166dd79c31fd44a13063780ae8d552eee0089a0a0930b9bdb7df554ed/coverage-7.14.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:62c7f79db2851c95ef020e5d28b97afde3daf9f7febcd35b53e05638f729063f", size = 254310, upload-time = "2026-06-22T23:08:39.174Z" }, - { url = "https://files.pythonhosted.org/packages/10/31/80b1fd028201a961033ce95be3cd1e39e521b3762e6b4a1ac1616cb291e7/coverage-7.14.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:90f7608aeb5d9b60b523b9fb2a4ee1973867cc4865a3f26fe6c7577073b70205", size = 252453, upload-time = "2026-06-22T23:08:40.84Z" }, - { url = "https://files.pythonhosted.org/packages/5f/85/c3d9addd94c4b524f3f4af0232075f5fe7170ce99a1386edff803e5934db/coverage-7.14.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:1e3b91f9c4740aeb571ecf82e5e8d8e4ab62d34fcb5a5d4e5baa38c6f7d2857c", size = 256522, upload-time = "2026-06-22T23:08:42.494Z" }, - { url = "https://files.pythonhosted.org/packages/91/14/e5a0575f73795af3a7a9ae13dadf812e17d32422896839987dc3f86947e1/coverage-7.14.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:c946099774a7699de03cbd0ff0a64e21aed4525eed9d959adde4afe6d15758ef", size = 252023, upload-time = "2026-06-22T23:08:44.243Z" }, - { url = "https://files.pythonhosted.org/packages/38/9b/9652ee531937ce3b8a63a8896885b2b4a2d56adc30e53c9540c666286d88/coverage-7.14.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:16b206e521feb8b7133a45754643dead0538489cf8b783b90cf5f4e3299625fd", size = 253893, upload-time = "2026-06-22T23:08:46.113Z" }, - { url = "https://files.pythonhosted.org/packages/b1/05/42678841c8c38e4b08bdfc48269f5a16dfbf5806000fe6a89b4cece3c691/coverage-7.14.3-cp312-cp312-win32.whl", hash = "sha256:ea3169c7116eb6cdf7608c6c7da9ecfcb3da40688e3a510fac2d1d2bafd6dc35", size = 222734, upload-time = "2026-06-22T23:08:47.858Z" }, - { url = "https://files.pythonhosted.org/packages/df/87/07a4fcee55177a25f1b52331a8e92cf4f2c53b1a9c75ce2981fd59c684ad/coverage-7.14.3-cp312-cp312-win_amd64.whl", hash = "sha256:7ea52fc08f007bcc494d4bb3df3851e95843d881860ba38fe2c64dc100db5e7d", size = 223266, upload-time = "2026-06-22T23:08:49.494Z" }, - { url = "https://files.pythonhosted.org/packages/aa/34/2b8b66a989282ea7b370beb49f50bab29470dc30bb0b03935b6b802782f7/coverage-7.14.3-cp312-cp312-win_arm64.whl", hash = "sha256:8cec0ad652ec57790970d817490105bd917d783c2f7b38d6b58a0ca312e1a336", size = 222655, upload-time = "2026-06-22T23:08:51.766Z" }, - { url = "https://files.pythonhosted.org/packages/a9/83/7fefbf5df23ed2b7f489907564a7b34b9b07098128e12e0fdfa92626e456/coverage-7.14.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:47968988b367990ae4ab17523790c38cd125e02c6bfd379b6022be2d40bdc38c", size = 220699, upload-time = "2026-06-22T23:08:53.522Z" }, - { url = "https://files.pythonhosted.org/packages/31/e6/38c3653ff6d56d704b29241362387ca824e38e15b76fdcb7096538195790/coverage-7.14.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0ee68f5c34812780f3a7063382c0a9fcbb99985b7ddcdcaa626e4f3fb2e0783a", size = 221068, upload-time = "2026-06-22T23:08:55.571Z" }, - { url = "https://files.pythonhosted.org/packages/20/86/4f5c45d51c5cd10a128933f0fd235393c9146abbfd2ce2dfa68b3267ead3/coverage-7.14.3-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:fa9e5c6857a7e80fa22ace5cf3550ae392bbfc322f1d8dd2d2d5a8be38cec027", size = 252060, upload-time = "2026-06-22T23:08:57.464Z" }, - { url = "https://files.pythonhosted.org/packages/82/50/dfce42eff2cecabcd5a9bbad5489449c87db3415f408d23ffee417ce01f6/coverage-7.14.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:98a0859b0e98e43e1178a9402e19c8127766b14f7109a374d976e5a62c0e5c73", size = 254657, upload-time = "2026-06-22T23:08:59.453Z" }, - { url = "https://files.pythonhosted.org/packages/ba/d2/639ceb1bc8038fd0d66768278d5dc22df3391918b8278c2a21aa2602a531/coverage-7.14.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:69918344541ed9c8368566c2adc03c0e33d4550d7faa87d1b35e49b6a3286ea9", size = 255892, upload-time = "2026-06-22T23:09:01.291Z" }, - { url = "https://files.pythonhosted.org/packages/8b/96/002094a10e113512500dc1e10430a449417e17b0f90f7d496bcb820208b7/coverage-7.14.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b7f300ac92cd4b570724c8ffbbd0c130fee298d2447f41d5a3abf58976fae1de", size = 258026, upload-time = "2026-06-22T23:09:03.017Z" }, - { url = "https://files.pythonhosted.org/packages/0b/ec/286a5d2fad9c4bee59bd724feeb7d5bf8303c6c9200b51d1dd945a9c72b0/coverage-7.14.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:11a7ec9f97ab950f4c5af62229befc7faf208fdbc0116d3902d7e306cf2c5abd", size = 252285, upload-time = "2026-06-22T23:09:04.773Z" }, - { url = "https://files.pythonhosted.org/packages/d9/7d/a17753a0b12dd48d0d50f5fab079ad99d3be1eac790494d89f3a417ca0b9/coverage-7.14.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a571bd889cd36c5922ce8e42e059f9d37d02301531d11374afa4c87a578625d5", size = 254023, upload-time = "2026-06-22T23:09:06.513Z" }, - { url = "https://files.pythonhosted.org/packages/86/ef/a76c6ceba6a2c313f905310abf2701d534cada22d372db11731831e9e209/coverage-7.14.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:de76caefc8deabb0dd1678b6a980be97d14c8d87e213ac194dbf8b09e96d63fb", size = 251989, upload-time = "2026-06-22T23:09:08.382Z" }, - { url = "https://files.pythonhosted.org/packages/d9/39/353013a75fec0fb49f7553519f9d52b4441e902e5178c93f38eb6c07cedb/coverage-7.14.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d20a15c622194234161535459affa8f7905830391c9ccfa060d495dbfe3a1c7f", size = 256144, upload-time = "2026-06-22T23:09:10.369Z" }, - { url = "https://files.pythonhosted.org/packages/29/0e/613878555d734def11c5b20a2701a15cb3781b9e9ea749da27c5f436e928/coverage-7.14.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:b488bd4b23397db62e7a9459129d01ff06a846582a732efd24834b24a6ada498", size = 251808, upload-time = "2026-06-22T23:09:12.057Z" }, - { url = "https://files.pythonhosted.org/packages/af/76/359c058c9cfdcf1e8b107663881225b03b364a320017eda24a2a66e55102/coverage-7.14.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6a3693b4153394d265f44fb855fdc80e72403024d4d6f91c4871b334d028e4e0", size = 253579, upload-time = "2026-06-22T23:09:13.858Z" }, - { url = "https://files.pythonhosted.org/packages/1d/d9/4ba2f060933a30ebe363cef9f67a365b0a317e580c0d5d9169d56a73ef1c/coverage-7.14.3-cp313-cp313-win32.whl", hash = "sha256:338b19131ab1a6b767b462bfcbaa692e7ae22f24463e39d49b02a83410ff6b37", size = 222741, upload-time = "2026-06-22T23:09:15.636Z" }, - { url = "https://files.pythonhosted.org/packages/76/e8/196ebc25d8f34c06d43a6e9c8513c9266ef8dbf3b5672beb1a00cf5e29fa/coverage-7.14.3-cp313-cp313-win_amd64.whl", hash = "sha256:b3d77f7f196abdef7e01415de1bce09f216189e83e58159cfeef2b92d0464994", size = 223283, upload-time = "2026-06-22T23:09:17.478Z" }, - { url = "https://files.pythonhosted.org/packages/7c/af/51d2aac6417523a286f10fb25f09eb9518a84df9f1151e93ff6871f34849/coverage-7.14.3-cp313-cp313-win_arm64.whl", hash = "sha256:e6230e688c7c3e65cedd41a774eb4ec221adc6bfee13768231015b702d5e4150", size = 222678, upload-time = "2026-06-22T23:09:19.7Z" }, - { url = "https://files.pythonhosted.org/packages/61/56/14e3b97facbfa1304dd19e676e26599ad359f04714bed32f7f1c5a88efdc/coverage-7.14.3-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:605ab2b566a22bd94834529d66d295c364aba84afd3e5498285c7a524017b1fc", size = 220741, upload-time = "2026-06-22T23:09:21.616Z" }, - { url = "https://files.pythonhosted.org/packages/12/1d/db378b5cca433b90b893f26dab728b280ddd89f272a1fdfed4aeaa05c686/coverage-7.14.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a3c2134809e80fac091bfed18a6991b5a5eb5df5ae32b17ac4f4f99864b73dd7", size = 221068, upload-time = "2026-06-22T23:09:23.452Z" }, - { url = "https://files.pythonhosted.org/packages/47/f0/3f8421b20d9c4fcd39be9a8ca3c3fda8bc204b44efbd09fede153afd3e2f/coverage-7.14.3-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:c02efd507227bde9969cab0db8f48890eb3b5dcad6afac57a4792df4133543ce", size = 252117, upload-time = "2026-06-22T23:09:25.458Z" }, - { url = "https://files.pythonhosted.org/packages/27/ca/59ea35fb99743549ec8b37eff141ece4431fea590c89e536ed8032ef45cf/coverage-7.14.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1bb93c2aa61d2a5b38f1526546d95cf4132cb681e541a337bf8dfd092be816e5", size = 254622, upload-time = "2026-06-22T23:09:27.523Z" }, - { url = "https://files.pythonhosted.org/packages/c8/25/ec6de51ae7493b92a1cf74d1b763121c29636759167e2a593ba4db5881e4/coverage-7.14.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f502e948e03e866538048bba081c075caaa62e5bda6ea5b7432e45f587eb462a", size = 255968, upload-time = "2026-06-22T23:09:29.43Z" }, - { url = "https://files.pythonhosted.org/packages/5d/05/c8bfc77823f42b4664fb25842f13b567022f6f84a4c83c8ecbb16734b7cb/coverage-7.14.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9973ef2463f8e6cfb61a6324126bb3e17d67a85f22f58d856e583ea2e3ca6501", size = 258284, upload-time = "2026-06-22T23:09:31.397Z" }, - { url = "https://files.pythonhosted.org/packages/f6/15/1d1b242027124a32b26ef01f82018b8c4ef34ef174aa6aeba7b1eeef48e8/coverage-7.14.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9be4e7d4c5ca0427889f8f9d614bd630c2be741b1de7699bca3b2b6c0e41003e", size = 252143, upload-time = "2026-06-22T23:09:33.256Z" }, - { url = "https://files.pythonhosted.org/packages/74/b6/d2a9842fd2a5d7d27f1ac851c043a734a494ad75402c5331db3da79ed691/coverage-7.14.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a574912f3bde4b0619f6e97d01aa590b70998859244793769eb3a6df78ee56d3", size = 253976, upload-time = "2026-06-22T23:09:35.351Z" }, - { url = "https://files.pythonhosted.org/packages/fd/30/e1600ddf7e226db5558bb5323d2186fff00f505c4b764643ec89ce5d8175/coverage-7.14.3-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:e343fb086c9cd780b38622fea7c369acd64c1a0724312149b5d769c387a2b1f5", size = 251942, upload-time = "2026-06-22T23:09:37.313Z" }, - { url = "https://files.pythonhosted.org/packages/d9/2c/9159de64f9dd648e324328d588a44cfab1e331eb5259ce1141afe2a92dfb/coverage-7.14.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:3c68df8e61f1e09633fefc7538297145623957a048534368c9d212782aa5e845", size = 256220, upload-time = "2026-06-22T23:09:39.165Z" }, - { url = "https://files.pythonhosted.org/packages/91/67/b7f536cc2c124f48e91b22fbb741d2261f4e3d310faf6f76007f47566e5d/coverage-7.14.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:3e5b550a128419373c2f6cec28a244207013ef15f5cbcff6a5ca09d1dfaaf027", size = 251756, upload-time = "2026-06-22T23:09:41.056Z" }, - { url = "https://files.pythonhosted.org/packages/dd/ec/f3718038e2d4860c715a55428377ca7f6c75872caf98cabd982e1d76967d/coverage-7.14.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2bfc4dd0a912329eccc7484a7d0b2a38032b38c40663b1e1ac595f10c457954b", size = 253413, upload-time = "2026-06-22T23:09:43.306Z" }, - { url = "https://files.pythonhosted.org/packages/b8/a5/91f11efeef89b3cc9b30461128db15b0511ef813ab889a7b7ab636b3a497/coverage-7.14.3-cp314-cp314-win32.whl", hash = "sha256:0423d64c013057a06e70f070f073cec4b0cbc7d2b27f3c7007292f2ff1d52965", size = 222946, upload-time = "2026-06-22T23:09:45.261Z" }, - { url = "https://files.pythonhosted.org/packages/58/fd/98ac9f524d9ec378de831c034dbdeb544ca7ef7d2d9c9996daf232a037fd/coverage-7.14.3-cp314-cp314-win_amd64.whl", hash = "sha256:92c22e19ce64ca3f2ad751f16f14df1468b4c231bd6af97185063a9c292a0cb3", size = 223436, upload-time = "2026-06-22T23:09:47.177Z" }, - { url = "https://files.pythonhosted.org/packages/b4/a0/7cd612d650a772a0ae80144443406bf61981c896c3d57c9e6e79fb2cdbd1/coverage-7.14.3-cp314-cp314-win_arm64.whl", hash = "sha256:41de778bd41780586e2b04912079c73089ab5d839624e28db3bdb26de638da92", size = 222861, upload-time = "2026-06-22T23:09:49.384Z" }, - { url = "https://files.pythonhosted.org/packages/55/57/017353fab573779c0d00448e47d102edd36c792f7b6f233a4d89a7a08384/coverage-7.14.3-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:8427f370ca67db4c975d2a26acfc0e5783ca0b52444dbc50278ace0f35445949", size = 221474, upload-time = "2026-06-22T23:09:51.417Z" }, - { url = "https://files.pythonhosted.org/packages/69/92/90cf1f1a5c468a9c1b7ba2716e0e205293ad9b02f5f573a6de4318b15ba1/coverage-7.14.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d8e88f335544a47e22ae2e45b344772925ec65166555c958720d5ed971880891", size = 221738, upload-time = "2026-06-22T23:09:53.487Z" }, - { url = "https://files.pythonhosted.org/packages/a4/c0/4df964fa539f8399fd7679c09c472d73744de334686fd3f01e3a2465ce4e/coverage-7.14.3-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:beaab199b9e5ceaf5a225e16a9d4df136f2a1eae0a5c20de1e277c8a5225f388", size = 263101, upload-time = "2026-06-22T23:09:55.895Z" }, - { url = "https://files.pythonhosted.org/packages/06/76/e5d33b2576ae3bf2be2058cd1cae57774b61e400f2c3c58f3783dc2ffb4a/coverage-7.14.3-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b3ff255799f5a1676c71c1c32ec01fd043aa09d57b3d95764b24992757184784", size = 265225, upload-time = "2026-06-22T23:09:57.904Z" }, - { url = "https://files.pythonhosted.org/packages/61/d2/e52419afe391a39ba27fdefaf0737d8e34bf03faef6ab3b3006545bbd0d0/coverage-7.14.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:878832eaac515b62decfa76965aed558775f86bf1fc8cca76993c0c84ae31aed", size = 267643, upload-time = "2026-06-22T23:09:59.938Z" }, - { url = "https://files.pythonhosted.org/packages/58/7a/f2625d8d5006b6b20fba5afaef00b24a763fe96476ea798a3076cbc1f84e/coverage-7.14.3-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:611e62cb9386096d81b63e0a05330750268617231e7bd598e1fe77482a2c58a5", size = 268762, upload-time = "2026-06-22T23:10:01.943Z" }, - { url = "https://files.pythonhosted.org/packages/7d/bf/908024006bba57127354d74e938954b9c3cd765cc2e0412dc9c37b415cda/coverage-7.14.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:02c41de2a88011b893050fc9830267d927a50a215f7ad5ec17349db7090ccf26", size = 262208, upload-time = "2026-06-22T23:10:03.954Z" }, - { url = "https://files.pythonhosted.org/packages/34/a0/d4f9296441b909817442fdb26bd77a698f08272ec683a7394b00eb2e47a0/coverage-7.14.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:526ce9721116af23b1065089f0b75046fe521e7772ab94b641cd66b7a0421889", size = 265096, upload-time = "2026-06-22T23:10:05.936Z" }, - { url = "https://files.pythonhosted.org/packages/e8/da/4ae4f3f4e477b56a4ce1e5c48a35eff38a94b50130ce5bdc897024741cfc/coverage-7.14.3-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:e4ed44705ca4bead6fc977a8b741f2145608289b33c8a9b42a95d0f15aedbf4d", size = 262699, upload-time = "2026-06-22T23:10:07.973Z" }, - { url = "https://files.pythonhosted.org/packages/d8/7a/6927148073ff32856d78baa77b4ddc07a9be7e90020f9db0661c4ca523a1/coverage-7.14.3-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:2415902f385a23dcc4ccd26e0ba803249a169af6a930c003a4c715eeb9a5444e", size = 266433, upload-time = "2026-06-22T23:10:10.145Z" }, - { url = "https://files.pythonhosted.org/packages/f7/a7/774f658dbe9c4c3f5daa86a87e0459ac3832e4e3cc67affe078547f727b9/coverage-7.14.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:b75ee850fc2d7c831e883220c445b035f2224de2ba6103f1e56dbd237ab913f7", size = 261547, upload-time = "2026-06-22T23:10:12.191Z" }, - { url = "https://files.pythonhosted.org/packages/3d/14/a0c18c0376c43cbf973f43ef6ca20019c950597180e6396232f7b6a27102/coverage-7.14.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:dc9b4e35e7c3920e925ba7f14886fd5fbe481232754624e832ddba66c7535635", size = 263859, upload-time = "2026-06-22T23:10:14.492Z" }, - { url = "https://files.pythonhosted.org/packages/10/ac/43a3d0f460af524b131a6191805bc5d18b806ab4e828fbf82e8c8c3af446/coverage-7.14.3-cp314-cp314t-win32.whl", hash = "sha256:7b27c822a8161afbe48e99f1adfb098d270ae7e0f7d7b0555ce110529bdb69cc", size = 223250, upload-time = "2026-06-22T23:10:16.758Z" }, - { url = "https://files.pythonhosted.org/packages/3f/5f/d5e5c56b0712e96ce8f69fe7dbf229ff938b437bc50862743c8a0d2cea84/coverage-7.14.3-cp314-cp314t-win_amd64.whl", hash = "sha256:39e1dbbb6ff2c338e0196a482558a792a1de3aa64261196f5cdb3da016ad9cda", size = 224082, upload-time = "2026-06-22T23:10:19.23Z" }, - { url = "https://files.pythonhosted.org/packages/62/35/947cbd5be1d3bcbbdc43d6791de8a56c6501903311d42915ae06a82815f0/coverage-7.14.3-cp314-cp314t-win_arm64.whl", hash = "sha256:68520c90babfa2d560eca6d497921ed3a4f469623bd709733124491b2aa8ef3f", size = 223400, upload-time = "2026-06-22T23:10:21.24Z" }, - { url = "https://files.pythonhosted.org/packages/eb/e3/a0aa32bfa3a081951f60a23bc0e7b512891ef0eecda1153cf1d8ba36c6b1/coverage-7.14.3-py3-none-any.whl", hash = "sha256:fb7e18afb6e903c1a92401a2f0501ac277dca527bb9ca6fe1f691a8a0026a0e8", size = 212469, upload-time = "2026-06-22T23:10:23.405Z" }, +version = "7.15.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/76/d0/55fe630f4cf94e3fcba868240fad8c8cdd1f764e2a932f8926347e6ec4cd/coverage-7.15.2.tar.gz", hash = "sha256:3df60dc267f0a2ca23cb7a9ab1109c62b9335ffbf519fcfe167157c28c09b81d", size = 927741, upload-time = "2026-07-15T18:56:19.558Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6a/50/eb5bf42e531611a9f8d272556b1ed4de503f84a91413584094487cf69f8f/coverage-7.15.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:1adac78e5abc7c5438f7a209c9ca69d06542f0bf481d728b6989ea80b813fdf9", size = 221587, upload-time = "2026-07-15T18:54:18.439Z" }, + { url = "https://files.pythonhosted.org/packages/06/d1/da99af464c335d4e023a6efcd7ec30f63b88a43c93745154ab74ffb31cea/coverage-7.15.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b868acc62aa5de3be7a9d05c2333bf8359ca987e43f9cb30ff8fbda6a024ab73", size = 221943, upload-time = "2026-07-15T18:54:20.062Z" }, + { url = "https://files.pythonhosted.org/packages/5b/8a/13c42723d61ca447eafa18732e8141dd6a63f2732e1c7e1502c182dd88d7/coverage-7.15.2-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:6f6966fc30e6f06ca8f98fb0ce51eda6b111b3ee8d066a8b1ec9e77fa06ab55d", size = 253450, upload-time = "2026-07-15T18:54:21.765Z" }, + { url = "https://files.pythonhosted.org/packages/d7/29/99021303f98fbdcb63504b4d07bea4cc025b9b2dd907c4f07c85d50a0dab/coverage-7.15.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:68af907f595ab01a78f794932ff3bdf929c316d3000810d38dbc247129e26f8b", size = 256187, upload-time = "2026-07-15T18:54:23.4Z" }, + { url = "https://files.pythonhosted.org/packages/f9/a8/fd503715ed6ca9c5d742923aa5209257340b367a867b2ced0c7d4ba8a0b9/coverage-7.15.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:afa29e2eff3d5729267e2cb2fd4ce9d61c952932fb2694e34ccb5d9540c6a296", size = 257301, upload-time = "2026-07-15T18:54:25.183Z" }, + { url = "https://files.pythonhosted.org/packages/da/40/3f4b8fb409810036ebc2857d36adc0498c6e957b5df0290c5036b2e143f1/coverage-7.15.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:bbf44513ceb1589e31948e20eafbde9deaface90e1a1afa5f5f77b4423d17ce6", size = 259562, upload-time = "2026-07-15T18:54:27.204Z" }, + { url = "https://files.pythonhosted.org/packages/0b/8a/9bdffbef47db77cce3d6b02a28f7e919b19f0106c4b080c2c2246040f885/coverage-7.15.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9deddf09eecb717b7f980414b43d90a5b22ff3967d2949ab29cb0aa83d9e9098", size = 253841, upload-time = "2026-07-15T18:54:29.134Z" }, + { url = "https://files.pythonhosted.org/packages/1b/1e/9031efde019d31a06646261fce6dfc5c3c74e951e27a71e5c9a424563178/coverage-7.15.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ae901f7e55ba405c84ee1cab3d3e962e4e871e4a2bcb9c90911adbd69b42ac5a", size = 255221, upload-time = "2026-07-15T18:54:31.142Z" }, + { url = "https://files.pythonhosted.org/packages/56/db/787acde872389fc84a9ef9d8cd1ccc658e391ab4cb5b28092a714426a394/coverage-7.15.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a0f47002c6eeb7c280228467a4cb0cc15ca2103a8421b986b2d3ec04a0f9bd8b", size = 253366, upload-time = "2026-07-15T18:54:32.886Z" }, + { url = "https://files.pythonhosted.org/packages/2f/9b/6f57bc4b93c842eef1695f8cdaf2318e35e7ba54f5ba80d84be213ab7858/coverage-7.15.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:1cd7a5beb7af3e864a13b1f0fb26efd3695da43ef0daf71e586adfffaf34d5b2", size = 257434, upload-time = "2026-07-15T18:54:34.7Z" }, + { url = "https://files.pythonhosted.org/packages/88/26/b3186a21b2acc83e451118978905c81c7072c3333707804db09a78c096a2/coverage-7.15.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:97a5c5457a9fb1d6c4e06cfb5dc835871fbfb6a6a51addc9e925bdeff5ef7440", size = 252935, upload-time = "2026-07-15T18:54:36.548Z" }, + { url = "https://files.pythonhosted.org/packages/20/c2/c9f3376b2e717ea69ed7a6e9a5fcab968fb0b290db6cf4bd9a1fc7541b75/coverage-7.15.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0901cfe6c13bcd2302da4f83e884555d2a22bda6e4c476f09ef204ba20ca536e", size = 254807, upload-time = "2026-07-15T18:54:38.296Z" }, + { url = "https://files.pythonhosted.org/packages/f0/e1/dfc15401f4a8aaeb486e1ba3e9e3c40522a6e38bd0ecf0b3f29cb8082957/coverage-7.15.2-cp312-cp312-win32.whl", hash = "sha256:b171bdd71cb7ff792bf32e376173b0ace7e7963e7e57c58dfc42063a6a7174cd", size = 223641, upload-time = "2026-07-15T18:54:40.103Z" }, + { url = "https://files.pythonhosted.org/packages/91/40/81b6d809d320cd366ec5bdf8176575e897dcb8efe7fb4b489ef9e93e4d13/coverage-7.15.2-cp312-cp312-win_amd64.whl", hash = "sha256:582edc45c2040543fef83341be23c43024a3ab3ae0c2d8bc498a06282905ad40", size = 224172, upload-time = "2026-07-15T18:54:41.882Z" }, + { url = "https://files.pythonhosted.org/packages/ef/28/9f14ec438149f7de557f45518f09b4a7917b795cc37083aa7db482693f8c/coverage-7.15.2-cp312-cp312-win_arm64.whl", hash = "sha256:a638db90c61cd219aeee65e83a24fdaa57269a741ae0cf773309208ac862cee3", size = 223556, upload-time = "2026-07-15T18:54:43.674Z" }, + { url = "https://files.pythonhosted.org/packages/fc/d5/f8c838e6b7282976f7c918884b792df7a0c42c5bba5d99c60ad2d221d56d/coverage-7.15.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1121caa19159a38b5463eaae4b1e1fde81e525b15ecc5e000cd5b1a108f743a8", size = 221606, upload-time = "2026-07-15T18:54:45.448Z" }, + { url = "https://files.pythonhosted.org/packages/bf/37/97c926376364f66298cc44893b89cdf17b8bc406376497c4061ae4b8a8ff/coverage-7.15.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a300c6934e0989c327b9e8a1e110329da4641149f872bbe9f70168be66da76c1", size = 221982, upload-time = "2026-07-15T18:54:47.341Z" }, + { url = "https://files.pythonhosted.org/packages/b7/30/a36050a6e83c2135ee0776f452ca3948224befc6d7f26acecc082d0c106a/coverage-7.15.2-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2617f8799d268fabdeef42a7e89ac3a23e1deee9025427db2df970f99a89a578", size = 252972, upload-time = "2026-07-15T18:54:49.2Z" }, + { url = "https://files.pythonhosted.org/packages/31/d3/06b5f1daf95f0f15ab05bd75f26ba5f3c8b33d0bb72f3aaa3cf41d1bad3a/coverage-7.15.2-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7dc2950a2992cd676d35c20ae63522836deeb034f08874699d14068710af3dc1", size = 255569, upload-time = "2026-07-15T18:54:51.098Z" }, + { url = "https://files.pythonhosted.org/packages/81/1c/9afb3f8de2b8d36960391c48559a2e3ff96594b58099f115921549ea8d0d/coverage-7.15.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9e36686f7a442185db2400b3df171aac520869faf9deb59df687d28659eda2a6", size = 256806, upload-time = "2026-07-15T18:54:53.145Z" }, + { url = "https://files.pythonhosted.org/packages/64/d8/b989f96061a5e32d82fddd1b1b9ff48a7c8f8ae7606f0e80fd9de54b1e33/coverage-7.15.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7d29ca7bd67af6e12e74632d65f026eabc1364da5c254494cd914446a28a3ef7", size = 258936, upload-time = "2026-07-15T18:54:55.015Z" }, + { url = "https://files.pythonhosted.org/packages/b8/fa/f99771f5110457c7b511c1935ca49ddf288218eaa84322e028b9334146ae/coverage-7.15.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:db9c8438057e5b0f6a22a0af99c0c1d26b57fbbdbd1be5861ddb8f897fcc3a2d", size = 253178, upload-time = "2026-07-15T18:54:57.527Z" }, + { url = "https://files.pythonhosted.org/packages/f6/96/c098a6044d119c751ceede7be91035fa8310170ec24a6523aff72f0a5793/coverage-7.15.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:63022c4c8dec1d0342f05c3ede99842fe3d007689acc45e86f123a1746e4a026", size = 254934, upload-time = "2026-07-15T18:54:59.41Z" }, + { url = "https://files.pythonhosted.org/packages/b2/a2/1457b3a7a50c8d77500103b97a046db863e2f59a1cf6d2f814595f349885/coverage-7.15.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:6c0be82b4d4aa5b2704e08518e2252f3e3d110164bcca826816801052e48a7aa", size = 252898, upload-time = "2026-07-15T18:55:01.338Z" }, + { url = "https://files.pythonhosted.org/packages/6c/0e/76958874c471ecfcdde0d2b2747bb2c61bdbf34a40636f4ce9db9923e643/coverage-7.15.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4510fb9cdf6bb02dfa6af0be4a534b8102d086e22e4a33f8836df663da3d660d", size = 257056, upload-time = "2026-07-15T18:55:03.243Z" }, + { url = "https://files.pythonhosted.org/packages/7c/7c/3d7c4e3bf58baa40327dc7edc2272b17cf02299366d52763db1b0ca1556a/coverage-7.15.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:42ec3d989421b174a2ab607c1539f24127ad362757b7f1c0c0d7a2993f7eb37b", size = 252718, upload-time = "2026-07-15T18:55:05.029Z" }, + { url = "https://files.pythonhosted.org/packages/c8/b8/1cecffed9ce14fb25be9ba42d37b6bb61485c9a3ddd43cd3dde36b6087d8/coverage-7.15.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e8f91bce78e32343af184c3b7fa28fcf5a9e2641f4b6623d392038f804939188", size = 254490, upload-time = "2026-07-15T18:55:06.889Z" }, + { url = "https://files.pythonhosted.org/packages/6c/2c/42984561bc7f4c045dca67516a0c50ee5ef8d84352dbeb5559dc86c4823e/coverage-7.15.2-cp313-cp313-win32.whl", hash = "sha256:434e68d531858205895eb0d74b73d20b84260de426387d53c422a5acda2cf050", size = 223647, upload-time = "2026-07-15T18:55:08.941Z" }, + { url = "https://files.pythonhosted.org/packages/41/9f/39c7c9245efc583beddf89a87683574e663ed93637f3afb6cd7b88405676/coverage-7.15.2-cp313-cp313-win_amd64.whl", hash = "sha256:26c3b04a6377fd7c09800921fa934e3a17c0020439cd59df73e73ae1d4b6a78c", size = 224190, upload-time = "2026-07-15T18:55:10.789Z" }, + { url = "https://files.pythonhosted.org/packages/c7/de/3a2883cf8a213659280ef4b403059e17a9acaeb7fc7fd4105e1226ff2e6d/coverage-7.15.2-cp313-cp313-win_arm64.whl", hash = "sha256:3ed010aa1b69cda8e827aabfca9866216c980e2dca82ab9a78c5f83689964c8b", size = 223583, upload-time = "2026-07-15T18:55:12.678Z" }, + { url = "https://files.pythonhosted.org/packages/81/5f/aed265fd7a3551a394f36dfe41868aee709b7f95db4052205b4ad1563ac3/coverage-7.15.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:40f633c5c5fc783732f6312280122e859538fa24461235597c13d803ea9a108a", size = 221650, upload-time = "2026-07-15T18:55:14.527Z" }, + { url = "https://files.pythonhosted.org/packages/6b/2c/222ba12a545189017120f8eddfc1a0bd4616b47d5d4a8d99421edb2fe4c6/coverage-7.15.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:075560438765b7a2ef43bf7aa7758661b53d889df47f062a31bda6c1ade553a2", size = 221988, upload-time = "2026-07-15T18:55:16.674Z" }, + { url = "https://files.pythonhosted.org/packages/aa/38/304b5877ab46e6c290b4292cfcf3fe28245f0e5597cad7f6acc91fc7e0a4/coverage-7.15.2-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:25fd15dd40a0a2c51a500d664ca29053c09c3259d998407bf982b6e114696138", size = 253029, upload-time = "2026-07-15T18:55:18.856Z" }, + { url = "https://files.pythonhosted.org/packages/6c/58/821b533b8db9e44cf1d8a97bd525149ced40dde1d0093da02cb78e715244/coverage-7.15.2-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b9a6367e4aff723e8ee8190836836124284e8fcd4265e307c844010cfa074f3f", size = 255536, upload-time = "2026-07-15T18:55:21.027Z" }, + { url = "https://files.pythonhosted.org/packages/f1/f2/7aa06604c389d32ea7f0a6a988359a7eafc3cd3f8e7bc2e88cd2fdf0b877/coverage-7.15.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9854ca62c152874b2060772503535be2e8f53f70b8aaa7686b094888d872f984", size = 256881, upload-time = "2026-07-15T18:55:23.125Z" }, + { url = "https://files.pythonhosted.org/packages/a2/4f/1ef342339c7916d0096bc5888cc0f653882cc7bc8f897d5cb89143287c9b/coverage-7.15.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:913b6c56e110da40e035bbd168353bf7aaa2544a5eaccea5d98a4629aac156c7", size = 259196, upload-time = "2026-07-15T18:55:25.099Z" }, + { url = "https://files.pythonhosted.org/packages/fe/f4/7ed055d7a9c5ec13b161773a115a5ccc6b0081d568c31fad830806306cc7/coverage-7.15.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:aaccad4129d735a8a4d526f26929894c9a4e8ef7034566f210b176749d6906e3", size = 253036, upload-time = "2026-07-15T18:55:27.018Z" }, + { url = "https://files.pythonhosted.org/packages/14/79/ea82cca18c242a3a38b6c017da39726aa62dcb64aa635abf79b92009975c/coverage-7.15.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a164b50081fc7357331c4024ef4d17b78ba325f8380d05f5a69599a7e05257ee", size = 254887, upload-time = "2026-07-15T18:55:29.084Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ba/a136db3c0d9562b00e10b72540dbf3a33cd3bc5b95060c9308e247494623/coverage-7.15.2-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:bfd341ccf78128e72c094bc70cc25b3ef309c33c7c2c66ba3ed4309549e02de1", size = 252852, upload-time = "2026-07-15T18:55:31.184Z" }, + { url = "https://files.pythonhosted.org/packages/17/17/ea334246b16b7d059953fad6fdefa11e33c68efbd3fe37b1098120a1fac2/coverage-7.15.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:1473b3ba8e7ee0f076117b1a72c23f579a2b9e2bb742f48a8d86ea27ca93f91a", size = 257128, upload-time = "2026-07-15T18:55:33.163Z" }, + { url = "https://files.pythonhosted.org/packages/ed/c3/074fb66d46d607855f710876b117cbda562c5ab08363528e78820449f937/coverage-7.15.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:17c432b5f73ad52ef46fb06019f6fa7c66ce381961cf0f7dfd1d3a4bd3a98145", size = 252668, upload-time = "2026-07-15T18:55:35.063Z" }, + { url = "https://files.pythonhosted.org/packages/e1/c1/f620850ada9b36435921c9a3a8057013422b1d964eb4bf37fe138724d192/coverage-7.15.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:77f0ef5011df53a4bd1b35211ab122287f8d9b8d7aa1c4553e5c2deb24b1d446", size = 254325, upload-time = "2026-07-15T18:55:37.125Z" }, + { url = "https://files.pythonhosted.org/packages/cc/31/a729ca3689404493af82ef8e6ff70bd88bdda8da89aeef6ca9b387aeb2b4/coverage-7.15.2-cp314-cp314-win32.whl", hash = "sha256:f653e5d7248c1191ec988a85c72edeab46c3ff44f90639a4ed4874ec0be90243", size = 223844, upload-time = "2026-07-15T18:55:39.078Z" }, + { url = "https://files.pythonhosted.org/packages/c6/83/5d809dc808fb1698c671f3e372259bb9158e64b7ea526fc6ab7de64de9fe/coverage-7.15.2-cp314-cp314-win_amd64.whl", hash = "sha256:9911f31aad8906abe337c271343485cf20df5e70df5d2f57f9f136e7b55f26bc", size = 224331, upload-time = "2026-07-15T18:55:41.346Z" }, + { url = "https://files.pythonhosted.org/packages/16/4e/35e488548e952795829e129995c4174df33bf432b591d1aa42c8d9e4e7ad/coverage-7.15.2-cp314-cp314-win_arm64.whl", hash = "sha256:e38def96ad59853824c97953fdcd2c320a84ba3ce99b417db78af8bb6c3db635", size = 223760, upload-time = "2026-07-15T18:55:43.518Z" }, + { url = "https://files.pythonhosted.org/packages/ed/49/dd2c86cd6374038f6e415fb5bfb86db5218553209c081384a020369dee79/coverage-7.15.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:835ec4e20b45f0a7f63ed78f94065aca00de033403df8377bfe8b9c6abc0a7be", size = 222384, upload-time = "2026-07-15T18:55:45.569Z" }, + { url = "https://files.pythonhosted.org/packages/d3/74/173ff17a1c0808e5a438f549f6f145d5ac7528f2791310b63523e3200ac7/coverage-7.15.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7466cc7ab6dc0db871d264bf99e8779f0917ee63d40730af0552f71535a6e072", size = 222647, upload-time = "2026-07-15T18:55:47.544Z" }, + { url = "https://files.pythonhosted.org/packages/84/f8/b8cba872162356fb44ac79c10309d987206a4461e32072fc29228dad7331/coverage-7.15.2-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:e370c12133095ff18432de8c044962be85a5a96d90c6fcbce8e17e76236d2328", size = 264013, upload-time = "2026-07-15T18:55:49.768Z" }, + { url = "https://files.pythonhosted.org/packages/ee/67/a807a7586d0b8cae485308ddd55756f0806c92f8e0b411bacbf23c48edf3/coverage-7.15.2-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fe41909c9515c3bfdb5f02c4d1f857dba322d9a9a1178069b91eea77889df63a", size = 266135, upload-time = "2026-07-15T18:55:51.941Z" }, + { url = "https://files.pythonhosted.org/packages/ce/67/cd78771dc985f7e4ebdcc82b1a96d9a932af9e806f01f2f91a89f4c72e80/coverage-7.15.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6aa28cfb6488e5453b5b762d65f73aa586380f6693a04d58078ce228a29b06c0", size = 268555, upload-time = "2026-07-15T18:55:54.065Z" }, + { url = "https://files.pythonhosted.org/packages/18/3e/10134cf81275188c58568f324fc74aedff32c63ca4d5bbc513a91944a6f0/coverage-7.15.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:bcc0aae933921d03096f53b0b03eeb702129fd406dee59f08d2efacc68681fa5", size = 269674, upload-time = "2026-07-15T18:55:56.066Z" }, + { url = "https://files.pythonhosted.org/packages/75/4a/771b77de446cba985dc414bbc5844bd21604da05dbc044286df8318a48a7/coverage-7.15.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7c63387e21ab21f512c69c9756a8c7dadd322c7275edb064064433c9a09c3743", size = 263101, upload-time = "2026-07-15T18:55:58.107Z" }, + { url = "https://files.pythonhosted.org/packages/5f/b5/70a7011da15f4071943361183aefa27847f3e3aec4fd335f1cb3d3a622b1/coverage-7.15.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:0e55510bc98ae943cece9e667a6c0fe94c6a92913720dea34243657a17993d0c", size = 266007, upload-time = "2026-07-15T18:56:00.468Z" }, + { url = "https://files.pythonhosted.org/packages/b4/0d/f9547e804ce7ad49646ffeffac26699510efbe6c0f751b66fdc960c4e825/coverage-7.15.2-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:2ff08701be2d1556fc78b326c80a3e8042da09352ecb3819105f8e386c8a3071", size = 263611, upload-time = "2026-07-15T18:56:02.615Z" }, + { url = "https://files.pythonhosted.org/packages/ac/59/f576a396659c0efd351f5c1544f67c3560e89c7761cabf7f65e412beeda5/coverage-7.15.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:38c9518b7103826c403a461544e3c2e77151e8676d06eaed85911a97e962584a", size = 267344, upload-time = "2026-07-15T18:56:04.622Z" }, + { url = "https://files.pythonhosted.org/packages/7c/5d/c2e4fce3579c0cb635024293f1a32bbe26df101b3e3a69f22243d1352b6c/coverage-7.15.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:dee88b1ed88587abd8c0269a1fc1f4cc77f7750d1dfde2869e2a123af420e67d", size = 262456, upload-time = "2026-07-15T18:56:06.641Z" }, + { url = "https://files.pythonhosted.org/packages/bb/dd/956287d69436b66094bc4b57ac2da71e43bfd2a5524e958900b9f582fcf8/coverage-7.15.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:2fbeeeecea279727f8ac16c8e1133ddfeee793e985c86ae343d6a5ce744eef8c", size = 264771, upload-time = "2026-07-15T18:56:08.795Z" }, + { url = "https://files.pythonhosted.org/packages/2c/5a/6f979530c2734c575de77cf58f5f28d51f7123a94b5030fd9156fe5f363c/coverage-7.15.2-cp314-cp314t-win32.whl", hash = "sha256:cb0fddaa6884be6aae36ced9544b5e90f7d5f03845a2853bf47a14953a4e8688", size = 224151, upload-time = "2026-07-15T18:56:10.856Z" }, + { url = "https://files.pythonhosted.org/packages/54/7e/27f6b2a74d484742f4017553e710b01e396b23d809df3e95ca0bb9a2824b/coverage-7.15.2-cp314-cp314t-win_amd64.whl", hash = "sha256:77f091ea3a9cc611cd29f433565476bc1936c084ac8eee00ea0e7e70c27e4199", size = 224981, upload-time = "2026-07-15T18:56:12.928Z" }, + { url = "https://files.pythonhosted.org/packages/b1/48/284863423aa474240f6842bd00d680da22f4e6ea2e466618ef7c9c9e69a9/coverage-7.15.2-cp314-cp314t-win_arm64.whl", hash = "sha256:6fc448c377d6eeb00a47c673494bd9bae29280ca53987e1869e67ebedfe20658", size = 224294, upload-time = "2026-07-15T18:56:15.156Z" }, + { url = "https://files.pythonhosted.org/packages/ec/82/32e3bd191d498e64f6f911ad55d14006a0861e54869d2d32452326399e65/coverage-7.15.2-py3-none-any.whl", hash = "sha256:eb6bcae8d1a9d305351ecb108232441d11c5cfe9de840a04388ba5d2db8d735c", size = 213375, upload-time = "2026-07-15T18:56:17.305Z" }, ] [[package]] @@ -1029,14 +1032,51 @@ wheels = [ [[package]] name = "hypothesis" -version = "6.155.7" +version = "6.160.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "sortedcontainers" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/f2/55/983b6bc1b6b343a5ff6020388f9d0680ab477be59a731517e6c4a0387100/hypothesis-6.155.7.tar.gz", hash = "sha256:d8d6091753d0669db3c90c5e5b346cb37c72f3dd9378c8413acb1fd5da63f7ea", size = 478291, upload-time = "2026-06-21T05:54:31.573Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/01/f8/c151e196d4f397ed9436a071e52666c70a2f021138dea828b0a461e245db/hypothesis-6.155.7-py3-none-any.whl", hash = "sha256:9f634bdb1f9e9b8ab6ba09431cf2deedb750c96978125a6fb3c5a0f6c6db4131", size = 544762, upload-time = "2026-06-21T05:54:29.506Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/27/18/824aedbd4117d769862a2722ea2371aa61433a38bfb5355e5dc113b564c2/hypothesis-6.160.0.tar.gz", hash = "sha256:149400acbb7382e2ce6810a52e86a9fd6d4e5c4a47660818abb438cde76aa5d1", size = 485677, upload-time = "2026-07-22T14:12:13.331Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ad/c6/39fa718992b7529d1f68532a3554b9479f27f6a46aa5859c0d909bde0a40/hypothesis-6.160.0-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:69e1511325901fcd570fbd88779882e30cb280aeedd9708093aab4b25f7cdbf5", size = 766096, upload-time = "2026-07-22T14:11:58.283Z" }, + { url = "https://files.pythonhosted.org/packages/94/1b/81b54dbf97baa4026034579ce63b56d3d35c0d22b72b032c68e23bbda92b/hypothesis-6.160.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:1ba0f1dd0f2872b7f7230a3884a0d739917d57262d0e9e3c8ee34b775f95a553", size = 761752, upload-time = "2026-07-22T14:11:42.682Z" }, + { url = "https://files.pythonhosted.org/packages/ea/02/fa35cf37fd801d1e952e2168c0b5542f99c77024098f954cd515f2101910/hypothesis-6.160.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f9116a80ed96060a7fbc8d50cc5e93dec10d72f70f61e9184628dbcba2f9a2f", size = 1090928, upload-time = "2026-07-22T14:12:05.158Z" }, + { url = "https://files.pythonhosted.org/packages/a7/35/f2422a4287bbac99d6317a10e7add5f24abe069952c503cb3512e91bebc0/hypothesis-6.160.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:065cfed699889b6c05265ca4f97e8c7bb85800d3d3146f4741b68ef7be1fed18", size = 1140474, upload-time = "2026-07-22T14:11:50.558Z" }, + { url = "https://files.pythonhosted.org/packages/bc/ef/7504f31be0c9dfd8c69b1e068564e0c1126a82ab753abcb20c4bacd1544b/hypothesis-6.160.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:52e0cdc8fcd34b121a213205f239545fec38142014114afc721d1c867ac34834", size = 1132509, upload-time = "2026-07-22T14:11:48.702Z" }, + { url = "https://files.pythonhosted.org/packages/b4/39/8c7a5cfc336e0bdd7b7ae1d8807028b2b46c03979a5d82e8992b4ba2b81c/hypothesis-6.160.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:4868821ffba805970441fec1b0635ea123f01aa6b71fc8f2d9550ee782f1ecd7", size = 1264762, upload-time = "2026-07-22T14:10:30.068Z" }, + { url = "https://files.pythonhosted.org/packages/ac/00/0d47e996ccbfa1eceb66d285b6fbf248c7c020e4e18b1bea09b18f05f6f5/hypothesis-6.160.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:64cf59670080aeb3c6048d62df0f6352586410745d14d7045a692eb5d2245110", size = 1307495, upload-time = "2026-07-22T14:11:33.978Z" }, + { url = "https://files.pythonhosted.org/packages/1a/b8/01f731cfcf9fc475adbde3c328d0c8f1d24952b4dd2a5049e7156aa64d9c/hypothesis-6.160.0-cp310-abi3-win32.whl", hash = "sha256:993c26c81e9cc9f291cdb64f54aa8f31507d2d472d0f1334f8ba9e7d77666911", size = 651991, upload-time = "2026-07-22T14:11:21.375Z" }, + { url = "https://files.pythonhosted.org/packages/87/12/95216fe9a84cafc9bc721b4352cf9b78bf0e9089f278811fbd58c76dbe3f/hypothesis-6.160.0-cp310-abi3-win_amd64.whl", hash = "sha256:95a4b0e1faa366d0cc9d7ce261773cec69f4f130b845ca33b71c22c85493c35d", size = 658114, upload-time = "2026-07-22T14:10:54.298Z" }, + { url = "https://files.pythonhosted.org/packages/81/b2/bc800c4925c1f47b61c17f78e57bb58a8743d03da28de13f59cba148daf2/hypothesis-6.160.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:18e058b34f4514da8b2ce15ebee9e6e98d3a95067665accf394415824934f790", size = 767730, upload-time = "2026-07-22T14:11:56.44Z" }, + { url = "https://files.pythonhosted.org/packages/37/b6/d34a7f990eb0a38933a7f6b14d261fda990faef37122e71797b0043fa371/hypothesis-6.160.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5b38697f797e9406e20e03cd79e1a69c7ac714e7e244f13121d39b44f27f7ed3", size = 759362, upload-time = "2026-07-22T14:11:05.77Z" }, + { url = "https://files.pythonhosted.org/packages/df/bf/48bd2bf246d22f188c82dbf3682832fc14fa4e6069c5415b1e8a473397a7/hypothesis-6.160.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef7d9e8022a8dd2afa2bfbf6580f21a7fd8b4798d20c027f4afb048d780414fd", size = 1089731, upload-time = "2026-07-22T14:11:39.069Z" }, + { url = "https://files.pythonhosted.org/packages/76/a0/d557bd44f611ec2516c69b6ada1e65f96c4d9d1dbad63f12b1799ca682b8/hypothesis-6.160.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4716ceb2adc72ea20138cd6a5600d102895f46fe95a42d915e032eed54b77ee6", size = 1139776, upload-time = "2026-07-22T14:11:19.164Z" }, + { url = "https://files.pythonhosted.org/packages/32/99/cad454acb11e027773bdba5cb95cb181a46cd1cabb8bfe2f2042e29dc0c5/hypothesis-6.160.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3d186b17a25eaf51ebf0376ea9d702dddb4f62cc11c0b5230e0aae77b44f49d3", size = 1262564, upload-time = "2026-07-22T14:11:02.444Z" }, + { url = "https://files.pythonhosted.org/packages/67/e7/61b2e1b6c2f75fa3b791040ba4baf2b617ffaf62ffbafad9463869baf521/hypothesis-6.160.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7e5e959bb18ec9b285dcc1d6f455c8860da919b9341842530847e820ed18dbbb", size = 1306756, upload-time = "2026-07-22T14:11:54.464Z" }, + { url = "https://files.pythonhosted.org/packages/89/79/6e9f2da0f298f891930a9fc1ed0559818d4ba840f47ed736c89152fd962e/hypothesis-6.160.0-cp312-cp312-win_amd64.whl", hash = "sha256:ded91bbdd0c3a84903bda3dc08d639b3b3e28c03fb83b568af8e13039042c3c4", size = 655265, upload-time = "2026-07-22T14:10:58.076Z" }, + { url = "https://files.pythonhosted.org/packages/85/05/a05ba058a37681d2aa872abcff9bd7a50c61c6347aedf2e3f5a15b8e932b/hypothesis-6.160.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:cb6cd703d38d881505a00e1901844d70d250e90824caa55e0dfaed6c8c7e0244", size = 767604, upload-time = "2026-07-22T14:11:11.346Z" }, + { url = "https://files.pythonhosted.org/packages/ec/a1/33dde1810a52698802fe2e28cfd2696b6aefafdc721cc456dfbc85875bb2/hypothesis-6.160.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9561298d687f9fca38aab451e8eb8a9f18b65a57f81f7331eff5234f0f065dc0", size = 759264, upload-time = "2026-07-22T14:10:40.271Z" }, + { url = "https://files.pythonhosted.org/packages/34/84/573402093577ef0fd86c8156d4c4ecd03b0a5e368e8925074fe565f9faba/hypothesis-6.160.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9e19f91119e2e19603210b849508695efabd2a35d6af9ac4d637c1b9a514a52b", size = 1089653, upload-time = "2026-07-22T14:11:37.333Z" }, + { url = "https://files.pythonhosted.org/packages/da/05/c85a35fef75214fc08a27e5099ae51d713c6550252ef7ce4c156780433f1/hypothesis-6.160.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd6b73076bb3fbf02001a439a5eb45cdd3db17e2cf6d95f453cfb1f5a97713f5", size = 1139592, upload-time = "2026-07-22T14:12:11.469Z" }, + { url = "https://files.pythonhosted.org/packages/59/53/8f9996fa3a6352edec2c17b743630b6c5f62486db6b43594168a1c0b7571/hypothesis-6.160.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:c0dcde9c08f3bdd5318026c57155ce4bfe7615fd27d3eca77a7453cb3ffbba64", size = 1262616, upload-time = "2026-07-22T14:11:14.754Z" }, + { url = "https://files.pythonhosted.org/packages/b4/f7/8b2699131893dd7bcecfe3be9ee758d3939cc8af68374700e68d9df2281b/hypothesis-6.160.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:78cb5fcf8518f3a10e888cdff545fa733931e2ff843b02a54e5e0b01b3142f94", size = 1306470, upload-time = "2026-07-22T14:11:23.203Z" }, + { url = "https://files.pythonhosted.org/packages/88/ba/9764eaff70d2a54aa072f709a121f98cf8766fc1591a063f8fab2117b6cf/hypothesis-6.160.0-cp313-cp313-win_amd64.whl", hash = "sha256:e95c3ce8e9c5abd2256854a2e53395fdd91d16cdce8d1621eca8caf5c7a2b1a2", size = 655209, upload-time = "2026-07-22T14:11:17.33Z" }, + { url = "https://files.pythonhosted.org/packages/a1/b9/3b92edf73785218f084521c2be9506ce6e5c63a64662cda074e588ff3071/hypothesis-6.160.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:9bd3d333a501f1faf8611159a998eb1bb28c43b620822ba6c8b2463f5de2a136", size = 767796, upload-time = "2026-07-22T14:11:28.865Z" }, + { url = "https://files.pythonhosted.org/packages/12/c7/eefd510bffc66320015169e2c6669e3a08ea29dda84d81655ecc1c6cbd8c/hypothesis-6.160.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:21ee82802c25282d692eaec7d3b960176c10eb6dc70853b152c5bc6b3b6faf02", size = 759410, upload-time = "2026-07-22T14:10:31.902Z" }, + { url = "https://files.pythonhosted.org/packages/1d/e4/6ad1e558d2df6900b0ad9d17081fbed4a74ffb01d86e64813cab4eaf45f1/hypothesis-6.160.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7d71e85548be9dd3a6eb59904daa85d5879e337cb69ad42cc2267c05a17ab26", size = 1090131, upload-time = "2026-07-22T14:11:44.448Z" }, + { url = "https://files.pythonhosted.org/packages/69/94/0d2fef37f9ff89b38b943cc38e12b45fda47cd06704d09bdeb890063d3bc/hypothesis-6.160.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4af833bb623f37b185e53ad7c62292272fc9fec3c7567d0703e3fdd3dcc90945", size = 1139829, upload-time = "2026-07-22T14:12:02.462Z" }, + { url = "https://files.pythonhosted.org/packages/ad/f3/216b8af797eda74af68b0d8ee37d8452adf0cf5b924dd25780e5c3b6296f/hypothesis-6.160.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:5789a0cd225f216690d7d99159bbd5d01a6d42cb6c4a07233739b4bf59c7fa37", size = 1262992, upload-time = "2026-07-22T14:10:34.529Z" }, + { url = "https://files.pythonhosted.org/packages/d8/14/63f14de37f41ed09d56593d9c03e8389a3bffcdbdf71bf05d30b5e3b1e4f/hypothesis-6.160.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:57f6e370e24c3ca4b9bb6cb132baa471745ca3d598f6328a602f590fe531b1e7", size = 1306760, upload-time = "2026-07-22T14:10:59.825Z" }, + { url = "https://files.pythonhosted.org/packages/8f/9f/a94eb847dd98edf233aefb7dbe88bd7bf7506840896454ed03827f844907/hypothesis-6.160.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:5df6d4768d7a2d0bd82cd8704c2732cf80fd13089217a3b0ff7b330b59eb50c6", size = 599306, upload-time = "2026-07-22T14:11:09.704Z" }, + { url = "https://files.pythonhosted.org/packages/cb/10/01a5545d22d61320e5d9507a252cef37a138af97d5c17bcad8ea08bfa936/hypothesis-6.160.0-cp314-cp314-win_amd64.whl", hash = "sha256:bdafeab25029d1261786f68ce7aedaa5c0be3ad4accfb13b32ff206ef6dfaa40", size = 655149, upload-time = "2026-07-22T14:11:12.9Z" }, + { url = "https://files.pythonhosted.org/packages/91/d7/b170ae2dfeea3bc0edb99f361ccd725ce00120ddd2065590ed4281ffd29d/hypothesis-6.160.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:285f6763461d58ef1b9b75efd69b559ba3b91055c7c6fb34b1513b3666106a62", size = 766374, upload-time = "2026-07-22T14:10:37.579Z" }, + { url = "https://files.pythonhosted.org/packages/85/30/64e3ca8d5132688bed13bf0c35b4cb1061975f7bba9201c718c394b14fbb/hypothesis-6.160.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d7cefc720eaf6d80f4ee0be59a12e301f3d16a5941fdbefe11295ca7e567b0c2", size = 757876, upload-time = "2026-07-22T14:11:27.033Z" }, + { url = "https://files.pythonhosted.org/packages/25/a2/219da3305b412dc265be7ecdd846882ff4e399f84896ff561982bb9be0d3/hypothesis-6.160.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ec6ff81bace8494b12b6c2096e8fb18a769e861613a02138700a2cb5e4c1ccd", size = 1088723, upload-time = "2026-07-22T14:10:48.385Z" }, + { url = "https://files.pythonhosted.org/packages/8a/29/c1879c3a25f3069b1102d17bf2b6f6a7c0667128f1fb2efb2e9964bc17c1/hypothesis-6.160.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1c32bed39ecff19f68e37fef7ee4bcd1d13a82378fcd321b61d0cd2f1a360c8", size = 1138696, upload-time = "2026-07-22T14:10:52.712Z" }, + { url = "https://files.pythonhosted.org/packages/b6/15/16239bfc9aad85aa0a0166f61b8aa4eddc69ee57b0c68188f191f4ef0b00/hypothesis-6.160.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8d04e56812e135c3223cd06cd0016f61466ce7c56720167046d91123534240f5", size = 1261184, upload-time = "2026-07-22T14:10:43.241Z" }, + { url = "https://files.pythonhosted.org/packages/7d/b8/aa6f06d42d1505b2dab0f82d133d84853391437f34a15c4c39cbcda04f6a/hypothesis-6.160.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c18c5eb6260bda6e56689429723d5b62b62cedee88c95de03976799645c9b0ce", size = 1305573, upload-time = "2026-07-22T14:10:51.193Z" }, + { url = "https://files.pythonhosted.org/packages/44/13/645f8c95070a21fa1257f0d4cf68b938d7ec60e8371d79402ce7cb50d3c9/hypothesis-6.160.0-cp314-cp314t-win_amd64.whl", hash = "sha256:deabcb5645076988ac52237a7c3ee8fca2fbd4f859461537374911fbe0e99817", size = 655308, upload-time = "2026-07-22T14:10:38.969Z" }, ] [[package]] @@ -1213,62 +1253,64 @@ wheels = [ [[package]] name = "librt" -version = "0.11.0" +version = "0.13.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/40/08/9e7f6b5d2b5bed6ad055cdd5925f192bb403a51280f86b56554d9d0699a2/librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1", size = 200139, upload-time = "2026-05-10T18:17:25.138Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/8b/d0/07c77e067f0838949b43bd89232c29d72efebb9d2801a9750184eb706b71/librt-0.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b87504f1690a23b9a2cca841191a04f83895d4fc2dd04df91d82b1a04ca2ad46", size = 144147, upload-time = "2026-05-10T18:15:53.227Z" }, - { url = "https://files.pythonhosted.org/packages/7a/24/8493538fa4f62f982686398a5b8f68008138a75086abdea19ade64bf4255/librt-0.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40071fc5fe0ce8daa6de616702314a01e1250711682b0523d6ab8d4525910cb3", size = 143614, upload-time = "2026-05-10T18:15:54.657Z" }, - { url = "https://files.pythonhosted.org/packages/ff/1e/f8bad050810d9171f34a1648ed910e56814c2ba61639f2bd53c6377ae24b/librt-0.11.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:137e79445c896a0ea7b265f52d23954e05b64222ee1af69e2cb34219067cbb67", size = 485538, upload-time = "2026-05-10T18:15:56.117Z" }, - { url = "https://files.pythonhosted.org/packages/c0/fe/3594ebfbaf03084ba4b120c9ba5c3183fd938a48725e9bbe6ff0a5159ad8/librt-0.11.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:cca6644054e78746d8d4ef238681f9c34ff8b584fe6b988ecebb8db3b15e622a", size = 479623, upload-time = "2026-05-10T18:15:57.544Z" }, - { url = "https://files.pythonhosted.org/packages/b0/da/5d1876984b3746c85dbd219dbfcb73c85f54ee263fd32e5b2a632ec14571/librt-0.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d5b0eea49f5562861ee8d757a32ef7d559c1d35be2aaaa1ec28941d74c9ffc8a", size = 513082, upload-time = "2026-05-10T18:15:58.805Z" }, - { url = "https://files.pythonhosted.org/packages/19/6e/55bdf5d5ca00c3e18430690bf2c953d8d3ffd3c337418173d33dec985dc9/librt-0.11.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0d1029d7e1ae1a7e647ed6fb5df8c4ce2dffefb7a9f5fd1376a4554d96dac09f", size = 508105, upload-time = "2026-05-10T18:16:00.2Z" }, - { url = "https://files.pythonhosted.org/packages/07/10/f1f23a7c595ee90ece4d35c851e5d104b1311a887ed1b4ac4c35bbd13da8/librt-0.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:bc3ce6b33c5828d9e80592011a5c584cb2ce86edbc4088405f70da47dc1d1b3b", size = 522268, upload-time = "2026-05-10T18:16:01.708Z" }, - { url = "https://files.pythonhosted.org/packages/b6/02/5720f5697a7f54b78b3aefbe20df3a48cedcff1276618c4aa481177942ed/librt-0.11.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:936c5995f3514a42111f20099397d8177c79b4d7e70961e396c6f5a0a3566766", size = 527348, upload-time = "2026-05-10T18:16:03.496Z" }, - { url = "https://files.pythonhosted.org/packages/50/db/b4a47c6f91db4ff76348a0b3dd0cc65e090a078b765a810a62ff9434c3d3/librt-0.11.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:9bc0ca6ad9381cbe8e4aa6e5726e4c80c78115a6e9723c599ed1d73e092bc49d", size = 516294, upload-time = "2026-05-10T18:16:05.173Z" }, - { url = "https://files.pythonhosted.org/packages/9e/58/9384b2f4eb1ed1d273d40948a7c5c4b2360213b402ef3be4641c06299f9c/librt-0.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:070aa8c26c0a74774317a72df8851facc7f0f012a5b406557ac56992d92e1ec8", size = 553608, upload-time = "2026-05-10T18:16:06.839Z" }, - { url = "https://files.pythonhosted.org/packages/21/7b/5aa8848a7c6a9278c79375146da1812e695754ceec5f005e6043461a7315/librt-0.11.0-cp312-cp312-win32.whl", hash = "sha256:6bf14feb84b05ae945277395451998c89c54d0def4070eb5c08de544930b245a", size = 101879, upload-time = "2026-05-10T18:16:08.103Z" }, - { url = "https://files.pythonhosted.org/packages/37/33/8a745436944947575b584231750a41417de1a38cf6a2e9251d1065651c09/librt-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:75672f0bc524ede266287d532d7923dbce94c7514ad07627bac3d0c6d92cc4d9", size = 119831, upload-time = "2026-05-10T18:16:09.174Z" }, - { url = "https://files.pythonhosted.org/packages/59/67/a6739ac96e28b7855808bdb0370e250606104a859750d209e5a0716fe7ab/librt-0.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:2f10cf143e4a9bb0f4f5af568a00df94a2d69ef41c2579584454bb0fe5cc642c", size = 103470, upload-time = "2026-05-10T18:16:10.369Z" }, - { url = "https://files.pythonhosted.org/packages/82/61/e59168d4d0bf2bf90f4f0caf7a001bfc60254c3af4586013b04dc3ef517b/librt-0.11.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:78dc31f7fdfe9c9d0eb0e8f42d139db230e826415bbcabd9f0e9faaaee909894", size = 144119, upload-time = "2026-05-10T18:16:11.771Z" }, - { url = "https://files.pythonhosted.org/packages/61/fd/caa1d60b12f7dd79ccea23054e06eeaebe266a5f52c40a6b651069200ce5/librt-0.11.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:fa475675db22290c3158e1d42326d0f5a65f04f44a0e68c3630a25b53560fb9c", size = 143565, upload-time = "2026-05-10T18:16:13.334Z" }, - { url = "https://files.pythonhosted.org/packages/b8/a9/dc744f5c2b4978d48db970be29f22716d3413d28b14ad99740817315cf2c/librt-0.11.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:621db29691044bdeda22e789e482e1b0f3a985d90e3426c9c6d17606416205ea", size = 485395, upload-time = "2026-05-10T18:16:14.729Z" }, - { url = "https://files.pythonhosted.org/packages/8f/21/7f8e97a1e4dae952a5a95948f6f8507a173bc1e669f54340bba6ca1ca31b/librt-0.11.0-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:a9010e2ed5b3a9e158c5fd966b3ab7e834bb3d3aacc8f66c91dd4b57a3799230", size = 479383, upload-time = "2026-05-10T18:16:16.321Z" }, - { url = "https://files.pythonhosted.org/packages/a6/6d/d8ee9c114bebf2c50e29ec2aa940826fccb62a645c3e4c18760987d0e16d/librt-0.11.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7c39513d8b7477a2e1ed8c43fc21c524e8d5a0f8d4e8b7b074dbdbe7820a08e2", size = 513010, upload-time = "2026-05-10T18:16:17.647Z" }, - { url = "https://files.pythonhosted.org/packages/f0/43/0b5708af2bd30a46400e72ba6bdaa8f066f15fb9a688527e34220e8d6c06/librt-0.11.0-cp313-cp313-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7aef3cf1d5af86e770ab04bfd993dfc4ae8b8c17f66fb77dd4a7d50de7bbb1a3", size = 508433, upload-time = "2026-05-10T18:16:19.309Z" }, - { url = "https://files.pythonhosted.org/packages/4a/50/356187247d09013490481033183b3532b58acf8028bcb34b2b56a375c9b2/librt-0.11.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:557183ddc36babe46b27dd60facbd5adb4492181a5be887587d57cda6e092f21", size = 522595, upload-time = "2026-05-10T18:16:20.642Z" }, - { url = "https://files.pythonhosted.org/packages/40/e7/c6ac4240899c7f3248079d5a9900debe0dadb3fdeaf856684c987105ba47/librt-0.11.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:83d3e1f72bd42f6c5c0b7daec530c3f829bd02db42c70b8ddf0c2d90a2459930", size = 527255, upload-time = "2026-05-10T18:16:22.352Z" }, - { url = "https://files.pythonhosted.org/packages/eb/b5/a81322dbeedeeaf9c1ee6f001734d28a09d8383ac9e6779bc24bbd0743c6/librt-0.11.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:4ce1f21fbe589bc1afd7872dece84fb0e1144f794a288e58a10d2c54a55c43be", size = 516847, upload-time = "2026-05-10T18:16:23.627Z" }, - { url = "https://files.pythonhosted.org/packages/ae/66/6e6323787d592b55204a42595ff1102da5115601b53a7e9ddebc889a6da5/librt-0.11.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:970b09f7044ea2b64c9da42fd3d335666518cfd1c6e8a182c95da73d0214b41e", size = 553920, upload-time = "2026-05-10T18:16:25.025Z" }, - { url = "https://files.pythonhosted.org/packages/9c/21/623f8ca230857102066d9ca8c6c1734995908c4d0d1bee7bb2ef0021cb33/librt-0.11.0-cp313-cp313-win32.whl", hash = "sha256:78fddc31cd4d3caa897ad5d31f856b1faadc9474021ad6cb182b9018793e254e", size = 101898, upload-time = "2026-05-10T18:16:26.649Z" }, - { url = "https://files.pythonhosted.org/packages/b3/1d/b4ebd44dd723f768469007515cb92251e0ae286c94c140f374801140fa74/librt-0.11.0-cp313-cp313-win_amd64.whl", hash = "sha256:8ca8aa88751a775870b764e93bad5135385f563cb8dcee399abf034ea4d3cb47", size = 119812, upload-time = "2026-05-10T18:16:27.859Z" }, - { url = "https://files.pythonhosted.org/packages/3b/e4/b2f4ca7965ca373b491cdb4bc25cdb30c1649ca81a8782056a83850292a9/librt-0.11.0-cp313-cp313-win_arm64.whl", hash = "sha256:96f044bb325fd9cf1a723015638c219e9143f0dfbc0ca54c565df2b7fc748b44", size = 103448, upload-time = "2026-05-10T18:16:29.066Z" }, - { url = "https://files.pythonhosted.org/packages/29/eb/dbce197da4e227779e56b5735f2decc3eb36e55a1cdbf1bd65d6639d76c1/librt-0.11.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:4a017a95e5837dc15a8c5661d60e05daa96b90908b1aa6b7acdf443cd25c8ebd", size = 143345, upload-time = "2026-05-10T18:16:30.674Z" }, - { url = "https://files.pythonhosted.org/packages/76/a3/254bebd0c11c8ba684018efb8006ff22e466abce445215cca6c778e7d9de/librt-0.11.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:b1ecbd9819deccc39b7542bf4d2a740d8a620694d39989e58661d3763458f8d4", size = 143131, upload-time = "2026-05-10T18:16:32.037Z" }, - { url = "https://files.pythonhosted.org/packages/f1/3f/f77d6122d21ac7bf6ae8a7dfced1bd2a7ac545d3273ebdcaf8042f6d619f/librt-0.11.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7da327dacd7be8f8ec36547373550744a3cc0e536d54665cd83f8bcd961200e8", size = 477024, upload-time = "2026-05-10T18:16:33.493Z" }, - { url = "https://files.pythonhosted.org/packages/ac/0a/2c996dadebaa7d9bbbd43ef2d4f3e66b6da545f838a41694ef6172cebec8/librt-0.11.0-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:0dc56b1f8d06e60db362cc3fdae206681817f86ce4725d34511473487f12a34b", size = 474221, upload-time = "2026-05-10T18:16:34.864Z" }, - { url = "https://files.pythonhosted.org/packages/0a/7e/f5d92af8486b8272c23b3e686b46ff72d89c8169585eb61eef01a2ac7147/librt-0.11.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:05fb8fb2ab90e21c8d12ea240d744ad514da9baf381ebfa70d91d20d21713175", size = 505174, upload-time = "2026-05-10T18:16:36.705Z" }, - { url = "https://files.pythonhosted.org/packages/af/1a/cb0734fe86398eb33193ab753b7326255c74cac5eb09e76b9b16536e7adb/librt-0.11.0-cp314-cp314-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cae74872be221df4374d10fec61f93ed1513b9546ea84f2c0bf73ab3e9bd0b03", size = 497216, upload-time = "2026-05-10T18:16:38.418Z" }, - { url = "https://files.pythonhosted.org/packages/18/06/094820f91558b66e29943c0ec41c9914f460f48dd51fc503c3101e10842d/librt-0.11.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:32bcc918c0148eb7e3d57385125bac7e5f9e4359d05f07448b09f6f778c2f31c", size = 513921, upload-time = "2026-05-10T18:16:39.848Z" }, - { url = "https://files.pythonhosted.org/packages/0b/c2/00de9018871a282f530cacb457d5ec0428f6ac7e6fedde9aff7468d9fb04/librt-0.11.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:f9743fc99135d5f78d2454435615f6dec0473ca507c26ce9d92b10b562a280d3", size = 520850, upload-time = "2026-05-10T18:16:41.471Z" }, - { url = "https://files.pythonhosted.org/packages/51/9d/64631832348fd1834fb3a61b996434edddaaf25a31d03b0a76273159d2cf/librt-0.11.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:5ba067f4aadae8fda802d91d2124c90c42195ff32d9161d3549e6d05cfe26f96", size = 504237, upload-time = "2026-05-10T18:16:43.15Z" }, - { url = "https://files.pythonhosted.org/packages/a5/ec/ae5525eb16edc827a044e7bb8777a455ff95d4bca9379e7e6bddd7383647/librt-0.11.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:de3bf945454d032f9e390b85c4072e0a0570bf825421c8be0e71209fa65e1abe", size = 546261, upload-time = "2026-05-10T18:16:44.408Z" }, - { url = "https://files.pythonhosted.org/packages/5a/09/adce371f27ca039411da9659f7430fcc2ba6cd0c7b3e4467a0f091be7fa9/librt-0.11.0-cp314-cp314-win32.whl", hash = "sha256:d2277a05f6dcb9fd13db9566aac4fabd68c3ea1ea46ee5567d4eef8efa495a2f", size = 96965, upload-time = "2026-05-10T18:16:46.039Z" }, - { url = "https://files.pythonhosted.org/packages/d6/ee/8ac720d98548f173c7ce2e632a7ca94673f74cacd5c8162a84af5b35958a/librt-0.11.0-cp314-cp314-win_amd64.whl", hash = "sha256:ab73e8db5e3f564d812c1f5c3a175930a5f9bc96ccb5e3b22a34d7858b401cf7", size = 115151, upload-time = "2026-05-10T18:16:47.133Z" }, - { url = "https://files.pythonhosted.org/packages/94/20/c900cf14efeb09b6bef2b2dff20779f73464b97fd58d1c6bccc379588ae3/librt-0.11.0-cp314-cp314-win_arm64.whl", hash = "sha256:aea3caa317752e3a466fa8af45d91ee0ea8c7fdd96e42b0a8dd9b76a7931eba1", size = 98850, upload-time = "2026-05-10T18:16:48.597Z" }, - { url = "https://files.pythonhosted.org/packages/0c/71/944bfe4b64e12abffcd3c15e1cce07f72f3d55655083786285f4dedeb532/librt-0.11.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:d1b36540d7aaf9b9101b3a6f376c8d8e9f7a9aec93ed05918f2c69d493ffef72", size = 151138, upload-time = "2026-05-10T18:16:49.839Z" }, - { url = "https://files.pythonhosted.org/packages/b6/10/99e64a5c86989357fda078c8143c533389585f6473b7439172dd8f3b3b2d/librt-0.11.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:efbb343ab2ce3540f4ecbe6315d677ed70f37cd9a72b1e58066c918ca83acbaa", size = 151976, upload-time = "2026-05-10T18:16:51.062Z" }, - { url = "https://files.pythonhosted.org/packages/21/31/5072ad880946d83e5ea4147d6d018c78eefce85b77819b19bdd0ee229435/librt-0.11.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa0dd688aab3f7914d3e6e5e3554978e0383312fb8e771d84be008a35b9ee548", size = 557927, upload-time = "2026-05-10T18:16:52.632Z" }, - { url = "https://files.pythonhosted.org/packages/5e/8d/70b5fb7cfbab60edbe7381614ab985da58e144fbf465c86d44c95f43cdca/librt-0.11.0-cp314-cp314t-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:f5fb36b8c6c63fdcbb1d526d94c0d1331610d43f4118cc1beb4efef4f3faacb2", size = 539698, upload-time = "2026-05-10T18:16:53.934Z" }, - { url = "https://files.pythonhosted.org/packages/fa/a3/ba3495a0b3edbd24a4cae0d1d3c64f39a9fc45d06e812101289b50c1a619/librt-0.11.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4a9a237d13addb93715b6fee74023d5ee3469b53fce527626c0e088aa585805f", size = 577162, upload-time = "2026-05-10T18:16:55.589Z" }, - { url = "https://files.pythonhosted.org/packages/f7/db/36e25fb81f99937ff1b96612a1dc9fd66f039cb9cc3aee12c01fac31aab9/librt-0.11.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5ddd17bd87b2c56ddd60e546a7984a2e64c4e8eab92fb4cf3830a48ad5469d51", size = 566494, upload-time = "2026-05-10T18:16:56.975Z" }, - { url = "https://files.pythonhosted.org/packages/33/0d/3f622b47f0b013eeb9cf4cc07ae9bfe378d832a4eec998b2b209fe84244d/librt-0.11.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bd43992b4473d42f12ff9e68326079f0696d9d4e6000e8f39a0238d482ba6ee2", size = 596858, upload-time = "2026-05-10T18:16:58.374Z" }, - { url = "https://files.pythonhosted.org/packages/a9/02/71b90bc93039c46a2000651f6ad60122b114c8f54c4ad306e0e96f5b75ad/librt-0.11.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:f8e3e8056dd674e279741485e2e512d6e9a751c7455809d0114e6ebf8d781085", size = 590318, upload-time = "2026-05-10T18:16:59.676Z" }, - { url = "https://files.pythonhosted.org/packages/04/04/418cb3f75621e2b761fb1ab0f017f4d70a1a72a6e7c74ee4f7e8d198c2f3/librt-0.11.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:c1f708d8ae9c56cf38a903c44297243d2ec83fd82b396b977e0144a3e76217e3", size = 575115, upload-time = "2026-05-10T18:17:01.007Z" }, - { url = "https://files.pythonhosted.org/packages/cc/2c/5a2183ac58dd911f26b5d7e7d7d8f1d87fcecdddd99d6c12169a258ff62c/librt-0.11.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0add982e0e7b9fc14cf4b33789d5f13f66581889b88c2f58099f6ce8f92617bd", size = 617918, upload-time = "2026-05-10T18:17:02.682Z" }, - { url = "https://files.pythonhosted.org/packages/15/1f/dc6771a52592a4451be6effa200cbfc9cec61e4393d3033d81a9d307961d/librt-0.11.0-cp314-cp314t-win32.whl", hash = "sha256:2b481d846ac894c4e8403c5fd0e87c5d11d6499e404b474602508a224ff531c8", size = 103562, upload-time = "2026-05-10T18:17:03.99Z" }, - { url = "https://files.pythonhosted.org/packages/62/4a/7d1415567027286a75ba1093ec4aca11f073e0f559c530cf3e0a757ad55c/librt-0.11.0-cp314-cp314t-win_amd64.whl", hash = "sha256:28edb433edde181112a908c78907af28f964eabc15f4dd16c9d66c834302677c", size = 124327, upload-time = "2026-05-10T18:17:05.465Z" }, - { url = "https://files.pythonhosted.org/packages/ce/62/b40b382fa0c66fee1478073eb8db352a4a6beda4a1adccf1df911d8c289c/librt-0.11.0-cp314-cp314t-win_arm64.whl", hash = "sha256:dee008f20b542e3cd162ba338a7f9ec0f6d23d395f66fe8aeeec3c9d067ea253", size = 102572, upload-time = "2026-05-10T18:17:06.809Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/dc/2f/3908645ddddab7120b46295e541ead308109fa48dbec7d67d7a778870d60/librt-0.13.0.tar.gz", hash = "sha256:1d2a610c14ac0d0750ee0a3ab8548e83155258387891caaca04def4bf7289781", size = 211402, upload-time = "2026-07-08T12:26:29.834Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f0/f4/b2933ddae222dac338476abb872641169a5cfed2c2bb5444a5b07b32b0c3/librt-0.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:30536798f4504c0fad0885b1d371b0539abb081e4570c9d7c641cb51141b49f0", size = 150990, upload-time = "2026-07-08T12:25:02.42Z" }, + { url = "https://files.pythonhosted.org/packages/90/ef/db98f744ca50e6efc9c95c70ee49b77aefac31f6a3fc7c83754a42d6a74f/librt-0.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:93d24ebb82aa4420b1409c389e7857bc35bd0b668007ac8172427d5c73cc8cc5", size = 155238, upload-time = "2026-07-08T12:25:03.681Z" }, + { url = "https://files.pythonhosted.org/packages/03/e7/a197e7bc72baf2c61ce7fdc6906a5054dc05bd8da0819aa894e4857bf87e/librt-0.13.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cb8a1adce42d8b75485a5d56a9623a50bcab995b6079f1dac59fc44034dd93d9", size = 503073, upload-time = "2026-07-08T12:25:05.049Z" }, + { url = "https://files.pythonhosted.org/packages/f8/e7/7887712e27da7c1ab80fcabb1de6eb24243964f6557cae530d4b70706dbd/librt-0.13.0-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:0763ca2ab66058174f9dee426dc64f5e0a89c24a7df8d3fe3f1836c04e25de4b", size = 496528, upload-time = "2026-07-08T12:25:06.26Z" }, + { url = "https://files.pythonhosted.org/packages/94/f0/f2283385bb6b950b26a1410f4ce51ec27231e0b3a4b925c46366d218b198/librt-0.13.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b222493da6e7b6199db9bd79502436cf5a27da3c1f7fa83c7e285444fc93fd03", size = 531786, upload-time = "2026-07-08T12:25:07.658Z" }, + { url = "https://files.pythonhosted.org/packages/36/11/69ac3b54766ffba5fd7e5acebfb048d66dbe1f9f2d14516c2b3edc59cf87/librt-0.13.0-cp312-cp312-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:fadc63331f4388c3dc90090448f682a7e9feafc11481391c1e94f2f907a3976e", size = 524393, upload-time = "2026-07-08T12:25:09.121Z" }, + { url = "https://files.pythonhosted.org/packages/61/5f/d72f95fd444a926a3c14b4e24979474116988dd57a45be242077c45d3c22/librt-0.13.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:70d9c62a4cffd9f23396cd5ef93fc5d11b31596b9b7d6306074abe3d5fcf09bd", size = 543026, upload-time = "2026-07-08T12:25:10.459Z" }, + { url = "https://files.pythonhosted.org/packages/c4/08/dcd9993ad192737a004ba263d549f8ea605b326b952e7d6205c7d4170b76/librt-0.13.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:66c0e7e6b02a155576df2c77ec933a70b72da726e248c494abf690923e624348", size = 546829, upload-time = "2026-07-08T12:25:11.716Z" }, + { url = "https://files.pythonhosted.org/packages/96/d5/6d9bb2f54e4109a956b7128836529653eb9d740f784bc47ed10a02c1000e/librt-0.13.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:ac04bcd3328eb91d99dfedf6a60d9c1f15d3434e6f6daf922f0420f7d90b85c7", size = 535700, upload-time = "2026-07-08T12:25:13.144Z" }, + { url = "https://files.pythonhosted.org/packages/8c/f2/10946922503858a359492fa27f13e86228bde702116a740ac7b3cd185f24/librt-0.13.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:db327e7271e653c32040b85ae6188059c924b57d7e1e29f935523fa017cd4e82", size = 573566, upload-time = "2026-07-08T12:25:14.336Z" }, + { url = "https://files.pythonhosted.org/packages/48/a8/94f00e3c99479a18088af3685ea016c42f3c7d5d1964d8dbb40c08d7f1aa/librt-0.13.0-cp312-cp312-win32.whl", hash = "sha256:860bd1d8ba48456ce08feaf8d343a8aaeb2fa086f2bcaa2a923fa3f7a3ff9aa3", size = 106099, upload-time = "2026-07-08T12:25:16.159Z" }, + { url = "https://files.pythonhosted.org/packages/c9/7b/2da9c74c1ed25a89cc4e1c8e007ea2eb4a0f1fafa3e70d757fe3242c5c5c/librt-0.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:e54a315caf843c8d77e388cadc56ea9ded569935ee2d2347d7ea94992e5aa6fa", size = 126934, upload-time = "2026-07-08T12:25:17.275Z" }, + { url = "https://files.pythonhosted.org/packages/d0/65/aead61bbf3b5358593f9d4779d2a0e88eaf6ec191a6342dde36dd1df6371/librt-0.13.0-cp312-cp312-win_arm64.whl", hash = "sha256:c718e99a0992127af84385378460db624103b559ab260435abcfe77a4e4ed1c1", size = 112236, upload-time = "2026-07-08T12:25:18.425Z" }, + { url = "https://files.pythonhosted.org/packages/67/3b/18e7b63255297a2bdc9c25c8d6d4ca8eca9f63aceb1252c0f7427ac7099e/librt-0.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a468951af16155824e88bdd8326ebe5bdb371f3ec0ac04642994b98201d914f3", size = 151027, upload-time = "2026-07-08T12:25:19.638Z" }, + { url = "https://files.pythonhosted.org/packages/4d/68/e2248452c00d1a03b45fee1752cdc8f790a476efd2402b75181da88a9e61/librt-0.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:ae01d8512cc17079e53425635327dbf3f7ff57a42c00dec348bf79791c56444c", size = 155152, upload-time = "2026-07-08T12:25:20.851Z" }, + { url = "https://files.pythonhosted.org/packages/0e/16/52b1c99bf19057a062aac39c900cbb81499f6f75d6c537c14463d247ba78/librt-0.13.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:32c26893cd085c1efe83219e78d866da23fb20a066101b8f68210004361d224c", size = 502499, upload-time = "2026-07-08T12:25:22.055Z" }, + { url = "https://files.pythonhosted.org/packages/9f/54/b811151805c795f55e0dedee6ec687b75f9982a8105d240ea3910737a77b/librt-0.13.0-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:5929da1981a46bcf4b28b1b9499905f0ff58e2419da402a048234e9783acbc4b", size = 496108, upload-time = "2026-07-08T12:25:23.296Z" }, + { url = "https://files.pythonhosted.org/packages/8f/f8/094d6b2bd93f3fdaa54db54cc788c4a365333bddad65ab02e04da0b1d004/librt-0.13.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:94b85d664d777bab6c0d709416cb42938251fda9e221b79e3a2215d85df5f4f9", size = 531576, upload-time = "2026-07-08T12:25:24.648Z" }, + { url = "https://files.pythonhosted.org/packages/2e/40/541733d5755824f968f7ec39d78ffbd75d145964157ae5e69a09ec6d7326/librt-0.13.0-cp313-cp313-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:531b2df3e9fe96b1fcf73a6d165921e4656be5f58d631d384ebce344298368db", size = 524390, upload-time = "2026-07-08T12:25:25.898Z" }, + { url = "https://files.pythonhosted.org/packages/c6/b5/255673cfdbf5ba663339d36cd863c897289ab4337577e19f9405ce059f36/librt-0.13.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:109b84a9edf69ad89dc1f66358659e14a031baca95e3e5b0060bd903ede8efd6", size = 543053, upload-time = "2026-07-08T12:25:27.436Z" }, + { url = "https://files.pythonhosted.org/packages/9e/11/ab5005e9c9850710f21e354201bf090646349d3fabf5f951eaf70235729e/librt-0.13.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1304368a3e7ffc3e9db986796cc5326fdb5943a3567ecc137cff318e4240c0e7", size = 546387, upload-time = "2026-07-08T12:25:28.65Z" }, + { url = "https://files.pythonhosted.org/packages/a2/04/a5d7ce1d1df1afd15ca283dcdf7530ac073e12d69ae8c40879dda96f7868/librt-0.13.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:e4f9b472e7d308d94b62c801982065661158c6ed02790d6c7ddb4337cea0f9c1", size = 535970, upload-time = "2026-07-08T12:25:30.171Z" }, + { url = "https://files.pythonhosted.org/packages/5a/76/927e267a6daa290174ac281b23c9804c8829b042ade9c6f24a065f540958/librt-0.13.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9f836c37478f167a81200d8c8b2c920a22224564bed2c23d7aeec760965c367a", size = 573582, upload-time = "2026-07-08T12:25:31.507Z" }, + { url = "https://files.pythonhosted.org/packages/10/24/b6c5213efe39c19f9e13605644d0cf063b4ddaa33ac2e45b088e23a70e2e/librt-0.13.0-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:4000d961ff9598ac6ea603c6c836a5ed49bc205ade5fc378b998dfe1e2c36628", size = 82189, upload-time = "2026-07-08T12:25:32.675Z" }, + { url = "https://files.pythonhosted.org/packages/4c/00/d29736be177a906ac0b84a5b04b4fbfa22c776dc2f366de4172b0f968c08/librt-0.13.0-cp313-cp313-win32.whl", hash = "sha256:79e44cff71750d299d61a678e49995b0d5935a9cda238c2574daeca3ba536927", size = 106193, upload-time = "2026-07-08T12:25:33.692Z" }, + { url = "https://files.pythonhosted.org/packages/c8/ac/aff6fb45393cb8912f39dfb156ef6b2d1cadb207ff465fc8f66141054be8/librt-0.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:54dab44a847d5ad1acd05c8a83fe518ae685516ecf4d3f7cc6e3df2a66767650", size = 126962, upload-time = "2026-07-08T12:25:34.769Z" }, + { url = "https://files.pythonhosted.org/packages/d9/3a/d68cb2b334d53fd30fac81d3a489ce4ba0d9506f4df43fcf676b68352b19/librt-0.13.0-cp313-cp313-win_arm64.whl", hash = "sha256:d4cb6fbfdf874340ab5e51450753c0f817b6958a3621125ee695bbc3de866566", size = 112127, upload-time = "2026-07-08T12:25:35.981Z" }, + { url = "https://files.pythonhosted.org/packages/7b/66/f49ae0d592bd45b6941e9a8bafcb6a87cddcd501ee7874707e767f01b585/librt-0.13.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:25218d94b1d2cbc0ba1d8a3f9dc9af578d9646e5ed16443a70cde1dfdcce6d71", size = 149818, upload-time = "2026-07-08T12:25:37.203Z" }, + { url = "https://files.pythonhosted.org/packages/3d/50/51c76d74014d04fb95b6506d286808984b78a2f7a41039094e6b2194ac48/librt-0.13.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:f26629539d4893c2957a16c41bb058e1e135c1f150f6a2e25ed047f64cf3f5c6", size = 154071, upload-time = "2026-07-08T12:25:39.399Z" }, + { url = "https://files.pythonhosted.org/packages/b8/fe/f19b0f5f82d5a1f2da736586bc840abd00ce07d6388136ae80b7333883fc/librt-0.13.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a4517d47b2b8af26975a406fba7d314de9696d864252e0257c6ea90238cfe27f", size = 494168, upload-time = "2026-07-08T12:25:40.641Z" }, + { url = "https://files.pythonhosted.org/packages/94/bc/b8550c75775127fd31a5f20e8775997f7b527ad661fc8ddccd7497c064f7/librt-0.13.0-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:f19e181de5b3a1148bb3420b8c4b0b0ea0fce6950099724ad151d6cea5acc180", size = 491054, upload-time = "2026-07-08T12:25:41.905Z" }, + { url = "https://files.pythonhosted.org/packages/30/14/4d0204867623df3f33f86efd3d3692ba5e01321443f4d6eab35a22697618/librt-0.13.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:22034924f5b42d5a56371cf271771bfeaabf235a7a8b6264bef2d20013f786c6", size = 523006, upload-time = "2026-07-08T12:25:43.327Z" }, + { url = "https://files.pythonhosted.org/packages/19/0a/c45fc9a260934696bace1ac5df1e148ac92bd71767aee3bf7cd7a4534f4c/librt-0.13.0-cp314-cp314-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c7897db4e95e22468bdda33d8e012ceacd0182abf001e6389d763f0def6286b9", size = 515058, upload-time = "2026-07-08T12:25:44.541Z" }, + { url = "https://files.pythonhosted.org/packages/13/0a/50c5ce45b326854ef8fa6ae4c36cf5142e5c55315eaf9e51d0ae73ac4da3/librt-0.13.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:1ce61b3746545029d4f5c17d6bd74b676254ad98433086c846ffb5e8fa73f007", size = 534025, upload-time = "2026-07-08T12:25:45.825Z" }, + { url = "https://files.pythonhosted.org/packages/89/2d/08c413c8f93fc13b8103624fce38e5caa86cd08cbbc8465870ab287af54b/librt-0.13.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:46c330e82565962c761dbce7941be2cff7db674ee807455a8d0cadc5f9b759b0", size = 540557, upload-time = "2026-07-08T12:25:47.059Z" }, + { url = "https://files.pythonhosted.org/packages/b3/c1/93af71fb4a364952210051811dd4e40174e79656b050c89cacac18af3330/librt-0.13.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:375f5af8f99cbaa99dd293af986e3d57caabc9ba81a5d3f021603764854197a1", size = 523201, upload-time = "2026-07-08T12:25:48.392Z" }, + { url = "https://files.pythonhosted.org/packages/c1/6e/9766f07b676a4889d9f8bc2864e9ba5fff165653143ef4dda7df6aa34d16/librt-0.13.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:9320d34c3376ae204b2cd176e8d4883a013934e0aef822f1aed9c536490c275d", size = 565740, upload-time = "2026-07-08T12:25:49.678Z" }, + { url = "https://files.pythonhosted.org/packages/a2/1e/664e3472ce2b6e10e9b83f29d4a36eb982ff6b5a169ae7567bba3a4c4ff5/librt-0.13.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:9af313c66157a69dc69ea0059a66961692250e0dc95af9c385a48ffb770a0d16", size = 81611, upload-time = "2026-07-08T12:25:50.857Z" }, + { url = "https://files.pythonhosted.org/packages/2f/d4/8582a4d65e2234673685e07309d02c230b28a85724eb0acbf13f019b7f6e/librt-0.13.0-cp314-cp314-win32.whl", hash = "sha256:f2a7253458e34f33543551394ae4fe104b497ec2a65ac266074de64c1df82e37", size = 100106, upload-time = "2026-07-08T12:25:52.03Z" }, + { url = "https://files.pythonhosted.org/packages/63/ce/0cb99efe6086b46cd985dc26672166fae312a239690e75871f7fafbd3fc5/librt-0.13.0-cp314-cp314-win_amd64.whl", hash = "sha256:a3dfe4edf10e8ed7e55b026a8bfc2c2a8704218b659cd4bffdf604fab966dc39", size = 121209, upload-time = "2026-07-08T12:25:53.166Z" }, + { url = "https://files.pythonhosted.org/packages/26/85/4f3ccb083a3c9b0d42e223acdb3c3f507953324a59cdcab4826e8e2e3b89/librt-0.13.0-cp314-cp314-win_arm64.whl", hash = "sha256:68a5faee4bba381cb93b5961f684a514cf0053cb92308ff9c792c2fea0b174c6", size = 106404, upload-time = "2026-07-08T12:25:54.253Z" }, + { url = "https://files.pythonhosted.org/packages/b2/77/333191499538c8e8189de7a4cba8e6f49ee949fd6d6e6324b21fd1522466/librt-0.13.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:a38fb81d8376dfa2f8963b265fec07637802b0d01e2a127c19c66cb070fb24f5", size = 159231, upload-time = "2026-07-08T12:25:55.432Z" }, + { url = "https://files.pythonhosted.org/packages/7a/9e/2aa83758f22c278b837a1d8025898434ce2b8bff36678d5330ecaef56dff/librt-0.13.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d4c8d9bd5abce34b2e75edb3bf37ab0f34e49b1f915a40ae8468eb7c85bc5b46", size = 161300, upload-time = "2026-07-08T12:25:56.585Z" }, + { url = "https://files.pythonhosted.org/packages/bb/c0/86791e936553ca763d6b3c2fb4d31d596cd00e14fa631c283a40ba01559a/librt-0.13.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:387e2f1d27e89bffe0d3f520f0da0662c973fd607ca16c1808f8a5085419485e", size = 582056, upload-time = "2026-07-08T12:25:58.144Z" }, + { url = "https://files.pythonhosted.org/packages/a8/d3/a9ec15984a185e000c4d2a16ba28bd623124ad4c38a10974c7ff78e3a893/librt-0.13.0-cp314-cp314t-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:4f6db193d2e5e0ed60359b9a5a682cd67205d0d3b1e459a867dd4b5c4e7eaa7a", size = 562758, upload-time = "2026-07-08T12:25:59.544Z" }, + { url = "https://files.pythonhosted.org/packages/3c/af/dbe36b78b19c06a55097f99305e4ea9458e2273e6ae16a3cbecaad7ee978/librt-0.13.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0d38604854e8d22faadf683ec6c02bb0f886e2ba56ef981a1c36ee275f21ea22", size = 602095, upload-time = "2026-07-08T12:26:00.991Z" }, + { url = "https://files.pythonhosted.org/packages/2a/a8/2966891b4dd2830f5203fbee92ac2c4947653a2390ba73dfa44244fad025/librt-0.13.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:371f7ce73026815dafd51c50ce38416e91428b28c4b2ec97cd39271164b0045c", size = 593452, upload-time = "2026-07-08T12:26:02.352Z" }, + { url = "https://files.pythonhosted.org/packages/61/f5/4df8bfc8405ecf8c0d525b4d69636f694bdd8620b313ec8b76e54a5926cc/librt-0.13.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:3aaedf52171bee90860704c560bc798fe83b76247df47568e0197e9b13c735a0", size = 623729, upload-time = "2026-07-08T12:26:04.294Z" }, + { url = "https://files.pythonhosted.org/packages/d6/13/9ac202dffc8db06f75d06c08c2f9f6ff054be67d21272dcc078fa1cc0c57/librt-0.13.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:96bad8725a4f196a798366c25ce075d1f7543a4ec045ffc13e6a7ec095cdab04", size = 617077, upload-time = "2026-07-08T12:26:05.845Z" }, + { url = "https://files.pythonhosted.org/packages/6e/f0/ebe38610716aee5cb28efd95089bb90192096179802779381e1c5dcf239c/librt-0.13.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:6bf6a559ffe4a93bbea6cf31ddf01a7fd9ba342ef51f27beb178e318b74acd61", size = 599561, upload-time = "2026-07-08T12:26:07.21Z" }, + { url = "https://files.pythonhosted.org/packages/4f/5c/c2e72e236fff7abc716d5b1753b8b8cd3ea85ac46fe17d2e7c51d4e1c723/librt-0.13.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:301067672387902c55f94b51d5022304b36c966ea9fe1f21caab99a9bef487c9", size = 645511, upload-time = "2026-07-08T12:26:08.562Z" }, + { url = "https://files.pythonhosted.org/packages/0c/99/6203ce619dee940d6bfbe099ec3fe4be00a68e9d60f70abf906cf124fe66/librt-0.13.0-cp314-cp314t-win32.whl", hash = "sha256:5fdcf34f86de8fb66d7dc7589f96ba91c4aa46671200d400e6fd6f109a483f18", size = 104357, upload-time = "2026-07-08T12:26:09.828Z" }, + { url = "https://files.pythonhosted.org/packages/52/dd/843b6314087c41657c7036d7914d8f294bdf9b580aa8513ea0588c8e9a3d/librt-0.13.0-cp314-cp314t-win_amd64.whl", hash = "sha256:260c33e92263fa629b4f6d3c51967a1c2158fe6c33237aaa3ebeac586b085259", size = 126998, upload-time = "2026-07-08T12:26:10.975Z" }, + { url = "https://files.pythonhosted.org/packages/5f/5d/3dcec2884ba1b0806d1408612555c38dd5d68e90156b59f75f6e36435c3a/librt-0.13.0-cp314-cp314t-win_arm64.whl", hash = "sha256:2f281549a4c52ac7bb97997f14353f8bd0e53a34ca0dad1c905cfd0b4a58ae99", size = 110771, upload-time = "2026-07-08T12:26:12.303Z" }, ] [[package]] @@ -1282,14 +1324,14 @@ wheels = [ [[package]] name = "markdown-exec" -version = "1.12.1" +version = "1.12.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pymdown-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/96/73/1f20927d075c83c0e2bc814d3b8f9bd254d919069f78c5423224b4407944/markdown_exec-1.12.1.tar.gz", hash = "sha256:eee8ba0df99a5400092eeda80212ba3968f3cbbf3a33f86f1cd25161538e6534", size = 78105, upload-time = "2025-11-11T19:25:05.44Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6d/76/c47da8edb6a12b066728432fb3724109d9d91de5331df5073d12d272493f/markdown_exec-1.12.3.tar.gz", hash = "sha256:006b9cac46470a9499797bc9c579305ae4719e0a8e495e5401dfbf1e66ce7fb4", size = 77841, upload-time = "2026-07-07T09:53:13.838Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ea/22/7b684ddb01b423b79eaba9726954bbe559540d510abc7a72a84d8eee1b26/markdown_exec-1.12.1-py3-none-any.whl", hash = "sha256:a645dce411fee297f5b4a4169c245ec51e20061d5b71e225bef006e87f3e465f", size = 38046, upload-time = "2025-11-11T19:25:03.878Z" }, + { url = "https://files.pythonhosted.org/packages/ad/a7/0279016386d611183ccc508c5688eb1e2133e8182164d7a2c6213b176f69/markdown_exec-1.12.3-py3-none-any.whl", hash = "sha256:48ac12a565f3f4331b1acd9efc48a0773e717eb7ca7c38e23c1d72ee61660de6", size = 37995, upload-time = "2026-07-07T09:53:12.619Z" }, ] [package.optional-dependencies] @@ -1461,7 +1503,7 @@ wheels = [ [[package]] name = "mkdocs-material" -version = "9.7.6" +version = "9.7.7" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "babel" }, @@ -1476,9 +1518,9 @@ dependencies = [ { name = "pymdown-extensions" }, { name = "requests" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/45/29/6d2bcf41ae40802c4beda2432396fff97b8456fb496371d1bc7aad6512ec/mkdocs_material-9.7.6.tar.gz", hash = "sha256:00bdde50574f776d328b1862fe65daeaf581ec309bd150f7bff345a098c64a69", size = 4097959, upload-time = "2026-03-19T15:41:58.161Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f1/cd/c05d3a530ba7934f144fb45f7203cd236adc25c7bdcc34673d202f4b0278/mkdocs_material-9.7.7.tar.gz", hash = "sha256:c0649c065b1b0512d60aad8c10f947f8e455284475239b364b610f2deb4d0855", size = 4097923, upload-time = "2026-07-17T16:21:33.156Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2c/01/bc663630c510822c95c47a66af9fa7a443c295b47d5f041e5e6ae62ef659/mkdocs_material-9.7.6-py3-none-any.whl", hash = "sha256:71b84353921b8ea1ba84fe11c50912cc512da8fe0881038fcc9a0761c0e635ba", size = 9305470, upload-time = "2026-03-19T15:41:55.217Z" }, + { url = "https://files.pythonhosted.org/packages/ad/21/17c1bc9e6f47c972ad66fb2ac2568f99f90f1207eeb6fc3b34d094dba7b5/mkdocs_material-9.7.7-py3-none-any.whl", hash = "sha256:8ea9bb1737a5b524a5f9dcf2e1b4ebda8274ae3008aa7845720a97083bef708f", size = 9305438, upload-time = "2026-07-17T16:21:30.017Z" }, ] [package.optional-dependencies] @@ -1511,7 +1553,7 @@ wheels = [ [[package]] name = "mkdocstrings" -version = "1.0.4" +version = "1.0.6" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "jinja2" }, @@ -1521,9 +1563,9 @@ dependencies = [ { name = "mkdocs-autorefs" }, { name = "pymdown-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/1d/5d/f888d4d3eb31359b327bc9b17a212d6ef03fe0b0682fbb3fc2cb849fb12b/mkdocstrings-1.0.4.tar.gz", hash = "sha256:3969a6515b77db65fd097b53c1b7aa4ae840bd71a2ee62a6a3e89503446d7172", size = 100088, upload-time = "2026-04-15T09:16:53.376Z" } +sdist = { url = "https://files.pythonhosted.org/packages/53/71/f85bdf13355073ae15a7375f09879375a830553552e58c1c4b7e0bbc5c8b/mkdocstrings-1.0.6.tar.gz", hash = "sha256:a0b8c2bdd29a6416c80d717aa369bbf7831946bd9f23c2a66db1b1dbe7693dbd", size = 100649, upload-time = "2026-07-11T19:38:05.732Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/6e/94/be70f8ee9c45f2f62b39a1f0e9303bc20e138a8f3b8e50ffd89498e177e1/mkdocstrings-1.0.4-py3-none-any.whl", hash = "sha256:63464b4b29053514f32a1dbbf604e52876d5e638111b0c295ab7ed3cac73ca9b", size = 35560, upload-time = "2026-04-15T09:16:51.436Z" }, + { url = "https://files.pythonhosted.org/packages/5d/5b/4c1902e8bdd5c4db63284e9d101dece4038d4025d6d88850ffe0a1578980/mkdocstrings-1.0.6-py3-none-any.whl", hash = "sha256:2703708697487d1b6d6d7b412e176fa436edf120c1bf81dc9e126b12d00893c7", size = 35787, upload-time = "2026-07-11T19:38:04.417Z" }, ] [[package]] @@ -1742,7 +1784,7 @@ wheels = [ [[package]] name = "mypy" -version = "2.1.0" +version = "2.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "ast-serialize" }, @@ -1751,37 +1793,38 @@ dependencies = [ { name = "pathspec" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/82/15/cca9d88503549ed6fedeaa1d448cdddd542ee8a490232d732e278036fbf2/mypy-2.1.0.tar.gz", hash = "sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633", size = 3898359, upload-time = "2026-05-11T18:37:36.237Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/95/b1/55861beb5c339b44f9a2ba92df9e2cb1eeb4ae1eee674cdf7772c797778b/mypy-2.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:244358bf1c0da7722230bce60683d52e8e9fd030554926f15b747a84efb5b3af", size = 14874381, upload-time = "2026-05-11T18:37:31.784Z" }, - { url = "https://files.pythonhosted.org/packages/0b/b3/b7f770114b7d0ac92d0f76e8d93c2780844a70488a90e91821927850da86/mypy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4ec7c57657493c7a75534df2751c8ae2cda383c16ecc55d2106c54476b1b16f6", size = 13665501, upload-time = "2026-05-11T18:34:23.063Z" }, - { url = "https://files.pythonhosted.org/packages/b6/f3/8ae2037967e2126689a0c11d99e2b707134a565191e92c60ca2572aec60a/mypy-2.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d8161b6ff4392410023224f0969d17db93e1e154bc3e4ba62598e720723ae211", size = 14045750, upload-time = "2026-05-11T18:31:48.151Z" }, - { url = "https://files.pythonhosted.org/packages/a0/32/615eb5911859e43d054941b0d0a7d06cfa2870eba86529cf385b052b111c/mypy-2.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bf03e12003084a67395184d3eb8cbd6a489dc3655b5664b28c210a9e2403ab0b", size = 15061630, upload-time = "2026-05-11T18:37:06.898Z" }, - { url = "https://files.pythonhosted.org/packages/d4/03/4eafbfff8bfab1b87082741eae6e6a624028c984e6708b73bce2a8570c9d/mypy-2.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:20509760fd791c51579d573153407d226385ec1f8bcce55d730b354f3336bc22", size = 15288831, upload-time = "2026-05-11T18:31:18.07Z" }, - { url = "https://files.pythonhosted.org/packages/99/ee/919661478e5891a3c96e549c036e467e64563ab85995b10c53c8358e16a3/mypy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:6753d0c1fdd6b1a23b9e4f283ce80b2153b724adcb2653b20b85a8a28ac6436b", size = 11135228, upload-time = "2026-05-11T18:34:31.23Z" }, - { url = "https://files.pythonhosted.org/packages/24/0a/6a12b9782ca0831a553192f351679f4548abc9d19a7cc93bb7feb02084c7/mypy-2.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:98ebb6589bb3b6d0c6f0c459d53ca55b8091fbc13d277c4041c885392e8195e8", size = 10040684, upload-time = "2026-05-11T18:36:48.199Z" }, - { url = "https://files.pythonhosted.org/packages/6e/dd/c7191469c777f07689c032a8f7326e393ea34c92d6d76eb7ce5ba57ea66d/mypy-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:35aac3bb114e03888f535d5eb51b8bafbb3266586b599da1940f9b1be3ec5bd5", size = 14852174, upload-time = "2026-05-11T18:31:38.929Z" }, - { url = "https://files.pythonhosted.org/packages/55/8c/aed55408879043d72bb9135f4d0d19a02b886dd569631e113e3d2706cb8d/mypy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8de55a8c861f2a49331f807be98d90caeceeef520bde13d43a160207f8af613e", size = 13651542, upload-time = "2026-05-11T18:36:04.636Z" }, - { url = "https://files.pythonhosted.org/packages/3a/8e/f371a824b1f1fa8ea6e3dbb8703d232977d572be2329554a3bc4d960302f/mypy-2.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5fdf2941a07434af755837d9880f7d7d25f1dacb1af9dcd4b9b66f2220a3024e", size = 14033929, upload-time = "2026-05-11T18:35:55.742Z" }, - { url = "https://files.pythonhosted.org/packages/94/21/f54be870d6dd53a82c674407e0f8eed7174b05ec78d42e5abd7b42e84fd5/mypy-2.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e195b817c13f02352a9c124301f9f30f078405444679b6753c1b96b6eed37285", size = 15039200, upload-time = "2026-05-11T18:33:10.281Z" }, - { url = "https://files.pythonhosted.org/packages/17/99/bf21748626a40ce59fd29a39386ab46afec88b7bd2f0fa6c3a97c995523f/mypy-2.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5431d42af987ebd92ba2f71d45c85ed41d8e6ca9f5fd209a69f68f707d2469e5", size = 15272690, upload-time = "2026-05-11T18:32:07.205Z" }, - { url = "https://files.pythonhosted.org/packages/d6/d7/9e90d2cf47100bea550ed2bc7b0d4de3a62181d84d5e37da0003e8462637/mypy-2.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:767fe8c66dc3e01e19e1737d4c38ebefead16125e1b8e58ad421903b376f5c65", size = 11147435, upload-time = "2026-05-11T18:33:56.477Z" }, - { url = "https://files.pythonhosted.org/packages/ec/46/e5c449e858798e35ffc90946282a27c62a77be743fe17480e4977374eb91/mypy-2.1.0-cp313-cp313-win_arm64.whl", hash = "sha256:ecfe70d43775ab99562ab128ce49854a362044c9f894961f68f898c23cb7429d", size = 10035052, upload-time = "2026-05-11T18:32:30.049Z" }, - { url = "https://files.pythonhosted.org/packages/b0/ca/b279a672e874aedd5498ae25f722dacc8aa86bbffb939b3f97cbb1cf6686/mypy-2.1.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:7354c5a7f69d9345c3d6e69921d57088eea3ddeeb6b20d34c1b3855b02c36ec2", size = 14848422, upload-time = "2026-05-11T18:35:45.984Z" }, - { url = "https://files.pythonhosted.org/packages/27/e6/3efe56c631d959b9b4454e208b0ac4b7f4f58b404c89f8bec7b49efdfc21/mypy-2.1.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:49890d4f76ac9e06ec117f9e09f3174da70a620a0c300953d8595c926e80947f", size = 13677374, upload-time = "2026-05-11T18:36:57.188Z" }, - { url = "https://files.pythonhosted.org/packages/84/7f/8107ea87a44fd1f1b59882442f033c9c3488c127201b1d1d15f1cbd6022e/mypy-2.1.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:761be68e023ef5d94678772396a8af1220030f80837a3afd8d0aef3b419666f4", size = 14055743, upload-time = "2026-05-11T18:35:18.361Z" }, - { url = "https://files.pythonhosted.org/packages/51/4d/b6d34db183133b83761b9199a82d31557cdbb70a380d8c3b3438e11882a3/mypy-2.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c90345fc182dc363b891350457ec69c35140858538f38b4540845afcc32b1aef", size = 15020937, upload-time = "2026-05-11T18:34:59.618Z" }, - { url = "https://files.pythonhosted.org/packages/ff/d7/f08360c691d758acb02f45022c34d98b92892f4ea756644e1000d4b9f3d8/mypy-2.1.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b84802e7b5a6daf1f5e15bc9fcd7ddae77be13981ffab037f1c67bb84d67d135", size = 15253371, upload-time = "2026-05-11T18:36:41.081Z" }, - { url = "https://files.pythonhosted.org/packages/67/1b/09460a13719530a19bce27bd3bc8449e83569dd2ba7faf51c9c3c30c0b61/mypy-2.1.0-cp314-cp314-win_amd64.whl", hash = "sha256:022c771234936ceac541ebaf836fe9e2abeb3f5e09aff21588fe543ff006fe21", size = 11326429, upload-time = "2026-05-11T18:34:13.526Z" }, - { url = "https://files.pythonhosted.org/packages/40/62/75dbf0f82f7b6680340efc614af29dd0b3c17b8a4f1cd09b8bd2fd6bc814/mypy-2.1.0-cp314-cp314-win_arm64.whl", hash = "sha256:498207db725cec88829a6a5c2fc771205fd043719ef98bc49aba8fb9fc4e6d57", size = 10218799, upload-time = "2026-05-11T18:32:23.491Z" }, - { url = "https://files.pythonhosted.org/packages/b2/66/caca04ed7d972fb6eb6dd1ccd6df1de5c38fae8c5b3dc1c4e8e0d85ee6b9/mypy-2.1.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7d5e5cad0efeba72b93cd17490cc0d69c5ac9ca132994fe3fb0314808aeeb83e", size = 15923458, upload-time = "2026-05-11T18:35:28.64Z" }, - { url = "https://files.pythonhosted.org/packages/ed/52/2d90cbe49d014b13ed7ff337930c30bad35893fe38a1e4641e756bb62191/mypy-2.1.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ff715050c127d724fd260a2e666e7747fdd83511c0c47d449d98238970aef780", size = 14757697, upload-time = "2026-05-11T18:36:14.208Z" }, - { url = "https://files.pythonhosted.org/packages/ac/37/d98f4a14e081b238992d0ed96b6d39c7cc0148c9699eb71eaa68629665ea/mypy-2.1.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:82208da9e09414d520e912d3e462d454854bed0810b71540bb016dcbca7308fd", size = 15405638, upload-time = "2026-05-11T18:33:48.249Z" }, - { url = "https://files.pythonhosted.org/packages/a3/c2/15c46613b24a84fad2aea1248bf9619b99c2767ae9071fe224c179a0b7d4/mypy-2.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e79ebc1b904b84f0310dff7469655a9c36c7a68bddb37bdd42b67a332df61d08", size = 16215852, upload-time = "2026-05-11T18:32:50.296Z" }, - { url = "https://files.pythonhosted.org/packages/5c/90/9c16a57f482c76d25f6379762b56bbf65c711d8158cf271fb2802cfb0640/mypy-2.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:e583edc957cfb0deb142079162ae826f58449b116c1d442f2d91c69d9fced081", size = 16452695, upload-time = "2026-05-11T18:33:38.182Z" }, - { url = "https://files.pythonhosted.org/packages/0f/4c/215a4eeb63cacc5f17f516691ea7285d11e249802b942476bff15922a314/mypy-2.1.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b33b6cd332695bba180d55e717a79d3038e479a2c49cc5eb3d53603409b9a5d7", size = 12866622, upload-time = "2026-05-11T18:34:39.945Z" }, - { url = "https://files.pythonhosted.org/packages/4b/50/1043e1db5f455ffe4c9ab22747cd8ca2bc492b1e4f4e21b130a44ee2b217/mypy-2.1.0-cp314-cp314t-win_arm64.whl", hash = "sha256:4f910fe825376a7b66ef7ca8c98e5a149e8cd64c19ae71d84047a74ee060d4e6", size = 10610798, upload-time = "2026-05-11T18:36:31.444Z" }, - { url = "https://files.pythonhosted.org/packages/0d/2a/13ca1f292f6db1b98ff495ef3467736b331621c5917cad984b7043e7348d/mypy-2.1.0-py3-none-any.whl", hash = "sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289", size = 2693302, upload-time = "2026-05-11T18:31:29.246Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/12/af/4e516a05d3ca2eb9283e9ec45b2c02225c1514dd6da49fd3c9eaa6639370/mypy-2.3.0.tar.gz", hash = "sha256:465965d41cd9a2726694e983e8ce7113259327bec798115d1e1dfa2a52fb666e", size = 3988104, upload-time = "2026-07-13T11:34:53.387Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/94/0e7e592619e2133596a47cdd642534b0456545c218430bd3b9d8fefdd1b1/mypy-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2d53fc67b9d28a43c6199077f49fea0f05839e36cf6158500331c9549225e5a5", size = 15026523, upload-time = "2026-07-13T11:34:49.206Z" }, + { url = "https://files.pythonhosted.org/packages/f6/d2/1e1731df090a857df2807177a4626863e5ac0f0256513c35780efe53986f/mypy-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fbc00cee7bdbb9291979ddc9d08034a29dfcda4932628c9bbc28c1edd589df0c", size = 14032189, upload-time = "2026-07-13T11:33:57.168Z" }, + { url = "https://files.pythonhosted.org/packages/44/95/cab921f4a806e171f34113e6181dd23c55358ccf6a80741269ef594a410e/mypy-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:04e617030eca5221909c8b7d8d7fd1c637948199aa2100b2ad9813feb07e1491", size = 14198696, upload-time = "2026-07-13T11:32:12.767Z" }, + { url = "https://files.pythonhosted.org/packages/66/80/e6d008bb19fe446e3662d85e0e2717bf9f2d611a2164fb29d6e067dbf46c/mypy-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:56c184d2c20ca6b6378d58d1960270a767f41f5e44acbbd27f05effef4f4e1d7", size = 15286904, upload-time = "2026-07-13T11:34:27.594Z" }, + { url = "https://files.pythonhosted.org/packages/db/83/94397c9293608a364aa03e8084fb34ede4ae976a260384b9b52929308135/mypy-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3961a4a34b05f7c74b0f05aa51fbfe99a2d1e126038df40318d15c8f558b7ef3", size = 15528342, upload-time = "2026-07-13T11:34:07.819Z" }, + { url = "https://files.pythonhosted.org/packages/cf/96/d8b37d819adec6cfccfb1fd3afc1735d94717ddeafb45536db9c6943e09b/mypy-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:b1942b9314d4c784b8ea1dbab4972603290e5dd5630f06675f13aec97526bc4c", size = 11218346, upload-time = "2026-07-13T11:28:27.745Z" }, + { url = "https://files.pythonhosted.org/packages/2b/cd/cd9f725b19b19e5b530a154cf9bcf9e94279c5d55b3c34fb42b3aa48ea1b/mypy-2.3.0-cp312-cp312-win_arm64.whl", hash = "sha256:be51653d7669d7d7955d613b8d0bb57d5b652eaf71a873ddf65ac87254dd2595", size = 10204525, upload-time = "2026-07-13T11:31:02.552Z" }, + { url = "https://files.pythonhosted.org/packages/6e/ae/f7d056eb0294586a572d0d0d89580ec633c064db520f11d37d5a2fb833bd/mypy-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:91ad22a52ae2c7e621c2f67c94d5a17f66b3209a4cff5cf8a573579835c69e97", size = 14947298, upload-time = "2026-07-13T11:27:47.734Z" }, + { url = "https://files.pythonhosted.org/packages/32/d5/db3e7af01e7844d21662c6ddc1f7825ec7cb4053f0391ac02faf3638396f/mypy-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:99ac767cc5d3b64c8d0ae226ead10c96694f94e4e7da1668642225dcd4e75aac", size = 13950768, upload-time = "2026-07-13T11:27:57.726Z" }, + { url = "https://files.pythonhosted.org/packages/d9/fb/43c031f0190513d1ec248ed037eceb742ddd2a4d74bbf406658a28173837/mypy-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:de6d2c484742a4d7b0ed6d07b143375624d3b899c5749c7b3c947f56261f48a6", size = 14151586, upload-time = "2026-07-13T11:29:18.615Z" }, + { url = "https://files.pythonhosted.org/packages/ec/c3/f8b2ffc60883084da91be51af58e88a7ffd4ff9795acb7d902ff88d31eb1/mypy-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7da939dd335cfd2ad788bdfd081c9f4e47634ab995e5a45eb15fd1e5bc052f8b", size = 15227411, upload-time = "2026-07-13T11:30:29.904Z" }, + { url = "https://files.pythonhosted.org/packages/83/2e/16b917fc7adcf03f1aadddfc93aab804ffb234b1ab09c0ffd6d92a5d34a2/mypy-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7247eb2824f996722a949530183394921ca71deb9680052a338cf53cff7925c2", size = 15478790, upload-time = "2026-07-13T11:33:14.686Z" }, + { url = "https://files.pythonhosted.org/packages/c0/88/aaa65a93c73d0cdae7e42f8adb302bf6885bb281302084f99d0290a35347/mypy-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:75b0984bb3cbd76bb5c9291a8671f7ae66ca3b51c7584c358fc2e923259f0757", size = 11234919, upload-time = "2026-07-13T11:33:39.28Z" }, + { url = "https://files.pythonhosted.org/packages/35/19/b40de63f1a80e63bc2d40f0679a6a8dbd34e95176c8122119bdf406aa552/mypy-2.3.0-cp313-cp313-win_arm64.whl", hash = "sha256:d78fcf900b59cb7e82cb7e3a235e31b462d9333d92285bd1e4952d355b8ffba1", size = 10201510, upload-time = "2026-07-13T11:31:52.619Z" }, + { url = "https://files.pythonhosted.org/packages/a4/58/fa0ae047da911f540284009b4f44b96fe09d83c076d7c103e9d645f46303/mypy-2.3.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:ea317b060ce83e26050f8f9e4d7d6bf44ed7597c8ff9990bccffbb9d1d8522db", size = 14941909, upload-time = "2026-07-13T11:32:34.332Z" }, + { url = "https://files.pythonhosted.org/packages/15/14/2ba1d61452d7c2a7fe12741e8d374e52b183476b07aa7f9e2a0d02b0720a/mypy-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:094af99f92638aa92852326188b85a89e50f4a472f44827c03362228482f0762", size = 13967581, upload-time = "2026-07-13T11:30:00.587Z" }, + { url = "https://files.pythonhosted.org/packages/ed/5a/483fb9e5ffbbb1a28dccc7b0a13d141b17ac769b6c9f488c0a0c63698962/mypy-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:de121747278144fc9ae7caa2e978cf5df12aebc82933182f5b3b86081a30baef", size = 14168807, upload-time = "2026-07-13T11:28:48.6Z" }, + { url = "https://files.pythonhosted.org/packages/ae/77/70d7a10732063beb74ad713682cf871e88f5c5fa39bfc8beff8a524bf9cb/mypy-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:37fa4de896a84e2dc9200d91e614c22563b43d1a266789d4bbac7b22ebe6192b", size = 15200144, upload-time = "2026-07-13T11:31:25.283Z" }, + { url = "https://files.pythonhosted.org/packages/56/72/766218ac783be4fdfcd699b90037b63017348a3e86fb2c1fbfb18302637d/mypy-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f1b3a98dfd21058bc759bb3337d5d1f61d0fdf9f3cf9c00f4291790fb5427bff", size = 15460389, upload-time = "2026-07-13T11:29:29.077Z" }, + { url = "https://files.pythonhosted.org/packages/38/4e/8a9db7411ecb8ec0cb1fd05dba432f28bafffcd38b4e887714a4a0506689/mypy-2.3.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:944c665d984157cb96a679dfb7a4a81dd1d36b24b9c284b699514e6e626b82d4", size = 7753664, upload-time = "2026-07-13T11:29:08.147Z" }, + { url = "https://files.pythonhosted.org/packages/65/4c/c3f8bfd6ed0e5e38b5a244403b27f821d433443df5a15a278417c10a3a3c/mypy-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:4359424140d985192c778c1ce2c114a10c1ca58a381ed79cfa70d37df94b299f", size = 11417237, upload-time = "2026-07-13T11:33:47.467Z" }, + { url = "https://files.pythonhosted.org/packages/3c/00/89a32eaf5ccf174bc4f90db0eaea5d70636c01b8d49f384bdab2e8834390/mypy-2.3.0-cp314-cp314-win_arm64.whl", hash = "sha256:3dd0bed92c4bdec57c42505b96416fb9e6a5aa7be84d2809bcd5f2ecec2860d7", size = 10389252, upload-time = "2026-07-13T11:31:43.81Z" }, + { url = "https://files.pythonhosted.org/packages/31/56/104f93d69aa9f339b6b9d3b0a7faa699b8b466c942cf3ae86cc2a2ec0915/mypy-2.3.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:691fdc37132b1ae628d834f672e74de83462d9fb4aff621835767fb43a8dd373", size = 16385495, upload-time = "2026-07-13T11:29:49.818Z" }, + { url = "https://files.pythonhosted.org/packages/d2/03/f1d2123313f55efafdd27706960f43a771c62f1b68426c76043f3ab9ebf3/mypy-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:aec15d465d477558fd842757b487849007311cf3897849cdda0e3162ac0ac556", size = 15098155, upload-time = "2026-07-13T11:30:40.301Z" }, + { url = "https://files.pythonhosted.org/packages/e5/5d/d5f9200399b445e81726c4f23becee33f233aee81c72680b1ef3a258b641/mypy-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b352b7e49f5e6576009e8df730e1ff4f915cb565b851b396d2ffe2f5a6f5da88", size = 15514155, upload-time = "2026-07-13T11:34:38.569Z" }, + { url = "https://files.pythonhosted.org/packages/cd/ce/69977c555f08faa3190cfde44189b89dbd56861b1ab97aa18fc5f3a2e4a3/mypy-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c6c6bf687b17f90dbfcad95b960d32eaa0154c00da45f03ab50bf8952e047fe", size = 16766351, upload-time = "2026-07-13T11:33:29.195Z" }, + { url = "https://files.pythonhosted.org/packages/bc/92/6648b6caa3ab9e00f9ac0c2a78307805f873dd48139b24a6f6f7c3667bbf/mypy-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f4ed18f111bfe2d599bca7468e7f9251042c1c2118f762c8de2766a56d773c60", size = 17043490, upload-time = "2026-07-13T11:30:53.927Z" }, + { url = "https://files.pythonhosted.org/packages/7c/ab/0dc91d80f3f016634c68d451f294a97320fe903a9b6f90b9e57b3f7f1717/mypy-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:0b025a93cffb9781d231f232be07a17912f35f10a313c24f301c81e842870654", size = 12146869, upload-time = "2026-07-13T11:29:38.874Z" }, + { url = "https://files.pythonhosted.org/packages/85/b5/4c964d02634ba81f4d1c84838e5c5b18ab06d13ed568960f5d6318495ccc/mypy-2.3.0-cp314-cp314t-win_arm64.whl", hash = "sha256:adebc76aab4f3495a88b41d48aa4aff0c03f2822501da76625afcca5975f19e5", size = 10965113, upload-time = "2026-07-13T11:28:07.056Z" }, + { url = "https://files.pythonhosted.org/packages/2c/fa/fdc54fe583ba3cafbcedfb70eeeaf03849f75b1827a07096c7bd996f582d/mypy-2.3.0-py3-none-any.whl", hash = "sha256:6b1cdb579446b60432432b2b2403a6201b4b475a004d7f488511c9ba177c9e88", size = 2753292, upload-time = "2026-07-13T11:33:18.48Z" }, ] [[package]] @@ -1836,53 +1879,53 @@ msgpack = [ [[package]] name = "numpy" -version = "2.5.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e7/05/3d27272d30698dc0ecb7fdfaa41ad70303b444f81722bb99bce1d818638a/numpy-2.5.0.tar.gz", hash = "sha256:5a129578019311b6e56bdd714250f19b518f7dceeeb8d1af5490f4942d3f891c", size = 20652461, upload-time = "2026-06-21T20:57:51.95Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/fa/0a/11486d02add7b1384dff7374d124b1cfbb0ee864dcc9f6a2c0380638cf84/numpy-2.5.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:489780423903667933b4ed6197b6ec3b75ea5dd17d1d8f0f38d798feb6921561", size = 16789987, upload-time = "2026-06-21T20:56:16.657Z" }, - { url = "https://files.pythonhosted.org/packages/55/b2/285f48640a181947b4587a3766d21ec1eaa7fea833d4b49957e09da467a2/numpy-2.5.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ece55976ced6bca95a03ae2839e2e5ccffe8eb6a3e7022415645eb154a81e4e6", size = 11760322, upload-time = "2026-06-21T20:56:19.813Z" }, - { url = "https://files.pythonhosted.org/packages/dd/67/b032db1eb03ca30d16eda3b0c22aaa615338b9263c2fd559d0f29451aca4/numpy-2.5.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:c83b664b0e6eee9594fa920cf0639d8af796606d3fad6cc70180c87e4b97c7be", size = 5319605, upload-time = "2026-06-21T20:56:22.173Z" }, - { url = "https://files.pythonhosted.org/packages/b9/83/03fc7300c7c6b6c84c487b1dc80d322817b95fbd1f4dd57a85e23b7198de/numpy-2.5.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:bf80333980bf37f523341ddd72c783f39d6829ec7736b9eb99086388a2d52cc2", size = 6653628, upload-time = "2026-06-21T20:56:23.914Z" }, - { url = "https://files.pythonhosted.org/packages/82/49/2ec21730bc63ccfda829323f7040a8ed4715b3852ce658689cf74ee96a8c/numpy-2.5.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a1a4874217b36d5ac8fc876f52e39df56f8182c88463e9e2dceabf7ca8b7efb8", size = 15153691, upload-time = "2026-06-21T20:56:25.631Z" }, - { url = "https://files.pythonhosted.org/packages/bb/6b/f4a3d0637692c49da8ef99d72d52526f92e0a8d6ac4f0ca9f31441b9d9ea/numpy-2.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:aaa760137137e8d3c920d27927748215b56014f92667dc9b6c27dfc61249255a", size = 16660066, upload-time = "2026-06-21T20:56:28.009Z" }, - { url = "https://files.pythonhosted.org/packages/3a/2f/c354ec86d1f3f5c19649463b0d39652e160736e5b0a4cd18dff0576715c4/numpy-2.5.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7174ce8265fc7f7417d171c9ea8fe905220748893ea67a2a7abe726ec331c4b0", size = 16514638, upload-time = "2026-06-21T20:56:30.26Z" }, - { url = "https://files.pythonhosted.org/packages/06/34/43efdcb319988648580f93c11f1ae82cf7e2faa74925e98e454ae3aa95f8/numpy-2.5.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b8c3daaf99de52415d20b42f8e8155c78642cb04207d02f9d317a0dcf1b3fb54", size = 18419647, upload-time = "2026-06-21T20:56:32.41Z" }, - { url = "https://files.pythonhosted.org/packages/71/e2/f5d1676b1d7fb682eb5e9a1641e7ebd2414b3216c370661d1029778908b4/numpy-2.5.0-cp312-cp312-win32.whl", hash = "sha256:6206db0af545d73d068add6d992279145f158428d1da6cc49adc4b630c5d6ee5", size = 6056688, upload-time = "2026-06-21T20:56:34.657Z" }, - { url = "https://files.pythonhosted.org/packages/8f/7c/48f115d1c58a34032facebcd51fdf2d02df2c51d4a46a81dd1197bb2ea6b/numpy-2.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:6f2d6873e2940c860a309d21e25b1e69af6aaffdd80aa056b04c16380db1c4f2", size = 12419237, upload-time = "2026-06-21T20:56:36.24Z" }, - { url = "https://files.pythonhosted.org/packages/86/26/2e0882f4044d1b1a1b63e875151fb2393389032022a8b7f5657a7996d3b2/numpy-2.5.0-cp312-cp312-win_arm64.whl", hash = "sha256:a55e1eb2bca2cfd17a16b213c99dfc8502d47b0d494224d2122277d0400935ca", size = 10339912, upload-time = "2026-06-21T20:56:38.733Z" }, - { url = "https://files.pythonhosted.org/packages/8a/33/07675aaad7f26ea013d5e884d9a0d784b79c6bd7566c333f5a52fa3c610b/numpy-2.5.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:520e6b8be0a4b65840ac8090d4f51cef4bed66e2b0894d5a520f099adc24a9b2", size = 16784890, upload-time = "2026-06-21T20:56:40.799Z" }, - { url = "https://files.pythonhosted.org/packages/85/4b/953118a730ee3b35e28645e0eb4cf9beec5bdbb954e1ac2f5fcefba6bbc3/numpy-2.5.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:146b81cdd3967fdb6beca8ba25f00c58741d8f3cbd797f55af0fbe0bfec3469c", size = 11754584, upload-time = "2026-06-21T20:56:43.094Z" }, - { url = "https://files.pythonhosted.org/packages/44/9b/56dd530c367c74ae17411027cea4135ca57e1e0583bf5594cee18bd83217/numpy-2.5.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:126b88d95e8ff9b00c9e717aa540469f21d6180162f84c0caec51b16215d49cd", size = 5313904, upload-time = "2026-06-21T20:56:45.503Z" }, - { url = "https://files.pythonhosted.org/packages/ce/b0/bcd672edad27ecca7da1f7bb0ce72cd1706a4f2d79ae94990afc97c13e1c/numpy-2.5.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:d4313cef1594c5ce46c31b6e54e918338f63f16ee9322304e8c9114d6d81c8bd", size = 6648504, upload-time = "2026-06-21T20:56:47.567Z" }, - { url = "https://files.pythonhosted.org/packages/80/9e/15cdfcbd30a1544a46c9e487a00df331c4672450216538705a9e51fa6710/numpy-2.5.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:750fb097caf26fa878746d9d119f6f9da12dedcbff1eea966c3e3447647c4a9e", size = 15150086, upload-time = "2026-06-21T20:56:49.352Z" }, - { url = "https://files.pythonhosted.org/packages/32/4e/8d7656ccaab3e81e97258b8a9bc5f0c8502513a92fb4ceb0a2cbfebc17bf/numpy-2.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3893adc2dc7c0412ba76777db55a049215d99c9aa3113003be8f49f4f1290ab9", size = 16647250, upload-time = "2026-06-21T20:56:51.542Z" }, - { url = "https://files.pythonhosted.org/packages/3c/81/97060281b602ed07f21b12f4ec409eac1f75a2f91fbc829ed8b2becf3ad4/numpy-2.5.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:835e454dd99b238cdc5a3f63bce2371296f5ebc53ca1e0f8e6ddbb6d92a29aab", size = 16512864, upload-time = "2026-06-21T20:56:55.401Z" }, - { url = "https://files.pythonhosted.org/packages/33/ab/4496208146911f8d8ddb54f68a972aafa6c8d44babcb2ea03b0e5cc87c9d/numpy-2.5.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6f9836778081a0a3c02a6a21493f3e9f5b311f8d2541934f31f05583dc999ea4", size = 18408407, upload-time = "2026-06-21T20:56:57.75Z" }, - { url = "https://files.pythonhosted.org/packages/d4/9f/a4df67c181e4ee8b467aa3332dc2db10fd5c515136831302f3ca48bc0a01/numpy-2.5.0-cp313-cp313-win32.whl", hash = "sha256:0b525be4744b60bb0557ac872d53ef07d085b5f39622bc579c98d3809d05b988", size = 6054431, upload-time = "2026-06-21T20:57:00.016Z" }, - { url = "https://files.pythonhosted.org/packages/30/53/491e1c47c55b62ccc6a63c1c5b8635c73fc2258dddeb9bda27cae4a0ae96/numpy-2.5.0-cp313-cp313-win_amd64.whl", hash = "sha256:44353e2878930039db472b99dc353d749826e4010bd4d2a7f835e94a97a5c748", size = 12414420, upload-time = "2026-06-21T20:57:01.815Z" }, - { url = "https://files.pythonhosted.org/packages/eb/4a/25c2906f541e9d9f4c5769764db732e6627be91a13f4724fa10634d77db4/numpy-2.5.0-cp313-cp313-win_arm64.whl", hash = "sha256:48f54b00711f83a5f796b70c518e8c2b3c5848dda03a54911f23eb68519b9b60", size = 10339533, upload-time = "2026-06-21T20:57:03.961Z" }, - { url = "https://files.pythonhosted.org/packages/86/ad/abc44aaceaf7b17ee1edde2bbb4458da591bc79574cffff50c4bb35f00d1/numpy-2.5.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:f27582c55ba4c750b7c58c8faf021d2cd9324a662b466229db8a417b41368af9", size = 16783807, upload-time = "2026-06-21T20:57:06.253Z" }, - { url = "https://files.pythonhosted.org/packages/5d/39/b72e168daf9c00fb20c9fc996d00437ccecdef3102387775d29d7a62576d/numpy-2.5.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:28e7137057d551e4a83c4ae414e3451f50568409db7569aacc7f9811ee06a446", size = 11765215, upload-time = "2026-06-21T20:57:08.547Z" }, - { url = "https://files.pythonhosted.org/packages/f7/a0/8400a9c0e3625182347593f5e1f57da9a617a534794805c8df5518154ddc/numpy-2.5.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:e1da54b53e75cd9fcfc23efcc7edab2c6aecf97b6037566d8a0fe804af8ec57c", size = 5324493, upload-time = "2026-06-21T20:57:11.012Z" }, - { url = "https://files.pythonhosted.org/packages/f6/8c/0d104deaa0401c93395a629ec902891618a2eff76d19229139cb5a887bfc/numpy-2.5.0-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:694d8f74e156f7fd01179f1aa8faa2f648ab6ae0f70b6c3fe57a03249aea2303", size = 6645211, upload-time = "2026-06-21T20:57:12.919Z" }, - { url = "https://files.pythonhosted.org/packages/6a/d9/4a4a628c812750363786afc3d33492709a5cd64b215469c16b0f6c7bb811/numpy-2.5.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1a7569a7b53c77716f036bb28cb1c91f166a26ec7d9502cd1e4bdfe502fdec22", size = 15166004, upload-time = "2026-06-21T20:57:14.717Z" }, - { url = "https://files.pythonhosted.org/packages/a0/5e/2a902317d7fc4aa93236e80c932662dadfc459b323d758329e01775125e1/numpy-2.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:39a0433bd4086ebd462960cf375e19195bb07b53dc1d87dd5fcf47ad78576f03", size = 16650797, upload-time = "2026-06-21T20:57:16.906Z" }, - { url = "https://files.pythonhosted.org/packages/e9/a0/a0090e6329f4ca5992c07847bb579c5259a19953dc57255bb08793142ffb/numpy-2.5.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:929f0c79ac38bcbd7154fe631dc907abfeddbcc5027a896bd1f7767323271e7a", size = 16524647, upload-time = "2026-06-21T20:57:19.165Z" }, - { url = "https://files.pythonhosted.org/packages/5e/7d/6caf27734c42b65837e7461ed0dbbd6b6fc835060c9714ec59d673bb383a/numpy-2.5.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:cc4f247a47bbf070bfd70be53ccdcf47b800af563535e7bbe172322197c30e21", size = 18411841, upload-time = "2026-06-21T20:57:21.638Z" }, - { url = "https://files.pythonhosted.org/packages/13/dc/26edadbd812536769a82c2e9e002234e33feb5da43061d47a044f6d309b7/numpy-2.5.0-cp314-cp314-win32.whl", hash = "sha256:5dc71423499fab3f46f7a7201155ade1669ea101f2f429d332df9e72f8161731", size = 6106361, upload-time = "2026-06-21T20:57:23.844Z" }, - { url = "https://files.pythonhosted.org/packages/f2/9e/4dd1459282229a72d92dece2ae9138e5cac94a72263a7ceb48f37434c925/numpy-2.5.0-cp314-cp314-win_amd64.whl", hash = "sha256:ebb81d9d5443e0309d6c54894c3fbed74ad7da0714352a67b6d773cd189eae73", size = 12551749, upload-time = "2026-06-21T20:57:25.945Z" }, - { url = "https://files.pythonhosted.org/packages/05/a7/6bc6384c080b86c7f6c85c5bc5b540b24f4f679cd144791d99574e90d462/numpy-2.5.0-cp314-cp314-win_arm64.whl", hash = "sha256:3b94d0d0deceebfad3e67ae5c0e5eb87371e8f7a0581cd04a779928c2450cf1e", size = 10617072, upload-time = "2026-06-21T20:57:28.175Z" }, - { url = "https://files.pythonhosted.org/packages/86/6b/4a2b71d66ada5608ae02b63f150dfad520f6940721cb7f029ad270befc0e/numpy-2.5.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:22f3d43e362d650bc39db1f17851302874a148ca95ba6981c1dfb5fa6862f35b", size = 11881067, upload-time = "2026-06-21T20:57:30.104Z" }, - { url = "https://files.pythonhosted.org/packages/dc/b2/d365eb40a20efb49d67e9feb90494ed8511282ee1f5fa16006675c65397d/numpy-2.5.0-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:243563efb4cd7528a264567e9fd206c87826457322521d06206a00bfa316c927", size = 5440290, upload-time = "2026-06-21T20:57:32.193Z" }, - { url = "https://files.pythonhosted.org/packages/fa/5e/e9c03188de5f9b767e46a8fe988bcfd3efad066a4a3fda8b9cb11a93f895/numpy-2.5.0-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:84881d825ca75249b189bbee875fcfe3238aa5c479e6100893cda566e8e86826", size = 6748371, upload-time = "2026-06-21T20:57:33.933Z" }, - { url = "https://files.pythonhosted.org/packages/fd/1d/68c186a38a5027bae2c4ddd5ea681fdaf8b4d30fb7301def6d8ad270390f/numpy-2.5.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cda12aa4779d42b8771180aba759c96f527d43446d8f380ab59e2b35e8489efd", size = 15214643, upload-time = "2026-06-21T20:57:35.677Z" }, - { url = "https://files.pythonhosted.org/packages/8c/67/73f67b7c7e20635baae9c4c3ead4ae7326a005900297a6110971abd62eb5/numpy-2.5.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c0121101093d2bd74981b10f8837d78e794a8ff57834eb27179f49e1ba11ac6", size = 16690128, upload-time = "2026-06-21T20:57:38.159Z" }, - { url = "https://files.pythonhosted.org/packages/eb/05/d4c1fb0c46d02a27d6b2b8b319a78c90937acec8631c1641874670b31e6f/numpy-2.5.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:d371c92cfa09da00022f501ab67fafaea813d752eb30ac44336d45b1e5b0268a", size = 16577902, upload-time = "2026-06-21T20:57:40.447Z" }, - { url = "https://files.pythonhosted.org/packages/9e/1d/771c797d50fa26e4888989cccf1d50ee51f530d4e455ad2692dcb64fa711/numpy-2.5.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:9990713e9c38154c6861e7547f1e3fc7a87e75ff09bab24ef1cc81d81c2835e9", size = 18452814, upload-time = "2026-06-21T20:57:42.875Z" }, - { url = "https://files.pythonhosted.org/packages/e8/46/52fc0d2a68d7643f0f149eeea5a5d8ea2a3507056ac8afa83c9212606e8b/numpy-2.5.0-cp314-cp314t-win32.whl", hash = "sha256:edadfbd4794b1086c0d822f81863e8a68fc129d132fd0bb9e31e955d7fbbbdb7", size = 6253168, upload-time = "2026-06-21T20:57:45.101Z" }, - { url = "https://files.pythonhosted.org/packages/2a/be/6c8d1118b5f13b2881dc095d5b345de19c6638b8959c17409b6eff84c8aa/numpy-2.5.0-cp314-cp314t-win_amd64.whl", hash = "sha256:f7e5fa4382967ae6548bd2f174219afb908e294b0d5f625af01166edd5f7d9aa", size = 12736286, upload-time = "2026-06-21T20:57:46.935Z" }, - { url = "https://files.pythonhosted.org/packages/fd/6a/d3a169aaf8536cf228d56a09e04bcb713a2fe4410d4e2105b9419b5a9c89/numpy-2.5.0-cp314-cp314t-win_arm64.whl", hash = "sha256:016623417bb330d719d579daf2d6b9a01ddc52e41a9ed61a47f39fde46dcd865", size = 10686451, upload-time = "2026-06-21T20:57:49.313Z" }, +version = "2.5.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/22/fd/89965aa4ac08c74998539fcbf24fa3540f3e15237fbeb6bcf9c908f4aade/numpy-2.5.1.tar.gz", hash = "sha256:a48a113e6afea91f5608793bafa7ef2ad481fefbda87ec5069f483de61cb9fa3", size = 20755553, upload-time = "2026-07-04T17:08:00.933Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/7b/14687aa674250e5e546f616f486b0d56d3631cd5b2415739141ce40bdcea/numpy-2.5.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2c889b56fe48b1018f764b0eec8df59ab654e9148aa91faa12596043500de277", size = 16801574, upload-time = "2026-07-04T17:06:12.423Z" }, + { url = "https://files.pythonhosted.org/packages/e1/19/cc5bb2a3f2913d27d6dbb2c78d25921fabaedc6741d4a5a615a11f3c5bf3/numpy-2.5.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ab451b59c5643c570974c43aef780703ef1d3b4965d2be07afd530615a9358d1", size = 11772250, upload-time = "2026-07-04T17:06:15.726Z" }, + { url = "https://files.pythonhosted.org/packages/42/77/fdf34a71dd30f54979b18603bee915e0aaf825b07afe79acd60b04b691e2/numpy-2.5.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:78798bd5b9ad744056af8efa90e3b9ddaa53272a0848a483084a1cc0a13b2dc0", size = 5331516, upload-time = "2026-07-04T17:06:17.913Z" }, + { url = "https://files.pythonhosted.org/packages/ce/e2/eb7efa015b4cce41e2517bf182a7fce0d7d5b9d9ed76a29bfa0f4fe4505c/numpy-2.5.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:2ae0ca40bcb22d6ba59c1dfd5446f49940b0f2d821fde133f10dda11f816b84e", size = 6664863, upload-time = "2026-07-04T17:06:20.02Z" }, + { url = "https://files.pythonhosted.org/packages/a9/4b/a2b32dd94ee9ffbeecb28152240042a3949db33b1c834d44090b80e1b3b8/numpy-2.5.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:61ac47e772e6b8ea489e1d2f441a34c5c3ac17327e7ce294cbdf535795ad4e75", size = 15167977, upload-time = "2026-07-04T17:06:21.621Z" }, + { url = "https://files.pythonhosted.org/packages/b8/a9/6e73d68500f80773f65f0654ea932019d6694329a0eb0ed0533de38df376/numpy-2.5.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:59fda5e192b570217ec2580c96f00e9a7e12ef6866a900eb089b62c1a32545ca", size = 16672469, upload-time = "2026-07-04T17:06:24.064Z" }, + { url = "https://files.pythonhosted.org/packages/24/7d/ad3e59015135f5261c95fd4cafeff159c955febd83a99a1d9250c4233815/numpy-2.5.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f7119ebff1a9829e9f431a4f9d28e703023bb6b9fe7c8f724467dbfc27c94ab3", size = 16527531, upload-time = "2026-07-04T17:06:26.69Z" }, + { url = "https://files.pythonhosted.org/packages/83/d0/a39b2fbcde9cb17a1dac678f254b33a6336298af9df338824c685425d5e8/numpy-2.5.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e824c2acf8862052246be5a44c15da1777940c60d010dd2aab897824d9c430f9", size = 18431940, upload-time = "2026-07-04T17:06:29.521Z" }, + { url = "https://files.pythonhosted.org/packages/04/12/cff070947791c1ed425ff76413189adbdc2fbe215eba7ce7fa454a03c7f8/numpy-2.5.1-cp312-cp312-win32.whl", hash = "sha256:08d60c810432eb83360958dea0999ac4cfb94531ea8efcbf0b7f277c2068aeb2", size = 6066764, upload-time = "2026-07-04T17:06:32.571Z" }, + { url = "https://files.pythonhosted.org/packages/65/66/53f31807a48a750f9d748da273bc3fcedd12b27ff1f3e373bfec55ef2dc0/numpy-2.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:f7d60026c0bdb1380e83bfa7a0419c4577ee4b9a08880afcb6dadeb74c649fa2", size = 12430966, upload-time = "2026-07-04T17:06:34.926Z" }, + { url = "https://files.pythonhosted.org/packages/2b/2a/d1a88066b1c14186f5d3c0d18c94f17b064511982bab0578d49ee9d43c29/numpy-2.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:17a25e09640602e10bc8de0e6fa2b3fd68eedd84ba6d7842dc8f32f9ab87bd0b", size = 10350488, upload-time = "2026-07-04T17:06:37.785Z" }, + { url = "https://files.pythonhosted.org/packages/eb/07/ec2a3f0c91761581d4b7104a740791800025983f9a4dc4e73f91a99aeac4/numpy-2.5.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0bfebd8695f9863592fe744be833a258120b14a9f39da255e8aa8fade2c0ddd1", size = 16796419, upload-time = "2026-07-04T17:06:40.37Z" }, + { url = "https://files.pythonhosted.org/packages/ab/ab/ddb499fc4f8780354395face5b65c7fd107bcd6e1d667a5f07d046956f6f/numpy-2.5.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:30b44a6b53a7ae63c54c089a8726e5563ed302716c5b7ccc85afade40b0e7ff6", size = 11765832, upload-time = "2026-07-04T17:06:42.768Z" }, + { url = "https://files.pythonhosted.org/packages/88/b3/3c28c558a09fc72100c646dac6d2fce8e834c471b0edca01a29996706117/numpy-2.5.1-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:6165343f81b56ef8f514f396989e529b61d9dc709b99421b07e9f3e698e2287d", size = 5325143, upload-time = "2026-07-04T17:06:45.466Z" }, + { url = "https://files.pythonhosted.org/packages/5e/0e/ce19b985bb15c596f4f05954e76cccc77c845083b3b8f938a6c68e523128/numpy-2.5.1-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:4939237038ada79308dda3204ac6462df056b5672b2e25db1149cf873668b3e1", size = 6659749, upload-time = "2026-07-04T17:06:47.288Z" }, + { url = "https://files.pythonhosted.org/packages/2e/20/1ee6614d64332a1bba6411f38e68cb79eec1b2459e20a623777c5c5492a2/numpy-2.5.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1c6759f538fb912fc46de0a6b1758ccf7b57bc7c7ebebc23974fdac3de8db0cd", size = 15164716, upload-time = "2026-07-04T17:06:49.494Z" }, + { url = "https://files.pythonhosted.org/packages/ed/a7/2bcd3fdbb87804755c35b729bf8709d62025c5f4cfd7d5b2415997097515/numpy-2.5.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9726558e8db4a5bf7929a70ae50f63abda4daf0efe810e3bfbab95976f75fc1a", size = 16661440, upload-time = "2026-07-04T17:06:52.061Z" }, + { url = "https://files.pythonhosted.org/packages/fc/d7/a41e3310c886fe457d36e670bbf24fae411aca8a7b6ad92a32afd924077c/numpy-2.5.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3935f3b419b244a02732676fa5317a9193cc596a4c0646db07e5b421229ac9f7", size = 16526305, upload-time = "2026-07-04T17:06:54.605Z" }, + { url = "https://files.pythonhosted.org/packages/53/75/4333a9a707c1edd3a4e1a0c58eca52c0f31e55089fa80db02b5565b24df7/numpy-2.5.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:dc932a65ded7ce9013d120845a2514dcccb1a67bfc8deb8d37633762951904a6", size = 18423008, upload-time = "2026-07-04T17:06:57.54Z" }, + { url = "https://files.pythonhosted.org/packages/ee/90/e314a32b1c11a2ffe818ddad3a57b50b4b6e1b6c487192eb50cdef0415d0/numpy-2.5.1-cp313-cp313-win32.whl", hash = "sha256:4b4ff1608417eb7a59da7b967bbb798cacfe071d2caf526a24281cd562072ed9", size = 6063885, upload-time = "2026-07-04T17:07:00.14Z" }, + { url = "https://files.pythonhosted.org/packages/10/70/800b3fca480af32df9e8ea9f3d4a0c8feb4b32d7f195d174eabbda4829ad/numpy-2.5.1-cp313-cp313-win_amd64.whl", hash = "sha256:6c3fe51bc6a16453d452997053454f309e8e0ed7b42d6b361ce4ac8c32913d74", size = 12425674, upload-time = "2026-07-04T17:07:02.387Z" }, + { url = "https://files.pythonhosted.org/packages/8b/0b/196350c122f50f6ca56846f2d71efd5e0d24b7b2e07355e019b2e2c7a11e/numpy-2.5.1-cp313-cp313-win_arm64.whl", hash = "sha256:f7feb014281029e628ba2d5a007407443b06e418b6fe451d1e2adcbc8eba0107", size = 10350256, upload-time = "2026-07-04T17:07:04.878Z" }, + { url = "https://files.pythonhosted.org/packages/db/f4/731b6085a83faf6ca843394cbd5e217280c214399f7e8b21b9f552af0ae2/numpy-2.5.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:7c786fe9a5bbe360022e584c5a34cf6b54265c71bd7ec8ac3d8fec38968071f8", size = 16795063, upload-time = "2026-07-04T17:07:07.374Z" }, + { url = "https://files.pythonhosted.org/packages/bf/64/0e215f2048dd11a55bb989ed41b3585ef57452404e638d703a211a3e4157/numpy-2.5.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:32985c896d897419ef8da6917872d80b78ad0ea26d85b23245c7366ffde76d75", size = 11776652, upload-time = "2026-07-04T17:07:09.907Z" }, + { url = "https://files.pythonhosted.org/packages/b5/59/2b844c7a6e9deff69b404a66221e1542937734f65d5e6e39411876053862/numpy-2.5.1-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:efd736408cc97c79b9e6917338dfc8f06013b2274f992e96b1d9a81a71e2a2c2", size = 5335944, upload-time = "2026-07-04T17:07:12.227Z" }, + { url = "https://files.pythonhosted.org/packages/86/51/9bf7cb2cabcebc9e017e4ec7e6322b378317a542c08b4cb68479c1efc716/numpy-2.5.1-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:ab84dc6b074fa881cae55bea94cc4f68e285181ba7f32497bf7dee6b1496165b", size = 6656266, upload-time = "2026-07-04T17:07:14.368Z" }, + { url = "https://files.pythonhosted.org/packages/83/3e/fb7615b211b82a32f44d5180a6d421b61f84d4fadd578b48ba4ac34e189f/numpy-2.5.1-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caf3e317d33d60c37986b452613f4ab51246d0691350c03d0cb4a898627f4a95", size = 15179720, upload-time = "2026-07-04T17:07:16.272Z" }, + { url = "https://files.pythonhosted.org/packages/41/5f/0f992cb24560673496c5d68de61913b57166ce530ffda07c1f280e0cc464/numpy-2.5.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:54ad769f17bc2d833b620851989f62054fb9ab93c969d9e1dc3c8e3d56beea21", size = 16664835, upload-time = "2026-07-04T17:07:19.021Z" }, + { url = "https://files.pythonhosted.org/packages/a2/2f/97d6475ee91afe2587797d09446f9d3e475ad4cb681662d824809327b75a/numpy-2.5.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c12afb53450fa976d4c681c50a7423729a4c51c0465ed9f32b8a9cabbc472373", size = 16539135, upload-time = "2026-07-04T17:07:22.015Z" }, + { url = "https://files.pythonhosted.org/packages/c4/5b/4db81e4ba0be7e2776b1de68c82aa862c7f8ec27e1b4927d4ae075e20678/numpy-2.5.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:e8c11c405efc5ff6816d5983c96cdfa215bab3428961243af3ff59b228490438", size = 18426684, upload-time = "2026-07-04T17:07:24.941Z" }, + { url = "https://files.pythonhosted.org/packages/1f/64/c0ba2d90724d450279a7df8f32057241070250a26a7e2b5337d77347f481/numpy-2.5.1-cp314-cp314-win32.whl", hash = "sha256:f2479a47f8d5932d1718168a681ad6e536a9df484c83cfcf9de365e164537ace", size = 6116103, upload-time = "2026-07-04T17:07:27.622Z" }, + { url = "https://files.pythonhosted.org/packages/c1/1a/837f9ed7405adcd7a40538792eb169eddd8fa5630c16a1ef49dae71a30f4/numpy-2.5.1-cp314-cp314-win_amd64.whl", hash = "sha256:24d0eb82c0541d3415a33425db64ae439dffccd7b4dbcb30e7c35120205c506a", size = 12562177, upload-time = "2026-07-04T17:07:29.887Z" }, + { url = "https://files.pythonhosted.org/packages/22/ed/49707938b6dd0a78a9178dd93227dc89e4c11af47f5c798d70366e8d0483/numpy-2.5.1-cp314-cp314-win_arm64.whl", hash = "sha256:5a4c988b38d261deeeaad9954e3deb091ad905c94e8bb6708654ef1d97f286b0", size = 10627739, upload-time = "2026-07-04T17:07:32.568Z" }, + { url = "https://files.pythonhosted.org/packages/a6/c7/bb4b882cfe7f299cbc8b66e42e7dd78cf9d14e40f9469fc5e3db7e15b3bd/numpy-2.5.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a33276be12fa045805f477f22482088b66bb758ffbe89a9d21457de863a32e22", size = 11894709, upload-time = "2026-07-04T17:07:34.941Z" }, + { url = "https://files.pythonhosted.org/packages/40/3f/5af7f4a7f6224aef48017aa82bb6174c7a659d724be0c75017b7e64a55b4/numpy-2.5.1-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:f089d7b00756190aacf1f5d34bdf38c3c430ac82b4f868f8cede73380460fce7", size = 5453810, upload-time = "2026-07-04T17:07:37.495Z" }, + { url = "https://files.pythonhosted.org/packages/20/c9/3474309bc94d634d3f9c3eddf03250ecb8c22cd948ef16fef69a77cc5d7b/numpy-2.5.1-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:09e9bfd8d2cf479c7d174804fb3811c53a8e9f20a37444008606b57d6b7a826d", size = 6761189, upload-time = "2026-07-04T17:07:39.563Z" }, + { url = "https://files.pythonhosted.org/packages/90/8a/558ae39fdd55d7e7f7fef9a84a6e964ac6b23edbd2a07e52bb084500507d/numpy-2.5.1-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e68d8dd1e7eba712948f2053a29ec86917bc70ba1358df869d9f06649ef9cf09", size = 15225039, upload-time = "2026-07-04T17:07:41.682Z" }, + { url = "https://files.pythonhosted.org/packages/63/27/ca7392b2d030277bdf0273e7d23255b3ee57d57a7c170a6f4fb3981e1e5d/numpy-2.5.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:99d5095fa265a0c4152e7bb12759e14381ef5496152f1ce58f44bdf55c44beb4", size = 16701306, upload-time = "2026-07-04T17:07:44.611Z" }, + { url = "https://files.pythonhosted.org/packages/02/42/03d53ae7996c44d4374a8262e9dc41671fd56cbb98f7d47ef85cf5da4c6b/numpy-2.5.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ab87a91b3cc3382b8956095bd8f95e00cf679bb81554339be1a2ba404a1473c1", size = 16589955, upload-time = "2026-07-04T17:07:47.694Z" }, + { url = "https://files.pythonhosted.org/packages/7b/15/6c1784ae469640e65db111e9a34b3d0f14d91e8a38b9ce34810ced370dbb/numpy-2.5.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:224ca51130ef7da85bea2191625181cb4f337f9cb64b471f10c1a12aa8b60077", size = 18464252, upload-time = "2026-07-04T17:07:50.684Z" }, + { url = "https://files.pythonhosted.org/packages/94/a8/f98e50356cf167df656c526c2dfeec2d7dde182f2a3da4b458a5938e2776/numpy-2.5.1-cp314-cp314t-win32.whl", hash = "sha256:6eab239876581b2b3c5a242281b6007bbdbcd1c7085d7709bb57c5929b11e6bf", size = 6263298, upload-time = "2026-07-04T17:07:53.445Z" }, + { url = "https://files.pythonhosted.org/packages/72/ac/96ae880cdecad0b3275d9359fcec72667b49a4863c9f12942e43679dda02/numpy-2.5.1-cp314-cp314t-win_amd64.whl", hash = "sha256:83ce9c80d5b521b0d77ddcbe5447c218d247929b6cc056ca5351342accfff0af", size = 12748623, upload-time = "2026-07-04T17:07:55.384Z" }, + { url = "https://files.pythonhosted.org/packages/a1/5a/4d2b1601df3602dba7a14f3348ba9bfe94a18adb428e693df6154c293831/numpy-2.5.1-cp314-cp314t-win_arm64.whl", hash = "sha256:5a6db61f9aaa57e369905c67d852045d3c4f7126405b29d09b19dec118e9c9cb", size = 10697674, upload-time = "2026-07-04T17:07:58.506Z" }, ] [[package]] @@ -2845,27 +2888,27 @@ wheels = [ [[package]] name = "ruff" -version = "0.15.20" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/43/dc/35b341fc554ba02f217fc10da57d1a75168cfbcf75b0ef2202176d4c4f2d/ruff-0.15.20.tar.gz", hash = "sha256:1416eb04349192646b54de98f146c4f59afe37d0decfc02c3cbbf396f3a28566", size = 4755489, upload-time = "2026-06-25T17:20:37.578Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/94/d9/2d5014f0253ba541d2061d9fa7193f48e941c8b21bb88a7ff9bbe0bd0596/ruff-0.15.20-py3-none-linux_armv6l.whl", hash = "sha256:00e188c53e499c3c1637f73c91dcf2fb56d576cab76ce1be50a27c4e80e37078", size = 10839665, upload-time = "2026-06-25T17:19:44.702Z" }, - { url = "https://files.pythonhosted.org/packages/c6/d3/ac1798ba64f670698867fcfc591d50e7e421bef137db564858f619a30fcf/ruff-0.15.20-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9ebd1fd9b9c95fc0bd7b2761aebec1f030013d2e193a2901b224af68fe47251b", size = 11208649, upload-time = "2026-06-25T17:19:48.787Z" }, - { url = "https://files.pythonhosted.org/packages/47/47/d3ac899991202095dfcf3d5176be4272642be3cf981a2f1a30f72a2afb95/ruff-0.15.20-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c5b16cdd67ca108185cd36dce98c576350c03b1660a751de725fb049193a0632", size = 10622638, upload-time = "2026-06-25T17:19:51.354Z" }, - { url = "https://files.pythonhosted.org/packages/33/13/4e043fe30aa94d4ff5213a9881fc296d12960f5971b234a5263fdc225312/ruff-0.15.20-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3413bb3c3d2ca6a8208f1f4809cd2dca3c6de6d0b491c0e70847672bde6e6efd", size = 10984227, upload-time = "2026-06-25T17:19:54.044Z" }, - { url = "https://files.pythonhosted.org/packages/76/e6/92e7bf40388bc5800073b96564f56264f7e48bfd1a498f5ced6ae6d5a769/ruff-0.15.20-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bd7ec42b3bb3da066488db093308a69c4ac5ee6d2af333a86ba6e2eb2e7dd44b", size = 10622882, upload-time = "2026-06-25T17:19:57.037Z" }, - { url = "https://files.pythonhosted.org/packages/13/7a/43460be3f24495a3aa46d4b16873e2c4941b3b5f0b00cf88c03b7b94b339/ruff-0.15.20-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1a36ad0eb77fba9aabfb69ede54de6f376d04ac18ebea022847046d340a8267", size = 11474808, upload-time = "2026-06-25T17:20:00.357Z" }, - { url = "https://files.pythonhosted.org/packages/27/a0/f37077884873221c6b33b4ab49eb18f9f88e54a16a25a5bca59bef46dd66/ruff-0.15.20-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b6df3b1e4610432f0386dba04d853b5f08cbbc903410c6fcc02f620f05aff53c", size = 12293094, upload-time = "2026-06-25T17:20:03.446Z" }, - { url = "https://files.pythonhosted.org/packages/a6/74/165545b60256a9704c21ac0ec4a0d07933b320812f9584836c9f4aca4292/ruff-0.15.20-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e89f198a1ea6ef0d727c1cf16088bc91a6cb0ab947dedc966715691647186eae", size = 11526176, upload-time = "2026-06-25T17:20:06.301Z" }, - { url = "https://files.pythonhosted.org/packages/86/b1/a976a136d40ade83ce743578399865f57001003a409acadc0ecbb3051082/ruff-0.15.20-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309809086c2acb67624950a3c8133e80f32d0d3e27106c0cd60ff26657c9f24b", size = 11520767, upload-time = "2026-06-25T17:20:09.191Z" }, - { url = "https://files.pythonhosted.org/packages/19/0f/f032696cb01c9b54c0263fa393474d7758f1cdc021a01b04e3cbc2500999/ruff-0.15.20-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:2d2374caa2f2c2f9e2b7da0a50802cfb8b79f55a9b5e49379f564544fbf56487", size = 11500132, upload-time = "2026-06-25T17:20:13.602Z" }, - { url = "https://files.pythonhosted.org/packages/4b/f4/51b1a14bc69e8c224b15dab9cce8e99b425e0455d462caa2b3c9be2b6a8e/ruff-0.15.20-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a1ed17b65293e0c2f22fc387bc13198a5de94bf4429589b0ff6946b0feaf21a3", size = 10943828, upload-time = "2026-06-25T17:20:16.635Z" }, - { url = "https://files.pythonhosted.org/packages/71/4b/fe267640783cd02bf6c5cc290b1df1051be2ec294c678b5c15fe19e52343/ruff-0.15.20-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f701305e66b38ea6c91882490eb73459796808e4c6362a1b765255e0cdcd4053", size = 10645418, upload-time = "2026-06-25T17:20:19.4Z" }, - { url = "https://files.pythonhosted.org/packages/b0/c0/a65aa4ec2f5e87a1df32dc3ec1fede434fe3dfd5cbcf3b503cafc676ab54/ruff-0.15.20-py3-none-musllinux_1_2_i686.whl", hash = "sha256:5b9c0c367ad8e5d0d5b5b8537864c469a0a0e55417aadfbeca41fa61333be9f4", size = 11211770, upload-time = "2026-06-25T17:20:22.033Z" }, - { url = "https://files.pythonhosted.org/packages/5a/a4/0caa331d954ae2723d729d351c989cb4ca8b6077d5c6c2cb6de75e98c041/ruff-0.15.20-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:01cc00dd58f0df339d0e902219dd53990ea99996a0344e5d9cc8d45d5307e460", size = 11618698, upload-time = "2026-06-25T17:20:25.259Z" }, - { url = "https://files.pythonhosted.org/packages/10/9b/5f14927848d2fd4aa891fd88d883788c5a7baba561c7874732364045708c/ruff-0.15.20-py3-none-win32.whl", hash = "sha256:ed65ef510e43a137207e0f01cfcf998aeddb1aeeda5c9d35023e910284d7cf21", size = 10857322, upload-time = "2026-06-25T17:20:28.612Z" }, - { url = "https://files.pythonhosted.org/packages/fa/f0/fe47c501f9dea92a26d788ff98bb5d92ed4cb4c88792c5c88af6b697dc8e/ruff-0.15.20-py3-none-win_amd64.whl", hash = "sha256:a525c81c70fb0380344dd1d8745d8cc1c890b7fc94a58d5a07bd8eb9557b8415", size = 11993274, upload-time = "2026-06-25T17:20:31.871Z" }, - { url = "https://files.pythonhosted.org/packages/d7/2b/9555445e1201d92b3195f45cdb153a0b68f24e0a4273f6e3d5ab46e212bb/ruff-0.15.20-py3-none-win_arm64.whl", hash = "sha256:2f5b2a6d614e8700388806a14996c40fab2c47b819ef57d790a34878858ed9ca", size = 11343498, upload-time = "2026-06-25T17:20:35.03Z" }, +version = "0.15.22" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/3a/06/ae069393fc66e8ff33036d4b368003833bf6e88ccf182e17e7a2f1c754fd/ruff-0.15.22.tar.gz", hash = "sha256:3f15175b1fb580126f58285a5dae6b2ea89000136d980c64499211f116b54809", size = 4785063, upload-time = "2026-07-16T15:14:13.244Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/23/18/ee54b7ae1e121be7a28ea6da4b67564ebb0530e183a54415ab7e3bcd2c4e/ruff-0.15.22-py3-none-linux_armv6l.whl", hash = "sha256:44423e73493737f5e7c5b41d475483898ff37afcdae38bc3da5085e29af1c2d8", size = 10781258, upload-time = "2026-07-16T15:13:19.452Z" }, + { url = "https://files.pythonhosted.org/packages/2f/d2/2520cb14761ddbeaf57642a76942fc36adcbdbe53b4532241995f6fc485c/ruff-0.15.22-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b82c6482946e9eda7ff2e091d25b8bad3f718684e1916d41bd56873cee05b697", size = 10999477, upload-time = "2026-07-16T15:13:23.318Z" }, + { url = "https://files.pythonhosted.org/packages/c9/10/74e53572aa758dfaa678c2a2646b5c5515d884b7ca56be4d2ce03ca4b560/ruff-0.15.22-py3-none-macosx_11_0_arm64.whl", hash = "sha256:11c1c715af53a09f714e011106bffc419751ec8232fcb5da42173284ea3fec6f", size = 10466716, upload-time = "2026-07-16T15:13:26.162Z" }, + { url = "https://files.pythonhosted.org/packages/1e/cc/44eaaf0844e028182f2d0a8f2190d0f359159aed0a9e5ab861d892f1ae2a/ruff-0.15.22-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:742a29cf29bddb7c8327895d6a10e0e6c5b38a96dd407af9b5d0857f809c0576", size = 10892644, upload-time = "2026-07-16T15:13:29.229Z" }, + { url = "https://files.pythonhosted.org/packages/9f/21/8edf559014d2b0f82beea19cfb713993ad802ccda16868769979c6090a84/ruff-0.15.22-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72af58b951b0ae395935ae79763dc349bc0eb706319d28f7a33ad2cfb3cfc178", size = 10576719, upload-time = "2026-07-16T15:13:32.35Z" }, + { url = "https://files.pythonhosted.org/packages/bf/1e/3a13abd392a3b50b62e5938a831f9ab6e588358cacad5c18545b716d2182/ruff-0.15.22-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62d425005c1835eb24e2ee4161cb90e8db263415f4a71c8c72c33abaa6c0c224", size = 11376494, upload-time = "2026-07-16T15:13:35.958Z" }, + { url = "https://files.pythonhosted.org/packages/bf/3e/422d3d95bcf04dd78e1aeac22184d4f9a8fb2c01865d39d44618484a0317/ruff-0.15.22-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e8b9b3f8779a4f08c969defc3c8c35abffaa757e601ed5ae66d6d1db6519969a", size = 12208370, upload-time = "2026-07-16T15:13:39.185Z" }, + { url = "https://files.pythonhosted.org/packages/1e/91/5d065a0e0a02bf4813f5119ad278462eed081d2b832eb7c021ade0ec9e65/ruff-0.15.22-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1e0dd1b2e4d3d585f897a0d137cbf4eaf6223bef4e8ce34d6bb12556c5f9249e", size = 11581098, upload-time = "2026-07-16T15:13:42.132Z" }, + { url = "https://files.pythonhosted.org/packages/f6/f9/a0d4871d12fae702eb1f41b686caf05f1f8b124dc6db6f784f53d74918fa/ruff-0.15.22-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:365523eb91d9224e1bcb03b022fbf0facb8f9e23792a2c53d9d4b3924bdbdebb", size = 11399422, upload-time = "2026-07-16T15:13:45.2Z" }, + { url = "https://files.pythonhosted.org/packages/18/80/c843a5176cddbceb0b7e8dd41cf9993490796c1c469348d384f5a5c13c56/ruff-0.15.22-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:fabfd168afdf29fee5be98b831efa9683c94d7c5a3b58b9ce5a2e38444589a74", size = 11381683, upload-time = "2026-07-16T15:13:48.46Z" }, + { url = "https://files.pythonhosted.org/packages/d4/00/8485de0ae92239438a36cfc51350db9b9e85c9ebdfaea91b18e422706662/ruff-0.15.22-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:225dbf095a87f1d9f90f5fd7924d2613ee452a75a4308c63a8f50f761787aa7c", size = 10850295, upload-time = "2026-07-16T15:13:51.655Z" }, + { url = "https://files.pythonhosted.org/packages/fa/91/24977ec2ec72eaf15e4394ace2959fdff2dd1e14f03e005e838023407169/ruff-0.15.22-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1877d63b9d24ed278744f1523fd11b85540566d54641f97c566d7d9dc5ca5296", size = 10579640, upload-time = "2026-07-16T15:13:54.79Z" }, + { url = "https://files.pythonhosted.org/packages/9c/47/9b51216951974df1f263ac19da550d34252e0ed7218c25f10c5ef9ed7517/ruff-0.15.22-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a1606c510bd7215680d32efab38965f7cdec3ef69f5170a3f4791404ffdd5262", size = 11105077, upload-time = "2026-07-16T15:13:57.915Z" }, + { url = "https://files.pythonhosted.org/packages/c2/47/20e9d4a3b8016778acea5fc32bb50d35d207500a17ddb529ffa6996feef8/ruff-0.15.22-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:630479b18625f5ffc373f77603a22a9f8ac0acd7ff0501178b5db28ec71e9c64", size = 11490980, upload-time = "2026-07-16T15:14:01.032Z" }, + { url = "https://files.pythonhosted.org/packages/4d/76/3f72d8fc38c1cb77b38c56a70da9d0c17700cc1cc50f9649c9d3c8f5ba71/ruff-0.15.22-py3-none-win32.whl", hash = "sha256:e5ba0e4a13fd14abbed2a77b517a3911290c6c6c59ef67784328d1668fab76cf", size = 10789165, upload-time = "2026-07-16T15:14:04.16Z" }, + { url = "https://files.pythonhosted.org/packages/cb/46/4965251734c2b6fcdca1b1b187d20bcac3af0ee5b083b89c910bb961ce3a/ruff-0.15.22-py3-none-win_amd64.whl", hash = "sha256:9be63ba1eb936acd2d1342fb8337c356353706fce233b2a15a09a97037e6acde", size = 11938297, upload-time = "2026-07-16T15:14:07.316Z" }, + { url = "https://files.pythonhosted.org/packages/57/c9/e69b1ff4c8b69093ef08b8919ab767af0569666865b39c30a8795d88d3c6/ruff-0.15.22-py3-none-win_arm64.whl", hash = "sha256:e1168075b72158510839f250027659cdd78476f40507dd517892304c41318661", size = 11298172, upload-time = "2026-07-16T15:14:10.51Z" }, ] [[package]] @@ -3047,11 +3090,11 @@ wheels = [ [[package]] name = "tomlkit" -version = "0.15.0" +version = "0.15.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/51/db/03eaf4331631ef6b27d6e3c9b68c54dc6f0d63d87201fed600cc409307fd/tomlkit-0.15.0.tar.gz", hash = "sha256:7d1a9ecba3086638211b13814ea79c90dd54dd11993564376f3aa92271f5c7a3", size = 161875, upload-time = "2026-05-10T07:38:22.245Z" } +sdist = { url = "https://files.pythonhosted.org/packages/94/96/e07752635b98536177fa1f37671c8f3cdde2e724c6bcf6034b2cfb571565/tomlkit-0.15.1.tar.gz", hash = "sha256:e25bbf38843005246210a12982776f27f99cb9be67160e14434d0c0d21ee1e97", size = 180129, upload-time = "2026-07-17T01:48:04.562Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/6a/43/8bd850ee71a191bf072e31302c73a66be413fecdd98fdcd111ecbcce13ca/tomlkit-0.15.0-py3-none-any.whl", hash = "sha256:4dbc8f0fc024412b57ced8757ac7461305126a648ff8c2c807fcb8e133a78738", size = 41328, upload-time = "2026-05-10T07:38:23.517Z" }, + { url = "https://files.pythonhosted.org/packages/13/bc/8c13eb66537dce1d2bd3a57132902f38d0e7f5bb46fa9f4daed9fe9d76ee/tomlkit-0.15.1-py3-none-any.whl", hash = "sha256:177a05aece5a8ca5266fd3c448abb47b8d352f09d477d3ca8332db4d89b24304", size = 49449, upload-time = "2026-07-17T01:48:05.728Z" }, ] [[package]] @@ -3069,7 +3112,7 @@ wheels = [ [[package]] name = "typer" -version = "0.26.8" +version = "0.27.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "annotated-doc" }, @@ -3077,9 +3120,9 @@ dependencies = [ { name = "rich" }, { name = "shellingham" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/7c/f7/68adc395201b20b872d68e975386832e8005ffeacedd43a1d837a32815be/typer-0.26.8.tar.gz", hash = "sha256:c244a6bd558886fe3f8780efb6bdd28bb9aff005a94eedebaa5cb32926fe2f7e", size = 202097, upload-time = "2026-06-26T09:22:45.705Z" } +sdist = { url = "https://files.pythonhosted.org/packages/37/78/fda3361b56efc27944f24225f6ecd13d96d6fcfe37bd0eb34e2f4c63f9fc/typer-0.27.0.tar.gz", hash = "sha256:629bd12ea5d13a17148125d9a264f949eb171fb3f120f9b04d85873cab054fa5", size = 203430, upload-time = "2026-07-15T19:21:07.007Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/80/87/b9fd69c92c6102a066e1b86a35243f53e70bd4c709f2a26d9f4fee4f4dc0/typer-0.26.8-py3-none-any.whl", hash = "sha256:3512ca79ac5c11113414b36e80281b872884477722440691c89d1112e321a49c", size = 122564, upload-time = "2026-06-26T09:22:44.72Z" }, + { url = "https://files.pythonhosted.org/packages/40/03/26a383c9e58c213199d1aad1c3d353cfc22d4444ec6d2c0bf8ad02523843/typer-0.27.0-py3-none-any.whl", hash = "sha256:6f4b27631e47f077871b7dc30e933ec0131c1390fbe0e387ea5574b5bac9ccf1", size = 122716, upload-time = "2026-07-15T19:21:05.553Z" }, ] [[package]] @@ -3127,28 +3170,28 @@ wheels = [ [[package]] name = "uv" -version = "0.11.26" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d0/cb/5efc713948ddb10b00abfb51bfd429221c720175557f9c7965fea2448fe4/uv-0.11.26.tar.gz", hash = "sha256:2a433ece2ace088dd572d8abb0e6bd9a4ecb0e10bc9856447bbb37545f384f29", size = 4331220, upload-time = "2026-06-30T14:52:03.77Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c2/71/86dbffac9e26df28a16639c426cf4ba572aaf43d9231463e0dca337895b2/uv-0.11.26-py3-none-linux_armv6l.whl", hash = "sha256:fb97bf04512dfe16d86084e75d8129701fc8da9fb40de8746b73c3aa617c5897", size = 25197324, upload-time = "2026-06-30T14:50:51.75Z" }, - { url = "https://files.pythonhosted.org/packages/ec/80/525b73c8188e7052343e7109466a08fcd5195055aff4b0346ce3622e48cb/uv-0.11.26-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:a58a06e5a4b0035538d3ab4160ad74c716076ea7148eb3317171c6276ac020b4", size = 24179172, upload-time = "2026-06-30T14:50:56.52Z" }, - { url = "https://files.pythonhosted.org/packages/7b/5e/cf7b94ed3b1932c2a62573dcd388ad6c1da5c52111cd71ab7f20faa4a0aa/uv-0.11.26-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7b6d078d2ce83897884c2330c0676f27be4bf3d223fb2a409460f579fb5f0a98", size = 22949576, upload-time = "2026-06-30T14:51:00.538Z" }, - { url = "https://files.pythonhosted.org/packages/bf/fd/71fa021f6909c4139d8354bea623b5e0ef0ce4a08da250da1a1645528da2/uv-0.11.26-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:1cd9ba4951681ce17f1703106266fcbe27aaa7d37f07d53cce8b5686d68a8755", size = 24936673, upload-time = "2026-06-30T14:51:04.496Z" }, - { url = "https://files.pythonhosted.org/packages/7d/5e/273425e58a8812423e3d1f6c5da1015e636fbf13a83d104317ca37e16304/uv-0.11.26-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:e4f4c3268e69ac96f01972274a62f5f930c03cbc680adba6f21e63237ba3a639", size = 24719617, upload-time = "2026-06-30T14:51:08.419Z" }, - { url = "https://files.pythonhosted.org/packages/81/f8/1601e2acc7c54963814b4831eab996d8599e690712722c5acec5114860be/uv-0.11.26-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:efcbe0e187846f5ddba23bcaed17e4f9cd2463da5c45bdb5869616f686d713ff", size = 24734176, upload-time = "2026-06-30T14:51:12.685Z" }, - { url = "https://files.pythonhosted.org/packages/88/d2/a8a422e54c08cf4b8d51bedb9dbdd3cc233aa290ad8b3ee0438c0c02a3a5/uv-0.11.26-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:120ab2de93164d08cf5950f7fe18cbebe3ff670865ae41a292452bab2346477f", size = 26158780, upload-time = "2026-06-30T14:51:16.514Z" }, - { url = "https://files.pythonhosted.org/packages/db/e6/647fe5fdc888a3d27f79977877ce4e88052fe9be5398371e51bb134fc262/uv-0.11.26-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9052bf27c7ee426901f35a48715fa9288ce631c1878b91c9a6c950288f4b8633", size = 27009550, upload-time = "2026-06-30T14:51:20.659Z" }, - { url = "https://files.pythonhosted.org/packages/72/c2/85d8e762ad83b0f14fae2255b0578c4fd7dc915746f81b64ed786342627a/uv-0.11.26-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:efdddfcc9b1b790c5f7985c5c183c851682ced165b44ffa914f4947f5cad1fbf", size = 26183777, upload-time = "2026-06-30T14:51:24.715Z" }, - { url = "https://files.pythonhosted.org/packages/d3/00/478c3a870dcac690b8c337ee950a60a952e817f574945e85155c3cc0ab34/uv-0.11.26-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4dcf4e0b5b5cbdc242dcb002f1f8d99e7cf8c043609869228a9ce15e095c0b18", size = 26260589, upload-time = "2026-06-30T14:51:28.809Z" }, - { url = "https://files.pythonhosted.org/packages/a7/51/e4e43e106fb8cdc026b97491ea4600f4194a9c4da0b4e4e30c2a7dceb268/uv-0.11.26-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:866ae8d28f7381c15de0906a284c1e97916424c635bf40f7960b3fc889cd725e", size = 25073850, upload-time = "2026-06-30T14:51:32.717Z" }, - { url = "https://files.pythonhosted.org/packages/f2/c2/e772b7e6c8a835e8bf6739a391cdfc8e8e244c5c496d9b40625068b59ff4/uv-0.11.26-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:22f6d62e794b252ff3a1e2dfe5010cc76208f90b2c906e54971a0223ad6f16bc", size = 25682609, upload-time = "2026-06-30T14:51:36.888Z" }, - { url = "https://files.pythonhosted.org/packages/1a/69/ea77209a224a23a399cb7f6414f77ef032bd9e083e01199a0ebebf0d3ff2/uv-0.11.26-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:edd0c12b75141a6d830d138a91e366ad66e630f1c1dcaf83b8325b80cbacfcbb", size = 25800556, upload-time = "2026-06-30T14:51:40.937Z" }, - { url = "https://files.pythonhosted.org/packages/77/60/b6c0c03d2538a016b6624fa251960012e564ea02f841e958c7d60e974685/uv-0.11.26-py3-none-musllinux_1_1_i686.whl", hash = "sha256:af6a45b11a569cc4d2437e89a25a53dcf753f2a02a8f2de96be09b9b942cb3ec", size = 25385658, upload-time = "2026-06-30T14:51:45.103Z" }, - { url = "https://files.pythonhosted.org/packages/8d/e7/46881ff9164aa2e7c649901837d58eee3c57beb3b0fcc0fea6a4e40cf8f3/uv-0.11.26-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:c28822517d03aebbe9549aaaecc88ad580e4b2b6a927abffe5774a74d6ba09f6", size = 26551013, upload-time = "2026-06-30T14:51:49.062Z" }, - { url = "https://files.pythonhosted.org/packages/d6/94/380dad6c2bbe12417025aacd12cfc08322ed4c9dd8f760bff7035b86f22d/uv-0.11.26-py3-none-win32.whl", hash = "sha256:79e5c1b3410047e1962290c3b7b8f512d2c1bb95200c60b016f7729287cf34c0", size = 23947180, upload-time = "2026-06-30T14:51:53.065Z" }, - { url = "https://files.pythonhosted.org/packages/d0/13/9c588226d5b478328d739e654944430719f3ffe8999d6a24d425ec9664ab/uv-0.11.26-py3-none-win_amd64.whl", hash = "sha256:d95567e9470dc48ff03265f420c3c6973f6437f18a79d5e00b6eb4b2d9379907", size = 26909320, upload-time = "2026-06-30T14:51:57.235Z" }, - { url = "https://files.pythonhosted.org/packages/21/1d/ea66b12813878797126e2b3aca124b1c9c5ef53120702d1c00172f90a21d/uv-0.11.26-py3-none-win_arm64.whl", hash = "sha256:7e69d1569afbb936e7bf4e4ab2f72d606405f4a68f380f088a0b2233e84e056a", size = 25176820, upload-time = "2026-06-30T14:52:01.05Z" }, +version = "0.11.31" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/21/f0/501fe8a234ac96ea8869e84cb47b3bd77e39a0e80ee01950713e24fe1c4a/uv-0.11.31.tar.gz", hash = "sha256:763609d59721af5b8522e16deac6cffe8055f82bb837740c708917506f305185", size = 6045932, upload-time = "2026-07-22T01:48:45.407Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e7/6a/065e1e7feaf375eee8d1bb05e5276185708149dd48c27a230f320a0fc8bf/uv-0.11.31-py3-none-linux_armv6l.whl", hash = "sha256:6adaaf151f53fef04dec685f0816d304c09a091b2b609746f86ee7c55ada6bcd", size = 25838313, upload-time = "2026-07-22T01:47:21.787Z" }, + { url = "https://files.pythonhosted.org/packages/e1/15/529b573723a36badbda1e13a432c3b21a7554b8ddef3b20a2200037051c2/uv-0.11.31-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:2d84b6dd6b1eaf42fc923203d21a5efd052e1982e4f961eccecc2a6905ffbecd", size = 24795386, upload-time = "2026-07-22T01:47:26.882Z" }, + { url = "https://files.pythonhosted.org/packages/52/be/a809b3fe20c3d37bc667de33f38475c4c94f860979d07049ccddb6d91801/uv-0.11.31-py3-none-macosx_11_0_arm64.whl", hash = "sha256:335f3262c4350c004cf6e3b7061200148d670e579bcee7ba0e31c7535f125018", size = 23410594, upload-time = "2026-07-22T01:47:31.43Z" }, + { url = "https://files.pythonhosted.org/packages/c9/9a/ebaacd8b7713fd755d23623e0e8de78dfd001f6abc818034f2e9058035c7/uv-0.11.31-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:e1cf5803c39221387b2fe8be2b522b0529ac732831a2e52a92330e053539995e", size = 25358933, upload-time = "2026-07-22T01:47:36.544Z" }, + { url = "https://files.pythonhosted.org/packages/81/34/c30568a0f9e556be766c341106bf6ca2ef5c8067be6c11665a53df0549f1/uv-0.11.31-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:68ae6974ffbd04703e138654e83220a16e7b0b679271a8f209f928928dd399f8", size = 25346175, upload-time = "2026-07-22T01:47:41.132Z" }, + { url = "https://files.pythonhosted.org/packages/b5/63/18467b66f578dc121ec6d4af78074a0db06b27627b072fc433226a99a384/uv-0.11.31-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:48f7ec906eaebf9717a01ba0f7635cd0cac648ff5c8fff3a57b8805e6bd49078", size = 25381240, upload-time = "2026-07-22T01:47:45.659Z" }, + { url = "https://files.pythonhosted.org/packages/b8/43/b51d6b8ad1307f51dd75154d623d6a527c6de600086bb0446251047d2e5e/uv-0.11.31-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5a2cfd1638420f9a2a7dbca71c808edaf3929b6d8f4ec2ceac2f27014150d0e3", size = 26661822, upload-time = "2026-07-22T01:47:50.42Z" }, + { url = "https://files.pythonhosted.org/packages/30/9f/008c859ea3fc0d25d6ac32e1293a0795c737b0a472a8603b5e511b56659c/uv-0.11.31-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aec65d8f54403e60f32c50e44d98b6420de55211ad22a340927efc5db6ef4205", size = 27594901, upload-time = "2026-07-22T01:47:55.444Z" }, + { url = "https://files.pythonhosted.org/packages/f5/ca/65a2856e79a208f8a1ece0ac077fbee531db7455608c06ab677b2513cbc4/uv-0.11.31-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5610fea306dc6ce5021482d272e6372f0c3dfd1e24ec061f90b1b9287263ac58", size = 26708620, upload-time = "2026-07-22T01:48:00.2Z" }, + { url = "https://files.pythonhosted.org/packages/c4/c3/019ecbf3564d909c55fcf065592aff90b8b386d679e379caf356de4473f9/uv-0.11.31-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44ac79fca5807122676701279a1f36d7917a922f25a0ab5c5cf58a252f666e7e", size = 26894006, upload-time = "2026-07-22T01:48:04.929Z" }, + { url = "https://files.pythonhosted.org/packages/f6/9b/b67aa8736f9f82a9f99cec93c28d66d77ff42126914784a3f680bc737b56/uv-0.11.31-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:c4d4b34264017dc9047d0d49f09363a5e20b388481cddc39d5c44b16b3c2a57c", size = 25504398, upload-time = "2026-07-22T01:48:09.859Z" }, + { url = "https://files.pythonhosted.org/packages/44/d1/37e3a30f55e1c623fca484efbb80b6e157b922ee79f5cb7b1c0ff5005f0f/uv-0.11.31-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:9ce168c7323aee61ef07220c815f1b3e3a1b74241acb9f56c0b7fc4794dad600", size = 26307040, upload-time = "2026-07-22T01:48:14.555Z" }, + { url = "https://files.pythonhosted.org/packages/00/cc/f607ba28a93100c55b3e048838f85481f8b55a24e3a338e42c151f5884ae/uv-0.11.31-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:f3f8f58030ba4f711542d581b5fc3cde54db75a773fc873178f7b353f68f8711", size = 26425088, upload-time = "2026-07-22T01:48:19.204Z" }, + { url = "https://files.pythonhosted.org/packages/0d/ae/dd865e1d680799f05ff32895689700a23f37e905aac9807c93521fc76d8c/uv-0.11.31-py3-none-musllinux_1_1_i686.whl", hash = "sha256:b1384887f8a4a0b0dfb8c6c81b2f819d1771015a96c70f89ef12559df8206b28", size = 25920399, upload-time = "2026-07-22T01:48:23.866Z" }, + { url = "https://files.pythonhosted.org/packages/b8/0a/45ebfd783235a7a39ae1e99dc0bf26c083ea24a37584e530c7fbb6e38a21/uv-0.11.31-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:c6e052de498086b2014020536829b7e2b6f173ba95b07e55e9e0f85ac00a3927", size = 27126383, upload-time = "2026-07-22T01:48:28.376Z" }, + { url = "https://files.pythonhosted.org/packages/d9/c7/4cf78823c123efd3bdac50eb26f4b8fc2c222962d47918a7bb2b465b6522/uv-0.11.31-py3-none-win32.whl", hash = "sha256:03e18e463ecf0e1c347f901f9a8739059d07e2e2ebce72c0f8f1b9328a349c6f", size = 24644301, upload-time = "2026-07-22T01:48:33.094Z" }, + { url = "https://files.pythonhosted.org/packages/e1/4f/f2c3d0993ebab255a2dd7c476678c0307da03d890fb98761e8221d7bb043/uv-0.11.31-py3-none-win_amd64.whl", hash = "sha256:1a4bb0030d9070a4831a4f3115c5489998da7ca936e569a72696c90af469177a", size = 27699662, upload-time = "2026-07-22T01:48:37.708Z" }, + { url = "https://files.pythonhosted.org/packages/4e/8b/259e12b510c655f743f9a0e3171e6e9276dfd35a058d04d6aeef1fc4a897/uv-0.11.31-py3-none-win_arm64.whl", hash = "sha256:88ab5fdbeff4ab10ac890ab2dd01b7ad62b92251665423e4f68b1cf977fbe635", size = 25849721, upload-time = "2026-07-22T01:48:42.513Z" }, ] [[package]] @@ -3522,19 +3565,19 @@ provides-extras = ["cast-value-rs", "cli", "gpu", "optional", "remote"] dev = [ { name = "astroid", specifier = "==4.1.2" }, { name = "botocore" }, - { name = "coverage", specifier = "==7.14.3" }, + { name = "coverage", specifier = "==7.15.2" }, { name = "fsspec", specifier = ">=2023.10.0" }, { name = "griffe-inherited-docstrings", specifier = "==1.1.3" }, - { name = "hypothesis", specifier = "==6.155.7" }, - { name = "markdown-exec", extras = ["ansi"], specifier = "==1.12.1" }, + { name = "hypothesis", specifier = "==6.160.0" }, + { name = "markdown-exec", extras = ["ansi"], specifier = "==1.12.3" }, { name = "mike", specifier = "==2.2.0" }, { name = "mkdocs", specifier = "==1.6.1" }, - { name = "mkdocs-material", extras = ["imaging"], specifier = "==9.7.6" }, + { name = "mkdocs-material", extras = ["imaging"], specifier = "==9.7.7" }, { name = "mkdocs-redirects", specifier = "==1.2.3" }, - { name = "mkdocstrings", specifier = "==1.0.4" }, + { name = "mkdocstrings", specifier = "==1.0.6" }, { name = "mkdocstrings-python", specifier = "==2.0.5" }, { name = "moto", extras = ["s3", "server"], specifier = "==5.2.2" }, - { name = "mypy", specifier = "==2.1.0" }, + { name = "mypy", specifier = "==2.3.0" }, { name = "numcodecs", extras = ["msgpack"] }, { name = "numpydoc", specifier = "==1.10.0" }, { name = "obstore", specifier = ">=0.5.1" }, @@ -3546,35 +3589,35 @@ dev = [ { name = "pytest-cov", specifier = "==7.1.0" }, { name = "pytest-xdist", specifier = "==3.8.0" }, { name = "requests", specifier = "==2.34.2" }, - { name = "ruff", specifier = "==0.15.20" }, + { name = "ruff", specifier = "==0.15.22" }, { name = "s3fs", specifier = ">=2023.10.0" }, - { name = "tomlkit", specifier = "==0.15.0" }, + { name = "tomlkit", specifier = "==0.15.1" }, { name = "towncrier", specifier = "==25.8.0" }, { name = "universal-pathlib" }, - { name = "uv", specifier = "==0.11.26" }, + { name = "uv", specifier = "==0.11.31" }, ] docs = [ { name = "astroid", specifier = "==4.1.2" }, { name = "griffe-inherited-docstrings", specifier = "==1.1.3" }, - { name = "markdown-exec", extras = ["ansi"], specifier = "==1.12.1" }, + { name = "markdown-exec", extras = ["ansi"], specifier = "==1.12.3" }, { name = "mike", specifier = "==2.2.0" }, { name = "mkdocs", specifier = "==1.6.1" }, - { name = "mkdocs-material", extras = ["imaging"], specifier = "==9.7.6" }, + { name = "mkdocs-material", extras = ["imaging"], specifier = "==9.7.7" }, { name = "mkdocs-redirects", specifier = "==1.2.3" }, - { name = "mkdocstrings", specifier = "==1.0.4" }, + { name = "mkdocstrings", specifier = "==1.0.6" }, { name = "mkdocstrings-python", specifier = "==2.0.5" }, { name = "numcodecs", extras = ["msgpack"] }, { name = "pytest", specifier = "==9.1.1" }, - { name = "ruff", specifier = "==0.15.20" }, + { name = "ruff", specifier = "==0.15.22" }, { name = "s3fs", specifier = ">=2023.10.0" }, { name = "towncrier", specifier = "==25.8.0" }, ] release = [{ name = "towncrier", specifier = "==25.8.0" }] remote-tests = [ { name = "botocore" }, - { name = "coverage", specifier = "==7.14.3" }, + { name = "coverage", specifier = "==7.15.2" }, { name = "fsspec", specifier = ">=2023.10.0" }, - { name = "hypothesis", specifier = "==6.155.7" }, + { name = "hypothesis", specifier = "==6.160.0" }, { name = "moto", extras = ["s3", "server"], specifier = "==5.2.2" }, { name = "numpydoc", specifier = "==1.10.0" }, { name = "obstore", specifier = ">=0.5.1" }, @@ -3587,12 +3630,12 @@ remote-tests = [ { name = "pytest-xdist", specifier = "==3.8.0" }, { name = "requests", specifier = "==2.34.2" }, { name = "s3fs", specifier = ">=2023.10.0" }, - { name = "tomlkit", specifier = "==0.15.0" }, - { name = "uv", specifier = "==0.11.26" }, + { name = "tomlkit", specifier = "==0.15.1" }, + { name = "uv", specifier = "==0.11.31" }, ] test = [ - { name = "coverage", specifier = "==7.14.3" }, - { name = "hypothesis", specifier = "==6.155.7" }, + { name = "coverage", specifier = "==7.15.2" }, + { name = "hypothesis", specifier = "==6.160.0" }, { name = "numpydoc", specifier = "==1.10.0" }, { name = "pytest", specifier = "==9.1.1" }, { name = "pytest-accept", specifier = "==0.3.0" }, @@ -3601,6 +3644,6 @@ test = [ { name = "pytest-codspeed", specifier = "==5.0.3" }, { name = "pytest-cov", specifier = "==7.1.0" }, { name = "pytest-xdist", specifier = "==3.8.0" }, - { name = "tomlkit", specifier = "==0.15.0" }, - { name = "uv", specifier = "==0.11.26" }, + { name = "tomlkit", specifier = "==0.15.1" }, + { name = "uv", specifier = "==0.11.31" }, ] From 57e66d92ed26eb02ca3931f253de052c0a890042 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Thu, 30 Jul 2026 14:28:22 +0200 Subject: [PATCH 25/61] fix: reject malformed chunk keys in DefaultChunkKeyEncoding (#4219) * fix: reject malformed chunk keys in DefaultChunkKeyEncoding decode_chunk_key stripped a single leading character and split the rest, so any key at all decoded to something. "0/1" silently became (1,) -- the "0" was eaten as if it were the "c" prefix -- and a key written with one separator decoded wrongly under an encoding configured with the other. Validate the "c" prefix and raise ValueError when it is absent, so a key that is not a chunk key for this encoding is reported rather than silently misread. Adds the tests this method never had, covering the round trip for both separators and each way a key can fail to carry the prefix. Assisted-by: ClaudeCode:claude-fable-5 * Rename 250.bugfix.md to 4219.bugfix.md --- changes/4219.bugfix.md | 3 ++ src/zarr/core/chunk_key_encodings.py | 6 ++- tests/test_chunk_key_encodings.py | 65 ++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 changes/4219.bugfix.md create mode 100644 tests/test_chunk_key_encodings.py diff --git a/changes/4219.bugfix.md b/changes/4219.bugfix.md new file mode 100644 index 0000000000..728e8a7e3a --- /dev/null +++ b/changes/4219.bugfix.md @@ -0,0 +1,3 @@ +`DefaultChunkKeyEncoding.decode_chunk_key` now validates that a chunk key +starts with the configured `c` prefix and raises `ValueError` for +malformed keys, instead of silently decoding them incorrectly. diff --git a/src/zarr/core/chunk_key_encodings.py b/src/zarr/core/chunk_key_encodings.py index 098f2c8981..fb2fd95dee 100644 --- a/src/zarr/core/chunk_key_encodings.py +++ b/src/zarr/core/chunk_key_encodings.py @@ -79,7 +79,11 @@ def __post_init__(self) -> None: def decode_chunk_key(self, chunk_key: str) -> tuple[int, ...]: if chunk_key == "c": return () - return tuple(map(int, chunk_key[1:].split(self.separator))) + # Strip the "c" prefix (e.g. "c/" or "c.") before splitting. + prefix = "c" + self.separator + if chunk_key.startswith(prefix): + return tuple(map(int, chunk_key[len(prefix) :].split(self.separator))) + raise ValueError(f"Invalid chunk key for default encoding: {chunk_key!r}") def encode_chunk_key(self, chunk_coords: tuple[int, ...]) -> str: return self.separator.join(map(str, ("c",) + chunk_coords)) diff --git a/tests/test_chunk_key_encodings.py b/tests/test_chunk_key_encodings.py new file mode 100644 index 0000000000..dcc93b9249 --- /dev/null +++ b/tests/test_chunk_key_encodings.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +import pytest + +from zarr.core.chunk_key_encodings import DefaultChunkKeyEncoding, V2ChunkKeyEncoding + + +@pytest.mark.parametrize("separator", ["/", "."]) +@pytest.mark.parametrize( + "coords", + [(), (0,), (1, 2), (10, 0, 3)], +) +def test_default_encoding_round_trips(separator: str, coords: tuple[int, ...]) -> None: + """Encoding coordinates and decoding the result returns the coordinates.""" + encoding = DefaultChunkKeyEncoding(separator=separator) # type: ignore[arg-type] + + key = encoding.encode_chunk_key(coords) + assert encoding.decode_chunk_key(key) == coords + + +@pytest.mark.parametrize("separator", ["/", "."]) +@pytest.mark.parametrize("coords", [(0,), (1, 2), (10, 0, 3)]) +def test_v2_encoding_round_trips(separator: str, coords: tuple[int, ...]) -> None: + """The v2 encoding round-trips coordinates for either separator.""" + encoding = V2ChunkKeyEncoding(separator=separator) # type: ignore[arg-type] + + key = encoding.encode_chunk_key(coords) + assert encoding.decode_chunk_key(key) == coords + + +@pytest.mark.parametrize("separator", ["/", "."]) +def test_v2_zero_dimensional_key_is_ambiguous(separator: str) -> None: + """A 0-d v2 array stores its sole chunk under `"0"`, the same key a 1-d + array uses for chunk 0, so decoding cannot recover the empty tuple on its + own -- the array's dimensionality is what disambiguates it.""" + encoding = V2ChunkKeyEncoding(separator=separator) # type: ignore[arg-type] + + assert encoding.encode_chunk_key(()) == "0" + assert encoding.decode_chunk_key("0") == (0,) + + +@pytest.mark.parametrize( + "chunk_key", + [ + "0/1", # no "c" prefix at all + "c0/1", # "c" not followed by the separator + "x/0/1", # wrong prefix character + "", + ], +) +def test_default_encoding_rejects_key_without_prefix(chunk_key: str) -> None: + """A key that does not carry the `c` prefix is not a chunk key + for this encoding, and must be rejected rather than silently decoded.""" + encoding = DefaultChunkKeyEncoding(separator="/") + + with pytest.raises(ValueError, match="Invalid chunk key"): + encoding.decode_chunk_key(chunk_key) + + +def test_default_encoding_rejects_key_using_the_other_separator() -> None: + """A key encoded with `.` is not valid for a `/`-separated encoding.""" + encoding = DefaultChunkKeyEncoding(separator="/") + + with pytest.raises(ValueError, match="Invalid chunk key"): + encoding.decode_chunk_key("c.0.1") From 6f52da5b8ce4e28031f4ad6c3287795fec971105 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Thu, 30 Jul 2026 17:44:37 +0200 Subject: [PATCH 26/61] fix: gate fused sync fast paths on full store sync capability; wrappers forward it (#4206) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fused write gate checked only SupportsSetSync, but write_sync also needs get_sync (partial-chunk read-modify-write) and delete_sync (all-fill chunk cleanup): a set-sync-only store passed the gate, wrote some chunks, then died mid-batch with TypeError. And WrapperStore forwarded no *_sync method, so every wrapped store (e.g. LatencyStore) silently lost the sync fast path — latency benchmarks measured the async fallback while claiming to measure the fused sync path. Both gates now consult _store_supports_sync_io: structural membership in SupportsSyncStore (the full get/set/delete sync surface) combined with a per-instance _supports_sync_io opt-out (absent means capable). This is a private, interim convention pending a formal sync/async store architecture — the store-side twin of the codec-side _sync_capable convention from #4179 — deliberately not new public API. WrapperStore delegates the three sync methods and forwards the wrapped store's capability, so wrapping a sync store keeps the fast path and wrapping an async-only store falls back cleanly; LoggingStore logs the delegated sync calls. LatencyStore fixes: sync reads/writes now sleep the configured latency on the worker thread; get_ranges/get_partial_values route through the latency-injecting get instead of bypassing the wrapper; _with_store passes the raw (loc, scale) latency config instead of a single sampled float, so derived stores keep the distribution. Assisted-by: ClaudeCode:claude-fable-5 --- changes/4206.bugfix.md | 1 + src/zarr/abc/store.py | 47 +++++- src/zarr/codecs/sharding.py | 4 +- src/zarr/core/codec_pipeline.py | 32 ++-- src/zarr/experimental/cache_store.py | 10 ++ src/zarr/storage/_logging.py | 21 +++ src/zarr/storage/_wrapper.py | 42 ++++- src/zarr/testing/store.py | 80 ++++++++- tests/test_codec_pipeline_suite.py | 18 ++- tests/test_experimental/test_cache_store.py | 37 +++++ tests/test_fused_pipeline.py | 170 +++++++++++++++++++- tests/test_store/test_get_ranges.py | 8 +- tests/test_store/test_latency.py | 108 +++++++++++++ tests/test_store/test_wrapper.py | 50 +++++- 14 files changed, 596 insertions(+), 32 deletions(-) create mode 100644 changes/4206.bugfix.md diff --git a/changes/4206.bugfix.md b/changes/4206.bugfix.md new file mode 100644 index 0000000000..a01c969449 --- /dev/null +++ b/changes/4206.bugfix.md @@ -0,0 +1 @@ +Fixed `FusedCodecPipeline`'s gating of its synchronous fast paths: stores exposing only part of the sync surface (e.g. `set_sync` without `get_sync`) now fall back cleanly to the async path instead of failing mid-write, and `WrapperStore` now forwards `get_sync`/`set_sync`/`delete_sync` to the wrapped store so wrapped sync-capable stores keep the fast path. The capability decision uses a private, interim convention (`zarr.abc.store._store_supports_sync_io`) rather than new public API, pending a formal sync/async store architecture. Also fixed `LatencyStore`: synchronous reads and writes now pay the configured latency, `get_ranges`/`get_partial_values` no longer bypass latency injection, and derived stores (e.g. from `with_read_only`) keep a stochastic `(loc, scale)` latency configuration instead of freezing a single sample. diff --git a/src/zarr/abc/store.py b/src/zarr/abc/store.py index c60d2468c5..af528ec533 100644 --- a/src/zarr/abc/store.py +++ b/src/zarr/abc/store.py @@ -662,6 +662,15 @@ def delete_sync(self) -> None: ... @runtime_checkable class SupportsGetSync(Protocol): + """Store protocol for synchronous reads (`get_sync`). + + The store sync surface is all-or-nothing: a store implementing any of the + `*_sync` methods must implement all of them (`SupportsSyncStore`), because + consumers mix sync reads, writes, and deletes within one operation. + Capability-gated callers consult `_store_supports_sync_io` rather than the + individual protocols. + """ + def get_sync( self, key: str, @@ -673,16 +682,52 @@ def get_sync( @runtime_checkable class SupportsSetSync(Protocol): + """Store protocol for synchronous writes (`set_sync`). + + See `SupportsGetSync` for the all-or-nothing contract on the store sync + surface. + """ + def set_sync(self, key: str, value: Buffer) -> None: ... @runtime_checkable class SupportsDeleteSync(Protocol): + """Store protocol for synchronous deletes (`delete_sync`). + + See `SupportsGetSync` for the all-or-nothing contract on the store sync + surface. + """ + def delete_sync(self, key: str) -> None: ... @runtime_checkable -class SupportsSyncStore(SupportsGetSync, SupportsSetSync, SupportsDeleteSync, Protocol): ... +class SupportsSyncStore(SupportsGetSync, SupportsSetSync, SupportsDeleteSync, Protocol): + """The full store sync surface: `get_sync`, `set_sync`, and `delete_sync`.""" + + +def _store_supports_sync_io(store: object) -> bool: + """Whether `store` can serve the full synchronous IO surface right now. + + Structural membership in `SupportsSyncStore` is necessary but not always + sufficient: a store can present the `*_sync` methods while its ability to + run them depends on runtime state the type system cannot see. Wrapper + stores are the canonical case — `WrapperStore` delegates the sync methods + to the store it wraps, so they only work when the wrapped store is itself + sync-capable. Such stores opt out dynamically via a `_supports_sync_io` + attribute/property (absent means capable). + + This is an interim, private convention pending a formal sync/async store + architecture — the store-side twin of the codec-side `_sync_capable` + convention consulted by `zarr.abc.codec._codec_supports_sync`. + + Synchronous IO is all-or-nothing: consumers such as the fused codec + pipeline mix synchronous reads, writes, and deletes within one batch + (e.g. a partial-chunk write reads existing bytes and an all-fill chunk is + deleted), so a partial sync surface never satisfies this predicate. + """ + return isinstance(store, SupportsSyncStore) and getattr(store, "_supports_sync_io", True) async def set_or_delete(byte_setter: ByteSetter, value: Buffer | None) -> None: diff --git a/src/zarr/codecs/sharding.py b/src/zarr/codecs/sharding.py index cdfdae6c89..d8ca8bdf62 100644 --- a/src/zarr/codecs/sharding.py +++ b/src/zarr/codecs/sharding.py @@ -23,7 +23,7 @@ RangeByteRequest, Store, SuffixByteRequest, - SupportsGetSync, + _store_supports_sync_io, ) from zarr.codecs._deprecated_enum import _coerce_enum_input, _DeprecatedStrEnumMeta from zarr.codecs.bytes import BytesCodec @@ -1721,7 +1721,7 @@ def _load_partial_shard_maybe_sync( shard_dict: ShardMutableMapping = {} store = byte_getter.store if hasattr(byte_getter, "store") else None - if isinstance(store, Store) and isinstance(store, SupportsGetSync): + if isinstance(store, Store) and _store_supports_sync_io(store): # External store: coalesce via get_ranges_sync (mirrors get_ranges). byte_ranges = [byte_range for _, byte_range in chunk_coord_byte_ranges] try: diff --git a/src/zarr/core/codec_pipeline.py b/src/zarr/core/codec_pipeline.py index 92fd0970fe..597f338c42 100644 --- a/src/zarr/core/codec_pipeline.py +++ b/src/zarr/core/codec_pipeline.py @@ -331,8 +331,8 @@ async def _async_read_fallback( then scatters each decoded chunk into `out` at its `out_selection`. Used by both `BatchedCodecPipeline.read_batch` (non-partial-decode - branch) and `FusedCodecPipeline.read` (when the store is not a - `SupportsGetSync` / sync transform is unavailable). + branch) and `FusedCodecPipeline.read` (when the store does not advertise + sync IO / sync transform is unavailable). """ chunk_array_batch: list[NDBuffer | None] @@ -393,8 +393,8 @@ async def _async_write_fallback( if encoding produced `None` or the chunk dropped). Used by both `BatchedCodecPipeline.write_batch` (non-partial-encode - branch) and `FusedCodecPipeline.write` (when the store is not a - `SupportsSetSync` / sync transform is unavailable). + branch) and `FusedCodecPipeline.write` (when the store does not advertise + sync IO / sync transform is unavailable). """ if use_sync := ( @@ -1265,16 +1265,17 @@ async def read( return () # Fast path: sync transform plus synchronous IO. For StorePath the gate - # is on the STORE's sync support (StorePath always has a get_sync - # method, but it only works when its store does); for other byte - # getters (e.g. the sharding codec's in-memory _ShardingByteGetter) the - # SyncByteGetter protocol is the gate. - from zarr.abc.store import SupportsGetSync, SyncByteGetter + # is the STORE's sync-IO capability (`_store_supports_sync_io`) (StorePath always has a + # get_sync method, but it only works when its store implements the full + # sync surface); for other byte getters (e.g. the sharding codec's + # in-memory _ShardingByteGetter) the SyncByteGetter protocol is the + # gate. + from zarr.abc.store import SyncByteGetter, _store_supports_sync_io from zarr.storage._common import StorePath first_bg = batch[0][0] if self.sync_transform is not None and ( - (isinstance(first_bg, StorePath) and isinstance(first_bg.store, SupportsGetSync)) + (isinstance(first_bg, StorePath) and _store_supports_sync_io(first_bg.store)) or (not isinstance(first_bg, StorePath) and isinstance(first_bg, SyncByteGetter)) ): # One thread hop for the WHOLE batch — not per chunk, so the fused @@ -1328,14 +1329,17 @@ async def write( return # Fast path: sync transform plus synchronous IO. Mirrors `read`: gate - # StorePath on the store's sync support, other byte setters (e.g. the - # sharding codec's in-memory _ShardingByteSetter) on SyncByteSetter. - from zarr.abc.store import SupportsSetSync, SyncByteSetter + # StorePath on the store's sync-IO capability (`_store_supports_sync_io`) — write_sync + # needs the FULL sync surface (get_sync for partial-chunk + # read-modify-write, delete_sync for all-fill chunks), not just + # set_sync — and other byte setters (e.g. the sharding codec's + # in-memory _ShardingByteSetter) on SyncByteSetter. + from zarr.abc.store import SyncByteSetter, _store_supports_sync_io from zarr.storage._common import StorePath first_bs = batch[0][0] if self.sync_transform is not None and ( - (isinstance(first_bs, StorePath) and isinstance(first_bs.store, SupportsSetSync)) + (isinstance(first_bs, StorePath) and _store_supports_sync_io(first_bs.store)) or (not isinstance(first_bs, StorePath) and isinstance(first_bs, SyncByteSetter)) ): # One thread hop for the whole batch; see the matching comment in diff --git a/src/zarr/experimental/cache_store.py b/src/zarr/experimental/cache_store.py index dd50693ad9..20cb4d4c0f 100644 --- a/src/zarr/experimental/cache_store.py +++ b/src/zarr/experimental/cache_store.py @@ -329,6 +329,16 @@ async def _get_no_cache( await self._cache_miss(key, byte_range, result) return result + @property + def _supports_sync_io(self) -> bool: + # The caching logic lives only in the async get/set/delete overrides; + # the sync methods inherited from `WrapperStore` delegate straight to + # the source store, so a sync-capable consumer (the fused codec + # pipeline) would write and delete around the cache, leaving stale + # entries that later async reads serve as current data. Opt out of + # sync IO until the sync surface is cache-aware. + return False + async def get( self, key: str, diff --git a/src/zarr/storage/_logging.py b/src/zarr/storage/_logging.py index c6f58ccd61..cdf0731430 100644 --- a/src/zarr/storage/_logging.py +++ b/src/zarr/storage/_logging.py @@ -204,6 +204,27 @@ async def delete(self, key: str) -> None: with self.log(key): return await self._store.delete(key=key) + def get_sync( + self, + key: str, + *, + prototype: BufferPrototype | None = None, + byte_range: ByteRequest | None = None, + ) -> Buffer | None: + # docstring inherited + with self.log(key): + return super().get_sync(key, prototype=prototype, byte_range=byte_range) + + def set_sync(self, key: str, value: Buffer) -> None: + # docstring inherited + with self.log(key): + return super().set_sync(key, value) + + def delete_sync(self, key: str) -> None: + # docstring inherited + with self.log(key): + return super().delete_sync(key) + async def list(self) -> AsyncGenerator[str, None]: # docstring inherited with self.log(): diff --git a/src/zarr/storage/_wrapper.py b/src/zarr/storage/_wrapper.py index 37aeb8166f..6f498a655d 100644 --- a/src/zarr/storage/_wrapper.py +++ b/src/zarr/storage/_wrapper.py @@ -11,7 +11,13 @@ from zarr.abc.store import ByteRequest from zarr.core.buffer import BufferPrototype -from zarr.abc.store import Store +from zarr.abc.store import ( + Store, + SupportsDeleteSync, + SupportsGetSync, + SupportsSetSync, + _store_supports_sync_io, +) class WrapperStore[T_Store: Store](Store): @@ -149,6 +155,40 @@ def supports_writes(self) -> bool: def supports_deletes(self) -> bool: return self._store.supports_deletes + @property + def _supports_sync_io(self) -> bool: + # The delegating `*_sync` methods below make every wrapper structurally + # satisfy `SupportsSyncStore`; whether they can actually run depends on + # the wrapped store, so forward its capability (see + # `zarr.abc.store._store_supports_sync_io`). + return _store_supports_sync_io(self._store) + + def get_sync( + self, + key: str, + *, + prototype: BufferPrototype | None = None, + byte_range: ByteRequest | None = None, + ) -> Buffer | None: + """Forward `get_sync` to the wrapped store.""" + if not isinstance(self._store, SupportsGetSync): + raise TypeError(f"Store {type(self._store).__name__} does not support synchronous get.") + return self._store.get_sync(key, prototype=prototype, byte_range=byte_range) # type: ignore[unreachable] + + def set_sync(self, key: str, value: Buffer) -> None: + """Forward `set_sync` to the wrapped store.""" + if not isinstance(self._store, SupportsSetSync): + raise TypeError(f"Store {type(self._store).__name__} does not support synchronous set.") + self._store.set_sync(key, value) # type: ignore[unreachable] + + def delete_sync(self, key: str) -> None: + """Forward `delete_sync` to the wrapped store.""" + if not isinstance(self._store, SupportsDeleteSync): + raise TypeError( + f"Store {type(self._store).__name__} does not support synchronous delete." + ) + self._store.delete_sync(key) # type: ignore[unreachable] + async def delete(self, key: str) -> None: await self._store.delete(key) diff --git a/src/zarr/testing/store.py b/src/zarr/testing/store.py index d7011440e0..f64d8e9364 100644 --- a/src/zarr/testing/store.py +++ b/src/zarr/testing/store.py @@ -2,6 +2,7 @@ import asyncio import pickle +import time from abc import abstractmethod from typing import TYPE_CHECKING, Self @@ -10,6 +11,7 @@ from zarr.storage import WrapperStore if TYPE_CHECKING: + from collections.abc import AsyncIterator, Iterable, Sequence from typing import Any from zarr.core.buffer.core import BufferPrototype @@ -718,7 +720,10 @@ def set_latency(self) -> float: return max(0.0, np.random.normal(loc=self._set_latency[0], scale=self._set_latency[1])) def _with_store(self, store: Store) -> Self: - return type(self)(store, get_latency=self.get_latency, set_latency=self.set_latency) + # Pass the raw latency config, not the sampled `get_latency`/`set_latency` + # properties — sampling would freeze a `(loc, scale)` distribution into + # one fixed float on derived stores (e.g. via `with_read_only`). + return type(self)(store, get_latency=self._get_latency, set_latency=self._set_latency) async def set(self, key: str, value: Buffer) -> None: """ @@ -763,3 +768,76 @@ async def get( """ await asyncio.sleep(self.get_latency) return await self._store.get(key, prototype=prototype, byte_range=byte_range) + + def get_sync( + self, + key: str, + *, + prototype: BufferPrototype | None = None, + byte_range: ByteRequest | None = None, + ) -> Buffer | None: + """Add latency to `get_sync`. + + Sleeps `self.get_latency` on the calling thread (the sync path runs on + worker threads, not the event loop) before delegating to the wrapped + store. + """ + time.sleep(self.get_latency) + return super().get_sync(key, prototype=prototype, byte_range=byte_range) + + def set_sync(self, key: str, value: Buffer) -> None: + """Add latency to `set_sync`. + + Sleeps `self.set_latency` on the calling thread (the sync path runs on + worker threads, not the event loop) before delegating to the wrapped + store. + """ + time.sleep(self.set_latency) + super().set_sync(key, value) + + async def get_ranges( + self, + key: str, + byte_ranges: Sequence[ByteRequest | None], + *, + prototype: BufferPrototype, + max_concurrency: int | None = None, + max_gap_bytes: int | None = None, + max_coalesced_bytes: int | None = None, + ) -> AsyncIterator[Sequence[tuple[int, Buffer | None]]]: + """Byte-range reads built on `self.get`, so each fetch pays latency. + + Routes through the coalescing `Store.get_ranges` default instead of the + `WrapperStore` delegation, which would bypass this wrapper's `get` and + therefore the synthetic latency. `None` for a coalescing kwarg means + "use the `Store` default". + """ + kwargs: dict[str, int] = {} + if max_concurrency is not None: + kwargs["max_concurrency"] = max_concurrency + if max_gap_bytes is not None: + kwargs["max_gap_bytes"] = max_gap_bytes + if max_coalesced_bytes is not None: + kwargs["max_coalesced_bytes"] = max_coalesced_bytes + async for group in Store.get_ranges(self, key, byte_ranges, prototype=prototype, **kwargs): + yield group + + async def get_partial_values( + self, + prototype: BufferPrototype, + key_ranges: Iterable[tuple[str, ByteRequest | None]], + ) -> list[Buffer | None]: + """Partial-value reads built on `self.get`, so each fetch pays latency. + + Issues one `self.get` per `(key, byte_range)` pair instead of the + `WrapperStore` delegation, which would bypass this wrapper's `get` and + therefore the synthetic latency. + """ + return list( + await asyncio.gather( + *( + self.get(key, prototype=prototype, byte_range=byte_range) + for key, byte_range in key_ranges + ) + ) + ) diff --git a/tests/test_codec_pipeline_suite.py b/tests/test_codec_pipeline_suite.py index 07e1aa2ec4..f0376d185a 100644 --- a/tests/test_codec_pipeline_suite.py +++ b/tests/test_codec_pipeline_suite.py @@ -9,8 +9,8 @@ Each test also runs over a *store axis* that exercises both code paths the synchronous pipelines branch on: -* ``sync`` -> ``MemoryStore`` (supports ``get_sync``/``set_sync``: fast path) -* ``async`` -> ``LatencyStore(MemoryStore())`` (NOT sync-capable: async fallback) +* ``sync`` -> ``MemoryStore`` (full sync surface: fast path) +* ``async`` -> ``_NoSyncIOStore(MemoryStore())`` (NOT sync-capable: async fallback) The async axis is deliberate: a regression that only affects the async fallback of the default pipeline (e.g. a codec-spec-evolution bug that surfaces only on @@ -50,14 +50,22 @@ STORE_KINDS = ["sync", "async"] +class _NoSyncIOStore(LatencyStore): + """An in-memory store that advertises no sync IO capability, so a + synchronous pipeline must fall back to its async path. (A plain wrapper + won't do: `WrapperStore` forwards the wrapped store's sync capability.)""" + + @property + def _supports_sync_io(self) -> bool: + return False + + def _make_store(kind: str) -> Store: if kind == "sync": # MemoryStore supports get_sync/set_sync -> synchronous fast path. return MemoryStore() if kind == "async": - # LatencyStore is NOT SupportsGetSync/SupportsSetSync, so a synchronous - # pipeline must fall back to its async path. Zero latency keeps it fast. - return LatencyStore(MemoryStore(), get_latency=0.0, set_latency=0.0) + return _NoSyncIOStore(MemoryStore(), get_latency=0.0, set_latency=0.0) raise AssertionError(kind) diff --git a/tests/test_experimental/test_cache_store.py b/tests/test_experimental/test_cache_store.py index 5ad56a4335..f688a6ca02 100644 --- a/tests/test_experimental/test_cache_store.py +++ b/tests/test_experimental/test_cache_store.py @@ -1036,3 +1036,40 @@ async def test_delete_invalidates_cached_byte_ranges(self) -> None: # Key is gone from source result = await cached_store.get("key", proto) assert result is None + + +def test_cache_store_opts_out_of_sync_io() -> None: + """`CacheStore` must not advertise sync IO capability. + + Its caching logic lives only in the async `get`/`set`/`delete` overrides, + while the inherited `WrapperStore` sync methods delegate straight to the + source store. If the fused codec pipeline took the sync fast path, writes + and deletes would bypass the cache and later async reads would serve stale + entries. The opt-out forces sync-capable consumers onto the async path, + which keeps the cache coherent. + """ + from zarr.abc.store import _store_supports_sync_io + from zarr.storage import MemoryStore + + cached = CacheStore(MemoryStore(), cache_store=MemoryStore()) + assert _store_supports_sync_io(cached) is False + + +async def test_cache_coherent_after_fused_pipeline_write() -> None: + """Writing through the fused pipeline must not leave stale cache entries.""" + import numpy as np + + import zarr + from zarr.core.config import config as zarr_config + from zarr.storage import MemoryStore + + source = MemoryStore() + cached = CacheStore(source, cache_store=MemoryStore()) + with zarr_config.set({"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"}): + arr = zarr.create_array(cached, shape=(8,), chunks=(8,), dtype="int32", fill_value=0) + arr[:] = np.arange(8, dtype="int32") + np.testing.assert_array_equal(arr[:], np.arange(8)) + # Overwrite, then read back through the same cached handle: the read + # must observe the overwrite, not a cached copy of the first write. + arr[:] = np.arange(100, 108, dtype="int32") + np.testing.assert_array_equal(arr[:], np.arange(100, 108)) diff --git a/tests/test_fused_pipeline.py b/tests/test_fused_pipeline.py index 7fa3ef2277..5c712fa97a 100644 --- a/tests/test_fused_pipeline.py +++ b/tests/test_fused_pipeline.py @@ -16,6 +16,7 @@ ArrayBytesCodecPartialEncodeMixin, BytesBytesCodec, ) +from zarr.abc.store import Store, _store_supports_sync_io from zarr.codecs.bytes import BytesCodec from zarr.codecs.gzip import GzipCodec from zarr.codecs.transpose import TransposeCodec @@ -23,9 +24,13 @@ from zarr.core.codec_pipeline import FusedCodecPipeline from zarr.core.config import config as zarr_config from zarr.registry import register_codec -from zarr.storage import MemoryStore, StorePath +from zarr.storage import MemoryStore, StorePath, WrapperStore +from zarr.storage._utils import _normalize_byte_range_index +from zarr.testing.store import LatencyStore if TYPE_CHECKING: + from collections.abc import AsyncIterator, Callable, Iterable + from zarr.abc.store import ByteRequest from zarr.core.array_spec import ArraySpec from zarr.core.buffer import Buffer, BufferPrototype, NDBuffer @@ -1065,3 +1070,166 @@ def test_partial_mixin_codec_async_partial_only_round_trip(dtype: str) -> None: with zarr_config.set(_BATCHED): np.testing.assert_array_equal(zarr.open_array(store, mode="r")[:], expected) + + +# Sync-IO capability gating (`zarr.abc.store._store_supports_sync_io`) +# +# The fused read/write fast paths must engage iff the store advertises the +# FULL synchronous IO surface (get_sync + set_sync + delete_sync): write_sync +# needs get_sync for partial-chunk read-modify-write and delete_sync for +# all-fill chunk cleanup, so gating on any single protocol can crash +# mid-batch. Wrappers must forward the capability of the wrapped store. +# --------------------------------------------------------------------------- + + +class AsyncOnlyStore(Store): + """Dict-backed store implementing only the async `Store` surface (no `*_sync`).""" + + def __init__(self) -> None: + super().__init__(read_only=False) + self._data: dict[str, Buffer] = {} + + def __eq__(self, other: object) -> bool: + return other is self + + @property + def supports_writes(self) -> bool: + return True + + @property + def supports_deletes(self) -> bool: + return True + + @property + def supports_listing(self) -> bool: + return True + + async def get( + self, key: str, prototype: BufferPrototype, byte_range: ByteRequest | None = None + ) -> Buffer | None: + try: + value = self._data[key] + except KeyError: + return None + start, stop = _normalize_byte_range_index(value, byte_range) + return prototype.buffer.from_buffer(value[start:stop]) + + async def get_partial_values( + self, + prototype: BufferPrototype, + key_ranges: Iterable[tuple[str, ByteRequest | None]], + ) -> list[Buffer | None]: + return [await self.get(key, prototype, byte_range) for key, byte_range in key_ranges] + + async def exists(self, key: str) -> bool: + return key in self._data + + async def set(self, key: str, value: Buffer) -> None: + self._check_writable() + self._data[key] = value + + async def delete(self, key: str) -> None: + self._check_writable() + self._data.pop(key, None) + + async def list(self) -> AsyncIterator[str]: + for key in list(self._data): + yield key + + async def list_prefix(self, prefix: str) -> AsyncIterator[str]: + for key in list(self._data): + if key.startswith(prefix): + yield key + + async def list_dir(self, prefix: str) -> AsyncIterator[str]: + if prefix and not prefix.endswith("/"): + prefix += "/" + seen: set[str] = set() + for key in list(self._data): + if key.startswith(prefix): + head = key.removeprefix(prefix).split("/")[0] + if head not in seen: + seen.add(head) + yield head + + +class SetOnlySyncStore(AsyncOnlyStore): + """Implements `set_sync` but not `get_sync`/`delete_sync` (partial sync surface).""" + + def set_sync(self, key: str, value: Buffer) -> None: + self._check_writable() + self._data[key] = value + + +@pytest.mark.parametrize( + ("store_factory", "expect_sync_path"), + [ + (MemoryStore, True), + (lambda: WrapperStore(MemoryStore()), True), + (lambda: LatencyStore(MemoryStore()), True), + (SetOnlySyncStore, False), + (lambda: WrapperStore(AsyncOnlyStore()), False), + ], + ids=[ + "full-sync", + "wrapper-of-sync", + "latency-wrapper-of-sync", + "set-sync-only", + "wrapper-of-async-only", + ], +) +def test_sync_io_capability_gates_fused_paths( + store_factory: Callable[[], Store], expect_sync_path: bool +) -> None: + """The fused pipeline takes the sync fast path iff the store satisfies + `_store_supports_sync_io`, + and every store round-trips correctly through full writes, partial + (read-modify-write) writes, and all-fill (delete) writes — a store with a + partial sync surface must get a clean async fallback, never a mid-batch + error.""" + from unittest.mock import patch + + store = store_factory() + assert _store_supports_sync_io(store) is expect_sync_path + + calls = {"read_sync": 0, "write_sync": 0} + orig_read_sync = FusedCodecPipeline.read_sync + orig_write_sync = FusedCodecPipeline.write_sync + + def spy_read_sync(self: FusedCodecPipeline, *args: Any, **kwargs: Any) -> Any: + calls["read_sync"] += 1 + return orig_read_sync(self, *args, **kwargs) + + def spy_write_sync(self: FusedCodecPipeline, *args: Any, **kwargs: Any) -> Any: + calls["write_sync"] += 1 + return orig_write_sync(self, *args, **kwargs) + + with zarr_config.set({"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"}): + arr = zarr.create_array( + store=store, + shape=(8,), + chunks=(4,), + dtype="uint8", + compressors=None, + fill_value=0, + ) + assert isinstance(arr._async_array.codec_pipeline, FusedCodecPipeline) + with ( + patch.object(FusedCodecPipeline, "read_sync", spy_read_sync), + patch.object(FusedCodecPipeline, "write_sync", spy_write_sync), + ): + data = np.arange(8, dtype="uint8") + arr[:] = data # complete-chunk writes + arr[:3] = 7 # partial write -> read-modify-write needs get + data[:3] = 7 + np.testing.assert_array_equal(arr[:], data) + arr[4:8] = 0 # all-fill chunk -> delete needed + data[4:8] = 0 + np.testing.assert_array_equal(arr[:], data) + + if expect_sync_path: + assert calls["write_sync"] > 0, "sync-capable store did not take the sync write path" + assert calls["read_sync"] > 0, "sync-capable store did not take the sync read path" + else: + assert calls["write_sync"] == 0, "non-sync store took the sync write path" + assert calls["read_sync"] == 0, "non-sync store took the sync read path" diff --git a/tests/test_store/test_get_ranges.py b/tests/test_store/test_get_ranges.py index f04251adf4..522d6565aa 100644 --- a/tests/test_store/test_get_ranges.py +++ b/tests/test_store/test_get_ranges.py @@ -16,12 +16,12 @@ from zarr.abc.store import RangeByteRequest from zarr.core.buffer import default_buffer_prototype -from zarr.storage import MemoryStore +from zarr.storage import MemoryStore, ZipStore from zarr.storage._wrapper import WrapperStore -from zarr.testing.store import LatencyStore if TYPE_CHECKING: from collections.abc import AsyncIterator, Sequence + from pathlib import Path from zarr.abc.store import ByteRequest from zarr.core.buffer import Buffer, BufferPrototype @@ -89,11 +89,11 @@ def test_get_ranges_sync_missing_key_raises() -> None: store.get_ranges_sync("does-not-exist", [RangeByteRequest(0, 10)], prototype=proto) -def test_get_ranges_sync_on_non_sync_store_raises_type_error() -> None: +def test_get_ranges_sync_on_non_sync_store_raises_type_error(tmp_path: Path) -> None: """`get_ranges_sync` requires the store to support synchronous reads (`SupportsGetSync`); a non-sync store raises TypeError rather than silently falling back.""" - store = LatencyStore(MemoryStore(), get_latency=0.0, set_latency=0.0) + store = ZipStore(tmp_path / "store.zip", mode="w") proto = default_buffer_prototype() with pytest.raises(TypeError, match="does not support synchronous reads"): store.get_ranges_sync("k", [RangeByteRequest(0, 10)], prototype=proto) diff --git a/tests/test_store/test_latency.py b/tests/test_store/test_latency.py index 38ffb17dd6..9cb71fd6a0 100644 --- a/tests/test_store/test_latency.py +++ b/tests/test_store/test_latency.py @@ -1,8 +1,16 @@ from __future__ import annotations +import time +from unittest.mock import patch + +import numpy as np import pytest +import zarr +from zarr.abc.store import RangeByteRequest from zarr.core.buffer import default_buffer_prototype +from zarr.core.codec_pipeline import FusedCodecPipeline +from zarr.core.config import config as zarr_config from zarr.storage import MemoryStore from zarr.testing.store import LatencyStore @@ -55,3 +63,103 @@ async def test_latency_store_with_read_only_round_trip() -> None: # The original read-only wrapper remains read-only assert latency_ro.read_only + + +@pytest.mark.parametrize( + ("get_latency", "set_latency"), + [ + (0.01, 0.02), + ((0.1, 0.05), (0.2, 0.01)), + ], + ids=["scalar", "distribution"], +) +def test_with_store_preserves_latency_config( + get_latency: float | tuple[float, float], set_latency: float | tuple[float, float] +) -> None: + """Derived stores (e.g. via `with_read_only`) keep the raw latency config — + a `(loc, scale)` distribution must not collapse to one sampled float.""" + store = LatencyStore(MemoryStore(), get_latency=get_latency, set_latency=set_latency) + derived = store.with_read_only(True) + assert derived._get_latency == store._get_latency + assert derived._set_latency == store._set_latency + + +def test_sync_methods_inject_latency(monkeypatch: pytest.MonkeyPatch) -> None: + """`get_sync`/`set_sync` sleep the configured latency on the calling thread + before delegating to the wrapped store.""" + sleeps: list[float] = [] + monkeypatch.setattr(time, "sleep", sleeps.append) + + store = LatencyStore(MemoryStore(), get_latency=0.123, set_latency=0.456) + buf = default_buffer_prototype().buffer.from_bytes(b"abcd") + store.set_sync("key", buf) + assert sleeps == [pytest.approx(0.456)] + out = store.get_sync("key", prototype=default_buffer_prototype()) + assert out is not None + assert out.to_bytes() == b"abcd" + assert sleeps == [pytest.approx(0.456), pytest.approx(0.123)] + + +async def test_get_ranges_pays_latency_per_fetch() -> None: + """`get_ranges` routes through the coalescing default built on `self.get`, + so each merged fetch pays the configured latency instead of bypassing it + via WrapperStore delegation. Two ranges further apart than `max_gap_bytes` + cannot coalesce -> exactly two `get` calls.""" + proto = default_buffer_prototype() + inner = MemoryStore() + await inner.set("blob", proto.buffer.from_bytes(bytes(4 << 20))) + store = LatencyStore(inner, get_latency=0.0) + + requests = [RangeByteRequest(0, 10), RangeByteRequest(2 << 20, (2 << 20) + 10)] + results: list[tuple[int, object]] = [] + with patch.object(store, "get", wraps=store.get) as get_spy: + async for group in store.get_ranges("blob", requests, prototype=proto): + results.extend(group) + assert get_spy.await_count == 2 + assert sorted(idx for idx, _ in results) == [0, 1] + for _, buf in results: + assert buf is not None + assert len(buf) == 10 # type: ignore[arg-type] + + +async def test_get_partial_values_routes_through_get() -> None: + """`get_partial_values` issues one `self.get` per key-range so each fetch + pays the configured latency instead of bypassing it via WrapperStore + delegation.""" + proto = default_buffer_prototype() + inner = MemoryStore() + await inner.set("blob", proto.buffer.from_bytes(b"0123456789")) + store = LatencyStore(inner, get_latency=0.0) + + with patch.object(store, "get", wraps=store.get) as get_spy: + results = await store.get_partial_values( + proto, [("blob", RangeByteRequest(0, 4)), ("blob", None)] + ) + assert get_spy.await_count == 2 + assert results[0] is not None + assert results[0].to_bytes() == b"0123" + assert results[1] is not None + assert results[1].to_bytes() == b"0123456789" + + +def test_latency_store_engages_fused_sync_path() -> None: + """A LatencyStore wrapping a sync-capable store must take the fused sync + fast path: reads go through the inner store's `get_sync`, not the async + fallback.""" + inner = MemoryStore() + store = LatencyStore(inner, get_latency=0.0, set_latency=0.0) + with zarr_config.set({"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"}): + arr = zarr.create_array( + store=store, + shape=(8,), + chunks=(4,), + dtype="uint8", + compressors=None, + fill_value=0, + ) + assert isinstance(arr._async_array.codec_pipeline, FusedCodecPipeline) + data = np.arange(8, dtype="uint8") + arr[:] = data + with patch.object(inner, "get_sync", wraps=inner.get_sync) as get_sync_spy: + np.testing.assert_array_equal(arr[:], data) + assert get_sync_spy.call_count == 2 # one per chunk diff --git a/tests/test_store/test_wrapper.py b/tests/test_store/test_wrapper.py index b34a63d5d0..e556a108c5 100644 --- a/tests/test_store/test_wrapper.py +++ b/tests/test_store/test_wrapper.py @@ -4,12 +4,12 @@ import pytest -from zarr.abc.store import ByteRequest, Store +from zarr.abc.store import ByteRequest, Store, _store_supports_sync_io from zarr.core.buffer import Buffer from zarr.core.buffer.cpu import Buffer as CPUBuffer from zarr.core.buffer.cpu import buffer_prototype -from zarr.storage import LocalStore, WrapperStore -from zarr.testing.store import StoreTests +from zarr.storage import LocalStore, MemoryStore, WrapperStore, ZipStore +from zarr.testing.store import LatencyStore, StoreTests if TYPE_CHECKING: from pathlib import Path @@ -123,3 +123,47 @@ async def get( await store_wrapped.get(key, buffer_prototype) captured = capsys.readouterr() assert f"getting {key}" in captured.out + + +@pytest.mark.parametrize( + ("store_factory", "expected"), + [ + (lambda tmp: MemoryStore(), True), + (lambda tmp: LocalStore(str(tmp)), True), + (lambda tmp: WrapperStore(MemoryStore()), True), + (lambda tmp: LatencyStore(MemoryStore()), True), + (lambda tmp: ZipStore(tmp / "store.zip", mode="w"), False), + (lambda tmp: WrapperStore(ZipStore(tmp / "store.zip", mode="w")), False), + ], + ids=[ + "memory", + "local", + "wrapper-of-memory", + "latency-wrapper-of-memory", + "zip", + "wrapper-of-zip", + ], +) +def test_supports_sync_io(store_factory: Any, expected: bool, tmp_path: Path | Any) -> None: + """`_store_supports_sync_io` is True only for stores implementing the full + sync surface (get_sync + set_sync + delete_sync); wrappers forward the + wrapped store's capability via `_supports_sync_io`.""" + assert _store_supports_sync_io(store_factory(tmp_path)) is expected + + +def test_wrapper_get_sync_without_inner_sync_raises(tmp_path: Any) -> None: + store = WrapperStore(ZipStore(tmp_path / "store.zip", mode="w")) + with pytest.raises(TypeError, match="does not support synchronous get"): + store.get_sync("key") + + +def test_wrapper_set_sync_without_inner_sync_raises(tmp_path: Any) -> None: + store = WrapperStore(ZipStore(tmp_path / "store.zip", mode="w")) + with pytest.raises(TypeError, match="does not support synchronous set"): + store.set_sync("key", CPUBuffer.from_bytes(b"data")) + + +def test_wrapper_delete_sync_without_inner_sync_raises(tmp_path: Any) -> None: + store = WrapperStore(ZipStore(tmp_path / "store.zip", mode="w")) + with pytest.raises(TypeError, match="does not support synchronous delete"): + store.delete_sync("key") From 53e6dc66b834988912194985a1051ad4db4f0141 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Thu, 30 Jul 2026 18:32:00 +0200 Subject: [PATCH 27/61] docs: dev blog, performance examples, and compiled 3.3.0 release notes (#4191) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a development blog to the documentation site with a 3.3.0 release post covering the FusedCodecPipeline and sharded partial-read coalescing, plus two runnable examples referenced by the post (examples/codec_pipeline_performance, examples/sharding_coalescing). Compiles every pending changelog fragment into a single 3.3.0 release notes section dated 2026-07-30, merging it with the section compiled earlier in #4148, and empties changes/ — making this commit suitable to tag as v3.3.0. Assisted-by: ClaudeCode:claude-fable-5 --- changes/3352.bugfix.md | 3 - changes/4128.feature.md | 1 - changes/4157.bugfix.md | 11 - changes/4172.misc.md | 7 - changes/4179.bugfix.md | 1 - changes/4183.bugfix.md | 3 - changes/4187.feature.md | 4 - changes/4194.bugfix.md | 10 - changes/4199.bugfix.md | 1 - changes/4201.bugfix.md | 1 - changes/4202.bugfix.md | 10 - changes/4203.bugfix.md | 1 - changes/4204.bugfix.md | 16 -- changes/4205.bugfix.md | 9 - changes/4206.bugfix.md | 1 - changes/4219.bugfix.md | 3 - docs/blog/.authors.yml | 6 + docs/blog/index.md | 3 + docs/blog/posts/3.3.0-release.md | 169 +++++++++++++ docs/release-notes.md | 134 +++++++++-- .../examples/codec_pipeline_performance.md | 7 + .../examples/sharding_coalescing.md | 7 + examples/codec_pipeline_performance/README.md | 59 +++++ .../codec_pipeline_performance.py | 214 +++++++++++++++++ examples/sharding_coalescing/README.md | 63 +++++ .../sharding_coalescing.py | 226 ++++++++++++++++++ mkdocs.yml | 12 + 27 files changed, 876 insertions(+), 106 deletions(-) delete mode 100644 changes/3352.bugfix.md delete mode 100644 changes/4128.feature.md delete mode 100644 changes/4157.bugfix.md delete mode 100644 changes/4172.misc.md delete mode 100644 changes/4179.bugfix.md delete mode 100644 changes/4183.bugfix.md delete mode 100644 changes/4187.feature.md delete mode 100644 changes/4194.bugfix.md delete mode 100644 changes/4199.bugfix.md delete mode 100644 changes/4201.bugfix.md delete mode 100644 changes/4202.bugfix.md delete mode 100644 changes/4203.bugfix.md delete mode 100644 changes/4204.bugfix.md delete mode 100644 changes/4205.bugfix.md delete mode 100644 changes/4206.bugfix.md delete mode 100644 changes/4219.bugfix.md create mode 100644 docs/blog/.authors.yml create mode 100644 docs/blog/index.md create mode 100644 docs/blog/posts/3.3.0-release.md create mode 100644 docs/user-guide/examples/codec_pipeline_performance.md create mode 100644 docs/user-guide/examples/sharding_coalescing.md create mode 100644 examples/codec_pipeline_performance/README.md create mode 100644 examples/codec_pipeline_performance/codec_pipeline_performance.py create mode 100644 examples/sharding_coalescing/README.md create mode 100644 examples/sharding_coalescing/sharding_coalescing.py diff --git a/changes/3352.bugfix.md b/changes/3352.bugfix.md deleted file mode 100644 index 7461486776..0000000000 --- a/changes/3352.bugfix.md +++ /dev/null @@ -1,3 +0,0 @@ -Fix `zarr.api.asynchronous.open_like` so it can create a new array by default when the -target path does not already exist. It now defaults to `mode="a"`; when using a read-only -store to open an existing array, pass `mode="r"` explicitly. diff --git a/changes/4128.feature.md b/changes/4128.feature.md deleted file mode 100644 index c62a615ac2..0000000000 --- a/changes/4128.feature.md +++ /dev/null @@ -1 +0,0 @@ -Added `Group.get_array`, `Group.get_group`, `AsyncGroup.get_array`, and `AsyncGroup.get_group`: type-safe accessors that return the child array or group at a given path, raising `ArrayNotFoundError` / `GroupNotFoundError` if no node exists there, and `ContainsGroupError` / `ContainsArrayError` if the node is not of the requested kind. Unlike `Group.__getitem__`, which returns `Array | Group`, these methods have precise return types. Nested paths like `"subgroup/subarray"` are supported. diff --git a/changes/4157.bugfix.md b/changes/4157.bugfix.md deleted file mode 100644 index 6b0d0fcc67..0000000000 --- a/changes/4157.bugfix.md +++ /dev/null @@ -1,11 +0,0 @@ -`MemoryStore` now copies buffers as they are written, so it never retains the -caller's memory. Previously an uncompressed write handed the store a zero-copy -view of the user's array, and mutating that array afterwards would silently -rewrite chunks already committed to the store. - -Only `MemoryStore` is affected: stores that serialize on write, such as -`LocalStore` and `ZipStore`, never aliased the caller's memory. Uncompressed -writes to a `MemoryStore` are correspondingly slower, since the copy that makes -the stored data independent is now actually performed; compressed writes are -unchanged. Buffers supplied through the `store_dict` argument remain the -caller's responsibility and are stored as-is. diff --git a/changes/4172.misc.md b/changes/4172.misc.md deleted file mode 100644 index 0be7226476..0000000000 --- a/changes/4172.misc.md +++ /dev/null @@ -1,7 +0,0 @@ -Improved `CoordinateIndexer` construction for large, sorted, in-bounds, one-dimensional integer -coordinate selections over regular chunk grids (e.g. `arr.get_coordinate_selection(sorted_idx)`, -`arr.vindex[sorted_idx]`, and the gather behind sparse/CSR row selections). When boundary searching -is estimated to be cheaper than processing every coordinate, per-chunk projections are now built -with `searchsorted`, making index construction ~15x faster for large gathers. Sparse sorted -selections spanning many chunks relative to their coordinate count, as well as unsorted, negative, -multi-dimensional, and irregular-grid selections, continue to use the existing implementation. diff --git a/changes/4179.bugfix.md b/changes/4179.bugfix.md deleted file mode 100644 index e02523114c..0000000000 --- a/changes/4179.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Fixed the opt-in `FusedCodecPipeline` for sharded arrays whose inner or index codec chain contains a codec implementing only the async codec interface (no `SupportsSyncCodec`). Such arrays previously raised `TypeError: All codecs must implement SupportsSyncCodec` on both read and write; the pipeline now declines its synchronous fast path for them and falls back to the async path, matching the behavior of the default `BatchedCodecPipeline`. Fully sync-capable codec chains keep the fast path unchanged. diff --git a/changes/4183.bugfix.md b/changes/4183.bugfix.md deleted file mode 100644 index 809708f596..0000000000 --- a/changes/4183.bugfix.md +++ /dev/null @@ -1,3 +0,0 @@ -Fixed `TypeError: unhashable type: 'writeable void-scalar'` when writing to sharded arrays whose fill value is a `np.void` scalar, e.g. arrays with a structured dtype. - -`ArraySpec` equality and hashing now compare the fill value by its byte representation rather than numeric equality. As a result, two specs with a `NaN` (or `NaT`) fill value now compare equal, while fill values of `-0.0` and `0.0` now compare unequal. This also restores the sharding codec's per-chunk spec cache, which had been disabled because of this bug. diff --git a/changes/4187.feature.md b/changes/4187.feature.md deleted file mode 100644 index 87133e2034..0000000000 --- a/changes/4187.feature.md +++ /dev/null @@ -1,4 +0,0 @@ -`ZipStore` now accepts an open binary file-like object in place of a path, enabling -zip archives on remote storage (e.g. a file opened with `fsspec` or an -`obstore.ReadableFile`). Operations that require a filesystem location -(`clear`, `move`) raise `NotImplementedError` for file-object-backed stores. diff --git a/changes/4194.bugfix.md b/changes/4194.bugfix.md deleted file mode 100644 index 21a4924664..0000000000 --- a/changes/4194.bugfix.md +++ /dev/null @@ -1,10 +0,0 @@ -`FusedCodecPipeline` no longer runs chunk IO and codec compute on the thread -driving zarr's internal event loop. Previously each read/write executed its -synchronous fast path inline on that loop thread, and because every sync-API -call from every user thread is serviced by the same loop, concurrent -operations serialized behind each other's codec work — reported as the fused -pipeline being slower than `BatchedCodecPipeline` for zstd-compressed data -under multi-threaded (e.g. dask) access. The synchronous batch now runs on a -worker thread (one hop per batch, not per chunk), keeping the loop free. -Multi-threaded single-chunk reads of zstd data are ~4.5x faster than before -and now scale with reader threads; single-threaded performance is unchanged. diff --git a/changes/4199.bugfix.md b/changes/4199.bugfix.md deleted file mode 100644 index d0c522cd7e..0000000000 --- a/changes/4199.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -The end-to-end benchmarks no longer invoke `sudo` to drop the OS page cache during a regular `pytest` run. Cache clearing is now opt-in via the `ZARR_BENCHMARK_CLEAR_CACHE` environment variable, which the benchmark CI jobs set. diff --git a/changes/4201.bugfix.md b/changes/4201.bugfix.md deleted file mode 100644 index d837a8a9e2..0000000000 --- a/changes/4201.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Fixed the opt-in `FusedCodecPipeline` for serializers that advertise the partial-decode/encode mixins with only the documented async partial methods: the partial dispatch previously asserted on the private `_decode_partial_sync`/`_encode_partial_sync` hooks (an `AssertionError`, or an `AttributeError` mid-IO under `python -O`); such codecs now take the full-chunk sync path. diff --git a/changes/4202.bugfix.md b/changes/4202.bugfix.md deleted file mode 100644 index 6130fc5b33..0000000000 --- a/changes/4202.bugfix.md +++ /dev/null @@ -1,10 +0,0 @@ -Fixed `FusedCodecPipeline` (the opt-in synchronous pipeline) silently skipping -array-array/bytes-bytes codecs placed outside a sharding serializer on its -partial-decode/partial-encode fast paths. With an outer compressor (e.g. -`compressors=[GzipCodec()]` around a `ShardingCodec` serializer), the fused -pipeline wrote non-conforming stored bytes that `BatchedCodecPipeline` (and any -other conforming reader) could not read, and could fail to read data that -`BatchedCodecPipeline` had written. With an outer array-array codec (e.g. -`TransposeCodec`), it silently returned wrong data in both directions with no -error. Only the opt-in `FusedCodecPipeline` was affected; the default -`BatchedCodecPipeline` was never impacted. diff --git a/changes/4203.bugfix.md b/changes/4203.bugfix.md deleted file mode 100644 index 42ca977193..0000000000 --- a/changes/4203.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Fixed silent data corruption in the experimental `FusedCodecPipeline`: reordering or duplicating fancy-index reads (e.g. `arr[perm, :]`, `arr.oindex[[0, 0, 1], :]`) on uncompressed, crc-free sharded arrays could return the shard in natural order because the vectorized whole-shard decode accepted any selection whose output shape matched the shard shape. The bulk decode now fires only for identity full-shard reads, declines structured dtypes (whose byte-order handling it lacks), and requires shard-index offsets to exactly tile the data section, so corrupt indexes with overlapping or out-of-range offsets can no longer be served as array data. diff --git a/changes/4204.bugfix.md b/changes/4204.bugfix.md deleted file mode 100644 index 90101d1059..0000000000 --- a/changes/4204.bugfix.md +++ /dev/null @@ -1,16 +0,0 @@ -`ManagedMemoryStore.get_sync`/`set_sync`/`delete_sync` now apply the store's -`path` prefix, matching the async `get`/`set`/`delete` methods. Previously the -sync methods were inherited unchanged from `MemoryStore` and used the raw key, -so code that takes the sync fast path (e.g. `FusedCodecPipeline`) would read -and write chunks outside the store's `path` prefix, silently returning fill -values when the data was re-read through a fresh handle. `GpuMemoryStore.set_sync` -now converts its value to a `gpu.Buffer`, matching `set`, so writes through the -sync API keep the store's all-values-are-GPU invariant. Also fixed -`ManagedMemoryStore.get_partial_values` applying its `path` prefix twice -whenever `path` is non-empty, which made it always return `None` for every -requested key. - -The shared store test suite (`zarr.testing.store.StoreTests`) gained -sync/async parity checks — comparing sync and async observations of the same -key on the same store instance, including with a `byte_range` — so every -store subclass now exercises this invariant. diff --git a/changes/4205.bugfix.md b/changes/4205.bugfix.md deleted file mode 100644 index 0492febb7d..0000000000 --- a/changes/4205.bugfix.md +++ /dev/null @@ -1,9 +0,0 @@ -Fixed several small correctness issues from the codec-pipeline performance work: construction-time -codec warnings (e.g. sharding's "disables partial reads" warning) no longer fire twice per array -open — including for `FusedCodecPipeline`, which previously re-warned via its own codec-chain -reconstruction and, on the async fallback path, on every decode/encode call; `concurrent_iter` now -schedules its tasks eagerly, matching its documented contract; an invalid -`codec_pipeline.max_workers` config/environment value now warns and falls back to the default -instead of raising mid-read; and `FusedCodecPipeline`'s async fallback helpers now cancel -already-spawned fetch/decode/write tasks instead of abandoning them in the background when one -fails. diff --git a/changes/4206.bugfix.md b/changes/4206.bugfix.md deleted file mode 100644 index a01c969449..0000000000 --- a/changes/4206.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Fixed `FusedCodecPipeline`'s gating of its synchronous fast paths: stores exposing only part of the sync surface (e.g. `set_sync` without `get_sync`) now fall back cleanly to the async path instead of failing mid-write, and `WrapperStore` now forwards `get_sync`/`set_sync`/`delete_sync` to the wrapped store so wrapped sync-capable stores keep the fast path. The capability decision uses a private, interim convention (`zarr.abc.store._store_supports_sync_io`) rather than new public API, pending a formal sync/async store architecture. Also fixed `LatencyStore`: synchronous reads and writes now pay the configured latency, `get_ranges`/`get_partial_values` no longer bypass latency injection, and derived stores (e.g. from `with_read_only`) keep a stochastic `(loc, scale)` latency configuration instead of freezing a single sample. diff --git a/changes/4219.bugfix.md b/changes/4219.bugfix.md deleted file mode 100644 index 728e8a7e3a..0000000000 --- a/changes/4219.bugfix.md +++ /dev/null @@ -1,3 +0,0 @@ -`DefaultChunkKeyEncoding.decode_chunk_key` now validates that a chunk key -starts with the configured `c` prefix and raises `ValueError` for -malformed keys, instead of silently decoding them incorrectly. diff --git a/docs/blog/.authors.yml b/docs/blog/.authors.yml new file mode 100644 index 0000000000..10ce423cfc --- /dev/null +++ b/docs/blog/.authors.yml @@ -0,0 +1,6 @@ +authors: + d-v-b: + name: Davis Bennett + description: Core developer + avatar: https://github.com/d-v-b.png + url: https://github.com/d-v-b diff --git a/docs/blog/index.md b/docs/blog/index.md new file mode 100644 index 0000000000..fca29e2578 --- /dev/null +++ b/docs/blog/index.md @@ -0,0 +1,3 @@ +# Blog + +News, release highlights, and design notes from the Zarr-Python developers. diff --git a/docs/blog/posts/3.3.0-release.md b/docs/blog/posts/3.3.0-release.md new file mode 100644 index 0000000000..13368848ae --- /dev/null +++ b/docs/blog/posts/3.3.0-release.md @@ -0,0 +1,169 @@ +--- +date: 2026-07-30 +authors: + - d-v-b +categories: + - Release +--- + +# Zarr-Python 3.3.0 + +We're happy to announce the release of version 3.3.0 of Zarr-Python. It's been a while since our last release ([3.2.1](https://github.com/zarr-developers/zarr-python/releases/tag/v3.2.1) dropped in May of this year), +and we're bringing some exciting additions to the latest version. For the full release notes, see the [3.3.0 release notes](../../release-notes.md), otherwise stick around for an overview of two performance-centric highlights of this release. + + + +## Faster low-latency storage + +Relevant issues and pull requests: + +- [#3524](https://github.com/zarr-developers/zarr-python/issues/3524) -- the performance report that started this work +- [#3885](https://github.com/zarr-developers/zarr-python/pull/3885) -- synchronous codec APIs and the `FusedCodecPipeline` + +### The cost of async overhead + +Zarr-Python 3.x uses async routines for fetching data and decoding chunks. In terms of code, this means our store (data fetching) and codec (chunk decoding) APIs are both async. This makes +I/O against high-latency storage backends like cloud object storage efficient. But for *low-latency* storage, like in-process memory or the file system, async routines add measurable overhead and offer no benefit. Async only adds value when there's work to be done while waiting for I/O to complete, but when I/O latency is low, it completes too quickly to run anything while waiting, and we are left paying the performance bill for obligatory async task scheduling that offered no value. + +This performance problem became acute when Zarr-Python users reported that in-memory array indexing workloads ran *slower* in Zarr-Python 3.1.3 relative to Zarr-Python 2.18.7 ([#3524](https://github.com/zarr-developers/zarr-python/issues/3524)). Fortunately this performance regression had a straightforward fix (I don't say "easy" because it was a lot of work). + +### Synchronous execution restores performance + +If async overhead makes low-latency storage slow, does *removing* that overhead restore performance? Yes, it does! + +In [#3885](https://github.com/zarr-developers/zarr-python/pull/3885) we defined synchronous versions of our storage and codec APIs -- the `SyncByteGetter` and `SyncByteSetter` protocols, plus a `get_ranges_sync` method on the `Store` ABC -- and then combined them in a new codec orchestration class called `FusedCodecPipeline`. The `FusedCodecPipeline` is an opt-in alternative to the default (the `BatchedCodecPipeline`) that gives large speedups for low-latency storage. It is currently marked [experimental](../../user-guide/experimental.md), so we may change it as we learn more; the default pipeline is untouched, and existing code keeps working unless you opt in. + +The win here is *not* a faster compressor. It is the removal of async scheduling overhead (including some [nasty `asyncio.to_thread` overhead](https://github.com/python/cpython/issues/136084)), plus a few vectorized fast paths for dense, uncompressed shards. And we only expect this new pipeline to accelerate workloads targeting a subset of storage backends, namely any store with methods that advertise low latency. + +On this author's 10-core Apple M4 laptop, the `FusedCodecPipeline` delivers the following results against memory-backed arrays: + +- uncompressed writes are *~4 times faster* +- uncompressed reads are *~5 times faster* +- compressed writes are *~2 times faster* +- compressed reads are *~2 times faster* + +These numbers came from a [runnable example](../../user-guide/examples/codec_pipeline_performance.md) that ships with the documentation. Run it yourself to get a sense of how the `FusedCodecPipeline` behaves on your system -- when and how you use it depends on your hardware, your array layout, and how your chunks are compressed. What's certain is that for in-memory arrays, and arrays saved to the local file system, the `FusedCodecPipeline` is worth a try. + +Getting good numbers requires choosing the right level of thread-based parallelism for your workload, which is part of the configuration of the `FusedCodecPipeline`. For uncompressed chunks there's no CPU-bound work to do after fetching a chunk and so +thread-based parallelism is worse than useless and slows things down. But for compressed chunks, threading offers a substantial payoff. + +### How to use it + +Select the pipeline through the [runtime configuration](../../user-guide/config.md) by setting `codec_pipeline.path`. Set it globally to affect every array created or opened afterwards: + +```python exec="true" session="blog-330" source="above" +import zarr + +zarr.config.set( + {"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"} +) +``` + +Or scope it to a block of code by using `zarr.config.set` as a context manager, which is the safer choice if you only want the new pipeline for part of your program: + +```python exec="true" session="blog-330" source="above" result="ansi" +import numpy as np +import zarr +from zarr.storage import MemoryStore + +with zarr.config.set( + {"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"} +): + arr = zarr.create_array( + store=MemoryStore(), + shape=(1000, 1000), + chunks=(100, 100), + shards=(1000, 1000), + dtype="float32", + ) + arr[:] = np.random.random((1000, 1000)).astype("float32") + result = arr[:] + +print(result.shape) +``` + +Thread-based parallelism is configured separately, via `codec_pipeline.max_workers`. It defaults to `None`, meaning a pool sized to `os.cpu_count()`. Note that this setting is read *only* by the `FusedCodecPipeline` -- the default `BatchedCodecPipeline` ignores it, so tuning it without opting in above does nothing. + +As noted, memory-backed and uncompressed workloads often do better with a single worker, which runs everything inline on the calling thread: + +```python exec="true" session="blog-330" source="above" +import zarr + +# No thread pool: run codec compute inline. Often best for uncompressed, +# memory-backed arrays, where there's no CPU-bound work to overlap. +zarr.config.set({"codec_pipeline.max_workers": 1}) + +# A fixed-size thread pool, which pays off once compression is in play. +zarr.config.set({"codec_pipeline.max_workers": 8}) + +# Or back to the default, sized to the number of CPUs. +zarr.config.set({"codec_pipeline.max_workers": None}) +``` + +To return to the default pipeline, set `codec_pipeline.path` back to the batched implementation: + +```python exec="true" session="blog-330" source="above" +import zarr + +zarr.config.set( + {"codec_pipeline.path": "zarr.core.codec_pipeline.BatchedCodecPipeline"} +) +``` + +## Faster sharded reads + +Relevant issues and pull requests: + +- [#3004](https://github.com/zarr-developers/zarr-python/pull/3004) -- optimize partial shard reads +- [#3925](https://github.com/zarr-developers/zarr-python/pull/3925) -- `Store.get_ranges` for concurrent, coalesced multi-range reads +- [#3987](https://github.com/zarr-developers/zarr-python/pull/3987) -- control coalescing through `ArrayConfig` and the runtime config + +### How sharding works + +Chunks encoded with the `sharding_indexed` codec contain a secondary level of chunking, called subchunks. For example, if the `chunk_grid` field of the array metadata declares an "outer chunk" size of, say `(10, 10)`, a `sharding_indexed` codec in the `codecs` field could declare an "inner chunk" size of `(5, 5)`. Readers accessing such a chunk will observe a stored object (a stream of bytes) that decodes to an array with size `(10, 10)` (the "outer chunk"), which is comprised of four separate, contiguous byte ranges that each decode to a `(5, 5)` inner chunk. Each inner chunk occupies its own byte range in the outer chunk. + +A reader can satisfy a request for all four inner chunks by issuing four separate byte-range requests, or by making a *single* request for a byte range that spans all four inner chunks. The latter option is nice because it cuts down on the number of requests we need. Historically Zarr-Python used this optimization when reading entire outer chunks; in 3.3.0, we use this optimization in more cases, resulting in more efficient I/O patterns for sharded reads. + +### Interval equivalence + +Byte ranges, being intervals, obey some combination rules: the values in two half-open intervals `[a, b), [b, c)` can be captured by the single interval `[a, c)`. That means a reader can get multiple inner chunks with *one* byte-range request by requesting a range of bytes starting with the first byte of the first subchunk and ending with the last byte of the last subchunk. When individual requests are expensive, this kind of optimization is worth a lot. + +The requested inner chunks are not necessarily contiguous -- there might be a byte range gap between them. As long as that gap is not too big, its often efficient to fetch the entire byte range, gap included, and pick out the inner chunk byte ranges after I/O is done. + +### Byte range coalescing + +We call this procedure -- merging adjacent byte ranges -- "byte range coalescing", and it's a new performance optimization shipping in Zarr-Python 3.3.0. Unlike the `FusedCodecPipeline`, this one is on by default with base settings we think are good, so most users won't need to tune anything. + +Two knobs control it, both documented in the [runtime configuration guide](../../user-guide/config.md). Nearby byte ranges in the same shard are merged into a single request when the gap between them is no larger than `array.sharding_coalesce_max_gap_bytes` (default 1 MiB) and the merged read stays within `array.sharding_coalesce_max_bytes` (default 16 MiB). The gap threshold is what trades wasted bytes against saved requests: raising it reads more data you didn't ask for, in exchange for fewer requests. + +For a runnable demonstration -- counting the store requests saved and timing them against a store with simulated latency -- see the [sharded read coalescing example](../../user-guide/examples/sharding_coalescing.md). + +You can set them globally, or per array by passing `config={...}` to [`zarr.create_array`][]: + +```python exec="true" session="blog-330" source="above" result="ansi" +import zarr +from zarr.storage import MemoryStore + +arr = zarr.create_array( + store=MemoryStore(), + shape=(1000, 1000), + chunks=(100, 100), + shards=(1000, 1000), + dtype="float32", + config={ + "sharding_coalesce_max_gap_bytes": 4 * 1024**2, # 4 MiB + "sharding_coalesce_max_bytes": 64 * 1024**2, # 64 MiB + }, +) +print(arr.shape) +``` + +## Tell us what you think + +We hope these new features are helpful, and we would appreciate any feedback that helps us improve them, or any other aspect of Zarr-Python. + +## Going faster + +The updates in this release are just the first step of a larger performance-oriented direction for Zarr-Python. Landing these two enhancements taught us a *lot* about the performance-sensitive areas of the library. We can and will invest more time in performance tuning, e.g. by adding or changing abstractions, writing code for special cases, etc. + +We plan to consider including compiled code that should enable significant performance improvements. The [`zarrs`](https://zarrs.dev/) project is an ecosystem of Zarr tools written in Rust, with [extremely high performance](https://book.zarrs.dev/#-zarrs-is-fast-). Is there a `zarrs` binding in Zarr-Python's future? I hope so! We are keenly observing development of [`zarrista`](https://developmentseed.org/zarrista/latest/) as a proof-of-concept for what a Python-`zarrs` binding layer might look like. Stay tuned! diff --git a/docs/release-notes.md b/docs/release-notes.md index 7b147a30bd..3b54ea993a 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -4,7 +4,7 @@ -## 3.3.0 (2026-07-15) +## 3.3.0 (2026-07-30) ### Features @@ -14,13 +14,19 @@ concurrently. ([#3004](https://github.com/zarr-developers/zarr-python/pull/3004)) - Added a `subchunk_write_order` option to `ShardingCodec` to control the physical order of subchunks within a shard. Supported values are `morton`, `unordered`, `lexicographic`, and `colexicographic`. `unordered` makes no guarantee about subchunk layout. This setting affects only on-disk layout, not the data read back, and is not persisted in array metadata: it applies per codec instance and is not recovered when reopening a sharded array. ([#3826](https://github.com/zarr-developers/zarr-python/pull/3826)) - Added `SyncByteGetter` and `SyncByteSetter` runtime-checkable protocols and a `get_ranges_sync` method on the `Store` ABC. These let custom byte getters/setters opt into the synchronous codec pipeline's fast path for in-memory IO, which the sharding codec uses for its inner chunks. ([#3885](https://github.com/zarr-developers/zarr-python/pull/3885)) -- Added `FusedCodecPipeline`, an opt-in codec pipeline that runs codec compute synchronously and in bulk (avoiding the per-chunk async scheduling overhead of the default `BatchedCodecPipeline`), giving large speedups for sharded arrays (up to ~24x writes / ~14x reads on many-chunks-per-shard layouts, more with compression) and no regressions on compute-bound workloads. The default `BatchedCodecPipeline` is unchanged for standard configurations, so existing code keeps working unless you opt in; enable the new pipeline with `zarr.config.set({"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"})`. ([#3885](https://github.com/zarr-developers/zarr-python/pull/3885)) +- Added `FusedCodecPipeline`, an opt-in codec pipeline that runs codec compute synchronously and in bulk (avoiding the per-chunk async scheduling overhead of the default `BatchedCodecPipeline`), giving large speedups for sharded arrays. The default `BatchedCodecPipeline` is unchanged for standard configurations, so existing code keeps working unless you opt in; enable the new pipeline with `zarr.config.set({"codec_pipeline.path": "zarr.core.codec_pipeline.FusedCodecPipeline"})`. ([#3885](https://github.com/zarr-developers/zarr-python/pull/3885)) - Add `zarr.abc.store.Store.get_ranges` for concurrent, coalesced multi-range reads from a single key. The method is defined on the `Store` ABC with a default implementation built on `Store.get`, so every store inherits a working version; stores with native multi-range backends (e.g. `FsspecStore`) can override for efficiency. Coalescing knobs (`max_concurrency`, `max_gap_bytes`, `max_coalesced_bytes`) are passed as keyword arguments to `get_ranges`. Failures from underlying fetches surface as a `BaseExceptionGroup` (PEP 654); callers should use `except*` to filter for specific exception types such as `FileNotFoundError`. ([#3925](https://github.com/zarr-developers/zarr-python/pull/3925)) - Two new fields on `ArrayConfig` control how the sharding codec coalesces partial-shard reads: `sharding_coalesce_max_gap_bytes` (default 1 MiB) and `sharding_coalesce_max_bytes` (default 16 MiB). When reading multiple chunks from the same shard, nearby byte ranges are merged into a single request to the store if separated by no more than `sharding_coalesce_max_gap_bytes` and the merged read stays within `sharding_coalesce_max_bytes`. Defaults are seeded from the matching `array.sharding_coalesce_max_gap_bytes` / `array.sharding_coalesce_max_bytes` keys in [`zarr.config`][] at array-creation time, and can be overridden per array by passing `config={...}` to [`zarr.create_array`][]. ([#3987](https://github.com/zarr-developers/zarr-python/pull/3987)) +- Added `Group.get_array`, `Group.get_group`, `AsyncGroup.get_array`, and `AsyncGroup.get_group`: type-safe accessors that return the child array or group at a given path, raising `ArrayNotFoundError` / `GroupNotFoundError` if no node exists there, and `ContainsGroupError` / `ContainsArrayError` if the node is not of the requested kind. Unlike `Group.__getitem__`, which returns `Array | Group`, these methods have precise return types. Nested paths like `"subgroup/subarray"` are supported. ([#4128](https://github.com/zarr-developers/zarr-python/pull/4128)) +- `ZipStore` now accepts an open binary file-like object in place of a path, enabling + zip archives on remote storage (e.g. a file opened with `fsspec` or an + `obstore.ReadableFile`). Operations that require a filesystem location + (`clear`, `move`) raise `NotImplementedError` for file-object-backed stores. ([#4187](https://github.com/zarr-developers/zarr-python/pull/4187)) + ### Bugfixes -- Stop emitting an `UnstableSpecificationWarning` when serializing the `struct` data type to Zarr V3 metadata. The `struct` data type now has a stable Zarr V3 specification. The legacy `structured` alias and the unspecified `null_terminated_bytes`, `raw_bytes`, and `variable_length_bytes` data types continue to warn. ([#202](https://github.com/zarr-developers/zarr-python/issues/202)) +- Stop emitting an `UnstableSpecificationWarning` when serializing the `struct` data type to Zarr V3 metadata. The `struct` data type now has a stable Zarr V3 specification. The legacy `structured` alias and the unspecified `null_terminated_bytes`, `raw_bytes`, and `variable_length_bytes` data types continue to warn. ([#4100](https://github.com/zarr-developers/zarr-python/pull/4100)) - Fix equality comparison of `ArrayV2Metadata` and `ArrayV3Metadata` objects with a `NaN` fill value. Such objects are now compared by their JSON-serialized form, so two otherwise-identical metadata objects with a `NaN` (or infinite) fill value compare equal. ([#2929](https://github.com/zarr-developers/zarr-python/issues/2929)) @@ -46,25 +52,11 @@ - Fixed writing to 0-dimensional arrays that use the sharding codec. Previously assigning to a 0-dimensional sharded array raised an error. ([#3966](https://github.com/zarr-developers/zarr-python/pull/3966)) - Fix flaky stateful test bookkeeping when `delete_dir` matches string prefixes instead of true directory descendants. Previously a path such as `6/faNT…` could be incorrectly removed when deleting `6/f`. (See [issue #3977](https://github.com/zarr-developers/zarr-python/issues/3977).) ([#3977](https://github.com/zarr-developers/zarr-python/issues/3977)) -- `FsspecStore.from_url()` and `from_mapper()` now close the async filesystem - they create when `store.close()` is called. Previously the underlying aiohttp - `ClientSession` was left open until garbage collection, producing - `"Unclosed client session"` `ResourceWarning`s from aiohttp. - - The fix introduces `FsspecStore._owns_fs`, a boolean that is ``True`` only when - `FsspecStore` itself created the filesystem (via `from_url` or `from_mapper` - when a sync→async conversion was performed). When `_owns_fs` is ``True``, - `store.close()` calls the new `_close_fs()` helper, which invokes - `fs.set_session()` and closes the returned client. Callers who supply their own - filesystem instance to `FsspecStore()` directly remain responsible for its - lifecycle; `_owns_fs` is ``False`` for those stores. - - **Scope note**: This fix closes the S3 client session that is active at the time - `store.close()` is called. Some S3-backed filesystem implementations (e.g. - s3fs with ``cache_regions=True``) may internally refresh and replace their - client during I/O operations, abandoning prior sessions before ``store.close()`` - is invoked. Those intermediate sessions are outside the scope of this fix and - are an issue in the upstream filesystem library. ([#4003](https://github.com/zarr-developers/zarr-python/pull/4003)) +- `FsspecStore.close()` no longer closes the underlying fsspec filesystem or its + network session. fsspec caches and shares filesystem instances across callers, + so the store cannot know whether it is the only user, and closing a shared + session would break other stores; the filesystem's lifecycle belongs to + whoever created it. ([#4165](https://github.com/zarr-developers/zarr-python/pull/4165)) - Fixed an invalid `zarr.create_array` example in the quick-start documentation (it passed an unsupported `mode` argument) and made the cloud-storage example execute against a mock S3 backend in CI. Added a test ensuring every Python code block in the documentation is either executed or explicitly opted out with a documented reason, so an invalid example can no longer go untested. ([#4016](https://github.com/zarr-developers/zarr-python/issues/4016)) - Fixed `ObjectStore.list_dir` for object-store listings that include a directory-marker object matching the requested non-root prefix. ([#4032](https://github.com/zarr-developers/zarr-python/issues/4032)) @@ -82,6 +74,82 @@ - Fixed writing Fortran-ordered (F-contiguous) arrays through the variable-length string and bytes codecs and through numcodecs array-array filters such as `Delta`, `FixedScaleOffset` and `PackBits`. Chunks are now passed to numcodecs as C-contiguous arrays, so elements are no longer stored in transposed order. ([#4116](https://github.com/zarr-developers/zarr-python/pull/4116)) - Fix silent byte-order corruption for structured dtypes with the `bytes` codec: multi-byte fields are now byte-swapped to the codec's configured `endian` on write and decoded honoring it on read, so non-native-endian structured data (e.g. big-endian fields, as produced by virtual references to external data) round-trips correctly. ([#4141](https://github.com/zarr-developers/zarr-python/issues/4141)) +- Fix `zarr.api.asynchronous.open_like` so it can create a new array by default when the + target path does not already exist. It now defaults to `mode="a"`; when using a read-only + store to open an existing array, pass `mode="r"` explicitly. ([#3352](https://github.com/zarr-developers/zarr-python/pull/3352)) +- `MemoryStore` now copies buffers as they are written, so it never retains the + caller's memory. Previously an uncompressed write handed the store a zero-copy + view of the user's array, and mutating that array afterwards would silently + rewrite chunks already committed to the store. + + Only `MemoryStore` is affected: stores that serialize on write, such as + `LocalStore` and `ZipStore`, never aliased the caller's memory. Uncompressed + writes to a `MemoryStore` are correspondingly slower, since the copy that makes + the stored data independent is now actually performed; compressed writes are + unchanged. Buffers supplied through the `store_dict` argument remain the + caller's responsibility and are stored as-is. ([#4157](https://github.com/zarr-developers/zarr-python/pull/4157)) + +- Fixed the opt-in `FusedCodecPipeline` for sharded arrays whose inner or index codec chain contains a codec implementing only the async codec interface (no `SupportsSyncCodec`). Such arrays previously raised `TypeError: All codecs must implement SupportsSyncCodec` on both read and write; the pipeline now declines its synchronous fast path for them and falls back to the async path, matching the behavior of the default `BatchedCodecPipeline`. Fully sync-capable codec chains keep the fast path unchanged. ([#4179](https://github.com/zarr-developers/zarr-python/pull/4179)) +- Fixed `TypeError: unhashable type: 'writeable void-scalar'` when writing to sharded arrays whose fill value is a `np.void` scalar, e.g. arrays with a structured dtype. + + `ArraySpec` equality and hashing now compare the fill value by its byte representation rather than numeric equality. As a result, two specs with a `NaN` (or `NaT`) fill value now compare equal, while fill values of `-0.0` and `0.0` now compare unequal. This also restores the sharding codec's per-chunk spec cache, which had been disabled because of this bug. ([#4183](https://github.com/zarr-developers/zarr-python/pull/4183)) + +- `FusedCodecPipeline` no longer runs chunk IO and codec compute on the thread + driving zarr's internal event loop. Previously each read/write executed its + synchronous fast path inline on that loop thread, and because every sync-API + call from every user thread is serviced by the same loop, concurrent + operations serialized behind each other's codec work — reported as the fused + pipeline being slower than `BatchedCodecPipeline` for zstd-compressed data + under multi-threaded (e.g. dask) access. The synchronous batch now runs on a + worker thread (one hop per batch, not per chunk), keeping the loop free. + Multi-threaded single-chunk reads of compressed data now scale with reader + threads; single-threaded performance is unchanged. ([#4194](https://github.com/zarr-developers/zarr-python/pull/4194)) +- The end-to-end benchmarks no longer invoke `sudo` to drop the OS page cache during a regular `pytest` run. Cache clearing is now opt-in via the `ZARR_BENCHMARK_CLEAR_CACHE` environment variable, which the benchmark CI jobs set. ([#4199](https://github.com/zarr-developers/zarr-python/pull/4199)) +- Fixed the opt-in `FusedCodecPipeline` for serializers that advertise the partial-decode/encode mixins with only the documented async partial methods: the partial dispatch previously asserted on the private `_decode_partial_sync`/`_encode_partial_sync` hooks (an `AssertionError`, or an `AttributeError` mid-IO under `python -O`); such codecs now take the full-chunk sync path. ([#4201](https://github.com/zarr-developers/zarr-python/pull/4201)) +- Fixed `FusedCodecPipeline` (the opt-in synchronous pipeline) silently skipping + array-array/bytes-bytes codecs placed outside a sharding serializer on its + partial-decode/partial-encode fast paths. With an outer compressor (e.g. + `compressors=[GzipCodec()]` around a `ShardingCodec` serializer), the fused + pipeline wrote non-conforming stored bytes that `BatchedCodecPipeline` (and any + other conforming reader) could not read, and could fail to read data that + `BatchedCodecPipeline` had written. With an outer array-array codec (e.g. + `TransposeCodec`), it silently returned wrong data in both directions with no + error. Only the opt-in `FusedCodecPipeline` was affected; the default + `BatchedCodecPipeline` was never impacted. ([#4202](https://github.com/zarr-developers/zarr-python/pull/4202)) +- Fixed silent data corruption in the experimental `FusedCodecPipeline`: reordering or duplicating fancy-index reads (e.g. `arr[perm, :]`, `arr.oindex[[0, 0, 1], :]`) on uncompressed, crc-free sharded arrays could return the shard in natural order because the vectorized whole-shard decode accepted any selection whose output shape matched the shard shape. The bulk decode now fires only for identity full-shard reads, declines structured dtypes (whose byte-order handling it lacks), and requires shard-index offsets to exactly tile the data section, so corrupt indexes with overlapping or out-of-range offsets can no longer be served as array data. ([#4203](https://github.com/zarr-developers/zarr-python/pull/4203)) +- `ManagedMemoryStore.get_sync`/`set_sync`/`delete_sync` now apply the store's + `path` prefix, matching the async `get`/`set`/`delete` methods. Previously the + sync methods were inherited unchanged from `MemoryStore` and used the raw key, + so code that takes the sync fast path (e.g. `FusedCodecPipeline`) would read + and write chunks outside the store's `path` prefix, silently returning fill + values when the data was re-read through a fresh handle. `GpuMemoryStore.set_sync` + now converts its value to a `gpu.Buffer`, matching `set`, so writes through the + sync API keep the store's all-values-are-GPU invariant. Also fixed + `ManagedMemoryStore.get_partial_values` applying its `path` prefix twice + whenever `path` is non-empty, which made it always return `None` for every + requested key. + + The shared store test suite (`zarr.testing.store.StoreTests`) gained + sync/async parity checks — comparing sync and async observations of the same + key on the same store instance, including with a `byte_range` — so every + store subclass now exercises this invariant. The suite's former + `test_get_bytes`/`test_get_json` methods (and their `_sync` variants) were + folded into these parity tests and no longer exist as separate methods. ([#4204](https://github.com/zarr-developers/zarr-python/pull/4204)) + +- Fixed several small correctness issues from the codec-pipeline performance work: construction-time + codec warnings (e.g. sharding's "disables partial reads" warning) no longer fire twice per array + open — including for `FusedCodecPipeline`, which previously re-warned via its own codec-chain + reconstruction and, on the async fallback path, on every decode/encode call; `concurrent_iter` now + schedules its tasks eagerly, matching its documented contract; an invalid + `codec_pipeline.max_workers` config/environment value now warns and falls back to the default + instead of raising mid-read; and `FusedCodecPipeline`'s async fallback helpers now cancel + already-spawned fetch/decode/write tasks instead of abandoning them in the background when one + fails. ([#4205](https://github.com/zarr-developers/zarr-python/pull/4205)) +- Fixed `FusedCodecPipeline`'s gating of its synchronous fast paths: stores exposing only part of the sync surface (e.g. `set_sync` without `get_sync`) now fall back cleanly to the async path instead of failing mid-write, and `WrapperStore` now forwards `get_sync`/`set_sync`/`delete_sync` to the wrapped store so wrapped sync-capable stores keep the fast path. The capability decision uses a private, interim convention (`zarr.abc.store._store_supports_sync_io`) rather than new public API, pending a formal sync/async store architecture. Also fixed `LatencyStore`: synchronous reads and writes now pay the configured latency, `get_ranges`/`get_partial_values` no longer bypass latency injection, and derived stores (e.g. from `with_read_only`) keep a stochastic `(loc, scale)` latency configuration instead of freezing a single sample. ([#4206](https://github.com/zarr-developers/zarr-python/pull/4206)) +- `DefaultChunkKeyEncoding.decode_chunk_key` now validates that a chunk key + starts with the configured `c` prefix and raises `ValueError` for + malformed keys, instead of silently decoding them incorrectly. ([#4219](https://github.com/zarr-developers/zarr-python/pull/4219)) + ### Improved Documentation - Document the changes to `zarr.errors` in the 3.0 migration guide, including the removal of v2 exception classes and the introduction of `NodeNotFoundError`. ([#3009](https://github.com/zarr-developers/zarr-python/issues/3009)) @@ -120,13 +188,30 @@ enumeration, bulk attribute updates, and the `use_consolidated` keyword. ([#4132](https://github.com/zarr-developers/zarr-python/pull/4132)) - Fixed the documented default of ``max_age_seconds`` in the ``CacheStore`` docstring: the default is ``"infinity"`` (no expiration), not ``None``, which is rejected. Also noted that ``cache_store`` must support deletes. ([#4133](https://github.com/zarr-developers/zarr-python/pull/4133)) +- Added a blog section to the documentation, with a post covering two performance + highlights of the 3.3.0 release: the opt-in `FusedCodecPipeline` and byte-range + coalescing for partial reads of sharded arrays. + + Added two runnable examples that accompany the post: + `examples/codec_pipeline_performance` compares the `BatchedCodecPipeline` and + `FusedCodecPipeline` on a sharded array across two stores and two codec + regimes, showing when the fused pipeline's thread pool helps and when it does + not, and `examples/sharding_coalescing` demonstrates how read coalescing + reduces the number of store requests when reading subregions of a sharded + array. + + Also removed the hardware-specific speedup figures from the `FusedCodecPipeline` + release note, since they depend on the array layout, codec, and machine. ([#4191](https://github.com/zarr-developers/zarr-python/pull/4191)) + ### Deprecations and Removals - The ``BloscShuffle`` and ``BloscCname`` enums (``zarr.codecs.BloscShuffle``, ``zarr.codecs.BloscCname``) are now deprecated. Pass the equivalent literal string (e.g. ``"zstd"``, ``"bitshuffle"``) when constructing a ``BloscCodec``. The enum classes remain importable but emit ``DeprecationWarning`` on member - access, and will be removed in a future release. ``BloscCodec.cname`` and + access, and will be removed in a future release. They are no longer ``Enum`` + subclasses: constructor calls (e.g. ``BloscCname("zstd")``), iteration, and + ``.value`` access no longer work. ``BloscCodec.cname`` and ``BloscCodec.shuffle`` are now plain strings rather than enum members. Additional renames in ``zarr.codecs.blosc`` from the same change: the type @@ -162,8 +247,9 @@ ### Misc -- [#214](https://github.com/zarr-developers/zarr-python/issues/214), [#215](https://github.com/zarr-developers/zarr-python/pull/215), [#3908](https://github.com/zarr-developers/zarr-python/pull/3908), [#3972](https://github.com/zarr-developers/zarr-python/pull/3972), [#3975](https://github.com/zarr-developers/zarr-python/pull/3975), [#3979](https://github.com/zarr-developers/zarr-python/pull/3979), [#3990](https://github.com/zarr-developers/zarr-python/pull/3990), [#3998](https://github.com/zarr-developers/zarr-python/pull/3998), [#4000](https://github.com/zarr-developers/zarr-python/pull/4000), [#4001](https://github.com/zarr-developers/zarr-python/pull/4001), [#4046](https://github.com/zarr-developers/zarr-python/pull/4046), [#4054](https://github.com/zarr-developers/zarr-python/pull/4054), [#4073](https://github.com/zarr-developers/zarr-python/issues/4073), [#4086](https://github.com/zarr-developers/zarr-python/issues/4086), [#4138](https://github.com/zarr-developers/zarr-python/pull/4138) +- [#4139](https://github.com/zarr-developers/zarr-python/pull/4139), [#4140](https://github.com/zarr-developers/zarr-python/pull/4140), [#3908](https://github.com/zarr-developers/zarr-python/pull/3908), [#3972](https://github.com/zarr-developers/zarr-python/pull/3972), [#3975](https://github.com/zarr-developers/zarr-python/pull/3975), [#3979](https://github.com/zarr-developers/zarr-python/pull/3979), [#3990](https://github.com/zarr-developers/zarr-python/pull/3990), [#3998](https://github.com/zarr-developers/zarr-python/pull/3998), [#4000](https://github.com/zarr-developers/zarr-python/pull/4000), [#4001](https://github.com/zarr-developers/zarr-python/pull/4001), [#4012](https://github.com/zarr-developers/zarr-python/pull/4012), [#4046](https://github.com/zarr-developers/zarr-python/pull/4046), [#4054](https://github.com/zarr-developers/zarr-python/pull/4054), [#4073](https://github.com/zarr-developers/zarr-python/issues/4073), [#4086](https://github.com/zarr-developers/zarr-python/issues/4086), [#4138](https://github.com/zarr-developers/zarr-python/pull/4138) +- [#4172](https://github.com/zarr-developers/zarr-python/pull/4172) ## 3.2.1 (2026-05-05) diff --git a/docs/user-guide/examples/codec_pipeline_performance.md b/docs/user-guide/examples/codec_pipeline_performance.md new file mode 100644 index 0000000000..f21e31636e --- /dev/null +++ b/docs/user-guide/examples/codec_pipeline_performance.md @@ -0,0 +1,7 @@ +--8<-- "examples/codec_pipeline_performance/README.md" + +## Source Code + +```python exec="false" reason="pymdownx snippet include directive, not python source" +--8<-- "examples/codec_pipeline_performance/codec_pipeline_performance.py" +``` diff --git a/docs/user-guide/examples/sharding_coalescing.md b/docs/user-guide/examples/sharding_coalescing.md new file mode 100644 index 0000000000..8b2e054af5 --- /dev/null +++ b/docs/user-guide/examples/sharding_coalescing.md @@ -0,0 +1,7 @@ +--8<-- "examples/sharding_coalescing/README.md" + +## Source Code + +```python exec="false" reason="pymdownx snippet include directive, not python source" +--8<-- "examples/sharding_coalescing/sharding_coalescing.py" +``` diff --git a/examples/codec_pipeline_performance/README.md b/examples/codec_pipeline_performance/README.md new file mode 100644 index 0000000000..5d85412c29 --- /dev/null +++ b/examples/codec_pipeline_performance/README.md @@ -0,0 +1,59 @@ +# Codec Pipeline Performance + +This example compares the default `BatchedCodecPipeline` against the opt-in +`FusedCodecPipeline` on a sharded array, across two stores (memory and local) +and two codec regimes (uncompressed and gzip), at one worker and at `cpu_count`. + +A *codec pipeline* turns chunks of array data into stored bytes and back, running +the configured codecs and performing the storage IO. The default +`BatchedCodecPipeline` schedules both asynchronously -- roughly one coroutine per +chunk operation. That model pays off for high-latency stores, where there is +useful work to do while waiting on IO. For low-latency stores (in-process memory, +the local filesystem) the IO completes too quickly for the overlap to be worth +its cost, and the async scheduling becomes pure overhead. + +`FusedCodecPipeline` runs codec compute and synchronous IO synchronously, +removing that overhead. It is +[experimental](https://zarr.readthedocs.io/en/stable/user-guide/experimental/) +and opt-in; the default pipeline is unchanged. + +## What it shows + +- How to select a pipeline with `zarr.config.set`, and why the array must be + *created* inside the config block: the pipeline class is resolved at array + construction time and then travels with the array. +- That the benefit depends strongly on layout and on whether compression is in + play. Some configurations are slower under the fused pipeline -- the script + reports speedups below 1.00x rather than hiding them. +- That `codec_pipeline.max_workers` is read only by `FusedCodecPipeline`; the + default pipeline ignores it entirely. + +## Running + +```bash +uv run codec_pipeline_performance.py +``` + +The script has no arguments and writes only to an in-memory store. + +## Interpreting the output + +The numbers are specific to your CPU, your Python build, and the workload chosen +here. They are a measurement of your machine, not a published benchmark -- treat +a single run as indicative and re-measure against your own data and store before +switching pipelines in production. + +Two effects are worth watching for: + +- **The two codec regimes tell opposite stories about `max_workers`.** + Uncompressed IO is dominated by per-chunk *scheduling*, so `Fused (1 worker)` + is already fastest and a thread pool only adds overhead. gzip is genuinely + CPU-bound: a single worker compresses chunk after chunk sequentially and can + be *slower than the default*, while a thread pool spreads that compression + over cores and reclaims the win. That flip is why the fused pipeline is + threaded by default, and why pinning `max_workers=1` is worth it for + memory-backed uncompressed data. +- **Chunk size decides whether threading can help at all.** The 64×64 inner + chunks here are small enough that per-chunk scheduling dominates uncompressed + IO, yet large enough that per-chunk gzip is real work to parallelize. Much + coarser chunks leave the pool with too few items to spread. diff --git a/examples/codec_pipeline_performance/codec_pipeline_performance.py b/examples/codec_pipeline_performance/codec_pipeline_performance.py new file mode 100644 index 0000000000..b821f3e6a7 --- /dev/null +++ b/examples/codec_pipeline_performance/codec_pipeline_performance.py @@ -0,0 +1,214 @@ +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "zarr @ git+https://github.com/zarr-developers/zarr-python.git@main", +# "numpy", +# ] +# /// + +""" +Compare the `BatchedCodecPipeline` and the `FusedCodecPipeline`. + +The default `BatchedCodecPipeline` schedules storage IO and codec compute +asynchronously -- roughly one coroutine per chunk operation. For a *sharded* +array that means one coroutine per inner chunk inside every shard. That is the +right model for high-latency stores, where there is useful work to do while +waiting for IO. For low-latency stores (in-process memory, the local +filesystem) the IO completes too quickly for the overlap to pay for itself, and +the scheduling becomes pure overhead. + +The `FusedCodecPipeline` runs codec compute and synchronous IO synchronously, +removing that overhead. Whether it wins, and whether its thread pool helps, +depends on which resource is actually scarce: + + * Uncompressed IO is dominated by per-chunk *scheduling*, not compute. There + is nothing for a thread pool to parallelize, so a single worker is already + fastest and extra workers only add overhead. + * gzip is genuinely CPU-bound. A single worker compresses every chunk + sequentially and can be *slower than the default*, while a thread pool + spreads that compression across cores and reclaims the win. This is when + `max_workers > 1` earns its keep. + +Run it with: + + uv run codec_pipeline_performance.py + +Numbers are hardware-, layout-, and codec-dependent. Treat the output as a +measurement of *your* machine, not as a published benchmark. +""" + +from __future__ import annotations + +import operator +import os +import statistics +import tempfile +import timeit +from pathlib import Path +from typing import TYPE_CHECKING + +import numpy as np + +import zarr +from zarr.storage import LocalStore, MemoryStore + +if TYPE_CHECKING: + from collections.abc import Callable + + from zarr.abc.store import Store + +BATCHED = "zarr.core.codec_pipeline.BatchedCodecPipeline" +FUSED = "zarr.core.codec_pipeline.FusedCodecPipeline" + +# gzip is CPU-bound to encode, which is exactly the regime where the thread +# pool matters. Level 6 is gzip's own default. +GZIP = {"name": "gzip", "configuration": {"level": 6}} + +# 4096x4096 int32 = 64 MiB, split into 16 shards of 1024x1024, each holding +# 16x16 = 256 inner chunks of 64x64 -> 4096 inner chunks in total. The chunks +# are small enough that per-chunk coroutine scheduling dominates uncompressed +# IO, yet large enough that per-chunk gzip is real work to spread over cores. +SHAPE = (4096, 4096) +SHARDS = (1024, 1024) +CHUNKS = (64, 64) +DTYPE = "int32" + +CONFIGS: tuple[tuple[str, dict[str, object]], ...] = ( + ("Batched (default)", {"codec_pipeline.path": BATCHED}), + ("Fused (1 worker)", {"codec_pipeline.path": FUSED, "codec_pipeline.max_workers": 1}), + ("Fused (cpu_count)", {"codec_pipeline.path": FUSED, "codec_pipeline.max_workers": None}), +) + + +def time_call(fn: Callable[[], object], repeat: int = 3) -> float: + """Median wall-clock seconds for one call to `fn`. + + `timeit.Timer` supplies `perf_counter` and disables the cyclic garbage + collector during each run, so a collection triggered by earlier work cannot + land inside a measurement. `number=1` because a single call here already + moves 64 MiB -- the per-call overhead `timeit` amortizes is irrelevant at + this scale. + """ + return statistics.median(timeit.Timer(fn).repeat(repeat=repeat, number=1)) + + +def measure( + settings: dict[str, object], + store: Store, + data: np.ndarray, + compressors: object, +) -> tuple[float, float]: + """Time one full write and one full read of `data` under `settings`. + + The whole operation runs inside `zarr.config.set`, not just the array + construction. The pipeline class is resolved when the array is built, but + `codec_pipeline.max_workers` is read *per operation*, so a timed call made + outside the config block would silently use whatever worker count was + globally in effect -- which makes every configuration look identical. + """ + everything = slice(None) + + def write_once() -> None: + with zarr.config.set(settings): + array = zarr.create_array( + store=store, + shape=SHAPE, + chunks=CHUNKS, + shards=SHARDS, + dtype=DTYPE, + compressors=compressors, + fill_value=0, + overwrite=True, + ) + operator.setitem(array, everything, data) + + write = time_call(write_once) + + # The bytes on disk are identical whichever pipeline wrote them, so reading + # back what we just wrote isolates read performance on the same data. + def read_once() -> object: + with zarr.config.set(settings): + return zarr.open_array(store=store, mode="r")[everything] + + read = time_call(read_once) + + if not np.array_equal(read_once(), data): + raise AssertionError("round trip mismatch") + return write, read + + +def make_store(kind: str, tmp: Path) -> Store: + if kind == "memory": + return MemoryStore() + return LocalStore(tmp / f"demo_{kind}_{os.getpid()}.zarr") + + +def main() -> None: + n_cpu = os.cpu_count() or 1 + + # Each regime gets the data that actually exercises it. `arange` is + # trivially compressible, which is fine when nothing compresses it, but it + # would make gzip finish almost instantly and hide the CPU-bound behavior + # this example is about. The noisy array keeps gzip genuinely busy. + n = int(np.prod(SHAPE)) + plain_data = np.arange(n, dtype=DTYPE).reshape(SHAPE) + noisy_data = np.random.default_rng(0).integers(0, 2**24, size=SHAPE, dtype=DTYPE) + + n_shards = int(np.prod([s // c for s, c in zip(SHAPE, SHARDS, strict=True)])) + per_shard = int(np.prod([s // c for s, c in zip(SHARDS, CHUNKS, strict=True)])) + print(f"zarr {zarr.__version__} | {n_cpu} CPUs") + print( + f"array {SHAPE} {DTYPE} = {plain_data.nbytes / 2**20:.0f} MiB | " + f"{n_shards} shards x {per_shard} inner chunks = {n_shards * per_shard} chunks\n" + ) + + with tempfile.TemporaryDirectory() as tmp: + for store_kind in ("memory", "local"): + for codec_label, compressors, data in ( + ("uncompressed", None, plain_data), + ("gzip-6 (CPU-bound)", GZIP, noisy_data), + ): + print(f"=== {store_kind} store / {codec_label} ===") + print( + f"{'pipeline':<22}{'write (s)':>11}{'vs base':>10}" + f"{'read (s)':>12}{'vs base':>10}" + ) + results: dict[str, tuple[float, float]] = {} + for label, settings in CONFIGS: + store = make_store(store_kind, Path(tmp)) + results[label] = measure(settings, store, data, compressors) + + base_write, base_read = results[CONFIGS[0][0]] + for label, (write, read) in results.items(): + print( + f"{label:<22}{write:>10.3f}{base_write / write:>9.1f}x" + f"{read:>11.3f}{base_read / read:>9.1f}x" + ) + + # The headline comparison: does the thread pool earn its keep? + single_write, single_read = results["Fused (1 worker)"] + pool_write, pool_read = results["Fused (cpu_count)"] + print( + f" workers (cpu_count vs 1 worker): " + f"write {single_write / pool_write:.1f}x " + f"read {single_read / pool_read:.1f}x" + ) + print() + + print( + "Reading it:\n" + " * Uncompressed IO is scheduling-bound, so Fused (1 worker) is already\n" + " fastest -- a thread pool has nothing to parallelize and only adds\n" + " overhead.\n" + " * gzip is CPU-bound, so Fused (1 worker) can be *slower* than the\n" + " default, while Fused (cpu_count) spreads compression across cores\n" + " and reclaims the win. That flip is why the fused pipeline is\n" + " threaded by default, and why pinning max_workers=1 is worth it for\n" + " memory-backed uncompressed data.\n" + " * `codec_pipeline.max_workers` is read only by the FusedCodecPipeline;\n" + " the default BatchedCodecPipeline ignores it." + ) + + +if __name__ == "__main__": + main() diff --git a/examples/sharding_coalescing/README.md b/examples/sharding_coalescing/README.md new file mode 100644 index 0000000000..29ba08c9ce --- /dev/null +++ b/examples/sharding_coalescing/README.md @@ -0,0 +1,63 @@ +# Sharded Read Coalescing + +This example demonstrates byte-range coalescing for partial reads of sharded +arrays, a performance optimization added in Zarr-Python 3.3.0 and enabled by +default. + +A shard is one stored object containing many inner chunks, each occupying its own +byte range. Reading N inner chunks could mean N separate byte-range requests. +Because byte ranges are intervals, nearby ranges can be merged: `[a, b)` and +`[b, c)` together cover `[a, c)`, so a single request can serve both. Merging +trades reading some bytes you did not ask for against issuing fewer requests -- +worthwhile whenever a request is expensive, as with object storage. + +## What it shows + +- Reading scattered inner chunks from one shard with coalescing **off** issues + one store request per inner chunk; with the **default** settings the same read + collapses to a single request. +- The resulting wall-clock difference against a store with simulated latency. +- That coalescing changes only *how* data is fetched, never *what* is returned -- + the script asserts both configurations produce identical arrays. +- A case where coalescing changes nothing: a contiguous selection already has + adjacent byte ranges, so it merges under any setting. + +## Running + +```bash +uv run sharding_coalescing.py +``` + +## How the comparison is set up + +Two details make the effect observable, and both are worth understanding if you +adapt this script: + +- **The selection must have gaps.** A contiguous read produces adjacent byte + ranges that merge regardless of configuration. The strided selections skip + inner chunks, creating the gaps that the `sharding_coalesce_max_gap_bytes` + budget decides whether to bridge. +- **Latency must be charged per merged fetch.** The example defines a small + `WrapperStore` subclass that sleeps in `get`. It deliberately does *not* keep + `WrapperStore.get_ranges`, which forwards straight to the wrapped store and + would bypass the latency entirely; inheriting the `Store` ABC's `get_ranges` + instead runs the coalescer over its own `get`, so each merged fetch pays once. + + `zarr.testing.store` ships a ready-made `LatencyStore`, but importing it pulls + in `pytest`. Defining the wrapper inline keeps the example runnable with only + `zarr` and `numpy` installed. + +## Configuration + +Two settings control the behavior, both settable globally via `zarr.config` or +per array via `config=` on `zarr.create_array` / `Array.with_config`: + +| Setting | Default | Meaning | +| --- | --- | --- | +| `sharding_coalesce_max_gap_bytes` | 1 MiB | Merge two ranges only if the gap between them is no larger than this | +| `sharding_coalesce_max_bytes` | 16 MiB | Never let a merged read exceed this size | + +Setting the gap to `0` merges only exactly-adjacent ranges, which approximates +the pre-3.3.0 behavior; that is how the example emulates the old path. Raising +the gap reads more unwanted bytes in exchange for fewer round trips -- the right +value depends on how expensive a request is against how fast your link is. diff --git a/examples/sharding_coalescing/sharding_coalescing.py b/examples/sharding_coalescing/sharding_coalescing.py new file mode 100644 index 0000000000..5da62ed806 --- /dev/null +++ b/examples/sharding_coalescing/sharding_coalescing.py @@ -0,0 +1,226 @@ +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "zarr @ git+https://github.com/zarr-developers/zarr-python.git@main", +# "numpy", +# ] +# /// + +""" +Demonstrate byte-range coalescing for partial reads of sharded arrays. + +A shard is a single stored object holding many inner chunks, each occupying +its own byte range. Reading N inner chunks could mean issuing N separate +byte-range requests to the store. Because byte ranges are intervals, a reader +can instead merge nearby ranges: `[a, b)` and `[b, c)` together cover +`[a, c)`, so one request can serve both. Merging trades reading some bytes you +did not ask for against issuing fewer requests -- a good trade whenever a +request is expensive, which is the normal case for object storage. + +Zarr-Python 3.3.0 does this automatically. Two settings control it: + + * `sharding_coalesce_max_gap_bytes` (default 1 MiB) -- merge two ranges only + if the gap between them is no larger than this. + * `sharding_coalesce_max_bytes` (default 16 MiB) -- never let a merged read + exceed this size. + +Setting the gap to 0 disables merging of non-adjacent ranges, which +approximates the pre-3.3.0 behavior. This script compares the two, counting +store requests and measuring wall-clock time against a store with simulated +latency. + +Run it with: + + uv run sharding_coalescing.py +""" + +from __future__ import annotations + +import asyncio +import operator +import statistics +import timeit +from contextlib import contextmanager +from functools import partial +from typing import TYPE_CHECKING + +import numpy as np + +import zarr +import zarr.core._coalesce as coalesce_module +from zarr.abc.store import ByteRequest, RangeByteRequest, Store +from zarr.storage import MemoryStore, WrapperStore + +if TYPE_CHECKING: + from collections.abc import Callable, Iterator, Sequence + + from zarr.core.buffer import Buffer, BufferPrototype + +# Emulates the pre-3.3.0 behavior: with a zero gap budget, only ranges that are +# exactly adjacent get merged, so scattered inner chunks are fetched one by one. +NO_COALESCING = {"sharding_coalesce_max_gap_bytes": 0} + +# The shipped defaults. Spelled out here so the comparison is explicit rather +# than relying on whatever the global config happens to be. +DEFAULT_COALESCING = { + "sharding_coalesce_max_gap_bytes": 1 << 20, # 1 MiB + "sharding_coalesce_max_bytes": 16 << 20, # 16 MiB +} + +GET_LATENCY_S = 0.005 # 5 ms per request, a modest stand-in for object storage + + +class PerRequestLatencyStore(WrapperStore[Store]): + """Wraps a store, charging a fixed latency per byte-range fetch. + + `zarr.testing.store` ships a `LatencyStore`, but importing it pulls in + `pytest`; defining the wrapper here keeps this example runnable with only + zarr and numpy installed. + + Two details matter for the measurement: + + * The latency is applied in `get`, which is what an individual fetch costs. + * `get_ranges` is explicitly *not* overridden to forward to the wrapped + store. `WrapperStore.get_ranges` does forward, which would skip this + class's `get` entirely and make every configuration look identical. + Inheriting the `Store` ABC's implementation instead runs the coalescer + over `self.get`, so each *merged* fetch pays the latency once -- which is + exactly the cost coalescing exists to reduce. + """ + + get_ranges = Store.get_ranges + + def __init__(self, store: Store, *, get_latency: float) -> None: + super().__init__(store) + self.get_latency = get_latency + + def _with_store(self, store: Store) -> PerRequestLatencyStore: + # `WrapperStore` rebuilds the wrapper when opening read-only, so the + # latency setting has to be carried across. + return type(self)(store, get_latency=self.get_latency) + + async def get( + self, + key: str, + prototype: BufferPrototype, + byte_range: ByteRequest | None = None, + ) -> Buffer | None: + await asyncio.sleep(self.get_latency) + return await self._store.get(key, prototype, byte_range) + + +@contextmanager +def counting_requests() -> Iterator[Callable[[], int]]: + """Count the store fetches issued inside the block. + + Wraps the coalescing planner rather than the store: every merged group it + returns, plus every range it declined to merge, becomes exactly one fetch. + Counting here rather than at the store means the number reported is the + planner's decision, which is precisely what the settings control. + """ + original = coalesce_module.coalesce_ranges + total = 0 + + def counting_coalesce_ranges( + byte_ranges: Sequence[ByteRequest | None], + *, + max_gap_bytes: int, + max_coalesced_bytes: int, + ) -> tuple[ + list[list[tuple[int, RangeByteRequest]]], + list[tuple[int, ByteRequest | None]], + ]: + nonlocal total + groups, uncoalescable = original( + byte_ranges, + max_gap_bytes=max_gap_bytes, + max_coalesced_bytes=max_coalesced_bytes, + ) + total += len(groups) + len(uncoalescable) + return groups, uncoalescable + + coalesce_module.coalesce_ranges = counting_coalesce_ranges + try: + yield lambda: total + finally: + coalesce_module.coalesce_ranges = original + + +def measure_read(array: zarr.Array, selection: slice) -> tuple[int, float]: + """Return (store fetches, median seconds) for reading `selection`.""" + read = partial(operator.getitem, array, selection) + + with counting_requests() as fetches: + result = read() + requests = fetches() + + # `timeit.Timer` supplies the loop, `perf_counter`, and GC handling. The + # median of several runs keeps one unlucky run from dominating. + elapsed = statistics.median(timeit.Timer(read).repeat(repeat=5, number=1)) + + assert result.size > 0 # a read that returned nothing would time as "fast" + return requests, elapsed + + +def main() -> None: + n = 8192 + chunk = 64 + inner_chunks = n // chunk + + base = MemoryStore() + source = (np.arange(n, dtype="uint64") % 251).astype("uint8") + + # One shard holding every inner chunk, uncompressed so inner-chunk byte + # offsets stay predictable and the demonstration is easy to reason about. + writable = zarr.create_array( + store=base, shape=(n,), chunks=(chunk,), shards=(n,), dtype="uint8", compressors=None + ) + writable[:] = source + + store = PerRequestLatencyStore(base, get_latency=GET_LATENCY_S) + + print(f"zarr {zarr.__version__}") + print(f"array: {n} uint8 values, {inner_chunks} inner chunks of {chunk} in a single shard") + print(f"store: MemoryStore wrapped with {GET_LATENCY_S * 1000:.0f} ms of latency per request\n") + + # A strided selection touches inner chunks with unread chunks in between, + # so there are real gaps for the coalescer to bridge. A contiguous + # selection would merge under any setting, since its ranges are adjacent. + selections = { + "every 2nd inner chunk": slice(None, None, chunk * 2), + "every 4th inner chunk": slice(None, None, chunk * 4), + "contiguous quarter": slice(0, n // 4), + } + + header = f"{'selection':<24} {'coalescing':<12} {'requests':>9} {'time':>10}" + print(header) + print("-" * len(header)) + + for label, selection in selections.items(): + results = {} + for mode, config in (("off", NO_COALESCING), ("default", DEFAULT_COALESCING)): + array = zarr.open_array(store=store, mode="r").with_config(config) + requests, elapsed = measure_read(array, selection) + results[mode] = (requests, elapsed) + print(f"{label:<24} {mode:<12} {requests:>9} {elapsed * 1000:>9.1f}ms") + + off_requests, off_time = results["off"] + on_requests, on_time = results["default"] + if on_requests < off_requests: + print( + f"{'':<24} {'->':<12} " + f"{off_requests // on_requests:>8}x fewer {off_time / on_time:>9.1f}x faster" + ) + else: + print(f"{'':<24} {'->':<12} {'no change (ranges already adjacent)':>30}") + print() + + # Correctness is the point: coalescing must not change what you read back. + for mode, config in (("off", NO_COALESCING), ("default", DEFAULT_COALESCING)): + array = zarr.open_array(store=store, mode="r").with_config(config) + assert np.array_equal(array[::128], source[::128]), mode + print("Both configurations return identical data; coalescing only changes how it is fetched.") + + +if __name__ == "__main__": + main() diff --git a/mkdocs.yml b/mkdocs.yml index 87aaf23430..b414c73196 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -31,6 +31,8 @@ nav: - Examples: - user-guide/examples/custom_dtype.md - user-guide/examples/rectilinear_chunks.md + - user-guide/examples/codec_pipeline_performance.md + - user-guide/examples/sharding_coalescing.md - API Reference: - api/zarr/index.md - ' zarr.abc': @@ -95,6 +97,8 @@ nav: - 'zarr-metadata ↪': https://zarr-metadata.readthedocs.io/ - release-notes.md - contributing.md + - Blog: + - blog/index.md hooks: - mkdocs_hooks.py @@ -153,6 +157,14 @@ extra_css: plugins: - autorefs + - blog: + blog_dir: blog + post_dir: "{blog}/posts" + post_url_format: "{slug}" + # The blog is a simple reverse-chronological list of posts; the archive + # and category indexes add navigation we don't have the volume to justify. + archive: false + categories: false - search - markdown-exec - mkdocstrings: From a994a4fc972fed428eab6a26d4f14bb95d22c144 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Fri, 31 Jul 2026 11:23:10 +0200 Subject: [PATCH 28/61] feat: add the zarr-indexing package (TensorStore-style index transforms, ndsel wire format) (#4196) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: byte-order handling for structured dtypes in the bytes codec (#220) * fix: byte-order handling for structured dtypes in the bytes codec The bytes codec neither byte-swapped structured-dtype fields to its configured endian on encode (numpy reports byteorder '|' for void dtypes, so the top-level byteorder comparison never detected a mismatch) nor honored its endian when decoding, silently corrupting any structured data whose field byte order differed from the stored one (e.g. virtual references to external big-endian data). Encode now detects byte-order mismatches by comparing full dtypes via newbyteorder, and decode reinterprets raw bytes in the stored byte order before converting to the data type's declared byte order, so the stored layout (codec state) and the in-memory layout (array data type) are independent. Closes #4141 Assisted-by: ClaudeCode:claude-fable-5 * test: fold structured byte-order cases into existing bytes codec tests Extend test_endian's parametrization with structured dtypes and test_bytes_codec_sync_roundtrip with endian/dtype parametrization plus stored-layout and decoded-dtype assertions, instead of adding parallel test functions for the same properties. Assisted-by: ClaudeCode:claude-fable-5 * refactor: rename stored_dtype to view_dtype in BytesCodec decode The variable is the dtype used to view the raw chunk bytes (byte order from the codec's endian configuration), not a property of the stored data or of the returned buffer, which always carries the array's declared dtype. Assisted-by: ClaudeCode:claude-fable-5 * docs: note that the decode-side byte-order conversion copies the chunk Assisted-by: ClaudeCode:claude-fable-5 * feat: add the zarr-indexing package (TensorStore-style index transforms) Standalone workspace package extracted from the lazy-indexing branch (zarr-developers#3906): composable, lazy coordinate transforms (IndexTransform / IndexDomain / output maps), dependency-aware chunk resolution against a DimensionGridLike protocol, and an ndsel-conformant JSON wire format validated against the vendored conformance corpus. zarr itself does not depend on zarr-indexing yet — the runtime wiring lands separately once 0.1.0 is published. The package is numpy-only; its tests exercise chunk resolution against zarr's concrete ChunkGrid, so they run from the workspace root (uv sync --all-packages). Assisted-by: ClaudeCode:claude-fable-5 * style: conventional submodule import in the chunk-resolution tests Assisted-by: ClaudeCode:claude-fable-5 * perf(zarr-indexing): joint chunk enumeration for correlated vindex maps Candidate-chunk enumeration took the cartesian product of each correlated ArrayMap's per-dimension distinct chunk ids and relied on intersect() to filter untouched combinations. For a diagonal selection of P scattered points that is P**2 intersect calls — quadratic in the number of selected points, the same workload shape as zarr-developers#4174 (400 points: ~2.6s; 10k points: ~30min). Group correlated maps jointly instead: broadcast their per-point chunk ids, take the distinct rows (np.unique(axis=0), O(P log P)), and enumerate exactly the touched combinations. Candidate slots now carry chunk-coordinate tuples covering one or more output dimensions; orthogonal/constant/slice dimensions keep their existing per-dimension candidates. 400-point diagonal resolution drops from 2628ms to 14ms and scales linearly. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): standalone documentation site; add package justfile Mirror the treatment zarr-metadata received in #4208/#4210 onto zarr-indexing: a self-contained mkdocs site under the package (own mkdocs.yml, landing page, ndsel wire-format guide, mkdocstrings page per module, and .readthedocs.yaml for a dedicated RTD project), so the package presents as a separate project with docs versioned by its own zarr_indexing-v* release tags rather than zarr-python's. The zarr-python site's API Reference nav links out to it, and each RTD project now skips PR builds that do not touch its half of the repo. The package gains a pinned docs dependency group, a docs build job in its CI workflow, and a justfile with package-scoped dev recipes. Two recipes deviate from the zarr-metadata original by design: - `test` runs against the workspace-root environment (`uv run --project ../.. --all-packages --group test`), because the chunk-resolution tests exercise this package against zarr's chunk grids and `zarr` is deliberately not a dependency of this package. - `typecheck` uses plain `pyright`, unpinned and on the default interpreter, mirroring this package's own CI invocation. The zarr-metadata pin exists for a PEP 661 sentinel regression that zarr-indexing's sources do not hit. composition.py gains the module docstring the other modules already have, since mkdocstrings renders it as the page introduction. Assisted-by: ClaudeCode:claude-fable-5 * chore: drop the already-released 4141 changelog fragment The bytes-codec byte-order fix this fragment describes shipped upstream and its entry is already in docs/release-notes.md; the fragment survived on this branch only as a rebase remnant, and would emit a duplicate entry in the next release. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): canonicalize ndsel references to zarr-developers/ndsel Also aligns the zarr-indexing workflow's setup-uv pin (v8.3.2) with the rest of the repo. The vendored-corpus sha is present upstream; the historical d-v-b/ndsel#1 PR reference stays as provenance. Assisted-by: ClaudeCode:claude-fable-5 * chore: drop the root uv-workspace wiring for zarr-indexing Per review: the root pyproject.toml should not change in this PR. The package now operates fully standalone (like zarr-metadata); the test invocations layer the package into the repo-root environment as an editable overlay instead (python -m pytest, since a base-env console script would not see the overlay). Assisted-by: ClaudeCode:claude-fable-5 --- .github/workflows/check_changelogs.yml | 3 + .github/workflows/zarr-indexing-release.yml | 117 ++ .github/workflows/zarr-indexing.yml | 123 ++ .readthedocs.yaml | 15 +- mkdocs.yml | 1 + packages/zarr-indexing/.readthedocs.yaml | 30 + packages/zarr-indexing/CHANGELOG.md | 3 + packages/zarr-indexing/LICENSE.txt | 21 + packages/zarr-indexing/README.md | 53 + .../zarr-indexing/changes/3906.feature.md | 1 + packages/zarr-indexing/changes/README.md | 25 + .../docs/_static/favicon-96x96.png | Bin 0 -> 12714 bytes .../zarr-indexing/docs/_static/logo_bw.png | Bin 0 -> 45208 bytes .../docs/api/chunk_resolution.md | 5 + .../zarr-indexing/docs/api/composition.md | 5 + packages/zarr-indexing/docs/api/domain.md | 5 + packages/zarr-indexing/docs/api/errors.md | 5 + packages/zarr-indexing/docs/api/grid.md | 5 + packages/zarr-indexing/docs/api/index.md | 47 + packages/zarr-indexing/docs/api/json.md | 5 + packages/zarr-indexing/docs/api/messages.md | 5 + packages/zarr-indexing/docs/api/output_map.md | 5 + packages/zarr-indexing/docs/api/transform.md | 5 + packages/zarr-indexing/docs/index.md | 150 ++ packages/zarr-indexing/docs/ndsel.md | 156 ++ packages/zarr-indexing/justfile | 58 + packages/zarr-indexing/mkdocs.yml | 110 ++ packages/zarr-indexing/pyproject.toml | 124 ++ .../src/zarr_indexing/__init__.py | 74 + .../src/zarr_indexing/chunk_resolution.py | 380 +++++ .../src/zarr_indexing/composition.py | 133 ++ .../zarr-indexing/src/zarr_indexing/domain.py | 189 +++ .../zarr-indexing/src/zarr_indexing/errors.py | 21 + .../zarr-indexing/src/zarr_indexing/grid.py | 25 + .../zarr-indexing/src/zarr_indexing/json.py | 325 ++++ .../src/zarr_indexing/messages.py | 657 +++++++++ .../src/zarr_indexing/output_map.py | 105 ++ .../zarr-indexing/src/zarr_indexing/py.typed | 0 .../src/zarr_indexing/transform.py | 1311 +++++++++++++++++ .../tests/conformance/PROVENANCE.md | 20 + .../zarr-indexing/tests/conformance/README.md | 16 + .../zarr-indexing/tests/conformance/box.json | 50 + .../tests/conformance/errors.json | 23 + .../tests/conformance/point.json | 30 + .../tests/conformance/points.json | 34 + .../tests/conformance/slice.json | 61 + .../tests/conformance/transform.json | 57 + .../tests/test_chunk_resolution.py | 521 +++++++ .../zarr-indexing/tests/test_composition.py | 166 +++ .../zarr-indexing/tests/test_conformance.py | 55 + packages/zarr-indexing/tests/test_domain.py | 202 +++ packages/zarr-indexing/tests/test_json.py | 336 +++++ packages/zarr-indexing/tests/test_messages.py | 91 ++ .../tests/test_ndsel_tensorstore.py | 52 + .../zarr-indexing/tests/test_output_map.py | 56 + .../tests/test_tensorstore_parity.py | 263 ++++ .../zarr-indexing/tests/test_transform.py | 628 ++++++++ 57 files changed, 6955 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/zarr-indexing-release.yml create mode 100644 .github/workflows/zarr-indexing.yml create mode 100644 packages/zarr-indexing/.readthedocs.yaml create mode 100644 packages/zarr-indexing/CHANGELOG.md create mode 100644 packages/zarr-indexing/LICENSE.txt create mode 100644 packages/zarr-indexing/README.md create mode 100644 packages/zarr-indexing/changes/3906.feature.md create mode 100644 packages/zarr-indexing/changes/README.md create mode 100644 packages/zarr-indexing/docs/_static/favicon-96x96.png create mode 100644 packages/zarr-indexing/docs/_static/logo_bw.png create mode 100644 packages/zarr-indexing/docs/api/chunk_resolution.md create mode 100644 packages/zarr-indexing/docs/api/composition.md create mode 100644 packages/zarr-indexing/docs/api/domain.md create mode 100644 packages/zarr-indexing/docs/api/errors.md create mode 100644 packages/zarr-indexing/docs/api/grid.md create mode 100644 packages/zarr-indexing/docs/api/index.md create mode 100644 packages/zarr-indexing/docs/api/json.md create mode 100644 packages/zarr-indexing/docs/api/messages.md create mode 100644 packages/zarr-indexing/docs/api/output_map.md create mode 100644 packages/zarr-indexing/docs/api/transform.md create mode 100644 packages/zarr-indexing/docs/index.md create mode 100644 packages/zarr-indexing/docs/ndsel.md create mode 100644 packages/zarr-indexing/justfile create mode 100644 packages/zarr-indexing/mkdocs.yml create mode 100644 packages/zarr-indexing/pyproject.toml create mode 100644 packages/zarr-indexing/src/zarr_indexing/__init__.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/chunk_resolution.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/composition.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/domain.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/errors.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/grid.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/json.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/messages.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/output_map.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/py.typed create mode 100644 packages/zarr-indexing/src/zarr_indexing/transform.py create mode 100644 packages/zarr-indexing/tests/conformance/PROVENANCE.md create mode 100644 packages/zarr-indexing/tests/conformance/README.md create mode 100644 packages/zarr-indexing/tests/conformance/box.json create mode 100644 packages/zarr-indexing/tests/conformance/errors.json create mode 100644 packages/zarr-indexing/tests/conformance/point.json create mode 100644 packages/zarr-indexing/tests/conformance/points.json create mode 100644 packages/zarr-indexing/tests/conformance/slice.json create mode 100644 packages/zarr-indexing/tests/conformance/transform.json create mode 100644 packages/zarr-indexing/tests/test_chunk_resolution.py create mode 100644 packages/zarr-indexing/tests/test_composition.py create mode 100644 packages/zarr-indexing/tests/test_conformance.py create mode 100644 packages/zarr-indexing/tests/test_domain.py create mode 100644 packages/zarr-indexing/tests/test_json.py create mode 100644 packages/zarr-indexing/tests/test_messages.py create mode 100644 packages/zarr-indexing/tests/test_ndsel_tensorstore.py create mode 100644 packages/zarr-indexing/tests/test_output_map.py create mode 100644 packages/zarr-indexing/tests/test_tensorstore_parity.py create mode 100644 packages/zarr-indexing/tests/test_transform.py diff --git a/.github/workflows/check_changelogs.yml b/.github/workflows/check_changelogs.yml index 0033b43db2..d7a54fc2c4 100644 --- a/.github/workflows/check_changelogs.yml +++ b/.github/workflows/check_changelogs.yml @@ -29,3 +29,6 @@ jobs: - name: Check zarr-metadata changelog entries run: uv run --no-sync python ci/check_changelog_entries.py packages/zarr-metadata/changes + + - name: Check zarr-indexing changelog entries + run: uv run --no-sync python ci/check_changelog_entries.py packages/zarr-indexing/changes diff --git a/.github/workflows/zarr-indexing-release.yml b/.github/workflows/zarr-indexing-release.yml new file mode 100644 index 0000000000..7cfd571eae --- /dev/null +++ b/.github/workflows/zarr-indexing-release.yml @@ -0,0 +1,117 @@ +name: zarr-indexing release + +on: + workflow_dispatch: + push: + tags: + - 'zarr_indexing-v*' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + build: + name: Build wheel and sdist + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: packages/zarr-indexing + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + fetch-depth: 0 # hatch-vcs needs full history + tags + + - name: Install Hatch + uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc + with: + version: '1.16.5' + + - name: Build + run: hatch build + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: zarr-indexing-dist + path: packages/zarr-indexing/dist + + test_artifacts: + name: Test built artifacts + needs: [build] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: zarr-indexing-dist + path: dist + + - name: Install uv + uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + with: + enable-cache: false + + - name: Set up Python + run: uv python install 3.12 + + - name: Install built wheel and run import smoke test + run: | + wheel=$(ls dist/*.whl) + uv run --with "${wheel}" --python 3.12 --no-project \ + python -c "import zarr_indexing; print('zarr_indexing', zarr_indexing.__version__)" + + upload_pypi: + name: Upload to PyPI + needs: [build, test_artifacts] + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/zarr_indexing-v') + runs-on: ubuntu-latest + environment: + name: zarr-indexing-releases + url: https://pypi.org/p/zarr-indexing + permissions: + id-token: write # required for OIDC trusted publishing + attestations: write # required for artifact attestations + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: zarr-indexing-dist + path: dist + + - name: Generate artifact attestation + uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0 + with: + subject-path: dist/* + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 + + upload_testpypi: + name: Upload to TestPyPI + needs: [build, test_artifacts] + if: github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + environment: + name: zarr-indexing-releases-test + url: https://test.pypi.org/p/zarr-indexing + permissions: + id-token: write + attestations: write + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: zarr-indexing-dist + path: dist + + - name: Generate artifact attestation + uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0 + with: + subject-path: dist/* + + - name: Publish package to TestPyPI + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/zarr-indexing.yml b/.github/workflows/zarr-indexing.yml new file mode 100644 index 0000000000..2106b10916 --- /dev/null +++ b/.github/workflows/zarr-indexing.yml @@ -0,0 +1,123 @@ +name: zarr-indexing + +on: + push: + branches: [main] + paths: + - 'packages/zarr-indexing/**' + - '.github/workflows/zarr-indexing.yml' + pull_request: + paths: + - 'packages/zarr-indexing/**' + - '.github/workflows/zarr-indexing.yml' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: pytest py=${{ matrix.python-version }} + runs-on: ubuntu-latest + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + python-version: ['3.12', '3.13', '3.14'] + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - name: Install uv + uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + with: + enable-cache: true + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + # The transform tests exercise chunk resolution against zarr's ChunkGrid, + # so they run from the repo root against the root environment (which + # provides `zarr`) with this package as an editable overlay rather than in + # package isolation. + - name: Sync test dependency group + run: uv sync --group test --python ${{ matrix.python-version }} + - name: Run pytest + run: uv run --no-sync --group test --with-editable ./packages/zarr-indexing python -m pytest packages/zarr-indexing/tests + + ruff: + name: ruff + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: packages/zarr-indexing + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - name: Install uv + uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + - name: Run ruff + run: uvx ruff check . + + pyright: + name: pyright + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: packages/zarr-indexing + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - name: Install uv + uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + with: + enable-cache: true + - name: Set up Python + run: uv python install 3.12 + - name: Sync test dependency group + run: uv sync --group test --python 3.12 + - name: Run pyright + run: uv run --group test --with pyright pyright src + + docs: + name: docs + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: packages/zarr-indexing + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + - name: Install uv + uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + with: + enable-cache: true + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 + - name: Build docs + # The strict mkdocs build lives in packages/zarr-indexing/justfile. + run: just docs-check + + zarr-indexing-complete: + name: zarr-indexing complete + needs: [test, ruff, pyright, docs] + if: always() + runs-on: ubuntu-latest + steps: + - name: Check failure + if: | + contains(needs.*.result, 'failure') || + contains(needs.*.result, 'cancelled') + run: exit 1 + - name: Success + run: echo Success! diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 55b5d6fed0..dddf8449a4 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,15 +6,14 @@ build: python: "3.12" jobs: post_checkout: - # Cancel pull request builds whose changes are confined to the - # zarr-metadata package, which has its own Read the Docs project. Exit - # code 183 cancels the build and reports success to the Git provider. - # Scoped to PR builds ("external" versions) because origin/main is only - # a meaningful diff base there. Read the Docs strips shell quoting from - # commands, so the exclude pathspec must use the quote-free :! form, - # not ':(exclude)'. + # Cancel pull request builds whose changes are confined to the packages + # that have their own Read the Docs projects. Exit code 183 cancels the + # build and reports success to the Git provider. Scoped to PR builds + # ("external" versions) because origin/main is only a meaningful diff + # base there. Read the Docs strips shell quoting from commands, so the + # exclude pathspecs must use the quote-free :! form, not ':(exclude)'. - | - if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- :!packages/zarr-metadata; + if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- :!packages/zarr-metadata :!packages/zarr-indexing; then exit 183; fi diff --git a/mkdocs.yml b/mkdocs.yml index b414c73196..6a0d94052e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -95,6 +95,7 @@ nav: - ' zarr.zeros': api/zarr/functions/zeros.md - ' zarr.zeros_like': api/zarr/functions/zeros_like.md - 'zarr-metadata ↪': https://zarr-metadata.readthedocs.io/ + - 'zarr-indexing ↪': https://zarr-indexing.readthedocs.io/ - release-notes.md - contributing.md - Blog: diff --git a/packages/zarr-indexing/.readthedocs.yaml b/packages/zarr-indexing/.readthedocs.yaml new file mode 100644 index 0000000000..b8c7b76e2b --- /dev/null +++ b/packages/zarr-indexing/.readthedocs.yaml @@ -0,0 +1,30 @@ +# Read the Docs configuration for the zarr-indexing docs site, separate from +# the zarr-python site configured by the repo-root .readthedocs.yaml. The RTD +# project for zarr-indexing must set its configuration-file path to +# packages/zarr-indexing/.readthedocs.yaml. +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.12" + jobs: + post_checkout: + # Cancel pull request builds that do not touch this package. Exit code + # 183 cancels the build and reports success to the Git provider. Scoped + # to PR builds ("external" versions) because origin/main is only a + # meaningful diff base there. + - | + if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- packages/zarr-indexing; + then + exit 183; + fi + install: + - pip install --upgrade pip + - pip install ./packages/zarr-indexing --group packages/zarr-indexing/pyproject.toml:docs + build: + html: + - mkdocs build --strict -f packages/zarr-indexing/mkdocs.yml --site-dir $READTHEDOCS_OUTPUT/html + +mkdocs: + configuration: packages/zarr-indexing/mkdocs.yml diff --git a/packages/zarr-indexing/CHANGELOG.md b/packages/zarr-indexing/CHANGELOG.md new file mode 100644 index 0000000000..7c4bc92cad --- /dev/null +++ b/packages/zarr-indexing/CHANGELOG.md @@ -0,0 +1,3 @@ +# Release notes + + diff --git a/packages/zarr-indexing/LICENSE.txt b/packages/zarr-indexing/LICENSE.txt new file mode 100644 index 0000000000..1e8da4d242 --- /dev/null +++ b/packages/zarr-indexing/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2025 Zarr Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/zarr-indexing/README.md b/packages/zarr-indexing/README.md new file mode 100644 index 0000000000..ccdfe595a5 --- /dev/null +++ b/packages/zarr-indexing/README.md @@ -0,0 +1,53 @@ +# zarr-indexing + +Composable, lazy coordinate transforms for Zarr array indexing. + +Documentation: + +This package implements TensorStore-inspired index transforms. The core idea: +every indexing operation (slicing, fancy indexing, etc.) produces a coordinate +mapping from user space to storage space. These mappings compose lazily — no +I/O until you explicitly read or write. + +Key types: + +- `IndexDomain` — a rectangular region of integer coordinates +- `IndexTransform` — maps input coordinates to storage coordinates +- `ConstantMap`, `DimensionMap`, `ArrayMap` — the three ways a single output + dimension can depend on the input +- `compose` — chain two transforms into one + +The package depends only on NumPy and the standard library; it does not import +`zarr`. It is developed in the [zarr-python](https://github.com/zarr-developers/zarr-python) +repository and consumed by `zarr` to resolve array indexing operations. + +## Installation + +```bash +pip install zarr-indexing +``` + +## Developing + +Package-scoped development commands live in the [`justfile`](./justfile) +(requires [just](https://github.com/casey/just)): + +``` +just test # run the test suite (extra args go to pytest) +just lint # ruff, same invocation as CI +just typecheck # pyright, same invocation as CI +just docs-check # strict build of the docs site +just check # all of the above +just docs-serve # serve the docs site locally +``` + +Run them from this directory, or from anywhere in the repository as +`just packages/zarr-indexing/`. + +The test recipe runs against the workspace-root environment, because the +chunk-resolution tests exercise this package against `zarr`'s chunk grids and +`zarr` is deliberately not a dependency of this package. + +## License + +MIT diff --git a/packages/zarr-indexing/changes/3906.feature.md b/packages/zarr-indexing/changes/3906.feature.md new file mode 100644 index 0000000000..fa51b4438e --- /dev/null +++ b/packages/zarr-indexing/changes/3906.feature.md @@ -0,0 +1 @@ +Reworked the JSON layer to conform to the [ndsel](https://github.com/zarr-developers/ndsel) draft wire format, which adapts TensorStore's `IndexTransform`. A new `zarr_indexing.messages` module (`parse_ndsel`, `normalize_ndsel`, `NdselError`) is a pure JSON-to-JSON layer that accepts all five message kinds (`point`/`box`/`slice`/`points`/`transform`) and normalizes them to the canonical transform body, enforcing the full ndsel error taxonomy. The package is checked against the vendored, language-agnostic ndsel conformance corpus. `index_transform_to_json`/`index_transform_from_json` (and the domain variants) now produce and consume the canonical body. On serialization, orthogonal (`oindex`) `index_array` maps no longer emit `input_dimension` alongside `index_array` (a combination both ndsel and TensorStore reject), and degenerate all-singleton index arrays collapse to constant maps; the in-memory `input_dimension` is reconstructed from the array's dependency axes on load. diff --git a/packages/zarr-indexing/changes/README.md b/packages/zarr-indexing/changes/README.md new file mode 100644 index 0000000000..feb3f8674e --- /dev/null +++ b/packages/zarr-indexing/changes/README.md @@ -0,0 +1,25 @@ +Writing a changelog entry for `zarr-indexing` +----------------------------------------------- + +Fragments in **this** directory are release notes for the `zarr-indexing` +package only — kept separate from the parent zarr-python `changes/` +directory so a PR touching only `packages/zarr-indexing/` produces a +release note for this package only. + +Please put a new file in this directory named `xxxx..md`, where + +- `xxxx` is the pull request number associated with this entry +- `` is one of: + - feature + - bugfix + - doc + - removal + - misc + +Inside the file, please write a short description of what you have +changed, and how it impacts users of `zarr-indexing`. + +A `zarr-indexing` release runs `towncrier build` in `packages/zarr-indexing/`, +which consumes the fragments here and updates `CHANGELOG.md`. Fragments +that describe parent zarr-python changes (not the transforms package) +belong in the top-level `changes/` directory, not here. diff --git a/packages/zarr-indexing/docs/_static/favicon-96x96.png b/packages/zarr-indexing/docs/_static/favicon-96x96.png new file mode 100644 index 0000000000000000000000000000000000000000..e77977ccf41426c35a768ea73ed20e05d2676dd5 GIT binary patch literal 12714 zcmV;bF;&iqP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H1AOJ~3 zK~#90-F3TWhscfoy={Ravrt z)mGbDaM!N|6a)bkEvSfq;)-mtg)E=~30t;v=6!yD+$3bVL2JR~_k2F*lbds%GiS~- zGw;m2vm7CbUmEfsOgmc?cSkhjxbhO*YmAwH+PyPA{Hf#h-$H&#;_nMi>T1C>A#Z}< zP((4?ltr=*xFNc>6^ z+?O^2!gH1KT*3o0zxWZO{9nO*H|592H^KDw1^1;rWyEX(Fd`g>WPYjZdLpLthTCuV z*JYSb025U(HFfO1;H0jnILbc=zMnb*)sY)ajdNTCMdTI$Awda1D*lF$M_{@E_LfCQ zGr|@Zw{97@dGD0;qSo7XEXKTf764#@gomcD1F)`ON?PxNdsD}XPgb;^I&;sD{$lmu zXJK{auVKG<*N+*K0(r!WtTEJk0CW`MFJW6dT337kC`d~iAwYYGd;_wShLK9M zL&zi}a;)`?koZ;nNvUH&Bv3IoJ|iRVCaUIBWjOtPl{i`b4x_pmOQ3Rdl;hss6U9D%#n4`w5hXowfcp9^n~PN_psKm;y;Cka^q=&hj41MmP?OZdv1FHiz6Liw~f7(to^Z32Og<;3YA_9*N* z1<9#BVXzvI>WK>gIBn+4FY{B<&J#)pQ1?LOjJ?Te=cwq1rn&(j84oPQuwhPqQitE| zO-Tzty*aJ3v-h7=k#LgD&i>TYCi&yjrZjM|i^RRK2#HYhP@niVsPals8bJ9vtlR*F z3Bv^ls5R?hUV_!G^k2Xq`Rt zT>$SEj8E=QFoJ5_f_qYKg|RE*X3feCakY|;gxMME0jw{$C#8>wiM0w8+?_gB$#)YT z$@~fc)G9>9#?Q`JgkaE@SEPgU$EP-F=#?ytee}`8|Eq5QQ_kOedoU{h?$imk-03gM z86cWfRfv@!D3pal3^2sE2An5WT7mG_s6dbNLCBj_UI~?rs`9v6Z4aVh4Sp@NQi-_P zS#KF@0swo0BJ_Nh6x@??>+U;K>QuA<5chEA`>Hri$j$%&F+B_JP96L8T@%~Zc*fMJ zUc$o}uSELsN{KWak$+F>-3P~wYx+aA1Ad_RyT=3@16ph20qY7cfO4xTW$~AE@QBMh_2o~@=xSYg( zp>gVv6#(UfxW8n~H6Fi)lAbYr#bOsM8&;>5x~@ks5{l1C*x-u1Kc(IL?VZ8KKSam> z%Is_(H!d;?4S(lvjC4Tas=5e@TI~~gOMz_1N)wXvAyqA%diYqY8@wJT~5+ z{BbFxt>?U&^!SXz+V2?mw~Q4Kk-R&TucR1j$d(0vN*&{Ke9Kz?W!l%3@i!`N>&G(Y zZyz@<(ik0*H!juZltnFU{m-ez-&fD?CH|&i!HDSQ#kV#z4f06*wGQEU({VL~86bK% zz|#Qk2GFFIaK{A&KBnPxQ6vdu2FS+&G^-Q-@%uLum?lIM5lr2`r+9@lkRAj-DaWzv z^8T1sjt1om4I--Q0sz3gc{Tx9n15%=C<=aMJlWtt2j}0J!pKrthz3&2^pOc7%k%C? zz6(ZLgWT@A?iKlWrWkSjZ_%~` zLh(1;e!IW5FEA>)Ii>(;D=wogqhtuNs4Ha{5j<=>uq%V`qWLW?<2geo5owe9Ywup9;#Ff@--kqJffs_S)| znp;KrN2(m7CmB@!4a)fHHoOMkA_vN;fXRoIG*ae5(Y^*BK&z~*V+oJXe7>QtWFah6 zU6VsaWZoSq*Vgd$SCod1k3L!!_xG7EG1B`tJyR~qy|8Rva7WsR-D85so2ZrVJawv< z@L0wxMf;;(5H+O+*e9@U^Z$@Cs)oH+0C0*E9-sN5bIdOBMV4Hbe@EJ|O~Zl_;bgAq z+Zi^@$q%%7m-WEt5-%g}O$hY%EE#J=X(?*bbF^sGeg%N|o z)`h#4L}$Q0PR8-5Vq8+alRI-cTnUoiOHhu%8<7* zyg5?cFEA4b%>j@O$azrghVbohd;p=GS?9q3XjVDatW@LuR;@HCXxjD`T2l@Q(?+!b zMcym}R!3T14PnEm;s!Sna=1>DHV;5kKxmd4*M8#qoS`D>r;WHughd{;h7zSFqSSA_ zrcn9#G>yI?Z*0o3grr8VV(L`SFp=cK#{mCj*{zaod^?~LaZ!D14v%oRnu zdd-DmuMo*jnSKq$?PB?YD7)6%WK|+2vH*(nPGG){h~kmvNl_($iO(C8 zeo1XHVS&@0oc?XxoXjVccpDZls=J`(^xRw1uBhSbuP`s||2gwe{M^iE;X1F;Le-j0 zqDU$jojMr7psB$J(CXQ&V+l{rd_EHLvawXU*lLvB@^4MOuFBjMhxnf2Q2gA?XSLM% zPkv7EO?kH@4>eGkN5z@7Y;DDF$rmekiIp_5@@J}^0Y#@e;vE-fzfh8?dZ#LeQFs;< z=hVli%3)F556UPgFK~#yu(CrG?Tg6Xl;Ak0bL&rKaYOPW^Q_e*81j55zy6^^BKHlHac%q%2iHG zw7{Z9iEBPL)R{-{eH638lsC8N3=Db^yhx+I_)x%GEVMby6lNrwdPD5X~o}xky z33(5|JPOhQoC_jUJ=f2lB1S%^GF4#u04S}`91%Qf1T#s#1IpbH-Y>vD0xQFiA!15J z@K=yaK>33TUI$PF0Alfu^;%$t2M{<)0%TwnQ_q-=spiUDFkCg$Iq+N)Ns z0stgDGdn--`OGJcweQlS0$6KZ?VLBVmbt6ow|+5uf828!Pr0RBK@T3qZ18#7Gw;Tf z0afPC0zN7Mq6oml0(`6n$=1VG5!Q?d0Hs#mTMXiFbj*Lm>NpqP22r`Jb}bs}$Pxg` z0sPA-7pXBLDB6$Y;OcY&5K&arS5|=M0C`@)%Sd}QEN-ZiIrj^yx!Mq4&}d_BtKuFa zx{~C-;WOhBo)0rJ6$~1GX+(cghteRQ$}2&vhvCt@8lCXV(uXjL?|(4hwXESQwr5b6tdKSe-zc^3Vojl#}|qV!CWE!kKkw(c>|V* zA@W|>){a1-_&;O#q*AU2xZD8wM4chTs&~-p@~r?b zmAk(8{eJH%g0BPc)!SSQ`7&2ndapSW(M>I011cPF_2b>6u~Dw?$g!b$Ulcz;%6gw; z2DY9TW?oJ(XmYJw3&HKI8N&xNd^REtvI54L*Q2^RjjU zn3I3agidsv(|k}2I>8Hi0zLK^;shcpAqyO%|FYH$^!eONpr~(3NCjjm z$wx)xT%Y&`Q#q~{>@Sbs>%`pL5sEF-V)K-0@EAB0uaXl++QCb!ZoDH5Mfs+<_gVH&zRwD z7tYvShd*qXlkc{>k!(9jz-?A^WYWUy4Rv_c!?$%$3t@zK4;CcY&cO86a(@#cYKU2# zujDd^zDR|3HIN=)L`x{j>V$8B+Ts(!mmLS|)WdHGE=BF)Unj9-xsr;*R?M=9Uy}77h)C|h)XT-#2!*rO zSnZ#Cb?VNqwaiVZ1f=Dp5T69pQgLVwy1$ZA$&~ z0enTGU*fVb)BG+C`f{U=-7Ha<1jXk985X}JYqBaafI=x*eax7fku8CadrL`DGIGyx!DGXh{JwA9s2?4#6l5c zjd!JZXaa+<=8M+&NnH+yiJ-*MaV~}8LLV&N2k??8qN}oLcysZg&*l4`-+4vAIRsi9 z4?P^8TaEhPQt@J;d>B9iLph@;%*Yf-6j;YwY}8*SlqnQl56FPTH?zK~9rC7O!HA}X zM{jA>EIL(Od}JMGNYd*wzpVS($5HT`2|d*K?(j$Glvcnu0I>Vgdjh@)|8!6vH3~O= zMb@J2SB;B|w2?zWX&~0DQnA0;J2?13>%|o#RCxdz0kl3%S}}7GE)Dwfe8;W^#1Y8H zMse}>tHyoRaapwib_>vPn7C}_as-2>V9n8i0(|6yMX+vC)e!S@A*WHKl{%)ESZ03* z|0@xh1_jl4{YCM39e#E3iCi(9Mo5w4`sV;RC}Ic4ub8zhoaoU9kB(_dNdaW7QU@o! zmA&aiqUZLX_$$!dD{uyha(Jt^v%aak<~aUG#NtV)DXpx`Ixc&(48TiYUy-@6(D)3ChZ(7gVsp5M_$C_!jg zr?Ny;3~lE2Paff8m|{{ANiE#!R_9T<*R9r>3eU#Kwm z0wxhaF@cv7R%OnwN|Z}ehk)oqgT<<7##+Nlt=`No&g+*PNlFftO#u@b={39&k?PhS z%mILM(lZtfRm=vXHi{O3$2T&9l*L_QfyGV=@%1czn2<7Frt7dJjEqZRhlshAjHrN89 zm$7z0(yGjnClWsQl9Y>bFHTvZioc6;u5mFEik4FD-Broick!eauzZ-rU)7Z;()&uA+0PG=Tnt>LBvY&$GbzhA`0I3|Y`kKTH00nSZDk_U>kxL;M4dSJW z{|f=m0^~!0v4B)AT-Yy$gQ)T#fMyEb$B4#n`^t~~4!{HgD}~Oqgf(?5-0H~hn|i4# z?}JDaKp#w8lf8J;nfLn}M;}{f1d|h1XI72O?dg-U0OabVHCcbj>pebR;rq2Qh@e6t z$V+@b^G%3IUhm|)l(H#l&GC_}+`g%CAg&-aLLe@T>`#0@>a{(6OQVh2o7L!=r1y^Z zDfV2H-X7NW1=vu;lnZz`A)?W%x#dT%^TDD(C^KmIt&o!m>0TjneeZcdh)hDZi7*X7 zPbh|jWePyz2!MwTunv$31SXQ^ZmFD^MlfMr);a)}=Uy=JVq;_)N{+oi;AJ@Yb>jOc zUO|%EE9G*4_X6Tq^1(LivzCD*kcB3_QtqXPj}q1$7e4R8)SHB8mbk9*qX3YwW_JFb zUa1YJ@QJWoRa)itO1V`pn7G@i-qfsoC3OoyUt`kj1=y5|=)4P#j*)UH4%gaYNok4W zL^LJv84Nq9O5&8L=2g>S%a;36|YqSuqmC+DDOr*+3VgNe+VQLRj{!m#-|b zaMp>d*Nf$^Xt|V@mxZp|Dqi(LD2HC?Y=bF0E(vs_+9hW8AmGbWtsCYSp3Ja{B_=W z$!AsFP%XD6Y?!@0;iK$1>hWW-Or(XEcmBlN^3G50d0fon{P?vQc?ln8%@xQe#xqHx zFnQ-DkIg$brC$wxdFW?{&$7NrT%Yw+sKTun@2qizB2)q^vtZ>~u{eh+%fyqY6Y$HS z_&bT;(&}l(VhLR|frW&<$HI!mb5PbC0;eOewZxa8$vZpc+T61zegfhlS~&F3LR^kA zR&Hzm(ab~D=}zI%X>esl!iQO_D$ngXXTtB`!4FD4J)^KVEAQ-yx9vV_VrPUgFG-)w z+AJz9M70@QKs|QKJA2}7TH-smD#KNec9}0f#Ai7y1xc=T@{YF+?LkrY8 z%A`y-Q8Ad7ZE5+sS`1``XkqvsJlROdd!P3y}Og;j`>HVx7&_ z0`RoGTHQj=v;12c(#2FaxKT23&>L-=c_?WSiFG~Po&jQ zi^V<#N<7poN9|c+H9KDfuviWL;;6I)u~;e=!x6X=RtDsDOfF)+~ie3@rTh@F5n{rD;s61Oyr`#fnEwF3` z%OY4buEux8no$Y4HRnSXdr_I<$^3+k8S5+0<#syqXYtT7!sVMa%wz@HY|L0GibPm; zhXOv=>zC6x<<`7T_r!%WFLFdbgq5~X(;6ytXfMb)W8!Ua-S*+!^H$t#^w?G`{7}I0 zO!u75$zw_BVn7UlMJd!QhstQ!3QuRa!@~}-GC-{ChGH=lcflgEKE5ixqALSwFR_adma{;)zrp=bDx$sy3 zH3}Eq#MNB7PTe{CEfca z6_*Bm#>F!r|NKp}BTHKxj2A4KmEhZJYF4 z8a*m1347X2yv2CBBq6tAahx8HPtuNAZ$m_K+fKNehDU@<%xRxImXxJ!cV+HFF+#?> zqA#4ZJ@b74@8@<%9&c(F{~D%1@eUP(V6jG(FTvILTE)Ni@e!5RQn?TwA2%vVu!yO{ ztIEmzQas)$9_LVTFFZLD7N^zEM+w#3Qr#sC06x$A3oPa&?3i8UPR`kNBn?)!Chp2! zblyk*bdz>w&Zk8?B`*+b7KkT9V5AGk zX90v3g4H((N|^^E!y(d2h`#}7jT20o0+eW;@&-<=Ef!c7GeTcOi$xtzd~z{ z2wK3<62}kyn5x&&)nZjXK~HDUGPd%%wLnciHdA@CQ7xy{EPDDVEn6Sw+gg0?R;%}r zIH;;q;Nf4iXiG~_301Am^6qn>5y|;@{M_k;~S^YsFeT!5i3bVK~&b@1EG?WpS|dt z{6jB@WvP0)hpOH8w4N|(Ym3w-l~FP909b6KCpW;wlW^q`b)Amz&=MX{&#{A+V`z~D z7Y}%z(;l8A)!}K??>xHvBRxzK54W*Q&Jq`=*WtSWJa}U9jAKn#@wm{c87D69wPn6B zHCzG!%F6K=TzNR*o6M>Kmxx0V_rt@N;z|rGN-U*GPK$}R<;Es=tE%WLaK^V8N0Ro= zde&H;4HrGsMWbddn%R#5lSD)|_iBJ5e>lE0f{7TTU2mOG_f4 z74J}i^Y~AfuD%Ux&V?&+YGES9yEdoA#G6Dl$|oL1!AJv;GXV+tG3qfF2C^T*+d&os zG8w2?!B-#Om;9n@H@m$DE<0Mu`39jg93ih`-m_3;^EeOQ6EzEwVhVU&@PJ_yHOW&=P zj~snKtH9R&F*I72UPd0J-OahJ0-_~?u^9X|p#wR05{7c2@*8X5k$J=%p7inT5t|xJWKt6`h zZ;#I(ssXF|h6A%x!OO(pH1CKrN&wfb$MND(7e)A;y`HOA3MAI^crA$1@-UOE3?Zm? z941WA2zQVeppZorxv=uO7gDbJQLG}_bg+$L&apJh2x1f%+7+98Gl9cx3$tFWett)@35g0!f$RT$m5|NGH5HL3puP#V@YuaR z$9zh0Tm!FL+rq41b>TNjFk)wH${i-qV2jZ7q?*f>=02r~CCu)fF)6q1Za%SdB|l^? zd}vdYwX0oG)?9kJo)GIfe9tJmZf}-+VJ$fU0Eypb6tpYKnoBXOlq{!l)*98GI|9j< zRV69_Uq#(_4CJG9~&=^b4EILx0KuJR#&_0C$k)Tz~_^MB+W#avWsh65D^BF=aQ1v@o2?jWB||x50hwQjXnv=QxWQ( zm2jx$HZ7YZ7||f6_|^sirjT4MDwnrA6lx*u45TIzI71Xysc=2jG}{@Ia;s@JVNLBm zQ2WEPw&f*`&(&l8u_|Z@YRS%+lrErr?t|G;+qKjF;LJTaE$&(DS#vGG7#fss4(xd`rpBE7=6{5_oTM#Qzi6Hv|<$QX)Lcs}`T9lk(e^a}vpNz-0D9Z4fg zJJd2Sbp(z{o&)gijt6RPEU`T%Tu_=QD97f3BJnPHue0chS+M@fT zkB*55NU9R=8*2x2I9zv1iU>D%D9oC?EjslABfOd->!_v~)oi0MrZ&GKs&A5dOzE5l zqn%x#7eh-KYoHh*Yft06qT*Sjrmv;66+t&2#UucHgE(HB3k+&aOt%1@mvY|*`0e!& zE@!m`)V25uVxBnmLDJVwlzr52=@~^?VRL$QY>P>`6O=DI70z5${rvVoN(YME?b54S zu(74-q-KsIfAz%l?p#=Nmf8ln-QOfSX0$)RG{AgdEv`J{a7K-p5tZ-&NX4EfoeqU| zBH7+7`9fM}5FP!1F#EO#QpZ}w>dG)G3q+^FS)Ty-%r_zr zl4z^extT_no>7$fouXHW*~vJ#B_h!9q8b+@Xfz;CLFCU}tCjLgpbxgjrt}fzKs8(~#0PCt~j z?u$VBwn#cR2pFUEox3%VdZCi!&23?k$; z5Rm|uhwF0Cn$6a)XZeY?YUL&vF6&g3@x4R`fK?LowGQZ9rTIhKT{V}>ZwZv%1CcGA z56-Nb%Ca?(HVi=08HaY=1cXFy932?dI1rN#a=kbh)MeSgMxioP|v^jZX%Y=E_J zd_z0!e<=S%w{!~i9p2j#lhV)7xx%Ba6k++cK>BSSv8wB#nsbWID9l(1VC9xT`sD(R zpvZb3amn^(sfRiqIKDKeXzS-umObsG>(j{E<6CV3Y4UgvZhNl;Wx!h8Y9GSAm~Do zk10B&>wy!`PKE@{mYCAv3}6C)cj=SCUA~>Z_lL$A0M00!wi3X~&4Kj(N?c(CZ(5qB zfaC~l-F?^$BLS`;O*;shIevQuA$@!xmMHiXfabMFyDNVRxX_9dG_-B3%0)1;yz37z zFSSu}sB{7e*LtRgY1@jluwom>`XIxcO)(ut zAi(h;R;lX@>{h*ha1zj^XvSLr-r5*QzuW+q2=sLkM>fTz-)f0f-HSr2P!s?J+V$Y{ z#j7OfYZWN{EhuYcV<0_T6MYC_77An$VS^%0oGLCdhReGioc`X)iu|U)m$8#ag!Ao?;_NcSxmM6x)ETa@uXq0+ z%u9W+hK@k~-tFM@J2%HnX=BOjJn9^QY&-MN^ct%MyB(ZSdw1~~SS3MUi$K{;odX^J zOu-7z#eg2Q{6eQ1T@TE79l+}wV2fRz+LpcCueG!;+nBb+~I}iz)FQVORn+2F=fz>|0cU9MKe*8_T ztE1b&X-fet{UUI0e~1huu!t&U8)GKlYE<9tdT7S>O5Y9vECCUO!E9jf$$iB!V|x!v!NZhng| z(BdutOZ@7;tm~nvr)vJp;k4Z~Hn^KF!<^G&Iu9q&MFsQDJNUpU z{mjwlv6H)5$~}Ob1Hl|8qV!oUi|kLz@Fs^2jX4|>eVY)!2l%pz_sDs*Mx=fT*d)P- zvS@E41&K=Ev*#C0ty+N|_RA6TWth`3rqeK`=_+F9pL=lH=ch7)8=3~2!{_}@h#Lgl zN1z=b#RASRH~vR^9+>(+ZyNn$V}so8H-T0o0kl!_+4G7Xth37I#Gmbup!q1q4l^p< zL^!`k;RD}qN&OGRDhc`;M|(pI(5}Q^{*ON2R?MaR1!05S?w3HTn+UXXl+T}Y=)pRR zxGVAfzL_FH^I?n*6yPFNJMV&`hkh~NAN;YfL2mbJOsnCd=mO=l=O2DB?BGpx{C6L$ z5s?pL?i(bKzO=gFSBD<>#eIqMq(g${qi7wfkaHcMJa^vyso!JprsCEg^tGUhL?EQE zvGVfyho-Lo?wkHUg9OdGXdMc{g#tcz!4ELW|J$dUsuBTx)N*03Ll3O`;eq`^AVIS( z8rMLymw|cySA|nQ{lP()5xJn^Q`V`)` z^1JW&nL&bPZHx>gc(GCQQqQ7$>))g8hd$y|f1Yn`AlP38SAtmDyJ+fvPU*u=1_ZJ? z=7B*Dc#$gR^(mTq%9_J_l~@%! zt*@b8LE-v-rzjCt1s>`zqE``S@g;>*R-KAx{5Sa7h+m0SvD5krc{xNr?00bTNlAo| z=)4l(YyEyk&EB7#_?1`{JFPFt%gz6g2$iB+%F@eq9mt=MUOjdB2t zth?+anXFTZUyS&b_)oKGz18w61Np2n5#EZO))&eF<`*J*C4O<@S7Jr%j6P5f6i@_w k``1NN-ukKI^xxwD0dx|tMUqFQ>i_@%07*qoM6N<$f_TPca{vGU literal 0 HcmV?d00001 diff --git a/packages/zarr-indexing/docs/_static/logo_bw.png b/packages/zarr-indexing/docs/_static/logo_bw.png new file mode 100644 index 0000000000000000000000000000000000000000..df1979d3cc3317a36feaf5e7aab7c32998bdbfc7 GIT binary patch literal 45208 zcmYg%cQ{*b+eGtTnL*e6vTC-FKl8TMP3q9PdSl+!|iF&flimbbZ*^ zYjLm3OtsO3Cm=Roz?aI+ig5NVu7xT1#*POe; z>LRlF7c-xu?xONHe!xzzIJX2e#r0oPN!WG{Dr4GsMoE0}-h@DkNn!{_ItQoS%@SCe zj(KT98(@6!Mho;v;m=7+xrp{nDkY|A`barQ@1OK{w!plS6d*X+d2PHu<{=dnOntLD zZ>ot>OKeJfPb=te)b?09NA6AD6wsDe$-lNDGUfbWiC=rbZo9TFizHPvdn0G>JzBxX znK)~S0N>Jdz5lvY`~vAYpA56TtFx>>gH70?#$oQ*_cR!~R&WKfRPp@eVa|eIz3^yRCrJ?L`r$v3N1x1>0Htr*i1OfABST6AR|wv2)8# zHldDWR$@_lv%aUF)QML5NQ0?;hPx-h(nP5y22u5cR;U*lijWd1MLt(>qk6?7BFPH* z)JOt5Z7|&ko~oI3K?Lk(Pxw3?uhum(EkhFhfG_Ls!=qEi>}%VXVRnEGn|-&2Dwy)XJVt^Qf_1&!bND+^B`&-NMrWJ z=8j)D;@K>pX&YWz)D{dC=7sy#{+r0-e-Cq%9n0C{v*h~BgKmdv+2xWy*@qyb19y{J zyJ+)ShUP{#-JPdmgF#@s(N`(-?+<}}A}@HuGlmPI({^47ZJ?^=fG?=Qm8D<$FDkB? zxHRl&ACnuUgh=(8mSR(h6q}@~#HUYdiv7xX0|p{}pjteXj~zYqx;#{|2GyX4)9Q1irjg~^S(Zrf zA@eeMo0UwRK>tKY1r=|GcS1hDU?6O9ored=tOYI^9&^>32IlIZN?QGrilO&6Z(+QeDSDNxe26c%;|p(U6<{2^ zFFq&(PfgPzQ*n&1(u@9W*Dz+}3xi{}V4C`nQ4&bx9SK(gyQD1_Dk#5=DUx#Ih8)bPnbd`x2WM(2W6B zV&WpS{Vc)%p_E#WM++Nhl6ni-qAs%5uUwc4Y-`OI;Mvs_xi<@%17fXW(*@`3Xf_B7 zgQVO|9VCxI2WwlQ2n0BHH15O%!F2DPv)GY0#m8glr{fn$t!U1^b_BPdV7=NT$>r-L zL(*Q-=j(sOztt*yO9hrGRU(!J?re6h((z(|89iZmdf_XHGUJVz%n5^AwAROI-Aixi z>zi^Q53_FYT^ZIqh$ni0n94zLoQ0qgbfnb2Tm z9o3d_Y`S;WbcN5n{gt z5@mY=5dw$nz=NWJ4;Gyk(*>)Z`?{;E1nY+fZ_??3>~ft;xTYY#I-AidQHG{!x=UCe^hj)0 z%S>4Ot_I6QoeU%{qsss_m65YAgY?rbf4S#{m|fFIjDg3!ns_+dm5t)PolDc^`bv3J zB;^tqn6*~s$+{5OdFh%pHOQMu716{y!chZz zDDL|~kQ%j5$PRP-%dmlFgixn5O7nOS5!wk0eoJIYl3{Ns_YO{9s7QJauuy@qJ57f79eR!de?^guaj$=KTOf!7mN4h0Qz*gcd$8Hf2 z5WJ~sVLXt1F+#s4&n|GW#irlI+TIHrH|`9(MxASdzlFFka>=-uHaHjS`AC7fhost) zpodyK;hN4^wF-NU)wO!OJlqmgdAx3qvGr}JX`#rtH#e%j`WXBa`$9Ni($H~sRc#hw zZfW3Ph*$1oTH4UO^z8KleY_#gY&8*UFC3RHP!*a8XR5C$|I$Zft2mCO4n98`75t7(nJneB5{G(e9C|K-He> z)e9I0PF%x>)=qyV+}%_j-~Bn+ZS*FHrI8XxsPj@4uF>g}7^2I$@};ZjTcL~@YB!$3H5>YXAiA}R_C;VK7tS)Z{yIg4g%a+#`nWNoPZkz zVy20A#|#P2i7(Q66@RjGNIF1Mc}Eczn<bARW-wMLqnk&1bd}n5o8#ehJg!&k{BX zb!O9tYRJ%;_+iqeKDEnchg+hzwN`Ao^FLlsoIr)GR97C0BR86XBf0}vQXhX@DCxL2 zRKgqT=%~=BsI3a#anqkRMz! zzPVU?CrCLzBJ)SETN)M$k9)lqF%~0<=nD}+s=#XQE;Pi6hp=e~dj018*S|N}gYcYP z;_H1>cCTj*?p1m%02Cex`o6FH6?LgGQC%cu(yoQVNiYK*7ZE&X1g@#JcpRmsEfUz> zLhKCC$R}pvvb0l=yh>8dB9u}xdrqX5O_dDiSnAr4^0VH+2OpyQ22tCz(3OkZj(D}$3mYSOE-_I00=-gQ?3qM%6QS-KDJb3 zym7KQE|G|yVFjQ@M;@2?q!h4ZzSA!?ZHWgKSJcmI4TtAm4>^_x6CY}@Z#@Hm%U#`q zczf7k?B#4uZF}+8#W)J*`kPlX@q;8b^vk`q6v74)S#Buau^OZ=9`}6m%5;v|Kg@qy z?0Dk@<H_La2yzHNf9mJ4-D!6;udp)LBz;)ITWB%n!_?oM=^>j1~ z;RlCcwHa=gOA9r&4fjnXUJT%;sYcxB--b$;1y#W+t;BAy$jcGxuu5Opmu`p$) znnMsRqn#K%Lx*NfM|Dmh?oS2Qu47CExT|^1qK-G5=&HSAA_y6``3+~y@nSG93ljB9 z$HYPZAaC*(kO!*_JI+NW`n(_69?IR4G+opc72q6?OaHReUX**w%=-Lf_A63p5%+8< zrYqNgNJr3T53Dl+TfTs;-AqHew7s}F82dDG%R|^%-1ir?|B*ES=2-OZQc*Gm5}|0O z{%cE%Ju7&or6i!M4P-}tu56&y0pV9qVUI!!fM*;@udtkON?vBy+*1+MPFt60&lBG> zVFCk()`%k-N6=85eRA4UI5AQr@Lk&jPAmj3+Y?fu_jeZ2(P`S>wXe{T6cJ3Dt>_hX zTRhyb(4OFP8F&B!Vk-Xe#R7@^Rz>uFrAa0MK|wKLq*vM>4vTx#Qe0aG+AbcxBc}5@ z^l0icOfoat^`4C;AIxwTCI+Cye^tTf;l2di86$xVsZIA|RCKCXGS}f@ihUAnf0{j1 zRZt$lCN$@A5%QH*cSdD`G}CwImw~pQM?nc>aj9f8e-t=;~p{k6oe4fY7;01-%a-YqThe7=(!|Eq+_0 zo#yk4F)KM3;%ToND!JeXnYyooi;vMh`EBE#9a@ax&L@6tVS{=7jH;HXC<~M!Y!lQU z38a*whN?3RJ2dfsYH*%PcCf0!F`qzo=; zzJ}I|3LY*X3)FcdRO%sG-~^%ZFNR}p7fIT7sF90pCV20$(+mtj!l;I#mi;o+ z$j-B6F}zH1JOpvK2b!k9UAD@ns`hH&zIH_>*iET{`jGCIZ^H?ARK-n=U^g*+M)OU` z&5F$`@jm(NPOTA5qH-$oNEq&Wmn3c17%gy<_qF*#p&L!T1^(BpHhs0B(X zoM?_3m3Jen5Q^dSQ=Dkh$`R$q-M~74?4twA$+%hKFT<*>q?D7jEd=*=5L{~B(DAi5 z08hBh_ovT9WO*oXS%L%&pHPQNttXjZ`QR%@e!MVEv50t-9WL&b>LY@8)2aOxeR4XV zPTu=mu7nPpJWJya>=pLH{v z_V|*@Fd3=zx35@>;CK5{r`4xOsUsFKA+QE*F`Z@S(uOM#{x)m8A^W;Ziy~}4!JF>1 zls$9?XQ1=;eM^sXnpemMXu4~Pw31|!_&l-yD_x-@W9q#RU;FNCo)?eHz7W(bH3kKe zARV&lH?>blNNc0y)uIT)dEcdfBt5-iM%2B&dxJCNIABfO^i0MrpjV^&sw|l=n@#08Xo_8) zp3FY4!*9D!?*Q!~4Ynx4Z8fbbP_qZPMJpi-XPO4+&ND28XroP691Z)Y3CTdSb1p)n zzIpcSAriytiB109Y`oe1pP{FJ8~3FvQ>V}*?uqZDrWNXK&$PEVTHtg(qY?kU-)&(R zaxBB)E?o+z=vZD+>3Oa6#S;PltB9iRAj2sZc&4>ng4N~QVzNTrTKEL(cej6uBB;L8 za*jkbKRz7iNWy$!0(O9!tdRtb3;h#8>-X{5LW%8nn^yQOYHf_<7evN8>1Wih^p~1d z)!wqE-Y#B;M@#?kR8GEn08jDMGjM>hv?RcexrjQbjvLRs7X3KAB3aSndh9g8sP{5UlF7$48Neq(bRZt z$;SPj(g?}7W$}S&IP=VA`+&@bDlL_yH<^o2r^P@On>})ij|$hMbk`sym>aTmBU>Pa z5fd-s`)Y18hO@+TKOez&_CR;WDSb}do37+fL}&?TAF$uDpR^~f{_c?3WqmC2-9>kr zTv@ue&eT))lou*oSp7$Ar1@MiH|$Fd=o3fOu%}?6Kk3~&qE(}I<$2tY*KjxJ!j+Lv zzRNTvif2m*P@QJExB3&G&^hV-HTo9U);Q`06^e59%z6dpLNI_7=z4jraF5EE=j{3R zVtN8o4o%{-_w3xmn-pcK#Lu<3w#3ObXe-_S;uT}~YsAavl2;_m;QnYAE!AV;WGBzw zhrTV1a?|i)BaaqNuzd!7T638PT@Sta8ET zYa}}d7U8kaG|MuKm>l?xX>0UBp0#P4t8aW`-VwcD=@25>mTr|Sj_yxON1j=0SSnrq zle-A#;F5;9>stx)O89Qck=3u475xr*XK0D|HS{Of8}tE1MS6z&b|mI$=n1HV=J*E~ zdQP`(=9UcX#&r$TUr&VtF8dFg^H_XsSJeV-{b(^)nYu<%(*H~1`}*0{a~o8$>KRK@ z7k+Q+WJPi39Y05j2#w#3y;lhRF+FF$<*=8Q>>sT49L5&}U0G5@82*0L6OpJKN?s939;z!pAP%e_)UZvx<5AL}oE5Ca zcTH#PNg>*_7fpwc5KGtFDNR(VP~BAiOs6zT+XCy?-@ovS&Fr-s;vrtjnPJz4k+O#vJygFrs~b`&ckrVg87+2MxazWQo?2 z8vpDk{|tP0#rfGy!FSA$s~Qqmdx?Lk#|~LceyC7j$#YRTh6={;%JK~Q-|O3tBnlAM7)m6eFtJLw*$CG(ijPJuSeeyHVh za%GZZkSb?8-TE>KhjM73Ls#X(Go!Wbqa^#gUdE&SxPmi}Rh!@cZ?Gq3e@Wo%yV@COJ4Lmk_`Uc`K*dW9F zLFfBJuA*DZqPjmRD+`Zo7!{}3QF__%e6fA5F;0lVtRB8ymta8$)n4?QT^J@ofw(yu zbg;A)`Aj%^Ihh57ki&(Yk!|2_3k%1AZmNVAGhJ|CbcPsdcw-*vWlVUB2U3L!;h4$` za>@#D;%vL5^k_9k!`O1!(AQ@AL7Eaps1h}{VyFBZO10}xa(->QXvaQ$B+|<%r-h$_ z58ffm6EuXu%Zdn|9N5^6;>zO~n&h5`M&ix!dVFJazz8kzH9cZ(A4-T{mkr%`2{E&L zFXF^}J&??+ZT??Vg7zFMpe@xVjPjkennly)Z(0v#Il-jiQTS z`P#L=8P`2e@}gY}A7u;%_>LKBcuwc=QE_Hirh_D5n&l39EMk@Rr&p5%&6H(cTtb!P zeY=TJK9h6DW(LQ1hlt^FS-+#GAo{tIYh?J%Uy`Qm(^!tW%c`%&5t;PkJc&GL(}$k# zSrD&34YlxpQ-6kgsLgeHuVlqAFXUo<4Y6j_vg^ z;IO6re~kTJJws$tW6lKW$6*drlONK1L|R&#RE|89% zNw&XQS3b*#9AYz^m9M#5)S~tnyya>Z79e%5g}=E|W)$EwORcnmvCYN}WtQw(-wfJW z+wR{?drlWbMIbDUlLlu}F}Bb4y`wM0N^)md>ddJR79|+ba&`}di3Q5|-a?i`*Zmhu zzJ4dw?tiu~6u`dk=>!;A8!(X4L0oxVeO#x+_x(^R#Vh4dH?o!;4pk>HGT!kfdZ-S% zHgq8V)x(zV;LP~;U(Sb!#u!LdEdyF4owuS(cb1+GnuPrecQ&~lIlKn!-L1v1hRU>D$#)|7Q%b2wA z34T$aG3=ALbq9U9M_@fg@A#Wz&mT;nEwXRzDPiMo^1x{ZxZ_Dq*aK|yn5<0M2Mytq z`Onbkk7Zv)jE19x+;8MvI&8%{!UJ5wS05l6KW~4XaKKGE)KfBv&Wv#nKVzJKq&1e8 zc@Fe7t`_%QtEnSW^L;JcPK+-Q?e={CnaYMVq*XSkDMS$6%zLX>>R^0(>uFxq)-5WS z`CnTaBL5531R+P`+kXn0?B+k*Nbwo2VtF^2Z4-jv(EdL!z|>8txGto|!uCw!2QX{{ z|1u+3aLc$%d9fQko8ILT^dzjP`eWb7{(&V$X~np2`wsQ4Dn+&4a6;CRBjmbO#r*2V zU(>SCN9fU>D9UB;#+8D}!YJv5W{@mE0u`AzJ zr{A2q7;}6w;BYq!Rp4rR1{NRyK*N5g;Wtfr!@T~UqY!$@SG(u-q{_j_m#xy7Ngr4w z+DB@n%$vF1ZFX@r#zzVAb4Z>cm{!Z5f28?GHL6I(V@$q|evov(~WFXzDf{lwUyGRas6e(zbjO{bdtr4`%doBjX&~}`8brEixhS!?w(lRAk=Y#OpWo+al=+e7DFnAmrZd ziu5rm7om_YvqkGkfq-H$b#>2^ZTqVhddHUlBXIV&4k2 z_BeK(p0~!e5GzIm0~6%50QBSQ#i`OW$FtG0i0+ly53_W#Q=t$J9%H$zRPQJ>JR@K|T-3Dm;~gO3(GT;p zcda&lw<$63$|SnBmG~>9VuipQs@cJ1&p3miyuu8#>Z4asm6^;0$dS4yAle6*=}IG7Io6(T3Bltx-_vGr>1zkZ?=`hYOLplFlops^JT*u zE3%kVNnc%%UGk8tfbHEWpcZsNmuvmaaWRJMb1%8?p0BVVunL50N(>#72YEt<=$Ac9 z7``&edkud;C#@h}4&-BlEFi6C6>rlBW&#d0&wvCg&KW}9Cd6}gpa{iAeYd^BZs>%8 z)e5=x0h#rP_mbs`1&~0K-|X<_wR;#Qce9%;K7qxqLpi_i8@;v}az%~LcB1Jc*bKOB zVA_XYNZTlN-9>?k*q_BsL_hyJ{c83`herf>fPL-+=WV1SFH!qArZ*mvR3bB2j27>^ zW>eOsjlC%CO~w^$N0}lQ1-VGipT+FNK4Pc1OaiKR)65?Dn_5f}(@7e@_4h`!K;+#k zoUIW6zcv=5L_ScWq}HOw5>kE0YSJt%WdcTaeQOL*2bMe~ij1(-cf;NJJ3V$|AqU9g zN7(GNrgzi?e(cISYQY;g<=uker#OF=-}JCj@1S1is8XySyvFs}Jfje}VmPZujgs!W zj|K~~Sj+w8Hfm?8YMj|)YB6i3u!iNS6`LN)_NPUl--p%{fB1LPkIio$>6Fm@`PPz3 zh-Xzfd6AbtSDdT#CMXrdU2H*Gtk-rr04CS-b+Lwt%l*ws%V z_%&jiEHD53a6XLBc%VyBgr1P)84^>ra>6V=93|GivN^>0D+Vgj5hI)qa~ING3M9PX zkWFbt=YGTDRuu?Z+bTohlxr8~hHaG@ zptWVH>%|R6^>J^BQfS=70s3IY6xq2xJ|YBYD+YMFXLXGvUhSvhnMD5IUc=Xoj<01M zlN?KsH|=++M*ZRd9s4I(6GIZNEIdP4YKmV`f89uZm_`%@%mM0VKOdewQlJWB2I}vp z^bM9BX+X+dX3DN@^)EIaa55`z8_EyAMb1XtxsO_(H;(?Jgxs5s*I;Sshkj)%v)a4s zEsqPnbg^s{@jQV=l}t0J@ga19iu%x3oV zEwMD9``rJiBH)dKp1ZoUQ#$@$J;#TO4g{d2DupUT-e{5mNJ zZaTplIBvWLg!Li8Yw03JD$4)Gb;>R-uHnK9W<=(TFArz)zFY-_)2oC4#g%--%e4B> zk?v@_oO=~kXrCxi;e)U0h>>IW@4qA@)L~2&pf3jJRJ?`{*qc`59fKUUmwigIFSagP z;|GC9gzP)gE-B@!{-%^c8HIEa_OB# z2^S1kf^I)TXCxVc&!YZ@F6QsZE37+suMEwvUV!G^@cye7`((9n?9GN`!O&al`$WZH z=K5RNlwv^<2tS0gFqNjsX3;xHL7YgRW0-JuKJp#^iesT+Rn9IVWGZp)ln$M@VGRpE z_HnC?U-&SOy#Pf#x1(|0{Cq^u5rSnyYwcaVOSDKlO5_Iw2>ai2)c?N#K|V6h0S$@7 z{;_}feXgAn%As2<^E%;?D~%E9M|3OA#n)%UvuT&dA8kMK(JfAYs>tyNm+gU1GWs1@ z-L286$MHTjg>S7#MX}A5X0xVQ9s^bvq*kgLZ%^%i;g)b6wG^#g)HKOPt`wQm0lt~K zz3@Hpv4#ElsUec`HI=Gqf0tqIKb3+vIn#vJX{vIz`&^biiE8u{8SM5%-KFXkB2#tS z4OY7k2@Xo9Fk6PibedKktbGXQHl>v>YO0XE3cbF&4ZXd~_v)m@hrf1A2GBgbL0LYT zf7?2!rl%EXtk+Bulz#b|oG>oiIZcq>o6d-W)}5YNR_5w*8n;DGwsf`v>X(SsBp5gFu7~)$?VOhKmw~N}WW2nqMzb`>29x zu|9ue-mqHbdUmZJdb0#Ao|V}_WNhiCEzqrf{tR0KX!Vk-Ck(LR1fab5CNd-%beWqW zbw$Gp<N08)T3_LE>piK(P190EMzE z_9N{R^c|LzPVUicH$vmPk@>+Q#jG%)?2DZPZB)}=NEiJVp93^L0AS}nhHv_8AH*aL z6BhbN=>Si9XwZ=Y{<7`xkAy0@GrnsfCMefDvVpYno5>keefr%~gE_4Ml!g1gB#M0r zjKWdEHsYeoq0Myc{Pfi6-6ugFswqQmlXE4m!d}Ux6|2AboN{bTIWLs1E5GFk+Ax~5(QEgA<}OpSLgmHC_bs}H`7!WPcD~_=}Kqs z6}uitr_c(NP~SGPaegNyh>H8BUhr}r-eJ$WOR^{Msx+sG|6xX5j7j*mJ2d_Qnv(7} zed_oG6fG2(z};}W_Ck60=TW{$Xz#W-Ml^)X-Z4-tYUV?8+xokf>8AoL9WUxUuR3_~1KDPZVPK4UO>N zPceZTX z<{v2A<&EjCYl@N5g_fw|mnrhXHo3;rZIwigw+Y`#b{3 zQan_tfIMIwz3x;q!pN0R%4ntN_AbUrEZ@x&@VyDlv3==u1r_nfvX>aH2}|+z=Qm{U zEkg{fAd&i2y7E#rm)`*B>yu5_ia+TDygViKk@+Tr2l(vJp+%;jrKn$AyuRsu(|H*; zUSn!j;r!Xc7d$sEW`)u32xld@=ym%6{P$=@Vp_dFoAf;@gbYoLB8O%<<$SE{>*=5m z?pAp;wz$PEcgZmGH)o|({({8MxipVAl(%1OLH#OIw-jgOCbDbu7lr@)t!faL)!_w9 zyZ7L;F5QN09!yqim2`H|>zf8R^EPb@foA*Jv)t0dKhZLB^0(MqzmW2v?PPKXu6gv$JLPi5_0E0S)R^>iUiI(?=%>5PB-tI z-;pojANiUQ;NLGYk;RhYAG z8|a>BT1lWt@`Fxowz;%nXm-tgpt|1~xEa4lQnub_DXI*a7Dp%yDY?TNIO};W?gw*1 zJj7Tm0U-!I@OBu~Du!cKFedZ2bV}ShxLqQJsK_*s3YF|96t4Jd{>Wb$s;gF6xwE!svaa@)d-$$&@=F(3<(~vP$s&RV zR5t6T0A;?cG1upDqW z`A^)J3wDtimQ7r}wxeY6_}B~#V*gK=w8n{`qo0!q%kApMR(s3K>w$ z;+*{DY`lFcy5@2KpK`}$kl2i-{HECyLyOP7=@@ZG2=>RYbeLX8FRksnc~y3#(t#7^ z9slQwu3Lu6{mIe3&5rIV9|g!e)AW1PeHmLJ2hNjI5)%26bP(*e-2vS?e)hrY@0ftuGXoWuxOXleP;NJ5H}Wbz>2~Rzc@IxG zUPrz3dfKp`5lbz5RsIiOz7}mAdz?w7_i!jX%{OKiT(>>Kyy+{K?0pLN@{hprW^O&& z_RshF(e*&kkh`#43{qi+LljSV~yA;Exdmd9i=NicDPz|VB#^l!L zW*$9So8hA>TD0dN-%6#57emQdT?NkKN&&d?)Pz)~jTfC%@)GLxyzLH`#j#DTDME|| zqrC^5!rgzJc3b?90`!vb&`GX^>=W-N48$+fX7HgCf`lj~2FXF*>9oyV07_6Nedp>% z4@QCk(B-GKbUt}{K_GUzSdhEC)8cbc4ip%kH$!c$$6}1lXRp9IMu1>d9W3Xwh$hdq zd%?d2vB__qDKnGQ$t(0>)6|;?iVn>^L($*X}&ej@Xq9%!hQd|?%FDPN*lw?M5ZT`@E#h}hn4}g+l*4GT@w=3J z*|iZ8vSl%uHH56gcrYMy#lWRDHL@7oF_o{jZFcA{Bd|~PEiD5av7FYz)(kiX*?Xk> zIO2q}2gmwm&JA>o>_PHU-*?q*T+4D#Z zTR=K-i=nmf3!$xN8FgI&9)@3Uz&^t;$9F|CyUiDGq{D!PX5SPQXrj`$Js&K#t!Mlu@M%~lcKBXIZ?yWj9f~S`LA)66pW?dKuCnO&P}@F!!{qT& zfcuUUZk^8yxmdGO9Q40e1+2UsE7$oD)+XxKKU4>;#jbZ|Kw^#0?KF?iw7lZL^#}dC z#_|Nh-u3-fpMcdyw2Z}%gYj?a!A&fp7@_r30!Mdx-fDr#zJl^CZf%_o+pkP^8`acc#a2Tv{rw&bPRGV?yMz3@Pfns*cq|N?DyBBqk3d6iw0~*w9JN*Ljnn zudkWj4#~9WiEgKa-~Z@*YEdOUJ#TdTn-;Crn8x~dn}f_N`;Uu1$$!(NozYnT6HY%& zeyf~dk6MDls&1!qAJj8u)mUu51qyKHN6zC$zEU()119X6onK#|!#>h{@jM&N122?3 z)V@>?mUVfjpZ-;d^G{UKx9z*=xzk>hK*Rv`*R81vW4?=DiNoMq*EqGg3djeFbP%nr zTxGu-D}ar@sbPC}pJIXV$1+3SA=}J;*X@=h6oNSpelpks2aH*mpi{{@U*mq;=a|TJ z7Q3FC>J%7L*8?`?@abPyoq;2=uqbqg(Da+U$qxWXUFz!Lv zsWu>0`-hwKUkVdx&SPw~)4OADAsAGi+GIY#*!1$-GndnzG=b!;KH`Buaz)=-6raXDG)?3Z}UguRB3!*bcACC zD)FYxmf3C32^Cl144`t)B-Vodn7XC%70H;<28}T9M#CPh4)@WDR!tAD?5uoTEB~o3 zQvf8y!PbvavJ~=A9-;VRxeVt&rM~#}%86IB#-D})pgvLQx*rR7bZxce(5m^h$-3sb zJ}mEmq-}Q6>?~BX3#t)LW_dFY^)xA2F^aIk%?FeTP`lf-UmPuLnvD9U31WtD&iqZA zFb->&Yk9shm_b)J2E?S$!$v#x1lr3xS^>@u2HZ*Hw{igI|J=A1u}`&pftz&zKpa6^ zCzl}Avpq4Z*Z+;mm3^yZ3asd?o-k>q@qx>fRK zd$ivr$oSE626me^Ge8&e-l7j{kh1;G);5QcS}Dz)(e0MI?YuKv^@~I)a^&d^$U8lL zU@6x&gPs4Fp>C&BDn_rSvoA#{s}bVu?8iX=vRqV&&W1i>V4tU_T0Z_mkVUz(A%7hq z=-;gnnCBs7zaT>}oNuUOUjB|BJtS7!fO@iDy}jc7!H6X6jeV~vxM<&-> zQW3(YgX$vjE3T>x3MV&MXUR6CbV;|Kb*U`IWqoIKvnYA9Lk!&7rFUzJcM&zCt;4ec z9fihem(TTyS6P)Bepif;28x+QU$Tok`KSE2fTB!02WRWl)07Ly`0S?OF!@QmCce;>>z`rT08@qn7Zp|R<(2%HU)R0YU$SO0G9s%UFBL#F)xm4gb`Xt~-N zKAi$`!KIQrQIqOU<;y^?2X_#$!#zpi@jTv;rtN$a!I;RxhfuApxm2CSXqINC(nOYk z?c3zj%@390AFn;C(EJh_=n=yV$Qi>`rUAO`zm%I4S~rxf+bSDa#wq~!J@SQ7NA}GI zDaXI_&%uL9Ni7Lm<2l%D1H(vfXrAHX>z1@R`Mx`$41@@|_vaM%Z<7jJS_P9Ecqeu+ zlZIqbf;uW#enA`iz$|lLK3l&aUNS3(bxl#yHvoB7J_3s$5>#uaUY1r%O72^G`<}tv zH0p~ZYG&_V%k~gZIEc&seqbD4gNU85Yxe9HfFG!?MGXP3nuO{WU0)Q~l@Y#$soeIWz4`@sBNdkT zOE~={?175ogrJDK*T(F^3@J|PY83!inK!7A;xgH-+*O`R7lSX6U@_0`3FHISa% zpRXCyoznl0n?*Dr;lb*(O4^t2d17nk$Oqr%bC#)|P?1_XLnbzr$+9=JtS`qd;99eX-(|`|T#c$Q6iTcO^Eh7&HXcnvedsUtDD&N=Q!b_~PpG$&~-!{NHF z?tDmnX#5&Lp*HgL2h7mKmuXpF60o^m=rPmF(b7NMzb*DIc zM6EF*4}W`jT^ILX)Wo`P8MF7AVDyj<8bp4Nn4ps1UL0C{Y(}$H;`DZ0{)>Sz63Of? z40OYytCG3M+*UntbBlL&I>h}Y%d)%^LXmWG=W4x-<@h; zIl#bf(Yb1D4RJZdgIA@UhogOJMTSR&N5y)c?8B`W`Sobg`sQytBY~7+4oln}k6+Oc zOlz<;q8<6hsVVQ!4nr~1*9tr7#z3!R90+UQROAh9CB8y%A2B1$TOOy>D>r=0yVRzw zyv#+&5V3T8in@Qo%2f=01+OXq@`){?(P3gUY8L^T@qaVWv?6(^)OLq-qZ|A5O`W!l z$UB5}ue6FM$$xp%!5{-`{Q~ zVhO}Ci|dAMHIuqm)5=%G=k6$`e=e}oYF!Xn1VU3ugIwfd1S`h_W z>v_j4d^FsRocjPSIV`LG@>7{X1uNxBn<;1Y1SAdfN}Gtx<2sk-L{(j55XYw@w^rq{ zm7sb40&7E@=2!5`uzJcX;v+`*+vT25h@L}j;I_uW!^@^?y1*a}He7 zol#;T?+qW=i)Vjy4O)^vuF=n2$Pz*=dg@j7|0J;qG$#tU8`fd0*4E1@ERff)LJ4OX z=>6Z>8*^1?!!s9oNOkCZ2a{*qe8)bY*~R=9?4MU_6{CY%0Ps=ub@HF>LqS^zS9I=H z&_6t)IxePRCNuj!g{SI2{lU1*P~eKQgkR=#VHe^Oc&Q1IW2VNlC}i7j#Odk5wk`Dk zX!^>ysGc`ox@+kMmy!mh8(EM>V(FCb?nZ>AO97=DmRhfY%z8x8n`Q#BO+d1 zT${EOU5Oi%Bu~Gx7A<-?`&Rw{5XcJ)mOu2Q1@tPwP8mf7nssh%#C+17Z~%5gV>1TJ z@-H8XWEWRZTEhu|I}?6Oj)|AD>^$Ln<={#U2vfLFL7uUdo=;l2h9-ESQ>mdb=sKGl zxrXMb0?bRFGlT}q2LppR!?TMh!}0E;=|foiI#q_LzCnyFEQybZq-ra^gOrmbCZ~}4 zt4^QU!6w_1EGBIOA$oq8FkO@*;|UD<1wnMyp@kU7IuV| zb`gqLO}oTApfCxaMrF3xaIasZV8#gAp7YPBrFSgzm41yZr(%F@*kx>ciR&n_Y$0xgg z>HpgkbB~@BMOsmA`*G(B@x8m)zwa9y?i5zDnwj?H_Bf>?Jl<^gn23*|kO4*A% z5k{@AXJL8t@pdm@nC_8_SA_hcuqLnD6c%1*kJXc9xp#O!SV#}mMBd+hEZ1XaUWzF2 zdh%14BjqSycaC`d<0h>1{p~LhbiXs~N0*btT+cZ^NelVRjhmW=gr4iutMZ@BXhb+F z8n-!mm;=mKwee;&pIR7eNy>i9aqIoJ%6GAz0jJPVT7_1w>90pgl#M4dhrwJxh(T-6 zLud8oa7A|Tfa%1fD2DV6AX_$XU!C#QaHt$hpJQ?XD8@R} z+PK%v%kY3fsgSC^*A;^>Y42O#>XQ)uM7&f~SPuUC;-=U)&~{8D!J3DApck2hiATH` z0^G0%qH@aw!&ELZQSSeH$pHVwI$4;x{$0y;G6g>rpa%WCl-KoAwl3o_1sQ%~e_Qi+ zA&TX=f~@<>ZhG(cBOY`^~;^q2jA?A;oRYI)R!X%oAqJZS)Ya`T1=psD>dpxXTy zYS2BsXC&!caTgMOyKSQjO1EfSMdTkcsMv+uZ~xj_d+Y|Kum8;ik3z=Rs;ho|cDHAZ zIgIPUih!_O%FcJHm_V#4MHiMKHJ=^%47xNN zKcq~9gx=E=*n>27lki^!B`&;R>xg{z)+;23z$SvTV?YQv&eS48#nD8g7XHQO4xwGt zr&8`%qzrX0u?FUj`W6ayM7Cdep7Z^>>du9n_&tju#lxuHm0NyqOmbzH{yY<}oA>L| z=i{8qn|dc;XZA`9;&Q$pMbL>rUJPyc)?lDTBQrWB5~DOT``TLkx`>$ieFe0AOOj6! z@q32bj}5HWsyXi0!9`XZ_sQojhuxe{f5M(o4+Ax>JesPRmFAhxtMc+*FNDt{vb?_Y zspCV6^AKS~T~pdI3#lb~t{HuZOW){drkWGEnhq*OtRl1=ilgG%6C3?k(NOWl=ZSca zO2mC8rPsGqeG-uwATM!PcuJ^oM&edry>GuJ#_qU|I1MwzoX@Ia1QliJdd}DFktr})sfStrkrK7TS zDxil@UJolQzyd|bOj7!y)FLmX4%*Y}#n|ZkE54FtAxD7N)o;sej^^LpU$a7j3vIyH zPXaLVKC(uxwHy=o5!%dd>w@dI>c{6_5?HU-!M+0nr+yZ@eCm{V{jVn=#iPEDLVaVK z<%V7ZNR2$e=b;BWb`(i(S?E0V|I^<)z-7jpP^@u^JCDMAt|(c-O{G&08cM(G$lf-s zD}p`+x`*`~7+nyZ4u9&yV+i#YoUDpO)C}s}1~(|i9dMjQGuK8@~Qc})_)cwu)qG$881hn2={%|r`PZ9?weB#zB)en=?46#QNUpF z?uYl$(P7t5)b&z*9*f^z+2PEMnF^NZv5i{kT(C>QN&lY$uAkS5oKYrGjbx>wm&fh|YP_BQTddky z|B-)kFctZkyLBkyR4PL(L~&))5jbvP`+94`uTX$^{tu&HM9lLG#vf@1qRFVp|6QJhBnd9c%uNlPzy^Z zplj*IVOJx{Pp~EcE4KJOVnbLKrTzPjM9}Sm7xcTkI@IeE!th^j}A+v`Y%dfC(le)7wuWpzwtWps~Tmby|BRmXj-gasdD+Z z^Bk%X8QPCTCJ>BJxjzl5SwD||2g#{1wf+Mx#oSR?@oB$3d#Y&ges16(URacsp zuPy5k0 z%KWQ{tFUNPCufl+*;m~UJ#0>>ruW{X7I&TZ+GqJ$2|=SyKqa8k&#$hIB-nGY**Bt3kj5Ly}tYvSg zgPJ^`QkHca@dn;X;W(;tNO zG9^0(t$OED13ONeORt*Df#96~i`i!?3u6bK>N{PCCJC>Ea?!hx4V5of2CE3NcYjL0 z@@xsK(P)^;(fC;sE`4%(_~CqIA>tO9uj+39_G1hEFOu#TG`L+8SDYZ}{F*`ki6hb0 zigvM}+8nuC8Qsdw8uhH{+frG{$d@ArE%lbSPBg+vertyy>$a-jSKlcc#n-FS9I#+- z;Icc|{4NDA2{CBqh(FNcrRfAL^qln6eA^dTRZ%wmo8fWHmdE#9X)2)Bl||)hJ}x+c zD)2EMff)~|jY-41o+1!=7T)?Tn_0Y|tX3kNE8*vb+cnqkl%jk2Py|!JYu$&_8T{BE zp%mB{s)8}Bc(E+XuqfjYBY zcP8)cT$BmJ&p3{aH;&7?G8V@;aANRtqy46L^f*5$5 zHc}V4Ya3OjPL$4OB4~V&qyEqQlpa-zb!sLAIIXMmG8H4d#y&71vz;z(1YdrWpm*3z zOQ$Au3Dm;U?v@AcH3LNoe}%ivWIK2sP+1AJXB}gPI;%E3 z#SZ=!ntwAcYpqrGw`;WCGv=Vqe7IZhAUUzEX5jt4ah{a>*&+4MilAQ6iwc1ztN4dy zsfq`2p_!8O3ReL)QQ7EBbVaY@`z7EnCL)+N{s5SqejUM0M~1Z+D%Of${suk$kd@T; zi6uyZOjLsC{PD(f^!5%1iyOuK+o23uO^*>6LvFLOc-d?fCf&Q83*mNsJh{_Pc1Vh% z_q!^3&28B=ou~a=mpr+!WG?kbD)RxfN;$ll0an{0>QTdDn*v8$kp`B`X=NGGzmY@b z6+0sMT~aU40oF-zSwi1NuVL7r@j1~cd0QepPHV9SncE^lVd6>*86wQxiNQ~U8BUuPCzHRGTxNlEIj)D-?QqPdaCc$J% z=7IF|{yS5mq|}0?@`r<{lrs-$#9c0C3(ZJYknyPXJ`R0l>!9D*FVXFZ+#0H+Y2t%0 z+8j#aq~880cAFKsh1K)844B^okuiHb;v<7Fv5M@CFQ0q+bzIU>u$irkppN!{-{>Ra z+Z&vz_@<4%qvLJFLgqYSg4h>dK;ws!r!I8GVK^|`8fuc+=%FqcHJG&;2}DMU*CGP` zyJ9Gu`y<&g_(HDTY;oQgrcnlp*l;S8d@oWNA)PYXl}I`HuT$}7dx(h;_*?WsW9RT0 zmag_4j(<4Y?z%^QQ{<)w-MMRJK8?d*IA9eX%V%+pIhNtIQ;5fxTVmDq@M3^bOW+$ zteGX^ZL-wM?*1Ov@wYg=l`iXSC~`d99;>--m#P~Pea1B!%soc)h4VCl_Bo>x4GH!| zI+UDn@3yRGv)eP@ugrJ&rVe!?-7ep#L4{5hZBqQ3$r~A>7QtYF--J@mc|;27iN)-r zV=OoWAF1#hI>#zxas_{JihU!-ns4gmEmFTzeK*iEAs6Cmu(=|lV^oNwU$frg-yNOV z;k@?efCVtK=rs~l4$FVuJFdIV$_(gL?u$%A2K5#oR?6kjADQ66T<#7-u4Wgh?+*EwJ{caM5wpaf$)JwZ_a(|pzMR@1(QF4YN|7Cnn$CHik#WILK z6~{l22umL}(c*CzZNGKijQ~y@tbUSd) z-O=J9r2!S9QmW4Dgst&9{s_X|+WamR9Inv!d`bNu?dP5rImjtX;0H0f7KYeMO|8%w zrk`C#28g@zYSKLOBI?(F8O5Swqqb7+vtR|kgR!OWcv2zk(GRND zhD{f=f0#sX?NMX;+RlBd3kxP$qVjFA_?hxfrCfSm2yVFE!>vDLASPedB|gtDV!h!~ z_E;f=X=A)OOLup#hDc^3!RNQuA-X~jxBE-wKmN#hvc8k% zt?ciTgPvPLN||RUAZ61F)nz36ca@z|cuuM&emtO&=v~CAu+{O$nHihm z?X#KhoEgn%L+<4|g|61TKOELZ?a^bTqwDpLZ8*qzdRq^gF@{o@NEW`U{lPV(8o>Os zvRltG(s%dLi3F`9<5kg$vYC7$vH+wK^>u;Sroa=$mYv;+NTFXbS35&U*4gs8h~bf1|?I3SjE!v}THL{LZXNfCU#IWjFoN#DydcE(KGotU+_2#ppDXg{_}}^2cIvUnc*8%#|GxRox9>&J2&*EYIlvr5YGr{zG-SU}xqYn)DQCn8dm<<1trGHMa z>rs-GH%ynJFL^L1qYn+!$~w|_^^smVS3TA#2uTeWGsR%Xy}x|O$_Gk@f`tMnH1cG& zod0@fz@H`U@|3TX*>s$z4m7VDR%CgG@()7cy>-wF)nlT8fj2?%HUmfEqzV^?_&j07(W7 zybi)PEMOny(d{d?a5{>IuoP(OYRtrhzDDhm{IQVD!Fm;I*Xj(&q_M;j~W!PG6?mJ0bb0TGgR? z9zJ&g<$f%QW{2j{M_>At&b@s|sdqm)-nm*!t-iT3f+JombTKqCCbRX4%%c~*_Bc^F_bkxc!Y4COHaSXrqt{Se zZG`)B>cXF#_+=3@u#a>7#?X~l-5*bHgYG}z;DPKcI#$Ec=FvM$pNF9x7E6+^C5^k~ z(({yC^_hYNzr8`^=VB^K91H5hdAsXh)=DUJGV1Gxk-l`=I8rtF>4R9Sf%brMJa{;O zRe_s-LTGQaIwzNZFhv@JPXep%BtAuIB#iHaF9pC4GJ66~VwGauWAcb+Kp*b*5RWz< z9@D}vx1HdBW$ZgwGjAeLeTgvl+mFA}fX&5_{3wphTj9zie!VlCm@mp8G0Kcc8{~BB z`Z2rP2<7Au^ww{BJpnG>XxmzEvSX(ic%&>0<2E<&?}k1ym$|P2T2|KufkqIvD$*V6 zshKAhpidRVZFX}*j2hfWpVa(>L#+^K);Z~oSc|P0Eo6IEwORRG;J2~Cr6G77>--`w zMiwC*mu`GA$+IzREed|Ht(NzXg=0pqJ=#wxdtr-4?A1I*LGH19O{9~3vQ`~4P-i#; zn-d_(qeLFgR}I&~f{F0;%@XsZisA7Vd1qvvY;(2eS|BX&Z`Rx8h(>?LF8h+g{7Puf z+vAxY%meH4BLp^Ltz1QWfTO*q%Mj!N$VegF_ha|SIX9a6^T0HfvF!m^=9EBKf*;8D zJmk@nF1xHi{pO&ec@Wt14V+l`Oa0|!FJ=%)lD35jII=c1$Q<?JRK6I2=W-|l^4^J9J$jIEQ8{{wNv|*c*}3?=-D|_qvLB`d$G14 z4t&8f>Om!UZe^=GB5i|qT@1Nb1{rGAl%AAA^}&~mxg}==d_n+J8IBj63r-c^i%uz@ za{{_7L1NE~C;fj1NJf4=#Iz0vf#kS>wLQMaZ{RaF+b7{uf5HL*I~Q6z9M7wG#$P{c zsD{#ntk*&KSb<}4)dRV2;oG^$4Rv@vX^SkDPaIblvdw7$ z{KY1}8*<d!6{O}t5pfnx6_F+ZM zD%!%}@`%Vkf|!t&z&^n3i@YU>8e+J4hn9z?0~zN4HoJAWU%!zdKAZ>oq(Z`gBY%1s zD^t7lKtJ6KO%z{XZKDNif+E;}MObg(uHeg-+!PlQ;Nl9ff=FR&;wVQSZUsf!p#eUb zfk;NswrIaq$>HzHYA&`XLmwAHUnY#Z0h?(Y#w3_D%*9@+>!2$71qjrivU~T$J0T|f zVG*{z9Fd!G5;kSLziX76I6E0BoUhVYj#MA-9oLP(%wYXV zjAyS9Z1^d5mRFz_8effMKvh)|xA?^!%~#0pkgUSL&%DtABw^tK(! zoN{@Zvs5mx4brB}z{YG_B*(Ro`qE%bX5tE~Nf%4j66=zGTWRkz2;ZjCu(pZLK?d=0&}S?H2{@$9ZW$ zxjAHLpYxW*%EX@j=h#Q^B`)+f?3?6yqAGRHZ}aFue)6lYhI2HTk6~lB-t0YZdEVE; z3?@?S++70mX41nyTCz=J?%n@E6xARLP!&p^N2zqv1(iz==!f=~s_{e*yu~?iRJLOQ ze6j!!!>_q>zuD(Q@_|6Yz||QUW$@-3xKh(~1ard50WIK@4p?4OH&m7zI8gaB-7>ct z2?EOkLZ`WG+Y6e81ROs@AE}M$7=~ScB~M>C>*k9_o0|VF_bsF>iMvht`dp-c_?CqL zIiA!jC*VET#l3`P&eM%sCgPD0ky9b3jC6Nkt)OMP1$M) zsl!Mk=W5~jjO}$_?QML#iT#fxS=0VMp4JC5r!Vyy29pQnb>WLPakqA%n&Cdrr~@nw zKgCsOTk3)Xjo>uaaXH_98h?(NR9n=|QKmfDrib3j5|`SI#MFC?=$%YcSablzGQN*% z%qix5`frCZvgVR{=f^Nfk&8Q_N(A%35IZO@P|!Aj_w@9Nf%6}JnGNaa!wjhOUl{bz zID}nfQs>MW82I->kCW-9JikDU3IQ1wAUnf)i}0t<t!kGlj5Ds`AQtsSKVO3GgWlY3>OB)|J13793~IGD<;raI%_OJQN<5 z!T#N&qoPPUMry;D?|0KY{9G0!xtAwX_E6^fx;=QkcM0k7Dl0+;D~v+JDS)b=f<}k; z8bj&a^qEWZ+i+PIM0&D++sj7W+L5^2x!<#H}cKN-!>hYlcf*wzgi)pIo_a@yzKh;v_$W~&sbv!jfFsdH8 z;Wl^NXY8^KZ(`CmM0>+mvi2=l%Vp@noTANFdT3`wIo!DydofFMifuiZ2~+Whit4KI znDXKDCno)|pqvv)-yp*-z`V6I*38;9dB)0Q!8sGT|J3Oq2Hjl|uM%DR-2+woYHjHB zQq1iew-RBx)mc$?)O7mRq6S~;zyWF2A**-3PHcRAXfgYPn?jdrVWiL0lr1Za6ukKV zE`JC$CNz^p1d}e#DKw^bxyKI5xa2~Bihnw@-Fpkap^u~ubYuj;Ox4JHj zf~LAyH45TY{QFau8}E@`< zMiyu1%dPG5#RPM<|2Mk&!Z+aV>rgp-$%ppY)AamD%qivICV`a+BCL&nov*S~1SU?) zE;&3|J8_JA6rbd0-#zl)U=C>wst_Ol5;`-H73cB4s5EBP3Yxx}JslCkjkz{mo8Mc4 zb})rZYio>wj@`oyhHJ#TPd+wH>*(s_NzO4%GU3GpD6Nc2`8W0$dHOZ5X`K`o6zYQC zwoA{zBxH7jocy#oP-9Ce^r5y5NcCnP{rzmg2Ot>L_0*rlFQqaYy^=(vAjI^Kkb7sv z*ry_6=t*$mW*dBl8KY8*(8>Bkk;K{P3HHF1%kd%g#fl760xy5h{r6J)dra5g_hSPm z5l<4-HtWe`k5XGtF^|_6$(ukuo4vn7Bqb4ue=IMeh{Yyk7~wb9TR}5XtWMj^n!FyE6y&uJSVwEXy6TtvYkKRhF67A z-pHoURY#`lAr2by?n#&L{Ff&zt+ohgd~saX@L*rMjp7rHs(68OFGe3J2q#(a-MD~# z$29-K9|$63`@jltkex;%^jr{&mtu+KL15fD_d@!ZK!c| zuxS4lEwST5JrT=MYHSm*_Pp>(d|S=s=Qq|F)@|92n@{ij{Yyt)IEHSLvV@1vo|RYkIr+Z!l7&S>J!+uW|E)7WplhYC^~LT_?W|De z{*VYt8VRrg?rJ(0j4F`6>p^k}x8vnQ86r#{JdmihB_812XC&B=Kxfo396)$CYZfwX z1WS_=_paU0s9E1NZ-5R=zCoBbObd12b-2Vnw@-h7#X6r;oMKgHR7NssK*i!9B7HFC z#c$HkZprp{p)?xd;c1XCfC6|7iX_QR`6b4eH~13RTnqW|9{to?Yka?GDC$5MaMKPU z(q*f90^lQtz1g`{kO4a>obqWGW=>=zf+`-7*n9W}^z8*WXF}~EmO3dr7-#@G0U*s= z0iRWUkAQYZSaA&;e0he3Mop7}f)nnf1i%g>IBrwj=cB|xA!DXVh8BJYJZZ>A?KY)8 zyf?$QFWy?(R(uj$3N7Q;Q-uVigkG?;Y&JW2It#dhJo=7XV%9h zk}X`o;D|GYei-=TO@s7%Z)WY2OU_*V=oDPZz_q}|22 z2eR}}Pn|EJi<-|un=pgdJIES4kip+9vamE;=xBx(=9yMw;1YzHuK*eFIp)HTEANsv`Y{7K9KW)|qFJS(l zJ02|x!p9G!5fWP9+J=?erWnrHHo<-OeJZgs)jb4(=LzG&OR~)BUCYa_LZ-98{$_4- zE2K$$Eb+m%d<%#Od+ob5h13x_PQe))0Ni9JC)Zo%gCxjKO%(rpF%rXU`J>805Qe~L z6zT-aFBccNyxqPkwWz-f{_4k^Z=-(-TdKy^NJ6JYQ3DQ1L)8u5)UkooY;1mnhMUc= zec`^912ymiwOHXJwOP7+^sZAHrm+2PgI)z!a9DW!$Mx6U6W#GXY^8*qIrud=0f6&Kgt~GVQQmN9SOG& zfcEgBsH3_F{4hR=NNTqXvAD-j;(p^Uj8__(OQCNgqS5_Rd!K=-m2BonQ z>DRpXPxTqw8*=0Jd@BI0x^>)6ouQZECB;L2;;V!-Lj}@H!s9G(~`-& zdgt_nvdZxBN)a;TEi+of=F z=0o9=EjZV3X&Dl5PJPZg`9yT zSaq3;v9xOl6J2Q?vZFuU)#oR=1!;Qn(}*#1w9RK6k$uvRqEo)*&#pl<;gdvIiWa^$ z3!fUZ(q;Go1?T?Bgk?65jU=m6*myCwac^hmXKZ`&H_3N1zc_KTcpas3vI%8TkYQaC z50%yy`S@EXX|uQ+qhzv0Ax!7>u{ihHmWIN4^$mrseaQoIGn>&ihp)WrA1u*^a0h3i zmGyDp*ELogj{GLk)=za=*57(o@>f{9Ys#@q1B?-=x&u|#%$_OJR(QVX`LxNk!SA+z zm6mEV%_~3oV8#?r2df5QZ~|&hgxVHKa>G68_d-^vsYo5p@ICy-(3_T{K4N0c`>j1G_Y6} zn2wF7GLPM2nv~`shlE><+12@S^WE7SBLMD}JgM!sG5X!uU-dw8IWCQBBEz#7NG6e4VR%IA1*So*&3?QahUkwed)|lQy8$6Jk;ctG&Z^z>Qp)@!F z5=M0g>C+rF{H6cW;Ev6uMwF{dN*<;9hAkytn*f%rKzlz-=Pt5fOl!sfNej?72@=E? z5p)y;G6sCIN@+iJBlo!#w83ATrpVAspMU*=NdG34Dx)ZAyws(MdSK{G?*VPn=RO^B zuLd#{Xl{8!!WzUPfsGl(2EOEnF$w^iDfZg^1=?zxnkOjh(uxe=;bri1abZEorp+VV zo@(IIQW+d*2tR#{GA7CH@m|BkzHDT=sl8kBp#Yd*tgluT1KsY!lN0$Qy((RayUf*iF_V zhd!sTk^(Z^o8afl3soWlS+Q$Gp-`j-N)&cW<>|rZc6d$8maP|zD#RLS zye*yU%vYkqnS}9)xz&Zug7GH$68m!L0yEgtc?i^_PHnorLis<(;gDV>f`p7P_?wcwN?1HWWTw)D&%Qc!~yV zhI&*%Z6DA9%jTftAw0vM0?>Ev-!5|(Cx1e3VNbdsF|v#U;fUW_iAeMK=A`*N1Sjw; zoKG+_C&8{mo-sywEhLy`NzyYf&eY@6dea|7o=_ef1?}>TA8*ACF3H?p$Py;?M{Z~t zJZL`6zF8ozJW4t$ZyXFjpGh1a(muNEho)j=k2*1+pr)cDWc+Q4>v569mMl)*-^lkh zSP#C1Gw5G#X#X&wxnapX0}cQ(?C;<+s1$}lCez?C^wugD9nEUk=g8{4{Vi{;=Ggd= zkuTccWO-I#5k z?#(Pq^EP3u*L>TrXZ@!nkv{%=HDrS!JgK|Bg+dn|4?kOMOp>%TkK3>8@QosC_IqHO ztPml|>r{URy-kKj6rpk-pHKwK<1(DqK}mvzfhLD)aXUm8Ze-xk;`U{LvFt+_>a<-A z;p3v@3c!AsOV^^pUr)`*{w!$fIZ8pN2KsPmi?46X*?n|Hd52<9sbRPlNRBrf{fydr z`%B1TVXM-NiD5)ShY;q~)l$3UVU^Bvabbj5V3`=*%0X_`Yih~V6?Xr|`N$PDgG;%# z`%4Dv+1to3K^Xmjii3qp$dc`o2p3 zZxC?{^V-MRN>(rR!EbL4JOdVQ{4P$7ZyN5T7o%PnIXXbqT?Qtqs=2DH$Z2vDyB7O3 z^L8%WTMG!m9Bmi5Gq!|jB}1prW~HBq-P7kgW<8G4?GxR(ZH;<<{0pLJhw`?p#dfv+ zMERx9fRV!nCT5pC`b^)XA4$RC%TN5fRfzl&3_Y4yTxv*s4fqv#Uc8Wniw6*>BqZuk z&G1wJwJa=|7Fkil)~3kNPZD#1BKbeV{IpP3)FTR2_Q|h*w5m#F7g(a>*2#Dw2_jeBl6_ zu?N$)o^MwdVwkbwTXi!s-wP!LNmymtL-#np-3Nx zWH`gouC`?wznCXce}co#g`mxGUd?~Y38y#<(M$#IWn&kein994J0YI#C35$q`I-=7#Q z0J+7G-{i%GOZ|PH>>m-0D#`ii8Qd`%ASUY%OjfVUfA^Q9UANk*l8#K89YdmkcIgvS8)LoiwTI8>j@09wC-(s;*wpy`$VUKwBL!OobQ zDn3V)n?=^K8e_#0T$HLqR))CeZs#Fh-t`!5AMHwj5RDi@N)wd?t%v5h+2K8-uh<;yl1y9a76d^=@3jBuLtT;l>I{cg{S#GkY3F+#!5B% zCTgt%5VA%zGQQvFBMhiU7C^hP_wde0IM}Pw?1;Cd09_`aM^c4@iG9JLjQQ6|&}N9y z%=e(_m8g76&=pxmHsMf!=b0tn=2aY2>K&Iq8ZC>`DN0gPu0?Q|{}`op%M)oGlxxqV zfyp(LLvx@=5g5D*WmIbw%9n)gTs=b>=!&d`G$( zmfvY97QY3fiKy0$$d1$sTSbR=X13IXV>q9(Oag*8s#^09cFe zR6iTclbXNL*ssBPVl505Pa5|JHp?v`%_w|s5vs}4n|zZ3TN$_cV6dZ01AmoUM}Wz<`a)ccu7`74|KBd$wTP@H_~yokytPNsDcaUj=%Xox z&s~@Djm^1UD!Q~Pr|^fgwM=l%Xc%_wLk{BYt;d%o)Xw#)BZy1BcK+v{%XzcAy7 z{EuiTodCR!h8b(p1iwBy6{xljrZ59XVxO~i52Jr^L|Yi&AAr>KjoRA&0|1uWK~Y{g z(A2@gb3V|F32M@!u=n@a#;ungDQM5WL#`zpAoZs>gQ~Bli#LL3veR=bRc%iRY4!Cr zZ#u~8yHf7dEH|f&Wzf%a6DE!jKG#j1;4^1jQ(?vgo{{70QFC_cG)s%J) zFYaIb^QE>DJe1sW+F2xPTM+3E=4wY<&5q@HBiz_l&#)kw#(?W-v$+wRyV1`z`n&ol z?yE@dk+b;J`RKs;ZrOqO*u}{svv@-4^_1};(p6oPqBp5(J$MlS7_;_f74O_8#azW1 z3vuBK@NZ|Y^q#rt=bQ=lzmBN1CH%)Egr;^$ukMdKEP-Z<9wn%ZsR)&(#Yea@e)wRR zh|1~?Dh`^@%1$K&V}Au9ytxVR)Z{IKEegrETK6heNd7G;k5-RBhKEd*z_T zDJj*Lcz0y_3=TEEi0Vz2x6W$x1@g5F!?rQ5D3`^<>k)&!cZ9`SnzVu$FSQJx*E0Tk zA+sbIB_tA-Uhi|Qj;&ulebo)q6CwkhyybGk6(aVfv*M6KoU>c1%CQ)6M-4Ka?_3lz zpBD`}miqo2J`?56W`4THQuxcK(ktxhHw!c-fNPH*C1J!EHGzG4ZwYR6SKZ5=vj$PT zOrNIsk3t8G2TUB@5o75)lcK5U5~3lk)^be4cd3=>QpPRmp+6vT{wuybIgR`jf^?oX6GRVqZAFQXN9Vzzrbn744;*2Bg z9 z9*B>YkIDDZ$0J|mEhFIh-i1v8!}<&pmidy!f_UsontBty-%pZ*PgL`L@k#GyMQ~!@ zH{m-2Q#Roud_vB{0w?vh({J5Q{ju6%pJKg%e9Y?z?c)a?4vd(sZX4roe{!1MPb&|; z81hE%N14wb$x-p;b-pD=Novg4$pj4HXszhg--L*=w#Q!ZJ{K9E@&i(GtukO$MLrt! zE#+6-6kn#7#M<)y%P?!<{3^C}7eeH?h+F2ODOvY-Oq}b)L>f;I>W1R;N|? zCi%S~0V`xL3sZH$5`lUU155(E=%^|DkvxeBex)_MpeVXMUnC*E*L>{|kI7q)vaF6h zy;_EaPKuuPeyD6lv3AF!qP>&3$(Ppzc=z9&mO0;f2)n=&vV<)Hc+jvGN1WMJb}ye{ zyYodYr+*2E$ZeYb2uqN!^DWB1JusRsp?4K&Q`zfWi@(VgPlB+-M;lG9Q`4bj0^4Vq zM4wM=W)}!?#vJh<`x%n1tSYm_KDQR&UWi)q=KF;I%oA_BR&MBM57WbPpsqxmG$MN}#IXTj*NyV$| zqQ}VS=U&52M2r~vQfiLqV?-p;6yGeCdL)N!t;o^m3Q9RTPEm_t`vR-=p9L&A2%z*0 zniWQQuj>{k5zc#$2>R^Zz}@8QbV3xW_@26~|KQsnMU)L3tX-IQhNf-ogmrR2D>(f*1CPJb#d*Y|9xH;-nm7Qc9vulfO&X?j;U zQv?4jO`1vpf5*TLqmTI=dCF<-r#kk#{{5l*&aUx zwT-hMZhH`-#e}FRyR&@okE&{IqP-O8FyU&^=|NEb?9$hMxU^*X9snV=8U5BCz_RpJ zB-8YV7H^sG8B5WVTp%mnZ7aKj9Sh4w=-=x#W9wfG9{CS3B-?6#{zGYk$H-0Le^2*A zr#87`R?yk5@BddsGH*_+{8*>(_gQ;|1rYg{Y-@GUDrWN=0T#=zm@+-)`)mmom+L2# zxY&c{CDn%JrE=fD!Wi2m_{49g>bzE7F!1_1IC%8dVXX9cSgLWVq$na;95X6D+I_ro zZUy5XO`FPjr_6ggAC~gh3R}qJZM+6{AI!0Q#eZgCW9(W23vV*f9XbYNIA_%j#4Co_*=*#tjwn$e=gDMc}((rn*} zVnxmWAxHas;hNJcH(i{SY?dfNd6G#pTq!Ha_^1Yb~ucExL71rEb zA9vny4zwJI+LB*5!#aG$@4gMp-l0FVKeIgQncqFuCjw_M^|G(Zv>M5?NSi8)JU0 zNgXc-O^Ny&K@SskhHB1AdWBEQbO)MAs{M6IA-yNTFVTXCa%RO(9Ouiec&#Zs*K(@X zPWw^5?oeWmEn$6A=e@*GSCVbdoEkfyg|}&TX_U3|^^<*clJMPNq&L36y8{}uR4!qu zBF#RdU&UB4`%60}Iq$FuLz&nAPf1rD5Y_X<-vxI^A0RDoASiLPf|5r!(xTK6(%q?d zv;u-ON-9z!A<`lTD4_@vqLL@5bSMo1zvuVIfAE&s-P!kMXJ$X2*(ay}VX4(49ct2) zT1}sNBtfA?Utiqh-*Whh-;p7(>kRpGg!-wrQvLwMgx1%%6f=Hbw!9K-w0LM-aP}-F zUy1GNvvq%vJ~0yeWi@&|U$xQBx-f8&S=BZb5`9+IYoBogg-U7*zxa^fJ%8*!vd(t4 z-`t2+DgWD28TMZhAOzaC55bH+$Y%|@*WpSJL<(`BG+`G^HtcB`#lBeV?sKBbfX=c* zI=l{c>%(f&Twmb#R_7D=Da-DzN7%&Xq-EjcU&}Fqf%HVH!0xLIFXNl({5BDpy_;*4 zgQgWl@`Qr|Sz!>e?dxeX*#BbV<^S zqzutZXcLOXsBO0#&SvaSK)|$Dss6>Tq;-&H0MdxA+=7w5@n>|Y>z_TUsvW$#6ny_E z%#VIDm*N8rdsD!zUOCoMC5MwWnHtXM`tMhgn8K*^-cI-csJSrf*JCltr?KrdMi|r( z<(R56PVw4_zvcLv7Qg(|_YKPu9NK#EW^b9J&VhR`Q1K z!yV6*{?{yMPN?z6PS1?bGa#CL6r}y6m#5EDix-1US^p*O`;XR?HoD~Qjc$CZZQ)uk)ovYtHr(=RG%7fD% z>%KR9)g#x*thkWsnl=D_5|1dn6k{BBS3hqXF6ST#^qe~bm-v#lHzP2i3Zbb94}VO# z<*L`kyt)1BLUHybvc;1Ed6~_@)l=>`jpJW`{tnzrCEQv}PpB`5tk`=rbFxY#WBs*z zR8tA$VEjyGud36~q-HIV%wS>>@wG3Idv~OCCi69s1S4%-6pwUcEHo96)ZV25qMPoX z-`yYQekIAt^7mX*fM>6qvSt*=cAHZuf4$g80H4fR%k`{m=<8W91apOz4m9tb!!d{5 zE(o|ke_2WPCH!R}LW;oDHr8hD;#1uR`S;u^f@C}C7w*%i4&M*60>k&`>ze8pKG{dK zLc0`6tfm|{>9$P{1fxKt!C7Rpgh~inDQir~1$eF4` z;B5V4NlioC7DlDFCsXtO53F}{a!Hp3R|C0ED1KWIuZi{>q^GW2^nG~!m6l>$DKin!IR$VYZusQ}5$Ir?Bd?%(huet~!!;esa zik)HdQPDlRmnxhAMnwhNgybMGHO1!L?`%M1N;tEbWpAtB=Uwm8q|@H`vzEwM2+n3D zgJrjuCT^BOK^9khmjBL*={8Ut2LdKeG<;d?uAk8H%E&b{rx@now$2H?85%Fk5`6^1 ztil-d=s7c{#0fve!g9dDv_lBDXSVl%tq1Kz*4l&ZY_B;@o-@8q;bzm8ELz>VIWs+k z{8ajecf1_l%4v0Q8AkZcHs}8hAWO-?3B{*q)T#cwsyvrf+=Rw>`zm-K+opiY*Ms4T z+5UusyO2qsHwgL(Vg>OXf`7u_jax}xi!yy0pgY3_Azo@O5~$+m2O%Zd%qZKg(XQSf zd)p4Jx~l%iF98*KpzeJ3Wk zlz}&lZap4nltcA4O7A$muE+p+s;kSv9&&0;QsI}6-L5P6a6ry~lm5l@L;SCG4#{gL z&Dv{5S29E?!0jv20;{$f%9um8T;CNS+lH)*wp``r0J@&%7I{@Gx(CghjQP>9C*g& z3p#L_Je~Bz4QK#0=|ctY3Jbt*$KTyo5{(f4DTqKR^V+9y@|<54LBkj0JY9o+>{za( zuS<&eu)8e^LBKzPNWG9gitRr;v)*6Y!(0$(eP8j522uX#f`?O}ue53Z=7-yly>>?) z|8}n(Ce#C08P~dTl0CN9itSSt0*HQN%RS?ABkaiPRXuta|HcbMF_rk09wd?ImsQr( zGET7?UOORn5X_Pm3U24M@b_B%>tov)xtWxEa)opuZ;-L=F>_RqX!74Q+812@N1aBD z;3m7@l%JzxG9=D*o)wF<$VC+NPzrvI?(Jrs)LE8AzfS$xfAcCBD@rPFc=xaW3uTIZK0LpR-qFLo$dMKTcA#kHW0lQRS6~w=nJ{W zkbk52t}4L~#J0>Lze{-TGP&HsilD1;rQyD^`%&0(y=Jc+D%3^CYpNV&L8MVXYfUKN zgRgYeqXfDFsPagKn;Lg3hmW@z*}X2XeKWLNw92KbFVZAG6Jh}1CsaiIs#wiF)5GSz zu%~P81~uObV!t#Cg_%5#>VK<6sFc6n#ge~?-)l+xml$mJKNF_~Ny`a4xrL6AVA2D7 znp%=OLOwiyvE3Hdb%EAhu8M+ z#sts5Rvy#Q@ffu)cx+U3=H9NP)NTUBed^Q)BR6SQ=QLW#_v@r8gQ2r~^2$t@G$u*f zMg@pZn@>Pt=C%UbTKx|DtpMIKUcaonoUo>%?<~*o-rABUw(LYw#&ay!On&N~XZF@} z!GGJKMQ`=rJF4MareCr+faudro|$d&@NvWZ{l$E6nPQg1dgP=l^WbrML{^F{vgP@?F)W<)hWBJP>&bj>7H7PJqM6XC>abJSV693oh|e?#q&M zJyO6AnXo-7)JpZ7%E|N5!Vh+xL=rv08K|RbWWQ+Ay*p5aOhJhxxsgpzpGAwIBYEnQqnF+CBVdeP|>+IA}kfLwI|ue&4H<@2W3_B%nf z#|l1a#Kzsie0`a)9y_q2fVsS&lbiGwrN|769T$we&s$sj!6p918!dbMR?YF9Nq>mT zMR@eML=g7j=@dDVE>%Nl{{hXSx})bzY#lw2qa(?Y6vd9cM3na$yI z96w$z7Y}V}Zc5&GuaBSv;QM1YFp0gEVg#HYuI|}tU*Mn+FCtb$5}g|xhLXwW%mrDP zh|%RAN(PSp$9zOQBTM+KKE*3U+2kML;xqg3kNUkIU!KGMR5{S!TTM*F4K%+oLuPKV@-2R2Up?w#rs{`BE7n*GFZ(W_U*6q8Sguw zYjop`_d1D59h*1~@@RoyiIZ%vaK6Z`)=a|}y3tQk{*i+J(iLaXl4Zvyfd}>k@H%O5 zH{bC-Rr6td&y^=-+h(C?FV=gOyb>9`=3b`K2=m>){P?(Lez2xUyzY8H#v3(PII2fm zD(UEyKBVvH-yTsCyda77aMd>4WMwjy^r?#RBakrg==M>>xnFub;iH#Dzv5Xv`+)NPDQ9qX!RQfb$rjdQ*24ybz69gj zV}|8jglQM5zGpG;X6od%Ywn9}p=*Jbb7)4fTXq{IYN}z3K(6Xhi`$3t4*j^d6b;4> z19urHbh2LH^Hfv$AaI`45#RK_QHco7Zh?EKA zZR9Y6OYi!N)Z_zB2zqEFm~nyZr~}12GMsQI5f#2Bw+bQGsw*_Z zI`EloeQBkd`%RC>_cc{3wyC%-{(Xw1xt*)KEl)D#$8_8ZG}Jac!`L_{2wcL1(&?dO zUa4HTjj2tAkS{-ikz6W11|Bj-4PCd3SB=7bVcNm7#xlevh*j2(#@3d6lv~(g-JE}| z$&s&|KLMm&lf6?kHwXRdbYSuRB=kwHneafDiT2frIl5WLON38S6jv2XtKKe2hLCW7 z(-DiF4_a@CID0G!&c-C;w)lkpzWBQ0ctSn{x$xkWZPH2fcT=NoR|xBMS&Z)^h8?IB zjW}C=Gnytgm8yFhFSd=#^RA7Or@vdeZ+F1~YJ1#);ro*VY!U4}dxT>bP7)DI&Dn8- zF}^pOfIGXE;T(1QYH>WNHT2zPZk+#D>k2~g?x~iI&|L|D!kyxr{w8R zzgkTh{5&CZ`}YrPjD4yjZN;12zLw3GkLS zY3sCG^19EtqKo!zsS1B{fORG0)7LB&Fyp0NUCBdJh`F7h@d#cpI%$@at-cI={h*kr z$rQwZ+fwQU#yydBkZjJrFWU;nLtA+rMw=bmJ=~1}VNWH;Zbxl9$ltFUnuC4#6pr*& zf_Wgf{Ak9NTz!>0oq@0`Sta=3EGCI^sK9_|Q((;YVzJDW8+gujK6POEI*f(-!7w!W zt>C?KM|Oq@-#!x}S#cl7k}M~6?(3DGjv^eWH##1`SM(Ie;c8KUtQ`cm9cndX0pjJI`Y3#{!?-=#8#yD|=N*Ua2D_(Ej}Vw81h3TK{b@ zHc6&+`K-r3@W7*Yg#YUcVd=uD=BF+v$J~uf<(MZ%rDp z7JFKWl%Q8952Tlq^RlU}Fon*UYV6lpA6tSLfM?a4+wl6 zAYJ6AQRW7MOOYzqV>((ECsqoQ12&y(+P3(*Ex7EXWHWf9#F`>buA8~&&3JvI%I0ch z5Sf$D-M7_?F0DFuM92E>G7B#zUk5g2K!y4HP$sxH45nhV`I29y5ln*K%k>Ftu*O}e zkcDnqKyYQmI=zI=J&OH8%~#TSj?ZU4%|-EjyNA2OHogcWAQ&&?E;boXL0%`V11#9K zBJ<^?f}aDksBtSfB9R$z z;(@m#hIb{g^dCAzXY<6x<&3@x(w>{fcZ#?DLb4wp>&QAI=IJnHGPEBaTLLZ{vC8Jl ztMaxq+aLBvW@p<)u8cvN)V>zn>O5`Z>c%5LW9iC*l8Fu%FLpTf%x_Gv6Bp4rhZzb{@GT6{jMTFI+wll&zq$*7kg-#Bo4%xw4ix3-&i7#`AU{BZZ&-HTh=f+w@x z4l_T=t1?`RK#BwWmvjPn;Wf&DDqex1mG_;8jk3zjb?Jm_8Hk^OHAE-gZhzp?g*;?ma! zjLlc5S-u7#bf8`IuIUO)4ZPJqPxs`bqx@I&K$`ugeIXxEv9fajXE;nxoWA$7;ARmV zurU2RS8ijfGt8f}Ut7gw22z4f6tZ7Bd`e36JvkwIo06tA~~a~t+wh^T!|MT zfN0eU3c{T0ZJ3}*I0XK2jRIy7?H4IhMo0BCj0Ug>lqXOD!fsY(yI0H=;ZIGt;#$)- z5XsCBr5$j-^09Nkb3CDr(btCsx5R>)q#(5G0AxR5K=5(wrm{HZK(IVqmse=vYUW}E zP@JC6Pl1ld2fr?asg~nD2?5o5P@o93UV)?3we=8sxWmiF#A!XL2Wsr8VNIf&0J-N) z$jfvU5eNpG`mvcC-3y|7734bEG1X&+kJk<1>rj#+KhKaOsGH!*U^p=pAf4x~fzGG) zx69O$lNVrnwjx5E6)So}6|bQ(XG5y%bR{;pmKtWvD`>PKge+|aNTijr;v~qPAm{ll zgmeO?t>xt2O*IMw6{TP?4RL26_F=AMn-JzQc$7!uz03lTn}^&0qcBL8o%0G85k~N; zua98PW)sVNUt_N0#t*|(>r&$qi6ka2@fR$Vf1N`=c@=bCgami_kz+>pFs)4 z3!^b|dYu>0{|X@RXZNiPTehtkarX*Z-KYii^il^viP#UU#ixHogDn2IC);Ycugpny zEn4cQ4}MBLYQ9(mVgcxvb<|bNAn-fLy5uVEZvfELYjW<4){<%A$}F9wmHAnXnEs1& zh(O0zhRop6bN@;(z?w!o;nKZve^4@IUrauCS~#|)OC?o-gwKdHwyXq)0h*!^`Pf&a zSJXsiNzQIzOY#LZLeXd>vW|8O-4tZY844T-mqCy8cI#blaPI|;t3NnG7xq!!+)a5E}^hT)-)1K>-+(iN<% z>D&3B%GNvz8>5P7Ou?zg-|H_Vv3XJ}D#-m5!|R#b+%T`L>Y)UbgsRP{DvBu|e`l zfzbx==1JA+^Oeq{*)Cn-o|XH-sRr9x0DHj)xR2<*KUADsj@V6-V=4~AOrDHyPA6rx5d=;-f~ZVQ(2MWDr?J2 z(4>pTbZcVx0`B!gEZ-+=OF#>Zyx}s&pBb0|GpPn}ZJ*<-T>=~lU?~R>gMKrig{jEs z^GAt7vd8qjMf_>y@%{eu@1|7+6tf{6V3CqKac9`UHBDN!_v@rZvmj~nj#j&qs?v0@ zu+3oHHFeLmJ0@7-d{)(w@yGi{<~}z*zmP1e^N@HmIVO3rAVvho7AS=w;?#cy0}?D+ zhpYwu@^yJrkmQY^yTX;F)r_LqhDes4Uwc7jK^{R0$jT~+dB+%}`&RBqC_{3>nCti4(Qk;NRh>1dUzP8VY4Xu;Cp@uE2>U)t z6bbDA7;y%rsrv!Gm~6fo7>U`E?4t&3jgEjC0Xd?z_P;4QDOkEqOb@ua|ISRS3&iOh zoaP|Gf<8zMr{?69PW=^LB+v&8L$!eKL#Fl2LoQ}PoaRx2dRAFxQfUHTA;}bm?_SB= zL2enCN4_#}w8eE(gxZs~1<`EDHD zY5{8S=c&Abxr^6!n+A~w7U59nQKH|+_?D}-Dm7%ZNLQHMbDqUL0zld$@SSQ(7Un$5 zEpHUM;p$GzWHhYPTmt?c-Txl zoW5%XB_?8_=Mx1;_d~#dUvy)n>d5JNlSrkLL{cJ6kBKf1EtUu&DH9ycc28?oKT6x` zt7pH1G6y4^1t77e^O2fanR@C@s5<8CYWHnKxnjz@9P8q$P1(xTAbl^C0f9vP1i6eP zJT=>`4BmX2u8VlOLj{2KLy}1L3^x%|yrH;Ulr=oRLWp1XKS>7qirY~ums}-g@9Po9 z%!4A|@7AWZ1W!PSda3Qo2suB`_h#hOT&kr!nr34i0hp}`01WDFq$vP+P5F*N3@=|# zJ^h^!efkq6UtZtzsyCAj@gf5n>P|{npTkqOc4O=qam124gZ-Pl#t)5j1!ZXhPCdKZ z4A*X-$DsBb*fKTe%GfM0GZ`SIUj%$Bs%CQ{B2Kgg`1$l4g$ZnE&@Z_WK10$CS}eY32`+Z0{3tZ;XNqSdX-MQ3`I< zVo}51xhcDjxwK^ALF%Qh!e%>le`AK5i~&r4Au{&*U4cV=l`D6TXG?VDvTwdDJ~^_` z5xAZ95<*J8lLbM&PVAoty$E`&)aOmKp~>gP`>Qtv3KI3Myp+z)Sh;LoVC0(v+5jVl zhu?HO0VO&xzOR4$nA5e{L>RLL^1B=n11EK;&+nUGr-LuLugL@#4*Lua73X`2E))Ah zAU`z#FOw`!TC)oA(#yajAY zVF;w8#K9N=EqS&N26h7c&%p*%IYcVJ7I6+8N(p?&B)@p?(y!3Q3{m?}tgX~12 z?Dhe>7c2JGx5Xbrq8IG`d-muugm3}DXR|^;K*b@L^U=3Eb_l+n;@bh>cm$+#t^x-# z+0?E#_qPcYfOrh_pGK@nHT;Ki#j!QFz(IqrR@c9-nbDzc>D@s_uV3kc3Q-0L9>h%} zYM|LshVYnr)pAHm@V_~gh;Od5VW!Q@I>A=y{$Pb4Eqk|dd-O0@37&)j83u?;Q-HJDiTtgnbj#dFu-ft8lM<;0C?O}03iTQ;exgmz*jSvZr^&m) zI#K_x_u5f7@WAXdC)jV%?J{uQU6`v-%h?lah$?6({VRcD3ukxC)_lMD8whxb?8r&v zC0|B}Pz0zEsk&$PWbkEhK%5y3X9T+aNV*$~2?QqM2N4{&5=0?p;BpRlZp#nEIuf&H zhUsCKjQ*3#2CiLJA0ESuzRZ9`S=kfnvX2jq!P{!2%nNMI=KjsL*93xdF@dOX^6^0< z*^|Vqr%wK|ZAp_us^nf&yfFv$ea{T|RA7etM1&K3&(%FRKJ+7>6aLq4cj-MOo&xaF zrhwbr2l;&L50w}0ghSahC{S5uqq1P%=4q}-P`0KY!B?TK@YwA<0>xUnq7@fZ4ce)C zGa#+j440OX*pI@}*)#2rg_52A6FkkowImO|JN_9|D1R0tst@|OwWttgh#WHiOrNxJ z1JsujD7~*@Wj8L!GY#xtkr8YK6a^?N(&r=c%d0Z}--@3SAcx{9_5-pI7hNg|#eMU@ zcl_WKicCRfH6s}52+)GA->EJIJc^Ow8+yTPkFdqJ6+n(OFEF$01GS?LDn}BWK#_*} z1d{FoB=$=kSGPE*bSLL5D&T$=6^e?H;U*I-)(5HzMY&Y1AT{=0r0X6D&`O=nLh`L4 zxU*7dbhL)L62*B#D2j>DK(wn^Y5%WLxBxSdsV9sPya(DROW$N<>=&XPq`Y!P{=dh6 z(y4&=Ld@t)eRZcRWDL2Tge7s3ZjzR(j)EUXfuEN*ICOtK3b+6>!%gM@`CY=6m@nPl zcW_z*gf!>1yP$L}P{qMsMtpxCRP%$vDdv?zRGQ^(Gmtn7@ZTihgEPS^0Pk$u3R@3{f{jzCa>icOlmy&u31Kll3w< zMBw-q)({*!%oQW-rmTKxkx0LEt2C1oV(t>c> z8>nsrl9D>Q@RAsN)WZNT6B{aAyC7WD-Z=pxiw@!70{+r^@`29^!Dn1lIC&wssH1ZN zR2JF{MUK*T-wHXyE>7|nsRF$O=}}9FD`i~qv%xj=y#I(O$ZQZJYv8lmeLl3xu%DNf zcF5qTD1LV?I$OFy<1OoZ(-?`hjiO)Hk9V%?07{r(lqqmalNSvPdfp|6&qrw@nN&jK zuBv@a5AYh5ry}TU@uulesaPVgPdH;4Lhi~gPCA`ZLD(pU^c^X1Kpajt_uC!P6%rL0 zMIz=9jYIBU0$c2z1M+C&aL!K7$Ivf~J_?HI-ss-xll6R$41X%ZV4NzZ!35RqPp-Jk zjkIVx{^bc4mDPpTWrfP7K`~<{C?~@~PjRv^9)49WrH{xPa#v)k`&JE_z<}4`5CNn_ zsEC6}dFzzcv^223(%*2uoDq-KiO(`rgq>(r3^gcPnEdr}A*N6*^vajEM~09zTN702 zB@?vRr6KeKy#>m7v8TU1sXZ{#?dL4DWC0$=O@s;HWP1*}EF?VzYl*(9c2z0mQX<#b zE589~DKJfupQQ;3k5$D)8Kb(?mxy_t69lAOsfaXYyeLP~fLrw?+e2j_1nN>g zqD4{^1V&w`h)%{Y8Qxovm2L%-AM*mkEytap^cSFX3xWNf5V5$+N4N?=+guQCLK%ml z8S9Xl?T0;uV$7eSwSVdd6#r#w;S8OaIU8uIqc8!$bRM*_I*@Elo&Q+Vj!`A_rJ;)U zSsxean%g+#V<;x882qoiZzl8CVv|OfMCO^Pv*@Csm>{q_uTo4hgtdI+3rUk~95R>Z zVPh%;n8;EQ#|^2v1$}imqF|l?cfh`~bd4S)?G~uwCKGfvQwS%-6FDJG#^`U`^j>=V zOoRgGuELu(DcwMwsF)?Ma=_BU6FNO}wzM#34wN#SgSyd3%hR_MggSg9@FYsdBE#9? z6u3v4ylK6X4e!*^Vvhc3?!f&y)~!~(dw_K=xDuDaWlp*6Tn-aiMts*IGvGVg&twvY z^Ee1Y+ceifEyAgYmkaX>G}m$`D7&wddPsHvZ3c^Rjor4*FKl{Ttzg|2HHk zarr_indexing.transform': api/transform.md + - ' zarr_indexing.domain': api/domain.md + - ' zarr_indexing.output_map': api/output_map.md + - ' zarr_indexing.composition': api/composition.md + - ' zarr_indexing.chunk_resolution': api/chunk_resolution.md + - ' zarr_indexing.grid': api/grid.md + - ' zarr_indexing.json': api/json.md + - ' zarr_indexing.messages': api/messages.md + - ' zarr_indexing.errors': api/errors.md + - Changelog: https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/CHANGELOG.md + +watch: + - src + +theme: + language: en + name: material + logo: _static/logo_bw.png + favicon: _static/favicon-96x96.png + + palette: + # Light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to light mode + + font: + text: Roboto + code: Roboto Mono + + features: + - content.code.annotate + - content.code.copy + - navigation.indexes + - navigation.instant + - navigation.tracking + - search.suggest + - search.share + +plugins: + - autorefs + - search + - mkdocstrings: + enable_inventory: true + handlers: + python: + paths: [src] + options: + allow_inspection: true + docstring_section_style: list + docstring_style: numpy + inherited_members: true + line_length: 60 + separate_signature: true + show_root_heading: true + show_signature_annotations: true + show_source: true + show_symbol_type_toc: true + signature_crossrefs: true + show_if_no_docstring: true + extensions: + - griffe_inherited_docstrings + + inventories: + - https://docs.python.org/3/objects.inv + - https://numpy.org/doc/stable/objects.inv + - https://zarr.readthedocs.io/en/stable/objects.inv + +markdown_extensions: + - admonition + - attr_list + - def_list + - footnotes + - md_in_html + - pymdownx.details + - pymdownx.superfences + - toc: + permalink: true + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite diff --git a/packages/zarr-indexing/pyproject.toml b/packages/zarr-indexing/pyproject.toml new file mode 100644 index 0000000000..21ba4ef7e7 --- /dev/null +++ b/packages/zarr-indexing/pyproject.toml @@ -0,0 +1,124 @@ +[build-system] +requires = ["hatchling>=1.29.0", "hatch-vcs"] +build-backend = "hatchling.build" + +[project] +name = "zarr-indexing" +dynamic = ["version"] +description = "Composable, lazy coordinate transforms for Zarr array indexing." +readme = "README.md" +requires-python = ">=3.12" +license = "MIT" +license-files = ["LICENSE.txt"] +authors = [ + { name = "Davis Bennett", email = "davis.v.bennett@gmail.com" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Topic :: Scientific/Engineering", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed", +] +keywords = ["zarr"] +dependencies = [ + "numpy>=2", +] + +[project.urls] +Homepage = "https://github.com/zarr-developers/zarr-python" +Source = "https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-indexing" +Issues = "https://github.com/zarr-developers/zarr-python/issues" +Changelog = "https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/CHANGELOG.md" +Documentation = "https://zarr-indexing.readthedocs.io/" + +[dependency-groups] +# The transform tests exercise chunk resolution against zarr's ChunkGrid +# (tests/test_chunk_resolution.py) and are collected by the parent zarr-python +# test suite, which already has zarr installed. `zarr` is intentionally NOT +# listed here to avoid a workspace dependency cycle; run these tests from the +# repo root (`uv run pytest packages/zarr-indexing/tests`), not in isolation. +test = ["pytest"] +docs = [ + # Pins match the zarr-python docs environment in the repo-root + # pyproject.toml so the two sites render with the same toolchain. + "mkdocs-material==9.7.6", + "mkdocs==1.6.1", + "mkdocstrings==1.0.4", + "mkdocstrings-python==2.0.5", + "griffe-inherited-docstrings==1.1.3", + # mkdocstrings uses ruff to format rendered signatures + "ruff==0.15.20", +] + +[tool.hatch.version] +source = "vcs" +tag-pattern = '^zarr_indexing-v(?P.+)$' +# `git_describe_command` ensures we get the zarr_indexing tags instead of latest. +# `local_scheme` strips the git commit info so the appending info is just a counter from latest tag. +# test-pypi doesn't accept git commit info in tags, and the count should be enough to distinguish unique runs. +raw-options = { root = "../..", git_describe_command = "git describe --dirty --tags --long --match zarr_indexing-v*", local_scheme = "no-local-version" } + +[tool.hatch.build.targets.wheel] +packages = ["src/zarr_indexing"] + +[tool.ruff] +extend = "../../pyproject.toml" +target-version = "py312" + +[tool.pytest.ini_options] +minversion = "7" +testpaths = ["tests"] +xfail_strict = true +addopts = ["-ra", "--strict-config", "--strict-markers"] +filterwarnings = [ + "error", +] + +[tool.pyright] +include = ["src"] +enableExperimentalFeatures = true +typeCheckingMode = "strict" +pythonVersion = "3.12" +# This strict config was written for zarr-metadata's JSON/dataclass-shaped +# code. zarr-indexing is numpy-heavy, and numpy's stubs return partially +# unknown types (e.g. `ndarray[Unknown, Unknown]`, `dtype[Unknown]`) even for +# fully-typed call sites, so the reportUnknown* family below cannot reasonably +# be satisfied here. Downgraded to warnings (not silenced) rather than +# disabled outright, and CI (which only fails the pyright job on errors, not +# warnings) still surfaces them for visibility. +reportUnknownVariableType = "warning" +reportUnknownArgumentType = "warning" +reportUnknownMemberType = "warning" +reportUnknownParameterType = "warning" + +[tool.numpydoc_validation] +checks = [ + "GL10", + "SS04", + "PR02", + "PR03", + "PR05", + "PR06", +] + +[tool.towncrier] +# Fragments for this package live alongside the package source, separate +# from the parent zarr-python `changes/` directory, so a PR touching only +# `packages/zarr-indexing/` produces a release note for this package only. +directory = "changes" +filename = "CHANGELOG.md" +package = "zarr_indexing" +underlines = ["", "", ""] +title_format = "## {version} ({project_date})" +issue_format = "[#{issue}](https://github.com/zarr-developers/zarr-python/issues/{issue})" +start_string = "\n" diff --git a/packages/zarr-indexing/src/zarr_indexing/__init__.py b/packages/zarr-indexing/src/zarr_indexing/__init__.py new file mode 100644 index 0000000000..effe38ca88 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/__init__.py @@ -0,0 +1,74 @@ +"""Composable, lazy coordinate transforms for zarr array indexing. + +This package implements TensorStore-inspired index transforms. The core idea: +every indexing operation (slicing, fancy indexing, etc.) produces a coordinate +mapping from user space to storage space. These mappings compose lazily — no +I/O until you explicitly read or write. + +Key types: + +- `IndexDomain` — a rectangular region of integer coordinates +- `IndexTransform` — maps input coordinates to storage coordinates +- `ConstantMap`, `DimensionMap`, `ArrayMap` — the three ways a single + output dimension can depend on the input (see `output_map.py`) +- `compose` — chain two transforms into one + +The chunk-resolution helpers (`iter_chunk_transforms`, +`sub_transform_to_selections`) and `selection_to_transform` are also exported +here: they form the surface the zarr integration layer (array indexing) depends +on. The `*Like` grid Protocols describe the chunk-grid surface chunk resolution +consumes without importing zarr. +""" + +from importlib.metadata import version + +from zarr_indexing.chunk_resolution import ( + iter_chunk_transforms, + sub_transform_to_selections, +) +from zarr_indexing.composition import compose +from zarr_indexing.domain import IndexDomain +from zarr_indexing.grid import DimensionGridLike +from zarr_indexing.json import ( + IndexDomainJSON, + IndexTransformJSON, + OutputIndexMapJSON, + index_domain_from_json, + index_domain_to_json, + index_transform_from_json, + index_transform_to_json, + transform_from_canonical, + transform_to_canonical, +) +from zarr_indexing.messages import NdselError, normalize_ndsel, parse_ndsel +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap, OutputIndexMap +from zarr_indexing.transform import IndexTransform, selection_to_transform + +__version__ = version("zarr-indexing") + +__all__ = [ + "ArrayMap", + "ConstantMap", + "DimensionGridLike", + "DimensionMap", + "IndexDomain", + "IndexDomainJSON", + "IndexTransform", + "IndexTransformJSON", + "NdselError", + "OutputIndexMap", + "OutputIndexMapJSON", + "__version__", + "compose", + "index_domain_from_json", + "index_domain_to_json", + "index_transform_from_json", + "index_transform_to_json", + "iter_chunk_transforms", + "normalize_ndsel", + "parse_ndsel", + "selection_to_transform", + "sub_transform_to_selections", + "transform_from_canonical", + "transform_to_canonical", +] diff --git a/packages/zarr-indexing/src/zarr_indexing/chunk_resolution.py b/packages/zarr-indexing/src/zarr_indexing/chunk_resolution.py new file mode 100644 index 0000000000..7aea86ad02 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/chunk_resolution.py @@ -0,0 +1,380 @@ +"""Chunk resolution — mapping transforms to chunk-level I/O. + +Given an `IndexTransform` (which coordinates a user wants to access) and a +`ChunkGrid` (how storage is divided into chunks), chunk resolution answers: + + For each chunk, which storage coordinates does this transform touch, + and where do those values land in the output buffer? + +The algorithm is: + +1. **Enumerate candidate chunks** — determine which chunks could possibly + be touched by the transform's output coordinate ranges. + +2. **Intersect** — for each candidate chunk, call + `transform.intersect(chunk_domain)` to restrict the transform to + coordinates within that chunk. If the intersection is empty, skip it. + +3. **Translate** — shift the restricted transform to chunk-local coordinates + via `transform.translate(-chunk_origin)`. + +4. **Yield** — produce `(chunk_coords, local_transform, surviving_indices)` + triples that the codec pipeline consumes. + +Sorted one-dimensional correlated array maps can be partitioned directly +because every touched chunk owns a contiguous slice of the index array. That +case bypasses candidate enumeration and repeated intersection. + +`sub_transform_to_selections` bridges from the transform representation +back to the raw `(chunk_selection, out_selection, drop_axes)` tuples that +the current codec pipeline expects. This bridge will go away when the codec +pipeline accepts transforms natively. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +import numpy as np + +from zarr_indexing.domain import IndexDomain +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap +from zarr_indexing.transform import IndexTransform + +if TYPE_CHECKING: + from collections.abc import Iterator, Sequence + + from zarr_indexing.grid import DimensionGridLike + +OutIndices = ( + dict[int, np.ndarray[Any, np.dtype[np.intp]]] | np.ndarray[Any, np.dtype[np.intp]] | None +) + +ChunkTransformResult = tuple[ + tuple[int, ...], + IndexTransform, + OutIndices, +] + + +def _one_dimensional_correlated_array_map( + transform: IndexTransform, +) -> tuple[ArrayMap, np.ndarray[Any, np.dtype[np.intp]]] | None: + """Return a nonempty correlated 1-D ArrayMap and its storage coordinates. + + A one-dimensional array selection has no cross-dimensional correlation to + preserve. The computed storage coordinates are also reused by general + resolution when they are unsorted. + """ + if transform.input_rank != 1 or transform.output_rank != 1: + return None + + m = transform.output[0] + if ( + not isinstance(m, ArrayMap) + or m.input_dimension is not None + or m.index_array.ndim != 1 + or m.index_array.size == 0 + ): + return None + + return m, m.offset + m.stride * m.index_array + + +def _iter_sorted_1d_array_map( + m: ArrayMap, + storage: np.ndarray[Any, np.dtype[np.intp]], + dim_grid: DimensionGridLike, +) -> Iterator[ChunkTransformResult]: + """Resolve a sorted 1-D ArrayMap one touched chunk at a time.""" + start = 0 + while start < storage.size: + chunk = dim_grid.index_to_chunk(int(storage[start])) + chunk_start = dim_grid.chunk_offset(chunk) + chunk_stop = chunk_start + dim_grid.chunk_size(chunk) + stop = int(np.searchsorted(storage, chunk_stop, side="left")) + + restricted = IndexTransform( + domain=IndexDomain(inclusive_min=(0,), exclusive_max=(stop - start,)), + output=( + ArrayMap( + index_array=m.index_array[start:stop], + offset=m.offset, + stride=m.stride, + input_dimension=m.input_dimension, + ), + ), + ) + local = restricted.translate((-chunk_start,)) + surviving = np.arange(start, stop, dtype=np.intp) + + yield (chunk,), local, surviving + start = stop + + +def iter_chunk_transforms( + transform: IndexTransform, + dim_grids: Sequence[DimensionGridLike], +) -> Iterator[ChunkTransformResult]: + """Resolve a composed IndexTransform against per-dimension chunk grids. + + `dim_grids` holds one `DimensionGridLike` per output (storage) dimension — + for zarr this is the chunk grid's per-dimension sequence. Yields + `(chunk_coords, sub_transform, out_indices)` triples: + + - `chunk_coords`: which chunk to access. + - `sub_transform`: maps output buffer coords to chunk-local coords. + - `out_indices`: for vectorized/array indexing, the output scatter + indices (integer array). `None` for basic/slice indexing. + """ + + array_map_1d = _one_dimensional_correlated_array_map(transform) + if array_map_1d is not None: + sorted_map, storage = array_map_1d + if storage[0] <= storage[-1] and bool(np.all(storage[1:] >= storage[:-1])): + dim_grid = dim_grids[0] + first_chunk = dim_grid.index_to_chunk(int(storage[0])) + if dim_grid.chunk_size(first_chunk) > 0: + yield from _iter_sorted_1d_array_map(sorted_map, storage, dim_grid) + return + + # Enumerate candidate chunks via the cartesian product of per-slot candidate + # chunk ids, then for each candidate intersect the transform with the chunk + # domain (`transform.intersect` handles orthogonal and vectorized cases + # alike, filtering out combinations it does not actually touch). + # + # A slot covers one or more output dimensions and contributes exactly the + # chunk-coordinate tuples those dimensions can touch: + # + # - `ConstantMap`/`DimensionMap` dims each form their own slot with a + # contiguous range — a single chunk for a constant, and the span between + # the first and last chunk for a slice. These are already tight (or + # nearly so). + # - Orthogonal `ArrayMap` (fancy) dims each form their own slot with only + # the *distinct* chunk ids the index array actually lands in + # (`np.unique`), never the dense `range(min_chunk, max_chunk + 1)` + # between them. A sparse fancy selection (e.g. two far-apart coordinates) + # would otherwise enumerate every chunk in the bounding box, making + # resolution scale with grid size instead of with the number of selected + # coordinates. + # - Correlated (vindex) `ArrayMap` dims share one *joint* slot holding the + # distinct chunk-coordinate tuples the points actually land in. The + # cartesian product of their per-dimension distinct sets would include + # combinations no point touches — quadratic in the number of selected + # points for a diagonal selection — while the joint distinct set is + # bounded by the point count (see zarr-python gh-4174). + correlated_dims: list[int] = [] + correlated_chunk_ids: list[np.ndarray[Any, np.dtype[np.intp]]] = [] + slot_dims: list[tuple[int, ...]] = [] + slot_candidates: list[Sequence[tuple[int, ...]]] = [] + for out_dim, m in enumerate(transform.output): + dg = dim_grids[out_dim] + if isinstance(m, ConstantMap): + # Single chunk + c = dg.index_to_chunk(m.offset) + slot_dims.append((out_dim,)) + slot_candidates.append(((c,),)) + elif isinstance(m, DimensionMap): + d = m.input_dimension + dim_lo = transform.domain.inclusive_min[d] + dim_hi = transform.domain.exclusive_max[d] + if dim_lo >= dim_hi: + return # empty domain + if m.stride > 0: + s_min = m.offset + m.stride * dim_lo + s_max = m.offset + m.stride * (dim_hi - 1) + else: + s_min = m.offset + m.stride * (dim_hi - 1) + s_max = m.offset + m.stride * dim_lo + first = dg.index_to_chunk(s_min) + last = dg.index_to_chunk(s_max) + slot_dims.append((out_dim,)) + slot_candidates.append([(c,) for c in range(first, last + 1)]) + else: + # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap). + # Storage coordinates were already computed for a correlated 1-D map. + storage = ( + array_map_1d[1] if array_map_1d is not None else m.offset + m.stride * m.index_array + ) + if storage.size == 0: + # Empty fancy selection: no coordinates, so no chunks are touched. + return + # Keep the index-array shape: correlated maps broadcast against each + # other below, and raveling first would lose the singleton axes. + chunk_ids = dg.indices_to_chunks(storage.astype(np.intp)) + if m.input_dimension is None: + correlated_dims.append(out_dim) + correlated_chunk_ids.append(chunk_ids) + else: + slot_dims.append((out_dim,)) + slot_candidates.append([(int(c),) for c in np.unique(chunk_ids)]) + + if len(correlated_dims) == 1: + slot_dims.append((correlated_dims[0],)) + slot_candidates.append([(int(c),) for c in np.unique(correlated_chunk_ids[0])]) + elif len(correlated_dims) >= 2: + # Group the points jointly: distinct rows of the per-point chunk + # coordinates, O(points log points) regardless of grid size. + broadcast = np.broadcast_arrays(*correlated_chunk_ids) + stacked = np.stack([b.ravel() for b in broadcast], axis=1) + joint = np.unique(stacked, axis=0) + slot_dims.append(tuple(correlated_dims)) + slot_candidates.append([tuple(int(c) for c in row) for row in joint]) + + import itertools + + output_rank = len(transform.output) + for combo in itertools.product(*slot_candidates): + chunk_coords_list = [0] * output_rank + for dims, part in zip(slot_dims, combo, strict=True): + for d, c in zip(dims, part, strict=True): + chunk_coords_list[d] = c + chunk_coords = tuple(chunk_coords_list) + + # Build the chunk domain in storage space + chunk_min: list[int] = [] + chunk_max: list[int] = [] + chunk_shift: list[int] = [] + for out_dim, c in enumerate(chunk_coords): + dg = dim_grids[out_dim] + c_start = dg.chunk_offset(c) + c_size = dg.chunk_size(c) + chunk_min.append(c_start) + chunk_max.append(c_start + c_size) + chunk_shift.append(-c_start) + + chunk_domain = IndexDomain( + inclusive_min=tuple(chunk_min), + exclusive_max=tuple(chunk_max), + ) + + # Intersect transform with chunk domain + result = transform.intersect(chunk_domain) + if result is None: + continue + + restricted, surviving = result + + # Translate to chunk-local coordinates + local = restricted.translate(tuple(chunk_shift)) + + yield (chunk_coords, local, surviving) + + +def sub_transform_to_selections( + sub_transform: IndexTransform, + out_indices: OutIndices = None, +) -> tuple[ + tuple[int | slice | np.ndarray[tuple[int, ...], np.dtype[np.intp]], ...], + tuple[slice | np.ndarray[tuple[int, ...], np.dtype[np.intp]], ...], + tuple[int, ...], +]: + """Convert a chunk-local sub-transform to raw selections for the codec pipeline. + + Parameters + ---------- + sub_transform + A chunk-local IndexTransform (output maps already translated to + chunk-local coordinates). + out_indices + For vectorized indexing: the output scatter indices for this chunk. + None for orthogonal/basic indexing. + + Returns + ------- + tuple + `(chunk_selection, out_selection, drop_axes)` + """ + inclusive_min = sub_transform.domain.inclusive_min + exclusive_max = sub_transform.domain.exclusive_max + + # Orthogonal outer product: >= 2 ArrayMaps each bound to a distinct input + # dimension. out_indices is a per-output-dim dict of surviving positions. The + # codec applies chunk_array[chunk_sel] / out[out_sel] with NumPy semantics, so + # build np.ix_-style selections (mirroring the legacy OrthogonalIndexer): one + # 1-D selector per dimension, expanded to an open mesh. ConstantMap dims are + # size-1 in chunk space and squeezed out via drop_axes. + if isinstance(out_indices, dict): + chunk_arrays: list[np.ndarray[Any, np.dtype[np.intp]]] = [] + out_arrays: list[np.ndarray[Any, np.dtype[np.intp]]] = [] + drop_axes: list[int] = [] + for out_dim, m in enumerate(sub_transform.output): + if isinstance(m, ConstantMap): + chunk_arrays.append(np.array([m.offset], dtype=np.intp)) + drop_axes.append(out_dim) + elif isinstance(m, DimensionMap): + rng = np.arange(inclusive_min[m.input_dimension], exclusive_max[m.input_dimension]) + chunk_arrays.append((m.offset + m.stride * rng).astype(np.intp)) + out_arrays.append(rng.astype(np.intp)) + else: # ArrayMap + idx = m.index_array.ravel() + chunk_arrays.append((m.offset + m.stride * idx).astype(np.intp)) + out_arrays.append(out_indices[out_dim]) + return np.ix_(*chunk_arrays), np.ix_(*out_arrays), tuple(drop_axes) + + # Correlated (vindex) sub-transforms carry ArrayMaps with `input_dimension` + # None. They scatter through a single flat index (`out_indices`) into the + # row-major-flattened output buffer; the chunk selection reads a + # (points, residual-slice) block via the raveled coordinate arrays and any + # residual DimensionMap slices. + correlated = any( + isinstance(m, ArrayMap) and m.input_dimension is None for m in sub_transform.output + ) + if correlated: + chunk_sel: list[int | slice | np.ndarray[tuple[int, ...], np.dtype[np.intp]]] = [] + for m in sub_transform.output: + if isinstance(m, ConstantMap): + chunk_sel.append(m.offset) + elif isinstance(m, DimensionMap): + d = m.input_dimension + start = m.offset + m.stride * inclusive_min[d] + stop = m.offset + m.stride * exclusive_max[d] + if m.stride < 0: + start, stop = stop + 1, start + 1 + chunk_sel.append(slice(start, stop, m.stride)) + else: # ArrayMap + idx = m.index_array.reshape(-1) + chunk_sel.append((m.offset + m.stride * idx).astype(np.intp)) + # Chunk resolution always supplies the flat scatter index for a + # correlated transform. Absent one (a bare sub-transform), fall back to an + # identity scatter over the whole flattened output buffer. + # `out_indices` is narrowed to a flat scatter array or None here (the + # per-dimension dict is an orthogonal outer product, handled above). + out_scatter: slice | np.ndarray[Any, np.dtype[np.intp]] + if out_indices is None: + n = 1 + for s in sub_transform.domain.shape: + n *= s + out_scatter = slice(0, n) + else: + out_scatter = out_indices + return tuple(chunk_sel), (out_scatter,), () + + chunk_sel = [] # annotated in the correlated branch above (same function scope) + out_sel: list[slice | np.ndarray[tuple[int, ...], np.dtype[np.intp]]] = [] + + # Single-pass build for the basic / single-orthogonal-array cases. + # ConstantMap dims are dropped (no out_sel entry). + for m in sub_transform.output: + if isinstance(m, ConstantMap): + chunk_sel.append(m.offset) + elif isinstance(m, DimensionMap): + d = m.input_dimension + dim_lo = inclusive_min[d] + dim_hi = exclusive_max[d] + start = m.offset + m.stride * dim_lo + stop = m.offset + m.stride * dim_hi + if m.stride < 0: + start, stop = stop + 1, start + 1 + chunk_sel.append(slice(start, stop, m.stride)) + out_sel.append(slice(dim_lo, dim_hi)) + else: # ArrayMap (orthogonal: full-rank, raveled to its 1-D fancy coords) + idx = m.index_array.reshape(-1) + if m.offset == 0 and m.stride == 1: + chunk_sel.append(idx) + else: + chunk_sel.append((m.offset + m.stride * idx).astype(np.intp)) + # Orthogonal ArrayMap: out_indices holds the surviving positions. + out_sel.append(out_indices if out_indices is not None else slice(0, idx.size)) + + return tuple(chunk_sel), tuple(out_sel), () diff --git a/packages/zarr-indexing/src/zarr_indexing/composition.py b/packages/zarr-indexing/src/zarr_indexing/composition.py new file mode 100644 index 0000000000..f5cc82599c --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/composition.py @@ -0,0 +1,133 @@ +"""Composition — chaining two transforms into one. + +`compose(outer, inner)` is the operation that makes views stack. `outer` maps +user coordinates to intermediate coordinates, `inner` maps those intermediate +coordinates to storage, and the result maps user coordinates straight to +storage — so a view of a view of an array is still a single +`IndexTransform`, and indexing never accumulates layers to walk at read time. + +Composition works one output map at a time, and each case reduces to +substituting the outer map into the inner one: + +- A `ConstantMap` inner map ignores its input, so it survives unchanged. +- A `DimensionMap` inner map is affine, so composing it with an outer + `ConstantMap` or `DimensionMap` folds into new `offset`/`stride` values; + composing it with an outer `ArrayMap` leaves the index array alone and + rescales around it. +- An `ArrayMap` inner map must be *evaluated* at the coordinates the outer + transform produces, which is the only case that touches array data. +""" + +from __future__ import annotations + +import numpy as np + +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap, OutputIndexMap +from zarr_indexing.transform import IndexTransform + + +def compose(outer: IndexTransform, inner: IndexTransform) -> IndexTransform: + """Compose two IndexTransforms. + + `outer` maps user coords (rank m) to intermediate coords (rank n). + `inner` maps intermediate coords (rank n) to storage coords (rank p). + The result maps user coords (rank m) to storage coords (rank p). + + Precondition: `outer.output_rank == inner.domain.ndim`. + """ + if outer.output_rank != inner.domain.ndim: + raise ValueError( + f"outer output rank ({outer.output_rank}) must match inner input rank " + f"({inner.domain.ndim})" + ) + + result_output = [_compose_single(outer, inner_map) for inner_map in inner.output] + + return IndexTransform(domain=outer.domain, output=tuple(result_output)) + + +def _compose_single(outer: IndexTransform, inner_map: OutputIndexMap) -> OutputIndexMap: + """Compose a single inner output map with the full outer transform.""" + if isinstance(inner_map, ConstantMap): + return ConstantMap(offset=inner_map.offset) + + if isinstance(inner_map, DimensionMap): + return _compose_dimension(outer, inner_map) + + # inner_map: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + return _compose_array(outer, inner_map) + + +def _compose_dimension(outer: IndexTransform, inner_map: DimensionMap) -> OutputIndexMap: + """Compose when inner is a DimensionMap. + + storage = offset_i + stride_i * intermediate[dim_i] + where intermediate[dim_i] = outer.output[dim_i](user_input) + """ + dim_i = inner_map.input_dimension + offset_i = inner_map.offset + stride_i = inner_map.stride + outer_map = outer.output[dim_i] + + if isinstance(outer_map, ConstantMap): + return ConstantMap(offset=offset_i + stride_i * outer_map.offset) + + if isinstance(outer_map, DimensionMap): + return DimensionMap( + input_dimension=outer_map.input_dimension, + offset=offset_i + stride_i * outer_map.offset, + stride=stride_i * outer_map.stride, + ) + + # outer_map: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + # Affine post-composition leaves the index array (and hence its full + # input rank and dependency axes) untouched; carry the orthogonal + # binding through unchanged. + return ArrayMap( + index_array=outer_map.index_array, + offset=offset_i + stride_i * outer_map.offset, + stride=stride_i * outer_map.stride, + input_dimension=outer_map.input_dimension, + ) + + +def _compose_array(outer: IndexTransform, inner_map: ArrayMap) -> OutputIndexMap: + """Compose when inner is an ArrayMap. + + storage = offset_i + stride_i * arr_i[intermediate] + We need to evaluate arr_i at the intermediate coordinates produced by outer. + """ + arr_i = inner_map.index_array + offset_i = inner_map.offset + stride_i = inner_map.stride + + # Check if all outer outputs are constant + all_constant = all(isinstance(m, ConstantMap) for m in outer.output) + + if all_constant: + # Evaluate arr_i at the single constant point + idx = tuple(m.offset for m in outer.output if isinstance(m, ConstantMap)) + value = int(arr_i[idx]) + return ConstantMap(offset=offset_i + stride_i * value) + + # For 1D inner array with a single outer output (simple case) + if arr_i.ndim == 1 and len(outer.output) == 1: + outer_map = outer.output[0] + + if isinstance(outer_map, DimensionMap): + dim_size = outer.domain.shape[outer_map.input_dimension] + user_indices = np.arange(dim_size, dtype=np.intp) + intermediate_vals = outer_map.offset + outer_map.stride * user_indices + new_arr = arr_i[intermediate_vals] + return ArrayMap(index_array=new_arr, offset=offset_i, stride=stride_i) + + if isinstance(outer_map, ArrayMap): + intermediate_vals = outer_map.offset + outer_map.stride * outer_map.index_array + new_arr = arr_i[intermediate_vals] + return ArrayMap(index_array=new_arr, offset=offset_i, stride=stride_i) + + # General multi-dim case: not yet implemented + raise NotImplementedError( + "Composing a multi-dimensional inner array map with non-constant outer maps " + "is not yet supported." + ) diff --git a/packages/zarr-indexing/src/zarr_indexing/domain.py b/packages/zarr-indexing/src/zarr_indexing/domain.py new file mode 100644 index 0000000000..f20d5bf7bd --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/domain.py @@ -0,0 +1,189 @@ +"""Index domains — rectangular regions in N-dimensional integer space. + +An `IndexDomain` represents the set of valid coordinates for an array or +array view. It is the cartesian product of per-dimension integer ranges:: + + IndexDomain(inclusive_min=(2, 5), exclusive_max=(10, 20)) + # represents {(i, j) : 2 <= i < 10, 5 <= j < 20} + +Unlike NumPy, domains can have **non-zero origins**. After slicing +`arr[5:10]`, the result has origin 5 and shape 5 — coordinates 5 through +9 are valid. This follows the TensorStore convention. +""" + +from __future__ import annotations + +from dataclasses import dataclass, field +from typing import Any + + +@dataclass(frozen=True, slots=True) +class IndexDomain: + """A rectangular region in N-dimensional index space. + + The valid coordinates are the integers in + `[inclusive_min[d], exclusive_max[d])` for each dimension `d`. + """ + + inclusive_min: tuple[int, ...] + exclusive_max: tuple[int, ...] + labels: tuple[str, ...] | None = None + # Lazily-memoized shape. Excluded from init/repr/eq/hash: it is derived + # state, not part of the domain's identity. The domain is frozen, so the + # value is computed at most once (see `shape`). `None` is the unset + # sentinel; an empty shape caches as `()`. + _shape: tuple[int, ...] | None = field(default=None, init=False, repr=False, compare=False) + + def __post_init__(self) -> None: + if len(self.inclusive_min) != len(self.exclusive_max): + raise ValueError( + f"inclusive_min and exclusive_max must have the same length. " + f"Got {len(self.inclusive_min)} and {len(self.exclusive_max)}." + ) + for i, (lo, hi) in enumerate(zip(self.inclusive_min, self.exclusive_max, strict=True)): + if lo > hi: + raise ValueError( + f"inclusive_min must be <= exclusive_max for all dimensions. " + f"Dimension {i}: {lo} > {hi}" + ) + if self.labels is not None and len(self.labels) != len(self.inclusive_min): + raise ValueError( + f"labels must have the same length as dimensions. " + f"Got {len(self.labels)} labels for {len(self.inclusive_min)} dimensions." + ) + + @classmethod + def from_shape(cls, shape: tuple[int, ...]) -> IndexDomain: + """Create a domain with origin at zero.""" + return cls( + inclusive_min=(0,) * len(shape), + exclusive_max=shape, + ) + + @property + def ndim(self) -> int: + return len(self.inclusive_min) + + @property + def origin(self) -> tuple[int, ...]: + return self.inclusive_min + + @property + def shape(self) -> tuple[int, ...]: + cached = self._shape + if cached is None: + cached = tuple( + hi - lo for lo, hi in zip(self.inclusive_min, self.exclusive_max, strict=True) + ) + object.__setattr__(self, "_shape", cached) + return cached + + def contains(self, index: tuple[int, ...]) -> bool: + if len(index) != self.ndim: + return False + return all( + lo <= idx < hi + for lo, hi, idx in zip(self.inclusive_min, self.exclusive_max, index, strict=True) + ) + + def contains_domain(self, other: IndexDomain) -> bool: + if other.ndim != self.ndim: + return False + return all( + self_lo <= other_lo and other_hi <= self_hi + for self_lo, self_hi, other_lo, other_hi in zip( + self.inclusive_min, + self.exclusive_max, + other.inclusive_min, + other.exclusive_max, + strict=True, + ) + ) + + def intersect(self, other: IndexDomain) -> IndexDomain | None: + if other.ndim != self.ndim: + raise ValueError( + f"Cannot intersect domains with different ranks: {self.ndim} vs {other.ndim}" + ) + new_min = tuple( + max(a, b) for a, b in zip(self.inclusive_min, other.inclusive_min, strict=True) + ) + new_max = tuple( + min(a, b) for a, b in zip(self.exclusive_max, other.exclusive_max, strict=True) + ) + if any(lo >= hi for lo, hi in zip(new_min, new_max, strict=True)): + return None + return IndexDomain(inclusive_min=new_min, exclusive_max=new_max) + + def translate(self, offset: tuple[int, ...]) -> IndexDomain: + if len(offset) != self.ndim: + raise ValueError( + f"Offset must have same length as domain dimensions. " + f"Domain has {self.ndim} dimensions, offset has {len(offset)}." + ) + new_min = tuple(lo + off for lo, off in zip(self.inclusive_min, offset, strict=True)) + new_max = tuple(hi + off for hi, off in zip(self.exclusive_max, offset, strict=True)) + return IndexDomain(inclusive_min=new_min, exclusive_max=new_max) + + def narrow(self, selection: Any) -> IndexDomain: + """Apply a basic selection and return a narrowed domain. + Indices are absolute coordinates. Integer indices produce length-1 extent. + Strided slices are not supported — use IndexTransform for strides. + """ + normalized = _normalize_selection(selection, self.ndim) + new_inclusive_min: list[int] = [] + new_exclusive_max: list[int] = [] + for dim_idx, (sel, dim_lo, dim_hi) in enumerate( + zip(normalized, self.inclusive_min, self.exclusive_max, strict=True) + ): + if isinstance(sel, int): + if sel < dim_lo or sel >= dim_hi: + raise IndexError( + f"index {sel} is out of bounds for dimension {dim_idx} " + f"with domain [{dim_lo}, {dim_hi})" + ) + new_inclusive_min.append(sel) + new_exclusive_max.append(sel + 1) + else: + start, stop, step = sel.start, sel.stop, sel.step + if step is not None and step != 1: + raise IndexError( + "IndexDomain.narrow only supports step=1 slices. " + f"Got step={step}. Use IndexTransform for strided access." + ) + abs_start = dim_lo if start is None else start + abs_stop = dim_hi if stop is None else stop + abs_start = max(abs_start, dim_lo) + abs_stop = min(abs_stop, dim_hi) + abs_stop = max(abs_stop, abs_start) + new_inclusive_min.append(abs_start) + new_exclusive_max.append(abs_stop) + return IndexDomain( + inclusive_min=tuple(new_inclusive_min), + exclusive_max=tuple(new_exclusive_max), + ) + + +def _normalize_selection(selection: Any, ndim: int) -> tuple[int | slice, ...]: + """Normalize a basic selection to a tuple of ints/slices with length ndim.""" + if not isinstance(selection, tuple): + selection = (selection,) + result: list[int | slice] = [] + ellipsis_seen = False + for sel in selection: + if sel is Ellipsis: + if ellipsis_seen: + raise IndexError("an index can only have a single ellipsis ('...')") + ellipsis_seen = True + num_missing = ndim - (len(selection) - 1) + result.extend([slice(None)] * num_missing) + else: + result.append(sel) + while len(result) < ndim: + result.append(slice(None)) + if len(result) > ndim: + raise IndexError( + f"too many indices for array: array has {ndim} dimensions, " + f"but {len(result)} were indexed" + ) + return tuple(result) diff --git a/packages/zarr-indexing/src/zarr_indexing/errors.py b/packages/zarr-indexing/src/zarr_indexing/errors.py new file mode 100644 index 0000000000..fa2f6fc5d3 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/errors.py @@ -0,0 +1,21 @@ +"""Canonical index-error types raised by the transform algebra. + +These are the authoritative class definitions. `zarr.errors` re-exports the +same objects (`from zarr_indexing.errors import ...`) so that, e.g., +`zarr.errors.BoundsCheckError is zarr_indexing.errors.BoundsCheckError`. +Both subclass the built-in `IndexError`, so existing `except IndexError` (or +`except zarr.errors.BoundsCheckError`) catch sites keep working unchanged. +""" + +from __future__ import annotations + +__all__ = [ + "BoundsCheckError", + "VindexInvalidSelectionError", +] + + +class VindexInvalidSelectionError(IndexError): ... + + +class BoundsCheckError(IndexError): ... diff --git a/packages/zarr-indexing/src/zarr_indexing/grid.py b/packages/zarr-indexing/src/zarr_indexing/grid.py new file mode 100644 index 0000000000..de1dae2dfc --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/grid.py @@ -0,0 +1,25 @@ +"""Structural typing for the chunk-grid surface used by chunk resolution. + +`chunk_resolution` needs only a narrow slice of a chunk grid: the per-dimension +mapping between storage indices and chunk coordinates, passed as one +`DimensionGridLike` per storage dimension. Rather than import zarr's concrete +grid types, we type against this Protocol; zarr's per-dimension grids satisfy +it structurally, so no zarr import is needed here. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Protocol + +if TYPE_CHECKING: + import numpy as np + import numpy.typing as npt + + +class DimensionGridLike(Protocol): + """The per-dimension chunk-mapping surface consumed by chunk resolution.""" + + def index_to_chunk(self, idx: int) -> int: ... + def chunk_offset(self, chunk_ix: int) -> int: ... + def chunk_size(self, chunk_ix: int) -> int: ... + def indices_to_chunks(self, indices: npt.NDArray[np.intp]) -> npt.NDArray[np.intp]: ... diff --git a/packages/zarr-indexing/src/zarr_indexing/json.py b/packages/zarr-indexing/src/zarr_indexing/json.py new file mode 100644 index 0000000000..c95696f309 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/json.py @@ -0,0 +1,325 @@ +"""Lowering between canonical ndsel bodies and in-memory `IndexTransform`s. + +This is the **engine layer**. Where `messages.py` is pure JSON→JSON and imposes +no array constraints, this module converts a *canonical* ndsel transform body +(spec section 4.3, as produced by `zarr_indexing.messages.normalize_ndsel`) +into the numpy-backed `IndexTransform` the chunk engine runs on, and back. + +Two engine constraints live **here and only here**: + +- **Finite bounds.** An `IndexDomain` addresses a finite array, so a canonical + body carrying a `"-inf"`/`"+inf"` bound cannot be lowered; `from_json` raises. +- **Implicit bounds lower by value.** The `[n]`-bracket implicit/explicit flag + is a message-layer concern; the engine keeps only the integer value. + +## The `index_array` wire format (and the degenerate-collapse it documents) + +ndsel and TensorStore both **reject** an output map that carries *both* +`input_dimension` and `index_array`. The in-memory `ArrayMap`, however, records +an `input_dimension` to pin the axis an orthogonal (`oindex`) array varies over. +This module bridges the gap: + +- **On serialize** (`transform_to_canonical`): + 1. An all-singleton `index_array` (size 1) selects a single coordinate + regardless of input, so it is **collapsed to a `constant` map** + `{offset: offset + stride*value}`. The size-1 input dimension stays in the + domain, unconsumed — a valid transform. This makes a length-1 `oindex` + selection round-trip *behaviorally* (an `ArrayMap` becomes a `ConstantMap`) + rather than by object identity. + 2. Non-degenerate `index_array` maps are emitted **without** `input_dimension`. + +- **On load** (`transform_from_canonical`): the in-memory `input_dimension` is + reconstructed from the full-rank array's dependency axes (its non-singleton + axes, see `transform._array_map_dependency_axes`). An array that solely owns a + single non-singleton axis is orthogonal (`input_dimension = that axis`); arrays + that share non-singleton axes, or vary over several, are correlated (`vindex`, + `input_dimension = None`). A single 1-D array over a rank-1 domain is + inherently ambiguous between the two flavours; it reconstructs as orthogonal, + which is behaviorally identical for the single-array case. + +`index_transform_to_json` / `index_transform_from_json` (and the `*_domain_*` +variants) are these canonical converters under their historical names. +""" + +from __future__ import annotations + +from collections import Counter +from typing import Any, Required, TypedDict + +import numpy as np + +from zarr_indexing.domain import IndexDomain +from zarr_indexing.messages import normalize_ndsel +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap, OutputIndexMap +from zarr_indexing.transform import ( + IndexTransform, + _array_map_dependency_axes, # pyright: ignore[reportPrivateUsage] +) + +# `_array_map_dependency_axes` is a leading-underscore helper in `transform.py`, +# but it is deliberately shared with this module (the engine-level JSON <-> +# `IndexTransform` lowering below needs the same dependency-axis logic that +# `transform.py`'s own array-reindexing helpers use). It is not part of the +# package's public API; pyright's `reportPrivateUsage` flags the cross-module +# import anyway. See `chunk_resolution.py`'s `_dimensions` suppression for the +# analogous rationale — whether to promote either symbol out of "private" is +# an open pre-publish API decision, not resolved here. + +# --------------------------------------------------------------------------- +# TypedDict definitions (canonical JSON shapes) +# --------------------------------------------------------------------------- + +# An `index_array` serializes via `ndarray.tolist()`, so it is a nested list of +# ints whose nesting depth equals the array rank. +NestedIntList = list[Any] + +# A canonical *lowered* body carries only finite integer bounds, but the JSON +# shape admits the full ndsel `bound` grammar: an explicit int / sentinel, or a +# one-element implicit `[value]` array. +IndexValueJSON = int | str +BoundJSON = int | str | list[IndexValueJSON] + + +class IndexDomainJSON(TypedDict, total=False): + """Canonical JSON representation of an IndexDomain.""" + + input_inclusive_min: Required[list[BoundJSON]] + input_exclusive_max: Required[list[BoundJSON]] + input_labels: Required[list[str]] + + +class OutputIndexMapJSON(TypedDict, total=False): + """Canonical JSON representation of a single output index map. + + Exactly one of three forms (distinguished by which fields are present): + + - `{"offset": 5}` — constant + - `{"offset": 0, "stride": 1, "input_dimension": 0}` — single_input_dimension + - `{"offset": 0, "stride": 1, "index_array": [...], + "index_array_bounds": ["-inf", "+inf"]}` — index_array + """ + + offset: int + stride: int + input_dimension: int + index_array: NestedIntList + index_array_bounds: list[IndexValueJSON] + + +class IndexTransformJSON(TypedDict, total=False): + """Canonical JSON representation of an IndexTransform (spec section 4.3).""" + + input_rank: Required[int] + input_inclusive_min: Required[list[BoundJSON]] + input_exclusive_max: Required[list[BoundJSON]] + input_labels: Required[list[str]] + output: Required[list[OutputIndexMapJSON]] + + +# --------------------------------------------------------------------------- +# Bound / label lowering (engine constraints) +# --------------------------------------------------------------------------- + + +def _lower_bound(bound: BoundJSON, where: str) -> int: + """Lower a canonical bound to a finite integer, rejecting infinities.""" + value = bound[0] if isinstance(bound, list) else bound + if value == "-inf" or value == "+inf": + raise ValueError( + f"{where} is infinite ({value!r}); an IndexDomain addresses a finite " + f"array and cannot lower an infinite bound" + ) + return int(value) + + +def _lower_labels(labels: list[str]) -> tuple[str, ...] | None: + """All-empty labels collapse to `None` so a label-free domain round-trips.""" + return None if all(label == "" for label in labels) else tuple(labels) + + +def _emit_labels(labels: tuple[str, ...] | None, rank: int) -> list[str]: + """Emit canonical labels: `[""]*rank` when the domain is unlabeled.""" + return [""] * rank if labels is None else list(labels) + + +# --------------------------------------------------------------------------- +# IndexDomain serialization +# --------------------------------------------------------------------------- + + +def index_domain_to_json(domain: IndexDomain) -> IndexDomainJSON: + """Convert an IndexDomain to its canonical JSON representation.""" + return { + "input_inclusive_min": list(domain.inclusive_min), + "input_exclusive_max": list(domain.exclusive_max), + "input_labels": _emit_labels(domain.labels, domain.ndim), + } + + +def index_domain_from_json(data: IndexDomainJSON) -> IndexDomain: + """Construct an IndexDomain from its canonical JSON representation.""" + inclusive_min = tuple( + _lower_bound(b, f"input_inclusive_min[{i}]") + for i, b in enumerate(data["input_inclusive_min"]) + ) + exclusive_max = tuple( + _lower_bound(b, f"input_exclusive_max[{i}]") + for i, b in enumerate(data["input_exclusive_max"]) + ) + labels = _lower_labels(list(data["input_labels"])) + return IndexDomain(inclusive_min=inclusive_min, exclusive_max=exclusive_max, labels=labels) + + +# --------------------------------------------------------------------------- +# OutputIndexMap serialization +# --------------------------------------------------------------------------- + + +def output_index_map_to_json(m: OutputIndexMap) -> OutputIndexMapJSON: + """Convert an output index map to its canonical JSON representation. + + A degenerate all-singleton `ArrayMap` collapses to a `constant` map; a + non-degenerate one is emitted without `input_dimension` (see the module + docstring on the wire format). + """ + if isinstance(m, ConstantMap): + return {"offset": m.offset} + + if isinstance(m, DimensionMap): + return {"offset": m.offset, "stride": m.stride, "input_dimension": m.input_dimension} + + # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + if m.index_array.size == 1: + value = int(m.index_array.reshape(-1)[0]) + return {"offset": m.offset + m.stride * value} + return { + "offset": m.offset, + "stride": m.stride, + "index_array": m.index_array.tolist(), + "index_array_bounds": ["-inf", "+inf"], + } + + +def output_index_map_from_json(data: OutputIndexMapJSON) -> OutputIndexMap: + """Construct an output index map from its canonical JSON representation. + + An `index_array` map's `input_dimension` is reconstructed from the array's + dependency axes in isolation (single non-singleton axis → orthogonal). The + transform-level loader classifies globally; use it when several maps may + share axes. + """ + if "index_array" in data: + arr = np.asarray(data["index_array"], dtype=np.intp) + return ArrayMap( + index_array=arr, + offset=data.get("offset", 0), + stride=data.get("stride", 1), + input_dimension=_solo_dependency_axis(arr), + ) + + if "input_dimension" in data: + return DimensionMap( + input_dimension=data["input_dimension"], + offset=data.get("offset", 0), + stride=data.get("stride", 1), + ) + + return ConstantMap(offset=data.get("offset", 0)) + + +def _solo_dependency_axis(arr: np.ndarray[Any, Any]) -> int | None: + """The single axis a lone `index_array` varies over, or `None` if not exactly one.""" + dep = _array_map_dependency_axes(arr) + return dep[0] if len(dep) == 1 else None + + +# --------------------------------------------------------------------------- +# IndexTransform serialization +# --------------------------------------------------------------------------- + + +def transform_to_canonical(transform: IndexTransform) -> IndexTransformJSON: + """Convert an IndexTransform to its canonical ndsel transform body. + + The result is fully explicit (spec section 4.3): `input_rank`, fully written + bounds and labels, and an explicit `output` with `offset`/`stride` present + on every affine and array map. + """ + return { + "input_rank": transform.domain.ndim, + "input_inclusive_min": list(transform.domain.inclusive_min), + "input_exclusive_max": list(transform.domain.exclusive_max), + "input_labels": _emit_labels(transform.domain.labels, transform.domain.ndim), + "output": [output_index_map_to_json(m) for m in transform.output], + } + + +def transform_from_canonical(data: IndexTransformJSON) -> IndexTransform: + """Construct an IndexTransform from a canonical (or canonicalizable) body. + + The body is first run through the message layer (`normalize_ndsel`) so that + omitted fields — identity `output`, default bounds/labels — are filled and + validated, then lowered to the engine representation. `index_array` maps' + `input_dimension` values are reconstructed by global dependency-axis + ownership (see the module docstring). + """ + body = normalize_ndsel({"kind": "transform", **data}) + + inclusive_min = tuple( + _lower_bound(b, f"input_inclusive_min[{i}]") + for i, b in enumerate(body["input_inclusive_min"]) + ) + exclusive_max = tuple( + _lower_bound(b, f"input_exclusive_max[{i}]") + for i, b in enumerate(body["input_exclusive_max"]) + ) + domain = IndexDomain( + inclusive_min=inclusive_min, + exclusive_max=exclusive_max, + labels=_lower_labels(body["input_labels"]), + ) + + output_raw: list[dict[str, Any]] = body["output"] + + # Classify index_array maps globally: an axis owned by exactly one array map + # (and the map's sole non-singleton axis) marks that map orthogonal; shared + # or multiple non-singleton axes mark the maps correlated (vindex). + array_axes: dict[int, tuple[int, ...]] = {} + axis_owners: Counter[int] = Counter() + for i, om in enumerate(output_raw): + if "index_array" in om: + arr = np.asarray(om["index_array"], dtype=np.intp) + dep = _array_map_dependency_axes(arr) + array_axes[i] = dep + axis_owners.update(dep) + + output: list[OutputIndexMap] = [] + for i, om in enumerate(output_raw): + if "index_array" in om: + dep = array_axes[i] + input_dim = dep[0] if len(dep) == 1 and axis_owners[dep[0]] == 1 else None + output.append( + ArrayMap( + index_array=np.asarray(om["index_array"], dtype=np.intp), + offset=om.get("offset", 0), + stride=om.get("stride", 1), + input_dimension=input_dim, + ) + ) + elif "input_dimension" in om: + output.append( + DimensionMap( + input_dimension=om["input_dimension"], + offset=om.get("offset", 0), + stride=om.get("stride", 1), + ) + ) + else: + output.append(ConstantMap(offset=om.get("offset", 0))) + + return IndexTransform(domain=domain, output=tuple(output)) + + +# Historical names, now pointing at the canonical converters. +index_transform_to_json = transform_to_canonical +index_transform_from_json = transform_from_canonical diff --git a/packages/zarr-indexing/src/zarr_indexing/messages.py b/packages/zarr-indexing/src/zarr_indexing/messages.py new file mode 100644 index 0000000000..d5761d1a38 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/messages.py @@ -0,0 +1,657 @@ +"""The ndsel message layer — pure JSON in, canonical JSON out. + +This module implements the [ndsel](https://github.com/zarr-developers/ndsel) draft wire +format: a JSON-serializable representation of NumPy-style n-dimensional +selections that adapts TensorStore's `IndexTransform` model. It is a **pure +JSON→JSON** layer: it depends on nothing but the standard library, imposes no +engine (numpy/array) constraints, and never rounds, clamps, or drops +information. Engine constraints (finite bounds, in-memory `IndexTransform` +construction) live one layer up, in `json.py`. + +Two entry points: + +- `parse_ndsel(obj)` — structurally validate an ndsel message of any of the + five kinds (`point`/`box`/`slice`/`points`/`transform`), returning it + unchanged. Raises `NdselError` (carrying a spec reason code) on any defect. +- `normalize_ndsel(obj)` — desugar and canonicalize a message to the single + deterministic **canonical transform body** of the spec (section 4.3): a bare + `IndexTransform` JSON body, without the `kind` discriminator. `normalize` is + idempotent when its output is re-tagged with `kind: "transform"`. + +The canonical body is, field-for-field, a TensorStore `IndexTransform` (minus +`kind`), so a normalized `transform` loads directly into TensorStore once +`kind` is stripped. + +Value rules enforced here: every integer is a 64-bit signed value; JSON +booleans are **not** integers (Python's `isinstance(True, int)` is guarded +against explicitly); the `"-inf"`/`"+inf"` sentinels are legal only in bound +positions; an implicit bound is the one-element `[n]`-bracket form, and its +implicit/explicit flag is preserved through normalization. +""" + +from __future__ import annotations + +from typing import Any + +__all__ = [ + "NdselError", + "normalize_ndsel", + "parse_ndsel", +] + +# --------------------------------------------------------------------------- +# Error taxonomy +# --------------------------------------------------------------------------- + +#: The complete set of ndsel reason codes (spec section 6). +REASON_CODES = frozenset( + { + "invalid_json", + "unknown_kind", + "unknown_field", + "multiple_upper_bounds", + "bounds_out_of_order", + "output_map_conflict", + "rank_mismatch", + "step_zero", + "negative_step_unsupported", + } +) + + +class NdselError(ValueError): + """An ndsel message failed validation. + + Carries the spec `reason` code (one of `REASON_CODES`) so callers and the + conformance harness can assert on it directly, plus a human-readable + `detail`. + """ + + def __init__(self, reason: str, detail: str = "") -> None: + self.reason = reason + self.detail = detail + super().__init__(f"{reason}: {detail}" if detail else reason) + + +# --------------------------------------------------------------------------- +# 64-bit signed integer range (spec section 3.5) +# --------------------------------------------------------------------------- + +_I64_MIN = -(2**63) +_I64_MAX = 2**63 - 1 + +_KNOWN_KINDS = frozenset({"point", "box", "slice", "points", "transform"}) + +# The two upper-bound spellings, keyed by message prefix. Only one of the three +# per group may appear (spec section 4.1 / 5.2). +_BOX_UPPER = ("exclusive_max", "inclusive_max", "shape") +_TRANSFORM_UPPER = ("input_exclusive_max", "input_inclusive_max", "input_shape") + +_OUTPUT_MAP_FIELDS = frozenset( + {"offset", "stride", "input_dimension", "index_array", "index_array_bounds"} +) + + +# --------------------------------------------------------------------------- +# Leaf value validators +# --------------------------------------------------------------------------- + + +def _is_int(value: Any) -> bool: + """True iff `value` is a JSON integer — an `int` that is not a `bool`. + + JSON has no boolean-as-integer: `True`/`False` are rejected even though + Python makes `bool` a subclass of `int` (spec section 3.6). + """ + return isinstance(value, int) and not isinstance(value, bool) + + +def _check_int(value: Any, where: str) -> int: + """Validate a plain-integer position: an in-range i64, never a sentinel.""" + if not _is_int(value): + raise NdselError("invalid_json", f"{where} must be an integer, got {value!r}") + if value < _I64_MIN or value > _I64_MAX: + raise NdselError("invalid_json", f"{where} is outside the 64-bit signed range: {value}") + return int(value) + + +def _is_sentinel(value: Any) -> bool: + return value in ("-inf", "+inf") + + +def _check_index_value(value: Any, where: str) -> int | str: + """Validate an `index-value`: an in-range i64 or a `"-inf"`/`"+inf"` sentinel.""" + if _is_sentinel(value): + return str(value) + return _check_int(value, where) + + +def _check_bound(value: Any, where: str) -> int | str | list[int | str]: + """Validate a `bound`: an explicit `index-value`, or a one-element implicit `[index-value]`.""" + if isinstance(value, list): + if len(value) != 1: + raise NdselError( + "invalid_json", + f"{where} implicit bound must be a one-element array, got {value!r}", + ) + return [_check_index_value(value[0], where)] + return _check_index_value(value, where) + + +def _check_int_list(value: Any, where: str) -> list[int]: + if not isinstance(value, list): + raise NdselError("invalid_json", f"{where} must be an array, got {value!r}") + return [_check_int(v, f"{where}[{i}]") for i, v in enumerate(value)] + + +def _check_bound_list(value: Any, where: str) -> list[Any]: + if not isinstance(value, list): + raise NdselError("invalid_json", f"{where} must be an array, got {value!r}") + return [_check_bound(v, f"{where}[{i}]") for i, v in enumerate(value)] + + +def _check_label_list(value: Any, where: str) -> list[str]: + if not isinstance(value, list): + raise NdselError("invalid_json", f"{where} must be an array, got {value!r}") + for i, v in enumerate(value): + if not isinstance(v, str): + raise NdselError("invalid_json", f"{where}[{i}] must be a string, got {v!r}") + return list(value) + + +# --------------------------------------------------------------------------- +# Extended-integer order for bounds (spec section 4.1) +# --------------------------------------------------------------------------- + + +def _bound_value(bound: int | str | list[int | str]) -> int | str: + """The underlying `index-value` of a bound, dropping the implicit bracket.""" + return bound[0] if isinstance(bound, list) else bound + + +def _bound_is_implicit(bound: int | str | list[int | str]) -> bool: + return isinstance(bound, list) + + +def _ext_key(value: int | str) -> tuple[int, int]: + """A sort key giving the extended-integer order `-inf < n < +inf` exactly. + + Uses an integer tier plus the value, so no float rounding of near-`2**63` + integers can misorder the `inclusive_min <= exclusive_max` check. + """ + if value == "-inf": + return (0, 0) + if value == "+inf": + return (2, 0) + assert isinstance(value, int) + return (1, value) + + +def _rewrap(value: int | str, *, implicit: bool) -> int | str | list[int | str]: + return [value] if implicit else value + + +# --------------------------------------------------------------------------- +# Message-level helpers +# --------------------------------------------------------------------------- + + +def _require_object(obj: Any) -> dict[str, Any]: + if not isinstance(obj, dict): + raise NdselError("invalid_json", f"message must be a JSON object, got {type(obj).__name__}") + return obj + + +def _message_kind(obj: dict[str, Any]) -> str: + kind = obj.get("kind") + if not isinstance(kind, str): + raise NdselError("invalid_json", "message must have a string 'kind' field") + if kind not in _KNOWN_KINDS: + raise NdselError("unknown_kind", f"unknown kind {kind!r}") + return kind + + +def _check_membership(obj: dict[str, Any], allowed: frozenset[str], what: str) -> None: + """Strict membership (spec section 3.7): reject any undefined member.""" + for key in obj: + if key not in allowed: + raise NdselError("unknown_field", f"{what} has undefined member {key!r}") + + +def _single_upper_bound(obj: dict[str, Any], fields: tuple[str, str, str]) -> str | None: + present = [f for f in fields if f in obj] + if len(present) > 1: + raise NdselError( + "multiple_upper_bounds", + f"at most one of {fields} may be present; got {present}", + ) + return present[0] if present else None + + +def _resolve_upper_bound( + upper_field: str | None, + upper_raw: list[Any] | None, + inclusive_min: list[Any], + rank: int, + *, + kind_of: str, +) -> list[int | str | list[int | str]]: + """Produce `exclusive_max` from whichever upper-bound spelling was supplied. + + - `exclusive_max`/`input_exclusive_max` → used directly. + - `inclusive_max`/`input_inclusive_max` → each element `+1`. + - `shape`/`input_shape` → `inclusive_min + shape` per element. + - none → an **implicit `+inf`** in every dimension. + + The implicit/explicit bracket travels with the extent-bearing field (the + upper bound, or `shape`), matching the spec's `[n]`-bracket convention. + """ + if upper_field is None: + return [["+inf"] for _ in range(rank)] + + assert upper_raw is not None + if kind_of == "exclusive": + return list(upper_raw) + + result: list[int | str | list[int | str]] = [] + for k in range(rank): + raw = upper_raw[k] + implicit = _bound_is_implicit(raw) + value = _bound_value(raw) + if kind_of == "inclusive": + new = _inclusive_to_exclusive(value) + else: # shape + new = _shape_to_exclusive(_bound_value(inclusive_min[k]), value) + result.append(_rewrap(new, implicit=implicit)) + return result + + +def _inclusive_to_exclusive(value: int | str) -> int | str: + if value == "+inf" or value == "-inf": + return value + assert isinstance(value, int) + return value + 1 + + +def _shape_to_exclusive(min_value: int | str, shape_value: int | str) -> int | str: + if shape_value == "+inf" or min_value == "+inf": + return "+inf" + if min_value == "-inf": + return "-inf" + assert isinstance(min_value, int) + assert isinstance(shape_value, int) + return min_value + shape_value + + +def _validate_domain(inclusive_min: list[Any], exclusive_max: list[Any], *, prefix: str) -> None: + """Every dimension must satisfy `inclusive_min <= exclusive_max` (empty is valid).""" + for k, (lo, hi) in enumerate(zip(inclusive_min, exclusive_max, strict=True)): + if _ext_key(_bound_value(lo)) > _ext_key(_bound_value(hi)): + raise NdselError( + "bounds_out_of_order", + f"{prefix}[{k}]: inclusive_min {_bound_value(lo)!r} > " + f"exclusive_max {_bound_value(hi)!r}", + ) + + +def _identity_output(rank: int) -> list[dict[str, Any]]: + return [{"offset": 0, "stride": 1, "input_dimension": k} for k in range(rank)] + + +# --------------------------------------------------------------------------- +# Per-kind desugaring +# --------------------------------------------------------------------------- + + +def _normalize_point(obj: dict[str, Any]) -> dict[str, Any]: + _check_membership(obj, frozenset({"kind", "coords"}), "point") + if "coords" not in obj: + raise NdselError("invalid_json", "point requires 'coords'") + coords = _check_int_list(obj["coords"], "coords") + return { + "input_rank": 0, + "input_inclusive_min": [], + "input_exclusive_max": [], + "input_labels": [], + "output": [{"offset": c} for c in coords], + } + + +def _infer_rank( + obj: dict[str, Any], + named_lengths: list[tuple[str, int]], + *, + declared: int | None, +) -> int: + """Reconcile a declared rank (if any) with every present array's length.""" + rank = declared + for name, length in named_lengths: + if rank is None: + rank = length + elif rank != length: + raise NdselError( + "rank_mismatch", + f"{name} has length {length}, inconsistent with rank {rank}", + ) + return rank if rank is not None else 0 + + +def _normalize_box(obj: dict[str, Any]) -> dict[str, Any]: + allowed = frozenset( + {"kind", "inclusive_min", "exclusive_max", "inclusive_max", "shape", "labels"} + ) + _check_membership(obj, allowed, "box") + + inclusive_min_raw = ( + _check_bound_list(obj["inclusive_min"], "inclusive_min") if "inclusive_min" in obj else None + ) + upper_field = _single_upper_bound(obj, _BOX_UPPER) + upper_raw = _check_bound_list(obj[upper_field], upper_field) if upper_field else None + labels_raw = _check_label_list(obj["labels"], "labels") if "labels" in obj else None + + named_lengths: list[tuple[str, int]] = [] + if inclusive_min_raw is not None: + named_lengths.append(("inclusive_min", len(inclusive_min_raw))) + if upper_raw is not None: + named_lengths.append((upper_field or "", len(upper_raw))) + if labels_raw is not None: + named_lengths.append(("labels", len(labels_raw))) + rank = _infer_rank(obj, named_lengths, declared=None) + + inclusive_min = inclusive_min_raw if inclusive_min_raw is not None else [0] * rank + exclusive_max = _resolve_upper_bound( + upper_field, upper_raw, inclusive_min, rank, kind_of=_upper_kind(upper_field, _BOX_UPPER) + ) + labels = labels_raw if labels_raw is not None else [""] * rank + _validate_domain(inclusive_min, exclusive_max, prefix="box") + + return { + "input_rank": rank, + "input_inclusive_min": inclusive_min, + "input_exclusive_max": exclusive_max, + "input_labels": labels, + "output": _identity_output(rank), + } + + +def _upper_kind(upper_field: str | None, fields: tuple[str, str, str]) -> str: + if upper_field is None or upper_field == fields[0]: + return "exclusive" + if upper_field == fields[1]: + return "inclusive" + return "shape" + + +def _normalize_slice(obj: dict[str, Any]) -> dict[str, Any]: + allowed = frozenset({"kind", "start", "stop", "step", "labels"}) + _check_membership(obj, allowed, "slice") + if "start" not in obj: + raise NdselError("invalid_json", "slice requires 'start'") + if "stop" not in obj: + raise NdselError("invalid_json", "slice requires 'stop'") + start = _check_int_list(obj["start"], "start") + stop = _check_int_list(obj["stop"], "stop") + step = _check_int_list(obj["step"], "step") if "step" in obj else [1] * len(start) + labels_raw = _check_label_list(obj["labels"], "labels") if "labels" in obj else None + + n = len(start) + for name, arr in (("stop", stop), ("step", step)): + if len(arr) != n: + raise NdselError( + "rank_mismatch", f"{name} has length {len(arr)}, expected {n} (from start)" + ) + if labels_raw is not None and len(labels_raw) != n: + raise NdselError( + "rank_mismatch", f"labels has length {len(labels_raw)}, expected {n} (from start)" + ) + + for k, s in enumerate(step): + if s == 0: + raise NdselError("step_zero", f"step[{k}] is zero") + if s < 0: + raise NdselError("negative_step_unsupported", f"step[{k}] is negative ({s})") + + inclusive_min: list[Any] = [] + exclusive_max: list[Any] = [] + output: list[dict[str, Any]] = [] + for k in range(n): + a, b, s = start[k], stop[k], step[k] + m = max(0, -(-(b - a) // s)) # ceil((b - a) / s) + o = _trunc_div(a, s) # trunc(a / s), toward zero + offset = a - s * o # lattice phase, in (-s, s) + inclusive_min.append(o) + exclusive_max.append(o + m) + output.append({"offset": offset, "stride": s, "input_dimension": k}) + + labels = labels_raw if labels_raw is not None else [""] * n + return { + "input_rank": n, + "input_inclusive_min": inclusive_min, + "input_exclusive_max": exclusive_max, + "input_labels": labels, + "output": output, + } + + +def _normalize_points(obj: dict[str, Any]) -> dict[str, Any]: + _check_membership(obj, frozenset({"kind", "coords"}), "points") + if "coords" not in obj: + raise NdselError("invalid_json", "points requires 'coords'") + coords = obj["coords"] + if not isinstance(coords, list): + raise NdselError("invalid_json", f"points coords must be an array, got {coords!r}") + + rows: list[list[int]] = [] + n: int | None = None + for i, row in enumerate(coords): + if not isinstance(row, list): + raise NdselError("invalid_json", f"points coords[{i}] must be an array, got {row!r}") + row_ints = [_check_int(v, f"coords[{i}][{j}]") for j, v in enumerate(row)] + if n is None: + n = len(row_ints) + elif len(row_ints) != n: + raise NdselError( + "rank_mismatch", + f"points coords[{i}] has length {len(row_ints)}, expected {n} (ragged)", + ) + rows.append(row_ints) + + m = len(rows) + n = n if n is not None else 0 + output = [ + { + "offset": 0, + "stride": 1, + "index_array": [rows[i][k] for i in range(m)], + "index_array_bounds": ["-inf", "+inf"], + } + for k in range(n) + ] + return { + "input_rank": 1, + "input_inclusive_min": [0], + "input_exclusive_max": [m], + "input_labels": [""], + "output": output, + } + + +def _normalize_output_map(raw: Any, where: str) -> dict[str, Any]: + if not isinstance(raw, dict): + raise NdselError("invalid_json", f"{where} must be a JSON object, got {raw!r}") + _check_membership(raw, _OUTPUT_MAP_FIELDS, where) + + has_index_array = "index_array" in raw + has_input_dim = "input_dimension" in raw + if has_index_array and has_input_dim: + raise NdselError( + "output_map_conflict", + f"{where} carries both 'input_dimension' and 'index_array'", + ) + + offset = _check_int(raw["offset"], f"{where}.offset") if "offset" in raw else 0 + + if has_index_array: + stride = _check_int(raw["stride"], f"{where}.stride") if "stride" in raw else 1 + bounds = ( + _check_index_array_bounds(raw["index_array_bounds"], where) + if "index_array_bounds" in raw + else ["-inf", "+inf"] + ) + # index_array is carried verbatim (spec section 7 defers shape validation). + return { + "offset": offset, + "stride": stride, + "index_array": raw["index_array"], + "index_array_bounds": bounds, + } + + if has_input_dim: + input_dim = _check_int(raw["input_dimension"], f"{where}.input_dimension") + if input_dim < 0: + raise NdselError( + "invalid_json", f"{where}.input_dimension must be >= 0, got {input_dim}" + ) + stride = _check_int(raw["stride"], f"{where}.stride") if "stride" in raw else 1 + return {"offset": offset, "stride": stride, "input_dimension": input_dim} + + # Constant map: only offset survives. A stray `stride`/`index_array_bounds` + # is schema-valid (the output-map schema permits those members on any map), + # so it is silently dropped rather than rejected — a constant carries only + # `offset` in canonical form (spec section 4.3). + return {"offset": offset} + + +def _check_index_array_bounds(value: Any, where: str) -> list[int | str]: + if not isinstance(value, list) or len(value) != 2: + raise NdselError( + "invalid_json", + f"{where}.index_array_bounds must be a two-element array, got {value!r}", + ) + return [ + _check_index_value(value[0], f"{where}.index_array_bounds[0]"), + _check_index_value(value[1], f"{where}.index_array_bounds[1]"), + ] + + +def _normalize_transform(obj: dict[str, Any]) -> dict[str, Any]: + allowed = frozenset( + { + "kind", + "input_rank", + "input_inclusive_min", + "input_exclusive_max", + "input_inclusive_max", + "input_shape", + "input_labels", + "output", + } + ) + _check_membership(obj, allowed, "transform") + + declared_rank: int | None = None + if "input_rank" in obj: + declared_rank = _check_int(obj["input_rank"], "input_rank") + if declared_rank < 0: + raise NdselError("invalid_json", f"input_rank must be >= 0, got {declared_rank}") + + inclusive_min_raw = ( + _check_bound_list(obj["input_inclusive_min"], "input_inclusive_min") + if "input_inclusive_min" in obj + else None + ) + upper_field = _single_upper_bound(obj, _TRANSFORM_UPPER) + upper_raw = _check_bound_list(obj[upper_field], upper_field) if upper_field else None + labels_raw = ( + _check_label_list(obj["input_labels"], "input_labels") if "input_labels" in obj else None + ) + + named_lengths: list[tuple[str, int]] = [] + if inclusive_min_raw is not None: + named_lengths.append(("input_inclusive_min", len(inclusive_min_raw))) + if upper_raw is not None: + named_lengths.append((upper_field or "", len(upper_raw))) + if labels_raw is not None: + named_lengths.append(("input_labels", len(labels_raw))) + rank = _infer_rank(obj, named_lengths, declared=declared_rank) + + inclusive_min = inclusive_min_raw if inclusive_min_raw is not None else [0] * rank + exclusive_max = _resolve_upper_bound( + upper_field, + upper_raw, + inclusive_min, + rank, + kind_of=_upper_kind(upper_field, _TRANSFORM_UPPER), + ) + labels = labels_raw if labels_raw is not None else [""] * rank + _validate_domain(inclusive_min, exclusive_max, prefix="input") + + if "output" in obj: + if not isinstance(obj["output"], list): + raise NdselError("invalid_json", f"output must be an array, got {obj['output']!r}") + output = [_normalize_output_map(m, f"output[{i}]") for i, m in enumerate(obj["output"])] + else: + output = _identity_output(rank) + + return { + "input_rank": rank, + "input_inclusive_min": inclusive_min, + "input_exclusive_max": exclusive_max, + "input_labels": labels, + "output": output, + } + + +_NORMALIZERS = { + "point": _normalize_point, + "box": _normalize_box, + "slice": _normalize_slice, + "points": _normalize_points, + "transform": _normalize_transform, +} + + +# --------------------------------------------------------------------------- +# trunc division (spec section 5.3 correction, matches _trunc_div in transform.py) +# --------------------------------------------------------------------------- + + +def _trunc_div(a: int, b: int) -> int: + """Integer division rounded toward zero (C semantics).""" + q = a // b + if q < 0 and q * b != a: + q += 1 + return q + + +# --------------------------------------------------------------------------- +# Public entry points +# --------------------------------------------------------------------------- + + +def normalize_ndsel(obj: Any) -> dict[str, Any]: + """Desugar and canonicalize an ndsel message to its canonical transform body. + + Accepts any of the five message kinds and returns the bare canonical + `IndexTransform` body of spec section 4.3 — no `kind` field. Raises + `NdselError` (carrying a reason code) for any invalid input. + """ + message = _require_object(obj) + kind = _message_kind(message) + return _NORMALIZERS[kind](message) + + +def parse_ndsel(obj: Any) -> dict[str, Any]: + """Structurally validate an ndsel message, returning it unchanged. + + A lighter gate than `normalize_ndsel`: it confirms the message is a + well-formed ndsel message of a recognized kind (correct field membership, + JSON types, upper-bound exclusivity, domain ordering, step signs) and + raises `NdselError` otherwise, but does not desugar it. Useful for + validating a message you intend to keep in its compact shorthand form. + """ + message = _require_object(obj) + _message_kind(message) + # Validation and desugaring share one pass; run it and discard the body. + normalize_ndsel(message) + return message diff --git a/packages/zarr-indexing/src/zarr_indexing/output_map.py b/packages/zarr-indexing/src/zarr_indexing/output_map.py new file mode 100644 index 0000000000..581229bd22 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/output_map.py @@ -0,0 +1,105 @@ +"""Output index maps — three representations of a set of integer coordinates. + +An output index map describes, for one dimension of storage, which coordinates +an array access will touch. Conceptually it is a **set of integers**. Three +representations cover the cases that arise in practice: + +- `ConstantMap(offset=5)` — a singleton set: `{5}` +- `DimensionMap(input_dimension=0, offset=3, stride=2)` over input `[0, 5)` + — an arithmetic progression: `{3, 5, 7, 9, 11}` +- `ArrayMap(index_array=[1, 5, 9])` — an explicit enumeration: `{1, 5, 9}` + +Every output map supports two set-theoretic operations (defined on +`IndexTransform`, which provides the input domain context these maps lack): + +- **intersect** — restrict to coordinates within a range (e.g., a chunk). + `{3, 5, 7, 9, 11} ∩ [4, 8) = {5, 7}` +- **translate** — shift every coordinate by a constant (e.g., make chunk-local). + `{5, 7} - 4 = {1, 3}` + +These two operations are the foundation of chunk resolution: for each chunk, +intersect the map with the chunk's range, then translate to chunk-local +coordinates. + +The three types exist because they trade off generality for efficiency: + +- `ConstantMap`: O(1) storage, O(1) intersection +- `DimensionMap`: O(1) storage, O(1) intersection (analytical) +- `ArrayMap`: O(n) storage, O(n) intersection (must scan the array) + +Collapsing everything to `ArrayMap` would be correct but wasteful — a +billion-element slice would materialize a billion coordinates just to group +them by chunk, when `DimensionMap` does it with three integers. +""" + +from __future__ import annotations + +from dataclasses import dataclass +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + import numpy as np + import numpy.typing as npt + + +@dataclass(frozen=True, slots=True) +class ConstantMap: + """A singleton set: one storage coordinate. + + Represents `{offset}`. Arises from integer indexing (e.g., `arr[5]` + fixes one dimension to coordinate 5). + """ + + offset: int = 0 + + +@dataclass(frozen=True, slots=True) +class DimensionMap: + """An arithmetic progression of storage coordinates. + + Represents `{offset + stride * i : i in input_range}`, where the input + range comes from the enclosing `IndexTransform`'s domain. Arises from + slice indexing (e.g., `arr[2:10:3]` gives offset=2, stride=3). + """ + + input_dimension: int + offset: int = 0 + stride: int = 1 + + +@dataclass(frozen=True, slots=True) +class ArrayMap: + """An explicit enumeration of storage coordinates. + + Represents `{offset + stride * index_array[i] : i in input_range}`. + Arises from fancy indexing (e.g., `arr[[1, 5, 9]]` or boolean masks). + + Freshly constructed maps are normalized to the **full input rank** of their + enclosing transform: `index_array` has the enclosing domain's rank, sized + fully on the axes it varies over and singleton (size 1) elsewhere. The + dependency axes are therefore derivable from the shape (see + `transform._array_map_dependency_axes`), which distinguishes the two flavours + of multi-array fancy indexing: + + - **orthogonal** (`oindex`): each array varies along a single, *distinct* + axis (all others singleton); the result is their outer product. + - **vectorized** (`vindex`): the arrays are correlated and share the same + non-singleton (broadcast) axes; the result is a pointwise scatter. + + `input_dimension` records the single axis an orthogonal array varies over + (`None` for vectorized), binding it the way `DimensionMap` is bound. It is + usually redundant with the shape-derived classifier, but stays authoritative + for the shapes the classifier cannot distinguish: a length-1 orthogonal + selection normalizes to an all-singleton array (no non-singleton axis), and + length-1 vectorized arrays are equally degenerate. `None` therefore marks a + map as correlated, and an integer pins the dependency axis of a degenerate + orthogonal map (see `transform._array_map_dependent_axis`). + """ + + index_array: npt.NDArray[np.intp] + offset: int = 0 + stride: int = 1 + input_dimension: int | None = None + + +OutputIndexMap = ConstantMap | DimensionMap | ArrayMap diff --git a/packages/zarr-indexing/src/zarr_indexing/py.typed b/packages/zarr-indexing/src/zarr_indexing/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/zarr-indexing/src/zarr_indexing/transform.py b/packages/zarr-indexing/src/zarr_indexing/transform.py new file mode 100644 index 0000000000..e1a3898b1d --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/transform.py @@ -0,0 +1,1311 @@ +"""Index transforms — composable, lazy coordinate mappings. + +An `IndexTransform` pairs an **input domain** (the coordinates a user sees) +with a tuple of **output maps** (the storage coordinates those inputs map to). +One output map per storage dimension. See `output_map.py` for the three +output map types. + +Key operations: + +- **Indexing** (`transform[2:8]`, `.oindex[idx]`, `.vindex[idx]`) — + produces a new transform with a narrower input domain and adjusted output + maps. No I/O occurs. This is how lazy slicing works. + +- **intersect(output_domain)** — restrict to storage coordinates within a + region. This is chunk resolution: "which of my coordinates fall in this + chunk?" + +- **translate(shift)** — shift all output coordinates. This makes coordinates + chunk-local: "express my coordinates relative to the chunk origin." + +- **compose(outer, inner)** — chain two transforms. See `composition.py`. + +The transform is the atomic unit that connects user-facing indexing to +chunk-level I/O. Every `Array` holds a transform (identity by default). +`Array.lazy[...]` composes a new transform lazily. Reading resolves the +transform against the chunk grid via intersect + translate. +""" + +from __future__ import annotations + +import math +from dataclasses import dataclass +from typing import Any, Literal, cast + +import numpy as np + +from zarr_indexing.domain import IndexDomain +from zarr_indexing.errors import BoundsCheckError, VindexInvalidSelectionError +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap, OutputIndexMap + + +@dataclass(frozen=True, slots=True) +class IndexTransform: + """A composable mapping from input coordinates to storage coordinates. + + An `IndexTransform` has: + + - `domain`: an `IndexDomain` describing the valid input coordinates + (the user-facing shape, possibly with non-zero origin). + - `output`: a tuple of output maps (one per storage dimension), each + describing which storage coordinates the inputs touch. + + For a freshly opened array, the transform is the identity: input + coordinate `i` maps to storage coordinate `i`. Indexing operations + compose new transforms without I/O. + """ + + domain: IndexDomain + output: tuple[OutputIndexMap, ...] + + def __post_init__(self) -> None: + for i, m in enumerate(self.output): + if isinstance(m, DimensionMap): + if m.input_dimension < 0 or m.input_dimension >= self.domain.ndim: + raise ValueError( + f"output[{i}].input_dimension = {m.input_dimension} " + f"is out of range for input rank {self.domain.ndim}" + ) + elif isinstance(m, ArrayMap) and m.index_array.ndim > self.domain.ndim: + # ArrayMap index arrays produced by indexing and chunk resolution + # are normalized to the full input rank (an axis the array varies + # over is full-sized, every other axis a singleton). A rank + # *exceeding* the domain is always a bug. A rank *below* it is + # tolerated: TensorStore-format JSON (external input) may supply a + # lower-rank index array that broadcasts against the input domain, + # and `_array_map_dependency_axes` treats any missing leading axes + # as singleton dependencies. + raise ValueError( + f"output[{i}].index_array has {m.index_array.ndim} dims " + f"but input domain has {self.domain.ndim} dims" + ) + + @property + def input_rank(self) -> int: + return self.domain.ndim + + @property + def output_rank(self) -> int: + return len(self.output) + + @classmethod + def identity(cls, domain: IndexDomain) -> IndexTransform: + output = tuple(DimensionMap(input_dimension=i) for i in range(domain.ndim)) + return cls(domain=domain, output=output) + + @classmethod + def from_shape(cls, shape: tuple[int, ...]) -> IndexTransform: + return cls.identity(IndexDomain.from_shape(shape)) + + @property + def selection_repr(self) -> str: + """Compact domain string, e.g. `'{ [2, 8), [0, 10) }'`. + + Follows TensorStore's IndexDomain notation: each dimension shown + as `[inclusive_min, exclusive_max)` with stride annotation if not 1. + Constant (integer-indexed) dimensions show as a single value. + Array-indexed dimensions show the set of selected coordinates. + """ + parts: list[str] = [] + for m in self.output: + if isinstance(m, ConstantMap): + parts.append(str(m.offset)) + elif isinstance(m, DimensionMap): + d = m.input_dimension + lo = self.domain.inclusive_min[d] + hi = self.domain.exclusive_max[d] + start = m.offset + m.stride * lo + stop = m.offset + m.stride * hi + if m.stride == 1: + parts.append(f"[{start}, {stop})") + else: + parts.append(f"[{start}, {stop}) step {m.stride}") + else: + # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + storage = m.offset + m.stride * m.index_array + n = int(storage.size) # .size, not len(): index_array may be 0-d + if n <= 5: + vals = ", ".join(str(int(v)) for v in storage.ravel()) + parts.append("{" + vals + "}") + else: + parts.append("{" + f"array({n})" + "}") + return "{ " + ", ".join(parts) + " }" + + def __repr__(self) -> str: + maps: list[str] = [] + for i, m in enumerate(self.output): + if isinstance(m, ConstantMap): + maps.append(f"out[{i}] = {m.offset}") + elif isinstance(m, DimensionMap): + maps.append(f"out[{i}] = {m.offset} + {m.stride} * in[{m.input_dimension}]") + else: + # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + maps.append(f"out[{i}] = {m.offset} + {m.stride} * arr{m.index_array.shape}[in]") + maps_str = ", ".join(maps) + return f"IndexTransform(domain={self.domain}, {maps_str})" + + def intersect( + self, output_domain: IndexDomain + ) -> ( + tuple[ + IndexTransform, + dict[int, np.ndarray[Any, np.dtype[np.intp]]] + | np.ndarray[Any, np.dtype[np.intp]] + | None, + ] + | None + ): + """Restrict this transform to storage coordinates within output_domain. + + Returns `(restricted_transform, out_indices)` or None if empty. + + `out_indices` carries the surviving output positions: `None` when all + positions survive (ConstantMap/DimensionMap only), a single integer array + for one ArrayMap (or correlated/vectorized ArrayMaps), or a dict keyed by + output dimension for >= 2 orthogonal ArrayMaps (an outer product). + """ + return _intersect(self, output_domain) + + def translate(self, shift: tuple[int, ...]) -> IndexTransform: + """Shift all output coordinates by `shift`.""" + if len(shift) != self.output_rank: + raise ValueError(f"shift must have length {self.output_rank}, got {len(shift)}") + new_output: list[OutputIndexMap] = [] + for m, s in zip(self.output, shift, strict=True): + if isinstance(m, ConstantMap): + new_output.append(ConstantMap(offset=m.offset + s)) + elif isinstance(m, DimensionMap): + new_output.append( + DimensionMap( + input_dimension=m.input_dimension, + offset=m.offset + s, + stride=m.stride, + ) + ) + else: + # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + new_output.append( + ArrayMap( + index_array=m.index_array, + offset=m.offset + s, + stride=m.stride, + input_dimension=m.input_dimension, + ) + ) + return IndexTransform(domain=self.domain, output=tuple(new_output)) + + def __getitem__(self, selection: Any) -> IndexTransform: + return _apply_basic_indexing(self, selection) + + def translate_domain_by(self, shift: tuple[int, ...]) -> IndexTransform: + """Shift the *input* domain by `shift`, preserving which cells are addressed. + + TensorStore's `translate_by`: the domain moves, and every output map is + re-offset so that new coordinate `c` addresses the cell that `c - shift` + addressed before. ArrayMaps are indexed positionally over the domain, so + their index arrays are unchanged. + """ + if len(shift) != self.input_rank: + raise ValueError(f"shift must have length {self.input_rank}, got {len(shift)}") + new_domain = self.domain.translate(shift) + new_output: list[OutputIndexMap] = [] + for m in self.output: + if isinstance(m, DimensionMap): + s = shift[m.input_dimension] + new_output.append( + DimensionMap( + input_dimension=m.input_dimension, + offset=m.offset - m.stride * s, + stride=m.stride, + ) + ) + else: + # ConstantMap: no input dependence. ArrayMap: positional over + # the domain, invariant under domain translation. + new_output.append(m) + return IndexTransform(domain=new_domain, output=tuple(new_output)) + + def translate_domain_to(self, origins: tuple[int, ...]) -> IndexTransform: + """Move the input domain so its per-dimension origins equal `origins`. + + TensorStore's `translate_to`; `translate_domain_to((0,) * rank)` + re-zeros a view's coordinate system without changing which cells it + addresses. + """ + if len(origins) != self.input_rank: + raise ValueError(f"origins must have length {self.input_rank}, got {len(origins)}") + shift = tuple(o - m for o, m in zip(origins, self.domain.inclusive_min, strict=True)) + return self.translate_domain_by(shift) + + @property + def oindex(self) -> _OIndexHelper: + return _OIndexHelper(self) + + @property + def vindex(self) -> _VIndexHelper: + return _VIndexHelper(self) + + +def _intersect( + transform: IndexTransform, output_domain: IndexDomain +) -> ( + tuple[ + IndexTransform, + dict[int, np.ndarray[Any, np.dtype[np.intp]]] | np.ndarray[Any, np.dtype[np.intp]] | None, + ] + | None +): + """Intersect a transform with an output domain (e.g., a chunk's bounds). + + For each output dimension, restrict to storage coordinates within + `[output_domain.inclusive_min[d], output_domain.exclusive_max[d])`. + + Two flavours of fancy indexing require different treatment, distinguished by + the ArrayMaps' dependency axes (see `_array_map_dependency_axes`): + + - **orthogonal** (`oindex`): each ArrayMap varies over a single, distinct + input axis, forming an outer product. Every output dimension is intersected + independently and the input domain narrowed per axis. + - **correlated** (`vindex`): the ArrayMaps share their (broadcast) dependency + axes and scatter through a single flat index. A point survives only if ALL + its storage coordinates fall within the output domain; residual slice + dimensions are intersected independently, as in the orthogonal case. + + A `None` `input_dimension` marks a correlated map, so any such map routes the + whole transform through the correlated intersection. + + Returns `None` if the intersection is empty. + """ + if output_domain.ndim != transform.output_rank: + raise ValueError( + f"output_domain rank ({output_domain.ndim}) != " + f"transform output rank ({transform.output_rank})" + ) + + correlated_dims = [ + i + for i, m in enumerate(transform.output) + if isinstance(m, ArrayMap) and m.input_dimension is None + ] + if len(correlated_dims) > 0: + return _intersect_correlated(transform, output_domain, correlated_dims) + return _intersect_orthogonal(transform, output_domain) + + +def _intersect_dimension_map( + m: DimensionMap, input_lo: int, input_hi: int, lo: int, hi: int +) -> tuple[int, int] | None: + """Narrow a DimensionMap's input range to storage coordinates in `[lo, hi)`. + + `input_lo`/`input_hi` are the current (possibly already narrowed) input + range for the map's axis. Returns the new `(input_lo, input_hi)` or `None` + if no input produces an in-bounds storage coordinate. + """ + if input_lo >= input_hi: + return None + if m.stride > 0: + new_input_lo = max(input_lo, math.ceil((lo - m.offset) / m.stride)) + new_input_hi = min(input_hi, math.ceil((hi - m.offset) / m.stride)) + elif m.stride < 0: + new_input_lo = max(input_lo, math.ceil((hi - 1 - m.offset) / m.stride)) + new_input_hi = min(input_hi, math.ceil((lo - 1 - m.offset) / m.stride)) + else: + if lo <= m.offset < hi: + new_input_lo, new_input_hi = input_lo, input_hi + else: + return None + if new_input_lo >= new_input_hi: + return None + return new_input_lo, new_input_hi + + +def _intersect_orthogonal( + transform: IndexTransform, output_domain: IndexDomain +) -> ( + tuple[ + IndexTransform, + dict[int, np.ndarray[Any, np.dtype[np.intp]]] | np.ndarray[Any, np.dtype[np.intp]] | None, + ] + | None +): + """Intersect a transform with no correlated ArrayMaps. + + Every output dimension is intersected independently. Multiple ArrayMaps bound + to distinct input dimensions form an outer product, so each array's surviving + *output* positions are tracked separately. + """ + new_min = list(transform.domain.inclusive_min) + new_max = list(transform.domain.exclusive_max) + new_output: list[OutputIndexMap] = [] + out_positions: dict[int, np.ndarray[Any, np.dtype[np.intp]]] = {} + + for out_dim, m in enumerate(transform.output): + lo = output_domain.inclusive_min[out_dim] + hi = output_domain.exclusive_max[out_dim] + + if isinstance(m, ConstantMap): + if lo <= m.offset < hi: + new_output.append(m) + else: + return None + + elif isinstance(m, DimensionMap): + d = m.input_dimension + narrowed = _intersect_dimension_map(m, new_min[d], new_max[d], lo, hi) + if narrowed is None: + return None + new_min[d], new_max[d] = narrowed + new_output.append(m) + + else: + # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + # Orthogonal: the array varies over a single axis (its dependency + # axis, or `input_dimension` for a degenerate length-1 array). Filter + # along that axis and keep the array at full input rank so the + # singleton axes it broadcasts over are preserved. + d = _array_map_dependent_axis(m) + storage = m.offset + m.stride * m.index_array + mask = (storage >= lo) & (storage < hi) + # The array is singleton on every axis but `d`, so its mask reduces + # to a 1-D vector along `d`. + survivors = np.nonzero(mask.reshape(-1))[0].astype(np.intp) + if survivors.size == 0: + return None + filtered = np.take(m.index_array, survivors, axis=d) + new_output.append( + ArrayMap( + index_array=np.asarray(filtered, dtype=np.intp), + offset=m.offset, + stride=m.stride, + input_dimension=m.input_dimension, + ) + ) + new_max[d] = new_min[d] + int(survivors.size) + out_positions[out_dim] = survivors + + new_domain = IndexDomain( + inclusive_min=tuple(new_min), + exclusive_max=tuple(new_max), + ) + result = IndexTransform(domain=new_domain, output=tuple(new_output)) + + # Hand back the surviving output positions in the shape the bridge expects: + # None (no arrays), a single vector (one array), or a per-output-dim dict + # (>= 2 orthogonal arrays → outer product). + out_indices: ( + dict[int, np.ndarray[Any, np.dtype[np.intp]]] | np.ndarray[Any, np.dtype[np.intp]] | None + ) + if len(out_positions) == 0: + out_indices = None + elif len(out_positions) == 1: + out_indices = next(iter(out_positions.values())) + else: + out_indices = out_positions + return (result, out_indices) + + +def _intersect_correlated( + transform: IndexTransform, + output_domain: IndexDomain, + correlated_dims: list[int], +) -> tuple[IndexTransform, np.ndarray[Any, np.dtype[np.intp]]] | None: + """Intersect a correlated (vindex) transform with an output domain. + + The correlated ArrayMaps share their broadcast (dependency) axes; a broadcast + point survives only if ALL its storage coordinates fall within the output + domain. Residual DimensionMap dimensions are intersected independently (as in + the orthogonal case) and preserved, so a partial vindex — e.g. two coordinate + arrays over a 3-D array, leaving one slice dimension — resolves correctly. + + The surviving broadcast axes collapse to a single axis; the returned + `out_indices` is the flat scatter index into the (row-major flattened) + output buffer, of shape `(surviving_points,) + (residual slice sizes)`. + """ + corr_maps = [cast("ArrayMap", transform.output[i]) for i in correlated_dims] + + # Mixing correlated and orthogonal ArrayMaps in one transform is not produced + # by any single selection and is not supported here. + orthogonal_array_dims = [ + i + for i, m in enumerate(transform.output) + if isinstance(m, ArrayMap) and m.input_dimension is not None + ] + if len(orthogonal_array_dims) > 0: + raise NotImplementedError( + "intersecting a transform with both correlated and orthogonal " + "ArrayMaps is not supported" + ) + + # The broadcast (dependency) axes are shared by every correlated map; they are + # the leading axes of the domain, followed by the residual slice axes. + broadcast_axes = _array_map_dependency_axes(corr_maps[0].index_array) + broadcast_shape = tuple(corr_maps[0].index_array.shape[a] for a in broadcast_axes) + + # Joint bounds mask over the broadcast block. + combined: np.ndarray[Any, np.dtype[np.bool_]] | None = None + for out_dim in correlated_dims: + cm = cast("ArrayMap", transform.output[out_dim]) + storage = cm.offset + cm.stride * cm.index_array + lo = output_domain.inclusive_min[out_dim] + hi = output_domain.exclusive_max[out_dim] + mask = (storage >= lo) & (storage < hi) + combined = mask if combined is None else (combined & mask) + assert combined is not None + # The correlated maps are singleton on every non-broadcast axis, so the mask + # collapses (C-order) to the broadcast block. + combined_bcast = combined.reshape(broadcast_shape) + surviving = np.nonzero(combined_bcast.reshape(-1))[0].astype(np.intp) + if surviving.size == 0: + return None + + # Intersect residual (slice / constant) dimensions independently. Slice dims + # are ordered by input dimension so their flat-buffer strides are row-major. + slice_dims: list[tuple[int, int, int, int, DimensionMap]] = [] # (in_dim, lo, hi, full, m) + for out_dim, m in enumerate(transform.output): + if out_dim in correlated_dims: + continue + lo = output_domain.inclusive_min[out_dim] + hi = output_domain.exclusive_max[out_dim] + if isinstance(m, ConstantMap): + if not (lo <= m.offset < hi): + return None + elif isinstance(m, DimensionMap): + d = m.input_dimension + input_lo = transform.domain.inclusive_min[d] + input_hi = transform.domain.exclusive_max[d] + narrowed = _intersect_dimension_map(m, input_lo, input_hi, lo, hi) + if narrowed is None: + return None + slice_dims.append((d, narrowed[0], narrowed[1], input_hi - input_lo, m)) + slice_dims.sort(key=lambda item: item[0]) + + n_points = int(surviving.size) + n_slice = len(slice_dims) + corr_values = { + out_dim: cast("ArrayMap", transform.output[out_dim]) + .index_array.reshape(broadcast_shape) + .reshape(-1)[surviving] + for out_dim in correlated_dims + } + + # New domain: the collapsed broadcast axis, then one axis per residual slice. + new_min = [0] + new_max = [n_points] + new_input_dim_of = {} + for new_axis, (d, nlo, nhi, _full, _m) in enumerate(slice_dims, start=1): + new_min.append(nlo) + new_max.append(nhi) + new_input_dim_of[d] = new_axis + new_domain = IndexDomain(inclusive_min=tuple(new_min), exclusive_max=tuple(new_max)) + + corr_shape = (n_points,) + (1,) * n_slice + new_output: list[OutputIndexMap] = [] + for out_dim, m in enumerate(transform.output): + if out_dim in correlated_dims: + corr = cast("ArrayMap", m) + new_output.append( + ArrayMap( + index_array=corr_values[out_dim].reshape(corr_shape).astype(np.intp), + offset=corr.offset, + stride=corr.stride, + ) + ) + elif isinstance(m, ConstantMap): + new_output.append(m) + else: + assert isinstance(m, DimensionMap) + new_output.append( + DimensionMap( + input_dimension=new_input_dim_of[m.input_dimension], + offset=m.offset, + stride=m.stride, + ) + ) + result = IndexTransform(domain=new_domain, output=tuple(new_output)) + + # Flat scatter index into the row-major output buffer of shape + # (broadcast points, residual slice sizes...): flat = point * prod(slice) + + # (row-major offset within the slice block). + prod_slice = 1 + for _d, _lo, _hi, full, _m in slice_dims: + prod_slice *= full + out_indices: np.ndarray[Any, np.dtype[np.intp]] = (surviving * prod_slice).reshape( + (n_points,) + (1,) * n_slice + ) + running = 1 + for j in range(n_slice - 1, -1, -1): + _d, nlo, nhi, full, _m = slice_dims[j] + coords = np.arange(nlo, nhi, dtype=np.intp) * running + shape = [1] * (1 + n_slice) + shape[1 + j] = coords.size + out_indices = out_indices + coords.reshape(shape) + running *= full + return (result, out_indices.astype(np.intp)) + + +def _normalize_basic_selection(selection: Any, ndim: int) -> tuple[int | slice | None, ...]: + """Normalize a selection to a tuple of int, slice, or None (newaxis), + expanding ellipsis and padding with slice(None) as needed. + """ + if not isinstance(selection, tuple): + selection = (selection,) + + # Count non-newaxis, non-ellipsis entries to determine how many real dims are addressed + n_newaxis = sum(1 for s in selection if s is None) + has_ellipsis = any(s is Ellipsis for s in selection) + n_real = len(selection) - n_newaxis - (1 if has_ellipsis else 0) + + if n_real > ndim: + raise IndexError( + f"too many indices for array: array has {ndim} dimensions, but {n_real} were indexed" + ) + + result: list[int | slice | None] = [] + ellipsis_seen = False + for sel in selection: + if sel is Ellipsis: + if ellipsis_seen: + raise IndexError("an index can only have a single ellipsis ('...')") + ellipsis_seen = True + num_missing = ndim - n_real + result.extend([slice(None)] * num_missing) + elif isinstance(sel, (int, np.integer)): + result.append(int(sel)) + elif isinstance(sel, slice) or sel is None: + result.append(sel) + else: + raise IndexError(f"unsupported selection type for basic indexing: {type(sel)!r}") + + # Pad remaining dimensions with slice(None) + while sum(1 for s in result if s is not None) < ndim: + result.append(slice(None)) + + return tuple(result) + + +def _reindex_array( + m: ArrayMap, + normalized: tuple[int | slice | None, ...], + domain: IndexDomain, +) -> np.ndarray[Any, np.dtype[np.intp]]: + """Apply basic indexing operations to an ArrayMap's index_array. + + The array's axes correspond to the transform's input dimensions (0-indexed + over the domain shape). Each axis is either a **dependency axis** — the array + genuinely varies with that input dimension — or a **singleton** axis it + broadcasts over. Integer indexing, slicing, or newaxis is applied to the + array only along its dependency axes; a selection on a singleton axis does not + touch the array's values (it just narrows or drops that broadcast axis). + """ + dependent = set(_array_map_dependency_axes(m.index_array)) + if m.input_dimension is not None: + # Degenerate length-1 orthogonal selection: the recorded axis is a + # dependency even though its size (1) makes it look singleton. + dependent.add(m.input_dimension) + arr = m.index_array + + # Build a numpy indexing tuple: one entry per old input dimension + idx: list[Any] = [] + old_dim = 0 + newaxis_positions: list[int] = [] + result_axis = 0 + + for sel in normalized: + if sel is None: + newaxis_positions.append(result_axis) + result_axis += 1 + elif isinstance(sel, int): + if old_dim < arr.ndim: + if old_dim in dependent: + # Convert absolute domain coordinate to 0-based array index + idx.append(sel - domain.inclusive_min[old_dim]) + else: + # Broadcast axis: keep the single element and drop the axis. + idx.append(0) + old_dim += 1 + else: + # sel: slice (normalized: tuple[int | slice | None, ...]) + if old_dim < arr.ndim: + if old_dim in dependent: + lo = domain.inclusive_min[old_dim] + hi = domain.exclusive_max[old_dim] + # Bounds are literal domain coordinates; the stored array is + # indexed positionally, so shift by the domain origin. + start, step, _origin, size = _resolve_slice_ts(sel, old_dim, lo, hi) + pos = start - lo + idx.append(slice(pos, pos + size * step, step)) + else: + # Broadcast axis: preserve the singleton (it still broadcasts + # over the narrowed domain), regardless of the slice bounds. + idx.append(slice(None)) + old_dim += 1 + result_axis += 1 + + result = arr[tuple(idx)] if idx else arr + + for pos in newaxis_positions: + result = np.expand_dims(result, axis=pos) + + return np.asarray(result, dtype=np.intp) + + +_FANCY_AFTER_FANCY_MSG = ( + "applying a fancy (orthogonal/vectorized) selection to a view that already " + "has a fancy-indexed axis is not supported (fancy-after-fancy composition): " + "the new coordinates would index a broadcast axis of the existing selection. " + "Materialize the view first with `.result()` and index the array, or reorder " + "the selections so the fancy step is applied last." +) + + +def _guard_fancy_after_fancy(m: ArrayMap, fancy_dims: set[int] | list[int]) -> None: + """Reject a fancy step that lands on a broadcast axis of an existing ArrayMap. + + A new orthogonal/vectorized selection can only be absorbed into an existing + ArrayMap along the axes that map genuinely varies over (its dependency axes, + plus the recorded `input_dimension` for a degenerate length-1 orthogonal + selection). A fancy index targeting any other axis — a singleton axis the map + merely broadcasts over — cannot be reindexed and used to leak a raw NumPy + `IndexError` at resolve time. Raise a clear `NotImplementedError` instead. + """ + dependent = set(_array_map_dependency_axes(m.index_array)) + if m.input_dimension is not None: + dependent.add(m.input_dimension) + for d in fancy_dims: + if d < m.index_array.ndim and d not in dependent: + raise NotImplementedError(_FANCY_AFTER_FANCY_MSG) + + +def _reindex_array_oindex( + arr: np.ndarray[Any, np.dtype[np.intp]], + normalized: tuple[Any, ...] | list[Any], + domain: IndexDomain, +) -> np.ndarray[Any, np.dtype[np.intp]]: + """Apply oindex/vindex selection to an existing ArrayMap's index_array. + + Each old input dimension gets either an array (fancy index that axis) + or a slice applied to the corresponding array axis. + """ + idx: list[Any] = [] + for old_dim, sel in enumerate(normalized): + if old_dim >= arr.ndim: + break + lo = domain.inclusive_min[old_dim] + if isinstance(sel, np.ndarray): + # Values are literal domain coordinates; the stored array is + # indexed positionally, so shift by the domain origin. + idx.append(sel - lo) + elif isinstance(sel, slice): + hi = domain.exclusive_max[old_dim] + start, step, _origin, size = _resolve_slice_ts(sel, old_dim, lo, hi) + pos = start - lo + idx.append(slice(pos, pos + size * step, step)) + else: + idx.append(slice(None)) + + result = arr[tuple(idx)] if idx else arr + return np.asarray(result, dtype=np.intp) + + +def _apply_basic_indexing(transform: IndexTransform, selection: Any) -> IndexTransform: + """Apply basic indexing (int, slice, ellipsis, newaxis) to an IndexTransform.""" + normalized = _normalize_basic_selection(selection, transform.domain.ndim) + + new_inclusive_min: list[int] = [] + new_exclusive_max: list[int] = [] + old_dim = 0 + new_dim_idx = 0 + old_to_new_dim: dict[int, int] = {} + dropped_dims: set[int] = set() + + # Per old-dim: the slice parameters (for computing new output maps) + dim_slice_params: dict[int, tuple[int, int, int]] = {} # old_dim -> (start, stop, step) + dim_int_val: dict[int, int] = {} # old_dim -> integer index value + + for sel in normalized: + if sel is None: + # newaxis: add a size-1 dimension + new_inclusive_min.append(0) + new_exclusive_max.append(1) + new_dim_idx += 1 + elif isinstance(sel, int): + # Integer index: drop this input dimension. + # Negative indices are literal coordinates (TensorStore convention), + # NOT "from the end" like NumPy. The Array layer handles conversion. + lo = transform.domain.inclusive_min[old_dim] + hi = transform.domain.exclusive_max[old_dim] + idx = sel + if idx < lo or idx >= hi: + hint = _LITERAL_HINT if sel < 0 else "" + raise BoundsCheckError( + f"index {sel} is out of bounds for dimension {old_dim} " + f"(valid indices [{lo}, {hi})){hint}" + ) + dropped_dims.add(old_dim) + dim_int_val[old_dim] = idx + old_dim += 1 + else: + # sel: slice (normalized: tuple[int | slice | None, ...]) + lo = transform.domain.inclusive_min[old_dim] + hi = transform.domain.exclusive_max[old_dim] + + # TensorStore semantics: bounds are literal coordinates; a step-1 + # slice keeps them as the new domain, a strided slice's domain is + # [trunc(start/step), trunc(start/step) + size). + start, step, origin, size = _resolve_slice_ts(sel, old_dim, lo, hi) + new_inclusive_min.append(origin) + new_exclusive_max.append(origin + size) + dim_slice_params[old_dim] = (start, step, origin) + old_to_new_dim[old_dim] = new_dim_idx + new_dim_idx += 1 + old_dim += 1 + + new_domain = IndexDomain( + inclusive_min=tuple(new_inclusive_min), + exclusive_max=tuple(new_exclusive_max), + ) + + # Now update output maps + new_output: list[OutputIndexMap] = [] + for m in transform.output: + if isinstance(m, ConstantMap): + new_output.append(m) + elif isinstance(m, DimensionMap): + d = m.input_dimension + if d in dropped_dims: + # Integer index: this output becomes constant + new_offset = m.offset + m.stride * dim_int_val[d] + new_output.append(ConstantMap(offset=new_offset)) + elif d in old_to_new_dim: + # Slice: new coordinate `origin + k` maps to old coordinate + # `start + k*step`, i.e. old = start - step*origin + step*new. + start, step, origin = dim_slice_params[d] + new_offset = m.offset + m.stride * (start - step * origin) + new_stride = m.stride * step + new_input_dim = old_to_new_dim[d] + new_output.append( + DimensionMap( + input_dimension=new_input_dim, offset=new_offset, stride=new_stride + ) + ) + else: + raise RuntimeError(f"unexpected: dimension {d} not handled") + else: + # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + new_arr = _reindex_array(m, normalized, transform.domain) + array_input_dim: int | None = None + if m.input_dimension is not None: + array_input_dim = old_to_new_dim.get(m.input_dimension, m.input_dimension) + new_output.append( + ArrayMap( + index_array=new_arr, + offset=m.offset, + stride=m.stride, + input_dimension=array_input_dim, + ) + ) + + return IndexTransform(domain=new_domain, output=tuple(new_output)) + + +def _array_map_dependency_axes(index_array: np.ndarray[Any, Any]) -> tuple[int, ...]: + """Return the input axes on which a normalized index array varies. + + Normalized `ArrayMap` index arrays carry the full input rank of their + enclosing transform: an axis the array varies over has its full size, while + an axis the array is independent of is a singleton (size 1). The dependency + axes are therefore exactly the non-singleton axes. An orthogonal (`oindex`) + array depends on a single axis; a vectorized (`vindex`) array depends on all + of the (shared) broadcast axes. + """ + return tuple(axis for axis, size in enumerate(index_array.shape) if size != 1) + + +def _array_map_dependent_axis(m: ArrayMap) -> int: + """Return the single input axis an orthogonal `ArrayMap` varies over. + + Normally this is the array's one non-singleton axis. A degenerate length-1 + orthogonal selection normalizes to an all-singleton shape (its dependency + axes are empty and indistinguishable by shape from a scalar), so + `input_dimension` breaks the tie — it records the axis the map binds. + """ + dep = _array_map_dependency_axes(m.index_array) + if len(dep) == 1: + return dep[0] + if m.input_dimension is not None: + return m.input_dimension + raise ValueError( + f"orthogonal ArrayMap must vary over exactly one axis; got dependency " + f"axes {dep} with input_dimension={m.input_dimension}" + ) + + +def _reshape_to_axis( + values: np.ndarray[Any, np.dtype[np.intp]], axis: int, ndim: int +) -> np.ndarray[Any, np.dtype[np.intp]]: + """Reshape a 1-D selection to full rank `ndim` varying only along `axis`. + + The result has `values` laid out along `axis` and singleton (size-1) axes + everywhere else, so its dependency axis is derivable from its shape. + """ + flat = np.asarray(values, dtype=np.intp).ravel() + shape = [1] * ndim + shape[axis] = flat.shape[0] + return flat.reshape(shape) + + +class _OIndexHelper: + """Helper that provides orthogonal (outer) indexing via `transform.oindex[...]`.""" + + def __init__(self, transform: IndexTransform) -> None: + self._transform = transform + + def __getitem__(self, selection: Any) -> IndexTransform: + return _apply_oindex(self._transform, selection) + + +def _normalize_oindex_selection( + selection: Any, ndim: int +) -> tuple[np.ndarray[Any, np.dtype[np.intp]] | slice, ...]: + """Normalize an oindex selection: arrays, slices, booleans, integers.""" + if not isinstance(selection, tuple): + selection = (selection,) + + # Expand ellipsis + has_ellipsis = any(s is Ellipsis for s in selection) + n_ellipsis = 1 if has_ellipsis else 0 + n_real = len(selection) - n_ellipsis + + result: list[np.ndarray[Any, np.dtype[np.intp]] | slice] = [] + for sel in selection: + if sel is Ellipsis: + num_missing = ndim - n_real + result.extend([slice(None)] * num_missing) + elif isinstance(sel, np.ndarray) and sel.dtype == np.bool_: + # Boolean array -> integer indices + (indices,) = np.nonzero(sel) + result.append(indices.astype(np.intp)) + elif isinstance(sel, np.ndarray): + result.append(sel.astype(np.intp)) + elif isinstance(sel, slice): + result.append(sel) + elif isinstance(sel, (int, np.integer)): + # Convert integer scalars to 1-element arrays for orthogonal indexing + result.append(np.array([int(sel)], dtype=np.intp)) + elif isinstance(sel, (list, tuple)): + result.append(np.asarray(sel, dtype=np.intp)) + else: + result.append(sel) + + # Pad with slice(None) + while len(result) < ndim: + result.append(slice(None)) + + return tuple(result) + + +def _apply_oindex(transform: IndexTransform, selection: Any) -> IndexTransform: + """Apply orthogonal indexing to an IndexTransform. + + Each index array is applied independently per dimension (outer product). + """ + normalized = _normalize_oindex_selection(selection, transform.domain.ndim) + + new_inclusive_min: list[int] = [] + new_exclusive_max: list[int] = [] + new_dim_idx = 0 + old_to_new_dim: dict[int, int] = {} + + # Info per old dim + dim_array: dict[int, np.ndarray[Any, np.dtype[np.intp]]] = {} + dim_slice_params: dict[int, tuple[int, int, int]] = {} + + for old_dim, sel in enumerate(normalized): + if isinstance(sel, np.ndarray): + lo = transform.domain.inclusive_min[old_dim] + hi = transform.domain.exclusive_max[old_dim] + # Index-array values are literal domain coordinates; the fancy dim + # they create gets a fresh zero-origin [0, n) domain (TensorStore). + _check_array_in_bounds(sel, lo, hi) + dim_array[old_dim] = sel + new_inclusive_min.append(0) + new_exclusive_max.append(len(sel)) + old_to_new_dim[old_dim] = new_dim_idx + new_dim_idx += 1 + else: + # sel: slice (_normalize_oindex_selection returns + # tuple[np.ndarray | slice, ...]) + lo = transform.domain.inclusive_min[old_dim] + hi = transform.domain.exclusive_max[old_dim] + start, step, origin, size = _resolve_slice_ts(sel, old_dim, lo, hi) + new_inclusive_min.append(origin) + new_exclusive_max.append(origin + size) + dim_slice_params[old_dim] = (start, step, origin) + old_to_new_dim[old_dim] = new_dim_idx + new_dim_idx += 1 + + new_domain = IndexDomain( + inclusive_min=tuple(new_inclusive_min), + exclusive_max=tuple(new_exclusive_max), + ) + + new_output: list[OutputIndexMap] = [] + for m in transform.output: + if isinstance(m, ConstantMap): + new_output.append(m) + elif isinstance(m, DimensionMap): + d = m.input_dimension + if d in dim_array: + new_axis = old_to_new_dim[d] + # Normalize to full input rank: the selection varies along its own + # new axis and is singleton on every other axis. The dependency + # axis is then derivable from the shape (a single non-singleton + # axis marks the selection orthogonal / outer-product rather than + # vectorized). `input_dimension` is kept populated as a + # compatibility shim for consumers not yet migrated to the + # shape-derived classifier. + full_arr = _reshape_to_axis(dim_array[d], new_axis, new_dim_idx) + new_output.append( + ArrayMap( + index_array=full_arr, + offset=m.offset, + stride=m.stride, + input_dimension=new_axis, + ) + ) + elif d in dim_slice_params: + start, step, origin = dim_slice_params[d] + new_offset = m.offset + m.stride * (start - step * origin) + new_stride = m.stride * step + new_input_dim = old_to_new_dim[d] + new_output.append( + DimensionMap( + input_dimension=new_input_dim, offset=new_offset, stride=new_stride + ) + ) + else: + raise RuntimeError(f"unexpected: dimension {d} not handled") + else: + # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + _guard_fancy_after_fancy(m, list(dim_array.keys())) + new_arr = _reindex_array_oindex(m.index_array, normalized, transform.domain) + array_input_dim: int | None = None + if m.input_dimension is not None: + array_input_dim = old_to_new_dim.get(m.input_dimension, m.input_dimension) + new_output.append( + ArrayMap( + index_array=new_arr, + offset=m.offset, + stride=m.stride, + input_dimension=array_input_dim, + ) + ) + + return IndexTransform(domain=new_domain, output=tuple(new_output)) + + +class _VIndexHelper: + """Helper that provides vectorized (fancy) indexing via `transform.vindex[...]`.""" + + def __init__(self, transform: IndexTransform) -> None: + self._transform = transform + + def __getitem__(self, selection: Any) -> IndexTransform: + return _apply_vindex(self._transform, selection) + + +def _apply_vindex(transform: IndexTransform, selection: Any) -> IndexTransform: + """Apply vectorized indexing to an IndexTransform. + + All array indices are broadcast together. Broadcast dimensions are prepended, + followed by non-array (slice) dimensions. + """ + if not isinstance(selection, tuple): + selection = (selection,) + + # Expand ellipsis and count consumed dimensions + # Boolean arrays with ndim > 1 consume ndim dims + n_consumed = 0 + for s in selection: + if s is Ellipsis: + continue + if isinstance(s, np.ndarray) and s.dtype == np.bool_ and s.ndim > 1: + n_consumed += s.ndim + else: + n_consumed += 1 + ndim = transform.domain.ndim + + expanded: list[Any] = [] + for sel in selection: + if sel is Ellipsis: + num_missing = ndim - n_consumed + expanded.extend([slice(None)] * num_missing) + else: + expanded.append(sel) + # Count dimensions already consumed by expanded entries + n_expanded_dims = 0 + for sel in expanded: + if isinstance(sel, np.ndarray) and sel.dtype == np.bool_ and sel.ndim > 1: + n_expanded_dims += sel.ndim + else: + n_expanded_dims += 1 + while n_expanded_dims < ndim: + expanded.append(slice(None)) + n_expanded_dims += 1 + + # Convert booleans, lists, ints to integer arrays + processed: list[np.ndarray[Any, np.dtype[np.intp]] | slice] = [] + for sel in expanded: + if isinstance(sel, np.ndarray) and sel.dtype == np.bool_: + indices_tuple = np.nonzero(sel) + processed.extend(indices.astype(np.intp) for indices in indices_tuple) + elif isinstance(sel, np.ndarray): + processed.append(sel.astype(np.intp)) + elif isinstance(sel, (list, tuple)): + processed.append(np.asarray(sel, dtype=np.intp)) + elif isinstance(sel, (int, np.integer)): + processed.append(np.array([int(sel)], dtype=np.intp)) + else: + processed.append(sel) + + # Separate array dims and slice dims + array_dims: list[int] = [] + slice_dims: list[int] = [] + arrays: list[np.ndarray[Any, np.dtype[np.intp]]] = [] + + for i, sel in enumerate(processed): + if isinstance(sel, np.ndarray): + lo = transform.domain.inclusive_min[i] + hi = transform.domain.exclusive_max[i] + _check_array_in_bounds(sel, lo, hi) + array_dims.append(i) + arrays.append(sel) + else: + slice_dims.append(i) + + # Broadcast all arrays together + broadcast_arrays: list[np.ndarray[Any, np.dtype[np.intp]]] + if len(arrays) > 0: + broadcast_arrays = list(np.broadcast_arrays(*arrays)) + broadcast_shape = broadcast_arrays[0].shape + else: + broadcast_arrays = [] + broadcast_shape = () + + # Build new domain: broadcast dims first, then slice dims + new_inclusive_min: list[int] = [] + new_exclusive_max: list[int] = [] + + # Broadcast dimensions + for s in broadcast_shape: + new_inclusive_min.append(0) + new_exclusive_max.append(s) + + # Slice dimensions (preserved-domain literal semantics, like basic indexing) + slice_dim_params: dict[int, tuple[int, int, int]] = {} + for old_dim in slice_dims: + sel = processed[old_dim] + assert isinstance(sel, slice) + lo = transform.domain.inclusive_min[old_dim] + hi = transform.domain.exclusive_max[old_dim] + start, step, origin, size = _resolve_slice_ts(sel, old_dim, lo, hi) + new_inclusive_min.append(origin) + new_exclusive_max.append(origin + size) + slice_dim_params[old_dim] = (start, step, origin) + + new_domain = IndexDomain( + inclusive_min=tuple(new_inclusive_min), + exclusive_max=tuple(new_exclusive_max), + ) + + # Build output maps + array_dim_to_broadcast: dict[int, np.ndarray[Any, np.dtype[np.intp]]] = {} + for i, d in enumerate(array_dims): + array_dim_to_broadcast[d] = broadcast_arrays[i] + + # New dim index for slice dims starts after broadcast dims + n_broadcast_dims = len(broadcast_shape) + + new_output: list[OutputIndexMap] = [] + for m in transform.output: + if isinstance(m, ConstantMap): + new_output.append(m) + elif isinstance(m, DimensionMap): + d = m.input_dimension + if d in array_dim_to_broadcast: + # Normalize to full input rank: the broadcast (correlated) axes + # come first, followed by a singleton axis per slice dimension. + # Every vectorized array shares the same broadcast axes, so the + # dependency axes derived from the shape coincide — the signature + # of a pointwise scatter rather than an outer product. + broadcast_arr = array_dim_to_broadcast[d] + full_arr = broadcast_arr.reshape(broadcast_shape + (1,) * len(slice_dims)) + new_output.append( + ArrayMap( + index_array=full_arr, + offset=m.offset, + stride=m.stride, + ) + ) + else: + # Slice dim: new coord `origin + k` maps to old `start + k*step` + start, step, origin = slice_dim_params[d] + new_offset = m.offset + m.stride * (start - step * origin) + new_stride = m.stride * step + new_input_dim = n_broadcast_dims + slice_dims.index(d) + new_output.append( + DimensionMap( + input_dimension=new_input_dim, offset=new_offset, stride=new_stride + ) + ) + else: + # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + _guard_fancy_after_fancy(m, array_dims) + new_arr = _reindex_array_oindex(m.index_array, processed, transform.domain) + new_output.append( + ArrayMap( + index_array=new_arr, + offset=m.offset, + stride=m.stride, + input_dimension=m.input_dimension, + ) + ) + + return IndexTransform(domain=new_domain, output=tuple(new_output)) + + +_LITERAL_HINT = ( + "; within this transform layer, indices are literal domain coordinates (the " + "public Array boundary wraps NumPy-style negatives before they reach here)" +) + + +def _trunc_div(a: int, b: int) -> int: + """Integer division rounded toward zero (C semantics), as TensorStore uses + for strided-slice domain origins — distinct from Python's floor division + for negative operands (`trunc(-9/2) == -4` where `-9 // 2 == -5`).""" + q = a // b + if q < 0 and q * b != a: + q += 1 + return q + + +def _resolve_slice_ts(sel: slice, dim: int, lo: int, hi: int) -> tuple[int, int, int, int]: + """Resolve a slice against domain `[lo, hi)` with TensorStore semantics. + + Slice bounds are **literal domain coordinates** — never from-the-end, never + clamped. Rules (each verified against tensorstore 0.1.84): + + - defaults: `start = lo`, `stop = hi`; + - a non-empty interval must be contained in the domain (no clamping — a + NumPy-style out-of-range or negative bound is an error, not a shorter or + wrapped result); + - an **empty** interval (`start == stop`) is valid anywhere; + - reversed bounds (`start > stop` with positive step) are an error, not + an empty result; + - the result's domain origin is `trunc(start/step)` (rounded toward + zero) and coordinate `origin + k` maps to input `start + k*step`. + + Returns `(start, step, origin, size)` in domain coordinates. + """ + step = 1 if sel.step is None else sel.step + if step <= 0: + # Negative steps are valid in TensorStore but not yet supported here; + # step 0 is invalid everywhere. + raise IndexError("slice step must be positive") + start = lo if sel.start is None else sel.start + stop = hi if sel.stop is None else sel.stop + if stop < start: + raise IndexError( + f"slice interval [{start}, {stop}) with step {step} does not specify " + f"a valid interval for dimension {dim} (start > stop)" + ) + size = -(-(stop - start) // step) # ceil((stop - start) / step) + if size > 0 and (start < lo or stop > hi): + hint = _LITERAL_HINT if (start < 0 or stop < 0) and lo >= 0 else "" + raise BoundsCheckError( + f"slice interval [{start}, {stop}) is not contained within domain " + f"[{lo}, {hi}) for dimension {dim}{hint}" + ) + origin = _trunc_div(start, step) + return start, step, origin, size + + +def _check_array_in_bounds(arr: np.ndarray[Any, np.dtype[np.intp]], lo: int, hi: int) -> None: + """Reject index-array values outside the domain `[lo, hi)`. + + Index-array values are literal domain coordinates (TensorStore semantics): + a value below `inclusive_min` is out of bounds rather than counting from + the end. Out-of-range values raise instead of silently wrapping. + """ + if arr.size == 0: + return + lo_val, hi_val = int(arr.min()), int(arr.max()) + if lo_val < lo: + hint = _LITERAL_HINT if lo_val < 0 and lo >= 0 else "" + raise BoundsCheckError( + f"index {lo_val} is out of bounds (valid indices [{lo}, {hi})){hint}" + ) + if hi_val >= hi: + raise BoundsCheckError(f"index {hi_val} is out of bounds (valid indices [{lo}, {hi}))") + + +def _validate_array_selection(selection: Any, shape: tuple[int, ...], mode: str) -> None: + """Validate array-based selections (orthogonal, vectorized). + + Rejects types that are not valid for coordinate/vectorized indexing. + Does not check bounds — the transform operations handle that. + """ + items = selection if isinstance(selection, tuple) else (selection,) + for sel in items: + if isinstance(sel, slice): + # vindex is coordinate-only (matches eager zarr): every axis needs an + # integer/boolean array, never a slice. Orthogonal (oindex) allows slices. + if mode == "vectorized": + raise VindexInvalidSelectionError( + "unsupported selection type for vectorized indexing; only " + "coordinate selection (tuple of integer arrays) and mask selection " + f"(single Boolean array) are supported; got {selection!r}" + ) + continue + if sel is Ellipsis or isinstance(sel, (int, np.integer)): + continue + if isinstance(sel, (list, np.ndarray)): + continue + raise IndexError(f"unsupported selection type for {mode} indexing: {type(sel)!r}") + + +def _validate_basic_selection(selection: Any) -> None: + """Validate that a selection only contains basic indexing types (int, slice, Ellipsis). + + Rejects None (newaxis), arrays, lists, floats, strings, etc. + """ + items = selection if isinstance(selection, tuple) else (selection,) + for s in items: + if s is Ellipsis or isinstance(s, (int, np.integer, slice)): + continue + raise IndexError(f"unsupported selection type for basic indexing: {type(s)!r}") + + +def selection_to_transform( + selection: Any, + transform: IndexTransform, + mode: Literal["basic", "orthogonal", "vectorized"], +) -> IndexTransform: + """Convert a user selection into a composed IndexTransform. + + Negative indices are treated as literal coordinates (TensorStore convention). + The caller (Array layer) is responsible for converting numpy-style negative + indices before calling this function. + """ + if mode == "basic": + _validate_basic_selection(selection) + return transform[selection] + elif mode == "orthogonal": + _validate_array_selection(selection, transform.domain.shape, mode) + return transform.oindex[selection] + elif mode == "vectorized": + _validate_array_selection(selection, transform.domain.shape, mode) + return transform.vindex[selection] + else: + raise ValueError(f"Unknown mode: {mode!r}") diff --git a/packages/zarr-indexing/tests/conformance/PROVENANCE.md b/packages/zarr-indexing/tests/conformance/PROVENANCE.md new file mode 100644 index 0000000000..0a6faef60b --- /dev/null +++ b/packages/zarr-indexing/tests/conformance/PROVENANCE.md @@ -0,0 +1,20 @@ +# Provenance of the ndsel conformance corpus + +The JSON fixtures in this directory (`point.json`, `box.json`, `slice.json`, +`points.json`, `transform.json`, `errors.json`) and `README.md` are **vendored, +unmodified**, from the ndsel reference repository. + +- **Source:** +- **Branch:** `main` (merge of d-v-b/ndsel#1, `fix/slice-origin-trunc`) +- **Commit:** `c59bc556c` (fixtures byte-identical to the previously vendored + `c132b4c1caa3205830ce35a42502363171f650a7`) +- **Path in source:** `conformance/` + +**Do not edit these files.** They are vendored as-is so that +`zarr_indexing`' ndsel message layer can be checked against the same +language-agnostic corpus every other ndsel implementation runs. To update the +corpus, re-vendor from a newer ndsel commit and update the commit SHA above. + +ndsel PR #1 (merged) corrected the `slice` desugaring origin from +`floor(a/s)` to `trunc(a/s)` (rounding toward zero), which matches +`zarr_indexing`' existing `_trunc_div` semantics. diff --git a/packages/zarr-indexing/tests/conformance/README.md b/packages/zarr-indexing/tests/conformance/README.md new file mode 100644 index 0000000000..ecb0c57ca2 --- /dev/null +++ b/packages/zarr-indexing/tests/conformance/README.md @@ -0,0 +1,16 @@ +# ndsel conformance corpus + +Language-agnostic fixtures. Each file is a JSON array of cases. + +A **success** case: + { "name": "...", "input": , "normalized": } + +An **error** case: + { "name": "...", "input": , "error": "" } + +An implementation is conformant iff, for every success case, +`normalize(input)` equals `normalized` by structural JSON equality, and for +every error case, `normalize(input)` is rejected with the given reason code. + +The `normalized` value is a canonical `transform` body (the `kind` field is +omitted; implementations compare the transform structure). diff --git a/packages/zarr-indexing/tests/conformance/box.json b/packages/zarr-indexing/tests/conformance/box.json new file mode 100644 index 0000000000..e847872f86 --- /dev/null +++ b/packages/zarr-indexing/tests/conformance/box.json @@ -0,0 +1,50 @@ +[ + { + "name": "box/2d-min-max", + "input": { "kind": "box", "inclusive_min": [0, 0], "exclusive_max": [3, 4] }, + "normalized": { + "input_rank": 2, + "input_inclusive_min": [0, 0], + "input_exclusive_max": [3, 4], + "input_labels": ["", ""], + "output": [ + { "offset": 0, "stride": 1, "input_dimension": 0 }, + { "offset": 0, "stride": 1, "input_dimension": 1 } + ] + } + }, + { + "name": "box/shape-only-origin-zero", + "input": { "kind": "box", "shape": [5] }, + "normalized": { + "input_rank": 1, + "input_inclusive_min": [0], + "input_exclusive_max": [5], + "input_labels": [""], + "output": [ { "offset": 0, "stride": 1, "input_dimension": 0 } ] + } + }, + { + "name": "box/inclusive-max", + "input": { "kind": "box", "inclusive_min": [2], "inclusive_max": [9] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [2], "input_exclusive_max": [10], + "input_labels": [""], + "output": [ { "offset": 0, "stride": 1, "input_dimension": 0 } ] + } + }, + { + "name": "box/implicit-and-infinite-bounds", + "input": { "kind": "box", "inclusive_min": [["-inf"], 0], "exclusive_max": [["+inf"], 4], "labels": ["t", ""] }, + "normalized": { + "input_rank": 2, + "input_inclusive_min": [["-inf"], 0], + "input_exclusive_max": [["+inf"], 4], + "input_labels": ["t", ""], + "output": [ + { "offset": 0, "stride": 1, "input_dimension": 0 }, + { "offset": 0, "stride": 1, "input_dimension": 1 } + ] + } + } +] diff --git a/packages/zarr-indexing/tests/conformance/errors.json b/packages/zarr-indexing/tests/conformance/errors.json new file mode 100644 index 0000000000..e5e08bab3c --- /dev/null +++ b/packages/zarr-indexing/tests/conformance/errors.json @@ -0,0 +1,23 @@ +[ + { "name": "error/step-zero", "input": { "kind": "slice", "start": [0], "stop": [4], "step": [0] }, "error": "step_zero" }, + { "name": "error/negative-step", "input": { "kind": "slice", "start": [9], "stop": [0], "step": [-2] }, "error": "negative_step_unsupported" }, + { "name": "error/multiple-upper-bounds", "input": { "kind": "box", "shape": [3], "exclusive_max": [3] }, "error": "multiple_upper_bounds" }, + { "name": "error/rank-mismatch", "input": { "kind": "slice", "start": [0, 0], "stop": [4] }, "error": "rank_mismatch" }, + { "name": "error/unknown-kind", "input": { "kind": "bogus" }, "error": "unknown_kind" }, + { "name": "error/transform-multiple-upper-bounds", "input": { "kind": "transform", "input_shape": [3], "input_exclusive_max": [3] }, "error": "multiple_upper_bounds" }, + { "name": "error/transform-rank-mismatch", "input": { "kind": "transform", "input_rank": 2, "input_inclusive_min": [0] }, "error": "rank_mismatch" }, + { "name": "error/missing-kind", "input": { "coords": [1, 2] }, "error": "invalid_json" }, + { "name": "error/point-missing-coords", "input": { "kind": "point" }, "error": "invalid_json" }, + { "name": "error/point-bool-coord", "input": { "kind": "point", "coords": [true] }, "error": "invalid_json" }, + { "name": "error/slice-missing-stop", "input": { "kind": "slice", "start": [0] }, "error": "invalid_json" }, + { "name": "error/box-non-list-bound", "input": { "kind": "box", "inclusive_min": 5 }, "error": "invalid_json" }, + { "name": "error/points-bool-coord", "input": { "kind": "points", "coords": [[true]] }, "error": "invalid_json" }, + { "name": "error/integer-out-of-i64-range", "input": { "kind": "point", "coords": [99999999999999999999] }, "error": "invalid_json" }, + { "name": "error/box-inverted-bounds", "input": { "kind": "box", "inclusive_min": [5], "exclusive_max": [3] }, "error": "bounds_out_of_order" }, + { "name": "error/box-negative-shape", "input": { "kind": "box", "shape": [-3] }, "error": "bounds_out_of_order" }, + { "name": "error/transform-inverted-bounds", "input": { "kind": "transform", "input_inclusive_min": [0], "input_exclusive_max": [-1] }, "error": "bounds_out_of_order" }, + { "name": "error/output-map-conflict", "input": { "kind": "transform", "output": [{ "input_dimension": 0, "index_array": [1, 2] }] }, "error": "output_map_conflict" }, + { "name": "error/box-unknown-field", "input": { "kind": "box", "shapee": [3] }, "error": "unknown_field" }, + { "name": "error/point-unknown-field", "input": { "kind": "point", "coords": [1], "extra": true }, "error": "unknown_field" }, + { "name": "error/output-map-unknown-field", "input": { "kind": "transform", "output": [{ "offset": 0, "bogus": 1 }] }, "error": "unknown_field" } +] diff --git a/packages/zarr-indexing/tests/conformance/point.json b/packages/zarr-indexing/tests/conformance/point.json new file mode 100644 index 0000000000..99a5ea16d8 --- /dev/null +++ b/packages/zarr-indexing/tests/conformance/point.json @@ -0,0 +1,30 @@ +[ + { + "name": "point/2d", + "input": { "kind": "point", "coords": [4, 7] }, + "normalized": { + "input_rank": 0, + "input_inclusive_min": [], + "input_exclusive_max": [], + "input_labels": [], + "output": [ { "offset": 4 }, { "offset": 7 } ] + } + }, + { + "name": "point/scalar-0d", + "input": { "kind": "point", "coords": [] }, + "normalized": { + "input_rank": 0, "input_inclusive_min": [], "input_exclusive_max": [], + "input_labels": [], "output": [] + } + }, + { + "name": "point/large-i64", + "input": { "kind": "point", "coords": [1152921504606846976] }, + "normalized": { + "input_rank": 0, "input_inclusive_min": [], "input_exclusive_max": [], + "input_labels": [], + "output": [ { "offset": 1152921504606846976 } ] + } + } +] diff --git a/packages/zarr-indexing/tests/conformance/points.json b/packages/zarr-indexing/tests/conformance/points.json new file mode 100644 index 0000000000..1ad92e12b1 --- /dev/null +++ b/packages/zarr-indexing/tests/conformance/points.json @@ -0,0 +1,34 @@ +[ + { + "name": "points/three-2d", + "input": { "kind": "points", "coords": [[1, 10], [2, 20], [3, 30]] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [0], "input_exclusive_max": [3], + "input_labels": [""], + "output": [ + { "offset": 0, "stride": 1, "index_array": [1, 2, 3], "index_array_bounds": ["-inf", "+inf"] }, + { "offset": 0, "stride": 1, "index_array": [10, 20, 30], "index_array_bounds": ["-inf", "+inf"] } + ] + } + }, + { + "name": "points/1d", + "input": { "kind": "points", "coords": [[5], [9], [2]] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [0], "input_exclusive_max": [3], + "input_labels": [""], + "output": [ + { "offset": 0, "stride": 1, "index_array": [5, 9, 2], "index_array_bounds": ["-inf", "+inf"] } + ] + } + }, + { + "name": "points/empty", + "input": { "kind": "points", "coords": [] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [0], "input_exclusive_max": [0], + "input_labels": [""], + "output": [] + } + } +] diff --git a/packages/zarr-indexing/tests/conformance/slice.json b/packages/zarr-indexing/tests/conformance/slice.json new file mode 100644 index 0000000000..2f1a0694ce --- /dev/null +++ b/packages/zarr-indexing/tests/conformance/slice.json @@ -0,0 +1,61 @@ +[ + { + "name": "slice/unit-step-preserves-frame", + "input": { "kind": "slice", "start": [5], "stop": [10] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [5], "input_exclusive_max": [10], + "input_labels": [""], + "output": [ { "offset": 0, "stride": 1, "input_dimension": 0 } ] + } + }, + { + "name": "slice/divisible-stride", + "input": { "kind": "slice", "start": [4], "stop": [10], "step": [2] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [2], "input_exclusive_max": [5], + "input_labels": [""], + "output": [ { "offset": 0, "stride": 2, "input_dimension": 0 } ] + } + }, + { + "name": "slice/nondivisible-stride-phase-offset", + "input": { "kind": "slice", "start": [5], "stop": [10], "step": [2] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [2], "input_exclusive_max": [5], + "input_labels": [""], + "output": [ { "offset": 1, "stride": 2, "input_dimension": 0 } ] + } + }, + { + "name": "slice/2d-mixed-step", + "input": { "kind": "slice", "start": [0, 5], "stop": [10, 10], "step": [2, 1] }, + "normalized": { + "input_rank": 2, + "input_inclusive_min": [0, 5], + "input_exclusive_max": [5, 10], + "input_labels": ["", ""], + "output": [ + { "offset": 0, "stride": 2, "input_dimension": 0 }, + { "offset": 0, "stride": 1, "input_dimension": 1 } + ] + } + }, + { + "name": "slice/negative-start-trunc-origin", + "input": { "kind": "slice", "start": [-9], "stop": [5], "step": [2] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [-4], "input_exclusive_max": [3], + "input_labels": [""], + "output": [ { "offset": -1, "stride": 2, "input_dimension": 0 } ] + } + }, + { + "name": "slice/negative-start-trunc-origin-step3", + "input": { "kind": "slice", "start": [-8], "stop": [6], "step": [3] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [-2], "input_exclusive_max": [3], + "input_labels": [""], + "output": [ { "offset": -2, "stride": 3, "input_dimension": 0 } ] + } + } +] diff --git a/packages/zarr-indexing/tests/conformance/transform.json b/packages/zarr-indexing/tests/conformance/transform.json new file mode 100644 index 0000000000..f26157aaab --- /dev/null +++ b/packages/zarr-indexing/tests/conformance/transform.json @@ -0,0 +1,57 @@ +[ + { + "name": "transform/omitted-output-identity", + "input": { "kind": "transform", "input_inclusive_min": [0, 0], "input_exclusive_max": [3, 4] }, + "normalized": { + "input_rank": 2, "input_inclusive_min": [0, 0], "input_exclusive_max": [3, 4], + "input_labels": ["", ""], + "output": [ + { "offset": 0, "stride": 1, "input_dimension": 0 }, + { "offset": 0, "stride": 1, "input_dimension": 1 } + ] + } + }, + { + "name": "transform/implicit-bounds-and-labels", + "input": { + "kind": "transform", + "input_inclusive_min": [["-inf"], 7], + "input_exclusive_max": [["+inf"], 11], + "input_labels": ["x", "y"] + }, + "normalized": { + "input_rank": 2, + "input_inclusive_min": [["-inf"], 7], + "input_exclusive_max": [["+inf"], 11], + "input_labels": ["x", "y"], + "output": [ + { "offset": 0, "stride": 1, "input_dimension": 0 }, + { "offset": 0, "stride": 1, "input_dimension": 1 } + ] + } + }, + { + "name": "transform/explicit-output-all-three-map-kinds", + "input": { + "kind": "transform", + "input_inclusive_min": [0], + "input_exclusive_max": [3], + "output": [ + { "offset": 7 }, + { "input_dimension": 0, "stride": 2 }, + { "index_array": [1, 2, 3] } + ] + }, + "normalized": { + "input_rank": 1, + "input_inclusive_min": [0], + "input_exclusive_max": [3], + "input_labels": [""], + "output": [ + { "offset": 7 }, + { "offset": 0, "stride": 2, "input_dimension": 0 }, + { "offset": 0, "stride": 1, "index_array": [1, 2, 3], "index_array_bounds": ["-inf", "+inf"] } + ] + } + } +] diff --git a/packages/zarr-indexing/tests/test_chunk_resolution.py b/packages/zarr-indexing/tests/test_chunk_resolution.py new file mode 100644 index 0000000000..0738384e2b --- /dev/null +++ b/packages/zarr-indexing/tests/test_chunk_resolution.py @@ -0,0 +1,521 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +import numpy as np +from zarr.core.chunk_grids import ChunkGrid, FixedDimension, VaryingDimension + +from zarr_indexing import chunk_resolution +from zarr_indexing.chunk_resolution import iter_chunk_transforms, sub_transform_to_selections +from zarr_indexing.domain import IndexDomain +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap +from zarr_indexing.transform import IndexTransform + +if TYPE_CHECKING: + import pytest + + +class TestChunkResolutionIdentity: + def test_single_chunk(self) -> None: + """Array fits in one chunk.""" + t = IndexTransform.from_shape((10,)) + grid = ChunkGrid(dimensions=(FixedDimension(size=10, extent=10),)) + results = list(iter_chunk_transforms(t, grid._dimensions)) + assert len(results) == 1 + coords, sub_t, _ = results[0] + assert coords == (0,) + assert sub_t.domain.shape == (10,) + + def test_multiple_chunks_1d(self) -> None: + """1D array spanning 3 chunks.""" + t = IndexTransform.from_shape((30,)) + grid = ChunkGrid(dimensions=(FixedDimension(size=10, extent=30),)) + results = list(iter_chunk_transforms(t, grid._dimensions)) + assert len(results) == 3 + coords_list = [r[0] for r in results] + assert (0,) in coords_list + assert (1,) in coords_list + assert (2,) in coords_list + + def test_multiple_chunks_2d(self) -> None: + """2D array spanning 2x3 chunks.""" + t = IndexTransform.from_shape((20, 30)) + grid = ChunkGrid( + dimensions=( + FixedDimension(size=10, extent=20), + FixedDimension(size=10, extent=30), + ) + ) + results = list(iter_chunk_transforms(t, grid._dimensions)) + assert len(results) == 6 + coords_list = [r[0] for r in results] + assert (0, 0) in coords_list + assert (1, 2) in coords_list + + +class TestChunkResolutionSliced: + def test_slice_within_chunk(self) -> None: + """Slice that falls within a single chunk.""" + # Chunk resolution consumes zero-origin transforms: the I/O layer + # normalizes preserved (user-facing) domains via translate_domain_to + # before resolving, so mirror that contract here. + t = IndexTransform.from_shape((100,))[5:8].translate_domain_to((0,)) + grid = ChunkGrid(dimensions=(FixedDimension(size=10, extent=100),)) + results = list(iter_chunk_transforms(t, grid._dimensions)) + assert len(results) == 1 + coords, sub_t, _ = results[0] + assert coords == (0,) + assert isinstance(sub_t.output[0], DimensionMap) + assert sub_t.output[0].offset == 5 + + def test_slice_across_chunks(self) -> None: + """Slice that spans two chunks.""" + t = IndexTransform.from_shape((100,))[8:15] + grid = ChunkGrid(dimensions=(FixedDimension(size=10, extent=100),)) + results = list(iter_chunk_transforms(t, grid._dimensions)) + assert len(results) == 2 + coords_list = [r[0] for r in results] + assert (0,) in coords_list + assert (1,) in coords_list + + +class TestChunkResolutionConstant: + def test_integer_index(self) -> None: + """Integer index produces constant map — single chunk per constant dim.""" + t = IndexTransform.from_shape((100, 100))[25, :] + grid = ChunkGrid( + dimensions=( + FixedDimension(size=10, extent=100), + FixedDimension(size=10, extent=100), + ) + ) + results = list(iter_chunk_transforms(t, grid._dimensions)) + assert len(results) == 10 + for coords, _, _ in results: + assert coords[0] == 2 + + +class TestChunkResolutionArray: + def test_array_index(self) -> None: + """Array index map — chunks determined by array values.""" + idx = np.array([5, 15, 25], dtype=np.intp) + t = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(index_array=idx),), + ) + grid = ChunkGrid(dimensions=(FixedDimension(size=10, extent=30),)) + results = list(iter_chunk_transforms(t, grid._dimensions)) + coords_list = [r[0] for r in results] + assert (0,) in coords_list + assert (1,) in coords_list + assert (2,) in coords_list + + +class TestChunkResolutionSorted1D: + def test_matches_general_resolution_for_randomized_sorted_selections( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + """Direct partitioning matches the original resolver across varied inputs.""" + rng = np.random.default_rng(0) + grids = ( + ChunkGrid(dimensions=(FixedDimension(size=7, extent=30),)), + ChunkGrid(dimensions=(VaryingDimension(edges=(3, 4, 8, 5, 10), extent=30),)), + ) + + for grid in grids: + for _ in range(50): + idx = np.sort(rng.integers(0, 30, size=int(rng.integers(1, 80)))).astype(np.intp) + transform = IndexTransform.from_shape((30,)).vindex[idx] + direct = list(iter_chunk_transforms(transform, grid._dimensions)) + + with monkeypatch.context() as context: + context.setattr( + chunk_resolution, + "_one_dimensional_correlated_array_map", + lambda _transform: None, + ) + general = list(iter_chunk_transforms(transform, grid._dimensions)) + + assert [result[0] for result in direct] == [result[0] for result in general] + for direct_result, general_result in zip(direct, general, strict=True): + _, direct_t, direct_out = direct_result + _, general_t, general_out = general_result + assert direct_t.domain == general_t.domain + + direct_chunk_sel, direct_out_sel, direct_drop = sub_transform_to_selections( + direct_t, direct_out + ) + general_chunk_sel, general_out_sel, general_drop = sub_transform_to_selections( + general_t, general_out + ) + assert direct_drop == general_drop + np.testing.assert_array_equal(direct_chunk_sel[0], general_chunk_sel[0]) + np.testing.assert_array_equal(direct_out_sel[0], general_out_sel[0]) + + def test_sorted_vindex_partitions_chunks_without_intersection( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + """Sorted vectorized coordinates are sliced directly per touched chunk.""" + idx = np.array([0, 3, 4, 4, 9, 11], dtype=np.intp) + t = IndexTransform.from_shape((12,)).vindex[idx] + grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=12),)) + + calls = _count_intersect_calls(monkeypatch) + results = list(iter_chunk_transforms(t, grid._dimensions)) + + assert [result[0] for result in results] == [(0,), (1,), (2,)] + assert calls["n"] == 0 + + expected_chunk_indices = ([0, 3], [0, 0], [1, 3]) + expected_out_indices = ([0, 1], [2, 3], [4, 5]) + for result, expected_chunk, expected_out in zip( + results, expected_chunk_indices, expected_out_indices, strict=True + ): + _, sub_t, out_indices = result + chunk_sel, out_sel, drop_axes = sub_transform_to_selections(sub_t, out_indices) + np.testing.assert_array_equal(chunk_sel[0], expected_chunk) + np.testing.assert_array_equal(out_sel[0], expected_out) + assert drop_axes == () + + def test_sorted_array_map_preserves_offset_and_stride(self) -> None: + """Storage partitioning retains the ArrayMap's offset and stride.""" + t = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=( + ArrayMap( + index_array=np.array([0, 1, 2], dtype=np.intp), + offset=1, + stride=3, + ), + ), + ) + grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=8),)) + + results = list(iter_chunk_transforms(t, grid._dimensions)) + + assert [result[0] for result in results] == [(0,), (1,)] + expected_chunk_indices = ([1], [0, 3]) + expected_out_indices = ([0], [1, 2]) + for result, expected_chunk, expected_out in zip( + results, expected_chunk_indices, expected_out_indices, strict=True + ): + _, sub_t, out_indices = result + chunk_sel, out_sel, _ = sub_transform_to_selections(sub_t, out_indices) + np.testing.assert_array_equal(chunk_sel[0], expected_chunk) + np.testing.assert_array_equal(out_sel[0], expected_out) + + def test_sorted_vindex_with_varying_chunks(self) -> None: + """Touched-boundary searches also support a non-uniform 1-D grid.""" + idx = np.array([0, 1, 2, 3, 5, 9], dtype=np.intp) + t = IndexTransform.from_shape((10,)).vindex[idx] + grid = ChunkGrid(dimensions=(VaryingDimension(edges=(2, 3, 5), extent=10),)) + + results = list(iter_chunk_transforms(t, grid._dimensions)) + + assert [result[0] for result in results] == [(0,), (1,), (2,)] + expected_chunk_indices = ([0, 1], [0, 1], [0, 4]) + for result, expected_chunk in zip(results, expected_chunk_indices, strict=True): + _, sub_t, out_indices = result + chunk_sel, _, _ = sub_transform_to_selections(sub_t, out_indices) + np.testing.assert_array_equal(chunk_sel[0], expected_chunk) + + def test_sorted_vindex_with_zero_sized_dimension_uses_general_resolution( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + """A zero-sized grid cannot be partitioned by touched boundaries.""" + t = IndexTransform.from_shape((10,)).vindex[np.array([1], dtype=np.intp)] + grid = ChunkGrid(dimensions=(FixedDimension(size=0, extent=10),)) + + calls = _count_intersect_calls(monkeypatch) + results = list(iter_chunk_transforms(t, grid._dimensions)) + + assert results == [] + assert calls["n"] == 1 + + def test_unsorted_vindex_uses_general_resolution(self, monkeypatch: pytest.MonkeyPatch) -> None: + """Unsorted coordinates continue through the general intersection logic.""" + t = IndexTransform.from_shape((12,)).vindex[np.array([9, 0, 4], dtype=np.intp)] + grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=12),)) + + calls = _count_intersect_calls(monkeypatch) + results = list(iter_chunk_transforms(t, grid._dimensions)) + + assert [result[0] for result in results] == [(0,), (1,), (2,)] + assert calls["n"] == 3 + + def test_sorted_oindex_uses_general_resolution(self, monkeypatch: pytest.MonkeyPatch) -> None: + """Orthogonal ArrayMaps retain their existing domain-aware resolution.""" + t = IndexTransform.from_shape((12,)).oindex[np.array([0, 4, 9], dtype=np.intp)] + grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=12),)) + + calls = _count_intersect_calls(monkeypatch) + results = list(iter_chunk_transforms(t, grid._dimensions)) + + assert [result[0] for result in results] == [(0,), (1,), (2,)] + assert calls["n"] == 3 + + +def _count_intersect_calls(monkeypatch: pytest.MonkeyPatch) -> dict[str, int]: + """Wrap `IndexTransform.intersect` with a call counter. + + Returns a mutable dict whose `"n"` entry is the number of times + `intersect` is invoked. Used to assert that candidate-chunk enumeration is + proportional to the *touched* chunks, not the dense bounding box between the + min and max touched chunk. + """ + calls = {"n": 0} + original = IndexTransform.intersect + + def counting(self: IndexTransform, output_domain: IndexDomain) -> object: + calls["n"] += 1 + return original(self, output_domain) + + monkeypatch.setattr(IndexTransform, "intersect", counting) + return calls + + +class TestChunkResolutionTouchedOnly: + """`iter_chunk_transforms` must enumerate only the chunks a fancy selection + actually touches — never the dense `range(min_chunk, max_chunk + 1)` bounding + box. These guard against a regression to bounding-box enumeration, whose cost + scales with grid size rather than with the number of selected coordinates. + """ + + def test_1d_sparse_vindex_enumerates_only_touched_chunks( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + """Two far-apart coordinates on a 1000-chunk grid touch exactly 2 chunks. + + A dense bounding-box enumeration would intersect ~1000 candidate chunks; + touched-only enumeration intersects exactly 2. + """ + # 4000 elements, chunk size 4 -> 1000 chunks. coords 1 and 3997 land in + # chunk 0 and chunk 999 respectively (998 empty chunks between them). + grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=4000),)) + t = IndexTransform.from_shape((4000,)).vindex[np.array([1, 3997], dtype=np.intp)] + + calls = _count_intersect_calls(monkeypatch) + results = list(iter_chunk_transforms(t, grid._dimensions)) + + coords = sorted(r[0] for r in results) + assert coords == [(0,), (999,)] + # Sorted 1-D coordinates are partitioned directly, without intersecting + # either the touched chunks or the 998 empty chunks between them. + assert calls["n"] == 0 + + def test_2d_orthogonal_enumerates_only_touched_chunks( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + """Orthogonal outer product of two 2-coordinate arrays touches 2x2 chunks. + + Per-dimension distinct touched chunks: {0, 999} on each axis. The outer + product is 2*2 = 4 candidate chunks (all survive), versus ~1e6 for a + dense 1000x1000 bounding box. + """ + grid = ChunkGrid( + dimensions=( + FixedDimension(size=4, extent=4000), + FixedDimension(size=4, extent=4000), + ) + ) + t = IndexTransform.from_shape((4000, 4000)).oindex[ + np.array([1, 3997], dtype=np.intp), np.array([2, 3998], dtype=np.intp) + ] + + calls = _count_intersect_calls(monkeypatch) + results = list(iter_chunk_transforms(t, grid._dimensions)) + + coords = sorted(r[0] for r in results) + assert coords == [(0, 0), (0, 999), (999, 0), (999, 999)] + assert calls["n"] == 4 + + def test_2d_correlated_vindex_enumerates_joint_touched_chunks( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + """Two correlated (vindex) coordinate arrays scatter to 2 diagonal chunks. + + The two points (1, 2) and (3997, 3998) touch chunks (0, 0) and + (999, 999). Correlated coordinate arrays are grouped *jointly*, so + enumeration intersects exactly the 2 touched chunks — never the 2x2 + cartesian product of per-dimension distinct chunks, and never the dense + 1e6 grid. + """ + grid = ChunkGrid( + dimensions=( + FixedDimension(size=4, extent=4000), + FixedDimension(size=4, extent=4000), + ) + ) + t = IndexTransform.from_shape((4000, 4000)).vindex[ + np.array([1, 3997], dtype=np.intp), np.array([2, 3998], dtype=np.intp) + ] + + calls = _count_intersect_calls(monkeypatch) + results = list(iter_chunk_transforms(t, grid._dimensions)) + + coords = sorted(r[0] for r in results) + assert coords == [(0, 0), (999, 999)] + assert calls["n"] == 2 + + def test_2d_correlated_vindex_diagonal_is_linear_in_points( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + """A diagonal of P correlated points touches P chunks with O(P) intersections. + + Enumerating the cartesian product of per-dimension distinct chunk sets + would cost P**2 intersections (2500 here) — quadratic in the number of + selected points for the scattered selections of zarr-python gh-4174. + Joint grouping keeps resolution work proportional to the touched chunks. + """ + p = 50 + grid = ChunkGrid( + dimensions=( + FixedDimension(size=4, extent=4000), + FixedDimension(size=4, extent=4000), + ) + ) + # point i lands in chunk (2i, 2i): all per-dimension chunks distinct + coords_1d = np.arange(p, dtype=np.intp) * 8 + t = IndexTransform.from_shape((4000, 4000)).vindex[coords_1d, coords_1d] + + calls = _count_intersect_calls(monkeypatch) + results = list(iter_chunk_transforms(t, grid._dimensions)) + + assert sorted(r[0] for r in results) == [(2 * i, 2 * i) for i in range(p)] + assert calls["n"] == p + + +class TestSubTransformToSelections: + def test_constant_map(self) -> None: + """ConstantMap produces int selection + drop axis.""" + t = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(ConstantMap(offset=5),), + ) + chunk_sel, out_sel, drop_axes = sub_transform_to_selections(t) + assert chunk_sel == (5,) + assert out_sel == () + assert drop_axes == () + + def test_dimension_map_stride_1(self) -> None: + """DimensionMap with stride=1 produces contiguous slice.""" + t = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(DimensionMap(input_dimension=0, offset=3, stride=1),), + ) + chunk_sel, out_sel, drop_axes = sub_transform_to_selections(t) + assert chunk_sel == (slice(3, 13, 1),) + assert out_sel == (slice(0, 10),) + assert drop_axes == () + + def test_dimension_map_strided(self) -> None: + """DimensionMap with stride>1 produces strided slice.""" + t = IndexTransform( + domain=IndexDomain.from_shape((5,)), + output=(DimensionMap(input_dimension=0, offset=2, stride=3),), + ) + chunk_sel, out_sel, drop_axes = sub_transform_to_selections(t) + assert chunk_sel == (slice(2, 17, 3),) + assert out_sel == (slice(0, 5),) + assert drop_axes == () + + def test_array_map(self) -> None: + """ArrayMap produces integer array selection.""" + arr = np.array([1, 5, 9], dtype=np.intp) + t = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(index_array=arr, offset=0, stride=1),), + ) + chunk_sel, out_sel, drop_axes = sub_transform_to_selections(t) + assert isinstance(chunk_sel[0], np.ndarray) + np.testing.assert_array_equal(chunk_sel[0], arr) + # Without chunk_mask, out_sel falls back to domain-based slices + assert out_sel == (slice(0, 3),) + assert drop_axes == () + + def test_array_map_with_offset_stride(self) -> None: + """ArrayMap with offset and stride computes storage coords.""" + arr = np.array([0, 1, 2], dtype=np.intp) + t = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(index_array=arr, offset=10, stride=5),), + ) + chunk_sel, _out_sel, drop_axes = sub_transform_to_selections(t) + assert isinstance(chunk_sel[0], np.ndarray) + np.testing.assert_array_equal(chunk_sel[0], np.array([10, 15, 20])) + assert drop_axes == () + + def test_mixed_maps_2d(self) -> None: + """Mix of ConstantMap and DimensionMap.""" + t = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=( + ConstantMap(offset=5), + DimensionMap(input_dimension=0, offset=0, stride=1), + ), + ) + chunk_sel, _out_sel, drop_axes = sub_transform_to_selections(t) + assert chunk_sel[0] == 5 + assert chunk_sel[1] == slice(0, 10, 1) + # drop_axes is empty — integer in chunk_sel naturally drops the dim via numpy + assert drop_axes == () + + +class TestChunkResolutionArrayMapFlavours: + """Chunk resolution must yield outer-product (np.ix_) selectors for + orthogonal ArrayMaps and shared flat-scatter selectors for correlated ones, + and must return early for empty fancy selections.""" + + def test_empty_array_selection_yields_nothing(self) -> None: + """An empty ArrayMap selection produces no chunk transforms (no crash).""" + t = IndexTransform( + domain=IndexDomain.from_shape((0,)), + output=(ArrayMap(index_array=np.array([], dtype=np.intp)),), + ) + grid = ChunkGrid(dimensions=(FixedDimension(size=3, extent=10),)) + assert list(iter_chunk_transforms(t, grid._dimensions)) == [] + + def test_orthogonal_outer_product_selectors(self) -> None: + """Two independent arrays produce np.ix_-style (mesh) chunk/out selectors.""" + t = IndexTransform.from_shape((10, 10)).oindex[np.array([1, 3]), np.array([2, 4, 6])] + grid = ChunkGrid( + dimensions=(FixedDimension(size=10, extent=10), FixedDimension(size=10, extent=10)) + ) + results = list(iter_chunk_transforms(t, grid._dimensions)) + assert len(results) == 1 + _coords, sub_t, out_indices = results[0] + chunk_sel, out_sel, drop_axes = sub_transform_to_selections(sub_t, out_indices) + # np.ix_ produces one 2-D open-mesh selector per axis, for both sides. + assert len(chunk_sel) == 2 + assert len(out_sel) == 2 + assert isinstance(chunk_sel[0], np.ndarray) + assert isinstance(chunk_sel[1], np.ndarray) + assert chunk_sel[0].shape == (2, 1) + assert chunk_sel[1].shape == (1, 3) + assert drop_axes == () + + def test_correlated_scatter_with_residual_slice(self) -> None: + """Correlated arrays + a residual slice dim scatter through a single flat + index whose shape matches the (points, slice) block read from the chunk.""" + t = IndexTransform.from_shape((4, 3, 5)).vindex[np.array([1, 3]), np.array([2, 0])] + grid = ChunkGrid( + dimensions=( + FixedDimension(size=4, extent=4), + FixedDimension(size=3, extent=3), + FixedDimension(size=5, extent=5), + ) + ) + # One chunk holds everything: both points survive, slice dim spans [0,5). + results = list(iter_chunk_transforms(t, grid._dimensions)) + assert len(results) == 1 + _coords, sub_t, out_indices = results[0] + chunk_sel, out_sel, _drop = sub_transform_to_selections(sub_t, out_indices) + # Chunk side: flat coordinate arrays for the two correlated dims plus a + # slice for the residual dim. + assert len(chunk_sel) == 3 + np.testing.assert_array_equal(np.asarray(chunk_sel[0]), [1, 3]) + np.testing.assert_array_equal(np.asarray(chunk_sel[1]), [2, 0]) + assert chunk_sel[2] == slice(0, 5, 1) + # Output side: a single flat scatter index of shape (points, slice) = (2, 5). + assert len(out_sel) == 1 + assert np.asarray(out_sel[0]).shape == (2, 5) diff --git a/packages/zarr-indexing/tests/test_composition.py b/packages/zarr-indexing/tests/test_composition.py new file mode 100644 index 0000000000..dd92f59b80 --- /dev/null +++ b/packages/zarr-indexing/tests/test_composition.py @@ -0,0 +1,166 @@ +from __future__ import annotations + +import numpy as np +import pytest + +from zarr_indexing.composition import compose +from zarr_indexing.domain import IndexDomain +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap +from zarr_indexing.transform import IndexTransform + + +class TestComposeConstantInner: + """Inner = constant. Result is always constant.""" + + def test_constant_inner_any_outer(self) -> None: + outer = IndexTransform.from_shape((5,)) + inner = IndexTransform( + domain=IndexDomain.from_shape((5,)), + output=(ConstantMap(offset=42),), + ) + result = compose(outer, inner) + assert isinstance(result.output[0], ConstantMap) + assert result.output[0].offset == 42 + + +class TestComposeDimensionInner: + """Inner = DimensionMap.""" + + def test_dimension_inner_constant_outer(self) -> None: + outer = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(ConstantMap(offset=5),), + ) + inner = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(DimensionMap(input_dimension=0, offset=10, stride=3),), + ) + result = compose(outer, inner) + assert isinstance(result.output[0], ConstantMap) + assert result.output[0].offset == 25 + + def test_dimension_inner_dimension_outer(self) -> None: + outer = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(DimensionMap(input_dimension=0, offset=5, stride=2),), + ) + inner = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(DimensionMap(input_dimension=0, offset=10, stride=3),), + ) + result = compose(outer, inner) + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].offset == 25 + assert result.output[0].stride == 6 + assert result.output[0].input_dimension == 0 + + def test_dimension_inner_array_outer(self) -> None: + arr = np.array([0, 2, 4], dtype=np.intp) + outer = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(index_array=arr, offset=5, stride=2),), + ) + inner = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(DimensionMap(input_dimension=0, offset=10, stride=3),), + ) + result = compose(outer, inner) + assert isinstance(result.output[0], ArrayMap) + assert result.output[0].offset == 25 + assert result.output[0].stride == 6 + np.testing.assert_array_equal(result.output[0].index_array, arr) + + +class TestComposeArrayInner: + """Inner = ArrayMap.""" + + def test_array_inner_constant_outer(self) -> None: + inner_arr = np.array([10, 20, 30], dtype=np.intp) + outer = IndexTransform( + domain=IndexDomain.from_shape((5,)), + output=(ConstantMap(offset=1),), + ) + inner = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(index_array=inner_arr, offset=0, stride=1),), + ) + result = compose(outer, inner) + assert isinstance(result.output[0], ConstantMap) + assert result.output[0].offset == 20 + + def test_array_inner_array_outer(self) -> None: + outer_arr = np.array([0, 2, 1], dtype=np.intp) + inner_arr = np.array([10, 20, 30], dtype=np.intp) + outer = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(index_array=outer_arr, offset=0, stride=1),), + ) + inner = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(index_array=inner_arr, offset=0, stride=1),), + ) + result = compose(outer, inner) + assert isinstance(result.output[0], ArrayMap) + expected = np.array([10, 30, 20], dtype=np.intp) + np.testing.assert_array_equal(result.output[0].index_array, expected) + + +class TestComposeMultiDim: + def test_2d_identity_compose(self) -> None: + a = IndexTransform.from_shape((10, 20)) + b = IndexTransform.from_shape((10, 20)) + result = compose(a, b) + assert result.domain.shape == (10, 20) + for i in range(2): + m = result.output[i] + assert isinstance(m, DimensionMap) + assert m.input_dimension == i + assert m.offset == 0 + assert m.stride == 1 + + def test_mixed_map_types(self) -> None: + outer = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=( + ConstantMap(offset=5), + DimensionMap(input_dimension=0, offset=0, stride=1), + ), + ) + inner = IndexTransform( + domain=IndexDomain.from_shape((10, 10)), + output=( + DimensionMap(input_dimension=0, offset=2, stride=3), + DimensionMap(input_dimension=1, offset=0, stride=1), + ), + ) + result = compose(outer, inner) + assert isinstance(result.output[0], ConstantMap) + assert result.output[0].offset == 17 + assert isinstance(result.output[1], DimensionMap) + assert result.output[1].input_dimension == 0 + assert result.output[1].offset == 0 + assert result.output[1].stride == 1 + + def test_rank_mismatch_raises(self) -> None: + outer = IndexTransform.from_shape((10,)) + inner = IndexTransform.from_shape((10, 20)) + with pytest.raises(ValueError, match="rank"): + compose(outer, inner) + + +class TestComposeChain: + def test_three_transforms(self) -> None: + a = IndexTransform.from_shape((100,)) + b = IndexTransform( + domain=IndexDomain.from_shape((100,)), + output=(DimensionMap(input_dimension=0, offset=10, stride=1),), + ) + c = IndexTransform( + domain=IndexDomain.from_shape((100,)), + output=(DimensionMap(input_dimension=0, offset=5, stride=2),), + ) + bc = compose(b, c) + abc = compose(a, bc) + assert isinstance(abc.output[0], DimensionMap) + assert abc.output[0].offset == 25 + assert abc.output[0].stride == 2 diff --git a/packages/zarr-indexing/tests/test_conformance.py b/packages/zarr-indexing/tests/test_conformance.py new file mode 100644 index 0000000000..207a9d8236 --- /dev/null +++ b/packages/zarr-indexing/tests/test_conformance.py @@ -0,0 +1,55 @@ +"""ndsel conformance corpus harness. + +Runs the vendored, language-agnostic ndsel fixtures (see +`tests/conformance/PROVENANCE.md`) against this package's message layer +(`zarr_indexing.messages`). An implementation is conformant iff: + +- for every *success* fixture, `normalize_ndsel(input)` equals the fixture's + `normalized` value by structural JSON equality; +- for every *error* fixture, `normalize_ndsel(input)` is rejected with an + `NdselError` carrying the fixture's `error` reason code. +""" + +from __future__ import annotations + +import json +from pathlib import Path +from typing import Any + +import pytest + +from zarr_indexing.messages import NdselError, normalize_ndsel + +_CONFORMANCE_DIR = Path(__file__).parent / "conformance" + + +def _load_cases() -> list[tuple[str, dict[str, Any]]]: + cases: list[tuple[str, dict[str, Any]]] = [] + for path in sorted(_CONFORMANCE_DIR.glob("*.json")): + data = json.loads(path.read_text()) + cases.extend((f"{path.stem}::{case['name']}", case) for case in data) + return cases + + +_CASES = _load_cases() +_SUCCESS = [(name, c) for name, c in _CASES if "normalized" in c] +_ERROR = [(name, c) for name, c in _CASES if "error" in c] + + +def test_corpus_is_present() -> None: + # Guard against an empty/missing vendored corpus silently passing. + assert len(_SUCCESS) > 0 + assert len(_ERROR) > 0 + + +@pytest.mark.parametrize(("name", "case"), _SUCCESS, ids=[name for name, _ in _SUCCESS]) +def test_success_fixture(name: str, case: dict[str, Any]) -> None: + result = normalize_ndsel(case["input"]) + assert result == case["normalized"] + + +@pytest.mark.parametrize(("name", "case"), _ERROR, ids=[name for name, _ in _ERROR]) +def test_error_fixture(name: str, case: dict[str, Any]) -> None: + with pytest.raises(NdselError) as excinfo: + normalize_ndsel(case["input"]) + assert excinfo.value.reason == case["error"] diff --git a/packages/zarr-indexing/tests/test_domain.py b/packages/zarr-indexing/tests/test_domain.py new file mode 100644 index 0000000000..9664a0b08a --- /dev/null +++ b/packages/zarr-indexing/tests/test_domain.py @@ -0,0 +1,202 @@ +from __future__ import annotations + +import pytest + +from zarr_indexing.domain import IndexDomain + + +class TestIndexDomainConstruction: + def test_from_shape(self) -> None: + d = IndexDomain.from_shape((10, 20)) + assert d.inclusive_min == (0, 0) + assert d.exclusive_max == (10, 20) + assert d.ndim == 2 + assert d.origin == (0, 0) + assert d.shape == (10, 20) + + def test_from_shape_0d(self) -> None: + d = IndexDomain.from_shape(()) + assert d.ndim == 0 + assert d.shape == () + + def test_non_zero_origin(self) -> None: + d = IndexDomain(inclusive_min=(5, 10), exclusive_max=(15, 30)) + assert d.origin == (5, 10) + assert d.shape == (10, 20) + assert d.ndim == 2 + + def test_validation_mismatched_lengths(self) -> None: + with pytest.raises(ValueError, match="same length"): + IndexDomain(inclusive_min=(0,), exclusive_max=(10, 20)) + + def test_validation_min_greater_than_max(self) -> None: + with pytest.raises(ValueError, match="inclusive_min must be <="): + IndexDomain(inclusive_min=(10,), exclusive_max=(5,)) + + def test_empty_domain(self) -> None: + d = IndexDomain(inclusive_min=(5,), exclusive_max=(5,)) + assert d.shape == (0,) + + def test_labels(self) -> None: + d = IndexDomain(inclusive_min=(0, 0), exclusive_max=(10, 20), labels=("x", "y")) + assert d.labels == ("x", "y") + + def test_labels_none(self) -> None: + d = IndexDomain.from_shape((10,)) + assert d.labels is None + + +class TestIndexDomainContains: + def test_contains_inside(self) -> None: + d = IndexDomain.from_shape((10, 20)) + assert d.contains((0, 0)) is True + assert d.contains((9, 19)) is True + assert d.contains((5, 10)) is True + + def test_contains_outside(self) -> None: + d = IndexDomain.from_shape((10, 20)) + assert d.contains((10, 0)) is False + assert d.contains((-1, 0)) is False + assert d.contains((0, 20)) is False + + def test_contains_non_zero_origin(self) -> None: + d = IndexDomain(inclusive_min=(5,), exclusive_max=(10,)) + assert d.contains((5,)) is True + assert d.contains((9,)) is True + assert d.contains((4,)) is False + assert d.contains((10,)) is False + + def test_contains_wrong_ndim(self) -> None: + d = IndexDomain.from_shape((10, 20)) + assert d.contains((5,)) is False + + def test_contains_domain_inside(self) -> None: + outer = IndexDomain.from_shape((10, 20)) + inner = IndexDomain(inclusive_min=(2, 3), exclusive_max=(8, 15)) + assert outer.contains_domain(inner) is True + + def test_contains_domain_outside(self) -> None: + outer = IndexDomain.from_shape((10, 20)) + inner = IndexDomain(inclusive_min=(2, 3), exclusive_max=(11, 15)) + assert outer.contains_domain(inner) is False + + def test_contains_domain_wrong_ndim(self) -> None: + outer = IndexDomain.from_shape((10, 20)) + inner = IndexDomain.from_shape((5,)) + assert outer.contains_domain(inner) is False + + +class TestIndexDomainIntersect: + def test_overlapping(self) -> None: + a = IndexDomain(inclusive_min=(0, 0), exclusive_max=(10, 10)) + b = IndexDomain(inclusive_min=(5, 5), exclusive_max=(15, 15)) + result = a.intersect(b) + assert result is not None + assert result.inclusive_min == (5, 5) + assert result.exclusive_max == (10, 10) + + def test_disjoint(self) -> None: + a = IndexDomain(inclusive_min=(0,), exclusive_max=(5,)) + b = IndexDomain(inclusive_min=(10,), exclusive_max=(15,)) + assert a.intersect(b) is None + + def test_touching_boundary(self) -> None: + a = IndexDomain(inclusive_min=(0,), exclusive_max=(5,)) + b = IndexDomain(inclusive_min=(5,), exclusive_max=(10,)) + assert a.intersect(b) is None + + def test_contained(self) -> None: + a = IndexDomain.from_shape((20,)) + b = IndexDomain(inclusive_min=(5,), exclusive_max=(10,)) + result = a.intersect(b) + assert result is not None + assert result.inclusive_min == (5,) + assert result.exclusive_max == (10,) + + def test_wrong_ndim(self) -> None: + a = IndexDomain.from_shape((10,)) + b = IndexDomain.from_shape((10, 20)) + with pytest.raises(ValueError, match="different ranks"): + a.intersect(b) + + +class TestIndexDomainTranslate: + def test_translate_positive(self) -> None: + d = IndexDomain.from_shape((10, 20)) + result = d.translate((5, 10)) + assert result.inclusive_min == (5, 10) + assert result.exclusive_max == (15, 30) + + def test_translate_negative(self) -> None: + d = IndexDomain(inclusive_min=(10, 20), exclusive_max=(30, 40)) + result = d.translate((-10, -20)) + assert result.inclusive_min == (0, 0) + assert result.exclusive_max == (20, 20) + + def test_translate_wrong_length(self) -> None: + d = IndexDomain.from_shape((10,)) + with pytest.raises(ValueError, match="same length"): + d.translate((1, 2)) + + +class TestIndexDomainNarrow: + def test_narrow_slice(self) -> None: + d = IndexDomain.from_shape((10, 20)) + result = d.narrow((slice(2, 8), slice(5, 15))) + assert result.inclusive_min == (2, 5) + assert result.exclusive_max == (8, 15) + + def test_narrow_int(self) -> None: + d = IndexDomain.from_shape((10, 20)) + result = d.narrow((3, slice(None))) + assert result.inclusive_min == (3, 0) + assert result.exclusive_max == (4, 20) + + def test_narrow_ellipsis(self) -> None: + d = IndexDomain.from_shape((10, 20, 30)) + result = d.narrow((slice(1, 5), ...)) + assert result.inclusive_min == (1, 0, 0) + assert result.exclusive_max == (5, 20, 30) + + def test_narrow_slice_none(self) -> None: + d = IndexDomain.from_shape((10,)) + result = d.narrow((slice(None),)) + assert result == d + + def test_narrow_non_zero_origin(self) -> None: + d = IndexDomain(inclusive_min=(10,), exclusive_max=(20,)) + result = d.narrow((slice(12, 18),)) + assert result.inclusive_min == (12,) + assert result.exclusive_max == (18,) + + def test_narrow_int_out_of_bounds(self) -> None: + d = IndexDomain.from_shape((10,)) + with pytest.raises(IndexError, match="out of bounds"): + d.narrow((10,)) + + def test_narrow_int_below_origin(self) -> None: + d = IndexDomain(inclusive_min=(5,), exclusive_max=(10,)) + with pytest.raises(IndexError, match="out of bounds"): + d.narrow((4,)) + + def test_narrow_clamps_to_domain(self) -> None: + d = IndexDomain.from_shape((10,)) + result = d.narrow((slice(-5, 100),)) + assert result.inclusive_min == (0,) + assert result.exclusive_max == (10,) + + def test_narrow_bare_slice(self) -> None: + d = IndexDomain.from_shape((10,)) + result = d.narrow(slice(2, 8)) + assert result.inclusive_min == (2,) + assert result.exclusive_max == (8,) + + def test_narrow_too_many_indices(self) -> None: + d = IndexDomain.from_shape((10,)) + with pytest.raises(IndexError, match="too many indices"): + d.narrow((1, 2)) + + def test_narrow_step_not_one(self) -> None: + d = IndexDomain.from_shape((10,)) + with pytest.raises(IndexError, match="step=1"): + d.narrow((slice(0, 10, 2),)) diff --git a/packages/zarr-indexing/tests/test_json.py b/packages/zarr-indexing/tests/test_json.py new file mode 100644 index 0000000000..42b59b2c30 --- /dev/null +++ b/packages/zarr-indexing/tests/test_json.py @@ -0,0 +1,336 @@ +from __future__ import annotations + +import numpy as np +import pytest + +from zarr_indexing.domain import IndexDomain +from zarr_indexing.json import ( + IndexTransformJSON, + index_domain_from_json, + index_domain_to_json, + index_transform_from_json, + index_transform_to_json, + output_index_map_from_json, + output_index_map_to_json, +) +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap +from zarr_indexing.transform import IndexTransform + + +def _maps_equal(a: object, b: object) -> bool: + if type(a) is not type(b): + return False + if isinstance(a, ConstantMap): + assert isinstance(b, ConstantMap) + return a.offset == b.offset + if isinstance(a, DimensionMap): + assert isinstance(b, DimensionMap) + return (a.input_dimension, a.offset, a.stride) == (b.input_dimension, b.offset, b.stride) + assert isinstance(a, ArrayMap) + assert isinstance(b, ArrayMap) + return ( + a.offset == b.offset + and a.stride == b.stride + and a.input_dimension == b.input_dimension + and np.array_equal(a.index_array, b.index_array) + ) + + +def _transforms_equal(a: IndexTransform, b: IndexTransform) -> bool: + """Structural equality that compares `ArrayMap` index arrays element-wise + (`IndexTransform`'s dataclass `__eq__` cannot, as numpy `==` is ambiguous).""" + return ( + a.domain == b.domain + and len(a.output) == len(b.output) + and all(_maps_equal(x, y) for x, y in zip(a.output, b.output, strict=True)) + ) + + +class TestIndexDomainJSON: + def test_roundtrip(self) -> None: + domain = IndexDomain(inclusive_min=(2, 5), exclusive_max=(10, 20)) + json = index_domain_to_json(domain) + assert json == { + "input_inclusive_min": [2, 5], + "input_exclusive_max": [10, 20], + "input_labels": ["", ""], + } + restored = index_domain_from_json(json) + assert restored == domain + + def test_with_labels(self) -> None: + domain = IndexDomain(inclusive_min=(0, 0), exclusive_max=(10, 20), labels=("x", "y")) + json = index_domain_to_json(domain) + assert json["input_labels"] == ["x", "y"] + restored = index_domain_from_json(json) + assert restored.labels == ("x", "y") + + def test_without_labels_emits_empty_and_round_trips_to_none(self) -> None: + domain = IndexDomain.from_shape((5,)) + json = index_domain_to_json(domain) + # Canonical form always writes labels; an unlabeled domain gets [""]*rank. + assert json["input_labels"] == [""] + restored = index_domain_from_json(json) + assert restored.labels is None + + def test_zero_origin(self) -> None: + domain = IndexDomain.from_shape((10, 20, 30)) + json = index_domain_to_json(domain) + assert json == { + "input_inclusive_min": [0, 0, 0], + "input_exclusive_max": [10, 20, 30], + "input_labels": ["", "", ""], + } + assert index_domain_from_json(json) == domain + + +class TestOutputIndexMapJSON: + def test_constant(self) -> None: + m = ConstantMap(offset=42) + json = output_index_map_to_json(m) + assert json == {"offset": 42} + restored = output_index_map_from_json(json) + assert isinstance(restored, ConstantMap) + assert restored.offset == 42 + + def test_constant_zero(self) -> None: + m = ConstantMap(offset=0) + json = output_index_map_to_json(m) + assert json == {"offset": 0} + restored = output_index_map_from_json(json) + assert isinstance(restored, ConstantMap) + assert restored.offset == 0 + + def test_dimension(self) -> None: + m = DimensionMap(input_dimension=1, offset=10, stride=3) + json = output_index_map_to_json(m) + assert json == {"offset": 10, "stride": 3, "input_dimension": 1} + restored = output_index_map_from_json(json) + assert isinstance(restored, DimensionMap) + assert restored.input_dimension == 1 + assert restored.offset == 10 + assert restored.stride == 3 + + def test_dimension_stride_1_written(self) -> None: + """Canonical form writes stride even at its default of 1.""" + m = DimensionMap(input_dimension=0) + json = output_index_map_to_json(m) + assert json == {"offset": 0, "stride": 1, "input_dimension": 0} + restored = output_index_map_from_json(json) + assert isinstance(restored, DimensionMap) + assert restored.stride == 1 + + def test_array(self) -> None: + arr = np.array([1, 5, 9], dtype=np.intp) + m = ArrayMap(index_array=arr, offset=2, stride=3) + json = output_index_map_to_json(m) + # Canonical: stride/offset present, index_array_bounds present, and + # no input_dimension (ndsel/TensorStore reject it beside index_array). + assert json == { + "offset": 2, + "stride": 3, + "index_array": [1, 5, 9], + "index_array_bounds": ["-inf", "+inf"], + } + restored = output_index_map_from_json(json) + assert isinstance(restored, ArrayMap) + np.testing.assert_array_equal(restored.index_array, arr) + assert restored.offset == 2 + assert restored.stride == 3 + + def test_array_stride_1_written(self) -> None: + arr = np.array([0, 1, 2], dtype=np.intp) + m = ArrayMap(index_array=arr) + json = output_index_map_to_json(m) + assert json["stride"] == 1 + restored = output_index_map_from_json(json) + assert isinstance(restored, ArrayMap) + assert restored.stride == 1 + + def test_array_2d(self) -> None: + arr = np.array([[1, 2], [3, 4]], dtype=np.intp) + m = ArrayMap(index_array=arr) + json = output_index_map_to_json(m) + assert json["index_array"] == [[1, 2], [3, 4]] + restored = output_index_map_from_json(json) + assert isinstance(restored, ArrayMap) + np.testing.assert_array_equal(restored.index_array, arr) + + def test_degenerate_singleton_array_collapses_to_constant(self) -> None: + """An all-singleton index_array selects one coordinate -> constant map.""" + m = ArrayMap(index_array=np.array([[4]], dtype=np.intp), offset=1, stride=2) + json = output_index_map_to_json(m) + assert json == {"offset": 1 + 2 * 4} + restored = output_index_map_from_json(json) + assert isinstance(restored, ConstantMap) + assert restored.offset == 9 + + +class TestIndexTransformJSON: + def test_identity(self) -> None: + t = IndexTransform.from_shape((10, 20)) + json = index_transform_to_json(t) + assert json == { + "input_rank": 2, + "input_inclusive_min": [0, 0], + "input_exclusive_max": [10, 20], + "input_labels": ["", ""], + "output": [ + {"offset": 0, "stride": 1, "input_dimension": 0}, + {"offset": 0, "stride": 1, "input_dimension": 1}, + ], + } + restored = index_transform_from_json(json) + assert restored.domain == t.domain + assert len(restored.output) == 2 + for orig, rest in zip(t.output, restored.output, strict=True): + assert type(orig) is type(rest) + + def test_sliced(self) -> None: + t = IndexTransform.from_shape((100,))[10:50:2] + json = index_transform_to_json(t) + restored = index_transform_from_json(json) + assert restored.domain.shape == t.domain.shape + assert isinstance(restored.output[0], DimensionMap) + orig = t.output[0] + assert isinstance(orig, DimensionMap) + assert restored.output[0].offset == orig.offset + assert restored.output[0].stride == orig.stride + + def test_with_constant(self) -> None: + t = IndexTransform.from_shape((10, 20))[3] + json = index_transform_to_json(t) + restored = index_transform_from_json(json) + assert isinstance(restored.output[0], ConstantMap) + assert restored.output[0].offset == 3 + assert isinstance(restored.output[1], DimensionMap) + + def test_with_array(self) -> None: + idx = np.array([1, 5, 9], dtype=np.intp) + t = IndexTransform.from_shape((10, 20)).oindex[idx, :] + json = index_transform_to_json(t) + # The oindex array must not carry input_dimension on the wire. + assert "input_dimension" not in json["output"][0] + restored = index_transform_from_json(json) + assert isinstance(restored.output[0], ArrayMap) + # Orthogonal arrays are normalized to full input rank with a singleton + # axis on the dimension they do not vary over. + assert restored.output[0].index_array.shape == (3, 1) + np.testing.assert_array_equal(restored.output[0].index_array, idx.reshape(3, 1)) + # input_dimension is reconstructed from the sole non-singleton axis. + assert restored.output[0].input_dimension == 0 + assert isinstance(restored.output[1], DimensionMap) + + def test_roundtrip_preserves_singleton_axes(self) -> None: + """Full-rank orthogonal arrays keep their singleton axes across JSON.""" + t = IndexTransform.from_shape((10, 20)).oindex[np.array([1, 3]), np.array([2, 4, 6])] + restored = index_transform_from_json(index_transform_to_json(t)) + orig0, orig1 = t.output[0], t.output[1] + rest0, rest1 = restored.output[0], restored.output[1] + assert isinstance(orig0, ArrayMap) + assert isinstance(orig1, ArrayMap) + assert isinstance(rest0, ArrayMap) + assert isinstance(rest1, ArrayMap) + assert rest0.index_array.shape == (2, 1) + assert rest1.index_array.shape == (1, 3) + np.testing.assert_array_equal(rest0.index_array, orig0.index_array) + np.testing.assert_array_equal(rest1.index_array, orig1.index_array) + # Distinct, exclusively-owned axes -> reconstructed as orthogonal. + assert rest0.input_dimension == 0 + assert rest1.input_dimension == 1 + + def test_with_labels(self) -> None: + domain = IndexDomain(inclusive_min=(0, 0), exclusive_max=(10, 20), labels=("x", "y")) + t = IndexTransform.identity(domain) + json = index_transform_to_json(t) + assert json["input_labels"] == ["x", "y"] + restored = index_transform_from_json(json) + assert restored.domain.labels == ("x", "y") + + def test_tensorstore_compatible_format(self) -> None: + """A canonical body loads and round-trips through the engine layer.""" + json: IndexTransformJSON = { + "input_rank": 3, + "input_inclusive_min": [0, 0, 0], + "input_exclusive_max": [100, 200, 3], + "input_labels": ["x", "y", "channel"], + "output": [ + {"offset": 5}, + {"offset": 10, "stride": 2, "input_dimension": 1}, + {"offset": 0, "stride": 1, "index_array": [1, 2, 0]}, + ], + } + t = index_transform_from_json(json) + assert t.domain.shape == (100, 200, 3) + assert t.domain.labels == ("x", "y", "channel") + assert isinstance(t.output[0], ConstantMap) + assert t.output[0].offset == 5 + assert isinstance(t.output[1], DimensionMap) + assert t.output[1].offset == 10 + assert t.output[1].stride == 2 + assert t.output[1].input_dimension == 1 + assert isinstance(t.output[2], ArrayMap) + np.testing.assert_array_equal(t.output[2].index_array, [1, 2, 0]) + + # Roundtrip + json_rt = index_transform_to_json(t) + t_rt = index_transform_from_json(json_rt) + assert t_rt.domain == t.domain + + +class TestCanonicalRoundTrips: + """Round-trip `transform == from(to(transform))`, up to the documented + degenerate-collapse (all-singleton ArrayMap -> ConstantMap).""" + + def test_oindex_multi_axis(self) -> None: + t = IndexTransform.from_shape((10, 20, 30)).oindex[np.array([1, 3]), :, np.array([2, 4, 6])] + rt = index_transform_from_json(index_transform_to_json(t)) + assert _transforms_equal(rt, t) + + def test_oindex_with_slice(self) -> None: + t = IndexTransform.from_shape((10, 20))[2:8].oindex[np.array([3, 5, 7]), :] + rt = index_transform_from_json(index_transform_to_json(t)) + assert _transforms_equal(rt, t) + + def test_vindex(self) -> None: + t = IndexTransform.from_shape((10, 20)).vindex[np.array([1, 3, 5]), np.array([2, 4, 6])] + rt = index_transform_from_json(index_transform_to_json(t)) + assert _transforms_equal(rt, t) + + def test_vindex_with_residual_slice(self) -> None: + t = IndexTransform.from_shape((10, 20, 30)).vindex[np.array([1, 3]), np.array([2, 4]), :] + rt = index_transform_from_json(index_transform_to_json(t)) + assert _transforms_equal(rt, t) + + def test_length1_degenerate_oindex_collapses(self) -> None: + """A length-1 oindex array becomes an all-singleton ArrayMap; the JSON + round-trip collapses it to a ConstantMap (behaviorally identical).""" + t = IndexTransform.from_shape((10, 20)).oindex[np.array([7]), :] + m = t.output[0] + assert isinstance(m, ArrayMap) + assert m.index_array.size == 1 + + rt = index_transform_from_json(index_transform_to_json(t)) + # The degenerate array collapsed to a constant selecting the same cell. + rm = rt.output[0] + assert isinstance(rm, ConstantMap) + assert rm.offset == 7 + # The size-1 input dimension survives, unconsumed, in the domain. + assert rt.domain == t.domain + + def test_slices_and_constants(self) -> None: + t = IndexTransform.from_shape((10, 20, 30))[2:8:2, 5, :] + rt = index_transform_from_json(index_transform_to_json(t)) + assert _transforms_equal(rt, t) + + +def test_infinite_bound_rejected_on_lowering() -> None: + body: IndexTransformJSON = { + "input_rank": 1, + "input_inclusive_min": [0], + "input_exclusive_max": [["+inf"]], + "input_labels": [""], + "output": [{"offset": 0, "stride": 1, "input_dimension": 0}], + } + with pytest.raises(ValueError, match="infinite"): + index_transform_from_json(body) diff --git a/packages/zarr-indexing/tests/test_messages.py b/packages/zarr-indexing/tests/test_messages.py new file mode 100644 index 0000000000..14bed66448 --- /dev/null +++ b/packages/zarr-indexing/tests/test_messages.py @@ -0,0 +1,91 @@ +"""Message-layer tests beyond the vendored conformance corpus. + +The corpus (see `test_conformance.py`) covers the desugaring matrix and error +codes. These tests pin behaviors the corpus does not: `normalize` idempotence, +`parse_ndsel`, 64-bit boundary handling, and schema-valid-but-redundant maps. +""" + +from __future__ import annotations + +from typing import Any + +import pytest + +from zarr_indexing.messages import NdselError, normalize_ndsel, parse_ndsel + +_MESSAGES = [ + {"kind": "point", "coords": [4, 7]}, + {"kind": "box", "inclusive_min": [0, 0], "exclusive_max": [3, 4]}, + {"kind": "box", "inclusive_min": [["-inf"], 0], "exclusive_max": [["+inf"], 4]}, + {"kind": "slice", "start": [5], "stop": [10], "step": [2]}, + {"kind": "points", "coords": [[1, 10], [2, 20]]}, + { + "kind": "transform", + "input_inclusive_min": [0], + "input_exclusive_max": [3], + "output": [{"offset": 7}, {"input_dimension": 0, "stride": 2}, {"index_array": [1, 2, 3]}], + }, +] + + +@pytest.mark.parametrize("message", _MESSAGES) +def test_normalize_is_idempotent(message: dict[str, Any]) -> None: + once = normalize_ndsel(message) + twice = normalize_ndsel({"kind": "transform", **once}) + assert twice == once + + +@pytest.mark.parametrize("message", _MESSAGES) +def test_parse_returns_message_unchanged(message: dict[str, Any]) -> None: + assert parse_ndsel(message) == message + + +def test_parse_rejects_invalid() -> None: + with pytest.raises(NdselError) as excinfo: + parse_ndsel({"kind": "slice", "start": [0]}) + assert excinfo.value.reason == "invalid_json" + + +def test_constant_map_drops_redundant_stride() -> None: + # A constant map (no input_dimension, no index_array) is schema-valid even + # with a stray stride; it canonicalizes to offset-only. + result = normalize_ndsel( + {"kind": "transform", "input_rank": 0, "output": [{"offset": 5, "stride": 9}]} + ) + assert result["output"] == [{"offset": 5}] + + +def test_i64_min_and_max_round_trip() -> None: + i64_min, i64_max = -(2**63), 2**63 - 1 + result = normalize_ndsel({"kind": "point", "coords": [i64_min, i64_max]}) + assert result["output"] == [{"offset": i64_min}, {"offset": i64_max}] + + +def test_i64_overflow_rejected() -> None: + with pytest.raises(NdselError) as excinfo: + normalize_ndsel({"kind": "point", "coords": [2**63]}) + assert excinfo.value.reason == "invalid_json" + + +def test_bool_in_output_offset_rejected() -> None: + with pytest.raises(NdselError) as excinfo: + normalize_ndsel({"kind": "transform", "input_rank": 0, "output": [{"offset": True}]}) + assert excinfo.value.reason == "invalid_json" + + +def test_sentinel_not_allowed_in_plain_integer_position() -> None: + with pytest.raises(NdselError) as excinfo: + normalize_ndsel({"kind": "point", "coords": ["+inf"]}) + assert excinfo.value.reason == "invalid_json" + + +def test_not_an_object_rejected() -> None: + with pytest.raises(NdselError) as excinfo: + normalize_ndsel([1, 2, 3]) + assert excinfo.value.reason == "invalid_json" + + +def test_empty_string_kind_is_unknown_kind() -> None: + with pytest.raises(NdselError) as excinfo: + normalize_ndsel({"kind": ""}) + assert excinfo.value.reason == "unknown_kind" diff --git a/packages/zarr-indexing/tests/test_ndsel_tensorstore.py b/packages/zarr-indexing/tests/test_ndsel_tensorstore.py new file mode 100644 index 0000000000..794ac5f3d5 --- /dev/null +++ b/packages/zarr-indexing/tests/test_ndsel_tensorstore.py @@ -0,0 +1,52 @@ +"""Cross-check canonical ndsel bodies against a real TensorStore. + +A normalized ndsel `transform` body is, field-for-field, a TensorStore +`IndexTransform` (minus the `kind` discriminator, which the canonical body never +carries). This test loads a handful of finite-bound canonical bodies into +`tensorstore.IndexTransform(json=...)` and confirms that TensorStore's own +`to_json()` re-loads, through our engine layer, into an equivalent transform. + +Skipped when tensorstore is not installed. Run it explicitly with: + + uv run --with tensorstore pytest \ + packages/zarr-indexing/tests/test_ndsel_tensorstore.py -q +""" + +from __future__ import annotations + +import numpy as np +import pytest + +from zarr_indexing.json import transform_from_canonical, transform_to_canonical +from zarr_indexing.transform import IndexTransform + +ts = pytest.importorskip("tensorstore") + + +def _canonical_transforms() -> list[IndexTransform]: + base = IndexTransform.from_shape((10, 20)) + return [ + base, # identity + base[2:8:2, :], # strided DimensionMap + identity + base[3, :], # integer index -> ConstantMap + DimensionMap + base.oindex[np.array([1, 5, 9]), :], # orthogonal index_array + IndexTransform.from_shape((10, 20, 30)).vindex[ + np.array([1, 3]), np.array([2, 4]), : + ], # correlated index_arrays + residual slice + ] + + +@pytest.mark.parametrize("transform", _canonical_transforms()) +def test_body_loads_in_tensorstore_and_round_trips(transform: IndexTransform) -> None: + body = transform_to_canonical(transform) + + # (1) The canonical body loads directly as a TensorStore IndexTransform. + ts_transform = ts.IndexTransform(json=body) + + # (2) TensorStore's own JSON re-loads, through our engine, to an equivalent + # transform. Comparing via our canonical form normalizes away + # representational choices (index_array_bounds, default omissions) that + # both sides make differently but that denote the same selection. + ts_json = ts_transform.to_json() + reloaded = transform_from_canonical(ts_json) + assert transform_to_canonical(reloaded) == transform_to_canonical(transform) diff --git a/packages/zarr-indexing/tests/test_output_map.py b/packages/zarr-indexing/tests/test_output_map.py new file mode 100644 index 0000000000..498101444e --- /dev/null +++ b/packages/zarr-indexing/tests/test_output_map.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +import numpy as np + +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap + + +class TestConstantMap: + def test_construction(self) -> None: + m = ConstantMap(offset=42) + assert m.offset == 42 + + def test_default_offset(self) -> None: + m = ConstantMap() + assert m.offset == 0 + + def test_frozen(self) -> None: + m = ConstantMap(offset=5) + assert isinstance(m, ConstantMap) + + +class TestDimensionMap: + def test_construction(self) -> None: + m = DimensionMap(input_dimension=3, offset=5, stride=2) + assert m.input_dimension == 3 + assert m.offset == 5 + assert m.stride == 2 + + def test_defaults(self) -> None: + m = DimensionMap(input_dimension=0) + assert m.offset == 0 + assert m.stride == 1 + + def test_frozen(self) -> None: + m = DimensionMap(input_dimension=0) + assert isinstance(m, DimensionMap) + + +class TestArrayMap: + def test_construction(self) -> None: + arr = np.array([1, 3, 5], dtype=np.intp) + m = ArrayMap(index_array=arr, offset=10, stride=2) + assert m.offset == 10 + assert m.stride == 2 + np.testing.assert_array_equal(m.index_array, arr) + + def test_defaults(self) -> None: + arr = np.array([0, 1], dtype=np.intp) + m = ArrayMap(index_array=arr) + assert m.offset == 0 + assert m.stride == 1 + + def test_frozen(self) -> None: + arr = np.array([0], dtype=np.intp) + m = ArrayMap(index_array=arr) + assert isinstance(m, ArrayMap) diff --git a/packages/zarr-indexing/tests/test_tensorstore_parity.py b/packages/zarr-indexing/tests/test_tensorstore_parity.py new file mode 100644 index 0000000000..1ed99046e9 --- /dev/null +++ b/packages/zarr-indexing/tests/test_tensorstore_parity.py @@ -0,0 +1,263 @@ +"""TensorStore-parity oracle tests for IndexTransform semantics. + +Every case in this module was executed against tensorstore 0.1.84 (see the +lazy-indexing design notes): the expected domains, values, and error conditions +are TensorStore's observed behavior, which zarr's lazy indexing matches by +design. Core rules pinned here: + +- **Domain preservation**: a step-1 slice keeps the literal coordinates of the + selected interval (`a[2:10]` has domain `[2, 10)`); nothing re-zeros + implicitly. Re-zeroing is explicit via `translate_to`. +- **Strided-domain rule**: for step ``k``, ``origin = trunc(start/k)`` (rounded + toward zero), ``shape = ceil((stop - start)/k)``, and coordinate + ``origin + i`` maps to base cell ``start + i*k``. +- **Strict containment**: non-empty slice intervals must lie within the domain + — no clamping, no negative-wrapping; empty intervals are valid anywhere; + reversed non-empty bounds are an error, not an empty result. +- **Fancy-dim rule**: index-array dims get fresh explicit ``[0, n)`` domains; + index-array values are absolute domain coordinates. +- **Translate rules**: ``translate_by``/``translate_to`` shift the input domain + while preserving which cells are addressed. +""" + +from __future__ import annotations + +from typing import ClassVar + +import numpy as np +import pytest + +from zarr_indexing.domain import IndexDomain +from zarr_indexing.errors import BoundsCheckError +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap +from zarr_indexing.transform import IndexTransform + + +def _identity(lo: int, hi: int) -> IndexTransform: + """Identity transform over the 1-D domain [lo, hi).""" + return IndexTransform.identity(IndexDomain(inclusive_min=(lo,), exclusive_max=(hi,))) + + +def _a() -> IndexTransform: + """The oracle's base fixture: identity over [0, 12).""" + return _identity(0, 12) + + +def _w() -> IndexTransform: + """The oracle's translated fixture: identity over [-10, 2), cell c -> base c + 10.""" + return _a().translate_domain_by((-10,)) + + +def _dim(t: IndexTransform) -> DimensionMap: + m = t.output[0] + assert isinstance(m, DimensionMap) + return m + + +def _base_cells(t: IndexTransform) -> list[int]: + """The base cells a 1-D single-DimensionMap transform addresses, in order.""" + m = _dim(t) + lo, hi = t.domain.inclusive_min[0], t.domain.exclusive_max[0] + return [m.offset + m.stride * c for c in range(lo, hi)] + + +class TestDomainPreservation: + """Oracle section 1-2: step-1 slices keep literal coordinates.""" + + def test_slice_preserves_domain(self) -> None: + t = _a()[2:10] + assert (t.domain.inclusive_min, t.domain.exclusive_max) == ((2,), (10,)) + assert _base_cells(t) == list(range(2, 10)) + + def test_integer_on_preserved_domain_is_a_coordinate(self) -> None: + v = _a()[2:10] + assert isinstance(v[3].output[0], ConstantMap) + assert v[3].output[0].offset == 3 # coordinate 3 = base cell 3 + assert v[2].output[0].offset == 2 + assert v[9].output[0].offset == 9 + + @pytest.mark.parametrize("bad", [0, -1, 10]) + def test_out_of_domain_integer_raises(self, bad: int) -> None: + with pytest.raises(BoundsCheckError, match=r"valid indices \[2, 10\)"): + _a()[2:10][bad] + + def test_slice_of_slice_is_literal(self) -> None: + v = _a()[2:10] + t = v[3:7] + assert (t.domain.inclusive_min, t.domain.exclusive_max) == ((3,), (7,)) + assert _base_cells(t) == [3, 4, 5, 6] + + def test_ellipsis_preserves_domain(self) -> None: + v = _a()[2:10] + t = v[...] + assert (t.domain.inclusive_min, t.domain.exclusive_max) == ((2,), (10,)) + + +class TestNegativeOriginDomain: + """Oracle section 3: on domain [-10, 2), -1 is just another index.""" + + def test_translated_domain(self) -> None: + w = _w() + assert (w.domain.inclusive_min, w.domain.exclusive_max) == ((-10,), (2,)) + assert _base_cells(w) == list(range(12)) + + @pytest.mark.parametrize(("coord", "base"), [(-5, 5), (-10, 0), (-1, 9), (1, 11)]) + def test_negative_coordinates_address_cells(self, coord: int, base: int) -> None: + t = _w()[coord] + assert isinstance(t.output[0], ConstantMap) + assert t.output[0].offset == base + + @pytest.mark.parametrize("bad", [-11, 2]) + def test_out_of_domain_raises(self, bad: int) -> None: + with pytest.raises(BoundsCheckError, match=r"valid indices \[-10, 2\)"): + _w()[bad] + + def test_negative_slice_bounds_are_coordinates(self) -> None: + t = _w()[-5:] + assert (t.domain.inclusive_min, t.domain.exclusive_max) == ((-5,), (2,)) + assert _base_cells(t) == [5, 6, 7, 8, 9, 10, 11] + t2 = _w()[-5:-2] + assert (t2.domain.inclusive_min, t2.domain.exclusive_max) == ((-5,), (-2,)) + assert _base_cells(t2) == [5, 6, 7] + + +class TestStridedDomains: + """Oracle section 5: origin = trunc(start/step), coord origin+i -> start + i*step.""" + + # (slice, expected (lo, hi), expected base cells) — verbatim oracle rows. + CASES: ClassVar[list[tuple[slice, tuple[int, int], list[int]]]] = [ + (slice(1, 10, 3), (0, 3), [1, 4, 7]), + (slice(None, None, 2), (0, 6), [0, 2, 4, 6, 8, 10]), + (slice(2, 11, 3), (0, 3), [2, 5, 8]), + (slice(0, 12, 4), (0, 3), [0, 4, 8]), + (slice(5, 12, 2), (2, 6), [5, 7, 9, 11]), + (slice(6, 12, 2), (3, 6), [6, 8, 10]), + (slice(7, 12, 3), (2, 4), [7, 10]), + ] + + @pytest.mark.parametrize(("sel", "dom", "cells"), CASES) + def test_strided_domain_and_cells( + self, sel: slice, dom: tuple[int, int], cells: list[int] + ) -> None: + t = _a()[sel] + assert (t.domain.inclusive_min[0], t.domain.exclusive_max[0]) == dom + assert _base_cells(t) == cells + + def test_strided_on_negative_origin(self) -> None: + # w[-9:2:2] -> domain [-4, 2), base cells 1,3,5,7,9,11 + t = _w()[-9:2:2] + assert (t.domain.inclusive_min[0], t.domain.exclusive_max[0]) == (-4, 2) + assert _base_cells(t) == [1, 3, 5, 7, 9, 11] + # w[::2] -> domain [-5, 1), base cells 0,2,4,6,8,10 + t2 = _w()[::2] + assert (t2.domain.inclusive_min[0], t2.domain.exclusive_max[0]) == (-5, 1) + assert _base_cells(t2) == [0, 2, 4, 6, 8, 10] + + def test_strided_composition(self) -> None: + s = _a()[1:10:3] # domain [0, 3), cells 1,4,7 + assert [s[k].output[0].offset for k in range(3)] == [1, 4, 7] + t = s[1:3] + assert (t.domain.inclusive_min[0], t.domain.exclusive_max[0]) == (1, 3) + assert _base_cells(t) == [4, 7] + t2 = _a()[::2][1:4] + assert (t2.domain.inclusive_min[0], t2.domain.exclusive_max[0]) == (1, 4) + assert _base_cells(t2) == [2, 4, 6] + t3 = _a()[::2][::2] + assert (t3.domain.inclusive_min[0], t3.domain.exclusive_max[0]) == (0, 3) + assert _base_cells(t3) == [0, 4, 8] + + @pytest.mark.parametrize("bad", [-2, -1, 3, 4]) + def test_strided_bounds(self, bad: int) -> None: + with pytest.raises(BoundsCheckError, match=r"valid indices \[0, 3\)"): + _a()[1:10:3][bad] + + +class TestStrictContainment: + """Oracle section 11: no clamping, no wrapping; empty intervals valid anywhere.""" + + @pytest.mark.parametrize( + "sel", + [ + slice(5, 100), + slice(-3, None), + slice(-3, -1), + slice(0, 13), + slice(12, 14), + slice(100, 200), + ], + ) + def test_uncontained_interval_raises(self, sel: slice) -> None: + with pytest.raises(BoundsCheckError, match="not contained"): + _a()[sel] + + def test_uncontained_on_negative_origin(self) -> None: + with pytest.raises(BoundsCheckError, match="not contained"): + _w()[-20:] + + @pytest.mark.parametrize( + ("sel", "pos"), [(slice(5, 5), 5), (slice(0, 0), 0), (slice(13, 13), 13)] + ) + def test_empty_interval_valid_anywhere(self, sel: slice, pos: int) -> None: + t = _a()[sel] + assert t.domain.shape == (0,) + assert t.domain.inclusive_min[0] == pos + + @pytest.mark.parametrize("sel", [slice(5, 2), slice(100, 50)]) + def test_reversed_bounds_raise(self, sel: slice) -> None: + with pytest.raises(IndexError, match="valid.*interval|interval"): + _a()[sel] + + +class TestTranslate: + """Oracle sections 4 and 12: translate_by / translate_to preserve the cell mapping.""" + + def test_translate_to_zero(self) -> None: + t = _a()[2:10].translate_domain_to((0,)) + assert (t.domain.inclusive_min, t.domain.exclusive_max) == ((0,), (8,)) + assert _base_cells(t) == list(range(2, 10)) + + def test_translate_to_offset(self) -> None: + t = _a().translate_domain_to((5,)) + assert (t.domain.inclusive_min, t.domain.exclusive_max) == ((5,), (17,)) + assert _base_cells(t) == list(range(12)) + + def test_translate_by_composes_with_stride(self) -> None: + # a[::2].translate_by[5] -> domain [5, 11), base = 2*(coord-5) + t = _a()[::2].translate_domain_by((5,)) + assert (t.domain.inclusive_min, t.domain.exclusive_max) == ((5,), (11,)) + assert _base_cells(t) == [0, 2, 4, 6, 8, 10] + assert t[5].output[0].offset == 0 + assert t[10].output[0].offset == 10 + with pytest.raises(BoundsCheckError, match=r"valid indices \[5, 11\)"): + t[0] + + def test_translate_strided_to(self) -> None: + t = _a()[1:10:3].translate_domain_to((100,)) + assert (t.domain.inclusive_min, t.domain.exclusive_max) == ((100,), (103,)) + assert _base_cells(t) == [1, 4, 7] + + +class TestFancyDims: + """Oracle section 7: fancy dims get fresh [0, n); values are absolute coordinates.""" + + def test_index_array_values_are_coordinates(self) -> None: + v = _a()[2:10] + t = v.oindex[(np.array([3, 5], dtype=np.intp),)] + assert (t.domain.inclusive_min, t.domain.exclusive_max) == ((0,), (2,)) + m = t.output[0] + assert isinstance(m, ArrayMap) + storage = m.offset + m.stride * m.index_array + np.testing.assert_array_equal(np.asarray(storage).ravel(), [3, 5]) + + def test_index_array_on_negative_origin(self) -> None: + t = _w().oindex[(np.array([-10, -1], dtype=np.intp),)] + m = t.output[0] + assert isinstance(m, ArrayMap) + storage = m.offset + m.stride * m.index_array + np.testing.assert_array_equal(np.asarray(storage).ravel(), [0, 9]) + + def test_index_array_out_of_domain_raises(self) -> None: + v = _a()[2:10] + for bad in ([0, 3], [-1, 3], [3, 10]): + with pytest.raises(BoundsCheckError): + v.oindex[(np.array(bad, dtype=np.intp),)] diff --git a/packages/zarr-indexing/tests/test_transform.py b/packages/zarr-indexing/tests/test_transform.py new file mode 100644 index 0000000000..baecd9ada2 --- /dev/null +++ b/packages/zarr-indexing/tests/test_transform.py @@ -0,0 +1,628 @@ +from __future__ import annotations + +import numpy as np +import pytest + +from zarr_indexing.domain import IndexDomain +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap +from zarr_indexing.transform import IndexTransform, selection_to_transform + + +class TestIndexTransformConstruction: + def test_from_shape(self) -> None: + t = IndexTransform.from_shape((10, 20)) + assert t.input_rank == 2 + assert t.output_rank == 2 + assert t.domain.shape == (10, 20) + assert t.domain.origin == (0, 0) + for i, m in enumerate(t.output): + assert isinstance(m, DimensionMap) + assert m.input_dimension == i + assert m.offset == 0 + assert m.stride == 1 + + def test_identity(self) -> None: + domain = IndexDomain(inclusive_min=(5,), exclusive_max=(15,)) + t = IndexTransform.identity(domain) + assert t.input_rank == 1 + assert t.output_rank == 1 + assert t.domain == domain + assert isinstance(t.output[0], DimensionMap) + assert t.output[0].input_dimension == 0 + + def test_from_shape_0d(self) -> None: + t = IndexTransform.from_shape(()) + assert t.input_rank == 0 + assert t.output_rank == 0 + assert t.domain.shape == () + + def test_custom_output_maps(self) -> None: + domain = IndexDomain.from_shape((10,)) + maps = (ConstantMap(offset=42), DimensionMap(input_dimension=0, offset=5, stride=2)) + t = IndexTransform(domain=domain, output=maps) + assert t.input_rank == 1 + assert t.output_rank == 2 + + def test_validation_input_dimension_out_of_range(self) -> None: + domain = IndexDomain.from_shape((10,)) + maps = (DimensionMap(input_dimension=5),) + with pytest.raises(ValueError, match="input_dimension"): + IndexTransform(domain=domain, output=maps) + + +class TestIndexTransformBasicIndexing: + def test_slice_identity(self) -> None: + """slice(None) on identity transform is a no-op.""" + t = IndexTransform.from_shape((10, 20)) + result = t[slice(None), slice(None)] + assert result.domain.shape == (10, 20) + assert result.input_rank == 2 + assert result.output_rank == 2 + + def test_slice_narrows(self) -> None: + t = IndexTransform.from_shape((10, 20)) + result = t[2:8, 5:15] + # Domains are preserved (TensorStore): the slice keeps its literal + # coordinates, so the map stays the identity (out = in). + assert result.domain.shape == (6, 10) + assert result.domain.origin == (2, 5) + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].offset == 0 + assert result.output[0].stride == 1 + assert result.output[0].input_dimension == 0 + assert isinstance(result.output[1], DimensionMap) + assert result.output[1].offset == 0 + assert result.output[1].input_dimension == 1 + + def test_strided_slice(self) -> None: + t = IndexTransform.from_shape((10,)) + result = t[::2] + assert result.domain.shape == (5,) + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].offset == 0 + assert result.output[0].stride == 2 + + def test_strided_slice_with_start(self) -> None: + t = IndexTransform.from_shape((10,)) + result = t[1:9:3] + # indices: 1, 4, 7 -> 3 elements + assert result.domain.shape == (3,) + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].offset == 1 + assert result.output[0].stride == 3 + + def test_int_drops_dimension(self) -> None: + t = IndexTransform.from_shape((10, 20)) + result = t[3] + assert result.input_rank == 1 + assert result.output_rank == 2 + assert isinstance(result.output[0], ConstantMap) + assert result.output[0].offset == 3 + assert isinstance(result.output[1], DimensionMap) + assert result.output[1].input_dimension == 0 + + def test_int_middle_dimension(self) -> None: + t = IndexTransform.from_shape((10, 20, 30)) + result = t[:, 5, :] + assert result.input_rank == 2 + assert result.output_rank == 3 + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].input_dimension == 0 + assert isinstance(result.output[1], ConstantMap) + assert result.output[1].offset == 5 + assert isinstance(result.output[2], DimensionMap) + assert result.output[2].input_dimension == 1 + + def test_ellipsis(self) -> None: + t = IndexTransform.from_shape((10, 20, 30)) + result = t[2:8, ...] + assert result.input_rank == 3 + assert result.domain.shape == (6, 20, 30) + + def test_newaxis(self) -> None: + t = IndexTransform.from_shape((10, 20)) + result = t[np.newaxis, :, :] + assert result.input_rank == 3 + assert result.domain.shape == (1, 10, 20) + assert result.output_rank == 2 + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].input_dimension == 1 + assert isinstance(result.output[1], DimensionMap) + assert result.output[1].input_dimension == 2 + + def test_int_out_of_bounds(self) -> None: + t = IndexTransform.from_shape((10,)) + with pytest.raises(IndexError): + t[10] + + def test_negative_int_is_literal(self) -> None: + """Negative indices are literal coordinates (TensorStore convention), + not 'from the end' like NumPy.""" + t = IndexTransform.from_shape((10,)) + with pytest.raises(IndexError): + t[-1] # -1 is out of bounds for domain [0, 10) + + def test_negative_int_valid_with_negative_origin(self) -> None: + """Negative index is valid if the domain includes negative coordinates.""" + domain = IndexDomain(inclusive_min=(-5,), exclusive_max=(5,)) + t = IndexTransform.identity(domain) + result = t[-3] + assert isinstance(result.output[0], ConstantMap) + assert result.output[0].offset == -3 + + def test_composition_of_slices(self) -> None: + """Slicing a sliced transform re-selects in literal domain coordinates.""" + t = IndexTransform.from_shape((100,)) + result = t[10:50][15:30] + assert result.domain.shape == (15,) + assert result.domain.origin == (15,) + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].offset == 0 + assert result.output[0].stride == 1 + + def test_composition_of_strides(self) -> None: + t = IndexTransform.from_shape((100,)) + result = t[::2][::3] + # t[::2] -> shape (50,), offset=0, stride=2 + # [::3] -> shape ceil(50/3)=17, offset=0, stride=2*3=6 + assert result.domain.shape == (17,) + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].stride == 6 + + def test_bare_int(self) -> None: + """Non-tuple selection.""" + t = IndexTransform.from_shape((10, 20)) + result = t[3] + assert result.input_rank == 1 + + def test_bare_slice(self) -> None: + t = IndexTransform.from_shape((10, 20)) + result = t[2:8] + assert result.domain.shape == (6, 20) + + +class TestBasicIndexingOnArrayMaps: + """When a transform already has ArrayMap outputs, basic indexing must + apply the corresponding operation to the index_array's axes.""" + + def test_int_on_array_map_drops_axis(self) -> None: + """Integer index on a dimension referenced by an ArrayMap should + index into the array on that axis.""" + arr = np.array([[10, 20], [30, 40], [50, 60]], dtype=np.intp) + # 2D input domain (3, 2), one ArrayMap output + t = IndexTransform( + domain=IndexDomain.from_shape((3, 2)), + output=(ArrayMap(index_array=arr),), + ) + # Index with int on dim 0 -> pick row 1 -> arr[1, :] = [30, 40] + result = t[1] + assert result.input_rank == 1 + assert result.domain.shape == (2,) + assert isinstance(result.output[0], ArrayMap) + np.testing.assert_array_equal(result.output[0].index_array, np.array([30, 40])) + + def test_slice_on_array_map(self) -> None: + """Slice on a dimension referenced by an ArrayMap should slice the array.""" + arr = np.array([10, 20, 30, 40, 50], dtype=np.intp) + t = IndexTransform( + domain=IndexDomain.from_shape((5,)), + output=(ArrayMap(index_array=arr),), + ) + result = t[1:4] + assert result.domain.shape == (3,) + assert isinstance(result.output[0], ArrayMap) + np.testing.assert_array_equal(result.output[0].index_array, np.array([20, 30, 40])) + + def test_strided_slice_on_array_map(self) -> None: + """Strided slice on ArrayMap should stride the array.""" + arr = np.array([10, 20, 30, 40, 50], dtype=np.intp) + t = IndexTransform( + domain=IndexDomain.from_shape((5,)), + output=(ArrayMap(index_array=arr),), + ) + result = t[::2] + assert result.domain.shape == (3,) + assert isinstance(result.output[0], ArrayMap) + np.testing.assert_array_equal(result.output[0].index_array, np.array([10, 30, 50])) + + def test_newaxis_on_array_map(self) -> None: + """Newaxis should insert an axis in the index_array.""" + arr = np.array([10, 20, 30], dtype=np.intp) + t = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(index_array=arr),), + ) + result = t[np.newaxis, :] + assert result.input_rank == 2 + assert result.domain.shape == (1, 3) + assert isinstance(result.output[0], ArrayMap) + assert result.output[0].index_array.shape == (1, 3) + np.testing.assert_array_equal(result.output[0].index_array, np.array([[10, 20, 30]])) + + def test_int_drops_one_of_two_array_dims(self) -> None: + """2D array map, int on dim 0, slice on dim 1.""" + arr = np.array([[10, 20, 30], [40, 50, 60]], dtype=np.intp) + t = IndexTransform( + domain=IndexDomain.from_shape((2, 3)), + output=(ArrayMap(index_array=arr),), + ) + result = t[0, 1:3] + assert result.input_rank == 1 + assert result.domain.shape == (2,) + assert isinstance(result.output[0], ArrayMap) + # arr[0, 1:3] = [20, 30] + np.testing.assert_array_equal(result.output[0].index_array, np.array([20, 30])) + + +class TestIndexTransformOindex: + def test_oindex_int_array(self) -> None: + t = IndexTransform.from_shape((10, 20)) + idx = np.array([1, 3, 5], dtype=np.intp) + result = t.oindex[idx, :] + assert result.input_rank == 2 + assert result.domain.shape == (3, 20) + assert isinstance(result.output[0], ArrayMap) + # Full input rank: the array varies along its own axis (0), singleton on 1. + assert result.output[0].index_array.shape == (3, 1) + np.testing.assert_array_equal(result.output[0].index_array, idx.reshape(3, 1)) + assert result.output[0].offset == 0 + assert result.output[0].stride == 1 + assert isinstance(result.output[1], DimensionMap) + assert result.output[1].input_dimension == 1 + + def test_oindex_bool_array(self) -> None: + t = IndexTransform.from_shape((5,)) + mask = np.array([True, False, True, False, True]) + result = t.oindex[mask] + assert result.domain.shape == (3,) + assert isinstance(result.output[0], ArrayMap) + np.testing.assert_array_equal( + result.output[0].index_array, np.array([0, 2, 4], dtype=np.intp) + ) + + def test_oindex_mixed(self) -> None: + t = IndexTransform.from_shape((10, 20)) + idx = np.array([2, 4], dtype=np.intp) + result = t.oindex[idx, 5:15] + assert result.input_rank == 2 + assert result.domain.shape == (2, 10) + # fancy dim: fresh zero-origin; slice dim: preserved literal coords + assert result.domain.origin == (0, 5) + assert isinstance(result.output[0], ArrayMap) + assert isinstance(result.output[1], DimensionMap) + assert result.output[1].offset == 0 + + def test_oindex_multiple_arrays(self) -> None: + t = IndexTransform.from_shape((10, 20, 30)) + idx0 = np.array([1, 3], dtype=np.intp) + idx1 = np.array([5, 10, 15], dtype=np.intp) + result = t.oindex[idx0, :, idx1] + assert result.input_rank == 3 + assert result.domain.shape == (2, 20, 3) + assert isinstance(result.output[0], ArrayMap) + assert isinstance(result.output[1], DimensionMap) + assert isinstance(result.output[2], ArrayMap) + + def test_oindex_multiple_arrays_preserves_independent_axes(self) -> None: + t = IndexTransform.from_shape((10, 20)) + result = t.oindex[np.array([1, 3]), np.array([2, 4, 6])] + assert result.domain.shape == (2, 3) + assert isinstance(result.output[0], ArrayMap) + assert isinstance(result.output[1], ArrayMap) + assert result.output[0].index_array.shape == (2, 1) + assert result.output[1].index_array.shape == (1, 3) + + +class TestIndexTransformVindex: + def test_vindex_single_array(self) -> None: + t = IndexTransform.from_shape((10,)) + idx = np.array([1, 3, 5], dtype=np.intp) + result = t.vindex[idx] + assert result.input_rank == 1 + assert result.domain.shape == (3,) + assert isinstance(result.output[0], ArrayMap) + np.testing.assert_array_equal(result.output[0].index_array, idx) + + def test_vindex_broadcast(self) -> None: + t = IndexTransform.from_shape((10, 20)) + idx0 = np.array([[1, 2], [3, 4]], dtype=np.intp) + idx1 = np.array([[10, 11], [12, 13]], dtype=np.intp) + result = t.vindex[idx0, idx1] + assert result.input_rank == 2 + assert result.domain.shape == (2, 2) + assert isinstance(result.output[0], ArrayMap) + assert isinstance(result.output[1], ArrayMap) + np.testing.assert_array_equal(result.output[0].index_array, idx0) + np.testing.assert_array_equal(result.output[1].index_array, idx1) + + def test_vindex_with_slice(self) -> None: + t = IndexTransform.from_shape((10, 20, 30)) + idx = np.array([1, 3, 5], dtype=np.intp) + result = t.vindex[idx, :, :] + assert result.input_rank == 3 + assert result.domain.shape == (3, 20, 30) + assert isinstance(result.output[0], ArrayMap) + + def test_vindex_bool_mask(self) -> None: + t = IndexTransform.from_shape((5,)) + mask = np.array([True, False, True, False, True]) + result = t.vindex[mask] + assert result.domain.shape == (3,) + assert isinstance(result.output[0], ArrayMap) + + def test_vindex_broadcast_different_shapes(self) -> None: + t = IndexTransform.from_shape((10, 20)) + idx0 = np.array([1, 2, 3], dtype=np.intp) + idx1 = np.array([[10], [11]], dtype=np.intp) + result = t.vindex[idx0, idx1] + assert result.input_rank == 2 + assert result.domain.shape == (2, 3) + + def test_vindex_multiple_arrays_preserves_shared_axes(self) -> None: + t = IndexTransform.from_shape((10, 20)) + result = t.vindex[np.array([1, 3]), np.array([2, 4])] + assert result.domain.shape == (2,) + assert isinstance(result.output[0], ArrayMap) + assert isinstance(result.output[1], ArrayMap) + assert result.output[0].index_array.shape == (2,) + assert result.output[1].index_array.shape == (2,) + + +class TestSelectionToTransform: + def test_basic_slice(self) -> None: + t = IndexTransform.from_shape((10, 20)) + result = selection_to_transform((slice(2, 8), slice(5, 15)), t, "basic") + assert result.domain.shape == (6, 10) + assert result.domain.origin == (2, 5) # preserved literal coordinates + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].offset == 0 + + def test_basic_int(self) -> None: + t = IndexTransform.from_shape((10, 20)) + result = selection_to_transform((3, slice(None)), t, "basic") + assert result.input_rank == 1 + assert isinstance(result.output[0], ConstantMap) + assert result.output[0].offset == 3 + + def test_basic_ellipsis(self) -> None: + t = IndexTransform.from_shape((10, 20)) + result = selection_to_transform(Ellipsis, t, "basic") + assert result.domain.shape == (10, 20) + + def test_orthogonal(self) -> None: + t = IndexTransform.from_shape((10, 20)) + idx = np.array([1, 3, 5], dtype=np.intp) + result = selection_to_transform((idx, slice(None)), t, "orthogonal") + assert result.domain.shape == (3, 20) + assert isinstance(result.output[0], ArrayMap) + + def test_vectorized(self) -> None: + t = IndexTransform.from_shape((10, 20)) + idx0 = np.array([1, 3], dtype=np.intp) + idx1 = np.array([5, 7], dtype=np.intp) + result = selection_to_transform((idx0, idx1), t, "vectorized") + assert result.domain.shape == (2,) + assert isinstance(result.output[0], ArrayMap) + assert isinstance(result.output[1], ArrayMap) + + def test_composition_with_non_identity(self) -> None: + """Indexing a sliced transform uses literal domain coordinates. + + The slice [10:50] preserves its domain, so a follow-up [15:30] + re-selects coordinates 15..29 of the base (TensorStore semantics), and + the composed map stays the identity (out = in). + """ + t = IndexTransform.from_shape((100,))[10:50] + result = selection_to_transform(slice(15, 30), t, "basic") + assert (result.domain.inclusive_min, result.domain.exclusive_max) == ((15,), (30,)) + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].offset == 0 + assert result.output[0].stride == 1 + + +class TestIndexTransformIntersect: + def test_constant_inside(self) -> None: + t = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(ConstantMap(offset=5),), + ) + result = t.intersect(IndexDomain(inclusive_min=(0,), exclusive_max=(10,))) + assert result is not None + restricted, surviving = result + assert isinstance(restricted.output[0], ConstantMap) + assert restricted.output[0].offset == 5 + assert surviving is None + + def test_constant_outside(self) -> None: + t = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(ConstantMap(offset=5),), + ) + result = t.intersect(IndexDomain(inclusive_min=(10,), exclusive_max=(20,))) + assert result is None + + def test_dimension_partial(self) -> None: + """DimensionMap over [0,10) intersected with [5,15) narrows input to [5,10).""" + t = IndexTransform.from_shape((10,)) + result = t.intersect(IndexDomain(inclusive_min=(5,), exclusive_max=(15,))) + assert result is not None + restricted, surviving = result + assert restricted.domain.inclusive_min == (5,) + assert restricted.domain.exclusive_max == (10,) + assert surviving is None + + def test_dimension_no_overlap(self) -> None: + t = IndexTransform.from_shape((10,)) + result = t.intersect(IndexDomain(inclusive_min=(20,), exclusive_max=(30,))) + assert result is None + + def test_dimension_strided(self) -> None: + """stride=2, offset=1 over [0,5): storage 1,3,5,7,9. Chunk [4,8).""" + t = IndexTransform( + domain=IndexDomain.from_shape((5,)), + output=(DimensionMap(input_dimension=0, offset=1, stride=2),), + ) + result = t.intersect(IndexDomain(inclusive_min=(4,), exclusive_max=(8,))) + assert result is not None + restricted, _surviving = result + # input 2->5, input 3->7. Both in [4,8). + assert restricted.domain.inclusive_min == (2,) + assert restricted.domain.exclusive_max == (4,) + + def test_array_partial(self) -> None: + arr = np.array([3, 8, 15, 22], dtype=np.intp) + t = IndexTransform( + domain=IndexDomain.from_shape((4,)), + output=(ArrayMap(index_array=arr),), + ) + result = t.intersect(IndexDomain(inclusive_min=(5,), exclusive_max=(20,))) + assert result is not None + restricted, surviving = result + assert isinstance(restricted.output[0], ArrayMap) + np.testing.assert_array_equal(restricted.output[0].index_array, np.array([8, 15])) + assert surviving is not None + np.testing.assert_array_equal(surviving, np.array([1, 2])) + + def test_array_none_inside(self) -> None: + arr = np.array([1, 2, 3], dtype=np.intp) + t = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(index_array=arr),), + ) + assert t.intersect(IndexDomain(inclusive_min=(10,), exclusive_max=(20,))) is None + + def test_2d_mixed(self) -> None: + """2D: ConstantMap on dim 0, DimensionMap on dim 1.""" + t = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=( + ConstantMap(offset=5), + DimensionMap(input_dimension=0, offset=0, stride=1), + ), + ) + chunk = IndexDomain(inclusive_min=(0, 5), exclusive_max=(10, 15)) + result = t.intersect(chunk) + assert result is not None + restricted, _ = result + assert isinstance(restricted.output[0], ConstantMap) + assert restricted.output[0].offset == 5 + assert isinstance(restricted.output[1], DimensionMap) + assert restricted.domain.inclusive_min == (5,) + assert restricted.domain.exclusive_max == (10,) + + +class TestIndexTransformTranslate: + def test_translate_constant(self) -> None: + t = IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(ConstantMap(offset=5),), + ) + result = t.translate((-5,)) + assert isinstance(result.output[0], ConstantMap) + assert result.output[0].offset == 0 + + def test_translate_dimension(self) -> None: + t = IndexTransform.from_shape((10,)) + result = t.translate((-3,)) + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].offset == -3 + assert result.output[0].stride == 1 + + def test_translate_array(self) -> None: + arr = np.array([5, 10], dtype=np.intp) + t = IndexTransform( + domain=IndexDomain.from_shape((2,)), + output=(ArrayMap(index_array=arr, offset=3),), + ) + result = t.translate((-3,)) + assert isinstance(result.output[0], ArrayMap) + assert result.output[0].offset == 0 + np.testing.assert_array_equal(result.output[0].index_array, arr) + + def test_translate_2d(self) -> None: + t = IndexTransform.from_shape((10, 20)) + result = t.translate((-5, -10)) + assert isinstance(result.output[0], DimensionMap) + assert result.output[0].offset == -5 + assert isinstance(result.output[1], DimensionMap) + assert result.output[1].offset == -10 + + +class TestArrayMapDependencyAxes: + """`_array_map_dependency_axes` derives the input axes an array varies on + from its (full-rank) shape: non-singleton axes vary, singleton axes do not.""" + + def test_orthogonal_single_axis(self) -> None: + from zarr_indexing.transform import _array_map_dependency_axes + + t = IndexTransform.from_shape((10, 20)).oindex[np.array([1, 3]), np.array([2, 4, 6])] + m0, m1 = t.output[0], t.output[1] + assert isinstance(m0, ArrayMap) + assert isinstance(m1, ArrayMap) + assert _array_map_dependency_axes(m0.index_array) == (0,) + assert _array_map_dependency_axes(m1.index_array) == (1,) + + def test_vectorized_shares_axes(self) -> None: + from zarr_indexing.transform import _array_map_dependency_axes + + t = IndexTransform.from_shape((10, 20)).vindex[np.array([1, 3]), np.array([2, 4])] + m0, m1 = t.output[0], t.output[1] + assert isinstance(m0, ArrayMap) + assert isinstance(m1, ArrayMap) + assert _array_map_dependency_axes(m0.index_array) == (0,) + assert _array_map_dependency_axes(m1.index_array) == (0,) + + def test_scalar_array_has_no_dependency(self) -> None: + from zarr_indexing.transform import _array_map_dependency_axes + + assert _array_map_dependency_axes(np.ones((1, 1), dtype=np.intp)) == () + + +class TestIntersectArrayMapClassification: + """`_intersect` must distinguish orthogonal (outer-product) ArrayMaps from + correlated (vectorized) ones by their dependency axes, keep surviving arrays + at full input rank, and preserve residual (slice) dimensions.""" + + def test_orthogonal_outer_product_keeps_full_rank(self) -> None: + """Two arrays on distinct axes narrow independently and stay full rank; + out_indices is a per-output-dim dict of surviving positions.""" + t = IndexTransform.from_shape((10, 10)).oindex[np.array([1, 3, 8]), np.array([2, 6, 9])] + # Chunk covering storage [0,5) x [0,5): rows 1,3 survive (out pos 0,1), + # cols 2 survives (out pos 0). + chunk = IndexDomain(inclusive_min=(0, 0), exclusive_max=(5, 5)) + result = t.intersect(chunk) + assert result is not None + restricted, out_indices = result + assert isinstance(restricted.output[0], ArrayMap) + assert isinstance(restricted.output[1], ArrayMap) + # Full input rank preserved (not raveled to 1-D). + assert restricted.output[0].index_array.ndim == 2 + assert restricted.output[1].index_array.ndim == 2 + assert restricted.domain.ndim == 2 + assert isinstance(out_indices, dict) + np.testing.assert_array_equal(out_indices[0], np.array([0, 1])) + np.testing.assert_array_equal(out_indices[1], np.array([0])) + + def test_correlated_with_residual_slice_preserves_slice_dim(self) -> None: + """A vindex transform with two correlated arrays plus a residual slice + dim intersects without a rank error and keeps the DimensionMap.""" + t = IndexTransform.from_shape((4, 3, 5)).vindex[np.array([1, 3]), np.array([2, 0])] + # Chunk covering storage [0,2) x [2,3) x [0,5): only point (1,2,*) is in + # bounds on both array dims -> one surviving broadcast point. + chunk = IndexDomain(inclusive_min=(0, 2, 0), exclusive_max=(2, 3, 5)) + result = t.intersect(chunk) + assert result is not None + restricted, out_indices = result + # A DimensionMap for the residual slice dim survives (no post-init error). + assert any(isinstance(m, DimensionMap) for m in restricted.output) + assert out_indices is not None + + def test_length1_orthogonal_not_treated_as_correlated(self) -> None: + """A length-1 orthogonal array (all-singleton shape) is still an outer + product with the length-3 axis: out_indices is a dict, not a flat array.""" + t = IndexTransform.from_shape((6, 6)).oindex[np.array([2]), np.array([1, 3, 5])] + chunk = IndexDomain(inclusive_min=(0, 0), exclusive_max=(6, 6)) + result = t.intersect(chunk) + assert result is not None + _restricted, out_indices = result + assert isinstance(out_indices, dict) From 24f9ad19430dc88bc1d92b5e1936ac6b3e20f4fe Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Sun, 2 Aug 2026 15:09:12 +0200 Subject: [PATCH 29/61] fix: make consolidated metadata nesting independent of persisted key order (#4227) * fix: make consolidated metadata nesting independent of persisted key order `ConsolidatedMetadata._flat_to_nested` grouped the flat keys with `itertools.groupby` over keys sorted by depth alone. `groupby` only groups *consecutive* runs, so when a parent's children were not adjacent it emitted several runs for the same parent and the surrounding dict comprehension kept only the last one. Every child in the earlier runs was silently never re-parented, and lingered as a bogus slash-containing key at the top level, making it unreachable through the consolidated metadata. The persisted key order is arbitrary, so nesting must not depend on it. Group by parent with an accumulating mapping instead. This is reachable from zarr-python itself: `to_dict` sorts keys by `(depth, NFKC-casefold(key))`, so sibling subtrees whose names differ only by case interleave and trigger exactly this pattern. Fixes #4226 Assisted-by: ClaudeCode:claude-opus-5 * docs: add changelog entry for 273 Assisted-by: ClaudeCode:claude-opus-5 * docs: renumber changelog fragment to the upstream PR number Assisted-by: ClaudeCode:claude-opus-5 --- changes/4227.bugfix.md | 1 + src/zarr/core/group.py | 11 +++-- tests/test_metadata/test_consolidated.py | 62 ++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 changes/4227.bugfix.md diff --git a/changes/4227.bugfix.md b/changes/4227.bugfix.md new file mode 100644 index 0000000000..18293178bd --- /dev/null +++ b/changes/4227.bugfix.md @@ -0,0 +1 @@ +Consolidated metadata is now reconstructed independently of the order the keys appear in on disk. Previously, sibling subtrees whose keys were not adjacent in the persisted mapping lost their children, which made nodes unreachable through consolidated metadata -- most visibly for sibling groups whose names differ only by case. diff --git a/src/zarr/core/group.py b/src/zarr/core/group.py index 922eaf1498..65f7767a29 100644 --- a/src/zarr/core/group.py +++ b/src/zarr/core/group.py @@ -1,7 +1,6 @@ from __future__ import annotations import asyncio -import itertools import logging import unicodedata import warnings @@ -237,10 +236,12 @@ def _flat_to_nested( # In the example, the group at `/a/b` will have consolidated metadata # for its children `array-0` and `array-1`. - keys = sorted(metadata, key=lambda k: k.count("/")) - grouped = { - k: list(v) for k, v in itertools.groupby(keys, key=lambda k: k.rsplit("/", 1)[0]) - } + # Group keys by their parent path. This must not rely on same-parent keys + # being adjacent: the persisted key order is arbitrary, so accumulate + # instead of using itertools.groupby, which only groups consecutive runs. + grouped: dict[str, list[str]] = defaultdict(list) + for k in sorted(metadata, key=lambda k: k.count("/")): + grouped[k.rsplit("/", 1)[0]].append(k) # we go top down and directly manipulate metadata. for key, children_keys in grouped.items(): diff --git a/tests/test_metadata/test_consolidated.py b/tests/test_metadata/test_consolidated.py index e6087435fe..cd0fd92d74 100644 --- a/tests/test_metadata/test_consolidated.py +++ b/tests/test_metadata/test_consolidated.py @@ -839,3 +839,65 @@ async def test_open_group_in_non_consolidating_stores() -> None: # Opening a group with use_consolidated=True should fail with pytest.raises(ValueError, match="doesn't support consolidated metadata"): await AsyncGroup.open(memory_store, use_consolidated=True) + + +@pytest.mark.parametrize( + "order", + [ + # keys grouped by parent, the order zarr-python used to write before it + # started sorting the persisted keys + ["a", "b", "a/x", "a/y", "b/x", "b/y"], + # sibling subtrees interleaved, which is what the (depth, casefold) sort + # produces for names differing only by case + ["a", "b", "a/x", "b/x", "a/y", "b/y"], + # reversed, to cover a parent appearing after its children in the mapping + ["b/y", "b/x", "a/y", "a/x", "b", "a"], + ], +) +def test_flat_to_nested_is_order_independent(order: list[str]) -> None: + """The persisted key order is arbitrary, so nesting must not depend on it.""" + group_metadata: dict[str, JSON] = {"zarr_format": 3, "node_type": "group", "attributes": {}} + consolidated = ConsolidatedMetadata.from_dict( + { + "kind": "inline", + "must_understand": False, + "metadata": dict.fromkeys(order, group_metadata), + } + ) + + assert sorted(consolidated.metadata) == ["a", "b"] + for name in ("a", "b"): + child = consolidated.metadata[name] + assert isinstance(child, GroupMetadata) + assert child.consolidated_metadata is not None + assert sorted(child.consolidated_metadata.metadata) == ["x", "y"] + + +async def test_consolidated_metadata_case_differing_siblings(memory_store: Store) -> None: + """Sibling nodes whose names differ only by case each keep their own children. + + Regression test for https://github.com/zarr-developers/zarr-python/issues/4226 + """ + root = await zarr.api.asynchronous.create_group(store=memory_store) + for name in ("Study", "study"): + child = await root.create_group(f"obs/{name}") + await child.create_array(name="categories", shape=(2,), dtype="uint8") + await child.create_array(name="codes", shape=(2,), dtype="uint8") + + with pytest.warns( + ZarrUserWarning, + match="Consolidated metadata is currently not part in the Zarr format 3 specification.", + ): + await consolidate_metadata(memory_store) + + consolidated = await open_consolidated(store=memory_store) + result = sorted([key async for key, _ in consolidated.members(max_depth=None)]) + assert result == [ + "obs", + "obs/Study", + "obs/Study/categories", + "obs/Study/codes", + "obs/study", + "obs/study/categories", + "obs/study/codes", + ] From 976be695a843dd2e5ebea5157f4cc7c22d9adef2 Mon Sep 17 00:00:00 2001 From: Joe Hamman Date: Mon, 3 Aug 2026 10:15:17 -0700 Subject: [PATCH 30/61] Convert rst double-backtick docstring markup to markdown (#4193) Docstring-only change: replace ``code`` (reStructuredText) with `code` (Markdown) in zarr.api.asynchronous, zarr.registry, and zarr.storage._common, matching the repo's mkdocs-based docs. Co-authored-by: Claude Fable 5 Co-authored-by: Davis Bennett --- changes/4193.doc.md | 4 + src/zarr/api/asynchronous.py | 72 +++++++++--------- src/zarr/api/synchronous.py | 140 +++++++++++++++++----------------- src/zarr/core/array.py | 142 +++++++++++++++++------------------ src/zarr/registry.py | 18 ++--- src/zarr/storage/_common.py | 18 ++--- 6 files changed, 199 insertions(+), 195 deletions(-) create mode 100644 changes/4193.doc.md diff --git a/changes/4193.doc.md b/changes/4193.doc.md new file mode 100644 index 0000000000..0972e8be2c --- /dev/null +++ b/changes/4193.doc.md @@ -0,0 +1,4 @@ +Converted remaining reStructuredText-style double-backtick markup to Markdown +single backticks in the docstrings of `zarr.api.asynchronous`, +`zarr.api.synchronous`, `zarr.core.array`, `zarr.registry`, and +`zarr.storage._common`. No functional changes. diff --git a/src/zarr/api/asynchronous.py b/src/zarr/api/asynchronous.py index f5e614a051..3bdc254ea5 100644 --- a/src/zarr/api/asynchronous.py +++ b/src/zarr/api/asynchronous.py @@ -103,7 +103,7 @@ def _infer_overwrite(mode: AccessModeLiteral) -> bool: """ - Check that an ``AccessModeLiteral`` is compatible with overwriting an existing Zarr node. + Check that an `AccessModeLiteral` is compatible with overwriting an existing Zarr node. """ return mode in _OVERWRITE_MODES @@ -112,9 +112,9 @@ def _warn_unimplemented_kwargs(kwargs: dict[str, Any]) -> None: """ Emit a "not yet implemented" warning for each provided keyword argument that is not None. - ``kwargs`` maps a keyword argument name to its supplied value. The ``stacklevel`` is chosen + `kwargs` maps a keyword argument name to its supplied value. The `stacklevel` is chosen so the warning points at the caller of the public API function (the same location as an - inline ``warnings.warn(..., stacklevel=2)`` would). + inline `warnings.warn(..., stacklevel=2)` would). """ for name, value in kwargs.items(): if value is not None: @@ -194,7 +194,7 @@ async def consolidate_metadata( Upon completion, the metadata of the root node in the Zarr hierarchy will be updated to include all the metadata of child nodes. For Stores that do - not support consolidated metadata, this operation raises a ``TypeError``. + not support consolidated metadata, this operation raises a `TypeError`. Parameters ---------- @@ -215,10 +215,10 @@ async def consolidate_metadata( Returns ------- group: AsyncGroup - The group, with the ``consolidated_metadata`` field set to include + The group, with the `consolidated_metadata` field set to include the metadata of each child node. If the Store doesn't support consolidated metadata, this function raises a `TypeError`. - See ``Store.supports_consolidated_metadata``. + See `Store.supports_consolidated_metadata`. """ store_path = await make_store_path(store, path=path) @@ -420,7 +420,7 @@ async def open_consolidated( *args: Any, use_consolidated: Literal[True] = True, **kwargs: Any ) -> AsyncGroup: """ - Alias for [`open_group`][zarr.api.asynchronous.open_group] with ``use_consolidated=True``. + Alias for [`open_group`][zarr.api.asynchronous.open_group] with `use_consolidated=True`. """ if use_consolidated is not True: raise TypeError( @@ -484,7 +484,7 @@ async def save_array( arr : ndarray NumPy array with data to save. zarr_format : {2, 3, None}, optional - The zarr format to use when saving. The default is ``None``, which will + The zarr format to use when saving. The default is `None`, which will use the default Zarr format defined in the global configuration object. path : str or None, optional The path within the store where the array will be saved. @@ -745,12 +745,12 @@ async def create_group( path : str, optional Group path within store. overwrite : bool, optional - If True, pre-existing data at ``path`` will be deleted before + If True, pre-existing data at `path` will be deleted before creating the group. zarr_format : {2, 3, None}, optional The zarr format to use when saving. - If no ``zarr_format`` is provided, the default format will be used. - This default can be changed by modifying the value of ``default_zarr_format`` + If no `zarr_format` is provided, the default format will be used. + This default can be changed by modifying the value of `default_zarr_format` in [`zarr.config`][zarr.config]. storage_options : dict If using an fsspec URL to create the store, these will be passed to @@ -828,17 +828,17 @@ async def open_group( Whether to use consolidated metadata. By default, consolidated metadata is used if it's present in the - store (in the ``zarr.json`` for Zarr format 3 and in the ``.zmetadata`` file + store (in the `zarr.json` for Zarr format 3 and in the `.zmetadata` file for Zarr format 2). - To explicitly require consolidated metadata, set ``use_consolidated=True``, + To explicitly require consolidated metadata, set `use_consolidated=True`, which will raise an exception if consolidated metadata is not found. - To explicitly *not* use consolidated metadata, set ``use_consolidated=False``, + To explicitly *not* use consolidated metadata, set `use_consolidated=False`, which will fall back to using the regular, non consolidated metadata. Zarr format 2 allowed configuring the key storing the consolidated metadata - (``.zmetadata`` by default). Specify the custom key as ``use_consolidated`` + (`.zmetadata` by default). Specify the custom key as `use_consolidated` to load consolidated metadata from a non-default key. Returns @@ -924,27 +924,27 @@ async def create( shape : int or tuple of ints Array shape. chunks : int or tuple of ints, optional - Chunk shape. If True, will be guessed from ``shape`` and ``dtype``. If - False, will be set to ``shape``, i.e., single chunk for the whole array. + Chunk shape. If True, will be guessed from `shape` and `dtype`. If + False, will be set to `shape`, i.e., single chunk for the whole array. If an int, the chunk size in each dimension will be given by the value - of ``chunks``. Default is True. + of `chunks`. Default is True. dtype : str or dtype, optional NumPy dtype. compressor : Codec, optional Primary compressor to compress chunk data. - Zarr format 2 only. Zarr format 3 arrays should use ``codecs`` instead. + Zarr format 2 only. Zarr format 3 arrays should use `codecs` instead. - If neither ``compressor`` nor ``filters`` are provided, the default compressor + If neither `compressor` nor `filters` are provided, the default compressor [`zarr.codecs.ZstdCodec`][] is used. - If ``compressor`` is set to ``None``, no compression is used. + If `compressor` is set to `None`, no compression is used. fill_value : Any, optional Fill value for the array. order : {'C', 'F'}, optional - Deprecated in favor of the ``config`` keyword argument. - Pass ``{'order': }`` to ``create`` instead of using this parameter. + Deprecated in favor of the `config` keyword argument. + Pass `{'order': }` to `create` instead of using this parameter. Memory layout to be used within each chunk. - If not specified, the ``array.order`` parameter in the global config will be used. + If not specified, the `array.order` parameter in the global config will be used. store : StoreLike or None, default=None StoreLike object to open. See the [storage documentation in the user guide][user-guide-store-like] @@ -952,12 +952,12 @@ async def create( synchronizer : object, optional Array synchronizer. overwrite : bool, optional - If True, delete all pre-existing data in ``store`` at ``path`` before + If True, delete all pre-existing data in `store` at `path` before creating the array. path : str, optional Path under which array is stored. chunk_store : StoreLike or None, default=None - Separate storage for chunks. If not provided, ``store`` will be used + Separate storage for chunks. If not provided, `store` will be used for storage of both chunks and metadata. filters : Iterable[Codec] | Literal["auto"], optional Iterable of filters to apply to each chunk of the array, in order, before serializing that @@ -970,14 +970,14 @@ async def create( For Zarr format 2, a "filter" can be any numcodecs codec; you should ensure that the order of your filters is consistent with the behavior of each filter. - The default value of ``"auto"`` instructs Zarr to use a default based on the data + The default value of `"auto"` instructs Zarr to use a default based on the data type of the array and the Zarr format specified. For all data types in Zarr V3, and most data types in Zarr V2, the default filters are empty. The only cases where default filters are not empty is when the Zarr format is 2, and the data type is a variable-length data type like [`zarr.dtype.VariableLengthUTF8`][] or [`zarr.dtype.VariableLengthUTF8`][]. In these cases, the default filters contains a single element which is a codec specific to that particular data type. - To create an array with no filters, provide an empty iterable or the value ``None``. + To create an array with no filters, provide an empty iterable or the value `None`. cache_metadata : bool, optional If True, array configuration metadata will be cached for the lifetime of the object. If False, array metadata will be reloaded @@ -993,17 +993,17 @@ async def create( A codec to encode object arrays, only needed if dtype=object. dimension_separator : {'.', '/'}, optional Separator placed between the dimensions of a chunk. - Zarr format 2 only. Zarr format 3 arrays should use ``chunk_key_encoding`` instead. + Zarr format 2 only. Zarr format 3 arrays should use `chunk_key_encoding` instead. write_empty_chunks : bool, optional - Deprecated in favor of the ``config`` keyword argument. - Pass ``{'write_empty_chunks': }`` to ``create`` instead of using this parameter. + Deprecated in favor of the `config` keyword argument. + Pass `{'write_empty_chunks': }` to `create` instead of using this parameter. If True, all chunks will be stored regardless of their contents. If False, each chunk is compared to the array's fill value prior to storing. If a chunk is uniformly equal to the fill value, then that chunk is not be stored, and the store entry for that chunk's key is deleted. zarr_format : {2, 3, None}, optional - The Zarr format to use when creating an array. The default is ``None``, + The Zarr format to use when creating an array. The default is `None`, which instructs Zarr to choose the default Zarr format value defined in the runtime configuration. meta_array : array-like, optional @@ -1016,15 +1016,15 @@ async def create( chunk_key_encoding : ChunkKeyEncoding, optional A specification of how the chunk keys are represented in storage. Zarr format 3 only. Zarr format 2 arrays should use `dimension_separator` instead. - Default is ``("default", "/")``. + Default is `("default", "/")`. codecs : Sequence of Codecs or dicts, optional An iterable of Codec or dict serializations of Codecs. Zarr V3 only. - The elements of ``codecs`` specify the transformation from array values to stored bytes. - Zarr format 3 only. Zarr format 2 arrays should use ``filters`` and ``compressor`` instead. + The elements of `codecs` specify the transformation from array values to stored bytes. + Zarr format 3 only. Zarr format 2 arrays should use `filters` and `compressor` instead. If no codecs are provided, default codecs will be used based on the data type of the array. - For most data types, the default codecs are the tuple ``(BytesCodec(), ZstdCodec())``; + For most data types, the default codecs are the tuple `(BytesCodec(), ZstdCodec())`; data types that require a special [`zarr.abc.codec.ArrayBytesCodec`][], like variable-length strings or bytes, will use the [`zarr.abc.codec.ArrayBytesCodec`][] required for the data type instead of [`zarr.codecs.BytesCodec`][]. dimension_names : Iterable[str | None] | None = None diff --git a/src/zarr/api/synchronous.py b/src/zarr/api/synchronous.py index dc12d5f7af..ebf42dca37 100644 --- a/src/zarr/api/synchronous.py +++ b/src/zarr/api/synchronous.py @@ -106,10 +106,10 @@ def consolidate_metadata( Returns ------- group: Group - The group, with the ``consolidated_metadata`` field set to include + The group, with the `consolidated_metadata` field set to include the metadata of each child node. If the Store doesn't support consolidated metadata, this function raises a `TypeError`. - See ``Store.supports_consolidated_metadata``. + See `Store.supports_consolidated_metadata`. """ return Group(sync(async_api.consolidate_metadata(store, path=path, zarr_format=zarr_format))) @@ -247,7 +247,7 @@ def open( def open_consolidated(*args: Any, use_consolidated: Literal[True] = True, **kwargs: Any) -> Group: """ - Alias for [`open_group`][zarr.api.synchronous.open_group] with ``use_consolidated=True``. + Alias for [`open_group`][zarr.api.synchronous.open_group] with `use_consolidated=True`. """ return Group( sync(async_api.open_consolidated(*args, use_consolidated=use_consolidated, **kwargs)) @@ -303,7 +303,7 @@ def save_array( arr : ndarray NumPy array with data to save. zarr_format : {2, 3, None}, optional - The zarr format to use when saving. The default is ``None``, which will + The zarr format to use when saving. The default is `None`, which will use the default Zarr format defined in the global configuration object. path : str or None, optional The path within the store where the array will be saved. @@ -530,17 +530,17 @@ def open_group( Whether to use consolidated metadata. By default, consolidated metadata is used if it's present in the - store (in the ``zarr.json`` for Zarr format 3 and in the ``.zmetadata`` file + store (in the `zarr.json` for Zarr format 3 and in the `.zmetadata` file for Zarr format 2). - To explicitly require consolidated metadata, set ``use_consolidated=True``, + To explicitly require consolidated metadata, set `use_consolidated=True`, which will raise an exception if consolidated metadata is not found. - To explicitly *not* use consolidated metadata, set ``use_consolidated=False``, + To explicitly *not* use consolidated metadata, set `use_consolidated=False`, which will fall back to using the regular, non consolidated metadata. Zarr format 2 allowed configuring the key storing the consolidated metadata - (``.zmetadata`` by default). Specify the custom key as ``use_consolidated`` + (`.zmetadata` by default). Specify the custom key as `use_consolidated` to load consolidated metadata from a non-default key. Returns @@ -587,12 +587,12 @@ def create_group( path : str, optional Group path within store. overwrite : bool, optional - If True, pre-existing data at ``path`` will be deleted before + If True, pre-existing data at `path` will be deleted before creating the group. zarr_format : {2, 3, None}, optional The zarr format to use when saving. - If no ``zarr_format`` is provided, the default format will be used. - This default can be changed by modifying the value of ``default_zarr_format`` + If no `zarr_format` is provided, the default format will be used. + This default can be changed by modifying the value of `default_zarr_format` in [`zarr.config`][zarr.config]. storage_options : dict If using an fsspec URL to create the store, these will be passed to @@ -662,27 +662,27 @@ def create( shape : int or tuple of ints Array shape. chunks : int or tuple of ints, optional - Chunk shape. If True, will be guessed from ``shape`` and ``dtype``. If - False, will be set to ``shape``, i.e., single chunk for the whole array. + Chunk shape. If True, will be guessed from `shape` and `dtype`. If + False, will be set to `shape`, i.e., single chunk for the whole array. If an int, the chunk size in each dimension will be given by the value - of ``chunks``. Default is True. + of `chunks`. Default is True. dtype : str or dtype, optional NumPy dtype. compressor : Codec, optional Primary compressor to compress chunk data. - Zarr format 2 only. Zarr format 3 arrays should use ``codecs`` instead. + Zarr format 2 only. Zarr format 3 arrays should use `codecs` instead. - If neither ``compressor`` nor ``filters`` are provided, the default compressor + If neither `compressor` nor `filters` are provided, the default compressor [`zarr.codecs.ZstdCodec`][] is used. - If ``compressor`` is set to ``None``, no compression is used. + If `compressor` is set to `None`, no compression is used. fill_value : Any, optional Fill value for the array. order : {'C', 'F'}, optional - Deprecated in favor of the ``config`` keyword argument. - Pass ``{'order': }`` to ``create`` instead of using this parameter. + Deprecated in favor of the `config` keyword argument. + Pass `{'order': }` to `create` instead of using this parameter. Memory layout to be used within each chunk. - If not specified, the ``array.order`` parameter in the global config will be used. + If not specified, the `array.order` parameter in the global config will be used. store : StoreLike or None, default=None StoreLike object to open. See the [storage documentation in the user guide][user-guide-store-like] @@ -690,12 +690,12 @@ def create( synchronizer : object, optional Array synchronizer. overwrite : bool, optional - If True, delete all pre-existing data in ``store`` at ``path`` before + If True, delete all pre-existing data in `store` at `path` before creating the array. path : str, optional Path under which array is stored. chunk_store : StoreLike or None, default=None - Separate storage for chunks. If not provided, ``store`` will be used + Separate storage for chunks. If not provided, `store` will be used for storage of both chunks and metadata. filters : Iterable[Codec] | Literal["auto"], optional Iterable of filters to apply to each chunk of the array, in order, before serializing that @@ -708,14 +708,14 @@ def create( For Zarr format 2, a "filter" can be any numcodecs codec; you should ensure that the order of your filters is consistent with the behavior of each filter. - The default value of ``"auto"`` instructs Zarr to use a default based on the data + The default value of `"auto"` instructs Zarr to use a default based on the data type of the array and the Zarr format specified. For all data types in Zarr V3, and most data types in Zarr V2, the default filters are empty. The only cases where default filters are not empty is when the Zarr format is 2, and the data type is a variable-length data type like [`zarr.dtype.VariableLengthUTF8`][] or [`zarr.dtype.VariableLengthUTF8`][]. In these cases, the default filters contains a single element which is a codec specific to that particular data type. - To create an array with no filters, provide an empty iterable or the value ``None``. + To create an array with no filters, provide an empty iterable or the value `None`. cache_metadata : bool, optional If True, array configuration metadata will be cached for the lifetime of the object. If False, array metadata will be reloaded @@ -731,17 +731,17 @@ def create( A codec to encode object arrays, only needed if dtype=object. dimension_separator : {'.', '/'}, optional Separator placed between the dimensions of a chunk. - Zarr format 2 only. Zarr format 3 arrays should use ``chunk_key_encoding`` instead. + Zarr format 2 only. Zarr format 3 arrays should use `chunk_key_encoding` instead. write_empty_chunks : bool, optional - Deprecated in favor of the ``config`` keyword argument. - Pass ``{'write_empty_chunks': }`` to ``create`` instead of using this parameter. + Deprecated in favor of the `config` keyword argument. + Pass `{'write_empty_chunks': }` to `create` instead of using this parameter. If True, all chunks will be stored regardless of their contents. If False, each chunk is compared to the array's fill value prior to storing. If a chunk is uniformly equal to the fill value, then that chunk is not be stored, and the store entry for that chunk's key is deleted. zarr_format : {2, 3, None}, optional - The Zarr format to use when creating an array. The default is ``None``, + The Zarr format to use when creating an array. The default is `None`, which instructs Zarr to choose the default Zarr format value defined in the runtime configuration. meta_array : array-like, optional @@ -754,15 +754,15 @@ def create( chunk_key_encoding : ChunkKeyEncoding, optional A specification of how the chunk keys are represented in storage. Zarr format 3 only. Zarr format 2 arrays should use `dimension_separator` instead. - Default is ``("default", "/")``. + Default is `("default", "/")`. codecs : Sequence of Codecs or dicts, optional An iterable of Codec or dict serializations of Codecs. Zarr V3 only. - The elements of ``codecs`` specify the transformation from array values to stored bytes. - Zarr format 3 only. Zarr format 2 arrays should use ``filters`` and ``compressor`` instead. + The elements of `codecs` specify the transformation from array values to stored bytes. + Zarr format 3 only. Zarr format 2 arrays should use `filters` and `compressor` instead. If no codecs are provided, default codecs will be used based on the data type of the array. - For most data types, the default codecs are the tuple ``(BytesCodec(), ZstdCodec())``; + For most data types, the default codecs are the tuple `(BytesCodec(), ZstdCodec())`; data types that require a special [`zarr.abc.codec.ArrayBytesCodec`][], like variable-length strings or bytes, will use the [`zarr.abc.codec.ArrayBytesCodec`][] required for the data type instead of [`zarr.codecs.BytesCodec`][]. dimension_names : Iterable[str | None] | None = None @@ -849,24 +849,24 @@ def create_array( [storage documentation in the user guide][user-guide-store-like] for a description of all valid StoreLike values. name : str or None, optional - The name of the array within the store. If ``name`` is ``None``, the array will be located + The name of the array within the store. If `name` is `None`, the array will be located at the root of the store. shape : ShapeLike, optional - Shape of the array. Must be ``None`` if ``data`` is provided. + Shape of the array. Must be `None` if `data` is provided. dtype : ZDTypeLike | None - Data type of the array. Must be ``None`` if ``data`` is provided. + Data type of the array. Must be `None` if `data` is provided. data : np.ndarray, optional Array-like data to use for initializing the array. If this parameter is provided, the - ``shape`` and ``dtype`` parameters must be ``None``. + `shape` and `dtype` parameters must be `None`. chunks : tuple[int, ...] | Sequence[Sequence[int]] | Literal["auto"], default="auto" Chunk shape of the array. If chunks is "auto", a chunk shape is guessed based on the shape of the array and the dtype. A nested list of per-dimension edge sizes creates a rectilinear grid. Rectilinear chunk grids are experimental and must be explicitly enabled - with ``zarr.config.set({'array.rectilinear_chunks': True})`` while the + with `zarr.config.set({'array.rectilinear_chunks': True})` while the feature is stabilizing. shards : tuple[int, ...], optional - Shard shape of the array. The default value of ``None`` results in no sharding at all. + Shard shape of the array. The default value of `None` results in no sharding at all. filters : Iterable[Codec] | Literal["auto"], optional Iterable of filters to apply to each chunk of the array, in order, before serializing that chunk to bytes. @@ -879,35 +879,35 @@ def create_array( For Zarr format 2, a "filter" can be any numcodecs codec; you should ensure that the order of your filters is consistent with the behavior of each filter. - The default value of ``"auto"`` instructs Zarr to use a default based on the data + The default value of `"auto"` instructs Zarr to use a default based on the data type of the array and the Zarr format specified. For all data types in Zarr V3, and most data types in Zarr V2, the default filters are empty. The only cases where default filters are not empty is when the Zarr format is 2, and the data type is a variable-length data type like [`zarr.dtype.VariableLengthUTF8`][] or [`zarr.dtype.VariableLengthUTF8`][]. In these cases, the default filters contains a single element which is a codec specific to that particular data type. - To create an array with no filters, provide an empty iterable or the value ``None``. + To create an array with no filters, provide an empty iterable or the value `None`. compressors : Iterable[Codec], optional List of compressors to apply to the array. Compressors are applied in order, and after any filters are applied (if any are specified) and the data is serialized into bytes. For Zarr format 3, a "compressor" is a codec that takes a bytestream, and returns another bytestream. Multiple compressors may be provided for Zarr format 3. - If no ``compressors`` are provided, a default set of compressors will be used. - These defaults can be changed by modifying the value of ``array.v3_default_compressors`` + If no `compressors` are provided, a default set of compressors will be used. + These defaults can be changed by modifying the value of `array.v3_default_compressors` in [`zarr.config`][zarr.config]. - Use ``None`` to omit default compressors. + Use `None` to omit default compressors. For Zarr format 2, a "compressor" can be any numcodecs codec. Only a single compressor may be provided for Zarr format 2. - If no ``compressor`` is provided, a default compressor will be used. + If no `compressor` is provided, a default compressor will be used. in [`zarr.config`][zarr.config]. - Use ``None`` to omit the default compressor. + Use `None` to omit the default compressor. serializer : dict[str, JSON] | ArrayBytesCodec, optional Array-to-bytes codec to use for encoding the array data. Zarr format 3 only. Zarr format 2 arrays use implicit array-to-bytes conversion. - If no ``serializer`` is provided, a default serializer will be used. - These defaults can be changed by modifying the value of ``array.v3_default_serializer`` + If no `serializer` is provided, a default serializer will be used. + These defaults can be changed by modifying the value of `array.v3_default_serializer` in [`zarr.config`][zarr.config]. fill_value : Any, optional Fill value for the array. @@ -916,17 +916,17 @@ def create_array( For Zarr format 2, this parameter sets the memory order of the array. For Zarr format 3, this parameter is deprecated, because memory order is a runtime parameter for Zarr format 3 arrays. The recommended way to specify the memory - order for Zarr format 3 arrays is via the ``config`` parameter, e.g. ``{'config': 'C'}``. - If no ``order`` is provided, a default order will be used. - This default can be changed by modifying the value of ``array.order`` in [`zarr.config`][zarr.config]. + order for Zarr format 3 arrays is via the `config` parameter, e.g. `{'config': 'C'}`. + If no `order` is provided, a default order will be used. + This default can be changed by modifying the value of `array.order` in [`zarr.config`][zarr.config]. zarr_format : {2, 3}, optional The zarr format to use when saving. attributes : dict, optional Attributes for the array. chunk_key_encoding : ChunkKeyEncodingLike, optional A specification of how the chunk keys are represented in storage. - For Zarr format 3, the default is ``{"name": "default", "separator": "/"}}``. - For Zarr format 2, the default is ``{"name": "v2", "separator": "."}}``. + For Zarr format 3, the default is `{"name": "default", "separator": "/"}}`. + For Zarr format 2, the default is `{"name": "v2", "separator": "."}}`. dimension_names : Iterable[str], optional The names of the dimensions (default is None). Zarr format 3 only. Zarr format 2 arrays should not use this parameter. @@ -935,13 +935,13 @@ def create_array( Ignored otherwise. overwrite : bool, default False Whether to overwrite an array with the same name in the store, if one exists. - If ``True``, all existing paths in the store will be deleted. + If `True`, all existing paths in the store will be deleted. config : ArrayConfigLike, optional Runtime configuration for the array. write_data : bool - If a pre-existing array-like object was provided to this function via the ``data`` parameter - then ``write_data`` determines whether the values in that array-like object should be - written to the Zarr array created by this function. If ``write_data`` is ``False``, then the + If a pre-existing array-like object was provided to this function via the `data` parameter + then `write_data` determines whether the values in that array-like object should be + written to the Zarr array created by this function. If `write_data` is `False`, then the array will be left empty. Returns @@ -1024,10 +1024,10 @@ def from_array( The array to copy. write_data : bool, default True Whether to copy the data from the input array to the new array. - If ``write_data`` is ``False``, the new array will be created with the same metadata as the + If `write_data` is `False`, the new array will be created with the same metadata as the input array, but without any data. name : str or None, optional - The name of the array within the store. If ``name`` is ``None``, the array will be located + The name of the array within the store. If `name` is `None`, the array will be located at the root of the store. chunks : tuple[int, ...] or Sequence[Sequence[int]] or "auto" or "keep", optional Chunk shape of the array. @@ -1038,7 +1038,7 @@ def from_array( - tuple[int, ...]: A tuple of integers representing the chunk shape (regular grid). - Sequence[Sequence[int]]: Per-dimension chunk edge lists (rectilinear grid). Rectilinear chunk grids are experimental and must be explicitly enabled - with ``zarr.config.set({'array.rectilinear_chunks': True})`` while the + with `zarr.config.set({'array.rectilinear_chunks': True})` while the feature is stabilizing. If not specified, defaults to "keep" if data is a zarr Array, otherwise "auto". @@ -1063,16 +1063,16 @@ def from_array( For Zarr format 2, a "filter" can be any numcodecs codec; you should ensure that the order of your filters is consistent with the behavior of each filter. - The default value of ``"keep"`` instructs Zarr to infer ``filters`` from ``data``. - If that inference is not possible, Zarr will fall back to the behavior specified by ``"auto"``, + The default value of `"keep"` instructs Zarr to infer `filters` from `data`. + If that inference is not possible, Zarr will fall back to the behavior specified by `"auto"`, which is to choose default filters based on the data type of the array and the Zarr format specified. - For all data types in Zarr V3, and most data types in Zarr V2, the default filters are the empty tuple ``()``. + For all data types in Zarr V3, and most data types in Zarr V2, the default filters are the empty tuple `()`. The only cases where default filters are not empty is when the Zarr format is 2, and the data type is a variable-length data type like [`zarr.dtype.VariableLengthUTF8`][] or [`zarr.dtype.VariableLengthUTF8`][]. In these cases, the default filters is a tuple with a single element which is a codec specific to that particular data type. - To create an array with no filters, provide an empty iterable or the value ``None``. + To create an array with no filters, provide an empty iterable or the value `None`. compressors : Iterable[Codec] or "auto" or "keep", optional List of compressors to apply to the array. Compressors are applied in order, and after any filters are applied (if any are specified) and the data is serialized into bytes. @@ -1089,17 +1089,17 @@ def from_array( - "auto": Automatically determine the compressors based on the array's dtype. - "keep": Retain the compressors of the input array if it is a zarr Array. - If no ``compressors`` are provided, defaults to "keep" if data is a zarr Array, otherwise "auto". + If no `compressors` are provided, defaults to "keep" if data is a zarr Array, otherwise "auto". serializer : dict[str, JSON] | ArrayBytesCodec or "auto" or "keep", optional Array-to-bytes codec to use for encoding the array data. Zarr format 3 only. Zarr format 2 arrays use implicit array-to-bytes conversion. Following values are supported: - - dict[str, JSON]: A dict representation of an ``ArrayBytesCodec``. - - ArrayBytesCodec: An instance of ``ArrayBytesCodec``. + - dict[str, JSON]: A dict representation of an `ArrayBytesCodec`. + - ArrayBytesCodec: An instance of `ArrayBytesCodec`. - "auto": a default serializer will be used. These defaults can be changed by modifying the value of - ``array.v3_default_serializer`` in [`zarr.config`][zarr.config]. + `array.v3_default_serializer` in [`zarr.config`][zarr.config]. - "keep": Retain the serializer of the input array if it is a zarr Array. fill_value : Any, optional @@ -1110,7 +1110,7 @@ def from_array( For Zarr format 2, this parameter sets the memory order of the array. For Zarr format 3, this parameter is deprecated, because memory order is a runtime parameter for Zarr format 3 arrays. The recommended way to specify the memory - order for Zarr format 3 arrays is via the ``config`` parameter, e.g. ``{'config': 'C'}``. + order for Zarr format 3 arrays is via the `config` parameter, e.g. `{'config': 'C'}`. If not specified, defaults to the memory order of the data array. zarr_format : {2, 3}, optional The zarr format to use when saving. @@ -1120,8 +1120,8 @@ def from_array( If not specified, defaults to the attributes of the data array. chunk_key_encoding : ChunkKeyEncoding, optional A specification of how the chunk keys are represented in storage. - For Zarr format 3, the default is ``{"name": "default", "separator": "/"}}``. - For Zarr format 2, the default is ``{"name": "v2", "separator": "."}}``. + For Zarr format 3, the default is `{"name": "default", "separator": "/"}}`. + For Zarr format 2, the default is `{"name": "v2", "separator": "."}}`. If not specified and the data array has the same zarr format as the target array, the chunk key encoding of the data array is used. dimension_names : Iterable[str | None] | None diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index cd51dad50c..2b31eefcd4 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -160,7 +160,7 @@ from zarr.types import AnyArray, AnyAsyncArray, ArrayV2, ArrayV3, AsyncArrayV2, AsyncArrayV3 -# Array and AsyncArray are defined in the base ``zarr`` namespace +# Array and AsyncArray are defined in the base `zarr` namespace __all__ = [ "DEFAULT_FILL_VALUE", "create_codec_pipeline", @@ -336,8 +336,8 @@ async def _prepare_overwrite( """ Prepare a store path for writing a new node. - If ``overwrite`` is true and the store supports deletes, any existing node at - ``store_path`` is deleted. Otherwise, the absence of an existing node is enforced + If `overwrite` is true and the store supports deletes, any existing node at + `store_path` is deleted. Otherwise, the absence of an existing node is enforced (raising if one is present). """ if overwrite and store_path.store.supports_deletes: @@ -867,10 +867,10 @@ def read_chunk_sizes(self) -> tuple[tuple[int, ...], ...]: Boundary chunks that extend past the array shape are clipped, so the last size along a dimension may be smaller than the declared - chunk size. This matches the dask ``Array.chunks`` convention. + chunk size. This matches the dask `Array.chunks` convention. When sharding is used, returns the inner chunk sizes. - Otherwise, returns the outer chunk sizes (same as ``write_chunk_sizes``). + Otherwise, returns the outer chunk sizes (same as `write_chunk_sizes`). Returns ------- @@ -900,7 +900,7 @@ def write_chunk_sizes(self) -> tuple[tuple[int, ...], ...]: Always returns the outer chunk sizes, regardless of sharding. Boundary chunks that extend past the array shape are clipped, so the last size along a dimension may be smaller than the declared - chunk size. This matches the dask ``Array.chunks`` convention. + chunk size. This matches the dask `Array.chunks` convention. Returns ------- @@ -1439,7 +1439,7 @@ def nbytes(self) -> int: ----- This value is calculated by multiplying the number of elements in the array and the size of each element, the latter of which is determined by the dtype of the array. - For this reason, ``nbytes`` will likely be inaccurate for arrays with variable-length + For this reason, `nbytes` will likely be inaccurate for arrays with variable-length dtypes. It is not possible to determine the size of an array with variable-length elements from the shape and dtype alone. """ @@ -2041,10 +2041,10 @@ def read_chunk_sizes(self) -> tuple[tuple[int, ...], ...]: Boundary chunks that extend past the array shape are clipped, so the last size along a dimension may be smaller than the declared - chunk size. This matches the dask ``Array.chunks`` convention. + chunk size. This matches the dask `Array.chunks` convention. When sharding is used, returns the inner chunk sizes. - Otherwise, returns the outer chunk sizes (same as ``write_chunk_sizes``). + Otherwise, returns the outer chunk sizes (same as `write_chunk_sizes`). Returns ------- @@ -2068,7 +2068,7 @@ def write_chunk_sizes(self) -> tuple[tuple[int, ...], ...]: Always returns the outer chunk sizes, regardless of sharding. Boundary chunks that extend past the array shape are clipped, so the last size along a dimension may be smaller than the declared - chunk size. This matches the dask ``Array.chunks`` convention. + chunk size. This matches the dask `Array.chunks` convention. Returns ------- @@ -2286,7 +2286,7 @@ def nbytes(self) -> int: ----- This value is calculated by multiplying the number of elements in the array and the size of each element, the latter of which is determined by the dtype of the array. - For this reason, ``nbytes`` will likely be inaccurate for arrays with variable-length + For this reason, `nbytes` will likely be inaccurate for arrays with variable-length dtypes. It is not possible to determine the size of an array with variable-length elements from the shape and dtype alone. """ @@ -2300,7 +2300,7 @@ def nchunks_initialized(self) -> int: This value is calculated as the product of the number of initialized shards and the number of chunks per shard. For arrays that do not use sharding, the number of chunks per shard is effectively 1, and in that case the number of chunks initialized is the same as the number of stored objects associated with an - array. For a direct count of the number of initialized stored objects, see ``nshards_initialized``. + array. For a direct count of the number of initialized stored objects, see `nshards_initialized`. Returns ------- @@ -3980,7 +3980,7 @@ def info_complete(self) -> Any: """ Returns all the information about an array, including information from the Store. - In addition to the statically known information like ``name`` and ``zarr_format``, + In addition to the statically known information like `name` and `zarr_format`, this includes additional information like the size of the array in bytes and the number of chunks written. @@ -4098,10 +4098,10 @@ async def from_array( The array to copy. write_data : bool, default True Whether to copy the data from the input array to the new array. - If ``write_data`` is ``False``, the new array will be created with the same metadata as the + If `write_data` is `False`, the new array will be created with the same metadata as the input array, but without any data. name : str or None, optional - The name of the array within the store. If ``name`` is ``None``, the array will be located + The name of the array within the store. If `name` is `None`, the array will be located at the root of the store. chunks : tuple[int, ...] or Sequence[Sequence[int]] or "auto" or "keep", optional Chunk shape of the array. @@ -4112,7 +4112,7 @@ async def from_array( - tuple[int, ...]: A tuple of integers representing the chunk shape (regular grid). - Sequence[Sequence[int]]: Per-dimension chunk edge lists (rectilinear grid). Rectilinear chunk grids are experimental and must be explicitly enabled - with ``zarr.config.set({'array.rectilinear_chunks': True})`` while the + with `zarr.config.set({'array.rectilinear_chunks': True})` while the feature is stabilizing. If not specified, defaults to "keep" if data is a zarr Array, otherwise "auto". @@ -4137,16 +4137,16 @@ async def from_array( For Zarr format 2, a "filter" can be any numcodecs codec; you should ensure that the order of your filters is consistent with the behavior of each filter. - The default value of ``"keep"`` instructs Zarr to infer ``filters`` from ``data``. - If that inference is not possible, Zarr will fall back to the behavior specified by ``"auto"``, + The default value of `"keep"` instructs Zarr to infer `filters` from `data`. + If that inference is not possible, Zarr will fall back to the behavior specified by `"auto"`, which is to choose default filters based on the data type of the array and the Zarr format specified. - For all data types in Zarr V3, and most data types in Zarr V2, the default filters are the empty tuple ``()``. + For all data types in Zarr V3, and most data types in Zarr V2, the default filters are the empty tuple `()`. The only cases where default filters are not empty is when the Zarr format is 2, and the data type is a variable-length data type like [`zarr.dtype.VariableLengthUTF8`][] or [`zarr.dtype.VariableLengthUTF8`][]. In these cases, the default filters is a tuple with a single element which is a codec specific to that particular data type. - To create an array with no filters, provide an empty iterable or the value ``None``. + To create an array with no filters, provide an empty iterable or the value `None`. compressors : Iterable[Codec] or "auto" or "keep", optional List of compressors to apply to the array. Compressors are applied in order, and after any filters are applied (if any are specified) and the data is serialized into bytes. @@ -4163,17 +4163,17 @@ async def from_array( - "auto": Automatically determine the compressors based on the array's dtype. - "keep": Retain the compressors of the input array if it is a zarr Array. - If no ``compressors`` are provided, defaults to "keep" if data is a zarr Array, otherwise "auto". + If no `compressors` are provided, defaults to "keep" if data is a zarr Array, otherwise "auto". serializer : dict[str, JSON] | ArrayBytesCodec or "auto" or "keep", optional Array-to-bytes codec to use for encoding the array data. Zarr format 3 only. Zarr format 2 arrays use implicit array-to-bytes conversion. Following values are supported: - - dict[str, JSON]: A dict representation of an ``ArrayBytesCodec``. - - ArrayBytesCodec: An instance of ``ArrayBytesCodec``. + - dict[str, JSON]: A dict representation of an `ArrayBytesCodec`. + - ArrayBytesCodec: An instance of `ArrayBytesCodec`. - "auto": a default serializer will be used. These defaults can be changed by modifying the value of - ``array.v3_default_serializer`` in [`zarr.config`][zarr.config]. + `array.v3_default_serializer` in [`zarr.config`][zarr.config]. - "keep": Retain the serializer of the input array if it is a zarr Array. fill_value : Any, optional @@ -4184,7 +4184,7 @@ async def from_array( For Zarr format 2, this parameter sets the memory order of the array. For Zarr format 3, this parameter is deprecated, because memory order is a runtime parameter for Zarr format 3 arrays. The recommended way to specify the memory - order for Zarr format 3 arrays is via the ``config`` parameter, e.g. ``{'config': 'C'}``. + order for Zarr format 3 arrays is via the `config` parameter, e.g. `{'config': 'C'}`. If not specified, defaults to the memory order of the data array. zarr_format : {2, 3}, optional The zarr format to use when saving. @@ -4194,8 +4194,8 @@ async def from_array( If not specified, defaults to the attributes of the data array. chunk_key_encoding : ChunkKeyEncoding, optional A specification of how the chunk keys are represented in storage. - For Zarr format 3, the default is ``{"name": "default", "separator": "/"}}``. - For Zarr format 2, the default is ``{"name": "v2", "separator": "."}}``. + For Zarr format 3, the default is `{"name": "default", "separator": "/"}}`. + For Zarr format 2, the default is `{"name": "v2", "separator": "."}}`. If not specified and the data array has the same zarr format as the target array, the chunk key encoding of the data array is used. dimension_names : Iterable[str | None] | None @@ -4373,7 +4373,7 @@ async def init_array( Chunk shape of the array. If not specified, default are guessed based on the shape and dtype. shards : tuple[int, ...], optional - Shard shape of the array. The default value of ``None`` results in no sharding at all. + Shard shape of the array. The default value of `None` results in no sharding at all. filters : Iterable[Codec] | Literal["auto"], optional Iterable of filters to apply to each chunk of the array, in order, before serializing that chunk to bytes. @@ -4385,26 +4385,26 @@ async def init_array( For Zarr format 2, a "filter" can be any numcodecs codec; you should ensure that the order of your filters is consistent with the behavior of each filter. - The default value of ``"auto"`` instructs Zarr to use a default based on the data + The default value of `"auto"` instructs Zarr to use a default based on the data type of the array and the Zarr format specified. For all data types in Zarr V3, and most data types in Zarr V2, the default filters are empty. The only cases where default filters are not empty is when the Zarr format is 2, and the data type is a variable-length data type like [`zarr.dtype.VariableLengthUTF8`][] or [`zarr.dtype.VariableLengthUTF8`][]. In these cases, the default filters contains a single element which is a codec specific to that particular data type. - To create an array with no filters, provide an empty iterable or the value ``None``. + To create an array with no filters, provide an empty iterable or the value `None`. compressors : Iterable[Codec] | Literal["auto"], optional List of compressors to apply to the array. Compressors are applied in order, and after any filters are applied (if any are specified) and the data is serialized into bytes. - The default value of ``"auto"`` instructs Zarr to use a default of [`zarr.codecs.ZstdCodec`][]. + The default value of `"auto"` instructs Zarr to use a default of [`zarr.codecs.ZstdCodec`][]. - To create an array with no compressors, provide an empty iterable or the value ``None``. + To create an array with no compressors, provide an empty iterable or the value `None`. serializer : dict[str, JSON] | ArrayBytesCodec | Literal["auto"], optional Array-to-bytes codec to use for encoding the array data. Zarr format 3 only. Zarr format 2 arrays use implicit array-to-bytes conversion. - The default value of ``"auto"`` instructs Zarr to use a default codec based on the data type of the array. + The default value of `"auto"` instructs Zarr to use a default codec based on the data type of the array. For most data types this default codec is [`zarr.codecs.BytesCodec`][]. For [`zarr.dtype.VariableLengthUTF8`][], the default codec is [`zarr.codecs.VlenUTF8Codec`][]. For [`zarr.dtype.VariableLengthBytes`][], the default codec is [`zarr.codecs.VlenBytesCodec`][]. @@ -4415,17 +4415,17 @@ async def init_array( For Zarr format 2, this parameter sets the memory order of the array. For Zarr format 3, this parameter is deprecated, because memory order is a runtime parameter for Zarr format 3 arrays. The recommended way to specify the memory - order for Zarr format 3 arrays is via the ``config`` parameter, e.g. ``{'config': 'C'}``. - If no ``order`` is provided, a default order will be used. - This default can be changed by modifying the value of ``array.order`` in [`zarr.config`][zarr.config]. + order for Zarr format 3 arrays is via the `config` parameter, e.g. `{'config': 'C'}`. + If no `order` is provided, a default order will be used. + This default can be changed by modifying the value of `array.order` in [`zarr.config`][zarr.config]. zarr_format : {2, 3}, optional The zarr format to use when saving. attributes : dict, optional Attributes for the array. chunk_key_encoding : ChunkKeyEncodingLike, optional A specification of how the chunk keys are represented in storage. - For Zarr format 3, the default is ``{"name": "default", "separator": "/"}}``. - For Zarr format 2, the default is ``{"name": "v2", "separator": "."}}``. + For Zarr format 3, the default is `{"name": "default", "separator": "/"}}`. + For Zarr format 2, the default is `{"name": "v2", "separator": "."}}`. dimension_names : Iterable[str], optional The names of the dimensions (default is None). Zarr format 3 only. Zarr format 2 arrays should not use this parameter. @@ -4433,7 +4433,7 @@ async def init_array( Whether to overwrite an array with the same name in the store, if one exists. config : ArrayConfigLike or None, default=None Configuration for this array. - If ``None``, the default array runtime configuration will be used. This default + If `None`, the default array runtime configuration will be used. This default is stored in the global configuration object. Returns @@ -4595,24 +4595,24 @@ async def create_array( [storage documentation in the user guide][user-guide-store-like] for a description of all valid StoreLike values. name : str or None, optional - The name of the array within the store. If ``name`` is ``None``, the array will be located + The name of the array within the store. If `name` is `None`, the array will be located at the root of the store. shape : ShapeLike, optional - Shape of the array. Must be ``None`` if ``data`` is provided. + Shape of the array. Must be `None` if `data` is provided. dtype : ZDTypeLike | None - Data type of the array. Must be ``None`` if ``data`` is provided. + Data type of the array. Must be `None` if `data` is provided. data : np.ndarray, optional Array-like data to use for initializing the array. If this parameter is provided, the - ``shape`` and ``dtype`` parameters must be ``None``. + `shape` and `dtype` parameters must be `None`. chunks : tuple[int, ...] | Sequence[Sequence[int]] | Literal["auto"], default="auto" Chunk shape of the array. If chunks is "auto", a chunk shape is guessed based on the shape of the array and the dtype. A nested list of per-dimension edge sizes creates a rectilinear grid. Rectilinear chunk grids are experimental and must be explicitly enabled - with ``zarr.config.set({'array.rectilinear_chunks': True})`` while the + with `zarr.config.set({'array.rectilinear_chunks': True})` while the feature is stabilizing. shards : tuple[int, ...], optional - Shard shape of the array. The default value of ``None`` results in no sharding at all. + Shard shape of the array. The default value of `None` results in no sharding at all. filters : Iterable[Codec] | Literal["auto"], optional Iterable of filters to apply to each chunk of the array, in order, before serializing that chunk to bytes. @@ -4625,35 +4625,35 @@ async def create_array( For Zarr format 2, a "filter" can be any numcodecs codec; you should ensure that the order of your filters is consistent with the behavior of each filter. - The default value of ``"auto"`` instructs Zarr to use a default based on the data + The default value of `"auto"` instructs Zarr to use a default based on the data type of the array and the Zarr format specified. For all data types in Zarr V3, and most data types in Zarr V2, the default filters are empty. The only cases where default filters are not empty is when the Zarr format is 2, and the data type is a variable-length data type like [`zarr.dtype.VariableLengthUTF8`][] or [`zarr.dtype.VariableLengthUTF8`][]. In these cases, the default filters contains a single element which is a codec specific to that particular data type. - To create an array with no filters, provide an empty iterable or the value ``None``. + To create an array with no filters, provide an empty iterable or the value `None`. compressors : Iterable[Codec], optional List of compressors to apply to the array. Compressors are applied in order, and after any filters are applied (if any are specified) and the data is serialized into bytes. For Zarr format 3, a "compressor" is a codec that takes a bytestream, and returns another bytestream. Multiple compressors may be provided for Zarr format 3. - If no ``compressors`` are provided, a default set of compressors will be used. - These defaults can be changed by modifying the value of ``array.v3_default_compressors`` + If no `compressors` are provided, a default set of compressors will be used. + These defaults can be changed by modifying the value of `array.v3_default_compressors` in [`zarr.config`][zarr.config]. - Use ``None`` to omit default compressors. + Use `None` to omit default compressors. For Zarr format 2, a "compressor" can be any numcodecs codec. Only a single compressor may be provided for Zarr format 2. - If no ``compressor`` is provided, a default compressor will be used. + If no `compressor` is provided, a default compressor will be used. in [`zarr.config`][zarr.config]. - Use ``None`` to omit the default compressor. + Use `None` to omit the default compressor. serializer : dict[str, JSON] | ArrayBytesCodec, optional Array-to-bytes codec to use for encoding the array data. Zarr format 3 only. Zarr format 2 arrays use implicit array-to-bytes conversion. - If no ``serializer`` is provided, a default serializer will be used. - These defaults can be changed by modifying the value of ``array.v3_default_serializer`` + If no `serializer` is provided, a default serializer will be used. + These defaults can be changed by modifying the value of `array.v3_default_serializer` in [`zarr.config`][zarr.config]. fill_value : Any, optional Fill value for the array. @@ -4662,17 +4662,17 @@ async def create_array( For Zarr format 2, this parameter sets the memory order of the array. For Zarr format 3, this parameter is deprecated, because memory order is a runtime parameter for Zarr format 3 arrays. The recommended way to specify the memory - order for Zarr format 3 arrays is via the ``config`` parameter, e.g. ``{'config': 'C'}``. - If no ``order`` is provided, a default order will be used. - This default can be changed by modifying the value of ``array.order`` in [`zarr.config`][zarr.config]. + order for Zarr format 3 arrays is via the `config` parameter, e.g. `{'config': 'C'}`. + If no `order` is provided, a default order will be used. + This default can be changed by modifying the value of `array.order` in [`zarr.config`][zarr.config]. zarr_format : {2, 3}, optional The zarr format to use when saving. attributes : dict, optional Attributes for the array. chunk_key_encoding : ChunkKeyEncodingLike, optional A specification of how the chunk keys are represented in storage. - For Zarr format 3, the default is ``{"name": "default", "separator": "/"}}``. - For Zarr format 2, the default is ``{"name": "v2", "separator": "."}}``. + For Zarr format 3, the default is `{"name": "default", "separator": "/"}}`. + For Zarr format 2, the default is `{"name": "v2", "separator": "."}}`. dimension_names : Iterable[str], optional The names of the dimensions (default is None). Zarr format 3 only. Zarr format 2 arrays should not use this parameter. @@ -4681,13 +4681,13 @@ async def create_array( Ignored otherwise. overwrite : bool, default False Whether to overwrite an array with the same name in the store, if one exists. - If ``True``, all existing paths in the store will be deleted. + If `True`, all existing paths in the store will be deleted. config : ArrayConfigLike, optional Runtime configuration for the array. write_data : bool - If a pre-existing array-like object was provided to this function via the ``data`` parameter - then ``write_data`` determines whether the values in that array-like object should be - written to the Zarr array created by this function. If ``write_data`` is ``False``, then the + If a pre-existing array-like object was provided to this function via the `data` parameter + then `write_data` determines whether the values in that array-like object should be + written to the Zarr array created by this function. If `write_data` is `False`, then the array will be left empty. Returns @@ -4885,7 +4885,7 @@ def default_compressors_v3(dtype: ZDType[Any, Any]) -> tuple[BytesBytesCodec, .. """ Given a data type, return the default compressors for that data type. - This is just a tuple containing ``ZstdCodec`` + This is just a tuple containing `ZstdCodec` """ return (ZstdCodec(),) @@ -4894,12 +4894,12 @@ def default_serializer_v3(dtype: ZDType[Any, Any]) -> ArrayBytesCodec: """ Given a data type, return the default serializer for that data type. - The default serializer for most data types is the ``BytesCodec``, which may or may not be + The default serializer for most data types is the `BytesCodec`, which may or may not be parameterized with an endianness, depending on whether the data type has endianness. Variable - length strings and variable length bytes have hard-coded serializers -- ``VLenUTF8Codec`` and - ``VLenBytesCodec``, respectively. + length strings and variable length bytes have hard-coded serializers -- `VLenUTF8Codec` and + `VLenBytesCodec`, respectively. - Structured data types with multi-byte fields use ``BytesCodec`` with little-endian encoding. + Structured data types with multi-byte fields use `BytesCodec` with little-endian encoding. """ serializer: ArrayBytesCodec = BytesCodec(endian=None) @@ -4923,7 +4923,7 @@ def default_filters_v2(dtype: ZDType[Any, Any]) -> tuple[Numcodec] | None: Given a data type, return the default filters for that data type. For data types that require an object codec, namely variable length data types, - this is a tuple containing the object codec. Otherwise it's ``None``. + this is a tuple containing the object codec. Otherwise it's `None`. """ if isinstance(dtype, HasObjectCodec): if dtype.object_codec_id == "vlen-bytes": @@ -4944,7 +4944,7 @@ def default_compressor_v2(dtype: ZDType[Any, Any]) -> Numcodec: """ Given a data type, return the default compressors for that data type. - This is just the numcodecs ``Zstd`` codec. + This is just the numcodecs `Zstd` codec. """ from numcodecs import Zstd @@ -5101,7 +5101,7 @@ def _parse_data_params( dtype: ZDTypeLike | None, ) -> tuple[np.ndarray[Any, np.dtype[Any]] | None, ShapeLike, ZDTypeLike]: """ - Ensure an array-like ``data`` parameter is consistent with the ``dtype`` and ``shape`` + Ensure an array-like `data` parameter is consistent with the `dtype` and `shape` parameters. """ if data is None: diff --git a/src/zarr/registry.py b/src/zarr/registry.py index 48f60fabd7..c2c0eb2921 100644 --- a/src/zarr/registry.py +++ b/src/zarr/registry.py @@ -196,9 +196,9 @@ def _resolve_codec(data: dict[str, JSON]) -> Codec: def _parse_bytes_bytes_codec(data: dict[str, JSON] | Codec) -> BytesBytesCodec: """ - Normalize the input to a ``BytesBytesCodec`` instance. - If the input is already a ``BytesBytesCodec``, it is returned as is. If the input is a dict, it - is converted to a ``BytesBytesCodec`` instance via the ``_resolve_codec`` function. + Normalize the input to a `BytesBytesCodec` instance. + If the input is already a `BytesBytesCodec`, it is returned as is. If the input is a dict, it + is converted to a `BytesBytesCodec` instance via the `_resolve_codec` function. """ from zarr.abc.codec import BytesBytesCodec @@ -216,9 +216,9 @@ def _parse_bytes_bytes_codec(data: dict[str, JSON] | Codec) -> BytesBytesCodec: def _parse_array_bytes_codec(data: dict[str, JSON] | Codec) -> ArrayBytesCodec: """ - Normalize the input to a ``ArrayBytesCodec`` instance. - If the input is already a ``ArrayBytesCodec``, it is returned as is. If the input is a dict, it - is converted to a ``ArrayBytesCodec`` instance via the ``_resolve_codec`` function. + Normalize the input to a `ArrayBytesCodec` instance. + If the input is already a `ArrayBytesCodec`, it is returned as is. If the input is a dict, it + is converted to a `ArrayBytesCodec` instance via the `_resolve_codec` function. """ from zarr.abc.codec import ArrayBytesCodec @@ -236,9 +236,9 @@ def _parse_array_bytes_codec(data: dict[str, JSON] | Codec) -> ArrayBytesCodec: def _parse_array_array_codec(data: dict[str, JSON] | Codec) -> ArrayArrayCodec: """ - Normalize the input to a ``ArrayArrayCodec`` instance. - If the input is already a ``ArrayArrayCodec``, it is returned as is. If the input is a dict, it - is converted to a ``ArrayArrayCodec`` instance via the ``_resolve_codec`` function. + Normalize the input to a `ArrayArrayCodec` instance. + If the input is already a `ArrayArrayCodec`, it is returned as is. If the input is a dict, it + is converted to a `ArrayArrayCodec` instance via the `_resolve_codec` function. """ from zarr.abc.codec import ArrayArrayCodec diff --git a/src/zarr/storage/_common.py b/src/zarr/storage/_common.py index 7e9c035c69..ed554327cd 100644 --- a/src/zarr/storage/_common.py +++ b/src/zarr/storage/_common.py @@ -84,11 +84,11 @@ async def open(cls, store: Store, path: str, mode: AccessModeLiteral | None = No The accepted values are: - - ``'r'``: read only (must exist) - - ``'r+'``: read/write (must exist) - - ``'a'``: read/write (create if doesn't exist) - - ``'w'``: read/write (overwrite if exists) - - ``'w-'``: read/write (create if doesn't exist). + - `'r'`: read only (must exist) + - `'r+'`: read/write (must exist) + - `'a'`: read/write (create if doesn't exist) + - `'w'`: read/write (overwrite if exists) + - `'w-'`: read/write (create if doesn't exist). Raises ------ @@ -209,7 +209,7 @@ async def delete_dir(self) -> None: async def set_if_not_exists(self, default: Buffer) -> None: """ - Store a key to ``value`` if the key is not already present. + Store a key to `value` if the key is not already present. Parameters ---------- @@ -250,7 +250,7 @@ def get_sync( prototype: BufferPrototype | None = None, byte_range: ByteRequest | None = None, ) -> Buffer | None: - """Synchronous read — delegates to ``self.store.get_sync(self.path, ...)``.""" + """Synchronous read — delegates to `self.store.get_sync(self.path, ...)`.""" if not isinstance(self.store, SupportsGetSync): raise TypeError(f"Store {type(self.store).__name__} does not support synchronous get.") if prototype is None: @@ -258,13 +258,13 @@ def get_sync( return self.store.get_sync(self.path, prototype=prototype, byte_range=byte_range) def set_sync(self, value: Buffer) -> None: - """Synchronous write — delegates to ``self.store.set_sync(self.path, value)``.""" + """Synchronous write — delegates to `self.store.set_sync(self.path, value)`.""" if not isinstance(self.store, SupportsSetSync): raise TypeError(f"Store {type(self.store).__name__} does not support synchronous set.") self.store.set_sync(self.path, value) def delete_sync(self) -> None: - """Synchronous delete — delegates to ``self.store.delete_sync(self.path)``.""" + """Synchronous delete — delegates to `self.store.delete_sync(self.path)`.""" if not isinstance(self.store, SupportsDeleteSync): raise TypeError( f"Store {type(self.store).__name__} does not support synchronous delete." From 5a4767b9c4e6fcf5e4d60a7db0d08dc506935e45 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 5 Aug 2026 10:38:09 +0200 Subject: [PATCH 31/61] refactor(zarr-metadata)!: unify constant naming grammar with type names (#4232) A constant's name is now a purely syntactic transformation of the name of the `Literal` type it manifests, so the format version comes first and is spelled `ZARR_V2`/`ZARR_V3`, matching the `ZarrV2`/`ZarrV3` prefix already used by type names. This replaces the 0.4.0 split under which types put the version first and constants put it last; there is now one rule instead of two. Nine constants are renamed without aliases (pre-1.0). Digit runs stay glued to the token they follow, which keeps the spec vocabulary intact: `Uint8DataTypeName` pairs with `UINT8_DATA_TYPE_NAME`, not `UINT_8_...`, and `Crc32cCodecName` with `CRC32C_CODEC_NAME`. No dtype, codec, chunk-grid, or chunk-key-encoding constant changed name. A strict letter/digit split would have renamed 18 of them for the worse. Store keys also move to the modules describing the documents they name. They are facts about the on-disk specs, so they belong beside the types they key: `ZARR_V2_ATTRIBUTES_STORE_KEY` now lives in `v2/attributes.py` next to `ZarrV2ZAttrsJSON`, rather than in the array model. This keeps the `v2`/`v3` packages as leaf spec-description modules that never import from `model`, and drops the `_group.py` -> `_array.py` import of a key that was never array-specific. `zarr_metadata.model` re-exports all of them, and they are now also exported from the top-level namespace alongside the rest of the spec vocabulary. `CONSOLIDATED_METADATA_KEY_V3` is renamed and moved likewise, but is not a store key: v3 consolidated metadata is embedded as an extension field in the group's own `zarr.json`, so it has no paired `Literal` alias and is not passed to the store-json helpers. Three tests pin what the refactor made implicit: constant names are derived from their types mechanically, the two v3 node store keys still name the same file now that they live in different modules, and the set of value-ambiguous constants the derivation check cannot see is counted so its coverage cannot shrink unnoticed. Assisted-by: ClaudeCode:claude-opus-4.8 --- .../zarr-metadata/changes/4232.removal.md | 63 +++++++ packages/zarr-metadata/docs/api/index.md | 5 +- .../src/zarr_metadata/__init__.py | 34 +++- .../src/zarr_metadata/model/__init__.py | 56 +++--- .../src/zarr_metadata/model/_array.py | 36 ++-- .../src/zarr_metadata/model/_group.py | 58 +++--- .../src/zarr_metadata/v2/array.py | 17 +- .../src/zarr_metadata/v2/attributes.py | 14 ++ .../src/zarr_metadata/v2/consolidated.py | 14 ++ .../src/zarr_metadata/v2/group.py | 11 +- .../src/zarr_metadata/v3/array.py | 15 +- .../src/zarr_metadata/v3/consolidated.py | 12 +- .../src/zarr_metadata/v3/group.py | 15 +- .../zarr-metadata/tests/model/test_array.py | 64 ++++++- .../zarr-metadata/tests/test_public_api.py | 165 +++++++++++++++++- 15 files changed, 480 insertions(+), 99 deletions(-) create mode 100644 packages/zarr-metadata/changes/4232.removal.md diff --git a/packages/zarr-metadata/changes/4232.removal.md b/packages/zarr-metadata/changes/4232.removal.md new file mode 100644 index 0000000000..73b2a18666 --- /dev/null +++ b/packages/zarr-metadata/changes/4232.removal.md @@ -0,0 +1,63 @@ +Unified the naming grammar for SCREAMING_SNAKE constants with the one used for +type names. A constant's name is now a purely syntactic transformation of the +name of the `Literal` type it manifests, so the format version is spelled +`ZARR_V2`/`ZARR_V3` and comes first, matching the `ZarrV2`/`ZarrV3` prefix on +the corresponding type: + +- `ARRAY_METADATA_STORE_KEY_V2` → `ZARR_V2_ARRAY_METADATA_STORE_KEY` +- `ARRAY_METADATA_STORE_KEY_V3` → `ZARR_V3_ARRAY_METADATA_STORE_KEY` +- `ATTRIBUTES_STORE_KEY_V2` → `ZARR_V2_ATTRIBUTES_STORE_KEY` +- `GROUP_METADATA_STORE_KEY_V2` → `ZARR_V2_GROUP_METADATA_STORE_KEY` +- `GROUP_METADATA_STORE_KEY_V3` → `ZARR_V3_GROUP_METADATA_STORE_KEY` +- `CONSOLIDATED_METADATA_STORE_KEY_V2` → `ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY` +- `ARRAY_ORDER_V2` → `ZARR_V2_ARRAY_ORDER` +- `ARRAY_DIMENSION_SEPARATOR_V2` → `ZARR_V2_ARRAY_DIMENSION_SEPARATOR` +- `CONSOLIDATED_METADATA_KEY_V3` → `ZARR_V3_CONSOLIDATED_METADATA_KEY` + +The old names are removed, not aliased. This supersedes the 0.4.0 convention +under which type names put the format version first while constants put it +last: every constant that manifests a `Literal` type now follows the same rule +as that type. + +The last of those is the one rename the syntactic rule does not force: +`ZARR_V3_CONSOLIDATED_METADATA_KEY` manifests no `Literal` type, so it is +outside the rule and was renamed for consistency with its siblings. + +Digit runs stay glued to the token they follow, so spec vocabulary is +preserved: `Uint8DataTypeName` pairs with `UINT8_DATA_TYPE_NAME` (not +`UINT_8_...`) and `Crc32cCodecName` with `CRC32C_CODEC_NAME`. No dtype, codec, +chunk-grid, or chunk-key-encoding constant changed name. + +Constants that do not manifest a `Literal` type are outside the rule and are +unchanged: the `*_METADATA_*_KEYS_V2`/`_V3` key sets, the +`CANONICAL_*_HEX_FLOAT*` bit patterns, and `UNSET`. The key sets keep the +version-last spelling, so `zarr_metadata.model` exports both +`ARRAY_METADATA_REQUIRED_KEYS_V2` and `ZARR_V2_ARRAY_METADATA_STORE_KEY`. They +name validation policy rather than a spec document, have no paired type to +derive from, and renaming them would be a second breaking change buying only +cosmetic consistency — so it is deliberately deferred. + +`tests/test_public_api.py::test_constant_names_derive_from_their_type_names` +derives every constant name from the type it manifests and asserts they match, +so the two grammars cannot diverge again. + +Store keys also moved to the modules that describe the documents they name, +matching the package's layering (the `v2`/`v3` modules describe the specs; the +`model` layer is built on top of them). `ZARR_V2_ATTRIBUTES_STORE_KEY` now +lives in `zarr_metadata.v2.attributes` beside the `.zattrs` type it names, +rather than in the array model; the other five moved likewise, and +`ZarrV2AttributesStoreKey` is no longer an array-specific concept. +`zarr_metadata.model` re-exports all six, so +`from zarr_metadata.model import ZARR_V2_ARRAY_METADATA_STORE_KEY` is +unaffected. + +`CONSOLIDATED_METADATA_KEY_V3` moved to `zarr_metadata.v3.consolidated` and was +renamed to `ZARR_V3_CONSOLIDATED_METADATA_KEY` for consistency. It is not a +store key: unlike v2's `.zmetadata` file, v3 consolidated metadata is embedded +as an extension field inside the group's own `zarr.json`. + +All seven keys and the six store-key `Literal` aliases are now also exported +from the top-level `zarr_metadata` namespace, alongside the document types and +the rest of the spec vocabulary, so `from zarr_metadata import +ZARR_V2_ARRAY_METADATA_STORE_KEY` works. The model layer's validators, parsers, +type guards, and metadata key sets remain `zarr_metadata.model` imports. diff --git a/packages/zarr-metadata/docs/api/index.md b/packages/zarr-metadata/docs/api/index.md index 2aa39ab161..5e230c7aa2 100644 --- a/packages/zarr-metadata/docs/api/index.md +++ b/packages/zarr-metadata/docs/api/index.md @@ -17,9 +17,12 @@ The package is organized to mirror the structure of the Zarr specifications: [chunk key encodings](v3/chunk_key_encoding.md), [codecs](v3/codec.md), and [data types](v3/data_type.md) -Every public name is also re-exported at the top level, so +The document types, models, and spec vocabulary — including the store keys — +are re-exported at the top level, so `from zarr_metadata import ZarrV3ArrayMetadataJSON` and `from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON` are equivalent. +The model layer's validators, parsers, type guards, and metadata key sets are +imported from [`zarr_metadata.model`](model.md) directly. ## Common types diff --git a/packages/zarr-metadata/src/zarr_metadata/__init__.py b/packages/zarr-metadata/src/zarr_metadata/__init__.py index b5e52e976d..1a6b39f04d 100644 --- a/packages/zarr-metadata/src/zarr_metadata/__init__.py +++ b/packages/zarr-metadata/src/zarr_metadata/__init__.py @@ -3,25 +3,38 @@ from zarr_metadata._common import JSONValue, ZarrV3NamedConfigJSON from zarr_metadata.model import ( UNSET, + ZARR_V2_ARRAY_METADATA_STORE_KEY, + ZARR_V2_ATTRIBUTES_STORE_KEY, + ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY, + ZARR_V2_GROUP_METADATA_STORE_KEY, + ZARR_V3_ARRAY_METADATA_STORE_KEY, + ZARR_V3_CONSOLIDATED_METADATA_KEY, + ZARR_V3_GROUP_METADATA_STORE_KEY, MetadataValidationError, ProblemKind, ValidationProblem, ZarrV2ArrayMetadata, ZarrV2ArrayMetadataPartial, + ZarrV2ArrayMetadataStoreKey, + ZarrV2AttributesStoreKey, ZarrV2ConsolidatedMetadata, + ZarrV2ConsolidatedMetadataStoreKey, ZarrV2GroupMetadata, ZarrV2GroupMetadataPartial, + ZarrV2GroupMetadataStoreKey, ZarrV3ArrayMetadata, ZarrV3ArrayMetadataPartial, + ZarrV3ArrayMetadataStoreKey, ZarrV3ConsolidatedMetadata, ZarrV3GroupMetadata, ZarrV3GroupMetadataPartial, + ZarrV3GroupMetadataStoreKey, ZarrV3MetadataField, ZarrV3NamedConfig, ) from zarr_metadata.v2.array import ( - ARRAY_DIMENSION_SEPARATOR_V2, - ARRAY_ORDER_V2, + ZARR_V2_ARRAY_DIMENSION_SEPARATOR, + ZARR_V2_ARRAY_ORDER, ZarrV2ArrayDimensionSeparator, ZarrV2ArrayMetadataJSON, ZarrV2ArrayMetadataJSONPartial, @@ -217,8 +230,6 @@ __all__ = [ - "ARRAY_DIMENSION_SEPARATOR_V2", - "ARRAY_ORDER_V2", "BLOSC_CNAME", "BLOSC_CODEC_NAME", "BLOSC_SHUFFLE", @@ -260,6 +271,15 @@ "UNSET", "V2_CHUNK_KEY_ENCODING_NAME", "V2_CHUNK_KEY_ENCODING_SEPARATOR", + "ZARR_V2_ARRAY_DIMENSION_SEPARATOR", + "ZARR_V2_ARRAY_METADATA_STORE_KEY", + "ZARR_V2_ARRAY_ORDER", + "ZARR_V2_ATTRIBUTES_STORE_KEY", + "ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY", + "ZARR_V2_GROUP_METADATA_STORE_KEY", + "ZARR_V3_ARRAY_METADATA_STORE_KEY", + "ZARR_V3_CONSOLIDATED_METADATA_KEY", + "ZARR_V3_GROUP_METADATA_STORE_KEY", "ZSTD_CODEC_NAME", "BloscCName", "BloscCodecMetadata", @@ -343,15 +363,19 @@ "ZarrV2ArrayMetadataJSON", "ZarrV2ArrayMetadataJSONPartial", "ZarrV2ArrayMetadataPartial", + "ZarrV2ArrayMetadataStoreKey", "ZarrV2ArrayOrder", + "ZarrV2AttributesStoreKey", "ZarrV2CodecMetadata", "ZarrV2ConsolidatedMetadata", "ZarrV2ConsolidatedMetadataJSON", + "ZarrV2ConsolidatedMetadataStoreKey", "ZarrV2DataTypeMetadata", "ZarrV2GroupMetadata", "ZarrV2GroupMetadataJSON", "ZarrV2GroupMetadataJSONPartial", "ZarrV2GroupMetadataPartial", + "ZarrV2GroupMetadataStoreKey", "ZarrV2ZArrayJSON", "ZarrV2ZAttrsJSON", "ZarrV2ZGroupJSON", @@ -359,6 +383,7 @@ "ZarrV3ArrayMetadataJSON", "ZarrV3ArrayMetadataJSONPartial", "ZarrV3ArrayMetadataPartial", + "ZarrV3ArrayMetadataStoreKey", "ZarrV3ConsolidatedMetadata", "ZarrV3ConsolidatedMetadataJSON", "ZarrV3ExtensionField", @@ -366,6 +391,7 @@ "ZarrV3GroupMetadataJSON", "ZarrV3GroupMetadataJSONPartial", "ZarrV3GroupMetadataPartial", + "ZarrV3GroupMetadataStoreKey", "ZarrV3MetadataField", "ZarrV3MetadataFieldJSON", "ZarrV3NamedConfig", diff --git a/packages/zarr-metadata/src/zarr_metadata/model/__init__.py b/packages/zarr-metadata/src/zarr_metadata/model/__init__.py index e726c54d3e..edf3561d1d 100644 --- a/packages/zarr-metadata/src/zarr_metadata/model/__init__.py +++ b/packages/zarr-metadata/src/zarr_metadata/model/__init__.py @@ -12,33 +12,20 @@ """ from zarr_metadata.model._array import ( - ARRAY_METADATA_STORE_KEY_V2, - ARRAY_METADATA_STORE_KEY_V3, - ATTRIBUTES_STORE_KEY_V2, ZarrV2ArrayMetadata, ZarrV2ArrayMetadataPartial, - ZarrV2ArrayMetadataStoreKey, - ZarrV2AttributesStoreKey, ZarrV3ArrayMetadata, ZarrV3ArrayMetadataPartial, - ZarrV3ArrayMetadataStoreKey, ZarrV3MetadataField, ZarrV3NamedConfig, ) from zarr_metadata.model._group import ( - CONSOLIDATED_METADATA_KEY_V3, - CONSOLIDATED_METADATA_STORE_KEY_V2, - GROUP_METADATA_STORE_KEY_V2, - GROUP_METADATA_STORE_KEY_V3, ZarrV2ConsolidatedMetadata, - ZarrV2ConsolidatedMetadataStoreKey, ZarrV2GroupMetadata, ZarrV2GroupMetadataPartial, - ZarrV2GroupMetadataStoreKey, ZarrV3ConsolidatedMetadata, ZarrV3GroupMetadata, ZarrV3GroupMetadataPartial, - ZarrV3GroupMetadataStoreKey, ) from zarr_metadata.model._sentinel import UNSET from zarr_metadata.model._validation import ( @@ -73,23 +60,52 @@ validate_metadata_field_v3, ) +# Store keys are facts about the on-disk specs, so they are defined in the +# `v2`/`v3` modules that describe those documents. They are re-exported here +# because the model layer is where consumers reach for them. +from zarr_metadata.v2.array import ( + ZARR_V2_ARRAY_METADATA_STORE_KEY, + ZarrV2ArrayMetadataStoreKey, +) +from zarr_metadata.v2.attributes import ( + ZARR_V2_ATTRIBUTES_STORE_KEY, + ZarrV2AttributesStoreKey, +) +from zarr_metadata.v2.consolidated import ( + ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY, + ZarrV2ConsolidatedMetadataStoreKey, +) +from zarr_metadata.v2.group import ( + ZARR_V2_GROUP_METADATA_STORE_KEY, + ZarrV2GroupMetadataStoreKey, +) +from zarr_metadata.v3.array import ( + ZARR_V3_ARRAY_METADATA_STORE_KEY, + ZarrV3ArrayMetadataStoreKey, +) +from zarr_metadata.v3.consolidated import ZARR_V3_CONSOLIDATED_METADATA_KEY +from zarr_metadata.v3.group import ( + ZARR_V3_GROUP_METADATA_STORE_KEY, + ZarrV3GroupMetadataStoreKey, +) + __all__ = [ "ARRAY_METADATA_OPTIONAL_KEYS_V3", "ARRAY_METADATA_REQUIRED_KEYS_V2", "ARRAY_METADATA_REQUIRED_KEYS_V3", "ARRAY_METADATA_STANDARD_KEYS_V3", - "ARRAY_METADATA_STORE_KEY_V2", - "ARRAY_METADATA_STORE_KEY_V3", - "ATTRIBUTES_STORE_KEY_V2", - "CONSOLIDATED_METADATA_KEY_V3", - "CONSOLIDATED_METADATA_STORE_KEY_V2", "GROUP_METADATA_OPTIONAL_KEYS_V3", "GROUP_METADATA_REQUIRED_KEYS_V2", "GROUP_METADATA_REQUIRED_KEYS_V3", "GROUP_METADATA_STANDARD_KEYS_V3", - "GROUP_METADATA_STORE_KEY_V2", - "GROUP_METADATA_STORE_KEY_V3", "UNSET", + "ZARR_V2_ARRAY_METADATA_STORE_KEY", + "ZARR_V2_ATTRIBUTES_STORE_KEY", + "ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY", + "ZARR_V2_GROUP_METADATA_STORE_KEY", + "ZARR_V3_ARRAY_METADATA_STORE_KEY", + "ZARR_V3_CONSOLIDATED_METADATA_KEY", + "ZARR_V3_GROUP_METADATA_STORE_KEY", "MetadataValidationError", "ProblemKind", "ValidationProblem", diff --git a/packages/zarr-metadata/src/zarr_metadata/model/_array.py b/packages/zarr-metadata/src/zarr_metadata/model/_array.py index c4c967f891..0b562bc188 100644 --- a/packages/zarr-metadata/src/zarr_metadata/model/_array.py +++ b/packages/zarr-metadata/src/zarr_metadata/model/_array.py @@ -6,7 +6,7 @@ import dataclasses from collections.abc import Mapping from dataclasses import dataclass, field -from typing import TYPE_CHECKING, Final, Literal, TypeAlias, cast +from typing import TYPE_CHECKING, Literal, TypeAlias, cast from typing_extensions import TypedDict, Unpack @@ -22,27 +22,27 @@ parse_array_metadata_v3, parse_metadata_field_v3, ) +from zarr_metadata.v2.array import ZARR_V2_ARRAY_METADATA_STORE_KEY +from zarr_metadata.v2.attributes import ZARR_V2_ATTRIBUTES_STORE_KEY +from zarr_metadata.v3.array import ZARR_V3_ARRAY_METADATA_STORE_KEY if TYPE_CHECKING: from zarr_metadata._common import JSONValue, ZarrV3NamedConfigJSON from zarr_metadata.v2.array import ( ZarrV2ArrayDimensionSeparator, ZarrV2ArrayMetadataJSON, + ZarrV2ArrayMetadataStoreKey, ZarrV2ArrayOrder, ZarrV2DataTypeMetadata, ) + from zarr_metadata.v2.attributes import ZarrV2AttributesStoreKey from zarr_metadata.v2.codec import ZarrV2CodecMetadata from zarr_metadata.v3._common import ZarrV3MetadataFieldJSON - from zarr_metadata.v3.array import ZarrV3ArrayMetadataJSON, ZarrV3ExtensionField - -ZarrV3ArrayMetadataStoreKey = Literal["zarr.json"] -ARRAY_METADATA_STORE_KEY_V3: Final[ZarrV3ArrayMetadataStoreKey] = "zarr.json" - -ZarrV2ArrayMetadataStoreKey = Literal[".zarray"] -ARRAY_METADATA_STORE_KEY_V2: Final[ZarrV2ArrayMetadataStoreKey] = ".zarray" - -ZarrV2AttributesStoreKey = Literal[".zattrs"] -ATTRIBUTES_STORE_KEY_V2: Final[ZarrV2AttributesStoreKey] = ".zattrs" + from zarr_metadata.v3.array import ( + ZarrV3ArrayMetadataJSON, + ZarrV3ArrayMetadataStoreKey, + ZarrV3ExtensionField, + ) @dataclass(frozen=True, slots=True, kw_only=True) @@ -319,12 +319,12 @@ def must_understand_fields(self) -> dict[str, ZarrV3ExtensionField]: @classmethod def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV3ArrayMetadata: - return cls.from_json(load_store_json(mapping, ARRAY_METADATA_STORE_KEY_V3)) + return cls.from_json(load_store_json(mapping, ZARR_V3_ARRAY_METADATA_STORE_KEY)) def to_key_value( self, *, indent: int | str | None = None ) -> Mapping[ZarrV3ArrayMetadataStoreKey, bytes]: - return {ARRAY_METADATA_STORE_KEY_V3: dump_store_json(self.to_json(), indent=indent)} + return {ZARR_V3_ARRAY_METADATA_STORE_KEY: dump_store_json(self.to_json(), indent=indent)} class ZarrV2ArrayMetadataPartial(TypedDict, total=False): @@ -464,7 +464,7 @@ def from_json(cls, data: object) -> ZarrV2ArrayMetadata: @classmethod def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV2ArrayMetadata: - zarray_raw = cast("object", load_store_json(mapping, ARRAY_METADATA_STORE_KEY_V2)) + zarray_raw = cast("object", load_store_json(mapping, ZARR_V2_ARRAY_METADATA_STORE_KEY)) if not isinstance(zarray_raw, Mapping): return cls.from_json(zarray_raw) zarray = cast("Mapping[str, object]", zarray_raw) @@ -478,8 +478,8 @@ def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV2ArrayMetadata: ) ] ) - if ATTRIBUTES_STORE_KEY_V2 in mapping: - zattrs = cast("object", load_store_json(mapping, ATTRIBUTES_STORE_KEY_V2)) + if ZARR_V2_ATTRIBUTES_STORE_KEY in mapping: + zattrs = cast("object", load_store_json(mapping, ZARR_V2_ATTRIBUTES_STORE_KEY)) return cls.from_json({**zarray, "attributes": zattrs}) return cls.from_json(zarray) @@ -491,8 +491,8 @@ def to_key_value( # when attributes are set (even empty) — UNSET emits no file. zarray = {k: v for k, v in self.to_json().items() if k != "attributes"} out: dict[ZarrV2ArrayMetadataStoreKey | ZarrV2AttributesStoreKey, bytes] = { - ARRAY_METADATA_STORE_KEY_V2: dump_store_json(zarray, indent=indent) + ZARR_V2_ARRAY_METADATA_STORE_KEY: dump_store_json(zarray, indent=indent) } if self.attributes is not UNSET: - out[ATTRIBUTES_STORE_KEY_V2] = dump_store_json(self.attributes, indent=indent) + out[ZARR_V2_ATTRIBUTES_STORE_KEY] = dump_store_json(self.attributes, indent=indent) return out diff --git a/packages/zarr-metadata/src/zarr_metadata/model/_group.py b/packages/zarr-metadata/src/zarr_metadata/model/_group.py index d576833c26..63dfe5611f 100644 --- a/packages/zarr-metadata/src/zarr_metadata/model/_group.py +++ b/packages/zarr-metadata/src/zarr_metadata/model/_group.py @@ -6,12 +6,11 @@ import dataclasses from collections.abc import Mapping from dataclasses import dataclass, field -from typing import TYPE_CHECKING, Final, Literal, cast +from typing import TYPE_CHECKING, Literal, cast from typing_extensions import TypedDict, Unpack from zarr_metadata.model._array import ( - ATTRIBUTES_STORE_KEY_V2, ZarrV3ArrayMetadata, must_understand_subset, ) @@ -28,28 +27,20 @@ validate_consolidated_metadata_v3, validate_json, ) +from zarr_metadata.v2.attributes import ZARR_V2_ATTRIBUTES_STORE_KEY +from zarr_metadata.v2.consolidated import ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY +from zarr_metadata.v2.group import ZARR_V2_GROUP_METADATA_STORE_KEY +from zarr_metadata.v3.consolidated import ZARR_V3_CONSOLIDATED_METADATA_KEY +from zarr_metadata.v3.group import ZARR_V3_GROUP_METADATA_STORE_KEY if TYPE_CHECKING: from zarr_metadata._common import JSONValue - from zarr_metadata.model._array import ZarrV2AttributesStoreKey - from zarr_metadata.v2.group import ZarrV2GroupMetadataJSON + from zarr_metadata.v2.attributes import ZarrV2AttributesStoreKey + from zarr_metadata.v2.consolidated import ZarrV2ConsolidatedMetadataStoreKey + from zarr_metadata.v2.group import ZarrV2GroupMetadataJSON, ZarrV2GroupMetadataStoreKey from zarr_metadata.v3.array import ZarrV3ExtensionField from zarr_metadata.v3.consolidated import ZarrV3ConsolidatedMetadataJSON - from zarr_metadata.v3.group import ZarrV3GroupMetadataJSON - -ZarrV3GroupMetadataStoreKey = Literal["zarr.json"] -GROUP_METADATA_STORE_KEY_V3: Final[ZarrV3GroupMetadataStoreKey] = "zarr.json" - -ZarrV2GroupMetadataStoreKey = Literal[".zgroup"] -GROUP_METADATA_STORE_KEY_V2: Final[ZarrV2GroupMetadataStoreKey] = ".zgroup" - -ZarrV2ConsolidatedMetadataStoreKey = Literal[".zmetadata"] -CONSOLIDATED_METADATA_STORE_KEY_V2: Final[ZarrV2ConsolidatedMetadataStoreKey] = ".zmetadata" - -# The key under which consolidated metadata is embedded in a v3 group document. -# This is a reference-implementation convention (not a spec artifact), stored -# as an extension field on the group's `zarr.json`. -CONSOLIDATED_METADATA_KEY_V3: Final = "consolidated_metadata" + from zarr_metadata.v3.group import ZarrV3GroupMetadataJSON, ZarrV3GroupMetadataStoreKey class ZarrV3GroupMetadataPartial(TypedDict, total=False): @@ -88,7 +79,7 @@ class ZarrV3GroupMetadata: extra_fields: dict[str, ZarrV3ExtensionField] def __post_init__(self) -> None: - reserved = GROUP_METADATA_STANDARD_KEYS_V3 | {CONSOLIDATED_METADATA_KEY_V3} + reserved = GROUP_METADATA_STANDARD_KEYS_V3 | {ZARR_V3_CONSOLIDATED_METADATA_KEY} if set(self.extra_fields.keys()).intersection(reserved): raise MetadataValidationError( [ @@ -134,7 +125,7 @@ def to_json(self) -> ZarrV3GroupMetadataJSON: out["attributes"] = copy.deepcopy(self.attributes) if self.consolidated_metadata is not UNSET: # Consolidated metadata is a known non-core top-level JSON field. - out[CONSOLIDATED_METADATA_KEY_V3] = cast( + out[ZARR_V3_CONSOLIDATED_METADATA_KEY] = cast( "ZarrV3ExtensionField", self.consolidated_metadata.to_json() ) for key, value in self.extra_fields.items(): @@ -145,7 +136,7 @@ def to_json(self) -> ZarrV3GroupMetadataJSON: def from_json(cls, data: object) -> ZarrV3GroupMetadata: parsed = parse_group_metadata_v3(arrays_to_tuples(data)) # Cast for narrowing across standard and arbitrary extra TypedDict items. - consolidated_raw = cast("object", parsed.get(CONSOLIDATED_METADATA_KEY_V3, UNSET)) + consolidated_raw = cast("object", parsed.get(ZARR_V3_CONSOLIDATED_METADATA_KEY, UNSET)) consolidated: ZarrV3ConsolidatedMetadata | UNSET if consolidated_raw is UNSET or consolidated_raw is None: # consolidated_metadata: null was written by a historical @@ -162,7 +153,8 @@ def from_json(cls, data: object) -> ZarrV3GroupMetadata: { k: v for k, v in parsed.items() - if k not in GROUP_METADATA_STANDARD_KEYS_V3 and k != CONSOLIDATED_METADATA_KEY_V3 + if k not in GROUP_METADATA_STANDARD_KEYS_V3 + and k != ZARR_V3_CONSOLIDATED_METADATA_KEY }, ) return cls( @@ -185,12 +177,12 @@ def must_understand_fields(self) -> dict[str, ZarrV3ExtensionField]: @classmethod def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV3GroupMetadata: - return cls.from_json(load_store_json(mapping, GROUP_METADATA_STORE_KEY_V3)) + return cls.from_json(load_store_json(mapping, ZARR_V3_GROUP_METADATA_STORE_KEY)) def to_key_value( self, *, indent: int | str | None = None ) -> Mapping[ZarrV3GroupMetadataStoreKey, bytes]: - return {GROUP_METADATA_STORE_KEY_V3: dump_store_json(self.to_json(), indent=indent)} + return {ZARR_V3_GROUP_METADATA_STORE_KEY: dump_store_json(self.to_json(), indent=indent)} @dataclass(frozen=True, slots=True, kw_only=True) @@ -322,7 +314,7 @@ def from_json(cls, data: object) -> ZarrV2GroupMetadata: @classmethod def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV2GroupMetadata: - zgroup_raw = cast("object", load_store_json(mapping, GROUP_METADATA_STORE_KEY_V2)) + zgroup_raw = cast("object", load_store_json(mapping, ZARR_V2_GROUP_METADATA_STORE_KEY)) if not isinstance(zgroup_raw, Mapping): return cls.from_json(zgroup_raw) zgroup = cast("Mapping[str, object]", zgroup_raw) @@ -336,8 +328,8 @@ def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV2GroupMetadata: ) ] ) - if ATTRIBUTES_STORE_KEY_V2 in mapping: - zattrs = cast("object", load_store_json(mapping, ATTRIBUTES_STORE_KEY_V2)) + if ZARR_V2_ATTRIBUTES_STORE_KEY in mapping: + zattrs = cast("object", load_store_json(mapping, ZARR_V2_ATTRIBUTES_STORE_KEY)) return cls.from_json({**zgroup, "attributes": zattrs}) return cls.from_json(zgroup) @@ -349,10 +341,10 @@ def to_key_value( # when attributes are set (even empty) — UNSET emits no file. zgroup = {k: v for k, v in self.to_json().items() if k != "attributes"} out: dict[ZarrV2GroupMetadataStoreKey | ZarrV2AttributesStoreKey, bytes] = { - GROUP_METADATA_STORE_KEY_V2: dump_store_json(zgroup, indent=indent) + ZARR_V2_GROUP_METADATA_STORE_KEY: dump_store_json(zgroup, indent=indent) } if self.attributes is not UNSET: - out[ATTRIBUTES_STORE_KEY_V2] = dump_store_json(self.attributes, indent=indent) + out[ZARR_V2_ATTRIBUTES_STORE_KEY] = dump_store_json(self.attributes, indent=indent) return out @@ -434,9 +426,11 @@ def from_json(cls, data: object) -> ZarrV2ConsolidatedMetadata: @classmethod def from_key_value(cls, mapping: Mapping[str, bytes]) -> ZarrV2ConsolidatedMetadata: - return cls.from_json(load_store_json(mapping, CONSOLIDATED_METADATA_STORE_KEY_V2)) + return cls.from_json(load_store_json(mapping, ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY)) def to_key_value( self, *, indent: int | str | None = None ) -> Mapping[ZarrV2ConsolidatedMetadataStoreKey, bytes]: - return {CONSOLIDATED_METADATA_STORE_KEY_V2: dump_store_json(self.to_json(), indent=indent)} + return { + ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY: dump_store_json(self.to_json(), indent=indent) + } diff --git a/packages/zarr-metadata/src/zarr_metadata/v2/array.py b/packages/zarr-metadata/src/zarr_metadata/v2/array.py index 84b6446bcb..e026e5c655 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v2/array.py +++ b/packages/zarr-metadata/src/zarr_metadata/v2/array.py @@ -39,7 +39,7 @@ See https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html """ -ARRAY_ORDER_V2: Final = ("C", "F") +ZARR_V2_ARRAY_ORDER: Final = ("C", "F") """Tuple of permitted values for the `order` field of v2 array metadata.""" ZarrV2ArrayDimensionSeparator = Literal[".", "/"] @@ -51,7 +51,7 @@ See https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html """ -ARRAY_DIMENSION_SEPARATOR_V2: Final = (".", "/") +ZARR_V2_ARRAY_DIMENSION_SEPARATOR: Final = (".", "/") """Tuple of permitted values for the `dimension_separator` field of v2 array metadata.""" @@ -149,12 +149,21 @@ class ZarrV2ArrayMetadataJSONPartial(TypedDict, total=False): """ +ZarrV2ArrayMetadataStoreKey = Literal[".zarray"] +"""Literal type of the store key holding a v2 array's metadata document.""" + +ZARR_V2_ARRAY_METADATA_STORE_KEY: Final[ZarrV2ArrayMetadataStoreKey] = ".zarray" +"""The store key a v2 array's metadata document is persisted under.""" + + __all__ = [ - "ARRAY_DIMENSION_SEPARATOR_V2", - "ARRAY_ORDER_V2", + "ZARR_V2_ARRAY_DIMENSION_SEPARATOR", + "ZARR_V2_ARRAY_METADATA_STORE_KEY", + "ZARR_V2_ARRAY_ORDER", "ZarrV2ArrayDimensionSeparator", "ZarrV2ArrayMetadataJSON", "ZarrV2ArrayMetadataJSONPartial", + "ZarrV2ArrayMetadataStoreKey", "ZarrV2ArrayOrder", "ZarrV2DataTypeMetadata", "ZarrV2ZArrayJSON", diff --git a/packages/zarr-metadata/src/zarr_metadata/v2/attributes.py b/packages/zarr-metadata/src/zarr_metadata/v2/attributes.py index f7cc31babe..68785d1660 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v2/attributes.py +++ b/packages/zarr-metadata/src/zarr_metadata/v2/attributes.py @@ -4,6 +4,7 @@ """ from collections.abc import Mapping +from typing import Final, Literal from zarr_metadata._common import JSONValue @@ -17,6 +18,19 @@ """ +ZarrV2AttributesStoreKey = Literal[".zattrs"] +"""Literal type of the store key holding a v2 node's user attributes.""" + +ZARR_V2_ATTRIBUTES_STORE_KEY: Final[ZarrV2AttributesStoreKey] = ".zattrs" +"""The store key a v2 node's user attributes are persisted under. + +Shared by arrays and groups: both node types keep their attributes in a +sibling `.zattrs` file. +""" + + __all__ = [ + "ZARR_V2_ATTRIBUTES_STORE_KEY", + "ZarrV2AttributesStoreKey", "ZarrV2ZAttrsJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v2/consolidated.py b/packages/zarr-metadata/src/zarr_metadata/v2/consolidated.py index 6b586bb92e..999c9131da 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v2/consolidated.py +++ b/packages/zarr-metadata/src/zarr_metadata/v2/consolidated.py @@ -7,6 +7,7 @@ """ from collections.abc import Mapping +from typing import Final, Literal from typing_extensions import TypedDict @@ -37,6 +38,19 @@ class ZarrV2ConsolidatedMetadataJSON(TypedDict): metadata: Mapping[str, ZarrV2ZArrayJSON | ZarrV2ZGroupJSON | ZarrV2ZAttrsJSON] +ZarrV2ConsolidatedMetadataStoreKey = Literal[".zmetadata"] +"""Literal type of the store key holding a v2 hierarchy's consolidated metadata.""" + +ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY: Final[ZarrV2ConsolidatedMetadataStoreKey] = ".zmetadata" +"""The store key a v2 hierarchy's consolidated metadata is persisted under. + +Like the document it names, this is a reference-implementation convention +rather than a spec artifact; see the module docstring. +""" + + __all__ = [ + "ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY", "ZarrV2ConsolidatedMetadataJSON", + "ZarrV2ConsolidatedMetadataStoreKey", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v2/group.py b/packages/zarr-metadata/src/zarr_metadata/v2/group.py index 50f2482e6f..34d72742c2 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v2/group.py +++ b/packages/zarr-metadata/src/zarr_metadata/v2/group.py @@ -4,7 +4,7 @@ """ from collections.abc import Mapping -from typing import Literal, NotRequired +from typing import Final, Literal, NotRequired from typing_extensions import TypedDict @@ -74,8 +74,17 @@ class ZarrV2GroupMetadataJSONPartial(TypedDict, total=False): attributes: NotRequired[Mapping[str, JSONValue]] +ZarrV2GroupMetadataStoreKey = Literal[".zgroup"] +"""Literal type of the store key holding a v2 group's metadata document.""" + +ZARR_V2_GROUP_METADATA_STORE_KEY: Final[ZarrV2GroupMetadataStoreKey] = ".zgroup" +"""The store key a v2 group's metadata document is persisted under.""" + + __all__ = [ + "ZARR_V2_GROUP_METADATA_STORE_KEY", "ZarrV2GroupMetadataJSON", "ZarrV2GroupMetadataJSONPartial", + "ZarrV2GroupMetadataStoreKey", "ZarrV2ZGroupJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/array.py b/packages/zarr-metadata/src/zarr_metadata/v3/array.py index 96341f73ca..31a5f6b755 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/array.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/array.py @@ -1,7 +1,7 @@ """Zarr v3 array metadata types.""" from collections.abc import Mapping -from typing import Literal, NotRequired, TypeAlias +from typing import Final, Literal, NotRequired, TypeAlias from typing_extensions import TypedDict @@ -75,8 +75,21 @@ class ZarrV3ArrayMetadataJSONPartial(TypedDict, total=False, extra_items=ZarrV3E dimension_names: NotRequired[tuple[str | None, ...]] +ZarrV3ArrayMetadataStoreKey = Literal["zarr.json"] +"""Literal type of the store key holding a v3 array's metadata document.""" + +ZARR_V3_ARRAY_METADATA_STORE_KEY: Final[ZarrV3ArrayMetadataStoreKey] = "zarr.json" +"""The store key a v3 array's metadata document is persisted under. + +v3 uses one key for both node types; the document's `node_type` field +distinguishes an array from a group. +""" + + __all__ = [ + "ZARR_V3_ARRAY_METADATA_STORE_KEY", "ZarrV3ArrayMetadataJSON", "ZarrV3ArrayMetadataJSONPartial", + "ZarrV3ArrayMetadataStoreKey", "ZarrV3ExtensionField", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/consolidated.py b/packages/zarr-metadata/src/zarr_metadata/v3/consolidated.py index bcbe675947..a9fe0c1f8f 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/consolidated.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/consolidated.py @@ -12,7 +12,7 @@ """ from collections.abc import Mapping -from typing import Literal +from typing import Final, Literal from typing_extensions import TypedDict @@ -34,6 +34,16 @@ class ZarrV3ConsolidatedMetadataJSON(TypedDict): metadata: Mapping[str, ZarrV3ArrayMetadataJSON | ZarrV3GroupMetadataJSON] +ZARR_V3_CONSOLIDATED_METADATA_KEY: Final = "consolidated_metadata" +"""The key under which consolidated metadata is embedded in a v3 group document. + +Unlike the v2 `.zmetadata` file, this is not a store key: consolidated metadata +is carried as an extension field inside the group's own `zarr.json`. Like its v2 +counterpart it is a reference-implementation convention, not a spec artifact. +""" + + __all__ = [ + "ZARR_V3_CONSOLIDATED_METADATA_KEY", "ZarrV3ConsolidatedMetadataJSON", ] diff --git a/packages/zarr-metadata/src/zarr_metadata/v3/group.py b/packages/zarr-metadata/src/zarr_metadata/v3/group.py index 033e91ff8c..37bfdd6934 100644 --- a/packages/zarr-metadata/src/zarr_metadata/v3/group.py +++ b/packages/zarr-metadata/src/zarr_metadata/v3/group.py @@ -4,7 +4,7 @@ """ from collections.abc import Mapping -from typing import Literal, NotRequired +from typing import Final, Literal, NotRequired from typing_extensions import TypedDict @@ -54,7 +54,20 @@ class ZarrV3GroupMetadataJSONPartial(TypedDict, total=False, extra_items=ZarrV3E attributes: NotRequired[Mapping[str, JSONValue]] +ZarrV3GroupMetadataStoreKey = Literal["zarr.json"] +"""Literal type of the store key holding a v3 group's metadata document.""" + +ZARR_V3_GROUP_METADATA_STORE_KEY: Final[ZarrV3GroupMetadataStoreKey] = "zarr.json" +"""The store key a v3 group's metadata document is persisted under. + +v3 uses one key for both node types; the document's `node_type` field +distinguishes a group from an array. +""" + + __all__ = [ + "ZARR_V3_GROUP_METADATA_STORE_KEY", "ZarrV3GroupMetadataJSON", "ZarrV3GroupMetadataJSONPartial", + "ZarrV3GroupMetadataStoreKey", ] diff --git a/packages/zarr-metadata/tests/model/test_array.py b/packages/zarr-metadata/tests/model/test_array.py index 467ef1e2ad..95dc7aea3a 100644 --- a/packages/zarr-metadata/tests/model/test_array.py +++ b/packages/zarr-metadata/tests/model/test_array.py @@ -64,25 +64,71 @@ def test_guards_exported_from_package() -> None: assert hasattr(zarr_metadata.model, name) +# `ZARR_V3_CONSOLIDATED_METADATA_KEY` is deliberately absent: it names a key +# *inside* a v3 group document, not a store key, so it has no paired `Literal` +# and no `to_key_value` signature to appear in. See `test_v3_consolidated_key_ +# is_not_a_store_key`, which pins that distinction. +STORE_KEY_PAIRS = [ + ("ZARR_V2_ARRAY_METADATA_STORE_KEY", "ZarrV2ArrayMetadataStoreKey", "zarr_metadata.v2.array"), + ("ZARR_V3_ARRAY_METADATA_STORE_KEY", "ZarrV3ArrayMetadataStoreKey", "zarr_metadata.v3.array"), + ("ZARR_V2_ATTRIBUTES_STORE_KEY", "ZarrV2AttributesStoreKey", "zarr_metadata.v2.attributes"), + ("ZARR_V2_GROUP_METADATA_STORE_KEY", "ZarrV2GroupMetadataStoreKey", "zarr_metadata.v2.group"), + ("ZARR_V3_GROUP_METADATA_STORE_KEY", "ZarrV3GroupMetadataStoreKey", "zarr_metadata.v3.group"), + ( + "ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY", + "ZarrV2ConsolidatedMetadataStoreKey", + "zarr_metadata.v2.consolidated", + ), +] + + def test_store_key_pairs_exported_from_package() -> None: """Each store-key constant is exported together with its Literal type alias, and the pair cannot drift apart.""" import zarr_metadata.model as m - pairs = [ - ("ARRAY_METADATA_STORE_KEY_V2", "ZarrV2ArrayMetadataStoreKey"), - ("ARRAY_METADATA_STORE_KEY_V3", "ZarrV3ArrayMetadataStoreKey"), - ("ATTRIBUTES_STORE_KEY_V2", "ZarrV2AttributesStoreKey"), - ("GROUP_METADATA_STORE_KEY_V2", "ZarrV2GroupMetadataStoreKey"), - ("GROUP_METADATA_STORE_KEY_V3", "ZarrV3GroupMetadataStoreKey"), - ("CONSOLIDATED_METADATA_STORE_KEY_V2", "ZarrV2ConsolidatedMetadataStoreKey"), - ] - for const_name, alias_name in pairs: + for const_name, alias_name, _ in STORE_KEY_PAIRS: assert const_name in m.__all__ assert alias_name in m.__all__ assert (getattr(m, const_name),) == get_args(getattr(m, alias_name)) +def test_store_keys_are_defined_in_their_spec_modules() -> None: + """Store keys are facts about the on-disk specs, so each is defined in the + `v2`/`v3` module describing that document — not in the model layer, which + only re-exports them.""" + import importlib + + for const_name, alias_name, module_name in STORE_KEY_PAIRS: + module = importlib.import_module(module_name) + for name in (const_name, alias_name): + assert name in module.__all__, f"{name} should be exported by {module_name}" + + +def test_v3_consolidated_key_is_not_a_store_key() -> None: + """v3 consolidated metadata is embedded as a field inside the group's own + `zarr.json`, not persisted under its own store key. It therefore has no + paired `Literal` alias, unlike every true store key — which is why it is + excluded from `STORE_KEY_PAIRS` rather than merely forgotten.""" + import zarr_metadata.model as m + + assert "ZARR_V3_CONSOLIDATED_METADATA_KEY" in m.__all__ + assert not hasattr(m, "ZarrV3ConsolidatedMetadataKey") + assert m.ZARR_V3_CONSOLIDATED_METADATA_KEY not in { + getattr(m, const_name) for const_name, _, _ in STORE_KEY_PAIRS + } + + +def test_v3_node_store_keys_agree() -> None: + """v3 keys both node types' metadata under one store key, distinguished by + the document's `node_type`. The array and group constants are separately + typed but must name the same file; adjacency used to make that obvious, and + they now live in different modules.""" + import zarr_metadata.model as m + + assert m.ZARR_V3_ARRAY_METADATA_STORE_KEY == m.ZARR_V3_GROUP_METADATA_STORE_KEY + + def test_validation_diagnostics_exported_from_package() -> None: """The validation-diagnostic types and validators are exported from the package.""" import zarr_metadata.model diff --git a/packages/zarr-metadata/tests/test_public_api.py b/packages/zarr-metadata/tests/test_public_api.py index e65c680fd1..6613aa394b 100644 --- a/packages/zarr-metadata/tests/test_public_api.py +++ b/packages/zarr-metadata/tests/test_public_api.py @@ -3,7 +3,7 @@ import importlib import pkgutil import re -from typing import get_args +from typing import Literal, get_args, get_origin import zarr_metadata as zm @@ -58,6 +58,23 @@ def _group_rank(s: str) -> int: "MetadataValidationError", "ProblemKind", "UNSET", + # Store keys — the names the documents are persisted under. Defined in the + # v2/v3 spec modules, re-exported through `zarr_metadata.model`. + "ZARR_V2_ARRAY_METADATA_STORE_KEY", + "ZarrV2ArrayMetadataStoreKey", + "ZARR_V2_GROUP_METADATA_STORE_KEY", + "ZarrV2GroupMetadataStoreKey", + "ZARR_V2_ATTRIBUTES_STORE_KEY", + "ZarrV2AttributesStoreKey", + "ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY", + "ZarrV2ConsolidatedMetadataStoreKey", + "ZARR_V3_ARRAY_METADATA_STORE_KEY", + "ZarrV3ArrayMetadataStoreKey", + "ZARR_V3_GROUP_METADATA_STORE_KEY", + "ZarrV3GroupMetadataStoreKey", + # Not a store key: v3 consolidated metadata is embedded in the group's own + # `zarr.json`, so it has no paired Literal alias. + "ZARR_V3_CONSOLIDATED_METADATA_KEY", # v2 data-type encoding union "ZarrV2DataTypeMetadata", # Category B — codec canonical unions @@ -147,9 +164,9 @@ def _group_rank(s: str) -> int: "RawBytesDataTypeName", "RawBytesFillValue", # Category E — constant+Literal pairs - "ARRAY_ORDER_V2", + "ZARR_V2_ARRAY_ORDER", "ZarrV2ArrayOrder", - "ARRAY_DIMENSION_SEPARATOR_V2", + "ZARR_V2_ARRAY_DIMENSION_SEPARATOR", "ZarrV2ArrayDimensionSeparator", "ENDIANNESS", "Endianness", @@ -285,14 +302,19 @@ def test_all_is_grouped_and_unique() -> None: ) -def _public_type_names() -> set[tuple[str, str]]: - """Every (module, CamelCase name) pair exported via a public `__all__`.""" +def _iter_module_names() -> set[str]: + """Every public module in the package, including the top-level namespace.""" module_names = {"zarr_metadata"} for info in pkgutil.walk_packages(zm.__path__, prefix="zarr_metadata."): if not any(part.startswith("_") for part in info.name.split(".")[1:]): module_names.add(info.name) + return module_names + + +def _public_type_names() -> set[tuple[str, str]]: + """Every (module, CamelCase name) pair exported via a public `__all__`.""" out: set[tuple[str, str]] = set() - for module_name in module_names: + for module_name in _iter_module_names(): module = importlib.import_module(module_name) for name in getattr(module, "__all__", ()): if name.startswith("_") or name.isupper() or name.islower(): @@ -323,6 +345,8 @@ def test_standalone_vocab_is_not_stale() -> None: def test_promoted_pairs_drift() -> None: + """Each promoted runtime constant holds exactly the values of the `Literal` + type it manifests, so the two cannot drift apart.""" pairs = [ (zm.ENDIANNESS, zm.Endianness), (zm.BLOSC_CNAME, zm.BloscCName), @@ -331,7 +355,134 @@ def test_promoted_pairs_drift() -> None: (zm.NUMPY_TIME_UNIT, zm.NumpyTimeUnit), (zm.CAST_ROUNDING_MODE, zm.CastRoundingMode), (zm.CAST_OUT_OF_RANGE_MODE, zm.CastOutOfRangeMode), - (zm.ARRAY_ORDER_V2, zm.ZarrV2ArrayOrder), + (zm.ZARR_V2_ARRAY_ORDER, zm.ZarrV2ArrayOrder), + (zm.ZARR_V2_ARRAY_DIMENSION_SEPARATOR, zm.ZarrV2ArrayDimensionSeparator), + (zm.DEFAULT_CHUNK_KEY_ENCODING_SEPARATOR, zm.DefaultChunkKeyEncodingSeparator), + (zm.V2_CHUNK_KEY_ENCODING_SEPARATOR, zm.V2ChunkKeyEncodingSeparator), ] for const, lit in pairs: assert set(const) == set(get_args(lit)) + + +def constant_name_for(type_name: str) -> str: + """Derive a constant's name from the name of the type it manifests. + + The transformation is purely syntactic: split at each lowercase-to-uppercase + boundary and before an uppercase run that starts a new word, then uppercase. + Digit runs stay glued to the token they follow (`Uint8` -> `UINT8`, + `Crc32c` -> `CRC32C`), because a digit boundary in CamelCase does not mark a + word boundary in the spec vocabulary these names model. + + Consecutive capitals do not split, so acronym-adjacent names derive badly: + `ZarrV2ZArrayJSON` -> `ZARR_V2ZARRAY_JSON` and `...JSONPartial` -> + `...JSONPARTIAL`. Every such name in the package today is a `TypedDict` or + `TypeAliasType` that backs no constant, so none reaches this function — but + a future `Literal` spelled that way would silently be held to a bad name. + Splitting acronyms correctly needs a vocabulary, not a regex, so the rule + stays syntactic and this stays a known limit. + """ + return re.sub(r"(?<=[a-z0-9])(?=[A-Z][a-z])|(?<=[a-z])(?=[A-Z])", "_", type_name).upper() + + +def _literal_backed_constants() -> list[tuple[str, str, str]]: + """Every (module, constant, type) triple where a module-level SCREAMING_SNAKE + constant holds exactly the values of a `Literal` type in the same module. + + Pairing is by value, not by proximity: a constant manifests the type whose + members it enumerates. Constants with no such type (extension-field keys, + key sets, canonical bit patterns) are exempt from the naming rule and are + simply absent from the result. + """ + out: list[tuple[str, str, str]] = [] + for module_name in _iter_module_names(): + module = importlib.import_module(module_name) + literals = { + name: frozenset(get_args(obj)) + for name, obj in vars(module).items() + if not name.startswith("_") + and not name.isupper() + and get_origin(obj) is Literal + and get_args(obj) + } + if not literals: + continue + for const_name, value in vars(module).items(): + if const_name.startswith("_") or not const_name.isupper(): + continue + members = frozenset(value) if isinstance(value, tuple) else frozenset({value}) + if not all(isinstance(m, str) for m in members): + continue + matches = [t for t, args in literals.items() if args == members] + # A single unambiguous type means this constant manifests it. Ties + # (two Literals with identical members) carry no signal about which + # name the constant should take, so they are skipped. + if len(matches) == 1: + out.append((module_name, const_name, matches[0])) + return out + + +def _value_tied_constants() -> set[str]: + """Constants whose manifested type is ambiguous because two or more `Literal` + types in the same module share its exact members. + + These are invisible to the derivation check, so they are surfaced here and + counted, rather than silently dropped inside the pairing helper.""" + tied: set[str] = set() + for module_name in _iter_module_names(): + module = importlib.import_module(module_name) + literals = [ + frozenset(get_args(obj)) + for name, obj in vars(module).items() + if not name.startswith("_") + and not name.isupper() + and get_origin(obj) is Literal + and get_args(obj) + ] + for const_name, value in vars(module).items(): + if const_name.startswith("_") or not const_name.isupper(): + continue + members = frozenset(value) if isinstance(value, tuple) else frozenset({value}) + if not all(isinstance(m, str) for m in members): + continue + if sum(1 for args in literals if args == members) > 1: + tied.add(f"{module_name}.{const_name}") + return tied + + +# Constants whose `Literal` type cannot be identified by value because another +# `Literal` in the same module has identical members. Pairing is by value, so a +# tie carries no signal about which name the constant should take. These are +# checked by eye; the count below fails if the tied set grows silently. +KNOWN_VALUE_TIES = 9 + + +def test_constant_names_derive_from_their_type_names() -> None: + """Every `Literal`-backed constant whose type can be identified by value has + a name that is the mechanical transform of that type's name. + + Constants tied to more than one identically-valued `Literal` are exempt (see + `KNOWN_VALUE_TIES`), as are constants in private modules and those backing + no `Literal` at all — so this pins the rule for most of the package, not all + of it.""" + pairs = _literal_backed_constants() + assert pairs, "found no Literal-backed constants to check" + violations = [ + f"{module}: {const} should be {constant_name_for(type_name)} (manifests {type_name})" + for module, const, type_name in pairs + if const != constant_name_for(type_name) + ] + assert not violations, "constants whose names do not derive from their type:\n" + "\n".join( + violations + ) + + +def test_value_tied_constants_are_a_known_set() -> None: + """The derivation check cannot see constants whose type is ambiguous by + value. Pin how many there are, so the exempt set cannot grow unnoticed and + quietly shrink the rule's coverage.""" + tied = _value_tied_constants() + assert len(tied) == KNOWN_VALUE_TIES, ( + f"value-tied constants changed (expected {KNOWN_VALUE_TIES}, got {len(tied)}); " + f"these are unchecked by the derivation rule and must be named by hand:\n" + + "\n".join(sorted(tied)) + ) From 4e13cf577d5be18b8e5312fa254d1a3034a3d321 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 5 Aug 2026 16:34:26 +0200 Subject: [PATCH 32/61] fix: preserve non-JSON-serializable storage options in _make_async (#4239) * fix: preserve non-JSON-serializable storage options in _make_async Converting a sync instance of an async-capable filesystem to an async instance went through fs.to_json()/from_json(), which raises TypeError when storage options hold objects like azure.identity credentials. Reconstruct the filesystem from storage_args/storage_options instead. Closes #4220 Assisted-by: ClaudeCode:claude-fable-5 * Rename 4220.bugfix.md to 4239.bugfix.md --- changes/4239.bugfix.md | 1 + src/zarr/storage/_fsspec.py | 9 ++++----- tests/test_store/test_fsspec.py | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 changes/4239.bugfix.md diff --git a/changes/4239.bugfix.md b/changes/4239.bugfix.md new file mode 100644 index 0000000000..b5bc92f18b --- /dev/null +++ b/changes/4239.bugfix.md @@ -0,0 +1 @@ +`FsspecStore.from_mapper` and `FsspecStore.from_url` no longer fail when converting a synchronous instance of an async-capable filesystem whose storage options contain objects that cannot be serialized to JSON (e.g. an `azure.identity.DefaultAzureCredential`). The async instance is now constructed from the original filesystem arguments instead of a JSON round-trip. diff --git a/src/zarr/storage/_fsspec.py b/src/zarr/storage/_fsspec.py index 37d134dd95..b109f80935 100644 --- a/src/zarr/storage/_fsspec.py +++ b/src/zarr/storage/_fsspec.py @@ -1,6 +1,5 @@ from __future__ import annotations -import json import warnings from contextlib import suppress from typing import TYPE_CHECKING, Any @@ -51,10 +50,10 @@ def _make_async(fs: AbstractFileSystem) -> AsyncFileSystem: # Already an async instance of an async filesystem, nothing to do return fs if fs.async_impl: - # Convert sync instance of an async fs to an async instance - fs_dict = json.loads(fs.to_json()) - fs_dict["asynchronous"] = True - return fsspec.AbstractFileSystem.from_json(json.dumps(fs_dict)) + # Convert sync instance of an async fs to an async instance. Reuse the original + # constructor arguments rather than round-tripping through JSON, since storage + # options may hold objects that are not JSON-serializable (e.g. credentials). + return type(fs)(*fs.storage_args, **{**fs.storage_options, "asynchronous": True}) if fsspec_version < parse_version("2024.12.0"): raise ImportError( diff --git a/tests/test_store/test_fsspec.py b/tests/test_store/test_fsspec.py index 515e1526b6..c367b908c5 100644 --- a/tests/test_store/test_fsspec.py +++ b/tests/test_store/test_fsspec.py @@ -584,6 +584,24 @@ def test_with_read_only_shares_filesystem(tmp_path: pathlib.Path) -> None: assert not source.read_only +def test_make_async_preserves_unserializable_storage_options() -> None: + """A sync instance of an async filesystem whose storage options hold objects that + cannot round-trip through JSON (e.g. an Azure credential) must still convert. + + See https://github.com/zarr-developers/zarr-python/issues/4220 + """ + pytest.importorskip("aiohttp") + credential = object() # stand-in for e.g. azure.identity.DefaultAzureCredential + sync_fs = fsspec.filesystem("http", client_kwargs={"auth": credential}) + assert sync_fs.async_impl + assert not sync_fs.asynchronous + + async_fs = _make_async(sync_fs) + + assert async_fs.asynchronous + assert async_fs.client_kwargs["auth"] is credential + + @pytest.mark.parametrize("asynchronous", [True, False]) def test_make_async(asynchronous: bool, endpoint_url: str) -> None: s3_filesystem = s3fs.S3FileSystem( From e382be8907f71729cd106d2ccf0b38eb016dc3c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Aug 2026 15:03:30 -0400 Subject: [PATCH 33/61] chore(deps): bump cryptography from 48.0.1 to 50.0.0 (#4240) Bumps [cryptography](https://github.com/pyca/cryptography) from 48.0.1 to 50.0.0. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/48.0.1...50.0.0) --- updated-dependencies: - dependency-name: cryptography dependency-version: 50.0.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- uv.lock | 87 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 45 deletions(-) diff --git a/uv.lock b/uv.lock index 8eac71caa7..17441eee71 100644 --- a/uv.lock +++ b/uv.lock @@ -690,55 +690,52 @@ wheels = [ [[package]] name = "cryptography" -version = "48.0.1" +version = "50.0.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/12/45/870e7f4bef50e5f53b9f51d4428aee5290eedf58ba443f16b1ebb7ab8e66/cryptography-48.0.1.tar.gz", hash = "sha256:266f4ee051abb2f725b74ef8072b521ce1feacf685a3364fa6a6b45548db791a", size = 832989, upload-time = "2026-06-09T22:32:31.8Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1b/bc/ee4137cbbe105652c0ee4252792b78fc8e7afa4b8e61d9d5dc05a7f45731/cryptography-48.0.1-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:3e4a1a3232eef2e6c732827d5722db29a0cc8b27af2a4d865b094cf954be9ca1", size = 8008324, upload-time = "2026-06-09T22:31:00.702Z" }, - { url = "https://files.pythonhosted.org/packages/d5/85/6379d42181bfc713094f081360fc5784d6c816b599d45e7f082502d173ce/cryptography-48.0.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:32143b24adb918f078134e1e230f1eb8cc04886b92c28b5f0041aaf3e5699225", size = 4696243, upload-time = "2026-06-09T22:32:33.446Z" }, - { url = "https://files.pythonhosted.org/packages/9c/87/c85d147b53323c7eb4d850920c8901377323c2a0ff8d79c262d4fee89aa2/cryptography-48.0.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f0d27a5696721ef7a672b8c810f6aded391058e0b9486e63e6d93baf765da691", size = 4713235, upload-time = "2026-06-09T22:31:40.141Z" }, - { url = "https://files.pythonhosted.org/packages/79/58/67cbf8cf1ee7c54b439ca07bbecf8362c07afc11a3724fea70f745784add/cryptography-48.0.1-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:eb86ce1af36fe65041b6db9a8bb064ee621a7e5fded0f80d475ec243477cd242", size = 4702323, upload-time = "2026-06-09T22:31:42.191Z" }, - { url = "https://files.pythonhosted.org/packages/89/c6/24266ac10c47f6cd2a865f4446062b466da1d1f10b27189eac00e61bf0c9/cryptography-48.0.1-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:b024e784ad6c077ee0147b35ea9cbfc1e34e1fd4c1dcca214c2794d73a12df08", size = 5300085, upload-time = "2026-06-09T22:31:58.703Z" }, - { url = "https://files.pythonhosted.org/packages/d2/bb/cc4b78784f97efc8c5874c2a9743708d172be6663024b34a0467885ae0c8/cryptography-48.0.1-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3752f2dbc8f07a30aad2932c986cea495b03bb554887828225da104f732852b6", size = 4746137, upload-time = "2026-06-09T22:31:31.01Z" }, - { url = "https://files.pythonhosted.org/packages/1f/52/0c44de3f5267f8fbe8e835138017522a333436166e406f0db9b9e6e3033f/cryptography-48.0.1-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:bd81490cd5801d755cf97bb68ac191f14b708470b1c7cf4580f669b9c9264cd8", size = 4333867, upload-time = "2026-06-09T22:32:28.096Z" }, - { url = "https://files.pythonhosted.org/packages/9a/2e/772d7adbfa931537bc401640b7cac9976bff689bda187833e5d63b428e49/cryptography-48.0.1-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:66fd0771e7b9c6dcd44cf1120690d2338d16d72795cf40cae2786a39eba65429", size = 4701805, upload-time = "2026-06-09T22:31:38.284Z" }, - { url = "https://files.pythonhosted.org/packages/f8/a3/b06844f303873493c963caf581c04df31c7035e0c1b0f02c4814d319ec80/cryptography-48.0.1-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:3fd2ca57062b241c856670b073487d2e86c4637937ca5601e48f97bf8e11fc8f", size = 5258461, upload-time = "2026-06-09T22:31:04.187Z" }, - { url = "https://files.pythonhosted.org/packages/9f/13/8b765e2e12b07c74941caadb9d1c8fdc006c4dfbf2b8f2d610519758954d/cryptography-48.0.1-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:0ee6ea481db1ab889cba043ec1eda17bb9c1ea79db6722f779c3667f9f70322f", size = 4745488, upload-time = "2026-06-09T22:32:30.07Z" }, - { url = "https://files.pythonhosted.org/packages/2e/aa/48972bce55049b32a94f4907eda4d75fa385aad8a39506cc2fc72196ecf0/cryptography-48.0.1-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:f2ceef93cb096aa3c4cc4b5c94ca6131f9196d28c64d6111533402a9b2054d41", size = 4830256, upload-time = "2026-06-09T22:31:43.868Z" }, - { url = "https://files.pythonhosted.org/packages/47/a2/e5079a032fb85cf6005046ca92bbd78b0c82dad2b5751ab8c311659da06f/cryptography-48.0.1-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:9bd3f92d76217892b15df84ca256c2c113d386fdda7a7d8691aeeced976507c6", size = 4979117, upload-time = "2026-06-09T22:31:05.845Z" }, - { url = "https://files.pythonhosted.org/packages/b7/a0/8f50cae9c74e718ed769d63ed5c74bd0ea830c9550a74629cebd1b9c7bc7/cryptography-48.0.1-cp311-abi3-win32.whl", hash = "sha256:b9a32b876490d66c8bcc9963ef220199569748434ab01a9d6aaeabf88e7f5158", size = 3304154, upload-time = "2026-06-09T22:32:16.845Z" }, - { url = "https://files.pythonhosted.org/packages/c5/69/0572c77dbace6fef72f33755bd52ea399c71367250d366237f8691826b9e/cryptography-48.0.1-cp311-abi3-win_amd64.whl", hash = "sha256:39489bfca54c7a1f6b297efcd8bc608ab92d16c4ca631b0cad4da46724588b24", size = 3817138, upload-time = "2026-06-09T22:32:00.388Z" }, - { url = "https://files.pythonhosted.org/packages/42/06/3e768b4c3bc78201583fa35a0e18f640dd782ff41afba88f8545481a8874/cryptography-48.0.1-cp314-cp314t-macosx_10_9_universal2.whl", hash = "sha256:f817adc181390bd54f2f700107a7419040fb7c1bdf2fc26f36551a06a68c3345", size = 7989830, upload-time = "2026-06-09T22:31:07.8Z" }, - { url = "https://files.pythonhosted.org/packages/8a/13/6476736484b94041110c8340a3eb63962fea4975baea8cb4a512adb44d4d/cryptography-48.0.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d5d30989c6917b478b5817902e85fddaea2261efa8648383d965381ccb9e1ac4", size = 4689201, upload-time = "2026-06-09T22:31:09.745Z" }, - { url = "https://files.pythonhosted.org/packages/79/62/65a87f34d2a431546e2509b85d55e8c90df86d668f6731da64d538512ac2/cryptography-48.0.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:df637c05205ea7c1d7fbcbe54bbfea648a52951155f997af13d895d0ecc96991", size = 4702822, upload-time = "2026-06-09T22:32:24.409Z" }, - { url = "https://files.pythonhosted.org/packages/7f/59/810b5204b0a9b10f4b6bc06bd551a8b609803cd931806bc3b71884b225e5/cryptography-48.0.1-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:869c3b8a53bfe27147832df48b32adadf558249d50e76cb3769d40e986b13265", size = 4694875, upload-time = "2026-06-09T22:32:08.737Z" }, - { url = "https://files.pythonhosted.org/packages/24/dc/d8ca05ffea724eec6d232ea6f18e74c269eb6bdfdcc9bfba689790d1325f/cryptography-48.0.1-cp314-cp314t-manylinux_2_28_ppc64le.whl", hash = "sha256:e361afba8918070d376df76f408a4f67fec0ee9cff81a99e48fe9a233ef59e17", size = 5290385, upload-time = "2026-06-09T22:31:15.212Z" }, - { url = "https://files.pythonhosted.org/packages/03/8c/3be6cb4da181f5bb6c19cf560c2359d60644a6b5fc5b57854e528f47b296/cryptography-48.0.1-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:d069066deead00ac7f090be101be875a06855908f7ec004c27b8fefb4acfb411", size = 4737082, upload-time = "2026-06-09T22:32:22.66Z" }, - { url = "https://files.pythonhosted.org/packages/aa/f6/d5f60a5a1434dbfd949e227fd0065d194c7e6b6ac526b17f5c06152b8231/cryptography-48.0.1-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:09f73a725d582cef64b91281a322cd798d14a33b2b6f2b7ad9531dc336d84c02", size = 4325328, upload-time = "2026-06-09T22:32:10.777Z" }, - { url = "https://files.pythonhosted.org/packages/17/b7/ba75dd947a14b6ad907b01ae8f6b5b348cdd1b48142f0063dee9e20c1d9d/cryptography-48.0.1-cp314-cp314t-manylinux_2_34_aarch64.whl", hash = "sha256:15254441469dd6bf027039453288e2072124f8b6603563f5d759e1c9b69273fa", size = 4694530, upload-time = "2026-06-09T22:31:53.105Z" }, - { url = "https://files.pythonhosted.org/packages/62/29/50d6b9e8aff12d8b67afaeb3569335e32dc83a5723e3bbded24fdac9f809/cryptography-48.0.1-cp314-cp314t-manylinux_2_34_ppc64le.whl", hash = "sha256:8ace4507d1e6533c125f4fac754f8bb8b6a74c08e92179dabd7e16571a3efbf3", size = 5245046, upload-time = "2026-06-09T22:31:25.774Z" }, - { url = "https://files.pythonhosted.org/packages/9f/04/618f4115cfc0add0838c82507aa18a346089428da8653ad38b3ff36f5cb3/cryptography-48.0.1-cp314-cp314t-manylinux_2_34_x86_64.whl", hash = "sha256:b4e391975f038e66432328639620a4aff2d307513b004f1ca06d6225bced815c", size = 4736660, upload-time = "2026-06-09T22:32:12.676Z" }, - { url = "https://files.pythonhosted.org/packages/24/9c/06e062462a0de28a3b3911322eded4c16deb9f441b1b7575d3dc59488ab5/cryptography-48.0.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:42fcd8e26fe555d9b3577a135f5091fefa0aa4e99129c23fb56787a1bd4ada72", size = 4822229, upload-time = "2026-06-09T22:31:17.062Z" }, - { url = "https://files.pythonhosted.org/packages/f4/be/0561971eaaee4b8a0e7d5113c536921063ab91aaf23278ac374eaf881e11/cryptography-48.0.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c1400da5e32a43253392277eac7490a60e497d810a63dd5608d71bbd7af507c9", size = 4966364, upload-time = "2026-06-09T22:31:32.842Z" }, - { url = "https://files.pythonhosted.org/packages/a4/27/728c77876f12b000820b69ae490f3c4083775e79e07827e9e60be07ad209/cryptography-48.0.1-cp314-cp314t-win32.whl", hash = "sha256:0df56b056bc17c1b7d6821dfa65216e62bd232d8ab05eb3db44e71d235651471", size = 3278498, upload-time = "2026-06-09T22:31:29.154Z" }, - { url = "https://files.pythonhosted.org/packages/06/e3/79a612c6d7b1e6ee0edd43633d53035bec2cfb78c82b76f7864f39e36f34/cryptography-48.0.1-cp314-cp314t-win_amd64.whl", hash = "sha256:9de21387aa95e2a895823d0745b430bed4f33503ba9ab5e0b5311f33e37d66d2", size = 3798790, upload-time = "2026-06-09T22:31:56.697Z" }, - { url = "https://files.pythonhosted.org/packages/ca/6c/00fa2a95997164c8b2072ce327c23d4ab20809ccc323ea5fab91e53a4bba/cryptography-48.0.1-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:4fdc69f8e4316bcf0c8c8ec1f26f285d12e8142d88d96c876a59a03be3f6ae67", size = 7987408, upload-time = "2026-06-09T22:32:20.777Z" }, - { url = "https://files.pythonhosted.org/packages/b0/d9/45f309a7e4e5f3f8f121d6d3be9e94024a7726ec598d6e08ae04edb2f04d/cryptography-48.0.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:48fe40804d4caa2288f24e70ca8c64c42dd826da0ad7e4f1b41b2128d679e6c8", size = 4690196, upload-time = "2026-06-09T22:31:54.74Z" }, - { url = "https://files.pythonhosted.org/packages/5f/9f/a1bc8bcc798811b8527eb374bbccf30a3f3e806829d967118222bf1125eb/cryptography-48.0.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:86be3b1b0b6bf09482fb50a979c508d2950ed95f5621ec77f4e385962006b83a", size = 4696782, upload-time = "2026-06-09T22:31:45.615Z" }, - { url = "https://files.pythonhosted.org/packages/66/c2/81a4fb4e4373c500bb526bc337ac5719dd31dd15b970b84a238168c6aa08/cryptography-48.0.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:4ab0a343c807bbcd90c971cd1ecf072937cd01847a9e002bef88fb47ac6be577", size = 4696618, upload-time = "2026-06-09T22:31:11.564Z" }, - { url = "https://files.pythonhosted.org/packages/e5/0b/aa68b221dde92d09cb29a024ede17550ee21e77a404e59fc093c82bb51e1/cryptography-48.0.1-cp39-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:9621de99d2da096006b629979efd8ae7eb2d8b822488d0c89ee4000c306c59b1", size = 5289970, upload-time = "2026-06-09T22:31:20.368Z" }, - { url = "https://files.pythonhosted.org/packages/78/13/fba657f958d2af66ea959a4ba01212632089249d34af1ae48054136344d7/cryptography-48.0.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:88c852a0ae366e262e5a1744b685e6a433dc8788dd2a277e418bf4904203609d", size = 4731873, upload-time = "2026-06-09T22:31:22.253Z" }, - { url = "https://files.pythonhosted.org/packages/4c/4c/9a964756d24a26b3e34dfcb16f961b89838786e6700b635b0d1e3adff4b6/cryptography-48.0.1-cp39-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:43c5835e2cb98c8733d86f57d6fc879b613f5c3478607281c3e36daffc6dd8a6", size = 4330804, upload-time = "2026-06-09T22:31:36.56Z" }, - { url = "https://files.pythonhosted.org/packages/4b/0f/a10f3a6eb12950a10e3a874070283aa2dd5875b2bfd15fad8a3e17b3f13e/cryptography-48.0.1-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:fe0180af5bf9236518a087e35bf2d9a347d5f5f51e63c579d683ddff424e3d46", size = 4696217, upload-time = "2026-06-09T22:31:13.351Z" }, - { url = "https://files.pythonhosted.org/packages/f3/6f/5cd12f951165ea73ef85266775d97e4c763b2474ccfd816dd69d3a18d6f8/cryptography-48.0.1-cp39-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:b7a2d1a937a738a881737cec135a38bb61470589b17515b9f73f571d0ae10401", size = 5245252, upload-time = "2026-06-09T22:32:02.193Z" }, - { url = "https://files.pythonhosted.org/packages/68/ab/8aaa12e4516ec4464033ab79b6f3b592bd5a92102467c4ace8a0d970203f/cryptography-48.0.1-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:b74ca3b8e5ecdd833bf6a002ca41b4793bb27fb8f1c06ffaf2643c9e9140e31b", size = 4731388, upload-time = "2026-06-09T22:32:04.019Z" }, - { url = "https://files.pythonhosted.org/packages/1b/24/50027ea4dca85ec1f40688f3c24fb32ccacd520583c9592c3cc95628e6fb/cryptography-48.0.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:2c37f2461406063b417837f5f3daab668652acd82423efcd7f0a9f04be972de1", size = 4824186, upload-time = "2026-06-09T22:32:18.707Z" }, - { url = "https://files.pythonhosted.org/packages/52/41/04cb5eb17085ade6f50cc611fb657df6a0f5885350de8764ece89c050197/cryptography-48.0.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:86fe77abb1bd87afb251d4d02ada7ecf53a32cee9b67d976abb2e45a13297475", size = 4964539, upload-time = "2026-06-09T22:31:18.793Z" }, - { url = "https://files.pythonhosted.org/packages/36/bf/ed70785c496e89d7e73b7cda2d21f2447fd6d4e821714b8d04ff217fed92/cryptography-48.0.1-cp39-abi3-win32.whl", hash = "sha256:6b2c0c3e6ccf3ade7750f836ef3ee36eea250cc467d45c256895573ac08cc6f1", size = 3282307, upload-time = "2026-06-09T22:30:53.162Z" }, - { url = "https://files.pythonhosted.org/packages/b3/ff/371ea7d252656ee1eb6d83eeeef3d1d0c6baf1d6497687d081ea03814670/cryptography-48.0.1-cp39-abi3-win_amd64.whl", hash = "sha256:9a49ca6c81417f6a5edb50375a60cccdd70fa0a91a5211829dbea74eba94d2ac", size = 3793408, upload-time = "2026-06-09T22:32:15.191Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/de/41/6cbdcf9142d00fe82836fbb51e503e58088575cf7a0fe1dbff6695bf0840/cryptography-50.0.0.tar.gz", hash = "sha256:eeac2acb5a20ed25e0ad6d1df9891a520b78b404266b6d11778f25d5d691a6c9", size = 880201, upload-time = "2026-07-31T14:25:10.11Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c5/5c/59086b4aac5e879d38ddbcf74e4be7ade89cebc3eb199a55da998c3bb46a/cryptography-50.0.0-cp311-abi3-macosx_11_0_arm64.whl", hash = "sha256:031e2d5dd4bb9caa3ca9c82e5a197fd8ae680232cee62603d1a813f3f07e3d03", size = 4001252, upload-time = "2026-07-31T14:23:33.331Z" }, + { url = "https://files.pythonhosted.org/packages/57/ef/8f2df13c7216bcad3e1c74e07f6e193d93e998e114f524a53877c9af27ad/cryptography-50.0.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:fd9192b7b70c573d7f214eb1ae35e00d359f6f5e4b27c7e21e30de1fc6204645", size = 4719554, upload-time = "2026-07-31T14:23:35.611Z" }, + { url = "https://files.pythonhosted.org/packages/d9/41/029086c34d91052fc3b88bcc8056f709a7c915c7a23b235a54eb800b1c97/cryptography-50.0.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:06a32a980526a6ab9a4b9bf8f7385800791e2bb960903cb6b530e4817509a3b7", size = 4702130, upload-time = "2026-07-31T14:23:37.635Z" }, + { url = "https://files.pythonhosted.org/packages/7d/ff/b6ce0954962e7f7b969f850a883744197bb3910bdfd7b6da162eab7d9f68/cryptography-50.0.0-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:a1b30560f2acc95aa8b2e06e716a13dbfc97314747b80d9707e307f77b40d6b3", size = 4725244, upload-time = "2026-07-31T14:23:39.471Z" }, + { url = "https://files.pythonhosted.org/packages/06/1e/63a1027cb7fec360a182208e1b7767d5aa1fe57be3d6aa856e69a321edc0/cryptography-50.0.0-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:8d89f3976b10b4ce31118de72329025f70d2c6ead14a8217c5514dd2c6d5a78f", size = 5342265, upload-time = "2026-07-31T14:23:41.286Z" }, + { url = "https://files.pythonhosted.org/packages/6b/72/a1116d683a6d7ece94590013882515de087edf9ef0e6292aae615a44df73/cryptography-50.0.0-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:b42a28c1844fd9de8f3f7d540e36b66f3a9c83fceac7170ebc7a6a19edd9dcae", size = 4734609, upload-time = "2026-07-31T14:23:43.139Z" }, + { url = "https://files.pythonhosted.org/packages/15/37/36a9c479bbe49acea2636c7fd3360d20f7b7e079c300352011c44850b181/cryptography-50.0.0-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:900131fafd8aead39ac7dd3a7e833be754c17a95cfd91221636949fe4eb0aa8a", size = 4356517, upload-time = "2026-07-31T14:23:44.939Z" }, + { url = "https://files.pythonhosted.org/packages/32/98/8a151d64367204cbc63ec65d37502f1d9c53cf4bfc6ec3c532614dbec60d/cryptography-50.0.0-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:07949c449a1abcf60d1ee6e88956d89404c7df3c8258f46589e912988e551987", size = 4724529, upload-time = "2026-07-31T14:23:46.93Z" }, + { url = "https://files.pythonhosted.org/packages/22/f6/ec13b470172126464a86bf54d2294a46d29837fc51ba3e45d4047946fb5e/cryptography-50.0.0-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:f89831ef99dd7dd169ab06d63a831adb9e20a87aac6d380266bbda5823349169", size = 5299852, upload-time = "2026-07-31T14:23:48.851Z" }, + { url = "https://files.pythonhosted.org/packages/da/3a/f05e32c99d440c9bb891ea0e36c9091891e36be5a9a87ab2ee6ea20729f6/cryptography-50.0.0-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:82148ec5bddac30b51a5b3c1945075f896fa022cb93f8e4a01e9f6ee95292c5f", size = 4734462, upload-time = "2026-07-31T14:23:50.861Z" }, + { url = "https://files.pythonhosted.org/packages/ca/dc/bd72b26be8953f80625f63151efd38eee71c76ca6cf591c08ff34615a79e/cryptography-50.0.0-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1489e263a8048bb8b6a8bac662eb2d402ea5d2b7b4699b72f385f1e2772db105", size = 4852708, upload-time = "2026-07-31T14:23:52.715Z" }, + { url = "https://files.pythonhosted.org/packages/27/20/c930314a2ab476d15dec966ec87e2e9637bb02b06106b12c0396c57bb603/cryptography-50.0.0-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:7cec5b856506da6defb290f30c9ee687d5f5e8cb0bd3f6459dde43b0b4fa40ef", size = 5004179, upload-time = "2026-07-31T14:23:54.887Z" }, + { url = "https://files.pythonhosted.org/packages/32/2e/c9db68a0c4bfa28e310707527c0ee3a2bd254104d2e02e68f368e197aa4c/cryptography-50.0.0-cp311-abi3-win_amd64.whl", hash = "sha256:bd1c592e4d5974f0d08d4888e432157adba757c66da0246918e43677fafa2d30", size = 3840395, upload-time = "2026-07-31T14:23:56.677Z" }, + { url = "https://files.pythonhosted.org/packages/c3/fb/951032a3bf22a5697c83183fb6294a4843772947a70e616c57b3ff5f522e/cryptography-50.0.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:49e7d93abdbd2990caced757e5fade25302f719c3c8fb6e6fff2dde98999fc41", size = 3989258, upload-time = "2026-07-31T14:23:58.881Z" }, + { url = "https://files.pythonhosted.org/packages/d4/67/91eb047e69c5e845f2f14b8a2e4a1aab0f283cb885531e9e22c8adb176bc/cryptography-50.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:19736989797678c6af1e55cd49055cdbcb55d8f6b5583ac5335f933aba9101dc", size = 4700648, upload-time = "2026-07-31T14:24:00.702Z" }, + { url = "https://files.pythonhosted.org/packages/30/82/85f0f7425c856b9f96459411eb12e74ef72df9caf6f8f15bf23a33ff131f/cryptography-50.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:80b63928fa35083b33966ce1efb70e5b9607181e49dcd1c22c8c005e319f667f", size = 4682442, upload-time = "2026-07-31T14:24:02.538Z" }, + { url = "https://files.pythonhosted.org/packages/1a/28/b555a365adff1cca2fbe7b9e487d68a40de6bc67ff2cb587473eb43de0e7/cryptography-50.0.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:d58c3db7cd6eed54e6c06744db55456b65ebd7492ddeae9c1e93cfca7aa857d3", size = 4707596, upload-time = "2026-07-31T14:24:04.394Z" }, + { url = "https://files.pythonhosted.org/packages/72/d8/f52538140cc719df62a01cf87d1c7142318d235817109d6f4054d7c352d6/cryptography-50.0.0-cp314-cp314t-manylinux_2_28_ppc64le.whl", hash = "sha256:df2a58a472f332225671c35b0a830208b86d004f82baa8530fa3782c85646533", size = 5314552, upload-time = "2026-07-31T14:24:06.31Z" }, + { url = "https://files.pythonhosted.org/packages/38/14/6120e5bd7c5aa022ad15424ba4d5c5269d0d9448ed4d55e492ea91e3c1c4/cryptography-50.0.0-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:11b74db56cdbe3cdee6e3f6982ecb70334fa10dce99ed58bf7894aaaa3b2a037", size = 4717113, upload-time = "2026-07-31T14:24:08.349Z" }, + { url = "https://files.pythonhosted.org/packages/fa/71/190bf38c3ee2e0f8efc9860ae100c9df4169742eef274b91e7aa1cb133b9/cryptography-50.0.0-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:f59e38625469987d7ef6d495323c55e7db6c212eaf6112267e0d3b565a2e9c9f", size = 4338580, upload-time = "2026-07-31T14:24:10.227Z" }, + { url = "https://files.pythonhosted.org/packages/3a/63/504ccfbbe61fd8aa983f7f146399cdf034c72c2fc55f5b2dfdcdcdb20c99/cryptography-50.0.0-cp314-cp314t-manylinux_2_34_aarch64.whl", hash = "sha256:ecfed7367f965a0328cfbdd70da860f15441f002f613185668c6e6ebf5a0ac11", size = 4707038, upload-time = "2026-07-31T14:24:12.169Z" }, + { url = "https://files.pythonhosted.org/packages/01/77/2cf79bbfc4d12ca106437a6e170d6aaa01a373e93093118aaaef0e801bd4/cryptography-50.0.0-cp314-cp314t-manylinux_2_34_ppc64le.whl", hash = "sha256:9aa87839c383bdbab6ef865787a1fb877af8dd03464c4400322726feaaadfc6d", size = 5273110, upload-time = "2026-07-31T14:24:14.38Z" }, + { url = "https://files.pythonhosted.org/packages/e5/45/8aae2972c520145377ea3559a605a899bebe227bf070b33cdb445929a9b9/cryptography-50.0.0-cp314-cp314t-manylinux_2_34_x86_64.whl", hash = "sha256:6ba6a53445bd3cfa809ef3ef5f1589aa6ba08784a1d962bf47d0940e871dab1c", size = 4716439, upload-time = "2026-07-31T14:24:16.415Z" }, + { url = "https://files.pythonhosted.org/packages/7b/20/4fe50b619a48c2525cc46e2dbc1ac490708d704be5d467bdaac6dc955682/cryptography-50.0.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:3f5735ffe4996d28b809371756219f5354864902a3b9e7c0b9ee87041209fc9c", size = 4837383, upload-time = "2026-07-31T14:24:18.553Z" }, + { url = "https://files.pythonhosted.org/packages/92/91/3a31366e183343d3703f8995c095f5734676bd6938118047e50fcf279eb4/cryptography-50.0.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:1b4a266766514614f8aa60416e71f2fc6e575d36e7bdc90f644fadb2f4b75b95", size = 4985772, upload-time = "2026-07-31T14:24:20.385Z" }, + { url = "https://files.pythonhosted.org/packages/74/9a/02ffe35b2853d121689871eb5dce862092562b3a1ed5cc98f1aaed441506/cryptography-50.0.0-cp314-cp314t-win_amd64.whl", hash = "sha256:12b9c6996425c76ea6c457ace4f3073e715b8c545add07cd1a8f3a4f90691269", size = 3816291, upload-time = "2026-07-31T14:24:22.125Z" }, + { url = "https://files.pythonhosted.org/packages/03/37/73d005be173aff344af30e9fd2a576575cb2391a7101d9cd3842e1fa8cce/cryptography-50.0.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:ccdc4a71a4dabae05de219404f9f4abc38e3b58422177ff93d0da05967dafa07", size = 4036009, upload-time = "2026-07-31T14:24:24.122Z" }, + { url = "https://files.pythonhosted.org/packages/ff/c6/7a6202a534e32103a285b7834a120869557fe198d51d7cfe59754c8bda9c/cryptography-50.0.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:910e1d2668e7de9648f2bcee30e180db2a6b15c30f887d7c4c93ddf96e3992e3", size = 4745252, upload-time = "2026-07-31T14:24:26.118Z" }, + { url = "https://files.pythonhosted.org/packages/85/4f/0fa8c2f4428198f15d9ff8d63400e27afbf94ce833f6108da1eb3753f945/cryptography-50.0.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a91296cb61e8df6f86d0c19cc4068228da256bf59bf86049fbd821084565327f", size = 4728939, upload-time = "2026-07-31T14:24:27.994Z" }, + { url = "https://files.pythonhosted.org/packages/d1/63/54dd723490ba2dc09b299682c10b38db38f159728bcaae8c591b8af2f22d/cryptography-50.0.0-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:e722f16708d854fe924790e051061f6704a472c3bac347b6fd88033ea8dd0dc5", size = 4748483, upload-time = "2026-07-31T14:24:30.254Z" }, + { url = "https://files.pythonhosted.org/packages/1d/dd/7c77d26285cc7f6991efce64a0f5b4f9383bfa5dd8c5033003eaf7db4cdb/cryptography-50.0.0-cp39-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:d764dcf130c428ef66786f866dd750f53182bc608813489915e9fc106bb0c82f", size = 5367599, upload-time = "2026-07-31T14:24:32.457Z" }, + { url = "https://files.pythonhosted.org/packages/46/c9/f60aed34c013f317f92817b6c171c2d22a78270fa41109bd4b08af26b194/cryptography-50.0.0-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:105110f43a471dbd0060b9c9516cb8a6a79233631a04cc2ba16f28323ac6e025", size = 4762647, upload-time = "2026-07-31T14:24:34.599Z" }, + { url = "https://files.pythonhosted.org/packages/be/f3/f9a0173b139372c3a48ed98154b45cc6b9de17c789d5ab552e621c293609/cryptography-50.0.0-cp39-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:828743d939e9629bc267b8e2d08d8bb67cd4319c771a33d4b18b22dd8fb7440a", size = 4385197, upload-time = "2026-07-31T14:24:36.647Z" }, + { url = "https://files.pythonhosted.org/packages/d8/36/83bb81f6e569bc38e1e4a7bc80f29b46bb9601920bc455fc8e888f5d5742/cryptography-50.0.0-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:2a8183b489dc1f7f80f135780fadc1108f14b31b8a40411c7a5b17425f65f28b", size = 4748095, upload-time = "2026-07-31T14:24:39.493Z" }, + { url = "https://files.pythonhosted.org/packages/6b/16/d3008eff98c764979865834c3d386d4fd041b5f52e7f34fc29ac1a5eb515/cryptography-50.0.0-cp39-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:6e7d61120573a7f2cd94cc095f9e81f6967c61ccdf194285aa143ecec8e0b708", size = 5325948, upload-time = "2026-07-31T14:24:41.556Z" }, + { url = "https://files.pythonhosted.org/packages/9c/f8/d97f9603efda3888187bfdb893f26c41be4735c10631d05d284ee6b047c4/cryptography-50.0.0-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:37fdb0d0111f1e2ff07139dfb79f1b49531f8e213c46f1163dd7642979b58c47", size = 4762400, upload-time = "2026-07-31T14:24:43.636Z" }, + { url = "https://files.pythonhosted.org/packages/64/a2/4615c8f7d81a00b1d6e6afe19f694e1543582349fb5f4076f6cb5dc36485/cryptography-50.0.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:c87f62a3d3b9888ed0fdde100ec06aa61ca9cd44bad9057d1dff9a516b5f5bb9", size = 4878208, upload-time = "2026-07-31T14:24:45.522Z" }, + { url = "https://files.pythonhosted.org/packages/d2/1a/efcfb02f91407149a0dacffffab791f7e19bf6385f63b3666dc8b5e5c9c8/cryptography-50.0.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:65c2c3add92b45fd0709db8594536aea39c2a67af0e27ffcf049c498501140b7", size = 5037050, upload-time = "2026-07-31T14:24:47.697Z" }, + { url = "https://files.pythonhosted.org/packages/57/30/4a22984d4f1bdfb8c054f07a92bc176b97a3134cc1d6c4b3bffb1f3688b4/cryptography-50.0.0-cp39-abi3-win_amd64.whl", hash = "sha256:d24fead1d4d076e1bfb006dcec392074a3cd8d7b4fc8a595aa64073b2b7a96ba", size = 3874135, upload-time = "2026-07-31T14:24:50.085Z" }, ] [[package]] From b5e53a5e425c6fbb947e6e7cadb89a62a13fa3fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Aug 2026 15:10:48 -0400 Subject: [PATCH 34/61] chore(deps): bump aiohttp from 3.14.1 to 3.14.3 (#4233) Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.14.1 to 3.14.3. - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.14.1...v3.14.3) --- updated-dependencies: - dependency-name: aiohttp dependency-version: 3.14.3 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Davis Bennett Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com> --- uv.lock | 170 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/uv.lock b/uv.lock index 17441eee71..b7f8ae9b3c 100644 --- a/uv.lock +++ b/uv.lock @@ -35,7 +35,7 @@ wheels = [ [[package]] name = "aiohttp" -version = "3.14.1" +version = "3.14.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohappyeyeballs" }, @@ -47,90 +47,90 @@ dependencies = [ { name = "typing-extensions", marker = "python_full_version < '3.13'" }, { name = "yarl" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/82/78/8ea7308cac6934de8c74a14f3d5f65d1c89287426688be79538d0e5c013d/aiohttp-3.14.1.tar.gz", hash = "sha256:307f2cff90a764d329e77040603fa032db89c5c24fdad50c4c15334cba744035", size = 7955794, upload-time = "2026-06-07T21:09:35.529Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1d/21/151624b51cd92553d95424daf4bf19f19ce9be9002d19253e7e7ce67197b/aiohttp-3.14.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:d35143e27778b4bb0fb189562d7f275bff79c62ab8e98459717c0ea617ff2480", size = 757402, upload-time = "2026-06-07T21:06:40.311Z" }, - { url = "https://files.pythonhosted.org/packages/c2/82/280619e0bd7bf2454987e19282616e84762255dd9c8468f62382e8c191f1/aiohttp-3.14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bcfb80a2cc36fba2534e5e5b5264dc7ae6fcd9bf15256da3e53d2f499e6fa29d", size = 512310, upload-time = "2026-06-07T21:06:42.207Z" }, - { url = "https://files.pythonhosted.org/packages/55/b2/2aac325583aaa1353045f96dffa586d8a34e8322e14a7ba49cffeb103ab4/aiohttp-3.14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:27fd7c91e51729b4f7e1577865fa6d34c9adccbc39aabe9000285b48af9f0ec2", size = 512448, upload-time = "2026-06-07T21:06:43.813Z" }, - { url = "https://files.pythonhosted.org/packages/8a/72/a60607cb849faa8af8a356c9329ea2eb6f395d49e82cc82ccba1fd8deb8f/aiohttp-3.14.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:64c567bf9eaf664280116a8688f63016e6b32db2505908e2bdaca1b6438142f2", size = 1766854, upload-time = "2026-06-07T21:06:45.391Z" }, - { url = "https://files.pythonhosted.org/packages/b5/d3/d9fe1c9ec7557ab4d0d82bebaa728c6418f0b93295ec2f4ab015f7710cc7/aiohttp-3.14.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:f5e6ff2bdbb8f4cd3fbe41f99e25bbcd58e3bf9f13d3dd31a11e7917251cc77a", size = 1740884, upload-time = "2026-06-07T21:06:47.413Z" }, - { url = "https://files.pythonhosted.org/packages/c1/dc/f2cecfaf9337ba3e63f181500814ff502aa3d00d9c7ec93a9d23d10a27b2/aiohttp-3.14.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2f73e01dc37122325caf079982621262f96d74823c179038a82fddfc50359264", size = 1810034, upload-time = "2026-06-07T21:06:50.165Z" }, - { url = "https://files.pythonhosted.org/packages/66/d7/2ff65c5e65c0d7476daf7e15c032e0805e36811185b9623e3238ad6c763e/aiohttp-3.14.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:bb2c0c80d431c0d03f2c7dbf125150fedd4f0de17366a7ca33f7ccb822391842", size = 1904054, upload-time = "2026-06-07T21:06:52.035Z" }, - { url = "https://files.pythonhosted.org/packages/20/9c/d445818389df371f56d141d881153ba23183c4735a03f7356ffb43f7757d/aiohttp-3.14.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3e6fc1a85fa7194a1a7d19f44e8609180f4a8eb5fa4c7ed8b4355f080fad235c", size = 1790278, upload-time = "2026-06-07T21:06:54.049Z" }, - { url = "https://files.pythonhosted.org/packages/4d/aa/bf04cb4d865fc6101c2229a294ad744973b72e513fdc5a6b791e6983d72a/aiohttp-3.14.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:686b6c0d3911ec387b444ddf5dc62fb7f7c0a7d5186a7861626496a5ab4aff95", size = 1591795, upload-time = "2026-06-07T21:06:55.911Z" }, - { url = "https://files.pythonhosted.org/packages/dc/b4/4dac0038960427ba832f6609dfb4ea5437d7fd80c72001b9e48f834f428b/aiohttp-3.14.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c6fa4dc7ad6f8109c70bb1499e589f76b0b792baf39f9b017eb92c8a81d0a199", size = 1728397, upload-time = "2026-06-07T21:06:57.777Z" }, - { url = "https://files.pythonhosted.org/packages/2b/f9/7cd4e8ad7aa3b75f17d56bb5498dd604a93d4e6eece822ba0568c413fff0/aiohttp-3.14.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:87a5eea1b2a5e21e1ebdbb33ad4165359189327e63fc4e4894693e7f821ac817", size = 1766504, upload-time = "2026-06-07T21:07:00.009Z" }, - { url = "https://files.pythonhosted.org/packages/f9/df/fc01d9fcad0f73fed3f3d361f1f94f975947b50dff82919f6dc2bf4316cc/aiohttp-3.14.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:1c1421eb01d4fd608d88cc8290211d177a58532b55ad94076fb349c5bf467f0a", size = 1777806, upload-time = "2026-06-07T21:07:02.064Z" }, - { url = "https://files.pythonhosted.org/packages/41/09/47e2d090bddcc8fb4ccb4c314aadc32d7c5d9bb55f50f6ad1c92fc15d501/aiohttp-3.14.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:34b257ec41345c1e8f2df68fa908a7952f5de932723871eb633ecbbff396c9a4", size = 1580707, upload-time = "2026-06-07T21:07:03.942Z" }, - { url = "https://files.pythonhosted.org/packages/3d/36/f1a4ce904ae0b6930cfe9afc96d0896f7ec1a620c400405d63783bb95a9c/aiohttp-3.14.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:de538791a80e5d862addbc183f70f0158ac9b9bb872bb147f1fd2a683691e087", size = 1798121, upload-time = "2026-06-07T21:07:05.987Z" }, - { url = "https://files.pythonhosted.org/packages/70/0a/e0075ce9ca0279ee1d4f0c0b85f54fea02ebc83c3007651a72bece658fec/aiohttp-3.14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:6f71173be42d3241d428f760122febb748de0623f44308a6f120d0dd9ec572e3", size = 1767580, upload-time = "2026-06-07T21:07:07.873Z" }, - { url = "https://files.pythonhosted.org/packages/3e/61/a0c0a8f327a9c52095cdd8e312391b00d3ed64ab6c72bb5c33d8ec251cf7/aiohttp-3.14.1-cp312-cp312-win32.whl", hash = "sha256:ec8dc383ee57ea3e883477dcca3f11b65d58199f1080acaf4cd6ad9a99698be4", size = 452771, upload-time = "2026-06-07T21:07:09.669Z" }, - { url = "https://files.pythonhosted.org/packages/df/d9/ea367c75f16ac9c6cdc8febb25e8318fa21a2b1bc8d6514d4b2d890bface/aiohttp-3.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:2aa92c87868cd13674989f9ee83e5f9f7ea4237589b728048e1f0c8f6caa3271", size = 479873, upload-time = "2026-06-07T21:07:11.538Z" }, - { url = "https://files.pythonhosted.org/packages/03/64/8d96784a7851156db8a4c6c3f6f91042fdf39fb15a4cc38c8b3c14833c45/aiohttp-3.14.1-cp312-cp312-win_arm64.whl", hash = "sha256:2c840c90759922cb5e6dda94596e079a30fb5a5ba548e7e0dc00574703940847", size = 448073, upload-time = "2026-06-07T21:07:13.637Z" }, - { url = "https://files.pythonhosted.org/packages/bc/97/bd137012dd97e1649162b099135a80e1fd59aaa807b2430fc448d1029aff/aiohttp-3.14.1-cp313-cp313-android_21_arm64_v8a.whl", hash = "sha256:b3a03285a7f9c7b016324574a6d92a1c895da6b978cb8f1deee3ac72bc6da178", size = 506882, upload-time = "2026-06-07T21:07:15.501Z" }, - { url = "https://files.pythonhosted.org/packages/ef/79/e5cc690e9d922a66887ceeaca53a8ffd5a7b0be3816142b7abc433742d89/aiohttp-3.14.1-cp313-cp313-android_21_x86_64.whl", hash = "sha256:2a73f487ab8ef5abbb24b7aa9b73e98eaba9e9e031804ff2416f02eca315ccaf", size = 515270, upload-time = "2026-06-07T21:07:17.53Z" }, - { url = "https://files.pythonhosted.org/packages/fe/22/a73ccbf9dbd6e26dda0b24d5fd5db7da92ee3383a79f47677ffb834c5c5b/aiohttp-3.14.1-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:915fbb7b41b115192259f8c9ae58f3ddc444d2b5579917270211858e606a4afd", size = 485841, upload-time = "2026-06-07T21:07:19.555Z" }, - { url = "https://files.pythonhosted.org/packages/3b/b9/57ed8eaf596321c2ad747bd480fb1700dbd7177c60dfc9e4c187f629662e/aiohttp-3.14.1-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:7fb4bdf95b0561a79f259f9d28fbc109728c5ee7f27aff6391f0ca703a329abe", size = 492088, upload-time = "2026-06-07T21:07:21.581Z" }, - { url = "https://files.pythonhosted.org/packages/78/c0/5ebe5270a7c140d7c6f79dcb018640225f14d406c149e4eec04a7d82fe71/aiohttp-3.14.1-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:1b9748363260121d2927704f5d4fc498150669ca3ae93625986ee89c8f80dcd4", size = 501564, upload-time = "2026-06-07T21:07:23.388Z" }, - { url = "https://files.pythonhosted.org/packages/75/7f/8cdaa24fc7983865e0915153b96a9ac5bcdd3548d64c5a27d17cecccad2d/aiohttp-3.14.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:86a6dab78b0e43e2897a3bbe15745aa60dc5423ca437b7b0b164c069bf91b876", size = 751998, upload-time = "2026-06-07T21:07:25.046Z" }, - { url = "https://files.pythonhosted.org/packages/b2/f4/c4227aacfacc5cb0cc2d119b65301d177912a6842cd64e120c47af76064f/aiohttp-3.14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:4dfd6e47d3c44c2279907607f73a4240b88c69eb8b90da7e2441a8045dfd21da", size = 510918, upload-time = "2026-06-07T21:07:27.28Z" }, - { url = "https://files.pythonhosted.org/packages/ab/01/a2d5f96cd4e74424864d30bc0a7e44d0a12dacdcfa91b5b2d1bd3dca6bf3/aiohttp-3.14.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:317acd9f8602858dc7d59679812c376c7f0b97bcbbf16e0d6237f54141d8a8a6", size = 508657, upload-time = "2026-06-07T21:07:29.252Z" }, - { url = "https://files.pythonhosted.org/packages/e8/ed/3c0fb5c500fdd8e7ebc10d1889c04384fffa1a9163eac1356088ca9da1b1/aiohttp-3.14.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bd869c427324e5cb15195793de951295710db28be7d818247f3097b4ab5d4b96", size = 1757907, upload-time = "2026-06-07T21:07:31.03Z" }, - { url = "https://files.pythonhosted.org/packages/0b/ab/d4c924d9bd5be3050c226612413ce68cb54c70d2c31b661bfc8d9a5b6a70/aiohttp-3.14.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:93b032b5ec3255473c143627d21a69ac74ae12f7f33974cb587c564d11b1066f", size = 1737565, upload-time = "2026-06-07T21:07:33.031Z" }, - { url = "https://files.pythonhosted.org/packages/19/2a/37326821ff779084020cdc33224d20b19f42f4183a500ff92022a739eda7/aiohttp-3.14.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f234b4deb12f3ad59127e037bc57c40c21e45b45282df7d3a55a0f409f595296", size = 1799018, upload-time = "2026-06-07T21:07:35.003Z" }, - { url = "https://files.pythonhosted.org/packages/b3/4f/6e947ba73e4ce09070761c05ed3a8ceb7c21f5e46798671d8b2aac0e4626/aiohttp-3.14.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:9af6779bfb46abf124068327abcdf9ce95c9ef8287a3e8da76ccf2d0f16c28fa", size = 1894416, upload-time = "2026-06-07T21:07:36.956Z" }, - { url = "https://files.pythonhosted.org/packages/9d/6e/dbf1d0625dc711fb2851f4f3c3055c39ed58bae92082d8c627dbe6013736/aiohttp-3.14.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:faccab372e66bc76d5731525e7f1143c922271725b9d38c9f97edcc66266b451", size = 1783881, upload-time = "2026-06-07T21:07:39.063Z" }, - { url = "https://files.pythonhosted.org/packages/44/c2/5e25098a67268ed369483ae7d1a58bd0a13d03aab860d2a0e4a6eb25b046/aiohttp-3.14.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f380468b09d2a81633ee863b0ec5648d364bd17bb8ecfb8c2f387f7ac1faf42c", size = 1587572, upload-time = "2026-06-07T21:07:41.058Z" }, - { url = "https://files.pythonhosted.org/packages/2a/bd/cf9cee17e140f942a3de73e658a543aa8fbf35a5fc67a9d2538d52d77f0b/aiohttp-3.14.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:97e704dcd26271f5bda3fa07c3ce0fb76d6d3f8659f4baa1a24442cc9ba177ca", size = 1722137, upload-time = "2026-06-07T21:07:43.014Z" }, - { url = "https://files.pythonhosted.org/packages/89/6d/5684f8c59045c96f81a18cefbc1fbbd79d25b88f1c622f2a5c5c08fcb632/aiohttp-3.14.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:269b76ac5394092b95bc4a098f4fc6c191c083c3bd12775d1e30e663132f6a09", size = 1755953, upload-time = "2026-06-07T21:07:45.933Z" }, - { url = "https://files.pythonhosted.org/packages/a8/40/35caf3170f8359760740a7d9aa0fff2e344bef98e1d1186f5a0f6dec17e6/aiohttp-3.14.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5c0b3e614340c889d575451696374c9d17affd54cd607ca0babed8f8c37b9397", size = 1766479, upload-time = "2026-06-07T21:07:48.047Z" }, - { url = "https://files.pythonhosted.org/packages/6d/a1/b0c61e7a137f0d81de49a82023a6df73c3c16d6fefb0f8e4a93d21639002/aiohttp-3.14.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:5663ee9257cfa1add7253a7da3035a02f31b6600ec48261585e1800a81533080", size = 1580077, upload-time = "2026-06-07T21:07:50.069Z" }, - { url = "https://files.pythonhosted.org/packages/0b/41/194ea4623693009fcefebef7aef63c141754f153e9cd0d39d3b9e36c175c/aiohttp-3.14.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:603a2c834142172ffddc054067f5ec0ca65d57a0aa98a71bc81952573208e345", size = 1791688, upload-time = "2026-06-07T21:07:52.106Z" }, - { url = "https://files.pythonhosted.org/packages/ba/45/4de841f005cfe1fd63e2a2fe011262c515e2a62aa6994b15947e7d717ac9/aiohttp-3.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:cb21957bb8aca671c1765e32f58164cf0c50e6bf41c0bbbd16da20732ecaf588", size = 1761094, upload-time = "2026-06-07T21:07:54.113Z" }, - { url = "https://files.pythonhosted.org/packages/e4/ae/dbce10533d3896d544d5053939ed75b7dc31a1b0973d959b1b5ae21028d6/aiohttp-3.14.1-cp313-cp313-win32.whl", hash = "sha256:e509a55f681e6158c20f70f102f9cf61fb20fbc382272bc6d94b7343f2582780", size = 452662, upload-time = "2026-06-07T21:07:56.06Z" }, - { url = "https://files.pythonhosted.org/packages/7b/d9/0bf1a19362c32f06229da5e7ddfcec91f93474d6307f7a2d3135e9c674dc/aiohttp-3.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:1ac8531b638959718e18c2207fbfe297819875da46a740b29dfa29beba64355a", size = 479748, upload-time = "2026-06-07T21:07:58.319Z" }, - { url = "https://files.pythonhosted.org/packages/22/0a/62e7232dc9484fbec112ceb32efb6a624cc7994ec6e2b019286f17c4e8f2/aiohttp-3.14.1-cp313-cp313-win_arm64.whl", hash = "sha256:250d14af67f6b6a1a4a811049b1afa69d61d617fca6bf33149b3ab1a6dbcf7b8", size = 447723, upload-time = "2026-06-07T21:08:00.154Z" }, - { url = "https://files.pythonhosted.org/packages/c4/a1/5fafa04e1ca91ddb47608699d60649c1c6db3cf41c99e78fc4056f9513db/aiohttp-3.14.1-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:7c106c26852ca1c2047c6b80384f17100b4e439af276f21ef3d4e2f450ae7e15", size = 508531, upload-time = "2026-06-07T21:08:02.093Z" }, - { url = "https://files.pythonhosted.org/packages/fa/2e/bfa02f699d87ffc86d5959270b28f1cb410add3ccaced8ed2e0b8a5238fc/aiohttp-3.14.1-cp314-cp314-android_24_x86_64.whl", hash = "sha256:20205f7f5ade7aaec9f4b500549bbc071b046453aed72f9c06dcab87896a83e8", size = 514718, upload-time = "2026-06-07T21:08:04.476Z" }, - { url = "https://files.pythonhosted.org/packages/85/a5/9594ad6289eebbc97d167c44213d557807f90e59115caad24de21ad2c3b1/aiohttp-3.14.1-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:62a759436b29e677181a9e76bab8b8f689a29cb9c535f45f7c48c9c830d3f8c3", size = 487918, upload-time = "2026-06-07T21:08:06.377Z" }, - { url = "https://files.pythonhosted.org/packages/b4/61/16a32c36c3c49edec122a3dc811f2057df2f94d3b14aa107c8017d981618/aiohttp-3.14.1-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:2964cbf553df4d7a57348da44d961d871895fc1ee4e8c322b2a95612c7b17fba", size = 494014, upload-time = "2026-06-07T21:08:08.263Z" }, - { url = "https://files.pythonhosted.org/packages/9b/89/3ebcf96ed99c05bec9c434aaac6963fd3cbab4a786ae739908a144d9ce44/aiohttp-3.14.1-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:237651caadc3a59badd39319c54642b5299e9cc98a3a194310e55d5bb9f5e397", size = 502398, upload-time = "2026-06-07T21:08:10.244Z" }, - { url = "https://files.pythonhosted.org/packages/fd/3d/b74870a0c2d40c355928cd5b96c7a11fa821b8a40fc41365e64479b151fb/aiohttp-3.14.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:896e12dfdbbab9d8f7e16d2b28c6769a60126fa92095d1ebf9473d02593a2448", size = 758018, upload-time = "2026-06-07T21:08:12.447Z" }, - { url = "https://files.pythonhosted.org/packages/d3/66/f42f5c984d99e49c6cff5f26f590750f2e2f7ef1fcfb99966ab5be1b632e/aiohttp-3.14.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:d03f281ed22579314ba00821ce20115a7c0ac430660b4cc05704a3f818b3e004", size = 512462, upload-time = "2026-06-07T21:08:14.624Z" }, - { url = "https://files.pythonhosted.org/packages/e9/a7/248e1aebe0c7810b0271e021a0f2a5eb6e78a051885b3c9df49f42a5802d/aiohttp-3.14.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:07eabb979d236335fed927e137a928c9adfb7df3b9ec7aa31726f133a62be983", size = 512824, upload-time = "2026-06-07T21:08:16.572Z" }, - { url = "https://files.pythonhosted.org/packages/26/97/2aa0e5ba0727dc3bd5aaebb7ccbc510f7dfb7fb961ec87497cd496635ab1/aiohttp-3.14.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4fe1f1087cbadb280b5e1bb054a4f00d1423c74d6626c5e48400d871d34ecefe", size = 1749898, upload-time = "2026-06-07T21:08:18.635Z" }, - { url = "https://files.pythonhosted.org/packages/00/8d/e97f6c96c891d457c8479d92a514ba194d0412f981d72c70341ee18488ed/aiohttp-3.14.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:367a9314fdc79dab0fac96e216cb41dd73c85bdca85306ce8999118ba7e0f333", size = 1710114, upload-time = "2026-06-07T21:08:20.892Z" }, - { url = "https://files.pythonhosted.org/packages/6f/e6/aa8d7e863048c8fceb5cd6ce74017311cec3ead07847387e12265fb4444e/aiohttp-3.14.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a24f677ebe83749039e7bdf862ff0bbb16818ae4193d4ef96505e269375bcce0", size = 1802541, upload-time = "2026-06-07T21:08:23.044Z" }, - { url = "https://files.pythonhosted.org/packages/83/a8/72193137de57fda4ebfae4563182d082c8856e3b6e9871d0b46f028fb369/aiohttp-3.14.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c83afe0ba876be7e943d2e0ba645809ad441575d2840c895c21ee5de93b9377a", size = 1875776, upload-time = "2026-06-07T21:08:25.288Z" }, - { url = "https://files.pythonhosted.org/packages/a0/18/938441025db6769a3464596b2410af3afde0b21eb2f204c6f766f68af4bd/aiohttp-3.14.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:634e385930fb6d2d479cf3aa66515955863b77a5e3c2b5894ca259a25b308602", size = 1760329, upload-time = "2026-06-07T21:08:27.363Z" }, - { url = "https://files.pythonhosted.org/packages/60/29/bf2496b4065e76e09fe48015aaffe5ce161d8f089b06ac6982070f653076/aiohttp-3.14.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:eeea07c4397bbc57719c4eed8f9c284874d4f175f9b6d57f7a1546b976d455ca", size = 1587293, upload-time = "2026-06-07T21:08:29.805Z" }, - { url = "https://files.pythonhosted.org/packages/49/a2/2136674d52123b1354bd05dd5753c318db47dc0c927cc70b27bab3755456/aiohttp-3.14.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:335c0cc3e3545ce98dcb9cfcb836f40c3411f43fa03dab757597d80c89af8a35", size = 1714756, upload-time = "2026-06-07T21:08:32.094Z" }, - { url = "https://files.pythonhosted.org/packages/a7/b9/e5fd2e6f915503081c0f9b1e8540947037929c70c191da2e4d54b31a21a1/aiohttp-3.14.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:ae6be797afdef264e8a84864a85b196ca06045586481b3df8a967322fd2fa844", size = 1721052, upload-time = "2026-06-07T21:08:34.167Z" }, - { url = "https://files.pythonhosted.org/packages/63/5a/2833e324a2263e104e31e2e91bc5bbee81bc499afd32203faee048a883f0/aiohttp-3.14.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:8560b4d712474335d08907db7973f71912d3a9a8f1dee992ec06b5d2fe359496", size = 1766888, upload-time = "2026-06-07T21:08:36.95Z" }, - { url = "https://files.pythonhosted.org/packages/57/fa/dea6511870913162f3b2e8c42a7614eb203a4540b8c2da43e0bfb0548f3c/aiohttp-3.14.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:2b7edd08e0a5deb1e8564a2fcd8f4561014a3f05252334671bbf55ddd47db0e5", size = 1581679, upload-time = "2026-06-07T21:08:39.292Z" }, - { url = "https://files.pythonhosted.org/packages/14/bd/3cf0d55e71784b33534e9710a67d382d900598b4787fbce6cc7317f8c42a/aiohttp-3.14.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:b6ff7fcee63287ae57b5df3e4f5957ce032122802509246dec1a5bcc55904c95", size = 1782021, upload-time = "2026-06-07T21:08:41.407Z" }, - { url = "https://files.pythonhosted.org/packages/c1/af/14bb5843eccbe234f4dfb78ab73e549d99727247e62ae5d62cbd22eaf5b0/aiohttp-3.14.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:6ffbb2f4ec1ceaff7e07d43922954da26b223d188bf30658e561b98e23089444", size = 1742574, upload-time = "2026-06-07T21:08:43.795Z" }, - { url = "https://files.pythonhosted.org/packages/f2/1e/fbeb7af9210a67ac0f9c9bec0f8f4568497924e33137a3d5b48e1cf85f3f/aiohttp-3.14.1-cp314-cp314-win32.whl", hash = "sha256:a9875b46d910cff3ea2f5962f9d266b465459fe634e22556ab9bd6fc1192eea0", size = 457773, upload-time = "2026-06-07T21:08:46.168Z" }, - { url = "https://files.pythonhosted.org/packages/f0/2b/13e8d741a9ec5db7d900c060554cf8352ab85e44e2a4469ebb9d377bda17/aiohttp-3.14.1-cp314-cp314-win_amd64.whl", hash = "sha256:af8b4b81a960eeaf1234971ac3cd0ba5901f3cd42eae42a46b4d089a8b492719", size = 485001, upload-time = "2026-06-07T21:08:48.401Z" }, - { url = "https://files.pythonhosted.org/packages/df/30/491acfa2c4d6c3ff59c49a14fc1b50be3241e25bbb0c84c09e2da4d11395/aiohttp-3.14.1-cp314-cp314-win_arm64.whl", hash = "sha256:cf4491381b1b57425c315a56a439251b1bdac07b2275f19a8c44bc57744532ec", size = 453809, upload-time = "2026-06-07T21:08:50.7Z" }, - { url = "https://files.pythonhosted.org/packages/34/e3/19dbe1a1f4cc6230eb9e314de7fe68053b0992f9302b27d12141a0b5db53/aiohttp-3.14.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:819c054312f1af92947e6a55883d1b66feefab11531a7fc45e0fb9b63880b5c2", size = 793320, upload-time = "2026-06-07T21:08:52.775Z" }, - { url = "https://files.pythonhosted.org/packages/7f/20/1b7182219ba1b108430d6e4dc53d25ae02dcfcf5a045b33af4e8c5167527/aiohttp-3.14.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:10ee9c1753a8f706345b22496c79fbddb5be0599e0823f3738b1534058e25340", size = 529077, upload-time = "2026-06-07T21:08:55Z" }, - { url = "https://files.pythonhosted.org/packages/b9/c8/14ce60ec31a2e5f5274bb17d383a6f7a3aabca31ac04eee05585bbadab16/aiohttp-3.14.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1601cc37baf5750ccacae618ec2daf020769581695550e3b654a911f859c563d", size = 532476, upload-time = "2026-06-07T21:08:57.176Z" }, - { url = "https://files.pythonhosted.org/packages/7e/02/9ac85e081e53da2e061b02fa7758fe0a12d17b8ce2d1f5e6c7cb76730328/aiohttp-3.14.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4d6e0ac9da31c9c04c84e1c0182ad8d6df35965a85cae29cd71d089621b3ae94", size = 1922347, upload-time = "2026-06-07T21:08:59.563Z" }, - { url = "https://files.pythonhosted.org/packages/c0/3e/d3ba07a0ab38b5389e10bec4362d21e10a4f667cba2d79ba30837b3a5059/aiohttp-3.14.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:9e8f2d660c350b3d0e259c7a7e3d9b7fc8b41210cbcc3d4a7076ff0a5e5c2fdc", size = 1786465, upload-time = "2026-06-07T21:09:01.909Z" }, - { url = "https://files.pythonhosted.org/packages/0b/cb/e2ee978a00cfb2df829704a69528b18154eba5939f45bc1efa8f33aee4c5/aiohttp-3.14.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4691802dda97be727f79d86818acaad7eb8e9252626a1d6b519fedbb92d5e251", size = 1909423, upload-time = "2026-06-07T21:09:04.357Z" }, - { url = "https://files.pythonhosted.org/packages/73/5d/1430334858b1022b58ae50399a918f0bd6fe8fa7fa183598d657ff61e040/aiohttp-3.14.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c389c482a7e9b9dc3ee2701ac46c4125297a3818875b9c305ddb603c04828fd1", size = 2001906, upload-time = "2026-06-07T21:09:06.722Z" }, - { url = "https://files.pythonhosted.org/packages/66/4e/560c7472d3d198a23aa5c8b19a5115bf6a9b77b7d3e4bb363da320430ad2/aiohttp-3.14.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fc0cacab7ba4e56f0f81c82a98c09bed2f39c940107b03a34b168bdf7597edd3", size = 1877095, upload-time = "2026-06-07T21:09:09.011Z" }, - { url = "https://files.pythonhosted.org/packages/0d/f1/4745806578d447db4a784a8591e2dae3afdfc2bcb96f8f81271b13df6543/aiohttp-3.14.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:979ed4717f59b8bb12e3963378fa285d93d367e15bcd66c721311826d3c44a6c", size = 1676222, upload-time = "2026-06-07T21:09:11.461Z" }, - { url = "https://files.pythonhosted.org/packages/6a/c9/48255813cca749a229ef0ab476004ec623728ad79a9c0840616f6c076325/aiohttp-3.14.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:38e1e7daaea81df51c952e18483f323d878499a1e2bfe564790e0f9701d6f203", size = 1842922, upload-time = "2026-06-07T21:09:14.118Z" }, - { url = "https://files.pythonhosted.org/packages/3d/c0/bbd054e2bee909f529523a5af3891052606af5143c09f5f183ec3b234676/aiohttp-3.14.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:4132e72c608fe9fecb8f409113567605915b83e9bdd3ea56538d2f9cd35002f1", size = 1825035, upload-time = "2026-06-07T21:09:16.447Z" }, - { url = "https://files.pythonhosted.org/packages/a8/ae/90395d4376deceb74e09ec26b6adf7d2015a6f8802d6d84446af860fef04/aiohttp-3.14.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:eefd9cc9b6d4a2db5f00a26bc3e4f9acf71926a6ec557cd56c9c6f27c290b665", size = 1849512, upload-time = "2026-06-07T21:09:18.742Z" }, - { url = "https://files.pythonhosted.org/packages/93/bd/fb25f3049957553d4ce0ba6ae480aa2f592a6985497fca590837d16c1be0/aiohttp-3.14.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:b165790117eea512d7f3fb22f1f6dad3d55a7189571993eb015591c1401276d1", size = 1668571, upload-time = "2026-06-07T21:09:21.458Z" }, - { url = "https://files.pythonhosted.org/packages/3f/22/7f73303d64dd567ff3addca90b556690ed1233a47b8f55d242fb90af3681/aiohttp-3.14.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:ed09c7eb1c391271c2ed0314a51903e72a3acb653d5ccfc264cdf3ef11f8269d", size = 1881159, upload-time = "2026-06-07T21:09:23.813Z" }, - { url = "https://files.pythonhosted.org/packages/44/be/0474c5a8b5640e1e4aa1923430a91f4151be82e511373fe764189b89aef5/aiohttp-3.14.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:99abd37084b82f5830c635fddd0b4993b9742a66eb746dacf433c8590e8f9e3c", size = 1841409, upload-time = "2026-06-07T21:09:26.207Z" }, - { url = "https://files.pythonhosted.org/packages/7b/3c/bb4a7cba26956cb3da4553cc2056cf67be5b5ff6e6d8fa4fbdff73bfb7ae/aiohttp-3.14.1-cp314-cp314t-win32.whl", hash = "sha256:47ddf841cdecc810749921d25606dee45857d12d2ad5ddb7b5bd7eab12e4b365", size = 494166, upload-time = "2026-06-07T21:09:28.505Z" }, - { url = "https://files.pythonhosted.org/packages/8a/84/ec80c2c1f66a952555a9f86df6b33af65108a6febfa0471b69013a12f807/aiohttp-3.14.1-cp314-cp314t-win_amd64.whl", hash = "sha256:5e78b522b7a6e27e0b25d19b247b75039ac4c94f99823e3c9e53ae1603a9f7e9", size = 530255, upload-time = "2026-06-07T21:09:30.843Z" }, - { url = "https://files.pythonhosted.org/packages/2a/71/6e22be134a4061ada85a92951b842f2657f17d926b727f3f94c56ae963d6/aiohttp-3.14.1-cp314-cp314t-win_arm64.whl", hash = "sha256:90d53f1609c29ccc2193945ef732428382a28f78d0456ae4d3daf0d48b74f0f6", size = 469640, upload-time = "2026-06-07T21:09:33.028Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/58/d9/22ce5786ac0c1653ae8b6c23bded02c1686d11f0dbb45b31ce128e0df985/aiohttp-3.14.3.tar.gz", hash = "sha256:9491196535a88924a60afd5b5f434b5b203b6cc616250878dbdb223a8f7844bc", size = 7971213, upload-time = "2026-07-23T01:57:27.037Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/d4/eb96299230e20acf2efae207cb8d69051f1f68e357e5ea5e479bf6fb097a/aiohttp-3.14.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:39aded8c7f3b935b54aab1d8d73c70ec0ee2d3ec3b943e0e86611bc150ba47f5", size = 754690, upload-time = "2026-07-23T01:53:47.332Z" }, + { url = "https://files.pythonhosted.org/packages/88/11/e7a70a209eb9a067c0d3212b518a0134e3484f5178c7533878b6b514d469/aiohttp-3.14.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5bcb6ff3fdab1258a192679ff1a05d44f59626430aa05cd1a9d2447423599228", size = 509484, upload-time = "2026-07-23T01:53:51.159Z" }, + { url = "https://files.pythonhosted.org/packages/30/07/4bbc222cc8dbe31d4c3e8a5baad2286e4d42026ac0c570027b89afce6344/aiohttp-3.14.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:617105e2c3018ee38d0c8ce5ee3c84f621a6d8b9f723202aacaff28449ca91ee", size = 511949, upload-time = "2026-07-23T01:53:55.083Z" }, + { url = "https://files.pythonhosted.org/packages/54/b9/42e74c46b7b7c794b995bbc1f573fb48950c38b19d8600c62a6804ee2d67/aiohttp-3.14.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f631fe87a6f30df5fbe6d79640b25e4cffb38c31c7fb6f10871517b84b0f8c1a", size = 1765282, upload-time = "2026-07-23T01:53:59.662Z" }, + { url = "https://files.pythonhosted.org/packages/6b/ed/62bc4d74363ad346d518e0720363a949f63e2e23439a79eb5813d4d29bb3/aiohttp-3.14.3-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a94dbaae5ae27bd849c93570669bff91e0510f33a80805738e3de72a7be0447b", size = 1741511, upload-time = "2026-07-23T01:54:04.063Z" }, + { url = "https://files.pythonhosted.org/packages/d0/9f/181e8a8bc79e47d13c7fc4540bd7a3b729d9505609c61f392a8dd2fbfe55/aiohttp-3.14.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8f2f1c4c032c7cedd7d8da6f54c97b70266c6570c3108d3fdffee7188bb70529", size = 1810680, upload-time = "2026-07-23T01:54:09.882Z" }, + { url = "https://files.pythonhosted.org/packages/5c/9a/dec94d6ad694552fe3424e3f1928d7a606a5d9d9433a04e7ecdd9d38ae7f/aiohttp-3.14.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ea05e1f97ceea523942d9b2a7d7c0359d781d683d6b043f5943a602b14da4787", size = 1905646, upload-time = "2026-07-23T01:54:13.475Z" }, + { url = "https://files.pythonhosted.org/packages/52/b7/7cd31f29d6055bd711ae6e669367fba6f5ae9de463910a793e30556a8db7/aiohttp-3.14.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:543906c127fb1d929b95076db19b83fa2d46751006ff1e23b093aa5ac4d8db42", size = 1792122, upload-time = "2026-07-23T01:54:15.752Z" }, + { url = "https://files.pythonhosted.org/packages/66/73/10b1ef93afa61f4963c746257b70ced619cf31a4798671de5fdb2608501d/aiohttp-3.14.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0a5ff2dfbb9ce645fa5b8ef3e02c6c0b9cc3f6030ff863d0c51fffc50cb5541b", size = 1591127, upload-time = "2026-07-23T01:54:19.489Z" }, + { url = "https://files.pythonhosted.org/packages/49/ed/3b203fa6de1b338c14acdc06bf6ca9b043b7944f005966958c2ced932cde/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:041badb8f84396357c4d3ad26de6afd7a32b112f43d3c63045c0c8278cfd2043", size = 1725210, upload-time = "2026-07-23T01:54:24.129Z" }, + { url = "https://files.pythonhosted.org/packages/28/b7/1c2aab8c706436dcc28598452488ac9cd7c409da815237c28c27d58993e6/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:530125ee1163c4219af35dc3aa1206e541e7b31b6efc1a3f93b70a136f65d427", size = 1764848, upload-time = "2026-07-23T01:54:27.973Z" }, + { url = "https://files.pythonhosted.org/packages/54/50/94c28f08b131c4bf10984ea2c7a536c9920608bb2d6e7f95642c30cc87b7/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c8653fd547c93a61aadc612007790f5555cdd18946fa48cf45e26d8ea4ea473d", size = 1777102, upload-time = "2026-07-23T01:54:31.775Z" }, + { url = "https://files.pythonhosted.org/packages/13/d4/e7d09ba7d345fb2d74440fd2fa033c5e079fac05552927705986f41a364f/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:89176250f686cb9853c0fb7ead90e639e915b84a6f43eedc2a4e7ec21f1037f0", size = 1580205, upload-time = "2026-07-23T01:54:34.518Z" }, + { url = "https://files.pythonhosted.org/packages/a3/84/072a91d68e1e1eb587985b54baab94221277f877e8ef274fc213a0ceae28/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3a26434dafe408229ff3403458ca58de24fb51936504decac49ce6755f77e59d", size = 1797219, upload-time = "2026-07-23T01:54:36.995Z" }, + { url = "https://files.pythonhosted.org/packages/e0/eb/aad34e897e668424d6e995da5dff8a4a09af93363d3392488772957a63aa/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d1558173930a5a8d3069cee5c92fc91c87c4dbcb099debbb3622053717145a19", size = 1768629, upload-time = "2026-07-23T01:54:40.103Z" }, + { url = "https://files.pythonhosted.org/packages/b6/2b/6bb88ddba0fecd9122aa3ebcad25996cf6c083a4a7040dbb3a4f97972af6/aiohttp-3.14.3-cp312-cp312-win32.whl", hash = "sha256:16100ad3ab8d649fdfbee87602d9d2dcdca9df0b9eda8a1b5fdc0d41f96da559", size = 451481, upload-time = "2026-07-23T01:54:42.547Z" }, + { url = "https://files.pythonhosted.org/packages/76/9b/f2f8f108da17ecef2cc3efc424e8b7ad3782b1a8360f7b8eae8ced84f6ea/aiohttp-3.14.3-cp312-cp312-win_amd64.whl", hash = "sha256:33a2d7c28d33797a2e99923dffa63f83d908a19b6bf26cfe80fa790aa5e1a75a", size = 476845, upload-time = "2026-07-23T01:54:44.853Z" }, + { url = "https://files.pythonhosted.org/packages/3e/44/28dac80a8941b604f4da10ce21097614ca1bf905ce93dca28d8d7de9c1e7/aiohttp-3.14.3-cp312-cp312-win_arm64.whl", hash = "sha256:362a3fd481769cac1a824514bcd86fda51c65e8fe6e051099e008fddde6db17c", size = 448050, upload-time = "2026-07-23T01:54:47.087Z" }, + { url = "https://files.pythonhosted.org/packages/57/be/5afd201cc0ab139029aadb75392efe85a293403d9dd3a3226161c21ce00c/aiohttp-3.14.3-cp313-cp313-android_21_arm64_v8a.whl", hash = "sha256:2e9878ae68e4a5f1c0abe4dd497dbc3d51946f5837b56759e2a02e78fa90ef86", size = 506269, upload-time = "2026-07-23T01:54:49.075Z" }, + { url = "https://files.pythonhosted.org/packages/22/09/dec8189d62b45ade009f6792a2264b942a90cb88aeaf181239933cd72c3c/aiohttp-3.14.3-cp313-cp313-android_21_x86_64.whl", hash = "sha256:f3d2669fe7dec7fc359ecdb5984b29b50d85d5d00f8c1cb61de4f4a24ee42627", size = 515166, upload-time = "2026-07-23T01:54:51.894Z" }, + { url = "https://files.pythonhosted.org/packages/28/24/2854869d29ed8a8b19d74f9ec6629515f7e04d02dd329d9d179201e58e47/aiohttp-3.14.3-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:cc7cb243a68167172f48c1fd43cee91ec4b1d40cefd190edd43369d1a6bc9c82", size = 486263, upload-time = "2026-07-23T01:54:54.223Z" }, + { url = "https://files.pythonhosted.org/packages/d4/dd/57187c8be2a35aea65eaee3bd2c3dcbbcf0204f5106c89637e3610380cd1/aiohttp-3.14.3-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:78253b573e6ffab5028924fc98bc281aae05445969982a10864bc360dea2016c", size = 492299, upload-time = "2026-07-23T01:54:56.236Z" }, + { url = "https://files.pythonhosted.org/packages/b9/11/06ae6ed8f0d414edf4068861e233d8fe23ee699bfd4b3ceb8663db948a62/aiohttp-3.14.3-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:7041d52c3a7fa20c9e8c182b534704abb19502c8bdcbde7ab23bfda6f642394f", size = 502235, upload-time = "2026-07-23T01:54:58.377Z" }, + { url = "https://files.pythonhosted.org/packages/7e/a3/559639c34a345d2cf7c52dff6838119f2eaf29eb508227b5b83f573af813/aiohttp-3.14.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ac74facc01463f138b0da5580329cfcc82818dea5656e83ddcd11268fc12ff80", size = 750883, upload-time = "2026-07-23T01:55:00.65Z" }, + { url = "https://files.pythonhosted.org/packages/91/cd/41e131f13afd1e7b0172a9d9eda085ef90eb8439f41f0d279db81ed3ae60/aiohttp-3.14.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d6218d92e450824e9b4881f44e8c09f1853b490f9a64130801024a4793b1b3b0", size = 508473, upload-time = "2026-07-23T01:55:02.945Z" }, + { url = "https://files.pythonhosted.org/packages/bc/6b/e7f13410d391c6e55b4c007a8de024355389d7d459e3d64c42b2d33617e5/aiohttp-3.14.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:11fb37ef075669eee52ab1928fbf6e1741fada40409fa309ebde9607a962aebf", size = 509190, upload-time = "2026-07-23T01:55:05.173Z" }, + { url = "https://files.pythonhosted.org/packages/97/21/6464573e53d69672cc1eada3e5c5cb2d2efa82701e8305a0f2047a576967/aiohttp-3.14.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:55bdcc472aafe2de4a253045cc128007a64f1e0264fb675791e132ea5edaa3bd", size = 1761478, upload-time = "2026-07-23T01:55:07.383Z" }, + { url = "https://files.pythonhosted.org/packages/1a/81/d217043a4c17fbce360905e3b2bdd20139ebc9a2de836d035d179c4da006/aiohttp-3.14.3-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c39846c3aad97a8530c89d7a3869a8f8e9e3762c6ac0504481e5c80948f7e807", size = 1735092, upload-time = "2026-07-23T01:55:09.803Z" }, + { url = "https://files.pythonhosted.org/packages/a1/66/e13a02d0eeb1a9a502402a977abb4e4abff9fe4051c26f80558c57a7c975/aiohttp-3.14.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5895ef58c4620afe02fa16044f023dc4dafec08158f9d08874a46a7dbc0341b8", size = 1800546, upload-time = "2026-07-23T01:55:12.012Z" }, + { url = "https://files.pythonhosted.org/packages/26/5e/57d42fca1d18cb5acc1cad945d017fabc5d6ae71d8a08ad66be8dc3ee544/aiohttp-3.14.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fa9467a8113aa69d3d7c55a70ef0b7c636010a40993f3df9d9d0d73b3eb7ef24", size = 1895250, upload-time = "2026-07-23T01:55:14.357Z" }, + { url = "https://files.pythonhosted.org/packages/ca/1c/7da8d08e74d56f00070822f9638ff3f1c563f8ad87d1efa996c87bfc8644/aiohttp-3.14.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d7d2deec16eeedf55f2c7cf75b521ea3856a5177e123844f8fd0f114ce252cb5", size = 1789289, upload-time = "2026-07-23T01:55:16.668Z" }, + { url = "https://files.pythonhosted.org/packages/cd/0f/cf16bcf56896981c1a0319f5d5db9337994b5165730c48a8fa07e9b34be6/aiohttp-3.14.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:dd54d0e8717de95939766febac482ac0474d8ac3b048115f9f2b1d23a16e7db4", size = 1586706, upload-time = "2026-07-23T01:55:18.913Z" }, + { url = "https://files.pythonhosted.org/packages/fe/6f/76eac12a7f2480e1e304f842efdb07db33256b0d9165b866b6ef0806c202/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:df82f3787c940c94986b34222d59c9e38843fba85139f36e85255a82ad5355a9", size = 1724652, upload-time = "2026-07-23T01:55:21.296Z" }, + { url = "https://files.pythonhosted.org/packages/39/b6/19c8c592baeeb94b75f966547d40c02ac7590902306ec5863d5c027cf506/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:42a67efc36300d052fb4508a53e8b6901b9284b599ae63945c377569c5fcc1e1", size = 1756239, upload-time = "2026-07-23T01:55:23.705Z" }, + { url = "https://files.pythonhosted.org/packages/dc/c9/4e9383150296f97f873b680c4de8fb2cd88608fb9f48c79edcb111611abc/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:7a75aa63cbf9b21cfaf60dc2657e19df2c2867d91707d653fee171ffeedd1371", size = 1769161, upload-time = "2026-07-23T01:55:26.082Z" }, + { url = "https://files.pythonhosted.org/packages/aa/1e/147bdc6cc5de5f3ab011be8bf5d6e786633249f22c20bae06f85e45f5387/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:e92eb8acc45eb6a9f4935071a77edf5b85cc6f8dfad5cd99e97653c26593cdde", size = 1578759, upload-time = "2026-07-23T01:55:28.846Z" }, + { url = "https://files.pythonhosted.org/packages/fd/31/78388a9d6040ece2e11df62ea229a822cf5e52d238374b220ae9975b2623/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b014a6ed7cf912e787149fdc529166d3ceabac23f26efeea3158c9aba2354e7e", size = 1792025, upload-time = "2026-07-23T01:55:31.457Z" }, + { url = "https://files.pythonhosted.org/packages/03/51/a3d29fdf2c25d796746af8ad6fe56a45d6256c38b0a8a2ed752e1160b3a2/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:3d4f72af88ac2474bb5bca640030320e3d38a0163a1d7533500e87be458eef71", size = 1768477, upload-time = "2026-07-23T01:55:33.87Z" }, + { url = "https://files.pythonhosted.org/packages/29/a6/442e18b5afeade534d877a2dc3c3e392aff8d49787890b0cf84790410267/aiohttp-3.14.3-cp313-cp313-win32.whl", hash = "sha256:5f08ec777f35ee70720233b8b9811d3bb5d728137f30ac91b7457709c3261ac0", size = 451069, upload-time = "2026-07-23T01:55:36.121Z" }, + { url = "https://files.pythonhosted.org/packages/9d/69/3d876ac02659f271cf7f6769f14a8e3de5b6e888ed8b5a7e998086a4cec8/aiohttp-3.14.3-cp313-cp313-win_amd64.whl", hash = "sha256:dff9461ec275f22135650d5ba4b4931a11f3958df7dfbb8db630000d4dee0883", size = 476518, upload-time = "2026-07-23T01:55:38.303Z" }, + { url = "https://files.pythonhosted.org/packages/b2/0e/50d6e6471cd31edce8b282bdec59375a3a69124d8a989a0b1313355cae52/aiohttp-3.14.3-cp313-cp313-win_arm64.whl", hash = "sha256:ddcac3c6b382e81f1dd0499199d4136b877beb4cb5ef770bbbfba56c4b8f55d2", size = 447676, upload-time = "2026-07-23T01:55:40.451Z" }, + { url = "https://files.pythonhosted.org/packages/c8/20/887fdcf832326571b370ffc347b3e70abe101096f3720126aac161b1d872/aiohttp-3.14.3-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:49f7325beb0f85ef4aef5f48f490269575f83e6e2acad00a1d80b807eb027062", size = 509067, upload-time = "2026-07-23T01:55:42.618Z" }, + { url = "https://files.pythonhosted.org/packages/ad/a3/92cec936f78cc4bf0fa5554ebe593b73459d94e3c62303e1902a4cccb6f7/aiohttp-3.14.3-cp314-cp314-android_24_x86_64.whl", hash = "sha256:e3be98a7c30b8c25d573dafba7171d66dfb05ee6a9070fc46535464ff97700a6", size = 514774, upload-time = "2026-07-23T01:55:44.937Z" }, + { url = "https://files.pythonhosted.org/packages/29/ba/2a0c38df3fc557620b6a5acd98364af050053b6285b4dc7ee74100c63c18/aiohttp-3.14.3-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:614c61d478b83953e261d02bb2df750f17227cd33ef8002945bf5aebbde21919", size = 488134, upload-time = "2026-07-23T01:55:47.135Z" }, + { url = "https://files.pythonhosted.org/packages/48/d6/d51b7d4bf309af3693940d8ffd2b9ed0b682434ef85959b7c9c137f60cf8/aiohttp-3.14.3-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:1caa7b0d05f3e3a36f87788c59e970a7ee1cefcfcbb924a9f138c4a6551c9cb7", size = 494201, upload-time = "2026-07-23T01:55:49.451Z" }, + { url = "https://files.pythonhosted.org/packages/3f/5a/8f624384e5f1efabb5229b94157eb966b021e97bdb188c62860c2ae243c2/aiohttp-3.14.3-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:dfa68deb2a443bdaa3ea5297b0699c1464f08aef3812b486d1348eee61b07dc0", size = 502766, upload-time = "2026-07-23T01:55:51.656Z" }, + { url = "https://files.pythonhosted.org/packages/a6/26/4ff0164370deec18fb19254ee4ab10b7a73304ac0c860b13f5f84663759b/aiohttp-3.14.3-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:e72ee89e28d907a18f46959b4eb0bb06701cc7f8cf4366e00029e2ccfaaf5924", size = 756557, upload-time = "2026-07-23T01:55:53.964Z" }, + { url = "https://files.pythonhosted.org/packages/97/a3/7056b86dc0d9ec709ea9777eae3b0161428f943372f8b98c01c11593b682/aiohttp-3.14.3-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:ad4c8b7488d745d2ca4838ebd8ae5ba9b56341d30b1da43640e4ce87f9f49646", size = 510168, upload-time = "2026-07-23T01:55:56.22Z" }, + { url = "https://files.pythonhosted.org/packages/85/ed/0357a015892fd68058bf2d39d3fd1958e459b997a7db30aaa6aaa434ae96/aiohttp-3.14.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:db332af25642007330fca8be5c4d194caf2bea7a7fc84415aff3497af5dfee6b", size = 512957, upload-time = "2026-07-23T01:55:58.437Z" }, + { url = "https://files.pythonhosted.org/packages/47/d1/8aba53f15ccb2238405f5e9d30e2a8ca44f93878c26e7165ade00d374b1c/aiohttp-3.14.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:25bd2708db6bdf6a6630dd37bdcdfcb47c4434d22ac69c64665b802910140b30", size = 1750149, upload-time = "2026-07-23T01:56:00.856Z" }, + { url = "https://files.pythonhosted.org/packages/49/bd/40c3fee327529284375c6701cbb0fa4600cc2e8432af1378f897e2ef7d3a/aiohttp-3.14.3-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:cef89a58e628c4efcac3275c2d68083f82426dcdc89c1492a6f654f9f7ea6ab9", size = 1707685, upload-time = "2026-07-23T01:56:03.371Z" }, + { url = "https://files.pythonhosted.org/packages/2a/a3/ca0cc6724cca8114b05694abd916060758c79894c3aa5b012cdadc1bc28e/aiohttp-3.14.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c23ec8ee9d5ab2f5421f9c7fffce208435607af27fd46d4a44e031954352838f", size = 1803911, upload-time = "2026-07-23T01:56:05.817Z" }, + { url = "https://files.pythonhosted.org/packages/95/b5/85b099c299c3ffd38ad9b3e43694c8a346934e4a30c88c4fd5a841234f77/aiohttp-3.14.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e2667f0bbe7eb6c74eae5e9691441ad186e5845ca3cff63230fc09c4e7514f5d", size = 1876929, upload-time = "2026-07-23T01:56:08.413Z" }, + { url = "https://files.pythonhosted.org/packages/d5/b7/1da684a04175473fa4cddbf9a2f572e79514c3fd27a74597f43057d4f3da/aiohttp-3.14.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:18cb43369747b2ae007bd2655fb8e63a099c2ff1d207962943636dac989b3147", size = 1761112, upload-time = "2026-07-23T01:56:10.918Z" }, + { url = "https://files.pythonhosted.org/packages/d1/16/bc4b55e3e5cb175fd69c53c90d60d2f47797cb343da5106e23863dc4dba4/aiohttp-3.14.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d77640cc618c1d99fc4f8589c0f24a730adfa54eb1e57ef7bf0c8dfb78da898c", size = 1583500, upload-time = "2026-07-23T01:56:13.613Z" }, + { url = "https://files.pythonhosted.org/packages/2a/e8/13a9d957a1ee40837f46aa30f0f4c657e673ad86a2e6362a9f9be20d26d9/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:53e5179d8abb5710f8e83ba207c41c8d1261fcffd4616500e15ca2b7a33be10a", size = 1713940, upload-time = "2026-07-23T01:56:15.969Z" }, + { url = "https://files.pythonhosted.org/packages/38/05/d33c680c1bcf1c7e130f9cbfc1fc02fe8bb0c4af2a94a53dd5fb56131e5c/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:cd817772b2fcf2b8c0905795318485f9ec16eae60b29feb7f4c77085311637f0", size = 1724413, upload-time = "2026-07-23T01:56:18.591Z" }, + { url = "https://files.pythonhosted.org/packages/85/1d/af798d306f7a74b6a632dbcabcf62a4c91391b7582d2a8c6d7712e2cc54e/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:4e3ac92d90e92773b2362d506068e9a948192bd553e743c5b2429e28527c8661", size = 1770748, upload-time = "2026-07-23T01:56:21.074Z" }, + { url = "https://files.pythonhosted.org/packages/a8/92/ad720d472556a995049206867765e9410969684f86ee09423ff9969044c1/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:3f42e9b78301f11c8f861746175d8b9c1ccef713fcad9eab396e2f6db8ed4a22", size = 1577564, upload-time = "2026-07-23T01:56:23.475Z" }, + { url = "https://files.pythonhosted.org/packages/60/ad/0ed7586cbef7a884e23a752fa2bb987a122e6a5dd50dab109258d0a95193/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:9d9edccfe496b476db5f398d97b865e9a6752bcf8aec4eef8390ce20fb64bb41", size = 1782080, upload-time = "2026-07-23T01:56:25.994Z" }, + { url = "https://files.pythonhosted.org/packages/97/ea/dbaed0d73e8a69aad653b045dab451c67c2454bb731a37b45a86593e9422/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:1c5ec8fb1bcc31a8466f74aaf26c345d5c386fa4bd08a3f0eb9c7a4a3fe8b5bf", size = 1745813, upload-time = "2026-07-23T01:56:28.604Z" }, + { url = "https://files.pythonhosted.org/packages/81/1b/6893d4bc57e434fc93a6c9217c637d967a0b651d989f6e3265179375754a/aiohttp-3.14.3-cp314-cp314-win32.whl", hash = "sha256:38901a84da3ce22249f6e860bf8f90d141bcab7da090cc398f8bb58c0e44b7da", size = 455872, upload-time = "2026-07-23T01:56:31.031Z" }, + { url = "https://files.pythonhosted.org/packages/f5/8b/c7baa1ba1eda4db6989baefe5de6d99834921b84ebd7918624febcb9f290/aiohttp-3.14.3-cp314-cp314-win_amd64.whl", hash = "sha256:8b3b60de05f3dcb6f6a00f818bb2ec781cee4de0645f59ccaf99b1d1823b6100", size = 481030, upload-time = "2026-07-23T01:56:33.365Z" }, + { url = "https://files.pythonhosted.org/packages/22/8c/c29d067df825a2df88ca432db848aa2fe8199598359cc06c12b09320cac9/aiohttp-3.14.3-cp314-cp314-win_arm64.whl", hash = "sha256:1576145bdceeb92382d899751e12743a3a5b8e460a841e3e50543859e54864dc", size = 453669, upload-time = "2026-07-23T01:56:35.731Z" }, + { url = "https://files.pythonhosted.org/packages/6a/a4/9c033beb355d39b6147980597ec9645e4729243f686ee4dc73945de72030/aiohttp-3.14.3-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:8800c996b01c2772a783e3e46f3e1abd5823029adca0df54231960de9bfefa5b", size = 791403, upload-time = "2026-07-23T01:56:37.972Z" }, + { url = "https://files.pythonhosted.org/packages/80/ca/87c32a0a7704583cfc49660bd817889bae5b830bf53b5dcb4e92145ac2da/aiohttp-3.14.3-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:ebe8e504f058fe91223351cecd2d9d6946c9d241bb0250d898ffbdf584cc72b0", size = 526413, upload-time = "2026-07-23T01:56:40.523Z" }, + { url = "https://files.pythonhosted.org/packages/9e/d8/8ec0e471248c500acdce2be3f46db8fb62b5eb60efef072529cc85ee1d26/aiohttp-3.14.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:30402d03a7c0ff52bce290b57e564e9079fd9d0cb545c8aba73f86a103162d2e", size = 532135, upload-time = "2026-07-23T01:56:42.876Z" }, + { url = "https://files.pythonhosted.org/packages/fe/45/f8919fd936e8b79fcd9bda7b6d8e62613462a713f4f17987fd7c34399142/aiohttp-3.14.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9fc7b5bfec6573f3ae844f457fdde5adeb713f8b8e4a81ad64fc207b49383716", size = 1922742, upload-time = "2026-07-23T01:56:45.528Z" }, + { url = "https://files.pythonhosted.org/packages/f6/ec/9ca76b28a27525b0cc53e20842e0228b022f301ce1f436b7d814b4aaf2df/aiohttp-3.14.3-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8a5fd34f7f7410d1730d5c2ba873cacb2eed3fede366feb268a70ba22581ed8f", size = 1787371, upload-time = "2026-07-23T01:56:48.045Z" }, + { url = "https://files.pythonhosted.org/packages/b1/04/6acdbf17315f7b55f1937e3387acb89a3cddeb4995689553d064af8e92ab/aiohttp-3.14.3-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:270d3dace9ca2f10f0da5d8ebe519b7a310fc6112ed916e32df5866df0888553", size = 1912623, upload-time = "2026-07-23T01:56:50.605Z" }, + { url = "https://files.pythonhosted.org/packages/86/e6/438b0c79ca6f45eb9fd9817dd4c01a91919a38c0de5ee9e05e2b4dc0ece7/aiohttp-3.14.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3ae5b3a59436d089b5395d910121a390feed4d00578eb95a0fd1a329fe963100", size = 2005515, upload-time = "2026-07-23T01:56:53.153Z" }, + { url = "https://files.pythonhosted.org/packages/bb/6b/62cbd6577758699525f5c712d1ddef57d9875fbab0ae8d5f5a202fd598f8/aiohttp-3.14.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2498f0fe69ead802f9675beca44a7c21c62fdaa4ec5145ea1c3ad6edbee29f85", size = 1879906, upload-time = "2026-07-23T01:56:55.818Z" }, + { url = "https://files.pythonhosted.org/packages/00/95/18bcbf830a21dc3aae24d8f6b6feaf3db1d2090242d00a7868db2ffb0b67/aiohttp-3.14.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a0dc483c00da8b673abbb367eb6f8d8f4bcec30eb58529ea13cb42e7fd2dfa33", size = 1675849, upload-time = "2026-07-23T01:56:58.861Z" }, + { url = "https://files.pythonhosted.org/packages/a9/19/47f4968659c5e23606c3790c80fc624e691c153d036148449ee84d31b287/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:c7d3a97c678d34fc5b59da671ee9cd630096ddc643e7b5a30d54a2a6f3574d3f", size = 1843496, upload-time = "2026-07-23T01:57:01.591Z" }, + { url = "https://files.pythonhosted.org/packages/64/af/38c33c4dd82fddcb4e56c4653b6f1072a8edbc6b7fa15809f14932c41e2d/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:f8fb78a83c9e5f741ca3a68cfb455c1f5bb83b4e7249a3848b3cd78d0a8563b0", size = 1827746, upload-time = "2026-07-23T01:57:05.131Z" }, + { url = "https://files.pythonhosted.org/packages/a1/9d/0537cda4885ac8f5b7053d164dd06312f4c483a4edcb8ee5b8aaf2a989bf/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:74ab5b6a9fb13e873e5a90946588baecaf488745e1db1a4a5c433f971f035098", size = 1853810, upload-time = "2026-07-23T01:57:08.043Z" }, + { url = "https://files.pythonhosted.org/packages/19/fe/26f9c5e6458385aa86497836b0dea6fb2f027827d63f37c7856cce9286ee/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:bd52f811e65f6fb634b1047159657c98f52b407f8efec907bcfc09da9a4c0a25", size = 1668895, upload-time = "2026-07-23T01:57:10.837Z" }, + { url = "https://files.pythonhosted.org/packages/ec/4c/618b1db9b9ba079b8875d2cdf78e7c4a3bf72903bd5850fee7dd9544600a/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:f0f177d1b195b9e06376cfd7d308d8a1b920909a609d03ac82a8c73bbb16d3b9", size = 1883833, upload-time = "2026-07-23T01:57:13.672Z" }, + { url = "https://files.pythonhosted.org/packages/94/c6/bd959bd1e4771f9fd944e9e436224c48c77b018b73b519b5aad346335bcc/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:498c6c623134f8e09a3c4e60bcd607a0b4590dd7dbf08dd40851b27cbb520ccb", size = 1844251, upload-time = "2026-07-23T01:57:16.593Z" }, + { url = "https://files.pythonhosted.org/packages/5e/19/08d41839658bdd44a0ed2480f3891705ecb487ce28c0dde62c9040c997e0/aiohttp-3.14.3-cp314-cp314t-win32.whl", hash = "sha256:b304db572b4368edd8dda8a2274f73156fe15558fca4a917cb8a09fc47af5963", size = 474180, upload-time = "2026-07-23T01:57:19.306Z" }, + { url = "https://files.pythonhosted.org/packages/99/5d/3cd6ef0a2b2851f7ab913b5b079334781bd50ff56a323e4454063377a080/aiohttp-3.14.3-cp314-cp314t-win_amd64.whl", hash = "sha256:b20032766aedf6261c7a566585a40867d092ac03a0d81592d5370ef9b054f99b", size = 500528, upload-time = "2026-07-23T01:57:21.762Z" }, + { url = "https://files.pythonhosted.org/packages/a4/37/cfd1ed540a4d318da025590d96b728e63713c09e9377950fc655dadeb856/aiohttp-3.14.3-cp314-cp314t-win_arm64.whl", hash = "sha256:2e1161602f45a54de2ce0905243a95f58cb42dcd378402f3697f5e0b21e9d2e7", size = 469280, upload-time = "2026-07-23T01:57:24.241Z" }, ] [[package]] From a1480823fb3819fba76a1a2ffcba76242f730180 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Aug 2026 15:11:33 -0400 Subject: [PATCH 35/61] chore(deps): bump pymdown-extensions from 10.21.3 to 11.0 (#4197) Bumps [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions) from 10.21.3 to 11.0. - [Release notes](https://github.com/facelessuser/pymdown-extensions/releases) - [Commits](https://github.com/facelessuser/pymdown-extensions/compare/10.21.3...11.0) --- updated-dependencies: - dependency-name: pymdown-extensions dependency-version: '11.0' dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Davis Bennett Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com> --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index b7f8ae9b3c..048816cf02 100644 --- a/uv.lock +++ b/uv.lock @@ -2409,15 +2409,15 @@ wheels = [ [[package]] name = "pymdown-extensions" -version = "10.21.3" +version = "11.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "markdown" }, { name = "pyyaml" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/9e/26/d1015444da4d952a1ca487a236b522eb979766f0295a0bd0c5fc089989a9/pymdown_extensions-10.21.3.tar.gz", hash = "sha256:72cfcf55f07aea0d4af2c4f11dd4e52466ddfb1bb819673146398e0bd3a77354", size = 854140, upload-time = "2026-05-13T12:57:32.267Z" } +sdist = { url = "https://files.pythonhosted.org/packages/47/67/f1e79672a5f91985577c7984c9709ca110e4fd37fe7fd167b60422e6ccc2/pymdown_extensions-11.0.tar.gz", hash = "sha256:8269cef0247f9e2d0a62fcea10860aba05c1cbab5470fd4b63230b96434dc589", size = 857049, upload-time = "2026-06-23T02:27:45.146Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/85/545a951eecc270fcd688288c600017e2050a1aacb56c711d208586d3e470/pymdown_extensions-10.21.3-py3-none-any.whl", hash = "sha256:d7a5d08014fc571e80ca21dd6f854e31f94c489800350564d55d15b3c41e76b6", size = 269002, upload-time = "2026-05-13T12:57:30.296Z" }, + { url = "https://files.pythonhosted.org/packages/af/b6/1ae53367e28b9cffa3be7574e13fbe4589694272fd47710fbdbafd3d63c6/pymdown_extensions-11.0-py3-none-any.whl", hash = "sha256:fbc4acb641814fa9d17521bbd21a5240ef739a662f11c06330c4b78c93e954d6", size = 269415, upload-time = "2026-06-23T02:27:43.826Z" }, ] [[package]] From d28cceaa980cc24b6ed21a8c85728f9a1b97245e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Aug 2026 15:14:42 -0400 Subject: [PATCH 36/61] chore(deps): bump the actions group across 1 directory with 9 updates (#4241) Bumps the actions group with 9 updates in the / directory: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `7.0.0` | `7.0.1` | | [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `8.3.2` | `9.0.0` | | [CodSpeedHQ/action](https://github.com/codspeedhq/action) | `4.18.5` | `5.0.1` | | [actions/setup-python](https://github.com/actions/setup-python) | `6.3.0` | `7.0.0` | | [scientific-python/issue-from-pytest-log-action](https://github.com/scientific-python/issue-from-pytest-log-action) | `1.6.0` | `1.6.1` | | [j178/prek-action](https://github.com/j178/prek-action) | `2.0.5` | `3.0.0` | | [actions/attest](https://github.com/actions/attest) | `4.2.0` | `4.2.1` | | [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) | `1.14.0` | `1.14.2` | | [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.6.0` | `0.6.1` | Updates `actions/checkout` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0...3d3c42e5aac5ba805825da76410c181273ba90b1) Updates `astral-sh/setup-uv` from 8.3.2 to 9.0.0 - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/11f9893b081a58869d3b5fccaea48c9e9e46f990...c771a70e6277c0a99b617c7a806ffedaca235ff9) Updates `CodSpeedHQ/action` from 4.18.5 to 5.0.1 - [Release notes](https://github.com/codspeedhq/action/releases) - [Changelog](https://github.com/CodSpeedHQ/action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codspeedhq/action/compare/f99becdce5e5d51fd556489ebef684f4ecfd6286...88472375d0a4572cf70a9f1fe3a4e0ab8da1b924) Updates `actions/setup-python` from 6.3.0 to 7.0.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/ece7cb06caefa5fff74198d8649806c4678c61a1...5fda3b95a4ea91299a34e894583c3862153e4b97) Updates `scientific-python/issue-from-pytest-log-action` from 1.6.0 to 1.6.1 - [Release notes](https://github.com/scientific-python/issue-from-pytest-log-action/releases) - [Commits](https://github.com/scientific-python/issue-from-pytest-log-action/compare/87351a8f864e969567cda22a25a2f214cbe2340f...054799b34bd75a5fd6c86277a4a8a575224e60c6) Updates `j178/prek-action` from 2.0.5 to 3.0.0 - [Release notes](https://github.com/j178/prek-action/releases) - [Commits](https://github.com/j178/prek-action/compare/e98a699c41eb69ab013a45817a0406469a748f8d...4e14d07f9231acabce116ccfca13b13dd9755ece) Updates `actions/attest` from 4.2.0 to 4.2.1 - [Release notes](https://github.com/actions/attest/releases) - [Changelog](https://github.com/actions/attest/blob/main/RELEASE.md) - [Commits](https://github.com/actions/attest/compare/f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6...508db95dd578ae2727ebd6217d5ba78e4fbda05d) Updates `pypa/gh-action-pypi-publish` from 1.14.0 to 1.14.2 - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/cef221092ed1bacb1cc03d23a2d87d1d172e277b...dc37677b2e1c63e2034f94d8a5b11f265b73ba33) Updates `zizmorcore/zizmor-action` from 0.6.0 to 0.6.1 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/6599ee8b7a49aef6a770f63d261d214911a7ce02...6fc4b006235f201fdab3722e17240ab420d580e5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: astral-sh/setup-uv dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: CodSpeedHQ/action dependency-version: 5.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-python dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: scientific-python/issue-from-pytest-log-action dependency-version: 1.6.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: j178/prek-action dependency-version: 3.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/attest dependency-version: 4.2.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: pypa/gh-action-pypi-publish dependency-version: 1.14.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.6.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com> --- .github/workflows/check_changelogs.yml | 4 ++-- .github/workflows/codspeed.yml | 4 ++-- .github/workflows/docs.yml | 4 ++-- .github/workflows/downstream.yml | 16 +++++++------- .github/workflows/gpu_test.yml | 6 +++--- .github/workflows/hypothesis.yaml | 8 +++---- .github/workflows/links.yml | 2 +- .github/workflows/lint.yml | 8 +++---- .github/workflows/nightly_wheels.yml | 4 ++-- .github/workflows/releases.yml | 8 +++---- .github/workflows/test.yml | 24 ++++++++++----------- .github/workflows/zarr-indexing-release.yml | 12 +++++------ .github/workflows/zarr-indexing.yml | 16 +++++++------- .github/workflows/zarr-metadata-release.yml | 12 +++++------ .github/workflows/zarr-metadata.yml | 16 +++++++------- .github/workflows/zizmor.yml | 4 ++-- 16 files changed, 74 insertions(+), 74 deletions(-) diff --git a/.github/workflows/check_changelogs.yml b/.github/workflows/check_changelogs.yml index d7a54fc2c4..b6c01e70fc 100644 --- a/.github/workflows/check_changelogs.yml +++ b/.github/workflows/check_changelogs.yml @@ -17,12 +17,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Check zarr-python changelog entries run: uv run --no-sync python ci/check_changelog_entries.py diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 427262d598..17e9de89ba 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -23,7 +23,7 @@ jobs: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark')) steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false @@ -32,7 +32,7 @@ jobs: with: version: '1.16.5' - name: Run the benchmarks - uses: CodSpeedHQ/action@f99becdce5e5d51fd556489ebef684f4ecfd6286 # v4.18.5 + uses: CodSpeedHQ/action@88472375d0a4572cf70a9f1fe3a4e0ab8da1b924 # v5.0.1 env: ZARR_BENCHMARK_CLEAR_CACHE: '1' with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index baf9233fc7..792ee431ab 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,10 +19,10 @@ jobs: name: Check docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - run: uv sync --group docs # Fast source-level guards that need no built site, so they run before the (slower) # build for a quick failure: every public export is in the API reference, and no diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index f65f8d47e3..98cd0fee3f 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -21,13 +21,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out zarr-python - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - name: Check out xarray - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: pydata/xarray path: xarray @@ -40,12 +40,12 @@ jobs: # `meson-python: error: Unknown option "pixi-conda-environment"`, breaking # the job before any test runs. Tests that need a backend we don't install # are skipped via xarray's `requires_*` markers, not failed. - - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: '3.13' - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Install xarray and test dependencies working-directory: xarray @@ -83,13 +83,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out zarr-python - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - name: Check out numcodecs - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: zarr-developers/numcodecs fetch-depth: 0 @@ -97,12 +97,12 @@ jobs: submodules: recursive persist-credentials: false - - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: '3.13' - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Install numcodecs with test-zarr-main group working-directory: numcodecs diff --git a/.github/workflows/gpu_test.yml b/.github/workflows/gpu_test.yml index bbbb3e5133..bf8700400e 100644 --- a/.github/workflows/gpu_test.yml +++ b/.github/workflows/gpu_test.yml @@ -34,7 +34,7 @@ jobs: python-version: ['3.12'] steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 # grab all branches and tags persist-credentials: false @@ -57,12 +57,12 @@ jobs: echo $LD_LIBRARY_PATH nvcc -V - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} cache: 'pip' - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Install Hatch uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc with: diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index e836f30a5b..cfe4477e52 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -39,7 +39,7 @@ jobs: dependency-set: ["optional"] steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set HYPOTHESIS_PROFILE based on trigger @@ -52,12 +52,12 @@ jobs: echo "HYPOTHESIS_PROFILE=ci" >> $GITHUB_ENV fi - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} cache: 'pip' - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Install Hatch uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc with: @@ -109,7 +109,7 @@ jobs: && steps.status.outcome == 'failure' && github.event_name == 'schedule' && github.repository_owner == 'zarr-developers' - uses: scientific-python/issue-from-pytest-log-action@87351a8f864e969567cda22a25a2f214cbe2340f # v1.6.0 + uses: scientific-python/issue-from-pytest-log-action@054799b34bd75a5fd6c86277a4a8a575224e60c6 # v1.6.1 with: log-path: output-${{ matrix.python-version }}-log.jsonl issue-title: "Nightly Hypothesis tests failed" diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 0af76deece..d52639a708 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -13,7 +13,7 @@ jobs: permissions: issues: write # required for peter-evans/create-issue-from-file steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dacba6648f..83cc0a1b3e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,15 +19,15 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.12" - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 with: enable-cache: true - - uses: j178/prek-action@e98a699c41eb69ab013a45817a0406469a748f8d # v2.0.5 + - uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0 diff --git a/.github/workflows/nightly_wheels.yml b/.github/workflows/nightly_wheels.yml index 0a0cafd425..5b99c523a1 100644 --- a/.github/workflows/nightly_wheels.yml +++ b/.github/workflows/nightly_wheels.yml @@ -22,13 +22,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: submodules: true fetch-depth: 0 persist-credentials: false - - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 name: Install Python with: python-version: '3.14' diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index fe0d09f300..759c443dd5 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -26,13 +26,13 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: submodules: true fetch-depth: 0 persist-credentials: false - - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 name: Install Python with: python-version: '3.12' @@ -81,8 +81,8 @@ jobs: name: releases path: dist - name: Generate artifact attestation - uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0 + uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 with: subject-path: dist/* - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce6b7e3eba..50bb85ff5c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,17 +56,17 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 # grab all branches and tags persist-credentials: false - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} cache: 'pip' - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Install Hatch run: python -m pip install hatch==1.16.5 - name: Set Up Hatch Env @@ -105,17 +105,17 @@ jobs: - python-version: "3.12" dependency-set: upstream steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} cache: 'pip' - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Install Hatch run: python -m pip install hatch==1.16.5 - name: Set Up Hatch Env @@ -140,17 +140,17 @@ jobs: name: doctests runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 # required for hatch version discovery, which is needed for numcodecs.zarr3 persist-credentials: false - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: '3.13' cache: 'pip' - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Install Hatch run: python -m pip install hatch==1.16.5 - name: Set Up Hatch Env @@ -164,17 +164,17 @@ jobs: name: Benchmark smoke test runs-on: ubuntu-latest steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - name: Set up Python - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: '3.13' cache: 'pip' - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Install Hatch run: python -m pip install hatch==1.16.5 - name: Run Benchmarks diff --git a/.github/workflows/zarr-indexing-release.yml b/.github/workflows/zarr-indexing-release.yml index 7cfd571eae..de57594d2b 100644 --- a/.github/workflows/zarr-indexing-release.yml +++ b/.github/workflows/zarr-indexing-release.yml @@ -22,7 +22,7 @@ jobs: shell: bash working-directory: packages/zarr-indexing steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false fetch-depth: 0 # hatch-vcs needs full history + tags @@ -51,7 +51,7 @@ jobs: path: dist - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 with: enable-cache: false @@ -82,12 +82,12 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0 + uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 with: subject-path: dist/* - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 upload_testpypi: name: Upload to TestPyPI @@ -107,11 +107,11 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0 + uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 with: subject-path: dist/* - name: Publish package to TestPyPI - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 with: repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/zarr-indexing.yml b/.github/workflows/zarr-indexing.yml index 2106b10916..afaa9e6db7 100644 --- a/.github/workflows/zarr-indexing.yml +++ b/.github/workflows/zarr-indexing.yml @@ -31,11 +31,11 @@ jobs: matrix: python-version: ['3.12', '3.13', '3.14'] steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 with: enable-cache: true - name: Set up Python ${{ matrix.python-version }} @@ -57,11 +57,11 @@ jobs: shell: bash working-directory: packages/zarr-indexing steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Run ruff run: uvx ruff check . @@ -73,11 +73,11 @@ jobs: shell: bash working-directory: packages/zarr-indexing steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 with: enable-cache: true - name: Set up Python @@ -95,11 +95,11 @@ jobs: shell: bash working-directory: packages/zarr-indexing steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 with: enable-cache: true - name: Install just diff --git a/.github/workflows/zarr-metadata-release.yml b/.github/workflows/zarr-metadata-release.yml index bc9ecf9871..f9516ead71 100644 --- a/.github/workflows/zarr-metadata-release.yml +++ b/.github/workflows/zarr-metadata-release.yml @@ -22,7 +22,7 @@ jobs: shell: bash working-directory: packages/zarr-metadata steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false fetch-depth: 0 # hatch-vcs needs full history + tags @@ -51,7 +51,7 @@ jobs: path: dist - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 with: enable-cache: false @@ -82,12 +82,12 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0 + uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 with: subject-path: dist/* - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 upload_testpypi: name: Upload to TestPyPI @@ -107,11 +107,11 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0 + uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 with: subject-path: dist/* - name: Publish package to TestPyPI - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 with: repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/zarr-metadata.yml b/.github/workflows/zarr-metadata.yml index b5f56dd508..5b3b83b0e0 100644 --- a/.github/workflows/zarr-metadata.yml +++ b/.github/workflows/zarr-metadata.yml @@ -35,11 +35,11 @@ jobs: matrix: python-version: ['3.11', '3.12', '3.13', '3.14'] steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 with: enable-cache: true - name: Install just @@ -59,11 +59,11 @@ jobs: shell: bash working-directory: packages/zarr-metadata steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 - name: Install just uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 - name: Run ruff @@ -77,11 +77,11 @@ jobs: shell: bash working-directory: packages/zarr-metadata steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 with: enable-cache: true - name: Install just @@ -98,11 +98,11 @@ jobs: shell: bash working-directory: packages/zarr-metadata steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 with: enable-cache: true - name: Install just diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 1567bea713..9022c56455 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -27,9 +27,9 @@ jobs: security-events: write # Required by zizmor-action to upload SARIF files steps: - name: Checkout repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Run zizmor - uses: zizmorcore/zizmor-action@6599ee8b7a49aef6a770f63d261d214911a7ce02 # v0.6.0 + uses: zizmorcore/zizmor-action@6fc4b006235f201fdab3722e17240ab420d580e5 # v0.6.1 From 96a54615b108d6d37b6f9722ad8d6165a0e7b185 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Tue, 11 Aug 2026 17:32:42 +0200 Subject: [PATCH 37/61] chore: bump ruff to 0.16.0 and fix new default-rule violations (#4213) Ruff 0.16.0 enables a much larger default rule set (flake8-bugbear, blind-except, bandit subset, pylint subset, etc.) and formats Python code blocks inside Markdown files. This bumps the pin in pyproject.toml and pre-commit, applies the automatic fixes (RUF036 None-at-end-of-union, RUF100 unused noqa, PLR1716 chained comparison), and resolves the rest by hand: - StorePath.__eq__ narrows a blind 'except Exception: pass' to 'except AttributeError: return False' (BLE001/S110) - reset_resources_after_fork drops 'loop' and 'iothread' from the global statement; they are mutated in place, not rebound (PLW0602) - subprocess.run calls in tests pass check=False explicitly since they assert on returncode themselves (PLW1510) - intentional patterns (returning the caught exception in sync._runner, self-equality assertion in the store test suite) get targeted noqa comments (BLE001/PLR0124) Assisted-by: ClaudeCode:claude-fable-5 Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- changes/4213.misc.md | 1 + design/chunk-grid.md | 67 +++++++++++-------- pyproject.toml | 2 +- src/zarr/api/synchronous.py | 2 +- src/zarr/codecs/sharding.py | 2 +- src/zarr/core/array.py | 6 +- src/zarr/core/dtype/common.py | 2 +- src/zarr/core/sync.py | 6 +- src/zarr/storage/_common.py | 5 +- src/zarr/testing/store.py | 2 +- src/zarr/testing/strategies.py | 6 +- tests/test_api.py | 2 +- tests/test_codecs/test_blosc.py | 4 +- tests/test_dtype_registry.py | 2 +- tests/test_examples.py | 2 +- .../test_v2_dtype_regression.py | 2 + tests/test_store/test_core.py | 2 +- tests/test_store/test_object.py | 1 - tests/test_unified_chunk_grid.py | 4 +- tests/test_v2.py | 2 +- uv.lock | 46 ++++++------- 22 files changed, 91 insertions(+), 79 deletions(-) create mode 100644 changes/4213.misc.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 57a1d0d4f7..7f49f47187 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ default_language_version: repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.20 + rev: v0.16.0 hooks: - id: ruff-check args: ["--fix", "--show-fixes"] diff --git a/changes/4213.misc.md b/changes/4213.misc.md new file mode 100644 index 0000000000..150e60b57b --- /dev/null +++ b/changes/4213.misc.md @@ -0,0 +1 @@ +Updated ruff to 0.16.0 and fixed the violations surfaced by its expanded default rule set: narrowed a blind `except Exception` in `StorePath.__eq__` to `AttributeError`, removed unnecessary `global` declarations in `zarr.core.sync`, made `subprocess.run` calls in tests pass `check=False` explicitly, and applied automatic fixes (`None` moved to the end of type unions, unused `noqa` directives removed). diff --git a/design/chunk-grid.md b/design/chunk-grid.md index eaa5fffad5..0f12e35c4b 100644 --- a/design/chunk-grid.md +++ b/design/chunk-grid.md @@ -162,9 +162,9 @@ class DimensionGrid(Protocol): @property def extent(self) -> int: ... def index_to_chunk(self, idx: int) -> int: ... - def chunk_offset(self, chunk_ix: int) -> int: ... # raises IndexError if OOB - def chunk_size(self, chunk_ix: int) -> int: ... # raises IndexError if OOB - def data_size(self, chunk_ix: int) -> int: ... # raises IndexError if OOB + def chunk_offset(self, chunk_ix: int) -> int: ... # raises IndexError if OOB + def chunk_size(self, chunk_ix: int) -> int: ... # raises IndexError if OOB + def data_size(self, chunk_ix: int) -> int: ... # raises IndexError if OOB def indices_to_chunks(self, indices: NDArray[np.intp]) -> NDArray[np.intp]: ... @property def unique_edge_lengths(self) -> Iterable[int]: ... @@ -181,8 +181,8 @@ The protocol is `@runtime_checkable`, enabling polymorphic handling of both dime ```python @dataclass(frozen=True) class ChunkSpec: - slices: tuple[slice, ...] # valid data region in array coordinates - codec_shape: tuple[int, ...] # buffer shape for codec processing + slices: tuple[slice, ...] # valid data region in array coordinates + codec_shape: tuple[int, ...] # buffer shape for codec processing @property def shape(self) -> tuple[int, ...]: @@ -199,34 +199,34 @@ For interior chunks, `shape == codec_shape`. For boundary chunks of a regular gr ```python # Creating arrays -arr = zarr.create_array(shape=(100, 200), chunks=(10, 20)) # regular -arr = zarr.create_array(shape=(60, 100), chunks=[[10, 20, 30], [25, 25, 25, 25]]) # rectilinear +arr = zarr.create_array(shape=(100, 200), chunks=(10, 20)) # regular +arr = zarr.create_array(shape=(60, 100), chunks=[[10, 20, 30], [25, 25, 25, 25]]) # rectilinear # ChunkGrid as a collection -grid = arr._chunk_grid # ChunkGrid (bound to array shape) -grid.grid_shape # (10, 10) — number of chunks per dimension -grid.ndim # 2 -grid.is_regular # True if all dimensions are Fixed +grid = arr._chunk_grid # ChunkGrid (bound to array shape) +grid.grid_shape # (10, 10) — number of chunks per dimension +grid.ndim # 2 +grid.is_regular # True if all dimensions are Fixed -spec = grid[0, 1] # ChunkSpec for chunk at grid position (0, 1) -spec.slices # (slice(0, 10), slice(20, 40)) -spec.shape # (10, 20) — data shape -spec.codec_shape # (10, 20) — same for interior chunks +spec = grid[0, 1] # ChunkSpec for chunk at grid position (0, 1) +spec.slices # (slice(0, 10), slice(20, 40)) +spec.shape # (10, 20) — data shape +spec.codec_shape # (10, 20) — same for interior chunks -boundary = grid[9, 0] # boundary chunk (extent=100, size=10) -boundary.shape # (10, 20) — data shape -boundary.codec_shape # (10, 20) — codec sees full buffer +boundary = grid[9, 0] # boundary chunk (extent=100, size=10) +boundary.shape # (10, 20) — data shape +boundary.codec_shape # (10, 20) — codec sees full buffer -grid[99, 99] # None — out of bounds +grid[99, 99] # None — out of bounds -for spec in grid: # iterate all chunks +for spec in grid: # iterate all chunks ... # .chunks property: retained for regular grids, raises NotImplementedError for rectilinear -arr.chunks # (10, 20) +arr.chunks # (10, 20) # .read_chunk_sizes / .write_chunk_sizes: works for all grids (dask-style) -arr.write_chunk_sizes # ((10, 10, ..., 10), (20, 20, ..., 20)) +arr.write_chunk_sizes # ((10, 10, ..., 10), (20, 20, ..., 20)) ``` `ChunkGrid.__getitem__` constructs `ChunkSpec` using `chunk_size` for `codec_shape` and `data_size` for `slices`: @@ -274,7 +274,10 @@ When `extent < sum(edges)`, the dimension is always stored as `VaryingDimension` {"name": "regular", "configuration": {"chunk_shape": [10, 20]}} # Rectilinear grid (with RLE compression and "kind" field): -{"name": "rectilinear", "configuration": {"kind": "inline", "chunk_shapes": [[10, 20, 30], [[25, 4]]]}} +{ + "name": "rectilinear", + "configuration": {"kind": "inline", "chunk_shapes": [[10, 20, 30], [[25, 4]]]}, +} ``` Both names deserialize to the same `ChunkGrid` class. The serialized form does not include the array extent — that comes from `shape` in array metadata and is combined with the chunk grid when constructing a `ChunkGrid` via `ChunkGrid.from_metadata()`. @@ -324,9 +327,9 @@ The underlying `ChunkGrid.chunk_sizes` property (on the grid, not the array) ret #### Resize ```python -arr.resize((80, 100)) # re-binds extent; FixedDimension stays fixed -arr.resize((200, 100)) # VaryingDimension grows by appending a new chunk -arr.resize((30, 100)) # VaryingDimension shrinks: preserves all edges, re-binds extent +arr.resize((80, 100)) # re-binds extent; FixedDimension stays fixed +arr.resize((200, 100)) # VaryingDimension grows by appending a new chunk +arr.resize((30, 100)) # VaryingDimension shrinks: preserves all edges, re-binds extent ``` Resize uses `ChunkGrid.update_shape(new_shape)`, which delegates to each dimension's `.resize()` method: @@ -363,8 +366,8 @@ When `chunks="keep"`, the logic checks `data._chunk_grid.is_regular`: The indexing pipeline is coupled to regular grid assumptions — every per-dimension indexer takes a scalar `dim_chunk_len: int` and uses `//` and `*`: ```python -dim_chunk_ix = self.dim_sel // self.dim_chunk_len # IntDimIndexer -dim_offset = dim_chunk_ix * self.dim_chunk_len # SliceDimIndexer +dim_chunk_ix = self.dim_sel // self.dim_chunk_len # IntDimIndexer +dim_offset = dim_chunk_ix * self.dim_chunk_len # SliceDimIndexer ``` Replace `dim_chunk_len: int` with the dimension object (`FixedDimension | VaryingDimension`). The shared interface means the indexer code structure stays the same — `dim_sel // dim_chunk_len` becomes `dim_grid.index_to_chunk(dim_sel)`. O(1) for regular, binary search for varying. @@ -590,14 +593,18 @@ If cubed needs to support both old and new zarr-python: def _create_zarr_indexer(selection, shape, chunks): if zarr.__version__[0] == "3": from zarr.core.indexing import OrthogonalIndexer + try: from zarr.core.chunk_grids import ChunkGrid + return OrthogonalIndexer(selection, shape, ChunkGrid.from_sizes(shape, chunks)) except ImportError: from zarr.core.chunk_grids import RegularChunkGrid + return OrthogonalIndexer(selection, shape, RegularChunkGrid(chunk_shape=chunks)) else: from zarr.indexing import OrthogonalIndexer + return OrthogonalIndexer(selection, ZarrArrayIndexingAdaptor(shape, chunks)) ``` @@ -625,13 +632,15 @@ def _resolve_chunk_grid(chunk_grid, shape): """Coerce ChunkGridMetadata to runtime ChunkGrid if needed.""" from zarr.core.chunk_grids import ChunkGrid as _ChunkGrid from zarr.core.metadata.v3 import ChunkGridMetadata + if isinstance(chunk_grid, _ChunkGrid): return chunk_grid if isinstance(chunk_grid, ChunkGridMetadata): warnings.warn( "Passing ChunkGridMetadata to indexers is deprecated. " "Use ChunkGrid.from_sizes() instead.", - DeprecationWarning, stacklevel=2, + DeprecationWarning, + stacklevel=2, ) if hasattr(chunk_grid, "chunk_shape"): return _ChunkGrid.from_sizes(shape, tuple(chunk_grid.chunk_shape)) diff --git a/pyproject.toml b/pyproject.toml index 684ac80b77..663a1ea286 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,7 +129,7 @@ docs = [ "mkdocs-redirects==1.2.3", "markdown-exec[ansi]==1.12.3", "griffe-inherited-docstrings==1.1.3", - "ruff==0.15.22", + "ruff==0.16.0", # Changelog generation {include-group = "release"}, # Optional dependencies to run examples diff --git a/src/zarr/api/synchronous.py b/src/zarr/api/synchronous.py index ebf42dca37..30ddf9ce6a 100644 --- a/src/zarr/api/synchronous.py +++ b/src/zarr/api/synchronous.py @@ -998,7 +998,7 @@ def from_array( write_data: bool = True, name: str | None = None, chunks: ChunksLike | Literal["auto", "keep"] = "keep", - shards: ShardsLike | None | Literal["keep"] = "keep", + shards: ShardsLike | Literal["keep"] | None = "keep", filters: FiltersLike | Literal["keep"] = "keep", compressors: CompressorsLike | Literal["keep"] = "keep", serializer: SerializerLike | Literal["keep"] = "keep", diff --git a/src/zarr/codecs/sharding.py b/src/zarr/codecs/sharding.py index d8ca8bdf62..41780e45b4 100644 --- a/src/zarr/codecs/sharding.py +++ b/src/zarr/codecs/sharding.py @@ -841,7 +841,7 @@ def _encode_partial_sync( # `_sentinel` distinguishes "not computed yet" from a memoized `None` # (an empty chunk). _sentinel = object() - scalar_complete_result: Buffer | None | object = _sentinel + scalar_complete_result: Buffer | object | None = _sentinel for chunk_coords, chunk_sel, out_sel, is_complete_chunk in indexer: if is_scalar and is_complete_chunk: diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index 2b31eefcd4..9cb66f339e 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -2181,7 +2181,7 @@ def filters(self) -> tuple[Numcodec, ...] | tuple[ArrayArrayCodec, ...]: return self.async_array.filters @property - def serializer(self) -> None | ArrayBytesCodec: + def serializer(self) -> ArrayBytesCodec | None: """ Array-to-bytes codec to use for serializing the chunks into bytes. """ @@ -4072,7 +4072,7 @@ async def from_array( write_data: bool = True, name: str | None = None, chunks: ChunksLike | Literal["auto", "keep"] = "keep", - shards: ShardsLike | None | Literal["keep"] = "keep", + shards: ShardsLike | Literal["keep"] | None = "keep", filters: FiltersLike | Literal["keep"] = "keep", compressors: CompressorsLike | Literal["keep"] = "keep", serializer: SerializerLike | Literal["keep"] = "keep", @@ -4763,7 +4763,7 @@ async def create_array( def _parse_keep_array_attr( data: AnyArray | npt.ArrayLike, chunks: ChunksLike | Literal["auto", "keep"], - shards: ShardsLike | None | Literal["keep"], + shards: ShardsLike | Literal["keep"] | None, filters: FiltersLike | Literal["keep"], compressors: CompressorsLike | Literal["keep"], serializer: SerializerLike | Literal["keep"], diff --git a/src/zarr/core/dtype/common.py b/src/zarr/core/dtype/common.py index 76d763d267..61cbfe0360 100644 --- a/src/zarr/core/dtype/common.py +++ b/src/zarr/core/dtype/common.py @@ -52,7 +52,7 @@ DTypeName_V2 = StructuredName_V2 | str -class DTypeConfig_V2[TDTypeNameV2: DTypeName_V2, TObjectCodecID: None | str](TypedDict): +class DTypeConfig_V2[TDTypeNameV2: DTypeName_V2, TObjectCodecID: str | None](TypedDict): name: ReadOnly[TDTypeNameV2] object_codec_id: ReadOnly[TObjectCodecID] diff --git a/src/zarr/core/sync.py b/src/zarr/core/sync.py index 160950ba64..724b31a464 100644 --- a/src/zarr/core/sync.py +++ b/src/zarr/core/sync.py @@ -90,7 +90,9 @@ def reset_resources_after_fork() -> None: Ensure that global resources are reset after a fork. Without this function, forked processes will retain invalid references to the parent process's resources. """ - global loop, iothread, _executor + # `loop` and `iothread` are mutated in place rather than rebound, so only + # `_executor` needs the global declaration. + global _executor # These lines are excluded from coverage because this function only runs in a child process, # which is not observed by the test coverage instrumentation. Despite the apparent lack of # test coverage, this function should be adequately tested by any test that uses Zarr IO with @@ -112,7 +114,7 @@ async def _runner[T](coro: Coroutine[Any, Any, T]) -> T | BaseException: """ try: return await coro - except Exception as ex: + except Exception as ex: # noqa: BLE001 -- the caller re-raises the returned exception return ex diff --git a/src/zarr/storage/_common.py b/src/zarr/storage/_common.py index ed554327cd..64dc486e01 100644 --- a/src/zarr/storage/_common.py +++ b/src/zarr/storage/_common.py @@ -297,9 +297,8 @@ def __eq__(self, other: object) -> bool: """ try: return self.store == other.store and self.path == other.path # type: ignore[attr-defined, no-any-return] - except Exception: - pass - return False + except AttributeError: + return False type StoreLike = Store | StorePath | FSMap | Path | str | dict[str, Buffer] diff --git a/src/zarr/testing/store.py b/src/zarr/testing/store.py index f64d8e9364..4c948a783c 100644 --- a/src/zarr/testing/store.py +++ b/src/zarr/testing/store.py @@ -115,7 +115,7 @@ def test_store_type(self, store: S) -> None: def test_store_eq(self, store: S, store_kwargs: dict[str, Any]) -> None: # check self equality - assert store == store + assert store == store # noqa: PLR0124 -- self-equality is the property under test # check store equality with same inputs # asserting this is important for being able to compare (de)serialized stores diff --git a/src/zarr/testing/strategies.py b/src/zarr/testing/strategies.py index 99e81b0389..6679dbcee4 100644 --- a/src/zarr/testing/strategies.py +++ b/src/zarr/testing/strategies.py @@ -132,7 +132,7 @@ def clear_store(x: Store) -> Store: @st.composite -def dimension_names(draw: st.DrawFn, *, ndim: int | None = None) -> list[None | str] | None: +def dimension_names(draw: st.DrawFn, *, ndim: int | None = None) -> list[str | None] | None: simple_text = st.text(zarr_key_chars, min_size=0) return draw(st.none() | st.lists(st.none() | simple_text, min_size=ndim, max_size=ndim)) # type: ignore[arg-type] @@ -292,7 +292,7 @@ def arrays( if arrays is None: arrays = numpy_arrays(shapes=shapes) nparray = draw(arrays, label="array data") - dim_names: None | list[str | None] = None + dim_names: list[str | None] | None = None serializer: SerializerLike = "auto" compressors_unsearched: CompressorsLike = "auto" @@ -328,7 +328,7 @@ def arrays( else: chunks_param = draw(chunk_shapes(shape=nparray.shape), label="chunk shape") - if all(s > c and c > 1 for s, c in zip(nparray.shape, chunks_param, strict=True)): + if all(s > c > 1 for s, c in zip(nparray.shape, chunks_param, strict=True)): shard_shape = draw( st.none() | shard_shapes(shape=nparray.shape, chunk_shape=chunks_param), label="shard shape", diff --git a/tests/test_api.py b/tests/test_api.py index cbe8ea3b44..2b831e942d 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -419,7 +419,7 @@ async def test_open_group_unspecified_version(tmp_path: Path, zarr_format: ZarrF @pytest.mark.parametrize("n_args", [10, 1, 0]) @pytest.mark.parametrize("n_kwargs", [10, 1, 0]) @pytest.mark.parametrize("path", [None, "some_path"]) -def test_save(store: Store, n_args: int, n_kwargs: int, path: None | str) -> None: +def test_save(store: Store, n_args: int, n_kwargs: int, path: str | None) -> None: data = np.arange(10) args = [np.arange(10) for _ in range(n_args)] kwargs = {f"arg_{i}": data for i in range(n_kwargs)} diff --git a/tests/test_codecs/test_blosc.py b/tests/test_codecs/test_blosc.py index f5f13f4d05..e342dba8bb 100644 --- a/tests/test_codecs/test_blosc.py +++ b/tests/test_codecs/test_blosc.py @@ -74,7 +74,7 @@ async def test_blosc_evolve(dtype: str) -> None: @pytest.mark.parametrize("shuffle", [None, "bitshuffle", "legacy-enum"]) @pytest.mark.parametrize("typesize", [None, 1, 2]) def test_tunable_attrs_param( - shuffle: None | BloscShuffleLiteral | str, typesize: None | int + shuffle: BloscShuffleLiteral | str | None, typesize: int | None ) -> None: """ Test that the tunable_attrs parameter is set as expected when creating a BloscCodec. @@ -83,7 +83,7 @@ def test_tunable_attrs_param( # contaminating the BloscCodec construction below with that warning. if shuffle == "legacy-enum": with pytest.warns(DeprecationWarning, match="BloscShuffle.shuffle"): - shuffle_arg: None | BloscShuffleLiteral | str = BloscShuffle.shuffle + shuffle_arg: BloscShuffleLiteral | str | None = BloscShuffle.shuffle else: shuffle_arg = shuffle diff --git a/tests/test_dtype_registry.py b/tests/test_dtype_registry.py index f0946014fc..40239c1132 100644 --- a/tests/test_dtype_registry.py +++ b/tests/test_dtype_registry.py @@ -170,7 +170,7 @@ def test_entrypoint_dtype(zarr_format: ZarrFormat) -> None: ) def test_parse_data_type( data_type: ZDType[Any, Any], - json_style: tuple[ZarrFormat, None | Literal["internal", "metadata"]], + json_style: tuple[ZarrFormat, Literal["internal", "metadata"] | None], dtype_parser_func: Any, ) -> None: """ diff --git a/tests/test_examples.py b/tests/test_examples.py index 9f8085e8c2..a6634e8cc6 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -80,7 +80,7 @@ def test_scripts_can_run(script_path: Path, tmp_path: Path) -> None: # This allows the example to be useful to users who don't have Zarr installed, but also testable. resave_script(script_path, dest_path) result = subprocess.run( - ["uv", "run", "--refresh", str(dest_path)], capture_output=True, text=True + ["uv", "run", "--refresh", str(dest_path)], capture_output=True, text=True, check=False ) assert result.returncode == 0, ( f"Script at {script_path} failed to run. Output: {result.stdout} Error: {result.stderr}" diff --git a/tests/test_regression/test_v2_dtype_regression.py b/tests/test_regression/test_v2_dtype_regression.py index c7b4a53a52..faba087e32 100644 --- a/tests/test_regression/test_v2_dtype_regression.py +++ b/tests/test_regression/test_v2_dtype_regression.py @@ -215,6 +215,7 @@ def test_roundtrip_v2(source_array_v2: ArrayV2, tmp_path: Path, script_path: Pat ], capture_output=True, text=True, + check=False, ) assert copy_op.returncode == 0, f"stdout {copy_op.stdout}\n stderr{copy_op.stderr}" out_array = zarr.open_array(store=out_path, mode="r", zarr_format=2) @@ -240,6 +241,7 @@ def test_roundtrip_v3(source_array_v3: ArrayV3, tmp_path: Path) -> None: ], capture_output=True, text=True, + check=False, ) assert copy_op.returncode == 0 out_array = zarr.open_array(store=out_path, mode="r", zarr_format=3) diff --git a/tests/test_store/test_core.py b/tests/test_store/test_core.py index d2784e1b4b..4138eebe6a 100644 --- a/tests/test_store/test_core.py +++ b/tests/test_store/test_core.py @@ -33,7 +33,7 @@ ) def store_like( request: pytest.FixtureRequest, -) -> Generator[None | str | Path | StorePath | MemoryStore | dict[Any, Any], None, None]: +) -> Generator[str | Path | StorePath | MemoryStore | dict[Any, Any] | None, None, None]: if request.param == "none": yield None elif request.param == "temp_dir_str": diff --git a/tests/test_store/test_object.py b/tests/test_store/test_object.py index cd85a48eb8..1ea148b3c3 100644 --- a/tests/test_store/test_object.py +++ b/tests/test_store/test_object.py @@ -1,4 +1,3 @@ -# ruff: noqa: E402 import re from pathlib import Path from typing import TypedDict diff --git a/tests/test_unified_chunk_grid.py b/tests/test_unified_chunk_grid.py index 0df5a5d9fd..f0b54519ab 100644 --- a/tests/test_unified_chunk_grid.py +++ b/tests/test_unified_chunk_grid.py @@ -2784,8 +2784,8 @@ def test_rectilinear_roundtrip(json_input: RectilinearChunkGridMetadataJSON) -> pytest.importorskip("hypothesis") -import hypothesis.strategies as st # noqa: E402 -from hypothesis import event, given, settings # noqa: E402 +import hypothesis.strategies as st +from hypothesis import event, given, settings @st.composite diff --git a/tests/test_v2.py b/tests/test_v2.py index 3a063ac509..798687438b 100644 --- a/tests/test_v2.py +++ b/tests/test_v2.py @@ -294,7 +294,7 @@ def test_parse_structured_fill_value_valid( @pytest.mark.parametrize("fill_value", [None, b"x"], ids=["no_fill", "fill"]) -def test_other_dtype_roundtrip(fill_value: None | bytes, tmp_path: Path) -> None: +def test_other_dtype_roundtrip(fill_value: bytes | None, tmp_path: Path) -> None: a = np.array([b"a\0\0", b"bb", b"ccc"], dtype="V7") array_path = tmp_path / "data.zarr" za = zarr.create( diff --git a/uv.lock b/uv.lock index 048816cf02..e1d469fd84 100644 --- a/uv.lock +++ b/uv.lock @@ -2885,27 +2885,27 @@ wheels = [ [[package]] name = "ruff" -version = "0.15.22" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3a/06/ae069393fc66e8ff33036d4b368003833bf6e88ccf182e17e7a2f1c754fd/ruff-0.15.22.tar.gz", hash = "sha256:3f15175b1fb580126f58285a5dae6b2ea89000136d980c64499211f116b54809", size = 4785063, upload-time = "2026-07-16T15:14:13.244Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/23/18/ee54b7ae1e121be7a28ea6da4b67564ebb0530e183a54415ab7e3bcd2c4e/ruff-0.15.22-py3-none-linux_armv6l.whl", hash = "sha256:44423e73493737f5e7c5b41d475483898ff37afcdae38bc3da5085e29af1c2d8", size = 10781258, upload-time = "2026-07-16T15:13:19.452Z" }, - { url = "https://files.pythonhosted.org/packages/2f/d2/2520cb14761ddbeaf57642a76942fc36adcbdbe53b4532241995f6fc485c/ruff-0.15.22-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b82c6482946e9eda7ff2e091d25b8bad3f718684e1916d41bd56873cee05b697", size = 10999477, upload-time = "2026-07-16T15:13:23.318Z" }, - { url = "https://files.pythonhosted.org/packages/c9/10/74e53572aa758dfaa678c2a2646b5c5515d884b7ca56be4d2ce03ca4b560/ruff-0.15.22-py3-none-macosx_11_0_arm64.whl", hash = "sha256:11c1c715af53a09f714e011106bffc419751ec8232fcb5da42173284ea3fec6f", size = 10466716, upload-time = "2026-07-16T15:13:26.162Z" }, - { url = "https://files.pythonhosted.org/packages/1e/cc/44eaaf0844e028182f2d0a8f2190d0f359159aed0a9e5ab861d892f1ae2a/ruff-0.15.22-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:742a29cf29bddb7c8327895d6a10e0e6c5b38a96dd407af9b5d0857f809c0576", size = 10892644, upload-time = "2026-07-16T15:13:29.229Z" }, - { url = "https://files.pythonhosted.org/packages/9f/21/8edf559014d2b0f82beea19cfb713993ad802ccda16868769979c6090a84/ruff-0.15.22-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72af58b951b0ae395935ae79763dc349bc0eb706319d28f7a33ad2cfb3cfc178", size = 10576719, upload-time = "2026-07-16T15:13:32.35Z" }, - { url = "https://files.pythonhosted.org/packages/bf/1e/3a13abd392a3b50b62e5938a831f9ab6e588358cacad5c18545b716d2182/ruff-0.15.22-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62d425005c1835eb24e2ee4161cb90e8db263415f4a71c8c72c33abaa6c0c224", size = 11376494, upload-time = "2026-07-16T15:13:35.958Z" }, - { url = "https://files.pythonhosted.org/packages/bf/3e/422d3d95bcf04dd78e1aeac22184d4f9a8fb2c01865d39d44618484a0317/ruff-0.15.22-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e8b9b3f8779a4f08c969defc3c8c35abffaa757e601ed5ae66d6d1db6519969a", size = 12208370, upload-time = "2026-07-16T15:13:39.185Z" }, - { url = "https://files.pythonhosted.org/packages/1e/91/5d065a0e0a02bf4813f5119ad278462eed081d2b832eb7c021ade0ec9e65/ruff-0.15.22-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1e0dd1b2e4d3d585f897a0d137cbf4eaf6223bef4e8ce34d6bb12556c5f9249e", size = 11581098, upload-time = "2026-07-16T15:13:42.132Z" }, - { url = "https://files.pythonhosted.org/packages/f6/f9/a0d4871d12fae702eb1f41b686caf05f1f8b124dc6db6f784f53d74918fa/ruff-0.15.22-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:365523eb91d9224e1bcb03b022fbf0facb8f9e23792a2c53d9d4b3924bdbdebb", size = 11399422, upload-time = "2026-07-16T15:13:45.2Z" }, - { url = "https://files.pythonhosted.org/packages/18/80/c843a5176cddbceb0b7e8dd41cf9993490796c1c469348d384f5a5c13c56/ruff-0.15.22-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:fabfd168afdf29fee5be98b831efa9683c94d7c5a3b58b9ce5a2e38444589a74", size = 11381683, upload-time = "2026-07-16T15:13:48.46Z" }, - { url = "https://files.pythonhosted.org/packages/d4/00/8485de0ae92239438a36cfc51350db9b9e85c9ebdfaea91b18e422706662/ruff-0.15.22-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:225dbf095a87f1d9f90f5fd7924d2613ee452a75a4308c63a8f50f761787aa7c", size = 10850295, upload-time = "2026-07-16T15:13:51.655Z" }, - { url = "https://files.pythonhosted.org/packages/fa/91/24977ec2ec72eaf15e4394ace2959fdff2dd1e14f03e005e838023407169/ruff-0.15.22-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1877d63b9d24ed278744f1523fd11b85540566d54641f97c566d7d9dc5ca5296", size = 10579640, upload-time = "2026-07-16T15:13:54.79Z" }, - { url = "https://files.pythonhosted.org/packages/9c/47/9b51216951974df1f263ac19da550d34252e0ed7218c25f10c5ef9ed7517/ruff-0.15.22-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a1606c510bd7215680d32efab38965f7cdec3ef69f5170a3f4791404ffdd5262", size = 11105077, upload-time = "2026-07-16T15:13:57.915Z" }, - { url = "https://files.pythonhosted.org/packages/c2/47/20e9d4a3b8016778acea5fc32bb50d35d207500a17ddb529ffa6996feef8/ruff-0.15.22-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:630479b18625f5ffc373f77603a22a9f8ac0acd7ff0501178b5db28ec71e9c64", size = 11490980, upload-time = "2026-07-16T15:14:01.032Z" }, - { url = "https://files.pythonhosted.org/packages/4d/76/3f72d8fc38c1cb77b38c56a70da9d0c17700cc1cc50f9649c9d3c8f5ba71/ruff-0.15.22-py3-none-win32.whl", hash = "sha256:e5ba0e4a13fd14abbed2a77b517a3911290c6c6c59ef67784328d1668fab76cf", size = 10789165, upload-time = "2026-07-16T15:14:04.16Z" }, - { url = "https://files.pythonhosted.org/packages/cb/46/4965251734c2b6fcdca1b1b187d20bcac3af0ee5b083b89c910bb961ce3a/ruff-0.15.22-py3-none-win_amd64.whl", hash = "sha256:9be63ba1eb936acd2d1342fb8337c356353706fce233b2a15a09a97037e6acde", size = 11938297, upload-time = "2026-07-16T15:14:07.316Z" }, - { url = "https://files.pythonhosted.org/packages/57/c9/e69b1ff4c8b69093ef08b8919ab767af0569666865b39c30a8795d88d3c6/ruff-0.15.22-py3-none-win_arm64.whl", hash = "sha256:e1168075b72158510839f250027659cdd78476f40507dd517892304c41318661", size = 11298172, upload-time = "2026-07-16T15:14:10.51Z" }, +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4d/94/1e5e4967626faf12fa56999cd6222dff6992ceb086ad7945756baf70c7a7/ruff-0.16.0.tar.gz", hash = "sha256:e460aafd5495ec89efaa6ced2e4a9a581116451e1c88b9d37ef497e0f8e93982", size = 4790557, upload-time = "2026-07-23T19:11:30.981Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4b/81/1c8818fee7ce1a04cd7d1b3172e0a8f8e4f1dc4feb7fc390e16daa8af323/ruff-0.16.0-py3-none-linux_armv6l.whl", hash = "sha256:e5115729eb08c585e5121978ba5d5b60caeae394ce21b9fb5e6cd33a1c6c9b1e", size = 10754633, upload-time = "2026-07-23T19:10:46.415Z" }, + { url = "https://files.pythonhosted.org/packages/23/df/beaf59c09d68db84304d555f188b276a77132a5d5b0b67a5c762aa143628/ruff-0.16.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3c954b1d580bfa035b41654f7858cc7e71d5fc3ac5b723dd62bd9133830ed522", size = 10969164, upload-time = "2026-07-23T19:10:50.271Z" }, + { url = "https://files.pythonhosted.org/packages/42/ce/741cd197496a1abbf51352710fd15ed995d2a2be87189c1da26a450d6e83/ruff-0.16.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e01c21d10eb1b29f47b7454e1f4056db9a3f0260c646aa88457c610291db9f81", size = 10488846, upload-time = "2026-07-23T19:10:52.639Z" }, + { url = "https://files.pythonhosted.org/packages/52/2a/a2db8e88cade358f5cdcb05674a917751074109315d014eb6352d9a893f7/ruff-0.16.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e364e5ed22ed8dc05082fd78e35308618260907ac2d3c1d637b2e682415b6c9", size = 10889729, upload-time = "2026-07-23T19:10:54.89Z" }, + { url = "https://files.pythonhosted.org/packages/42/65/62a771694ebd63029dc953e27dbad40e1588bd4860ff9fe881018fddaa49/ruff-0.16.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d327b8fc113a1d4421a04f3839d3752057c8dd1ee320223a6f3f52d04ada462a", size = 10568275, upload-time = "2026-07-23T19:10:56.993Z" }, + { url = "https://files.pythonhosted.org/packages/3f/e2/ced249fe8af5f086c5c58cc21cc3356d50f32f7401c5df87050c999620a7/ruff-0.16.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9b50c55e263103586b3dcf5f73d479eb8cb5fdb6098fec59a62891dab653717", size = 11385112, upload-time = "2026-07-23T19:10:59.615Z" }, + { url = "https://files.pythonhosted.org/packages/87/0b/05154977a8fd69eeb6c103271f55403bfd8711f5c0f8ed07489d95a504e7/ruff-0.16.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0ff4a79ce3ec0172f3241943835de1c4cb4e2dcd07f0f8c2d02603dbbbee4b17", size = 12207008, upload-time = "2026-07-23T19:11:02.154Z" }, + { url = "https://files.pythonhosted.org/packages/fb/29/98225831a3a1eab0e02f4acc6ca6559a98611dcc68b6965ff4b7234627c1/ruff-0.16.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e95c448fca1fb2a18372a9440926c5a6ee789639bb975c72e7ae6d0b04218ab4", size = 11650842, upload-time = "2026-07-23T19:11:04.557Z" }, + { url = "https://files.pythonhosted.org/packages/91/66/6bd3cf90500653d55dc0ffc8507aa8300bd49d0214b2e8cb4d3fef2943ba/ruff-0.16.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f11a8d11010301d0a398a2fdef67691feca7294da6aef55e2150e8fa2cd520b", size = 11400718, upload-time = "2026-07-23T19:11:09.233Z" }, + { url = "https://files.pythonhosted.org/packages/8e/a2/a54eb4eae05d66364050a5d3b8a9c5ef88196531b3cbe7109d873f87f819/ruff-0.16.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:48044c678e9cb8698246c99b14aaccfa6601dea7379eb48a6f8f73f7a6d86cd0", size = 11426177, upload-time = "2026-07-23T19:11:11.994Z" }, + { url = "https://files.pythonhosted.org/packages/1a/be/16e3eea4b2a478a496919f5e36f17c4559e54620bd3bbac5d6affa068006/ruff-0.16.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7aa0959bad8eb8bef50340154fc9b58678dae31fa4293afa38b44b6e552c0213", size = 10856126, upload-time = "2026-07-23T19:11:14.221Z" }, + { url = "https://files.pythonhosted.org/packages/a2/84/252eb8b868a16eec7257c14f504f77537e734b2d69c762e639e588e304a3/ruff-0.16.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:28ea2b7df8ebf7f9da6b7d47b230ab48f387c0a29be3b474c4d0740e197bb9af", size = 10571208, upload-time = "2026-07-23T19:11:16.378Z" }, + { url = "https://files.pythonhosted.org/packages/21/09/817a482f542f7570cbb4554b26e896610c7114f539b1d9e2d2145bf6bef6/ruff-0.16.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:33a3dfac8c35f81498dea9181bccc2f4c4bc8f1521a1dd9406e77643e0f0fb09", size = 11063329, upload-time = "2026-07-23T19:11:19.173Z" }, + { url = "https://files.pythonhosted.org/packages/2e/23/9403c180ca1cb9b1f7335f5c3e5305c09d49ea5b345196682a36028bde4a/ruff-0.16.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a5237a0bda500d30d81b8e07a6973a5cbc772864cbf746ae2f4e8a2e01c9f4ed", size = 11489751, upload-time = "2026-07-23T19:11:21.74Z" }, + { url = "https://files.pythonhosted.org/packages/b2/1d/1b2ef7bcde851c78d7f17f1cca13fd6dc695fc4b3d6197941e72cae5b132/ruff-0.16.0-py3-none-win32.whl", hash = "sha256:7fab76fa065c873f41ff744347c6e77bcc3dfec4bcc754dc26b63d23c0f7f5fb", size = 10785885, upload-time = "2026-07-23T19:11:23.947Z" }, + { url = "https://files.pythonhosted.org/packages/b2/a3/d5e4ef7a56be3f928ffb90b94c25ba7d3cb9c7fe0736aeaaedf361770712/ruff-0.16.0-py3-none-win_amd64.whl", hash = "sha256:429c117f022bf481fabd9d551e7a3952b24c65e6ef44337ea09d90bebef14472", size = 11923141, upload-time = "2026-07-23T19:11:26.409Z" }, + { url = "https://files.pythonhosted.org/packages/cb/9a/8415f2657cbe200f41a4531ccededf135505a92d4a012229121f885b26f9/ruff-0.16.0-py3-none-win_arm64.whl", hash = "sha256:14296fedcd2705c77ab8235439278bbb38f285cf7da5528b00b3e330c3d4872d", size = 11273407, upload-time = "2026-07-23T19:11:28.705Z" }, ] [[package]] @@ -3586,7 +3586,7 @@ dev = [ { name = "pytest-cov", specifier = "==7.1.0" }, { name = "pytest-xdist", specifier = "==3.8.0" }, { name = "requests", specifier = "==2.34.2" }, - { name = "ruff", specifier = "==0.15.22" }, + { name = "ruff", specifier = "==0.16.0" }, { name = "s3fs", specifier = ">=2023.10.0" }, { name = "tomlkit", specifier = "==0.15.1" }, { name = "towncrier", specifier = "==25.8.0" }, @@ -3605,7 +3605,7 @@ docs = [ { name = "mkdocstrings-python", specifier = "==2.0.5" }, { name = "numcodecs", extras = ["msgpack"] }, { name = "pytest", specifier = "==9.1.1" }, - { name = "ruff", specifier = "==0.15.22" }, + { name = "ruff", specifier = "==0.16.0" }, { name = "s3fs", specifier = ">=2023.10.0" }, { name = "towncrier", specifier = "==25.8.0" }, ] From 2fc8f823725d49dcb5fbee2f0ed14f89b1561a97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Aug 2026 12:16:33 -0700 Subject: [PATCH 38/61] chore(deps-dev): bump the python-dependencies group across 1 directory with 5 updates (#4242) Bumps the python-dependencies group with 4 updates in the / directory: [fsspec](https://github.com/fsspec/filesystem_spec), [hypothesis](https://github.com/HypothesisWorks/hypothesis), [uv](https://github.com/astral-sh/uv) and [ruff](https://github.com/astral-sh/ruff). Updates `fsspec` from 2026.6.0 to 2026.7.0 - [Commits](https://github.com/fsspec/filesystem_spec/compare/2026.6.0...2026.7.0) Updates `hypothesis` from 6.160.0 to 6.164.0 - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](https://github.com/HypothesisWorks/hypothesis/compare/v6.160.0...v6.164.0) Updates `uv` from 0.11.31 to 0.12.0 - [Release notes](https://github.com/astral-sh/uv/releases) - [Changelog](https://github.com/astral-sh/uv/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/uv/compare/0.11.31...0.12.0) Updates `s3fs` from 2026.6.0 to 2026.7.0 - [Changelog](https://github.com/fsspec/s3fs/blob/main/release-procedure.md) - [Commits](https://github.com/fsspec/s3fs/commits/2026.7.0) Updates `ruff` from 0.15.22 to 0.16.0 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.15.22...0.16.0) --- updated-dependencies: - dependency-name: fsspec dependency-version: 2026.7.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies - dependency-name: hypothesis dependency-version: 6.163.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies - dependency-name: ruff dependency-version: 0.16.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies - dependency-name: s3fs dependency-version: 2026.7.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies - dependency-name: uv dependency-version: 0.12.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com> Co-authored-by: Davis Bennett --- pyproject.toml | 4 +- uv.lock | 154 +++++++++++++++++++++++++------------------------ 2 files changed, 81 insertions(+), 77 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 663a1ea286..8b8534cb65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,12 +100,12 @@ test = [ "pytest-cov==7.1.0", "pytest-accept==0.3.0", "numpydoc==1.10.0", - "hypothesis==6.160.0", + "hypothesis==6.164.0", "pytest-xdist==3.8.0", "pytest-benchmark==5.2.3", "pytest-codspeed==5.0.3", "tomlkit==0.15.1", - "uv==0.11.31", + "uv==0.12.0", ] remote-tests = [ {include-group = "test"}, diff --git a/uv.lock b/uv.lock index e1d469fd84..5e3e33aefe 100644 --- a/uv.lock +++ b/uv.lock @@ -955,11 +955,11 @@ wheels = [ [[package]] name = "fsspec" -version = "2026.6.0" +version = "2026.7.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/10/a1/ae4e3e5003468d6391d2c77b6fa1cd73bd5d13511d81c642d7b28ac90ed4/fsspec-2026.6.0.tar.gz", hash = "sha256:f5bac145310fe30e16e1471bd6840b2d990d609e872251d7e674241822abf01a", size = 313646, upload-time = "2026-06-16T01:57:28.105Z" } +sdist = { url = "https://files.pythonhosted.org/packages/00/78/f34251dadb8f3921264a1d9b8946f5e542014ee2614b285261b4e40e6775/fsspec-2026.7.0.tar.gz", hash = "sha256:c803c40f4cf860b49dea58ee3e1c33cb9c790520e233537e1340049f89b82a88", size = 317040, upload-time = "2026-07-28T16:34:51.052Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e5/22/4222d7ddf3da30f363edaa98e329c2bce6c65497c9cb2810931c8b2c0fbc/fsspec-2026.6.0-py3-none-any.whl", hash = "sha256:02e0b71817df9b2169dc30a16832045764def1191b43dcff5bb85bdee212d2a1", size = 203949, upload-time = "2026-06-16T01:57:26.358Z" }, + { url = "https://files.pythonhosted.org/packages/fd/3c/6a2bf344106328fd04963664a60b9bb6496fc25df8e962fcdc1367285fb9/fsspec-2026.7.0-py3-none-any.whl", hash = "sha256:b57ddbafedfaef7018c1ecab32aa200a9d7ca26b77965f64e48b70061249d279", size = 206583, upload-time = "2026-07-28T16:34:49.538Z" }, ] [[package]] @@ -1029,51 +1029,55 @@ wheels = [ [[package]] name = "hypothesis" -version = "6.160.0" +version = "6.164.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "sortedcontainers" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/27/18/824aedbd4117d769862a2722ea2371aa61433a38bfb5355e5dc113b564c2/hypothesis-6.160.0.tar.gz", hash = "sha256:149400acbb7382e2ce6810a52e86a9fd6d4e5c4a47660818abb438cde76aa5d1", size = 485677, upload-time = "2026-07-22T14:12:13.331Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/ad/c6/39fa718992b7529d1f68532a3554b9479f27f6a46aa5859c0d909bde0a40/hypothesis-6.160.0-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:69e1511325901fcd570fbd88779882e30cb280aeedd9708093aab4b25f7cdbf5", size = 766096, upload-time = "2026-07-22T14:11:58.283Z" }, - { url = "https://files.pythonhosted.org/packages/94/1b/81b54dbf97baa4026034579ce63b56d3d35c0d22b72b032c68e23bbda92b/hypothesis-6.160.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:1ba0f1dd0f2872b7f7230a3884a0d739917d57262d0e9e3c8ee34b775f95a553", size = 761752, upload-time = "2026-07-22T14:11:42.682Z" }, - { url = "https://files.pythonhosted.org/packages/ea/02/fa35cf37fd801d1e952e2168c0b5542f99c77024098f954cd515f2101910/hypothesis-6.160.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f9116a80ed96060a7fbc8d50cc5e93dec10d72f70f61e9184628dbcba2f9a2f", size = 1090928, upload-time = "2026-07-22T14:12:05.158Z" }, - { url = "https://files.pythonhosted.org/packages/a7/35/f2422a4287bbac99d6317a10e7add5f24abe069952c503cb3512e91bebc0/hypothesis-6.160.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:065cfed699889b6c05265ca4f97e8c7bb85800d3d3146f4741b68ef7be1fed18", size = 1140474, upload-time = "2026-07-22T14:11:50.558Z" }, - { url = "https://files.pythonhosted.org/packages/bc/ef/7504f31be0c9dfd8c69b1e068564e0c1126a82ab753abcb20c4bacd1544b/hypothesis-6.160.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:52e0cdc8fcd34b121a213205f239545fec38142014114afc721d1c867ac34834", size = 1132509, upload-time = "2026-07-22T14:11:48.702Z" }, - { url = "https://files.pythonhosted.org/packages/b4/39/8c7a5cfc336e0bdd7b7ae1d8807028b2b46c03979a5d82e8992b4ba2b81c/hypothesis-6.160.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:4868821ffba805970441fec1b0635ea123f01aa6b71fc8f2d9550ee782f1ecd7", size = 1264762, upload-time = "2026-07-22T14:10:30.068Z" }, - { url = "https://files.pythonhosted.org/packages/ac/00/0d47e996ccbfa1eceb66d285b6fbf248c7c020e4e18b1bea09b18f05f6f5/hypothesis-6.160.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:64cf59670080aeb3c6048d62df0f6352586410745d14d7045a692eb5d2245110", size = 1307495, upload-time = "2026-07-22T14:11:33.978Z" }, - { url = "https://files.pythonhosted.org/packages/1a/b8/01f731cfcf9fc475adbde3c328d0c8f1d24952b4dd2a5049e7156aa64d9c/hypothesis-6.160.0-cp310-abi3-win32.whl", hash = "sha256:993c26c81e9cc9f291cdb64f54aa8f31507d2d472d0f1334f8ba9e7d77666911", size = 651991, upload-time = "2026-07-22T14:11:21.375Z" }, - { url = "https://files.pythonhosted.org/packages/87/12/95216fe9a84cafc9bc721b4352cf9b78bf0e9089f278811fbd58c76dbe3f/hypothesis-6.160.0-cp310-abi3-win_amd64.whl", hash = "sha256:95a4b0e1faa366d0cc9d7ce261773cec69f4f130b845ca33b71c22c85493c35d", size = 658114, upload-time = "2026-07-22T14:10:54.298Z" }, - { url = "https://files.pythonhosted.org/packages/81/b2/bc800c4925c1f47b61c17f78e57bb58a8743d03da28de13f59cba148daf2/hypothesis-6.160.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:18e058b34f4514da8b2ce15ebee9e6e98d3a95067665accf394415824934f790", size = 767730, upload-time = "2026-07-22T14:11:56.44Z" }, - { url = "https://files.pythonhosted.org/packages/37/b6/d34a7f990eb0a38933a7f6b14d261fda990faef37122e71797b0043fa371/hypothesis-6.160.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5b38697f797e9406e20e03cd79e1a69c7ac714e7e244f13121d39b44f27f7ed3", size = 759362, upload-time = "2026-07-22T14:11:05.77Z" }, - { url = "https://files.pythonhosted.org/packages/df/bf/48bd2bf246d22f188c82dbf3682832fc14fa4e6069c5415b1e8a473397a7/hypothesis-6.160.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef7d9e8022a8dd2afa2bfbf6580f21a7fd8b4798d20c027f4afb048d780414fd", size = 1089731, upload-time = "2026-07-22T14:11:39.069Z" }, - { url = "https://files.pythonhosted.org/packages/76/a0/d557bd44f611ec2516c69b6ada1e65f96c4d9d1dbad63f12b1799ca682b8/hypothesis-6.160.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4716ceb2adc72ea20138cd6a5600d102895f46fe95a42d915e032eed54b77ee6", size = 1139776, upload-time = "2026-07-22T14:11:19.164Z" }, - { url = "https://files.pythonhosted.org/packages/32/99/cad454acb11e027773bdba5cb95cb181a46cd1cabb8bfe2f2042e29dc0c5/hypothesis-6.160.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3d186b17a25eaf51ebf0376ea9d702dddb4f62cc11c0b5230e0aae77b44f49d3", size = 1262564, upload-time = "2026-07-22T14:11:02.444Z" }, - { url = "https://files.pythonhosted.org/packages/67/e7/61b2e1b6c2f75fa3b791040ba4baf2b617ffaf62ffbafad9463869baf521/hypothesis-6.160.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7e5e959bb18ec9b285dcc1d6f455c8860da919b9341842530847e820ed18dbbb", size = 1306756, upload-time = "2026-07-22T14:11:54.464Z" }, - { url = "https://files.pythonhosted.org/packages/89/79/6e9f2da0f298f891930a9fc1ed0559818d4ba840f47ed736c89152fd962e/hypothesis-6.160.0-cp312-cp312-win_amd64.whl", hash = "sha256:ded91bbdd0c3a84903bda3dc08d639b3b3e28c03fb83b568af8e13039042c3c4", size = 655265, upload-time = "2026-07-22T14:10:58.076Z" }, - { url = "https://files.pythonhosted.org/packages/85/05/a05ba058a37681d2aa872abcff9bd7a50c61c6347aedf2e3f5a15b8e932b/hypothesis-6.160.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:cb6cd703d38d881505a00e1901844d70d250e90824caa55e0dfaed6c8c7e0244", size = 767604, upload-time = "2026-07-22T14:11:11.346Z" }, - { url = "https://files.pythonhosted.org/packages/ec/a1/33dde1810a52698802fe2e28cfd2696b6aefafdc721cc456dfbc85875bb2/hypothesis-6.160.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9561298d687f9fca38aab451e8eb8a9f18b65a57f81f7331eff5234f0f065dc0", size = 759264, upload-time = "2026-07-22T14:10:40.271Z" }, - { url = "https://files.pythonhosted.org/packages/34/84/573402093577ef0fd86c8156d4c4ecd03b0a5e368e8925074fe565f9faba/hypothesis-6.160.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9e19f91119e2e19603210b849508695efabd2a35d6af9ac4d637c1b9a514a52b", size = 1089653, upload-time = "2026-07-22T14:11:37.333Z" }, - { url = "https://files.pythonhosted.org/packages/da/05/c85a35fef75214fc08a27e5099ae51d713c6550252ef7ce4c156780433f1/hypothesis-6.160.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd6b73076bb3fbf02001a439a5eb45cdd3db17e2cf6d95f453cfb1f5a97713f5", size = 1139592, upload-time = "2026-07-22T14:12:11.469Z" }, - { url = "https://files.pythonhosted.org/packages/59/53/8f9996fa3a6352edec2c17b743630b6c5f62486db6b43594168a1c0b7571/hypothesis-6.160.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:c0dcde9c08f3bdd5318026c57155ce4bfe7615fd27d3eca77a7453cb3ffbba64", size = 1262616, upload-time = "2026-07-22T14:11:14.754Z" }, - { url = "https://files.pythonhosted.org/packages/b4/f7/8b2699131893dd7bcecfe3be9ee758d3939cc8af68374700e68d9df2281b/hypothesis-6.160.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:78cb5fcf8518f3a10e888cdff545fa733931e2ff843b02a54e5e0b01b3142f94", size = 1306470, upload-time = "2026-07-22T14:11:23.203Z" }, - { url = "https://files.pythonhosted.org/packages/88/ba/9764eaff70d2a54aa072f709a121f98cf8766fc1591a063f8fab2117b6cf/hypothesis-6.160.0-cp313-cp313-win_amd64.whl", hash = "sha256:e95c3ce8e9c5abd2256854a2e53395fdd91d16cdce8d1621eca8caf5c7a2b1a2", size = 655209, upload-time = "2026-07-22T14:11:17.33Z" }, - { url = "https://files.pythonhosted.org/packages/a1/b9/3b92edf73785218f084521c2be9506ce6e5c63a64662cda074e588ff3071/hypothesis-6.160.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:9bd3d333a501f1faf8611159a998eb1bb28c43b620822ba6c8b2463f5de2a136", size = 767796, upload-time = "2026-07-22T14:11:28.865Z" }, - { url = "https://files.pythonhosted.org/packages/12/c7/eefd510bffc66320015169e2c6669e3a08ea29dda84d81655ecc1c6cbd8c/hypothesis-6.160.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:21ee82802c25282d692eaec7d3b960176c10eb6dc70853b152c5bc6b3b6faf02", size = 759410, upload-time = "2026-07-22T14:10:31.902Z" }, - { url = "https://files.pythonhosted.org/packages/1d/e4/6ad1e558d2df6900b0ad9d17081fbed4a74ffb01d86e64813cab4eaf45f1/hypothesis-6.160.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7d71e85548be9dd3a6eb59904daa85d5879e337cb69ad42cc2267c05a17ab26", size = 1090131, upload-time = "2026-07-22T14:11:44.448Z" }, - { url = "https://files.pythonhosted.org/packages/69/94/0d2fef37f9ff89b38b943cc38e12b45fda47cd06704d09bdeb890063d3bc/hypothesis-6.160.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4af833bb623f37b185e53ad7c62292272fc9fec3c7567d0703e3fdd3dcc90945", size = 1139829, upload-time = "2026-07-22T14:12:02.462Z" }, - { url = "https://files.pythonhosted.org/packages/ad/f3/216b8af797eda74af68b0d8ee37d8452adf0cf5b924dd25780e5c3b6296f/hypothesis-6.160.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:5789a0cd225f216690d7d99159bbd5d01a6d42cb6c4a07233739b4bf59c7fa37", size = 1262992, upload-time = "2026-07-22T14:10:34.529Z" }, - { url = "https://files.pythonhosted.org/packages/d8/14/63f14de37f41ed09d56593d9c03e8389a3bffcdbdf71bf05d30b5e3b1e4f/hypothesis-6.160.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:57f6e370e24c3ca4b9bb6cb132baa471745ca3d598f6328a602f590fe531b1e7", size = 1306760, upload-time = "2026-07-22T14:10:59.825Z" }, - { url = "https://files.pythonhosted.org/packages/8f/9f/a94eb847dd98edf233aefb7dbe88bd7bf7506840896454ed03827f844907/hypothesis-6.160.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:5df6d4768d7a2d0bd82cd8704c2732cf80fd13089217a3b0ff7b330b59eb50c6", size = 599306, upload-time = "2026-07-22T14:11:09.704Z" }, - { url = "https://files.pythonhosted.org/packages/cb/10/01a5545d22d61320e5d9507a252cef37a138af97d5c17bcad8ea08bfa936/hypothesis-6.160.0-cp314-cp314-win_amd64.whl", hash = "sha256:bdafeab25029d1261786f68ce7aedaa5c0be3ad4accfb13b32ff206ef6dfaa40", size = 655149, upload-time = "2026-07-22T14:11:12.9Z" }, - { url = "https://files.pythonhosted.org/packages/91/d7/b170ae2dfeea3bc0edb99f361ccd725ce00120ddd2065590ed4281ffd29d/hypothesis-6.160.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:285f6763461d58ef1b9b75efd69b559ba3b91055c7c6fb34b1513b3666106a62", size = 766374, upload-time = "2026-07-22T14:10:37.579Z" }, - { url = "https://files.pythonhosted.org/packages/85/30/64e3ca8d5132688bed13bf0c35b4cb1061975f7bba9201c718c394b14fbb/hypothesis-6.160.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d7cefc720eaf6d80f4ee0be59a12e301f3d16a5941fdbefe11295ca7e567b0c2", size = 757876, upload-time = "2026-07-22T14:11:27.033Z" }, - { url = "https://files.pythonhosted.org/packages/25/a2/219da3305b412dc265be7ecdd846882ff4e399f84896ff561982bb9be0d3/hypothesis-6.160.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ec6ff81bace8494b12b6c2096e8fb18a769e861613a02138700a2cb5e4c1ccd", size = 1088723, upload-time = "2026-07-22T14:10:48.385Z" }, - { url = "https://files.pythonhosted.org/packages/8a/29/c1879c3a25f3069b1102d17bf2b6f6a7c0667128f1fb2efb2e9964bc17c1/hypothesis-6.160.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1c32bed39ecff19f68e37fef7ee4bcd1d13a82378fcd321b61d0cd2f1a360c8", size = 1138696, upload-time = "2026-07-22T14:10:52.712Z" }, - { url = "https://files.pythonhosted.org/packages/b6/15/16239bfc9aad85aa0a0166f61b8aa4eddc69ee57b0c68188f191f4ef0b00/hypothesis-6.160.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8d04e56812e135c3223cd06cd0016f61466ce7c56720167046d91123534240f5", size = 1261184, upload-time = "2026-07-22T14:10:43.241Z" }, - { url = "https://files.pythonhosted.org/packages/7d/b8/aa6f06d42d1505b2dab0f82d133d84853391437f34a15c4c39cbcda04f6a/hypothesis-6.160.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c18c5eb6260bda6e56689429723d5b62b62cedee88c95de03976799645c9b0ce", size = 1305573, upload-time = "2026-07-22T14:10:51.193Z" }, - { url = "https://files.pythonhosted.org/packages/44/13/645f8c95070a21fa1257f0d4cf68b938d7ec60e8371d79402ce7cb50d3c9/hypothesis-6.160.0-cp314-cp314t-win_amd64.whl", hash = "sha256:deabcb5645076988ac52237a7c3ee8fca2fbd4f859461537374911fbe0e99817", size = 655308, upload-time = "2026-07-22T14:10:38.969Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/7a/ac/7b76103bd74d8457e4de0c6a6c3a26ac6327016438bde125e0a3de83a5b8/hypothesis-6.164.0.tar.gz", hash = "sha256:5d63d263d8c71b571638c18d9591f6e34b836c60a12469e9d9105c1c785f00f1", size = 492022, upload-time = "2026-07-30T12:39:49.085Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7c/fe/d5b75a55892b33e72945f82efc71f645d29c0bfdb9f00727f7535a52edcc/hypothesis-6.164.0-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:14b861ac3353f8643b82a3ba76b8a0a54d2a06160c32b9a1f64a8ab41b179089", size = 771561, upload-time = "2026-07-30T12:39:00.404Z" }, + { url = "https://files.pythonhosted.org/packages/1c/b0/2f01e9efc7267446bad0e2a68f7472daa174a72553d213b16aefe44b2bda/hypothesis-6.164.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:3d8c8bb00a4b86ae90b9ad41f3e1c99d016ec3e64c0ff9d676a4bb7be4f56948", size = 767079, upload-time = "2026-07-30T12:39:23.123Z" }, + { url = "https://files.pythonhosted.org/packages/c3/26/d7bcd26b58e1df2bd39116b924b2a72676215d9650e68cbff9a629c3ce30/hypothesis-6.164.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e80e3ba8eaf37664eaa0f2625cef120b330b128a7df570210cf8be4f5ae65aaa", size = 1096364, upload-time = "2026-07-30T12:38:49.972Z" }, + { url = "https://files.pythonhosted.org/packages/9d/17/99fe7ea866935da83444c3ef7885a14fc7349d96ff61c6faebd37ef4edf2/hypothesis-6.164.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8cdf70f821e2d2f3a0bccaab29830aea8aefb63a77806e7e91246fb65a10c8d3", size = 1124963, upload-time = "2026-07-30T12:39:13.1Z" }, + { url = "https://files.pythonhosted.org/packages/38/e8/df08be6296cbc1271d44e81f8ff9dcd6267a07552fb768e0fdc166e93d40/hypothesis-6.164.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bcc3743e22b3cffa7267b4bc74d03628606e4a115495728e986a7be220987315", size = 1145886, upload-time = "2026-07-30T12:39:45.612Z" }, + { url = "https://files.pythonhosted.org/packages/4e/72/d5cf6fbfac40891d4281f630e16a6eb217ff56f97e350a06e0fd9322aa6a/hypothesis-6.164.0-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:730f09d4afcd8a918b3d589bfb6421e3b41c057aa57652a773ef4f512cc60836", size = 1101181, upload-time = "2026-07-30T12:39:05.194Z" }, + { url = "https://files.pythonhosted.org/packages/fb/ff/7ceb002329febffb678b65835ca6e9479a916325d088aadb0210d07f8252/hypothesis-6.164.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9651cb48cb5a995295b442138d15d381547b935dcb0066fca7148a7955347400", size = 1137970, upload-time = "2026-07-30T12:39:16.076Z" }, + { url = "https://files.pythonhosted.org/packages/7c/8f/c12c697b73ca9ca24d8a913879e3e0a9db86479754c7221554247c701565/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:51d161d2655dd86143b370c577267b5b7b4c2e8fcb8a3f22c1a787572aad707c", size = 1270184, upload-time = "2026-07-30T12:38:54.436Z" }, + { url = "https://files.pythonhosted.org/packages/0e/2f/93f1c850c794fc9c80f5e61b3b20652126b865e6f57b348ae530446aadc7/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:e8a250552390128b57e3afe55035ce2c2cb1f6f0919817657854244f071bc5be", size = 1397987, upload-time = "2026-07-30T12:38:21.113Z" }, + { url = "https://files.pythonhosted.org/packages/c5/b8/bab2546325e15e87c8518dfbca263c81dbc35d566c516d66c9da98a38b77/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:570cd51944e1cc3443847d8afa3d17fcf8aac475a1f744c9e7318a5ad7ef5c9f", size = 1270755, upload-time = "2026-07-30T12:38:51.571Z" }, + { url = "https://files.pythonhosted.org/packages/6a/4e/ea97dd39678a42dc5a24e3e2a64d3b950fad9fb1dcce8d7be5afb52a0335/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3a423e543055b3de5af7a7624c4285422541658367211fa293a3a57dd0ad01ba", size = 1312888, upload-time = "2026-07-30T12:38:30.847Z" }, + { url = "https://files.pythonhosted.org/packages/44/84/a6f2d5b12b23d65f16eb398750e430065f9d1f40f4418569e3b87ef58d23/hypothesis-6.164.0-cp310-abi3-win32.whl", hash = "sha256:f5e51490b2ce64c66138f24477d83c71b6224ab0ef65700da10187c464b54e94", size = 657401, upload-time = "2026-07-30T12:39:11.581Z" }, + { url = "https://files.pythonhosted.org/packages/f5/d3/c5ee410daa594cac2d3fe1fbe5473f2390e35f4369e168a817e43341ce2f/hypothesis-6.164.0-cp310-abi3-win_amd64.whl", hash = "sha256:c9059dfbb039342b6590bbce207f90e0f9a80fdf45a404c68c2d3e598be78ab3", size = 663566, upload-time = "2026-07-30T12:39:30.27Z" }, + { url = "https://files.pythonhosted.org/packages/90/91/4942fe3f2f08b920368ed5a2937346259e843e382205513b4a0e70d2de9d/hypothesis-6.164.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:6bc3373fe550cf4d7cadb94ceaeb91e431e1418a96b7baa330487366eaa67d3c", size = 773152, upload-time = "2026-07-30T12:38:33.328Z" }, + { url = "https://files.pythonhosted.org/packages/eb/df/e66d052386a2b6c3e2f3eab32a02d7de3c9c59cd21d5dd58c08ecfa715f0/hypothesis-6.164.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2780297ca68929b153eff7effb2ebe67e9487d2fd9f49fa961007f8f2d236c9e", size = 764713, upload-time = "2026-07-30T12:38:48.59Z" }, + { url = "https://files.pythonhosted.org/packages/f5/d5/5a50d14b8f04809e973c4dea884b367fef3663ff253c1205fa9e96229ef9/hypothesis-6.164.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b400bb4eb5a4a1e19cd5af3cc63817909e6b54b4603e04022bdba46860913d7", size = 1095160, upload-time = "2026-07-30T12:38:58.925Z" }, + { url = "https://files.pythonhosted.org/packages/58/01/781b19ce4382ec239c4dc6ec3bd9f195e69e5570f2814bbf04b5781ecb18/hypothesis-6.164.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fca6632933fc506dd96926d9383483e4c0066c7ff62c748d059a3276da761e7", size = 1145199, upload-time = "2026-07-30T12:39:09.904Z" }, + { url = "https://files.pythonhosted.org/packages/e9/64/30e016863515ca01c1c738b05dd50491353d3ccae6432362e56e0c15d0da/hypothesis-6.164.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b9e1f6e89e5ec34735b727f3ce41d12e7f3b8efc162c91c8a225e10b54b504b4", size = 1267980, upload-time = "2026-07-30T12:38:18.733Z" }, + { url = "https://files.pythonhosted.org/packages/84/23/17eb8d67d59ecd3a820c905fbdf514e371dd7d01631e62a304cdd5793abe/hypothesis-6.164.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:51b0f967f608707b24ed37a298174ae6eec7899bfe3f271d1c3062c39ad66c06", size = 1312181, upload-time = "2026-07-30T12:38:36.056Z" }, + { url = "https://files.pythonhosted.org/packages/42/69/cff9f3cd9524252adda7c8e0e129dfc176e72f64fdf0bf1552d1ea43d78d/hypothesis-6.164.0-cp312-cp312-win_amd64.whl", hash = "sha256:5770df7d518bf867a9379e9081abd9e44db1d15473430e26a0946438c08c5926", size = 660690, upload-time = "2026-07-30T12:38:28.107Z" }, + { url = "https://files.pythonhosted.org/packages/ba/b4/729697380a22dc2ce8feae3c64b08bf3bd3c27e99c3706cb9bdac40c6fc8/hypothesis-6.164.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:29e7cb48974cb9fd87602e20625c890385793c6b56c18a957085a9c291f56ef8", size = 773046, upload-time = "2026-07-30T12:39:40.473Z" }, + { url = "https://files.pythonhosted.org/packages/38/35/72374f02d90dfda198afd8aac6b1e7d1184506f97e62ebcf3d2c1e5bf761/hypothesis-6.164.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1ff8c3819345be8dd15ee6588ee9383869a54c9a3d2232cce5e26b456424135d", size = 764659, upload-time = "2026-07-30T12:38:55.896Z" }, + { url = "https://files.pythonhosted.org/packages/6e/75/fb26388915d71e5949b98ccd0c9d95edcbe6b45d0370f177d43633d81ae2/hypothesis-6.164.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:33e88be13fac3ff7cb789a0b4cc43d99fb297db085f529fbb363188141c7d5bf", size = 1095078, upload-time = "2026-07-30T12:38:34.677Z" }, + { url = "https://files.pythonhosted.org/packages/be/63/f6da6e39667d39a1e44c5df82fbe6cff070c29aaffa9beb62a5322e7d8ae/hypothesis-6.164.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2e296d03a77355ce2e1c32e85a636b555edf0ddaaef277f98f1b84fe38a4595", size = 1145015, upload-time = "2026-07-30T12:39:26.487Z" }, + { url = "https://files.pythonhosted.org/packages/88/c7/55ba09727da3d9a60628c50e31e6083a36f403cb230f5e1a7bd1749a5c39/hypothesis-6.164.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:53698a1b246714539dd0ecc2d556cde613d74e9f7385ec4109e0651ab2d382d6", size = 1268027, upload-time = "2026-07-30T12:38:25.676Z" }, + { url = "https://files.pythonhosted.org/packages/ff/35/4789cade332f799b0e8f2f7ea0fe2aae6157a85e60f74497e316dd17a7e3/hypothesis-6.164.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:004c92c4b869f8e258f0641101b7743cae8420436f4465383f681c086ef95c9d", size = 1311895, upload-time = "2026-07-30T12:39:14.621Z" }, + { url = "https://files.pythonhosted.org/packages/12/8a/18d85e624f8631aec42daa8a2f07c6edcedb7385b2c0f375ba8a30cbd065/hypothesis-6.164.0-cp313-cp313-win_amd64.whl", hash = "sha256:4878f81fa92a580d3e16b53e64e01a9d9fe1dca5973783558493a003138dbd36", size = 660656, upload-time = "2026-07-30T12:38:37.696Z" }, + { url = "https://files.pythonhosted.org/packages/c7/06/3c144d427799c7c72befb0bb3b199d419a89b96e1002fd8f0cc94c84ffb7/hypothesis-6.164.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:9110010bdf6deb3ba9134f8ce8b683e8bb0fba108a351045c96d60c410eb6963", size = 773254, upload-time = "2026-07-30T12:38:38.919Z" }, + { url = "https://files.pythonhosted.org/packages/74/2d/b61a10d9e70df04aa7e8f34efef8e4afe364e8995c59f894e1c35b428214/hypothesis-6.164.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4df103e5d32b47d574c6e857d45361e2cba5a198d6dae4e4ee1bd248b3a2cbfa", size = 764786, upload-time = "2026-07-30T12:38:24.464Z" }, + { url = "https://files.pythonhosted.org/packages/99/68/7f80ac7bdffe78686135311c919534be411d4565c2a5ba38fd389880c553/hypothesis-6.164.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4abec95020960c0ed08e5be318d2bcdde79f2c6fc7785e368a9389d31d3e802a", size = 1095578, upload-time = "2026-07-30T12:38:57.422Z" }, + { url = "https://files.pythonhosted.org/packages/45/f9/97dcbac776bcf33cb4241b52111527821f707b60a84d03d0ea670b09a134/hypothesis-6.164.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b106756cc9abd50ab1632541ea7b7223792d877a084726aa0304237d758181e", size = 1145207, upload-time = "2026-07-30T12:38:23.387Z" }, + { url = "https://files.pythonhosted.org/packages/a4/df/68184b6f71540435c895cf35ad1d67a3634a887c597ab38d3372c0d20186/hypothesis-6.164.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:11c4aab2ae6757fc4bc3bbf009487e24fd3490365817bbf40b9ec85a7e02fabb", size = 1268357, upload-time = "2026-07-30T12:38:52.946Z" }, + { url = "https://files.pythonhosted.org/packages/a0/76/6a6851dc8af89a5c0418937d38456417b2a1fc9db15c992b9cb43d53a7a3/hypothesis-6.164.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:4713edecbc0969557ca135769a36d1e524c8e3b7a2b271de48d98fa29f681bf6", size = 1312183, upload-time = "2026-07-30T12:39:28.604Z" }, + { url = "https://files.pythonhosted.org/packages/2f/19/83adeb1f8f045bd8a1ab9822d0c3db28b337d37fff01d809fcd6e3ea70f8/hypothesis-6.164.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:e6882d316c390d33c55ec8f1675f35ab238d7c0473ccf8d235c69eaef6c621b9", size = 604771, upload-time = "2026-07-30T12:39:33.579Z" }, + { url = "https://files.pythonhosted.org/packages/0b/62/fcb48ebfbccdc5b695de175b9d1d344b3688782150f0603124bb70c0891b/hypothesis-6.164.0-cp314-cp314-win_amd64.whl", hash = "sha256:7c3357633b38bca8c927fd90d02b39a0a3f35f24cdbcfb2fb1dcf69a3f63bd85", size = 660570, upload-time = "2026-07-30T12:39:43.898Z" }, + { url = "https://files.pythonhosted.org/packages/42/61/5857da7db0435fa69df658a9eafba62eb8a1319454005ce2a0d97f6f9e4d/hypothesis-6.164.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:53152cb549f52d661c47768d0d12a192ef26a7a9758a7f13b8ec41e8e63d6325", size = 771839, upload-time = "2026-07-30T12:38:26.842Z" }, + { url = "https://files.pythonhosted.org/packages/6c/9c/22292a9dab1c544362d1759244132c7d71a9d9d5eda5d454ec735fba6bd3/hypothesis-6.164.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:cee7898ad84b63da6506ae48483bb36f319a25ea4c2b1d2df47d021cc4080c24", size = 763363, upload-time = "2026-07-30T12:38:20.042Z" }, + { url = "https://files.pythonhosted.org/packages/e8/29/cc0c6e9a065a32f93fe52dde746232f007d2cabf619d4e7b1b37bd34c424/hypothesis-6.164.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0def33f0d236e54144a5218997e4492925144d4615f25fdbb4ac8e47b7b709e6", size = 1094171, upload-time = "2026-07-30T12:39:35.158Z" }, + { url = "https://files.pythonhosted.org/packages/a7/59/37040d0776a29d4bc6d0ca9a50ca2755200007e4a8ddc27b010115b69c85/hypothesis-6.164.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:471fd80d70f2df606b1320276168bc2c6007a586124a1d81628264ccb9266f68", size = 1144089, upload-time = "2026-07-30T12:38:43.024Z" }, + { url = "https://files.pythonhosted.org/packages/fa/10/5235ed3c090a2f12fa15cc1d08e5a36cfa31bc0607c45199b0806e930ab4/hypothesis-6.164.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:2eb285756aee62890fd08d6e97cf77651dfe7c093ceac094df52120a7a8dbe68", size = 1266595, upload-time = "2026-07-30T12:39:36.979Z" }, + { url = "https://files.pythonhosted.org/packages/7f/97/ffc4cee4dfdffe658e839d5f4df72ae3fa7bfea9401550b475d9700e0ee2/hypothesis-6.164.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:7c5215b5568968c35c6e124e5a4a8068f80419d6171414ddf735b49e1df1ab59", size = 1310998, upload-time = "2026-07-30T12:38:45.788Z" }, + { url = "https://files.pythonhosted.org/packages/dd/08/681d4a272cd2812151581c3328e41a80a34e420d676e419a25b4b9dc2291/hypothesis-6.164.0-cp314-cp314t-win_amd64.whl", hash = "sha256:a845e59fae87bb47a6fb84e0d5adb5679b3b55042fc3f8791da91486103cfbf0", size = 660724, upload-time = "2026-07-30T12:38:40.341Z" }, ] [[package]] @@ -2910,16 +2914,16 @@ wheels = [ [[package]] name = "s3fs" -version = "2026.6.0" +version = "2026.7.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiobotocore" }, { name = "aiohttp" }, { name = "fsspec" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/99/00/6677343dc919d6c072bb04d80210afdd22c16838a8d16b3315c122dc728f/s3fs-2026.6.0.tar.gz", hash = "sha256:b28de7082d0a4f72392884bdc497e34a4a1582f675d214c7da0acf6e950a0083", size = 87358, upload-time = "2026-06-16T02:05:48.719Z" } +sdist = { url = "https://files.pythonhosted.org/packages/12/60/69fc080b72a32971b2fb5acbc80802b0e876b606f6e27b1689caac4bb57b/s3fs-2026.7.0.tar.gz", hash = "sha256:76b062d1b2bc7bf4bcd9e7d8f1eb2b5dd9d5cee96ce888664c4ddb5f563146bf", size = 87595, upload-time = "2026-07-28T17:14:10.595Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a5/0b/f68a968b49876eae0f2a515387093cebb2eb9451380a96741cc20efac0d0/s3fs-2026.6.0-py3-none-any.whl", hash = "sha256:60576e31bb31193c1f643f32b4c6439548720ea6918ac702e21cd757c80b5db8", size = 32573, upload-time = "2026-06-16T02:05:47.608Z" }, + { url = "https://files.pythonhosted.org/packages/98/cc/bcde19a37952ecc58e7d9d67ecaa048e1e21b17d014ce0863a6a6101e606/s3fs-2026.7.0-py3-none-any.whl", hash = "sha256:64edf3c01ebffab1eec38ff9c09eefbf86a3db14c87d248f795da0e7b801d698", size = 32659, upload-time = "2026-07-28T17:14:09.497Z" }, ] [[package]] @@ -3167,28 +3171,28 @@ wheels = [ [[package]] name = "uv" -version = "0.11.31" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/21/f0/501fe8a234ac96ea8869e84cb47b3bd77e39a0e80ee01950713e24fe1c4a/uv-0.11.31.tar.gz", hash = "sha256:763609d59721af5b8522e16deac6cffe8055f82bb837740c708917506f305185", size = 6045932, upload-time = "2026-07-22T01:48:45.407Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e7/6a/065e1e7feaf375eee8d1bb05e5276185708149dd48c27a230f320a0fc8bf/uv-0.11.31-py3-none-linux_armv6l.whl", hash = "sha256:6adaaf151f53fef04dec685f0816d304c09a091b2b609746f86ee7c55ada6bcd", size = 25838313, upload-time = "2026-07-22T01:47:21.787Z" }, - { url = "https://files.pythonhosted.org/packages/e1/15/529b573723a36badbda1e13a432c3b21a7554b8ddef3b20a2200037051c2/uv-0.11.31-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:2d84b6dd6b1eaf42fc923203d21a5efd052e1982e4f961eccecc2a6905ffbecd", size = 24795386, upload-time = "2026-07-22T01:47:26.882Z" }, - { url = "https://files.pythonhosted.org/packages/52/be/a809b3fe20c3d37bc667de33f38475c4c94f860979d07049ccddb6d91801/uv-0.11.31-py3-none-macosx_11_0_arm64.whl", hash = "sha256:335f3262c4350c004cf6e3b7061200148d670e579bcee7ba0e31c7535f125018", size = 23410594, upload-time = "2026-07-22T01:47:31.43Z" }, - { url = "https://files.pythonhosted.org/packages/c9/9a/ebaacd8b7713fd755d23623e0e8de78dfd001f6abc818034f2e9058035c7/uv-0.11.31-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:e1cf5803c39221387b2fe8be2b522b0529ac732831a2e52a92330e053539995e", size = 25358933, upload-time = "2026-07-22T01:47:36.544Z" }, - { url = "https://files.pythonhosted.org/packages/81/34/c30568a0f9e556be766c341106bf6ca2ef5c8067be6c11665a53df0549f1/uv-0.11.31-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:68ae6974ffbd04703e138654e83220a16e7b0b679271a8f209f928928dd399f8", size = 25346175, upload-time = "2026-07-22T01:47:41.132Z" }, - { url = "https://files.pythonhosted.org/packages/b5/63/18467b66f578dc121ec6d4af78074a0db06b27627b072fc433226a99a384/uv-0.11.31-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:48f7ec906eaebf9717a01ba0f7635cd0cac648ff5c8fff3a57b8805e6bd49078", size = 25381240, upload-time = "2026-07-22T01:47:45.659Z" }, - { url = "https://files.pythonhosted.org/packages/b8/43/b51d6b8ad1307f51dd75154d623d6a527c6de600086bb0446251047d2e5e/uv-0.11.31-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5a2cfd1638420f9a2a7dbca71c808edaf3929b6d8f4ec2ceac2f27014150d0e3", size = 26661822, upload-time = "2026-07-22T01:47:50.42Z" }, - { url = "https://files.pythonhosted.org/packages/30/9f/008c859ea3fc0d25d6ac32e1293a0795c737b0a472a8603b5e511b56659c/uv-0.11.31-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aec65d8f54403e60f32c50e44d98b6420de55211ad22a340927efc5db6ef4205", size = 27594901, upload-time = "2026-07-22T01:47:55.444Z" }, - { url = "https://files.pythonhosted.org/packages/f5/ca/65a2856e79a208f8a1ece0ac077fbee531db7455608c06ab677b2513cbc4/uv-0.11.31-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5610fea306dc6ce5021482d272e6372f0c3dfd1e24ec061f90b1b9287263ac58", size = 26708620, upload-time = "2026-07-22T01:48:00.2Z" }, - { url = "https://files.pythonhosted.org/packages/c4/c3/019ecbf3564d909c55fcf065592aff90b8b386d679e379caf356de4473f9/uv-0.11.31-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44ac79fca5807122676701279a1f36d7917a922f25a0ab5c5cf58a252f666e7e", size = 26894006, upload-time = "2026-07-22T01:48:04.929Z" }, - { url = "https://files.pythonhosted.org/packages/f6/9b/b67aa8736f9f82a9f99cec93c28d66d77ff42126914784a3f680bc737b56/uv-0.11.31-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:c4d4b34264017dc9047d0d49f09363a5e20b388481cddc39d5c44b16b3c2a57c", size = 25504398, upload-time = "2026-07-22T01:48:09.859Z" }, - { url = "https://files.pythonhosted.org/packages/44/d1/37e3a30f55e1c623fca484efbb80b6e157b922ee79f5cb7b1c0ff5005f0f/uv-0.11.31-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:9ce168c7323aee61ef07220c815f1b3e3a1b74241acb9f56c0b7fc4794dad600", size = 26307040, upload-time = "2026-07-22T01:48:14.555Z" }, - { url = "https://files.pythonhosted.org/packages/00/cc/f607ba28a93100c55b3e048838f85481f8b55a24e3a338e42c151f5884ae/uv-0.11.31-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:f3f8f58030ba4f711542d581b5fc3cde54db75a773fc873178f7b353f68f8711", size = 26425088, upload-time = "2026-07-22T01:48:19.204Z" }, - { url = "https://files.pythonhosted.org/packages/0d/ae/dd865e1d680799f05ff32895689700a23f37e905aac9807c93521fc76d8c/uv-0.11.31-py3-none-musllinux_1_1_i686.whl", hash = "sha256:b1384887f8a4a0b0dfb8c6c81b2f819d1771015a96c70f89ef12559df8206b28", size = 25920399, upload-time = "2026-07-22T01:48:23.866Z" }, - { url = "https://files.pythonhosted.org/packages/b8/0a/45ebfd783235a7a39ae1e99dc0bf26c083ea24a37584e530c7fbb6e38a21/uv-0.11.31-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:c6e052de498086b2014020536829b7e2b6f173ba95b07e55e9e0f85ac00a3927", size = 27126383, upload-time = "2026-07-22T01:48:28.376Z" }, - { url = "https://files.pythonhosted.org/packages/d9/c7/4cf78823c123efd3bdac50eb26f4b8fc2c222962d47918a7bb2b465b6522/uv-0.11.31-py3-none-win32.whl", hash = "sha256:03e18e463ecf0e1c347f901f9a8739059d07e2e2ebce72c0f8f1b9328a349c6f", size = 24644301, upload-time = "2026-07-22T01:48:33.094Z" }, - { url = "https://files.pythonhosted.org/packages/e1/4f/f2c3d0993ebab255a2dd7c476678c0307da03d890fb98761e8221d7bb043/uv-0.11.31-py3-none-win_amd64.whl", hash = "sha256:1a4bb0030d9070a4831a4f3115c5489998da7ca936e569a72696c90af469177a", size = 27699662, upload-time = "2026-07-22T01:48:37.708Z" }, - { url = "https://files.pythonhosted.org/packages/4e/8b/259e12b510c655f743f9a0e3171e6e9276dfd35a058d04d6aeef1fc4a897/uv-0.11.31-py3-none-win_arm64.whl", hash = "sha256:88ab5fdbeff4ab10ac890ab2dd01b7ad62b92251665423e4f68b1cf977fbe635", size = 25849721, upload-time = "2026-07-22T01:48:42.513Z" }, +version = "0.12.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a7/e7/5a94b658b08c46142cf7bf1d0c432cc7d04375b80f42765633414e7541bd/uv-0.12.0.tar.gz", hash = "sha256:80ba22cae467c6f47d2157ec2b840c032cac709b85ab1300ac4dcfeb29986462", size = 5827380, upload-time = "2026-07-28T18:57:12.191Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/e9/5663af6b4d90827c008005cfe7926a747688bd408226913d249b9de8492b/uv-0.12.0-py3-none-linux_armv6l.whl", hash = "sha256:11cc7ef5386fe54536cc8921676728a0e5c348cf522c8ee1fa0b81cbafc20cbc", size = 21499556, upload-time = "2026-07-28T18:56:27.552Z" }, + { url = "https://files.pythonhosted.org/packages/4b/8e/b88ae4a3b704f60f8e9dcdef78047c3749077b2f1e884bd387c8e41fe378/uv-0.12.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:074e693e9b2df99f621166b44760abe0d53cd9b0ae96fcbfec5809497925da87", size = 19751720, upload-time = "2026-07-28T18:56:30.623Z" }, + { url = "https://files.pythonhosted.org/packages/a5/7b/15d6865264120bd30c738b4bf63ddff66d087087cadeb2a6b88c6284a446/uv-0.12.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:009758d8fde2da2b90900f5fe863c71d0e1b8b28bbdba59863ceb967973a3735", size = 18117978, upload-time = "2026-07-28T18:56:32.904Z" }, + { url = "https://files.pythonhosted.org/packages/0e/bc/2066cc63e6930e3d5e27c73a9c439418164eafb4f1c24845f17caf63eaea/uv-0.12.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:effc2de9f044e880306f3c52b048bf24ee4fe63429c82dd6509c9a0f3d1b8f0b", size = 20833318, upload-time = "2026-07-28T18:56:35.567Z" }, + { url = "https://files.pythonhosted.org/packages/2d/d6/49fef7e4e3c401540113115846e47094aff7cda86f54ba79477636758e38/uv-0.12.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:e9e660171873f905a6782bf2a5e7515aba1a8e8a5cfce0add68fbe7a22ead8b0", size = 21056599, upload-time = "2026-07-28T18:56:38.117Z" }, + { url = "https://files.pythonhosted.org/packages/2e/b9/cc32f406b5429cbb0f0849938d12a24a33c3bd28b710c8ccd0955c588131/uv-0.12.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53c5c07fafcf620d23faa8f339742806d57cb82122c97544d0f3750f55e2fe36", size = 21100563, upload-time = "2026-07-28T18:56:40.305Z" }, + { url = "https://files.pythonhosted.org/packages/42/ff/36eef4c1624ed371d8367cf96207f35ba81b42b8308688d1acad835432cc/uv-0.12.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b80a1a89aad16c6d84dd96b0c795b44f3824f0765e815af2f93fd05cb4a894cd", size = 21763617, upload-time = "2026-07-28T18:56:42.59Z" }, + { url = "https://files.pythonhosted.org/packages/05/23/b82dbd945c5b8a88ed5dc8c2c001619677ad5aea246318716c773711aef9/uv-0.12.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a1e84987c4b4d832796b779ad614e91c1b44ac1ade5163c00654b70881ef53cb", size = 22917937, upload-time = "2026-07-28T18:56:45.546Z" }, + { url = "https://files.pythonhosted.org/packages/7b/d9/44f5f753fda99820b972251c3be9ca9e56d98f4ced752cea623f19479fa8/uv-0.12.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dbb9d9c40e91b6bf5e124230277fe5579ecf685e6de47e61a0eed8af5ffa0cdb", size = 22555435, upload-time = "2026-07-28T18:56:47.882Z" }, + { url = "https://files.pythonhosted.org/packages/4b/ba/bc14d74741b0292edd8e61e87a4bd96f79447a1b9d27e85cda2e8539039b/uv-0.12.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cbff74f884846d794713670faf8abe10db3bd70c43b01e63223f74eb7d958689", size = 21986958, upload-time = "2026-07-28T18:56:50.271Z" }, + { url = "https://files.pythonhosted.org/packages/1d/52/e14f0a91be4b426f18107f63b1b87e99ec671e8907689cf45144a79c4f76/uv-0.12.0-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:c818bb6aead39652e2ad644583fa418ac8d92baf50b4c6f685738bb2598e33bd", size = 20965849, upload-time = "2026-07-28T18:56:52.628Z" }, + { url = "https://files.pythonhosted.org/packages/0d/a6/ef7b436f9983c467b88bacb5ce58620398c7fe7fa86ee67906bfce343201/uv-0.12.0-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:5fe6cdc82cacc630827f2ec779b91b0d13ff57ff476e41bdcace05cd61261951", size = 21671684, upload-time = "2026-07-28T18:56:54.923Z" }, + { url = "https://files.pythonhosted.org/packages/9d/c8/19086d68078b514be4c266081e11d5530b07d099cb05d011e1fa6a216e10/uv-0.12.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:fcf4b6d0807f8f05a7dd8c090f080674e8526db27a0764af2a5a54ab5096c3eb", size = 21798247, upload-time = "2026-07-28T18:56:57.226Z" }, + { url = "https://files.pythonhosted.org/packages/4d/87/571847075bbe2205ec7ae108c17d01742a1251aea9fe5f9cd5da1496922e/uv-0.12.0-py3-none-musllinux_1_1_i686.whl", hash = "sha256:4be9870fca2952143f33a02347c8da603bbe645283e3e989f038ef7b306b3ecb", size = 20977006, upload-time = "2026-07-28T18:56:59.544Z" }, + { url = "https://files.pythonhosted.org/packages/be/df/d391bc0f5901ff8a0d6285eb433222cacb972b5e5817a420e084ee698894/uv-0.12.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:ed4053e07048ab3561de95c3b686b7983f997cd19d53a265a238103b5dbf258a", size = 22186132, upload-time = "2026-07-28T18:57:02.014Z" }, + { url = "https://files.pythonhosted.org/packages/9c/fe/d440d50811ef913cb035e4c5f346799d9353fd5a8aa8479e57d7efc34692/uv-0.12.0-py3-none-win32.whl", hash = "sha256:bef14df9bec1ee7577fdc5b37d02ad8128574a2eebc130c525255edac051b9a4", size = 19210613, upload-time = "2026-07-28T18:57:04.493Z" }, + { url = "https://files.pythonhosted.org/packages/cb/27/c3da5b9136925ea2bc9209f7cabbfae12fd191f778456ead0f2d6de446a7/uv-0.12.0-py3-none-win_amd64.whl", hash = "sha256:ffdfed09a23e67ef6facf1d4db978a3cd73a886674644131a11a933fd746904a", size = 20005960, upload-time = "2026-07-28T18:57:07.332Z" }, + { url = "https://files.pythonhosted.org/packages/9f/bc/d04df3b6c36be124cb99e7eab59db514ec528f2b5c5ac2ed9fec41fbdc71/uv-0.12.0-py3-none-win_arm64.whl", hash = "sha256:e3d748f526739110dd9e267ecca30604b64a5fe3344f903d348b5a3af1f0a90a", size = 18981523, upload-time = "2026-07-28T18:57:09.743Z" }, ] [[package]] @@ -3565,7 +3569,7 @@ dev = [ { name = "coverage", specifier = "==7.15.2" }, { name = "fsspec", specifier = ">=2023.10.0" }, { name = "griffe-inherited-docstrings", specifier = "==1.1.3" }, - { name = "hypothesis", specifier = "==6.160.0" }, + { name = "hypothesis", specifier = "==6.164.0" }, { name = "markdown-exec", extras = ["ansi"], specifier = "==1.12.3" }, { name = "mike", specifier = "==2.2.0" }, { name = "mkdocs", specifier = "==1.6.1" }, @@ -3591,7 +3595,7 @@ dev = [ { name = "tomlkit", specifier = "==0.15.1" }, { name = "towncrier", specifier = "==25.8.0" }, { name = "universal-pathlib" }, - { name = "uv", specifier = "==0.11.31" }, + { name = "uv", specifier = "==0.12.0" }, ] docs = [ { name = "astroid", specifier = "==4.1.2" }, @@ -3614,7 +3618,7 @@ remote-tests = [ { name = "botocore" }, { name = "coverage", specifier = "==7.15.2" }, { name = "fsspec", specifier = ">=2023.10.0" }, - { name = "hypothesis", specifier = "==6.160.0" }, + { name = "hypothesis", specifier = "==6.164.0" }, { name = "moto", extras = ["s3", "server"], specifier = "==5.2.2" }, { name = "numpydoc", specifier = "==1.10.0" }, { name = "obstore", specifier = ">=0.5.1" }, @@ -3628,11 +3632,11 @@ remote-tests = [ { name = "requests", specifier = "==2.34.2" }, { name = "s3fs", specifier = ">=2023.10.0" }, { name = "tomlkit", specifier = "==0.15.1" }, - { name = "uv", specifier = "==0.11.31" }, + { name = "uv", specifier = "==0.12.0" }, ] test = [ { name = "coverage", specifier = "==7.15.2" }, - { name = "hypothesis", specifier = "==6.160.0" }, + { name = "hypothesis", specifier = "==6.164.0" }, { name = "numpydoc", specifier = "==1.10.0" }, { name = "pytest", specifier = "==9.1.1" }, { name = "pytest-accept", specifier = "==0.3.0" }, @@ -3642,5 +3646,5 @@ test = [ { name = "pytest-cov", specifier = "==7.1.0" }, { name = "pytest-xdist", specifier = "==3.8.0" }, { name = "tomlkit", specifier = "==0.15.1" }, - { name = "uv", specifier = "==0.11.31" }, + { name = "uv", specifier = "==0.12.0" }, ] From f63e61d982df914032522ccee5e0b1492af1f7ab Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 12 Aug 2026 11:02:02 +0200 Subject: [PATCH 39/61] docs: add a page linking to the companion packages (#4247) * docs: add a page linking to the companion packages The zarr-metadata and zarr-indexing docs are already Read the Docs subprojects of zarr-python and resolve under /projects/, but nothing in the main docs pointed at them except two entries buried at the bottom of the API Reference nav, which linked to the standalone *.readthedocs.io domains rather than the /projects/ paths Read the Docs advertises as canonical. Add a top-level "Related Projects" page listing each companion package, surface it as a card on the landing page, repoint the API Reference nav entries at the canonical subproject URLs, and give each subproject a nav link back to the parent docs. The changelog fragment is named for the issue rather than the PR because the upstream PR number is not known yet; rename it to that number when this is opened upstream. Closes #4246 Assisted-by: ClaudeCode:claude-opus-5 * Rename 4246.doc.md to 4247.doc.md * docs: projects -> subprojects * docs: rewire docs references correctly --- changes/4247.doc.md | 5 +++++ docs/index.md | 8 +++++++ docs/subprojects.md | 35 +++++++++++++++++++++++++++++++ mkdocs.yml | 9 ++++++-- packages/zarr-indexing/mkdocs.yml | 3 +++ packages/zarr-metadata/mkdocs.yml | 3 +++ 6 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 changes/4247.doc.md create mode 100644 docs/subprojects.md diff --git a/changes/4247.doc.md b/changes/4247.doc.md new file mode 100644 index 0000000000..6dbca1d3d6 --- /dev/null +++ b/changes/4247.doc.md @@ -0,0 +1,5 @@ +Added a "Related Projects" page to the documentation listing the companion +packages developed in this repository — `zarr-metadata` and `zarr-indexing` — +and linked it from the landing page. Links to those packages now use the +canonical `https://zarr.readthedocs.io/projects/...` URLs, and each companion +package's documentation links back to the `zarr-python` docs. diff --git a/docs/index.md b/docs/index.md index ee4098a8ea..eb3b6a5000 100644 --- a/docs/index.md +++ b/docs/index.md @@ -58,6 +58,14 @@ conda install -c conda-forge zarr which parameters can be used. It assumes that you have an understanding of the key concepts. +- [:material-package-variant:{ .lg .middle } __Related projects__](subprojects.md) + + --- + + Companion packages developed in the zarr-python repository and released + independently, such as `zarr-metadata` and `zarr-indexing`, plus pointers to + the wider Zarr ecosystem. + - [:material-account-group:{ .lg .middle } __Contributor's Guide__](contributing.md) --- diff --git a/docs/subprojects.md b/docs/subprojects.md new file mode 100644 index 0000000000..1903f759d2 --- /dev/null +++ b/docs/subprojects.md @@ -0,0 +1,35 @@ +# Subprojects + +Alongside `zarr` itself, the +[zarr-python repository](https://github.com/zarr-developers/zarr-python) hosts a +small number of companion packages. Each one is developed in the same repository +but versioned, released, and documented independently, so you can depend on it +without taking on `zarr` as a dependency. + +
+ +- [:material-code-json:{ .lg .middle } __zarr-metadata__](https://zarr.readthedocs.io/projects/zarr-metadata/) + + --- + + Spec-defined metadata types, models, and validators for Zarr v2 and v3, with + minimal dependencies. Useful if your software reads or writes Zarr metadata + documents but does not need a full Zarr implementation. + + ```bash + pip install zarr-metadata + ``` + +- [:material-vector-polyline:{ .lg .middle } __zarr-indexing__](https://zarr.readthedocs.io/projects/zarr-indexing/) + + --- + + Composable, lazy coordinate transforms for Zarr array indexing. Makes the + mapping from requested coordinates to stored coordinates a first-class, + composable value, and resolves which chunks a selection touches. + + ```bash + pip install zarr-indexing + ``` + +
diff --git a/mkdocs.yml b/mkdocs.yml index 6a0d94052e..ca8165af4c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -33,6 +33,7 @@ nav: - user-guide/examples/rectilinear_chunks.md - user-guide/examples/codec_pipeline_performance.md - user-guide/examples/sharding_coalescing.md + - subprojects.md - API Reference: - api/zarr/index.md - ' zarr.abc': @@ -94,8 +95,12 @@ nav: - ' zarr.testing.utils': api/zarr/testing/utils.md - ' zarr.zeros': api/zarr/functions/zeros.md - ' zarr.zeros_like': api/zarr/functions/zeros_like.md - - 'zarr-metadata ↪': https://zarr-metadata.readthedocs.io/ - - 'zarr-indexing ↪': https://zarr-indexing.readthedocs.io/ + # The companion packages are Read the Docs subprojects of this one; link + # to the /projects/ paths Read the Docs advertises as canonical rather + # than to their standalone *.readthedocs.io domains, so following one + # keeps the reader on this site's domain. + - 'zarr-metadata ↪': https://zarr.readthedocs.io/projects/zarr-metadata/ + - 'zarr-indexing ↪': https://zarr.readthedocs.io/projects/zarr-indexing/ - release-notes.md - contributing.md - Blog: diff --git a/packages/zarr-indexing/mkdocs.yml b/packages/zarr-indexing/mkdocs.yml index d7261f32e1..43a5ea5b4c 100644 --- a/packages/zarr-indexing/mkdocs.yml +++ b/packages/zarr-indexing/mkdocs.yml @@ -26,6 +26,9 @@ nav: - ' zarr_indexing.messages': api/messages.md - ' zarr_indexing.errors': api/errors.md - Changelog: https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/CHANGELOG.md + # This site is a Read the Docs subproject of zarr-python; give readers a way + # back to the parent docs, which list every companion package. + - 'zarr-python ↪': https://zarr.readthedocs.io/ watch: - src diff --git a/packages/zarr-metadata/mkdocs.yml b/packages/zarr-metadata/mkdocs.yml index 6c4a590b3c..18e1fc8c35 100644 --- a/packages/zarr-metadata/mkdocs.yml +++ b/packages/zarr-metadata/mkdocs.yml @@ -25,6 +25,9 @@ nav: - ' zarr_metadata.v3.codec': api/v3/codec.md - ' zarr_metadata.v3.data_type': api/v3/data_type.md - Changelog: https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-metadata/CHANGELOG.md + # This site is a Read the Docs subproject of zarr-python; give readers a way + # back to the parent docs, which list every companion package. + - 'zarr-python ↪': https://zarr.readthedocs.io/ watch: - src From 5abdee22028cabe14da5c192a3d11d494a061451 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 12 Aug 2026 11:34:51 +0200 Subject: [PATCH 40/61] build(zarr-metadata): the sdist ships an allowlist, not whatever is lying around (#4248) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hatchling had no sdist configuration here either, so a source distribution carried everything in the package directory. Building from a working tree with scratch files in it put `.env.local`, a notebook and a `__scratch/` dump in the tarball. A tagged release builds from a fresh CI checkout and so was never actually at risk, but nothing made that a property of the package rather than of the runner. The list is derived from this package rather than copied from zarr-indexing, which needed `docs/snippets` and `examples/` because its suite executes them. Nothing here does: every fixture is a JSON file next to the test module that reads it, so `/tests` is the whole test dependency. `/docs` and `/mkdocs.yml` ride along because they are self-contained — mkdocstrings reads `src` and the config reaches nowhere outside the package — so the sdist documents itself as well as tests itself. `changes/` and `.readthedocs.yaml` are left out: towncrier fragments are repo bookkeeping, and the RTD config addresses paths from the repo root, where an unpacked sdist is not. Verified by unpacking the built sdist into a bare venv and working from there: 595 tests pass and `mkdocs build --strict` succeeds. Assisted-by: ClaudeCode:claude-opus-5 --- packages/zarr-metadata/pyproject.toml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/zarr-metadata/pyproject.toml b/packages/zarr-metadata/pyproject.toml index 1ef1c31624..0df3385dc7 100644 --- a/packages/zarr-metadata/pyproject.toml +++ b/packages/zarr-metadata/pyproject.toml @@ -71,6 +71,26 @@ raw-options = { root = "../..", git_describe_command = "git describe --dirty --t [tool.hatch.build.targets.wheel] packages = ["src/zarr_metadata"] +# An allowlist, so nothing that merely happens to sit in the package directory +# — a scratch script, a stray notebook — can ride along in a release. The list +# keeps an sdist self-testing and self-documenting: every fixture this suite +# reads is a JSON file sitting next to the test module that loads it, so +# `/tests` is the whole test dependency, and `/docs` plus `/mkdocs.yml` are a +# self-contained site (mkdocstrings reads `src`, nothing reaches outside the +# package) so `just docs-check` runs from an unpacked sdist too. `changes/` +# and `.readthedocs.yaml` are deliberately absent: towncrier fragments are +# repo bookkeeping, and the RTD config addresses paths from the repo root. +# `pyproject.toml`, `README.md` and `LICENSE.txt` are added by hatchling itself. +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", + "/docs", + "/mkdocs.yml", + "/justfile", + "/CHANGELOG.md", +] + [tool.ruff] extend = "../../pyproject.toml" target-version = "py311" From 0f7c883ad2509d017e54097874ce4d62609157eb Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 12 Aug 2026 12:11:13 +0200 Subject: [PATCH 41/61] HTTP server that exposes stores, arrays, groups (#3732) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * implement store server and node server * update tests and add v2 -> v3 example * add __all__ and clean up tests * add docs and changelog * add proper server * rework examples (simplify) and make server a context manager * minor tweaks to server * fix: byte-order handling for structured dtypes in the bytes codec (#220) * fix: byte-order handling for structured dtypes in the bytes codec The bytes codec neither byte-swapped structured-dtype fields to its configured endian on encode (numpy reports byteorder '|' for void dtypes, so the top-level byteorder comparison never detected a mismatch) nor honored its endian when decoding, silently corrupting any structured data whose field byte order differed from the stored one (e.g. virtual references to external big-endian data). Encode now detects byte-order mismatches by comparing full dtypes via newbyteorder, and decode reinterprets raw bytes in the stored byte order before converting to the data type's declared byte order, so the stored layout (codec state) and the in-memory layout (array data type) are independent. Closes #4141 Assisted-by: ClaudeCode:claude-fable-5 * test: fold structured byte-order cases into existing bytes codec tests Extend test_endian's parametrization with structured dtypes and test_bytes_codec_sync_roundtrip with endian/dtype parametrization plus stored-layout and decoded-dtype assertions, instead of adding parallel test functions for the same properties. Assisted-by: ClaudeCode:claude-fable-5 * refactor: rename stored_dtype to view_dtype in BytesCodec decode The variable is the dtype used to view the raw chunk bytes (byte order from the codec's endian configuration), not a property of the stored data or of the returned buffer, which always carries the array's declared dtype. Assisted-by: ClaudeCode:claude-fable-5 * docs: note that the decode-side byte-order conversion copies the chunk Assisted-by: ClaudeCode:claude-fable-5 * fix: adapt server branch to current starlette/uvicorn starlette 1.3 deprecated using httpx with its TestClient, which the warnings-as-errors filter turns into a collection error; add httpx2 to the test dependency group. uvicorn 0.51 removed Server.install_signal_handlers and now skips signal-handler setup off the main thread natively, so drop the monkey-patch workaround. Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-server): scaffold packages/zarr-server Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-server): move server code, tests, and example into the package The moved code now uses only public zarr API: zarr.buffer.cpu replaces zarr.core.buffer.cpu, spec-defined key names are inlined, chunk-key encodings are duck-typed on their spec names, and the shard grid shape is computed locally from public Array attributes. Also mirrors the root repo's [tool.numpydoc_validation] override in the package's pyproject.toml, since numpydoc-validation resolves config from the nearest pyproject.toml and would otherwise apply its stricter default checks to the moved docstrings. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-server): package README; retarget root changelog fragment at the core fix Assisted-by: ClaudeCode:claude-fable-5 * refactor!: remove the HTTP server from zarr core The server now lives in packages/zarr-server (published as zarr-server). The feature never shipped in a zarr release, so there is no deprecation shim. The decode_chunk_key strictness fix stays in zarr core. Assisted-by: ClaudeCode:claude-fable-5 * ci(zarr-server): add package test and release workflows Assisted-by: ClaudeCode:claude-fable-5 * chore(zarr-server): refresh package lockfile after root server-extra removal The package lock embeds the workspace-root zarr project's metadata; Task 4 removed the root server extra and httpx2 test dep after this lock was first generated. Assisted-by: ClaudeCode:claude-fable-5 * fix: reject path-traversal segments in zarr-server request handling store_app (and thus serve_store) passed the request path straight to the store without validation, since the is_valid_node_key gate only ran for node_app. Starlette percent-decodes path params, so a request like GET /..%2fsecret.txt arrived as literal ".." and LocalStore resolved it outside the store root, allowing arbitrary file read via GET and arbitrary file write via PUT. Closes this path-traversal vulnerability by rejecting any "." or ".." path segment in _handle_request before the store is touched, for both store_app and node_app. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-server): close absolute-key path-traversal bypass in request guard The path-traversal guard in _handle_request only rejected "." and ".." segments. A percent-encoded leading slash (e.g. "/%2fetc%2fhostname") decodes to an absolute path param ("/etc/hostname"), whose split() produces an empty leading segment with no "." or ".." segment, so the guard let it through. LocalStore resolves an absolute key by discarding its configured root, allowing arbitrary filesystem read/write outside the store. Reject empty segments too, closing the bypass. Assisted-by: ClaudeCode:claude-fable-5 * ci(zarr-server): bump actions/attest to v4.2.0 to match sibling workflow Keeps the zarr-server release workflow's pinned action SHAs in sync with the dependabot bump that landed in zarr-metadata-release.yml via the merge. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-server): fold backslash separators and reject drive-qualified keys The traversal guard in _handle_request split only on "/", so backslash- separated segments like "..\\..\\win.ini" and drive-qualified or UNC-rooted keys like "C:/Windows/win.ini" or "\\host\share\x" passed through untouched. On Windows, LocalStore joins keys onto its root via pathlib, which discards the root entirely for a drive-qualified or rooted key -- turning percent-encoded backslash paths into arbitrary file read/write. Fold backslashes to "/" before the segment check (mirroring zarr's own normalize_path) and add an ntpath.splitdrive check to catch drive letters and UNC prefixes that don't produce empty/"."/".." segments. Added TDD coverage that fails against the old guard (via a store double that raises if get/set is ever called) and passes against the fix. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-server): fix vacuous two-level traversal test The `/..%2f..%2fsecret.txt` case in test_encoded_traversal_variants_ return_404 climbed two levels from tmp_path/store_root to tmp_path/.., but the secret was written at tmp_path/secret.txt (one level up) -- so the case passed for the wrong reason (no such file, not "guard blocked it") even with the traversal guard deleted entirely. Nest the store root exactly `climb_depth` directories below tmp_path per case, so every case's ".." segments resolve to tmp_path/secret.txt. Verified by mutation: copied _serve.py to a scratch dir (never the repo), deleted the guard body, and ran TestPathTraversalProtection against it via PYTHONPATH. Before this fix, 12/13 traversal tests failed against the mutant (1 false pass -- this vacuous case). After this fix, 13/13 fail against the mutant, and all still pass against the real guard. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-server): bound BackgroundServer shutdown instead of blocking forever shutdown() joined the server thread with no timeout, and uvicorn's graceful wait is itself unbounded: force_exit is only set by a signal handler uvicorn deliberately skips off the main thread. A client mid request could wedge __exit__ unrecoverably. Bound uvicorn's graceful wait with timeout_graceful_shutdown and fall back to force_exit if the thread outlives it, both driven by a new shutdown_timeout parameter on serve_store/serve_node. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-server)!: only accept HTTP methods the handler implements _handle_request special-cased PUT and let every other verb fall through to the read path, so a server built with DELETE/POST/PATCH answered them with the key's contents and changed nothing. HTTPMethod advertised all of them. Narrow HTTPMethod to GET/PUT/HEAD and reject anything else when the app is built. Doing this before the first release avoids narrowing a published type later. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-server): document client deps; lint the package's changelog in CI The README's round-trip example reads back through FsspecStore, which needs an HTTP-capable fsspec that zarr-server does not depend on, so a clean install failed on the PyPI landing page's headline snippet. Same for examples/serve.py under a plain interpreter, which needs httpx. check_changelogs.yml also never visited packages/zarr-server/changes, so a malformed fragment would have passed PR CI and failed at release time. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-server): add docs dependency group and cover the README round-trip Reading a served array back with zarr.open_array(url) routes through FsspecStore -- zarr's only URL-string backend -- so the README's headline example needs an HTTP-capable fsspec that the package itself has no reason to depend on. Carry that in a docs group, mirroring the root project's group for running examples, and use it to test the round-trip in CI so the example cannot rot. Assisted-by: ClaudeCode:claude-fable-5 * refactor(zarr-http-server)!: rename zarr-server to zarr-http-server The package is HTTP-specific end to end -- Starlette/ASGI, byte-range headers, CORS, HTTP verbs -- so the unqualified name overclaimed its scope and squatted the generic name that a future transport (an S3-compatible or WebDAV frontend) would want. Renames the distribution, the zarr_http_server module, the package directory, the zarr_http_server-v* release tags, both workflows and their artifact and PyPI environment names. Nothing is published yet, so this costs nothing now and would be permanent after the first upload. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-http-server): reject an empty methods set instead of failing open Starlette's Route treats a falsy `methods` as "match every method", and an empty set passes the unsupported-verb check trivially, so store_app(store, methods=set()) served GET, DELETE, POST, PATCH and TRACE alike and accepted PUT writes -- the opposite of what the caller asked for, and the same fail-open the method narrowing set out to close. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-http-server): report the bound port, unblock the loop, 404 unopenable children Three defects the adversarial re-review reproduced: BackgroundServer reported the requested port, so port=0 produced http://host:0 while the socket was bound elsewhere -- clients following the documented url reached an unrelated service. Group key validation opened children through zarr's synchronous API directly on the event loop, serializing every concurrent request behind it (20 concurrent requests: 10.5s, now 1.1s) and outlasting the shutdown timeout. Move it to a worker thread. Child lookup caught only KeyError, so a corrupt metadata document or a codec from an uninstalled plugin surfaced as 500 and made a whole subtree unservable during ordinary operation. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-http-server): close the S5-S13 follow-ups from the adversarial review Hostile keys the store cannot express (embedded NUL, over-long names) now answer 404 instead of surfacing ValueError/OSError as a 500. PUT bodies are capped at DEFAULT_MAX_BODY_SIZE and answer 413 past it; Store.set takes a whole Buffer, so a body cannot be streamed and one request would otherwise size the server's memory. 206 responses carry Content-Range, and a range beyond the end or an inverted one answers 416 rather than an empty 206. A 0-d v2 array's sole chunk, stored under "0", is now servable: the key decodes to a 1-tuple no 0-d grid could match, so it needs the array's dimensionality to disambiguate. Array and group metadata key sets are split, so a v2 group no longer claims .zarray as its own; bind failures report the likely cause instead of a bare timeout; and serve_* gain a background: bool overload. The two out-of-bounds chunk tests planted no data, so they passed for the wrong reason -- mutating the bounds check to return True left the suite green. They now plant data at the out-of-grid key, and that mutation fails 3 tests. Adds the missing coverage for this branch's one core change, and widens the workflow's path filter to src/zarr, since the package resolves zarr from the repo root and a core change can break it. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-http-server): stop reporting I/O failures as misses; enforce the body cap while reading The round-3 review found the previous round's error handling was too broad and its body cap too narrow. except (ValueError, OSError) around store.get and store.set caught the whole errno family, so EACCES, EROFS and ENOSPC all answered 404. Under the v3 spec an absent chunk is an uninitialized one and a reader is right to substitute the array's fill value, so 404 asserts something about the store's contents: an unreadable chunk answered that way has a correct client silently materialize fill values over data that exists, and a failed write looks like a pointless one rather than a failure. Only ENAMETOOLONG and EINVAL now mean "this key names nothing"; everything else surfaces. NUL bytes are rejected in the guard instead, so the store's own errors always mean real I/O trouble. max_body_size only consulted Content-Length, which a chunked request does not send, so request.body() buffered the whole thing before the check: 256 MiB passed a 1 KiB cap at 572 MiB peak RSS. The body is now read incrementally and abandoned at the cap -- the same attack peaks at 59 MiB. Also: a range too wide to allocate answers 416 rather than raising MemoryError; the force_exit fallback join is bounded, so shutdown cannot outlast its timeout; DEFAULT_MAX_BODY_SIZE is importable, since it is the documented default of three public functions; and _make_starlette_app loses a parameter it never read. Adds the coverage the review found missing: shard-grid bounds (the mutant served an out-of-grid shard key against a green suite), wrong-arity chunk keys, the chunked body path, I/O failures as 5xx, and a parser-level assertion for inverted ranges, which the status code alone could not distinguish on a MemoryStore. The drive-letter check stays unconditional. It over-rejects a first-segment node name like a:b, which is legal on POSIX -- but ntpath treats any single character before a colon as a drive, so there is no safe subset, and the guard is a string gate in front of an arbitrary Store whose path semantics this package cannot know. Assisted-by: ClaudeCode:claude-fable-5 * fix(ci): silence BLE001 on two intentional broad excepts ruff 0.16 selects BLE001 under the root config's `B` prefix, so the package's `uvx ruff check .` job failed on two deliberate blind excepts. Both are intentional and already documented, so they get targeted noqa comments, matching how #4213 handled the same rule in the core tree. Assisted-by: ClaudeCode:claude-opus-5 * chore: drop stale changelog fragment for the chunk key fix The DefaultChunkKeyEncoding.decode_chunk_key fix this fragment described was split out into #4219 and has already shipped -- its text is in docs/release-notes.md verbatim. Leaving the fragment here would emit the same paragraph a second time under a #3732 link, for a change this branch no longer contains. Assisted-by: ClaudeCode:claude-opus-5 * ci: check zarr-http-server changelogs and align action pins check_changelogs.yml validated the root, zarr-metadata and zarr-indexing changes/ directories but not zarr-http-server's, so the new package's fragments were the only ones whose filenames went unchecked. The two new workflows were also written before #4241 bumped the actions group, so they pinned older checkout/setup-uv/attest/pypi-publish SHAs than their siblings. Bump them to the versions main already uses; the release workflow is now identical to zarr-metadata's modulo the package name. Assisted-by: ClaudeCode:claude-opus-5 * docs(http-server): add justfile and Read the Docs scaffold Brings the package in line with zarr-metadata and zarr-indexing, which each own a justfile and a separate Read the Docs site. The docs content is a scaffold -- an overview page and an API reference over the public namespace -- meant to be filled in later; the point is to get the site wired up and building under --strict now. The `docs` dependency group previously held the runtime deps for the README examples, but Read the Docs and `just docs-check` both expect it to carry the mkdocs toolchain, as it does in the sibling packages. Those example deps move to a new `examples` group and the test job follows. CI gains a `docs` job matching the siblings', so a scaffold that stops building fails the gate. The repo-root .readthedocs.yaml skips PR builds confined to this package now that it has its own site, and the root docs nav links out to it. Creating the Read the Docs project itself is a manual step: point its configuration-file path at packages/zarr-http-server/.readthedocs.yaml. Assisted-by: ClaudeCode:claude-opus-5 * fix(http-server): correct silent-corruption and HTTP-conformance defects Two of these answered a request successfully while leaving the client with data that does not exist. Chunk keys were validated by decoding coordinates and bounds-checking them, never by re-encoding. `int` is lenient in ways a store key is not -- leading zeros, a leading `+`/`-`, surrounding whitespace, underscore separators, non-ASCII decimal digits -- so `c/00/00` decoded to (0, 0) and validated, then went to the store verbatim. A PUT answered 204 and stored the body under a key no reader looks up: success reported, data invisible. Validation now requires the key to equal `metadata.encode_chunk_key(coords)`, which makes the accepted set exactly the set zarr can read. Decoding delegates to the encoding's own decoder rather than reimplementing the default/v2 grammars, so a new or third-party chunk key encoding works without changes here. Resolving a group child caught bare `Exception` and returned False, which turned an unreadable child -- EACCES, EIO, a corrupt metadata document, a missing codec plugin -- into 404. Under the v3 spec an absent chunk is an uninitialized one, so a correct reader answers that 404 by substituting the fill value over data that exists. Only KeyError is caught now; a key that could not be judged surfaces as 5xx rather than being reported absent. The rest are conformance fixes on the same request path: - A Range header the server cannot use is now ignored with a 200 rather than refused with a 416, per RFC 9110 §14.2. This covers an unrecognized unit and a multi-range request, both legal to send. - A suffix range resolves against the object's size, so a 206 always carries the Content-Range that RFC 9110 §15.3.7 requires. Sharding reads a shard index this way, so the header was missing on a hot path. - A last-byte-pos wider than the store can materialize is clamped to the end of the object per §14.1.2 instead of raising out of the store as a 500. - A byte position is parsed as 1*DIGIT rather than by `int`, which accepted `+0`, ` 0` and `0_0`. - PUT to a read-only store answers 403 instead of letting the store's ValueError surface as a 500. Assisted-by: ClaudeCode:claude-opus-5 * test(http-server): property tests over a real endpoint Adds hypothesis properties that drive a real uvicorn server over a socket, so the assertions cover what only exists on the wire: header parsing, method dispatch, status codes. Each property checks the response *and* the backing store. That pairing is what the previous suite could not do: a PUT to a non-canonical chunk key answered 204 and wrote a key no reader consults, which a response-only assertion cannot see. Refused requests assert the store is byte-for-byte unchanged; accepted writes assert the bytes landed under the key the client named and that a zarr client reads back the values. Keys are generated in two families -- in-band (the node's metadata and the canonical spelling of each chunk key in its grid) and out-of-band (non-canonical spellings, out-of-grid coordinates, traversal probes, a sibling node's keys). Two details worth keeping: - Traversal probes are percent-encoded. An HTTP client resolves dot-segments before sending, so httpx turns "../secret" into "/secret" and a literal probe asserts nothing; encoded, it reaches the server and Starlette decodes it back into a real ".." segment. - The matrix includes LocalStore, not just MemoryStore. MemoryStore slices a `bytes` and accepts any range bound, so it cannot distinguish a clamped over-wide range from a refused one -- mutation-testing the suite showed that property passing against deliberately broken code until a filesystem-backed server was added. Verified by reverting each fix in turn and confirming the corresponding property fails. Assisted-by: ClaudeCode:claude-opus-5 * fix(http-server): stop reading EINVAL from a store as a missing key `_names_nothing` reclassified two errnos as absence so a client could not turn a freely chosen key into a 5xx. `ENAMETOOLONG` earns that: it is the store answering about the name -- nothing can be stored under a name it cannot express -- and `encode_chunk_key` never produces a segment near a filesystem's length limit, so it is unreachable for real data. `EINVAL` does not. It is POSIX's catch-all, reachable on a perfectly ordinary short key through a bad seek or an unsupported filesystem feature, and under the v3 spec an absent chunk is an uninitialized one -- so answering 404 has a correct reader write fill values over a chunk that exists but could not be read. That is the same defect already fixed in the group-child lookup and in chunk key validation: reporting "something went wrong" as "it is not there". Nothing exercised EINVAL in practice. A NUL in a key raises ValueError and is rejected before the store anyway, and an over-long key raises ENAMETOOLONG, so this narrows the guard to the case that was doing the work. The traversal, absolute-key and drive-letter guards deliberately stay where they are rather than deferring to the store. LocalStore.get/set are `self.root / key` with no validation -- zarr's normalize_path applies at the StorePath layer, not to raw store keys -- so `../sibling.txt` and an absolute key both write outside the store root. This server is the component that feeds a Store unvalidated strings from the network, so it is the component that has to reject them. Assisted-by: ClaudeCode:claude-opus-5 * feat(http-server): stop sealing over CORSMiddleware and uvicorn.Config Wrapping an API means taking responsibility for its parameters, not hiding the ones we did not think to name. Two wrappers were doing the latter. `CorsOptions` carried 2 of `CORSMiddleware`'s 8 parameters, so `allow_headers`, `allow_credentials`, `allow_origin_regex`, `allow_private_network`, `expose_headers` and `max_age` were unreachable without bypassing this package. It now mirrors the full signature, with every key optional. Two of the defaults are ours rather than Starlette's, because the server knows what its caller should not have to. It emits `Content-Range` on every ranged response, which is not a CORS-safelisted response header, so `expose_headers` defaults to `["Content-Range"]` -- without it a browser client could read the bytes but not learn which bytes it got, which made the suffix-range Content-Range fix invisible to exactly the clients CORS exists for. It accepts a `Range` request header, so `allow_headers` defaults to `["Range"]`; Starlette's empty default answered a preflight naming Range with 400. Defaults apply only to absent keys, so an explicit `expose_headers: []` means "expose nothing". `_start_server` passed 4 of `uvicorn.Config`'s 52 parameters, which put TLS, `proxy_headers`/`forwarded_allow_ips`, `root_path`, `log_level`, `limit_concurrency` and unix-socket binds out of reach entirely. A `uvicorn_options: Mapping[str, object] | None` is merged over the three options set here, so a caller key wins. uvicorn ships no TypedDict for Config -- its only TypedDicts are ASGI protocol events -- so the mapping is hand-typed and the cast is confined to the call site. Un-sealing uvicorn makes two BackgroundServer attributes reachable that could previously only be one thing. `url` now reports the scheme actually in use, so configuring TLS yields https, and `host`/`port`/`url` are None for a uds or fd bind rather than naming an address nothing is listening on. Assisted-by: ClaudeCode:claude-opus-5 * fix(http-server): lifecycle, HEAD cost, and CORS/route method agreement Clears the findings left open from the review. Lifecycle. `_start_server` raised on its startup timeout without ever signalling the server, so the thread went on to bind the port and serve forever as a daemon with no handle to stop it -- and a retry on the same port then failed with the other error. It now sets should_exit and force_exit and joins before raising. `shutdown()` returned normally when the thread survived both joins, reporting success for a server still bound and still serving; it now raises. The first join also matched uvicorn's own `timeout_graceful_shutdown` exactly, and uvicorn spends ~0.2s tearing down before that wait even begins, so the join always expired first and escalated to force_exit on the orderly path -- which makes uvicorn skip ASGI lifespan shutdown. The join now outlasts the graceful bound by a margin, and reads that bound from the config so it stays correct when a caller sets it through uvicorn_options. HEAD. A HEAD body is discarded at the wire, but HEAD fell through to the GET handler, so answering one transferred the whole value: measured at 10 MB read to report a length. It is now answered from `Store.getsize` -- a stat on a filesystem store, an info call on a remote one -- and reads zero bytes. HEAD is served whenever GET is, which is what Starlette does and what RFC 9110 asks of an origin server; the README and docstrings said otherwise and now say so. CORS. `cors_options["allow_methods"]` was passed through unchecked, so an app could advertise methods its route rejects: a browser caches that preflight and every later cross-origin call fails with 405 after a successful handshake. Advertising an unserved method is now a ValueError at construction, consistent with how unsupported `methods` are already rejected, and `"*"` expands to what is actually served rather than to every verb Starlette knows. An absent `allow_methods` is left alone -- widening it to everything served would newly advertise PUT cross-origin on a write-enabled app that never asked for it. Media type. The JSON content type was keyed off a third hardcoded "zarr.json", so a v2 array's `.zarray` was served as octet-stream. It is now derived from the same tables that decide which keys a node owns. Also documents that `store_app` does not validate keys: it proxies the raw key space and has no array semantics to check against, so a client that misspells a chunk key gets a successful write to a key no reader consults. `node_app` rejects that with 404. Assisted-by: ClaudeCode:claude-opus-5 * ci(http-server): run the justfile's recipes instead of copies of them The workflow repeated the commands the justfile already defines -- `uvx ruff check .` and the mypy invocation were byte-identical copies, and the pytest step differed only by the sync that precedes it. Two definitions of the same verb drift silently: renaming the `docs` dependency group to `examples` required the same edit in both places, and updating only one would have left `just check` and CI testing different things with nothing failing. CI now calls `just test`, `just lint` and `just typecheck` (it already called `just docs-check`), keeping the python matrix and caching, which are genuinely CI's concern. This matches zarr-metadata, whose workflow already states the arrangement; zarr-indexing remains half-converted. Delegating also meant fixing what the shared recipe would otherwise spread: `just lint` ran an unpinned `uvx ruff`, which is precisely how this job broke before -- ruff 0.16 began selecting BLE001 under the root config's `B` prefix and failed on rules the pre-commit-pinned ruff never enforced, with no code change to blame. The recipe now pins the same version .pre-commit-config.yaml does, so the local gate, the pre-commit gate and CI enforce one standard. Assisted-by: ClaudeCode:claude-opus-5 * ci: build the zarr-http-server docs on pre-push A dead cross-reference or a nav entry pointing at a removed file only fails at `mkdocs build --strict`, which until now happened first in CI. This catches it before the code leaves the machine. Scoped deliberately. `stages: [pre-push]` overrides the repo default of running on every commit: this builds the whole site, which is too slow to pay per commit and is only actionable before pushing. `files:` limits it to changes that touch the package, and `pass_filenames: false` because mkdocs builds a site rather than a list of files. It delegates to `just docs-check` so the build has one definition shared with CI, and is added to `ci.skip` alongside mypy for the same reason that one is skipped: pre-commit.ci's runners have neither `uv` nor the repo checkout needed to resolve the environment. The zarr-http-server workflow covers it there. Note this hook and CI still declare their toolchains separately -- the hook shells out to the local `just`/`uv`, CI installs them itself. That is inherent to pre-commit.ci not being able to run them, and is the same trade already accepted for mypy. Also refreshes packages/zarr-http-server/uv.lock, which references the root project's dependency groups, for the hypothesis and uv bumps that arrived with the main merge. Assisted-by: ClaudeCode:claude-opus-5 * feat(http-server): make the read-only guarantee explicit and enforced Read-only was already the default -- `store_app(store)` answers 405 to PUT, POST, DELETE and PATCH, and POST is unconfigurable because there is no handler behavior for it -- but nothing said so and little pinned it. Only PUT was covered against the default app; POST, DELETE and PATCH were covered only against a fixture built with writes enabled, so "the default app is read-only" was not actually a tested claim. Adds a test class covering both layers the guarantee rests on: `methods`, which decides what the route answers, and the store, which decides whether a write could succeed at all. Each refusal also asserts the value is unchanged, matching the property tests -- a 405 that still wrote would otherwise pass. Serving PUT from a read-only store is now a ValueError at construction. A store's `read_only` is fixed when it is built, so that combination can never succeed; it previously surfaced as a 403 to whichever client tried to write first, long after whoever misconfigured it had moved on. The handler's 403 stays as a backstop for a store whose read_only is not fixed, and the test for it builds the app through the private builder since the public entry points now reject the combination. Documents `store.with_read_only(True)` as the categorical recipe: it is the stronger of the two layers because it holds even if the HTTP layer is misconfigured. Assisted-by: ClaudeCode:claude-opus-5 * feat(http-server): name the read-only and read-write method sets `READ_ONLY_METHODS` and `READ_WRITE_METHODS` let a call site say which it is, rather than leaving that to the presence or absence of an argument. The read-only one is exactly the default, so passing it changes nothing except that the intent is written down. The value is the other direction: a writable app must name a method set, so `grep -r 'methods='` finds every place that opts into writes -- which is what makes a deployment auditable without a separate read-only entry point. Both are frozensets, so one caller cannot widen the default for every other, and both name HEAD explicitly: Starlette serves it wherever GET goes, and a constant that omitted it would misdescribe the route. `methods` now accepts any `AbstractSet`, which is what lets a frozenset constant be passed where a `set` was previously required. Assisted-by: ClaudeCode:claude-opus-5 * feat(http-server): model read-only methods in the type domain Renames the constants to READ_ONLY_HTTP_METHODS / READ_WRITE_HTTP_METHODS so they say what kind of method they hold, matching the HTTPMethod type they are drawn from. Adds `ReadOnlyHTTPMethod = Literal["GET", "HEAD"]`, which moves the distinction from a runtime convention to something a checker enforces: a `frozenset[ReadOnlyHTTPMethod]` cannot contain "PUT", so a read-only interface can be declared rather than merely configured. Verified against mypy --strict -- assigning either a set containing "PUT" or READ_WRITE_HTTP_METHODS to that annotation is an error, while READ_ONLY_HTTP_METHODS is accepted. HTTPMethod is now the union of that and a private `_WriteHTTPMethod` rather than a third hand-written list of the same strings, and both constants plus _SUPPORTED_METHODS are derived from the Literals via get_args. The runtime sets and the static types therefore cannot disagree about what this server serves: widening a Literal is the only edit needed, and a test pins the contents so that widening is deliberate. Assisted-by: ClaudeCode:claude-opus-5 * docs(http-server): add a notebook example, and run both examples in tests The only example used `with serve_node(...)`, which is the one form that cannot work in a notebook: it shuts the server down when the cell ends, so anyone copying it gets a dead server by the next cell. Nothing in the package mentioned notebooks at all. Adds examples/serve_notebook.ipynb covering the lifecycle a kernel needs -- start with background=True and keep the handle, use it across cells, then shutdown() -- plus metadata and chunk reads, a byte range, and a refused PUT. Two arguments carry it: background=True runs uvicorn in a daemon thread with its own loop so the kernel's loop is untouched, and port=0 means re-running a start cell picks a new port instead of failing with "address already in use". A README section says the same in prose. The notebook is executed by the suite through nbclient, in a real kernel, and asserts its own expectations, so a behavior change fails there rather than in someone's notebook. Verified by mutation: making writes the default breaks the notebook's `assert refused.status_code == 405` and surfaces as a CellExecutionError naming the cell. examples/serve.py is now executed too, which required fixing the same fixed-port footgun the notebook section warns about -- it bound 8000, so it failed if anything else held that port. It runs in-process rather than under `uv run`, because its inline script metadata resolves zarr-http-server from git and would test main instead of the working tree. Assisted-by: ClaudeCode:claude-opus-5 * feat(http-server): expose serve() for arbitrary ASGI apps Serving two nodes did not need two servers, but the only way to run several was to reach past this package: `serve_store`/`serve_node` each take exactly one store or node, so a composed app had no route to the background-server ergonomics -- `port=0` into `server.url`, and `shutdown()` -- only a blocking `uvicorn.run`. `_start_server` already did this for any Starlette app; it was just private. `serve(app, ...)` makes it public, with the same background/blocking overloads the shorthands have. `serve_store` and `serve_node` now delegate to it and stay, because they are the common case and are what the docs and examples use; retiring them is still available later. The split the pair muddles is now visible: what an app *serves* (`methods`, `cors_options`, `max_body_size`) is settled when the app is built, and `serve` only decides how it runs. Documents the three ways to serve several nodes -- serve their common parent group, serve the whole store, or mount separate apps and run the result -- with tests covering mounted nodes in *separate* stores, that each mount serves only its own data, and that `serve` runs the composed app in the background. Also derives the bounded-shutdown test's threshold from the timeouts that produce it. It hard-coded 3.0s, which was generous when shutdown could take at most 2x shutdown_timeout and marginal once the join margin was added -- it began failing under load rather than at the moment the constant changed. Assisted-by: ClaudeCode:claude-opus-5 * refactor(http-server)!: split blocking and background into two functions `background: bool` decided whether a call returns immediately with a handle or never returns at all -- the largest difference a call site can have, hidden in a keyword. The return type depended on it too, which is why every runner carried three @overload stanzas: nine in total, all of them working around that one flag, and `background=False` returned None, a value meaningless half the time. `serve(app)` now blocks and `serve_background(app)` returns a BackgroundServer. Neither needs an overload. Splitting forced the shorthand question, since the axes multiply: keeping serve_store/serve_node alongside two modes means six runner functions. The public surface is instead two builders and two runners -- `serve_background(store_app(store))` replaces `serve_store(store, background=True)`. That is one more call, and it puts the two halves where they belong: what an app serves is settled when it is built, and the runner only decides how it runs. _serve.py drops from 1301 to ~1100 lines with the duplicated signatures and docstrings gone. `serve_background` defaults to `port=0` where `serve` defaults to 8000. Deliberate: a background server is reached through `server.url`, and a fixed default makes starting a second one -- or re-running a notebook cell -- fail on a collision, while a blocking server usually wants a port others already know. BREAKING CHANGE: serve_store and serve_node are removed. The package is unreleased, so nothing depends on them yet. Assisted-by: ClaudeCode:claude-opus-5 * feat(http-server): default both runners to port="auto" `serve` defaulted to 8000 and `serve_background` to 0, which read as an arbitrary disagreement between two sibling functions about a shared parameter. Both now default to `"auto"`: prefer 8000, fall back to any free port if it is taken, and report the result through `server.url` and uvicorn's own startup line. What makes the fallback safe is that it applies only to the default. An explicit port still binds exactly that or fails, because a caller who names one usually has a proxy or a container port mapping expecting the server there -- silently moving would break it while looking healthy. `port=0` keeps its OS meaning of "any free port, no preference". The port is bound here and the socket handed to `Server.run(sockets=...)` rather than probing for a free port and passing uvicorn the number: probing releases the port before uvicorn claims it, which is the bind-then-close race that makes "find a free port" helpers flaky. Holding the socket means nothing can take it in between. `Config.port` is set to what was actually bound, so uvicorn's "running on ..." line does not name a port it is not serving. Two cases the mechanism has to respect: a `uds` or `fd` bind in uvicorn_options skips the TCP bind entirely, and the address family comes from `getaddrinfo` rather than a hard-coded AF_INET, which would bind the wrong family for an IPv6 host. Both are covered by tests, as is that an explicit taken port still raises. Assisted-by: ClaudeCode:claude-opus-5 * revert: drop changes to files this package does not own The PR should not reach outside packages/zarr-http-server and .github, and four files did. Two were unrelated churn: docs/api/zarr/experimental.md renamed a heading in the *core* zarr docs about zarr.experimental.cache_store, left over from when this server lived at zarr.experimental.serve, and uv.lock carried an idna bump nothing here asked for. Reverted; `uv lock --check` is clean. Two were premature rather than wrong. mkdocs.yml added a nav link to zarr-http-server.readthedocs.io and .readthedocs.yaml skipped the repo-root docs build for changes confined to this package. Both belong with a Read the Docs project that does not exist yet -- until it does, the nav link 404s and the build skip means neither site builds the package's docs. mkdocs.yml is also what GitHub reported a conflict on, which is what surfaced this. They should land in the follow-up that creates the RTD project. What remains outside the package is two root files that have nowhere else to live: the pre-push docs hook, since a pre-commit hook is necessarily repo-level, and a comment-only change to pyproject.toml noting that the release workflow's `zarr_http_server-v*` tags are among those the `git describe --match v*` filter exists to exclude. Assisted-by: ClaudeCode:claude-opus-5 --- .github/workflows/check_changelogs.yml | 3 + .../workflows/zarr-http-server-release.yml | 117 + .github/workflows/zarr-http-server.yml | 139 ++ .pre-commit-config.yaml | 31 +- packages/zarr-http-server/.readthedocs.yaml | 30 + packages/zarr-http-server/CHANGELOG.md | 3 + packages/zarr-http-server/LICENSE.txt | 21 + packages/zarr-http-server/README.md | 405 +++ .../zarr-http-server/changes/3732.feature.md | 3 + packages/zarr-http-server/changes/README.md | 25 + .../docs/_static/favicon-96x96.png | Bin 0 -> 12714 bytes .../zarr-http-server/docs/_static/logo_bw.png | Bin 0 -> 45208 bytes packages/zarr-http-server/docs/api/index.md | 31 + packages/zarr-http-server/docs/index.md | 58 + packages/zarr-http-server/examples/serve.py | 45 + .../examples/serve_notebook.ipynb | 213 ++ packages/zarr-http-server/justfile | 68 + packages/zarr-http-server/mkdocs.yml | 99 + packages/zarr-http-server/pyproject.toml | 141 ++ .../src/zarr_http_server/__init__.py | 38 + .../src/zarr_http_server/_keys.py | 218 ++ .../src/zarr_http_server/_serve.py | 1170 +++++++++ .../src/zarr_http_server/py.typed | 0 packages/zarr-http-server/tests/conftest.py | 30 + .../zarr-http-server/tests/test_examples.py | 60 + .../zarr-http-server/tests/test_properties.py | 580 +++++ packages/zarr-http-server/tests/test_serve.py | 1831 ++++++++++++++ packages/zarr-http-server/uv.lock | 2212 +++++++++++++++++ pyproject.toml | 6 +- 29 files changed, 7569 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/zarr-http-server-release.yml create mode 100644 .github/workflows/zarr-http-server.yml create mode 100644 packages/zarr-http-server/.readthedocs.yaml create mode 100644 packages/zarr-http-server/CHANGELOG.md create mode 100644 packages/zarr-http-server/LICENSE.txt create mode 100644 packages/zarr-http-server/README.md create mode 100644 packages/zarr-http-server/changes/3732.feature.md create mode 100644 packages/zarr-http-server/changes/README.md create mode 100644 packages/zarr-http-server/docs/_static/favicon-96x96.png create mode 100644 packages/zarr-http-server/docs/_static/logo_bw.png create mode 100644 packages/zarr-http-server/docs/api/index.md create mode 100644 packages/zarr-http-server/docs/index.md create mode 100644 packages/zarr-http-server/examples/serve.py create mode 100644 packages/zarr-http-server/examples/serve_notebook.ipynb create mode 100644 packages/zarr-http-server/justfile create mode 100644 packages/zarr-http-server/mkdocs.yml create mode 100644 packages/zarr-http-server/pyproject.toml create mode 100644 packages/zarr-http-server/src/zarr_http_server/__init__.py create mode 100644 packages/zarr-http-server/src/zarr_http_server/_keys.py create mode 100644 packages/zarr-http-server/src/zarr_http_server/_serve.py create mode 100644 packages/zarr-http-server/src/zarr_http_server/py.typed create mode 100644 packages/zarr-http-server/tests/conftest.py create mode 100644 packages/zarr-http-server/tests/test_examples.py create mode 100644 packages/zarr-http-server/tests/test_properties.py create mode 100644 packages/zarr-http-server/tests/test_serve.py create mode 100644 packages/zarr-http-server/uv.lock diff --git a/.github/workflows/check_changelogs.yml b/.github/workflows/check_changelogs.yml index b6c01e70fc..c391f63738 100644 --- a/.github/workflows/check_changelogs.yml +++ b/.github/workflows/check_changelogs.yml @@ -32,3 +32,6 @@ jobs: - name: Check zarr-indexing changelog entries run: uv run --no-sync python ci/check_changelog_entries.py packages/zarr-indexing/changes + + - name: Check zarr-http-server changelog entries + run: uv run --no-sync python ci/check_changelog_entries.py packages/zarr-http-server/changes diff --git a/.github/workflows/zarr-http-server-release.yml b/.github/workflows/zarr-http-server-release.yml new file mode 100644 index 0000000000..b8940f7560 --- /dev/null +++ b/.github/workflows/zarr-http-server-release.yml @@ -0,0 +1,117 @@ +name: zarr-http-server release + +on: + workflow_dispatch: + push: + tags: + - 'zarr_http_server-v*' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + build: + name: Build wheel and sdist + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: packages/zarr-http-server + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + fetch-depth: 0 # hatch-vcs needs full history + tags + + - name: Install Hatch + uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc + with: + version: '1.16.5' + + - name: Build + run: hatch build + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: zarr-http-server-dist + path: packages/zarr-http-server/dist + + test_artifacts: + name: Test built artifacts + needs: [build] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: zarr-http-server-dist + path: dist + + - name: Install uv + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + with: + enable-cache: false + + - name: Set up Python + run: uv python install 3.12 + + - name: Install built wheel and run import smoke test + run: | + wheel=$(ls dist/*.whl) + uv run --with "${wheel}" --python 3.12 --no-project \ + python -c "import zarr_http_server; print('zarr_http_server', zarr_http_server.__version__)" + + upload_pypi: + name: Upload to PyPI + needs: [build, test_artifacts] + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/zarr_http_server-v') + runs-on: ubuntu-latest + environment: + name: zarr-http-server-releases + url: https://pypi.org/p/zarr-http-server + permissions: + id-token: write # required for OIDC trusted publishing + attestations: write # required for artifact attestations + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: zarr-http-server-dist + path: dist + + - name: Generate artifact attestation + uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 + with: + subject-path: dist/* + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 + + upload_testpypi: + name: Upload to TestPyPI + needs: [build, test_artifacts] + if: github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + environment: + name: zarr-http-server-releases-test + url: https://test.pypi.org/p/zarr-http-server + permissions: + id-token: write + attestations: write + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: zarr-http-server-dist + path: dist + + - name: Generate artifact attestation + uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 + with: + subject-path: dist/* + + - name: Publish package to TestPyPI + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/zarr-http-server.yml b/.github/workflows/zarr-http-server.yml new file mode 100644 index 0000000000..16589f0d7d --- /dev/null +++ b/.github/workflows/zarr-http-server.yml @@ -0,0 +1,139 @@ +name: zarr-http-server + +# Job steps delegate to packages/zarr-http-server/justfile, the single source +# of truth for this package's verbs; CI owns only the python matrix and +# caching. Keeping the commands in one place is what makes `just check` +# locally mean the same thing as a green run here. + +on: + push: + branches: [main] + paths: + - 'packages/zarr-http-server/**' + - '.github/workflows/zarr-http-server.yml' + # The package resolves zarr from the repo root for its own tests, so a + # core change can break it. Run this suite when core changes too. + - 'src/zarr/**' + pull_request: + paths: + - 'packages/zarr-http-server/**' + - '.github/workflows/zarr-http-server.yml' + # The package resolves zarr from the repo root for its own tests, so a + # core change can break it. Run this suite when core changes too. + - 'src/zarr/**' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: pytest py=${{ matrix.python-version }} + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: packages/zarr-http-server + strategy: + fail-fast: false + matrix: + python-version: ['3.12', '3.13', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Install uv + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + with: + enable-cache: true + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 + - name: Sync test dependency groups + # The examples group carries the deps the README examples need, so the + # test that reads a served array back with a zarr client runs here + # instead of silently skipping. + run: uv sync --group test --group examples --python ${{ matrix.python-version }} + - name: Run pytest + run: just test + + ruff: + name: ruff + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: packages/zarr-http-server + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Install uv + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 + - name: Run ruff + run: just lint + + mypy: + name: mypy + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: packages/zarr-http-server + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Install uv + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + with: + enable-cache: true + - name: Set up Python + run: uv python install 3.12 + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 + - name: Sync test dependency group + run: uv sync --group test --python 3.12 + - name: Run mypy + run: just typecheck + + docs: + name: docs + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: packages/zarr-http-server + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Install uv + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + with: + enable-cache: true + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 + - name: Build docs + run: just docs-check + + zarr-http-server-complete: + name: zarr-http-server complete + needs: [test, ruff, mypy, docs] + if: always() + runs-on: ubuntu-latest + steps: + - name: Check failure + if: | + contains(needs.*.result, 'failure') || + contains(needs.*.result, 'cancelled') + run: exit 1 + - name: Success + run: echo Success! diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7f49f47187..54345c819e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,11 +2,13 @@ ci: autoupdate_commit_msg: "chore: update pre-commit hooks" autoupdate_schedule: "monthly" autofix_prs: false - # mypy runs as a `language: system` hook via `uv run mypy`, which needs `uv` - # and the repo checkout to resolve the dev environment from `uv.lock` — - # unavailable on pre-commit.ci's runners. It is covered instead by the Lint - # GitHub Actions workflow and by local prek runs. - skip: [mypy] + # Both of these are `language: system` hooks that shell out to the local + # toolchain — `uv` for mypy, `uv` and `just` for the docs build — and need + # the repo checkout to resolve their environments from `uv.lock`. Neither is + # available on pre-commit.ci's runners. Each is covered instead by a GitHub + # Actions job (Lint for mypy, zarr-http-server for the docs build) and by + # local prek runs. + skip: [mypy, zarr-http-server-docs] default_stages: [pre-commit, pre-push] @@ -50,6 +52,25 @@ repos: pass_filenames: false always_run: true types_or: [python, pyi] + # Builds the zarr-http-server docs site with warnings as errors, which + # catches a dead cross-reference or a nav entry pointing at a file that + # no longer exists before it reaches CI. + # + # `stages: [pre-push]` overrides the default of running on every commit: + # this is a whole-site build, too slow to pay per commit and only + # actionable before the code leaves the machine. `files:` limits it to + # changes that touch the package, and `pass_filenames: false` because + # mkdocs builds the site, not a list of files. Delegating to the + # justfile keeps one definition of the build shared with CI. + - id: zarr-http-server-docs + name: zarr-http-server docs build + language: system + entry: >- + just --justfile packages/zarr-http-server/justfile + --working-directory packages/zarr-http-server docs-check + pass_filenames: false + files: ^packages/zarr-http-server/ + stages: [pre-push] - repo: https://github.com/scientific-python/cookie rev: 2026.06.18 hooks: diff --git a/packages/zarr-http-server/.readthedocs.yaml b/packages/zarr-http-server/.readthedocs.yaml new file mode 100644 index 0000000000..62a1e82b77 --- /dev/null +++ b/packages/zarr-http-server/.readthedocs.yaml @@ -0,0 +1,30 @@ +# Read the Docs configuration for the zarr-http-server docs site, separate from +# the zarr-python site configured by the repo-root .readthedocs.yaml. The RTD +# project for zarr-http-server must set its configuration-file path to +# packages/zarr-http-server/.readthedocs.yaml. +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.12" + jobs: + post_checkout: + # Cancel pull request builds that do not touch this package. Exit code + # 183 cancels the build and reports success to the Git provider. Scoped + # to PR builds ("external" versions) because origin/main is only a + # meaningful diff base there. + - | + if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- packages/zarr-http-server; + then + exit 183; + fi + install: + - pip install --upgrade pip + - pip install ./packages/zarr-http-server --group packages/zarr-http-server/pyproject.toml:docs + build: + html: + - mkdocs build --strict -f packages/zarr-http-server/mkdocs.yml --site-dir $READTHEDOCS_OUTPUT/html + +mkdocs: + configuration: packages/zarr-http-server/mkdocs.yml diff --git a/packages/zarr-http-server/CHANGELOG.md b/packages/zarr-http-server/CHANGELOG.md new file mode 100644 index 0000000000..7c4bc92cad --- /dev/null +++ b/packages/zarr-http-server/CHANGELOG.md @@ -0,0 +1,3 @@ +# Release notes + + diff --git a/packages/zarr-http-server/LICENSE.txt b/packages/zarr-http-server/LICENSE.txt new file mode 100644 index 0000000000..1e8da4d242 --- /dev/null +++ b/packages/zarr-http-server/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2025 Zarr Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/zarr-http-server/README.md b/packages/zarr-http-server/README.md new file mode 100644 index 0000000000..069b33abf8 --- /dev/null +++ b/packages/zarr-http-server/README.md @@ -0,0 +1,405 @@ +# zarr-http-server + +HTTP server for Zarr stores, arrays, and groups. + +`zarr-http-server` exposes a Zarr `Store`, `Array`, or `Group` over HTTP via an +ASGI app, so any HTTP-capable client (including zarr-python itself, via +`FsspecStore` or `ObjectStore`) can read the data. The app is built on +[Starlette](https://www.starlette.io/) and can be run with any ASGI server; +the `serve` / `serve_background` helpers run it with +[Uvicorn](https://www.uvicorn.org/). + +## Installation + +```bash +pip install zarr-http-server +``` + +### Building an ASGI App + +`store_app` creates an ASGI app that exposes every key +in a store. Only point it at a store whose full contents are safe to serve +publicly — it grants read (and, if `PUT` is enabled, write) access to +everything the store contains, with no per-key filtering: + +```python +import zarr +from zarr_http_server import store_app + +store = zarr.storage.MemoryStore() +zarr.create_array(store, shape=(100, 100), chunks=(10, 10), dtype="float64") + +app = store_app(store) + +# Run with any ASGI server, e.g. Uvicorn: +# uvicorn my_module:app --host 0.0.0.0 --port 8000 +``` + +`node_app` creates an ASGI app that only serves keys +belonging to a specific `Array` or `Group`. Requests for keys outside the node +receive a 404, even if those keys exist in the underlying store: + +```python +import zarr +from zarr_http_server import node_app + +store = zarr.storage.MemoryStore() +root = zarr.open_group(store) +root.create_array("a", shape=(10,), dtype="int32") +root.create_array("b", shape=(20,), dtype="float64") + +# Only serve the array at "a" — requests for "b" will return 404. +arr = root["a"] +app = node_app(arr) +``` + +### Running the Server + +Build an app with `store_app` or `node_app`, then run it. `serve` blocks +until the server is stopped, which is the shape for a script or a container +entrypoint: + +```python +from zarr_http_server import serve, store_app + +serve(store_app(store), host="127.0.0.1", port=8000) +``` + +`serve_background` instead starts the server in a daemon thread and returns a +`BackgroundServer` as soon as the socket is listening, so the caller can carry +on. These are two functions rather than one with a flag, because they differ +in the only thing that matters at a call site: whether control comes back. The +handle is also a context manager: + +Both default to `port="auto"`, which prefers port 8000 but falls back to any +free port if it is taken, reporting the result through `server.url` and +uvicorn's startup line. An **explicit** port means the opposite — bind exactly +that or fail — because a caller who names one usually has a proxy or a +container port mapping expecting the server there, and silently moving would +break it while looking healthy. `port=0` keeps its usual meaning of "any free +port, no preference". + +The example below also *reads back* over HTTP, which is a client-side +concern: `zarr.open_array(server.url)` goes through `FsspecStore`, which needs +an HTTP-capable fsspec that `zarr-http-server` does not pull in. + +```bash +pip install "fsspec[http]" +``` + + +```python +import numpy as np + +import zarr +from zarr_http_server import node_app, serve_background +from zarr.storage import MemoryStore + +store = MemoryStore() +arr = zarr.create_array(store, shape=(100,), chunks=(10,), dtype="float64") +arr[:] = np.arange(100, dtype="float64") + +with serve_background(node_app(arr), host="127.0.0.1") as server: + # Now open the served array from another zarr client. + remote = zarr.open_array(server.url, mode="r") + np.testing.assert_array_equal(remote[:], arr[:]) +# Server is shut down automatically when the block exits. +``` + +### Serving Several Nodes + +Serving two arrays does not mean running two servers. Which approach fits +depends on where the arrays live. + +If they share a parent group, serve the parent — `node_app` recurses through +its members, so both are reachable under one port and node scoping still +applies to everything outside it: + +```python +server = serve_background(node_app(root)) +# -> /a/zarr.json, /a/c/0, /b/zarr.json, ... +``` + +If everything in the store is safe to expose, `store_app(store)` does the +same for the whole key space. + +Otherwise — arrays in *different* stores, or nodes that are not siblings — +`store_app` and `node_app` return plain Starlette apps, so mount them and run +the result: + +```python +from starlette.applications import Starlette +from starlette.routing import Mount + +from zarr_http_server import node_app, serve_background + +app = Starlette(routes=[ + Mount("/first", app=node_app(one)), + Mount("/second", app=node_app(other)), +]) +server = serve_background(app) +``` + +Each mount keeps its own validation, so a request under one cannot reach +another's data — `/first/../second/zarr.json` and its percent-encoded +spellings all return 404. + +Both runners take any ASGI app, so the split is clean: what an app *serves* +(`methods`, `cors_options`, `max_body_size`) is settled when the app is built, +while `serve` / `serve_background` only decide how it runs (`host`, `port`, +`shutdown_timeout`, `uvicorn_options`). + +### Serving from a Notebook + +A notebook needs a server that outlives the cell that started it, so the +`with serve_background(...)` form above is the wrong shape — it shuts the server down +as soon as the block ends. Start it, keep the handle, and stop it later: + +```python +# cell 1 — start +server = serve_background(node_app(array), host="127.0.0.1") +print(server.url) # e.g. http://127.0.0.1:54635 + +# cell 2..n — use it, across as many cells as you like +httpx.get(f"{server.url}/zarr.json") + +# last cell — stop +server.shutdown() +``` + +Two things make this comfortable in a kernel you re-run. `serve_background` +runs Uvicorn in a daemon thread with its own event loop, so it never touches +the kernel's loop and cannot block it. And its default `port="auto"` falls +back to a free port when 8000 is taken — re-running a start cell without +stopping the previous server is the classic notebook mistake, and a fixed port +fails there with *address already in use*. `server.url` reports the port +actually bound. + +If you forget to stop one, the thread is a daemon, so restarting the kernel +always clears it — and since each start takes a fresh port, a forgotten server +does not block the next one. + +[`examples/serve_notebook.ipynb`](examples/serve_notebook.ipynb) is a runnable +version of this, covering metadata and chunk reads, byte ranges, and that +writes are refused by default. It is executed by the test suite, so it cannot +drift from the code. + +### Uvicorn Configuration + +`serve` and `serve_background` name the options most callers need — `host`, +`port`, `shutdown_timeout` — and forward anything else to +`uvicorn.Config` through `uvicorn_options`, so nothing uvicorn can do is out +of reach: + +```python +server = serve_background( + store_app(store), + host="0.0.0.0", + port=8443, + uvicorn_options={ + "ssl_keyfile": "key.pem", + "ssl_certfile": "cert.pem", + "proxy_headers": True, + "forwarded_allow_ips": "10.0.0.0/8", + "log_level": "warning", + }, +) +``` + +Keys you pass are merged over the ones set for you, so they win. `server.url` +reflects the scheme actually in use (`https` when TLS is configured) and is +`None` when the server is not bound to a TCP host and port — a `uds` or `fd` +bind has no URL to report. + +### CORS Support + +Both `store_app` and `node_app` accept a `CorsOptions` parameter to enable +[CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) middleware for +browser-based clients: + +```python +from zarr_http_server import CorsOptions, store_app + +app = store_app( + store, + cors_options=CorsOptions( + allow_origins=["*"], + allow_methods=["GET"], + ), +) +``` + +`CorsOptions` carries every parameter Starlette's `CORSMiddleware` accepts — +`allow_headers`, `allow_credentials`, `allow_origin_regex`, +`allow_private_network`, `expose_headers` and `max_age` as well as the two +above — so configuring CORS never means reaching around this package. All keys +are optional. + +Two defaults differ from Starlette's, because the server knows things the +caller should not have to. It emits `Content-Range` on every ranged response, +which is *not* a CORS-safelisted response header, so `expose_headers` defaults +to `["Content-Range"]` — otherwise a browser client can read the bytes but not +learn which bytes it got. And it accepts a `Range` request header, so +`allow_headers` defaults to `["Range"]` — otherwise a preflight naming `Range` +is rejected. A key you supply replaces the default outright, so +`expose_headers=[]` means "expose nothing". + +### HTTP Range Requests + +The server supports the standard `Range` header for partial reads. The three +forms defined by [RFC 7233](https://httpwg.org/specs/rfc7233.html) are supported: + +| Header | Meaning | +| -------------------- | ------------------------------ | +| `bytes=0-99` | First 100 bytes | +| `bytes=100-` | Everything from byte 100 | +| `bytes=-50` | Last 50 bytes | + +A successful range request returns HTTP 206 (Partial Content) with a +`Content-Range` header, including for suffix ranges — the server resolves +`bytes=-50` against the object's size so the response says which bytes it +carries. + +A range that is well-formed but names nothing readable — one lying wholly +beyond the end of the object, an inverted one such as `bytes=5-2`, or +`bytes=-0` — returns 416 (Range Not Satisfiable). A last-byte-position past +the end of the object is *not* in that category: per RFC 9110 §14.1.2 it is +clamped, so `bytes=0-999999` on a short object returns the whole thing. + +A `Range` header the server cannot use is **ignored** rather than refused, per +RFC 9110 §14.2: an unrecognized unit (`chars=0-7`), a multi-range request +(`bytes=0-7, 10-20`, which this server does not build multipart responses +for), or malformed syntax all return 200 with the full representation. + +### Read-only Serving + +Read-only is the default. `store_app(store)` and `node_app(node)` accept +`GET` and `HEAD` and answer **405** to `PUT`, `POST`, `DELETE` and `PATCH` — +no argument is needed to get there. + +`POST` is not merely unrouted, it is unconfigurable: the accepted methods are +`GET`, `HEAD` and `PUT`, and asking for anything else raises `ValueError` when +the app is built. There is no handler behavior for `POST`, so no configuration +can produce one. + +Two named sets let a call site state which it is, instead of leaving it to the +presence or absence of an argument: + +```python +from zarr_http_server import READ_ONLY_HTTP_METHODS, READ_WRITE_HTTP_METHODS, store_app + +app = store_app(store, methods=READ_ONLY_HTTP_METHODS) # GET, HEAD +app = store_app(store, methods=READ_WRITE_HTTP_METHODS) # GET, HEAD, PUT +``` + +The distinction also exists in the type domain. `ReadOnlyHTTPMethod` is a +`Literal["GET", "HEAD"]`, so a read-only set can be *declared* rather than +merely configured — a `frozenset[ReadOnlyHTTPMethod]` containing `"PUT"` is a +type error, not a runtime surprise: + +```python +from zarr_http_server import ReadOnlyHTTPMethod + +reads: frozenset[ReadOnlyHTTPMethod] = frozenset({"GET", "HEAD"}) # ok +reads = frozenset({"GET", "PUT"}) # type error +``` + +Both constants are derived from these Literals, so the runtime sets and the +static types cannot disagree about what the server serves. + +`READ_ONLY_HTTP_METHODS` is exactly the default, so passing it changes nothing +except that the intent is now written down. The practical value is the other +direction: a writable app *must* name a method set, so +`grep -r 'methods=' ` finds every place that opts into writes. + +For a guarantee that does not depend on getting `methods` right, make the +*store* read-only. The store refuses writes itself, so no routing mistake — +now or in a later edit — can produce one: + +```python +app = store_app(store.with_read_only(True)) + +# For a node, open it read-only and node_app inherits that store: +app = node_app(zarr.open_array(store, mode="r")) +``` + +These two layers are independent, and the store is the stronger one: it holds +even if the HTTP layer is misconfigured. Asking for both at once — +`methods={"GET", "PUT"}` on a read-only store — is a contradiction that can +never succeed, so it raises `ValueError` at construction rather than turning +into a 403 for whichever client tries to write first. + +### Write Support + +By default only reads are accepted: `GET`, and `HEAD` alongside it. Starlette +routes `HEAD` wherever `GET` goes, as RFC 9110 §9.3.2 asks of every origin +server, so naming `GET` gets you both — a `HEAD` is answered from the value's +size without transferring it. To enable writes, pass `methods={"GET", "PUT"}`: + +```python +app = store_app(store, methods={"GET", "PUT"}) +``` + +Accepted methods are `GET`, `HEAD`, and `PUT`; anything else raises +`ValueError` when the app is built, since the handler has no behavior for it. + +A `PUT` request stores the request body at the given path and returns 204 (No +Content). Bodies are capped at `DEFAULT_MAX_BODY_SIZE` (256 MiB) and a larger +one returns 413 (Content Too Large) -- `Store.set` takes a whole buffer, so an +accepted body is held in memory in full. Raise or remove the cap with +`max_body_size`: + +```python +from zarr_http_server import DEFAULT_MAX_BODY_SIZE, store_app + +app = store_app(store, methods={"GET", "PUT"}, max_body_size=None) +``` + +Note that `store_app` exposes every key in the store, so `PUT` grants +unrestricted write access to all of it. `node_app` confines writes to keys +belonging to the node -- though a client that can write a node's metadata can +change what that node contains, and so what it will serve. + +`store_app` also does not *validate* keys, because it proxies the store's raw +key space and has no array semantics to check against. A client that misspells +a chunk key — `c/00/00` where zarr writes `c/0/0` — gets a successful write to +a key no reader will ever consult, so the data is stored but invisible to +anyone opening the array. `node_app` rejects such a key with 404, since it +knows which node it is serving and therefore which keys are real. If you are +serving a zarr hierarchy to clients you do not control and writes are enabled, +prefer `node_app`. + +### Shutting Down + +`BackgroundServer.shutdown()` (and leaving the `with` block) waits up to +`shutdown_timeout` seconds -- 5 by default -- for in-flight requests to finish +before forcing the server closed: + +```python +with serve_background(node_app(arr), shutdown_timeout=30) as server: + ... +``` + +## Example + +`examples/serve.py` creates an in-memory Zarr array, serves it over HTTP with +`serve_background`, and fetches the `zarr.json` metadata document and a raw chunk +using `httpx`. + +`examples/serve_notebook.ipynb` is the notebook equivalent, showing how to +start a server in one cell and stop it in another. Both are executed by the +test suite. + +Running it with uv is the simplest route — the script declares its own +dependencies inline, so uv installs them for you: + +```bash +uv run examples/serve.py +``` + +To run it with a plain interpreter, install its `httpx` dependency first: + +```bash +pip install httpx +python examples/serve.py +``` diff --git a/packages/zarr-http-server/changes/3732.feature.md b/packages/zarr-http-server/changes/3732.feature.md new file mode 100644 index 0000000000..accd91ab81 --- /dev/null +++ b/packages/zarr-http-server/changes/3732.feature.md @@ -0,0 +1,3 @@ +Initial release of `zarr-http-server`: an HTTP server exposing Zarr stores, +arrays, and groups over an ASGI app, extracted from the +`zarr.experimental.serve` prototype in zarr-python. diff --git a/packages/zarr-http-server/changes/README.md b/packages/zarr-http-server/changes/README.md new file mode 100644 index 0000000000..80f0be782c --- /dev/null +++ b/packages/zarr-http-server/changes/README.md @@ -0,0 +1,25 @@ +Writing a changelog entry for `zarr-http-server` +--------------------------------------------- + +Fragments in **this** directory are released notes for the `zarr-http-server` +package only — kept separate from the parent zarr-python `changes/` +directory so a PR touching only `packages/zarr-http-server/` produces a +release note for this package only. + +Please put a new file in this directory named `xxxx..md`, where + +- `xxxx` is the pull request number associated with this entry +- `` is one of: + - feature + - bugfix + - doc + - removal + - misc + +Inside the file, please write a short description of what you have +changed, and how it impacts users of `zarr-http-server`. + +A `zarr-http-server` release runs `towncrier build` in `packages/zarr-http-server/`, +which consumes the fragments here and updates `CHANGELOG.md`. Fragments +that describe parent zarr-python changes (not the server package) +belong in the top-level `changes/` directory, not here. diff --git a/packages/zarr-http-server/docs/_static/favicon-96x96.png b/packages/zarr-http-server/docs/_static/favicon-96x96.png new file mode 100644 index 0000000000000000000000000000000000000000..e77977ccf41426c35a768ea73ed20e05d2676dd5 GIT binary patch literal 12714 zcmV;bF;&iqP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H1AOJ~3 zK~#90-F3TWhscfoy={Ravrt z)mGbDaM!N|6a)bkEvSfq;)-mtg)E=~30t;v=6!yD+$3bVL2JR~_k2F*lbds%GiS~- zGw;m2vm7CbUmEfsOgmc?cSkhjxbhO*YmAwH+PyPA{Hf#h-$H&#;_nMi>T1C>A#Z}< zP((4?ltr=*xFNc>6^ z+?O^2!gH1KT*3o0zxWZO{9nO*H|592H^KDw1^1;rWyEX(Fd`g>WPYjZdLpLthTCuV z*JYSb025U(HFfO1;H0jnILbc=zMnb*)sY)ajdNTCMdTI$Awda1D*lF$M_{@E_LfCQ zGr|@Zw{97@dGD0;qSo7XEXKTf764#@gomcD1F)`ON?PxNdsD}XPgb;^I&;sD{$lmu zXJK{auVKG<*N+*K0(r!WtTEJk0CW`MFJW6dT337kC`d~iAwYYGd;_wShLK9M zL&zi}a;)`?koZ;nNvUH&Bv3IoJ|iRVCaUIBWjOtPl{i`b4x_pmOQ3Rdl;hss6U9D%#n4`w5hXowfcp9^n~PN_psKm;y;Cka^q=&hj41MmP?OZdv1FHiz6Liw~f7(to^Z32Og<;3YA_9*N* z1<9#BVXzvI>WK>gIBn+4FY{B<&J#)pQ1?LOjJ?Te=cwq1rn&(j84oPQuwhPqQitE| zO-Tzty*aJ3v-h7=k#LgD&i>TYCi&yjrZjM|i^RRK2#HYhP@niVsPals8bJ9vtlR*F z3Bv^ls5R?hUV_!G^k2Xq`Rt zT>$SEj8E=QFoJ5_f_qYKg|RE*X3feCakY|;gxMME0jw{$C#8>wiM0w8+?_gB$#)YT z$@~fc)G9>9#?Q`JgkaE@SEPgU$EP-F=#?ytee}`8|Eq5QQ_kOedoU{h?$imk-03gM z86cWfRfv@!D3pal3^2sE2An5WT7mG_s6dbNLCBj_UI~?rs`9v6Z4aVh4Sp@NQi-_P zS#KF@0swo0BJ_Nh6x@??>+U;K>QuA<5chEA`>Hri$j$%&F+B_JP96L8T@%~Zc*fMJ zUc$o}uSELsN{KWak$+F>-3P~wYx+aA1Ad_RyT=3@16ph20qY7cfO4xTW$~AE@QBMh_2o~@=xSYg( zp>gVv6#(UfxW8n~H6Fi)lAbYr#bOsM8&;>5x~@ks5{l1C*x-u1Kc(IL?VZ8KKSam> z%Is_(H!d;?4S(lvjC4Tas=5e@TI~~gOMz_1N)wXvAyqA%diYqY8@wJT~5+ z{BbFxt>?U&^!SXz+V2?mw~Q4Kk-R&TucR1j$d(0vN*&{Ke9Kz?W!l%3@i!`N>&G(Y zZyz@<(ik0*H!juZltnFU{m-ez-&fD?CH|&i!HDSQ#kV#z4f06*wGQEU({VL~86bK% zz|#Qk2GFFIaK{A&KBnPxQ6vdu2FS+&G^-Q-@%uLum?lIM5lr2`r+9@lkRAj-DaWzv z^8T1sjt1om4I--Q0sz3gc{Tx9n15%=C<=aMJlWtt2j}0J!pKrthz3&2^pOc7%k%C? zz6(ZLgWT@A?iKlWrWkSjZ_%~` zLh(1;e!IW5FEA>)Ii>(;D=wogqhtuNs4Ha{5j<=>uq%V`qWLW?<2geo5owe9Ywup9;#Ff@--kqJffs_S)| znp;KrN2(m7CmB@!4a)fHHoOMkA_vN;fXRoIG*ae5(Y^*BK&z~*V+oJXe7>QtWFah6 zU6VsaWZoSq*Vgd$SCod1k3L!!_xG7EG1B`tJyR~qy|8Rva7WsR-D85so2ZrVJawv< z@L0wxMf;;(5H+O+*e9@U^Z$@Cs)oH+0C0*E9-sN5bIdOBMV4Hbe@EJ|O~Zl_;bgAq z+Zi^@$q%%7m-WEt5-%g}O$hY%EE#J=X(?*bbF^sGeg%N|o z)`h#4L}$Q0PR8-5Vq8+alRI-cTnUoiOHhu%8<7* zyg5?cFEA4b%>j@O$azrghVbohd;p=GS?9q3XjVDatW@LuR;@HCXxjD`T2l@Q(?+!b zMcym}R!3T14PnEm;s!Sna=1>DHV;5kKxmd4*M8#qoS`D>r;WHughd{;h7zSFqSSA_ zrcn9#G>yI?Z*0o3grr8VV(L`SFp=cK#{mCj*{zaod^?~LaZ!D14v%oRnu zdd-DmuMo*jnSKq$?PB?YD7)6%WK|+2vH*(nPGG){h~kmvNl_($iO(C8 zeo1XHVS&@0oc?XxoXjVccpDZls=J`(^xRw1uBhSbuP`s||2gwe{M^iE;X1F;Le-j0 zqDU$jojMr7psB$J(CXQ&V+l{rd_EHLvawXU*lLvB@^4MOuFBjMhxnf2Q2gA?XSLM% zPkv7EO?kH@4>eGkN5z@7Y;DDF$rmekiIp_5@@J}^0Y#@e;vE-fzfh8?dZ#LeQFs;< z=hVli%3)F556UPgFK~#yu(CrG?Tg6Xl;Ak0bL&rKaYOPW^Q_e*81j55zy6^^BKHlHac%q%2iHG zw7{Z9iEBPL)R{-{eH638lsC8N3=Db^yhx+I_)x%GEVMby6lNrwdPD5X~o}xky z33(5|JPOhQoC_jUJ=f2lB1S%^GF4#u04S}`91%Qf1T#s#1IpbH-Y>vD0xQFiA!15J z@K=yaK>33TUI$PF0Alfu^;%$t2M{<)0%TwnQ_q-=spiUDFkCg$Iq+N)Ns z0stgDGdn--`OGJcweQlS0$6KZ?VLBVmbt6ow|+5uf828!Pr0RBK@T3qZ18#7Gw;Tf z0afPC0zN7Mq6oml0(`6n$=1VG5!Q?d0Hs#mTMXiFbj*Lm>NpqP22r`Jb}bs}$Pxg` z0sPA-7pXBLDB6$Y;OcY&5K&arS5|=M0C`@)%Sd}QEN-ZiIrj^yx!Mq4&}d_BtKuFa zx{~C-;WOhBo)0rJ6$~1GX+(cghteRQ$}2&vhvCt@8lCXV(uXjL?|(4hwXESQwr5b6tdKSe-zc^3Vojl#}|qV!CWE!kKkw(c>|V* zA@W|>){a1-_&;O#q*AU2xZD8wM4chTs&~-p@~r?b zmAk(8{eJH%g0BPc)!SSQ`7&2ndapSW(M>I011cPF_2b>6u~Dw?$g!b$Ulcz;%6gw; z2DY9TW?oJ(XmYJw3&HKI8N&xNd^REtvI54L*Q2^RjjU zn3I3agidsv(|k}2I>8Hi0zLK^;shcpAqyO%|FYH$^!eONpr~(3NCjjm z$wx)xT%Y&`Q#q~{>@Sbs>%`pL5sEF-V)K-0@EAB0uaXl++QCb!ZoDH5Mfs+<_gVH&zRwD z7tYvShd*qXlkc{>k!(9jz-?A^WYWUy4Rv_c!?$%$3t@zK4;CcY&cO86a(@#cYKU2# zujDd^zDR|3HIN=)L`x{j>V$8B+Ts(!mmLS|)WdHGE=BF)Unj9-xsr;*R?M=9Uy}77h)C|h)XT-#2!*rO zSnZ#Cb?VNqwaiVZ1f=Dp5T69pQgLVwy1$ZA$&~ z0enTGU*fVb)BG+C`f{U=-7Ha<1jXk985X}JYqBaafI=x*eax7fku8CadrL`DGIGyx!DGXh{JwA9s2?4#6l5c zjd!JZXaa+<=8M+&NnH+yiJ-*MaV~}8LLV&N2k??8qN}oLcysZg&*l4`-+4vAIRsi9 z4?P^8TaEhPQt@J;d>B9iLph@;%*Yf-6j;YwY}8*SlqnQl56FPTH?zK~9rC7O!HA}X zM{jA>EIL(Od}JMGNYd*wzpVS($5HT`2|d*K?(j$Glvcnu0I>Vgdjh@)|8!6vH3~O= zMb@J2SB;B|w2?zWX&~0DQnA0;J2?13>%|o#RCxdz0kl3%S}}7GE)Dwfe8;W^#1Y8H zMse}>tHyoRaapwib_>vPn7C}_as-2>V9n8i0(|6yMX+vC)e!S@A*WHKl{%)ESZ03* z|0@xh1_jl4{YCM39e#E3iCi(9Mo5w4`sV;RC}Ic4ub8zhoaoU9kB(_dNdaW7QU@o! zmA&aiqUZLX_$$!dD{uyha(Jt^v%aak<~aUG#NtV)DXpx`Ixc&(48TiYUy-@6(D)3ChZ(7gVsp5M_$C_!jg zr?Ny;3~lE2Paff8m|{{ANiE#!R_9T<*R9r>3eU#Kwm z0wxhaF@cv7R%OnwN|Z}ehk)oqgT<<7##+Nlt=`No&g+*PNlFftO#u@b={39&k?PhS z%mILM(lZtfRm=vXHi{O3$2T&9l*L_QfyGV=@%1czn2<7Frt7dJjEqZRhlshAjHrN89 zm$7z0(yGjnClWsQl9Y>bFHTvZioc6;u5mFEik4FD-Broick!eauzZ-rU)7Z;()&uA+0PG=Tnt>LBvY&$GbzhA`0I3|Y`kKTH00nSZDk_U>kxL;M4dSJW z{|f=m0^~!0v4B)AT-Yy$gQ)T#fMyEb$B4#n`^t~~4!{HgD}~Oqgf(?5-0H~hn|i4# z?}JDaKp#w8lf8J;nfLn}M;}{f1d|h1XI72O?dg-U0OabVHCcbj>pebR;rq2Qh@e6t z$V+@b^G%3IUhm|)l(H#l&GC_}+`g%CAg&-aLLe@T>`#0@>a{(6OQVh2o7L!=r1y^Z zDfV2H-X7NW1=vu;lnZz`A)?W%x#dT%^TDD(C^KmIt&o!m>0TjneeZcdh)hDZi7*X7 zPbh|jWePyz2!MwTunv$31SXQ^ZmFD^MlfMr);a)}=Uy=JVq;_)N{+oi;AJ@Yb>jOc zUO|%EE9G*4_X6Tq^1(LivzCD*kcB3_QtqXPj}q1$7e4R8)SHB8mbk9*qX3YwW_JFb zUa1YJ@QJWoRa)itO1V`pn7G@i-qfsoC3OoyUt`kj1=y5|=)4P#j*)UH4%gaYNok4W zL^LJv84Nq9O5&8L=2g>S%a;36|YqSuqmC+DDOr*+3VgNe+VQLRj{!m#-|b zaMp>d*Nf$^Xt|V@mxZp|Dqi(LD2HC?Y=bF0E(vs_+9hW8AmGbWtsCYSp3Ja{B_=W z$!AsFP%XD6Y?!@0;iK$1>hWW-Or(XEcmBlN^3G50d0fon{P?vQc?ln8%@xQe#xqHx zFnQ-DkIg$brC$wxdFW?{&$7NrT%Yw+sKTun@2qizB2)q^vtZ>~u{eh+%fyqY6Y$HS z_&bT;(&}l(VhLR|frW&<$HI!mb5PbC0;eOewZxa8$vZpc+T61zegfhlS~&F3LR^kA zR&Hzm(ab~D=}zI%X>esl!iQO_D$ngXXTtB`!4FD4J)^KVEAQ-yx9vV_VrPUgFG-)w z+AJz9M70@QKs|QKJA2}7TH-smD#KNec9}0f#Ai7y1xc=T@{YF+?LkrY8 z%A`y-Q8Ad7ZE5+sS`1``XkqvsJlROdd!P3y}Og;j`>HVx7&_ z0`RoGTHQj=v;12c(#2FaxKT23&>L-=c_?WSiFG~Po&jQ zi^V<#N<7poN9|c+H9KDfuviWL;;6I)u~;e=!x6X=RtDsDOfF)+~ie3@rTh@F5n{rD;s61Oyr`#fnEwF3` z%OY4buEux8no$Y4HRnSXdr_I<$^3+k8S5+0<#syqXYtT7!sVMa%wz@HY|L0GibPm; zhXOv=>zC6x<<`7T_r!%WFLFdbgq5~X(;6ytXfMb)W8!Ua-S*+!^H$t#^w?G`{7}I0 zO!u75$zw_BVn7UlMJd!QhstQ!3QuRa!@~}-GC-{ChGH=lcflgEKE5ixqALSwFR_adma{;)zrp=bDx$sy3 zH3}Eq#MNB7PTe{CEfca z6_*Bm#>F!r|NKp}BTHKxj2A4KmEhZJYF4 z8a*m1347X2yv2CBBq6tAahx8HPtuNAZ$m_K+fKNehDU@<%xRxImXxJ!cV+HFF+#?> zqA#4ZJ@b74@8@<%9&c(F{~D%1@eUP(V6jG(FTvILTE)Ni@e!5RQn?TwA2%vVu!yO{ ztIEmzQas)$9_LVTFFZLD7N^zEM+w#3Qr#sC06x$A3oPa&?3i8UPR`kNBn?)!Chp2! zblyk*bdz>w&Zk8?B`*+b7KkT9V5AGk zX90v3g4H((N|^^E!y(d2h`#}7jT20o0+eW;@&-<=Ef!c7GeTcOi$xtzd~z{ z2wK3<62}kyn5x&&)nZjXK~HDUGPd%%wLnciHdA@CQ7xy{EPDDVEn6Sw+gg0?R;%}r zIH;;q;Nf4iXiG~_301Am^6qn>5y|;@{M_k;~S^YsFeT!5i3bVK~&b@1EG?WpS|dt z{6jB@WvP0)hpOH8w4N|(Ym3w-l~FP909b6KCpW;wlW^q`b)Amz&=MX{&#{A+V`z~D z7Y}%z(;l8A)!}K??>xHvBRxzK54W*Q&Jq`=*WtSWJa}U9jAKn#@wm{c87D69wPn6B zHCzG!%F6K=TzNR*o6M>Kmxx0V_rt@N;z|rGN-U*GPK$}R<;Es=tE%WLaK^V8N0Ro= zde&H;4HrGsMWbddn%R#5lSD)|_iBJ5e>lE0f{7TTU2mOG_f4 z74J}i^Y~AfuD%Ux&V?&+YGES9yEdoA#G6Dl$|oL1!AJv;GXV+tG3qfF2C^T*+d&os zG8w2?!B-#Om;9n@H@m$DE<0Mu`39jg93ih`-m_3;^EeOQ6EzEwVhVU&@PJ_yHOW&=P zj~snKtH9R&F*I72UPd0J-OahJ0-_~?u^9X|p#wR05{7c2@*8X5k$J=%p7inT5t|xJWKt6`h zZ;#I(ssXF|h6A%x!OO(pH1CKrN&wfb$MND(7e)A;y`HOA3MAI^crA$1@-UOE3?Zm? z941WA2zQVeppZorxv=uO7gDbJQLG}_bg+$L&apJh2x1f%+7+98Gl9cx3$tFWett)@35g0!f$RT$m5|NGH5HL3puP#V@YuaR z$9zh0Tm!FL+rq41b>TNjFk)wH${i-qV2jZ7q?*f>=02r~CCu)fF)6q1Za%SdB|l^? zd}vdYwX0oG)?9kJo)GIfe9tJmZf}-+VJ$fU0Eypb6tpYKnoBXOlq{!l)*98GI|9j< zRV69_Uq#(_4CJG9~&=^b4EILx0KuJR#&_0C$k)Tz~_^MB+W#avWsh65D^BF=aQ1v@o2?jWB||x50hwQjXnv=QxWQ( zm2jx$HZ7YZ7||f6_|^sirjT4MDwnrA6lx*u45TIzI71Xysc=2jG}{@Ia;s@JVNLBm zQ2WEPw&f*`&(&l8u_|Z@YRS%+lrErr?t|G;+qKjF;LJTaE$&(DS#vGG7#fss4(xd`rpBE7=6{5_oTM#Qzi6Hv|<$QX)Lcs}`T9lk(e^a}vpNz-0D9Z4fg zJJd2Sbp(z{o&)gijt6RPEU`T%Tu_=QD97f3BJnPHue0chS+M@fT zkB*55NU9R=8*2x2I9zv1iU>D%D9oC?EjslABfOd->!_v~)oi0MrZ&GKs&A5dOzE5l zqn%x#7eh-KYoHh*Yft06qT*Sjrmv;66+t&2#UucHgE(HB3k+&aOt%1@mvY|*`0e!& zE@!m`)V25uVxBnmLDJVwlzr52=@~^?VRL$QY>P>`6O=DI70z5${rvVoN(YME?b54S zu(74-q-KsIfAz%l?p#=Nmf8ln-QOfSX0$)RG{AgdEv`J{a7K-p5tZ-&NX4EfoeqU| zBH7+7`9fM}5FP!1F#EO#QpZ}w>dG)G3q+^FS)Ty-%r_zr zl4z^extT_no>7$fouXHW*~vJ#B_h!9q8b+@Xfz;CLFCU}tCjLgpbxgjrt}fzKs8(~#0PCt~j z?u$VBwn#cR2pFUEox3%VdZCi!&23?k$; z5Rm|uhwF0Cn$6a)XZeY?YUL&vF6&g3@x4R`fK?LowGQZ9rTIhKT{V}>ZwZv%1CcGA z56-Nb%Ca?(HVi=08HaY=1cXFy932?dI1rN#a=kbh)MeSgMxioP|v^jZX%Y=E_J zd_z0!e<=S%w{!~i9p2j#lhV)7xx%Ba6k++cK>BSSv8wB#nsbWID9l(1VC9xT`sD(R zpvZb3amn^(sfRiqIKDKeXzS-umObsG>(j{E<6CV3Y4UgvZhNl;Wx!h8Y9GSAm~Do zk10B&>wy!`PKE@{mYCAv3}6C)cj=SCUA~>Z_lL$A0M00!wi3X~&4Kj(N?c(CZ(5qB zfaC~l-F?^$BLS`;O*;shIevQuA$@!xmMHiXfabMFyDNVRxX_9dG_-B3%0)1;yz37z zFSSu}sB{7e*LtRgY1@jluwom>`XIxcO)(ut zAi(h;R;lX@>{h*ha1zj^XvSLr-r5*QzuW+q2=sLkM>fTz-)f0f-HSr2P!s?J+V$Y{ z#j7OfYZWN{EhuYcV<0_T6MYC_77An$VS^%0oGLCdhReGioc`X)iu|U)m$8#ag!Ao?;_NcSxmM6x)ETa@uXq0+ z%u9W+hK@k~-tFM@J2%HnX=BOjJn9^QY&-MN^ct%MyB(ZSdw1~~SS3MUi$K{;odX^J zOu-7z#eg2Q{6eQ1T@TE79l+}wV2fRz+LpcCueG!;+nBb+~I}iz)FQVORn+2F=fz>|0cU9MKe*8_T ztE1b&X-fet{UUI0e~1huu!t&U8)GKlYE<9tdT7S>O5Y9vECCUO!E9jf$$iB!V|x!v!NZhng| z(BdutOZ@7;tm~nvr)vJp;k4Z~Hn^KF!<^G&Iu9q&MFsQDJNUpU z{mjwlv6H)5$~}Ob1Hl|8qV!oUi|kLz@Fs^2jX4|>eVY)!2l%pz_sDs*Mx=fT*d)P- zvS@E41&K=Ev*#C0ty+N|_RA6TWth`3rqeK`=_+F9pL=lH=ch7)8=3~2!{_}@h#Lgl zN1z=b#RASRH~vR^9+>(+ZyNn$V}so8H-T0o0kl!_+4G7Xth37I#Gmbup!q1q4l^p< zL^!`k;RD}qN&OGRDhc`;M|(pI(5}Q^{*ON2R?MaR1!05S?w3HTn+UXXl+T}Y=)pRR zxGVAfzL_FH^I?n*6yPFNJMV&`hkh~NAN;YfL2mbJOsnCd=mO=l=O2DB?BGpx{C6L$ z5s?pL?i(bKzO=gFSBD<>#eIqMq(g${qi7wfkaHcMJa^vyso!JprsCEg^tGUhL?EQE zvGVfyho-Lo?wkHUg9OdGXdMc{g#tcz!4ELW|J$dUsuBTx)N*03Ll3O`;eq`^AVIS( z8rMLymw|cySA|nQ{lP()5xJn^Q`V`)` z^1JW&nL&bPZHx>gc(GCQQqQ7$>))g8hd$y|f1Yn`AlP38SAtmDyJ+fvPU*u=1_ZJ? z=7B*Dc#$gR^(mTq%9_J_l~@%! zt*@b8LE-v-rzjCt1s>`zqE``S@g;>*R-KAx{5Sa7h+m0SvD5krc{xNr?00bTNlAo| z=)4l(YyEyk&EB7#_?1`{JFPFt%gz6g2$iB+%F@eq9mt=MUOjdB2t zth?+anXFTZUyS&b_)oKGz18w61Np2n5#EZO))&eF<`*J*C4O<@S7Jr%j6P5f6i@_w k``1NN-ukKI^xxwD0dx|tMUqFQ>i_@%07*qoM6N<$f_TPca{vGU literal 0 HcmV?d00001 diff --git a/packages/zarr-http-server/docs/_static/logo_bw.png b/packages/zarr-http-server/docs/_static/logo_bw.png new file mode 100644 index 0000000000000000000000000000000000000000..df1979d3cc3317a36feaf5e7aab7c32998bdbfc7 GIT binary patch literal 45208 zcmYg%cQ{*b+eGtTnL*e6vTC-FKl8TMP3q9PdSl+!|iF&flimbbZ*^ zYjLm3OtsO3Cm=Roz?aI+ig5NVu7xT1#*POe; z>LRlF7c-xu?xONHe!xzzIJX2e#r0oPN!WG{Dr4GsMoE0}-h@DkNn!{_ItQoS%@SCe zj(KT98(@6!Mho;v;m=7+xrp{nDkY|A`barQ@1OK{w!plS6d*X+d2PHu<{=dnOntLD zZ>ot>OKeJfPb=te)b?09NA6AD6wsDe$-lNDGUfbWiC=rbZo9TFizHPvdn0G>JzBxX znK)~S0N>Jdz5lvY`~vAYpA56TtFx>>gH70?#$oQ*_cR!~R&WKfRPp@eVa|eIz3^yRCrJ?L`r$v3N1x1>0Htr*i1OfABST6AR|wv2)8# zHldDWR$@_lv%aUF)QML5NQ0?;hPx-h(nP5y22u5cR;U*lijWd1MLt(>qk6?7BFPH* z)JOt5Z7|&ko~oI3K?Lk(Pxw3?uhum(EkhFhfG_Ls!=qEi>}%VXVRnEGn|-&2Dwy)XJVt^Qf_1&!bND+^B`&-NMrWJ z=8j)D;@K>pX&YWz)D{dC=7sy#{+r0-e-Cq%9n0C{v*h~BgKmdv+2xWy*@qyb19y{J zyJ+)ShUP{#-JPdmgF#@s(N`(-?+<}}A}@HuGlmPI({^47ZJ?^=fG?=Qm8D<$FDkB? zxHRl&ACnuUgh=(8mSR(h6q}@~#HUYdiv7xX0|p{}pjteXj~zYqx;#{|2GyX4)9Q1irjg~^S(Zrf zA@eeMo0UwRK>tKY1r=|GcS1hDU?6O9ored=tOYI^9&^>32IlIZN?QGrilO&6Z(+QeDSDNxe26c%;|p(U6<{2^ zFFq&(PfgPzQ*n&1(u@9W*Dz+}3xi{}V4C`nQ4&bx9SK(gyQD1_Dk#5=DUx#Ih8)bPnbd`x2WM(2W6B zV&WpS{Vc)%p_E#WM++Nhl6ni-qAs%5uUwc4Y-`OI;Mvs_xi<@%17fXW(*@`3Xf_B7 zgQVO|9VCxI2WwlQ2n0BHH15O%!F2DPv)GY0#m8glr{fn$t!U1^b_BPdV7=NT$>r-L zL(*Q-=j(sOztt*yO9hrGRU(!J?re6h((z(|89iZmdf_XHGUJVz%n5^AwAROI-Aixi z>zi^Q53_FYT^ZIqh$ni0n94zLoQ0qgbfnb2Tm z9o3d_Y`S;WbcN5n{gt z5@mY=5dw$nz=NWJ4;Gyk(*>)Z`?{;E1nY+fZ_??3>~ft;xTYY#I-AidQHG{!x=UCe^hj)0 z%S>4Ot_I6QoeU%{qsss_m65YAgY?rbf4S#{m|fFIjDg3!ns_+dm5t)PolDc^`bv3J zB;^tqn6*~s$+{5OdFh%pHOQMu716{y!chZz zDDL|~kQ%j5$PRP-%dmlFgixn5O7nOS5!wk0eoJIYl3{Ns_YO{9s7QJauuy@qJ57f79eR!de?^guaj$=KTOf!7mN4h0Qz*gcd$8Hf2 z5WJ~sVLXt1F+#s4&n|GW#irlI+TIHrH|`9(MxASdzlFFka>=-uHaHjS`AC7fhost) zpodyK;hN4^wF-NU)wO!OJlqmgdAx3qvGr}JX`#rtH#e%j`WXBa`$9Ni($H~sRc#hw zZfW3Ph*$1oTH4UO^z8KleY_#gY&8*UFC3RHP!*a8XR5C$|I$Zft2mCO4n98`75t7(nJneB5{G(e9C|K-He> z)e9I0PF%x>)=qyV+}%_j-~Bn+ZS*FHrI8XxsPj@4uF>g}7^2I$@};ZjTcL~@YB!$3H5>YXAiA}R_C;VK7tS)Z{yIg4g%a+#`nWNoPZkz zVy20A#|#P2i7(Q66@RjGNIF1Mc}Eczn<bARW-wMLqnk&1bd}n5o8#ehJg!&k{BX zb!O9tYRJ%;_+iqeKDEnchg+hzwN`Ao^FLlsoIr)GR97C0BR86XBf0}vQXhX@DCxL2 zRKgqT=%~=BsI3a#anqkRMz! zzPVU?CrCLzBJ)SETN)M$k9)lqF%~0<=nD}+s=#XQE;Pi6hp=e~dj018*S|N}gYcYP z;_H1>cCTj*?p1m%02Cex`o6FH6?LgGQC%cu(yoQVNiYK*7ZE&X1g@#JcpRmsEfUz> zLhKCC$R}pvvb0l=yh>8dB9u}xdrqX5O_dDiSnAr4^0VH+2OpyQ22tCz(3OkZj(D}$3mYSOE-_I00=-gQ?3qM%6QS-KDJb3 zym7KQE|G|yVFjQ@M;@2?q!h4ZzSA!?ZHWgKSJcmI4TtAm4>^_x6CY}@Z#@Hm%U#`q zczf7k?B#4uZF}+8#W)J*`kPlX@q;8b^vk`q6v74)S#Buau^OZ=9`}6m%5;v|Kg@qy z?0Dk@<H_La2yzHNf9mJ4-D!6;udp)LBz;)ITWB%n!_?oM=^>j1~ z;RlCcwHa=gOA9r&4fjnXUJT%;sYcxB--b$;1y#W+t;BAy$jcGxuu5Opmu`p$) znnMsRqn#K%Lx*NfM|Dmh?oS2Qu47CExT|^1qK-G5=&HSAA_y6``3+~y@nSG93ljB9 z$HYPZAaC*(kO!*_JI+NW`n(_69?IR4G+opc72q6?OaHReUX**w%=-Lf_A63p5%+8< zrYqNgNJr3T53Dl+TfTs;-AqHew7s}F82dDG%R|^%-1ir?|B*ES=2-OZQc*Gm5}|0O z{%cE%Ju7&or6i!M4P-}tu56&y0pV9qVUI!!fM*;@udtkON?vBy+*1+MPFt60&lBG> zVFCk()`%k-N6=85eRA4UI5AQr@Lk&jPAmj3+Y?fu_jeZ2(P`S>wXe{T6cJ3Dt>_hX zTRhyb(4OFP8F&B!Vk-Xe#R7@^Rz>uFrAa0MK|wKLq*vM>4vTx#Qe0aG+AbcxBc}5@ z^l0icOfoat^`4C;AIxwTCI+Cye^tTf;l2di86$xVsZIA|RCKCXGS}f@ihUAnf0{j1 zRZt$lCN$@A5%QH*cSdD`G}CwImw~pQM?nc>aj9f8e-t=;~p{k6oe4fY7;01-%a-YqThe7=(!|Eq+_0 zo#yk4F)KM3;%ToND!JeXnYyooi;vMh`EBE#9a@ax&L@6tVS{=7jH;HXC<~M!Y!lQU z38a*whN?3RJ2dfsYH*%PcCf0!F`qzo=; zzJ}I|3LY*X3)FcdRO%sG-~^%ZFNR}p7fIT7sF90pCV20$(+mtj!l;I#mi;o+ z$j-B6F}zH1JOpvK2b!k9UAD@ns`hH&zIH_>*iET{`jGCIZ^H?ARK-n=U^g*+M)OU` z&5F$`@jm(NPOTA5qH-$oNEq&Wmn3c17%gy<_qF*#p&L!T1^(BpHhs0B(X zoM?_3m3Jen5Q^dSQ=Dkh$`R$q-M~74?4twA$+%hKFT<*>q?D7jEd=*=5L{~B(DAi5 z08hBh_ovT9WO*oXS%L%&pHPQNttXjZ`QR%@e!MVEv50t-9WL&b>LY@8)2aOxeR4XV zPTu=mu7nPpJWJya>=pLH{v z_V|*@Fd3=zx35@>;CK5{r`4xOsUsFKA+QE*F`Z@S(uOM#{x)m8A^W;Ziy~}4!JF>1 zls$9?XQ1=;eM^sXnpemMXu4~Pw31|!_&l-yD_x-@W9q#RU;FNCo)?eHz7W(bH3kKe zARV&lH?>blNNc0y)uIT)dEcdfBt5-iM%2B&dxJCNIABfO^i0MrpjV^&sw|l=n@#08Xo_8) zp3FY4!*9D!?*Q!~4Ynx4Z8fbbP_qZPMJpi-XPO4+&ND28XroP691Z)Y3CTdSb1p)n zzIpcSAriytiB109Y`oe1pP{FJ8~3FvQ>V}*?uqZDrWNXK&$PEVTHtg(qY?kU-)&(R zaxBB)E?o+z=vZD+>3Oa6#S;PltB9iRAj2sZc&4>ng4N~QVzNTrTKEL(cej6uBB;L8 za*jkbKRz7iNWy$!0(O9!tdRtb3;h#8>-X{5LW%8nn^yQOYHf_<7evN8>1Wih^p~1d z)!wqE-Y#B;M@#?kR8GEn08jDMGjM>hv?RcexrjQbjvLRs7X3KAB3aSndh9g8sP{5UlF7$48Neq(bRZt z$;SPj(g?}7W$}S&IP=VA`+&@bDlL_yH<^o2r^P@On>})ij|$hMbk`sym>aTmBU>Pa z5fd-s`)Y18hO@+TKOez&_CR;WDSb}do37+fL}&?TAF$uDpR^~f{_c?3WqmC2-9>kr zTv@ue&eT))lou*oSp7$Ar1@MiH|$Fd=o3fOu%}?6Kk3~&qE(}I<$2tY*KjxJ!j+Lv zzRNTvif2m*P@QJExB3&G&^hV-HTo9U);Q`06^e59%z6dpLNI_7=z4jraF5EE=j{3R zVtN8o4o%{-_w3xmn-pcK#Lu<3w#3ObXe-_S;uT}~YsAavl2;_m;QnYAE!AV;WGBzw zhrTV1a?|i)BaaqNuzd!7T638PT@Sta8ET zYa}}d7U8kaG|MuKm>l?xX>0UBp0#P4t8aW`-VwcD=@25>mTr|Sj_yxON1j=0SSnrq zle-A#;F5;9>stx)O89Qck=3u475xr*XK0D|HS{Of8}tE1MS6z&b|mI$=n1HV=J*E~ zdQP`(=9UcX#&r$TUr&VtF8dFg^H_XsSJeV-{b(^)nYu<%(*H~1`}*0{a~o8$>KRK@ z7k+Q+WJPi39Y05j2#w#3y;lhRF+FF$<*=8Q>>sT49L5&}U0G5@82*0L6OpJKN?s939;z!pAP%e_)UZvx<5AL}oE5Ca zcTH#PNg>*_7fpwc5KGtFDNR(VP~BAiOs6zT+XCy?-@ovS&Fr-s;vrtjnPJz4k+O#vJygFrs~b`&ckrVg87+2MxazWQo?2 z8vpDk{|tP0#rfGy!FSA$s~Qqmdx?Lk#|~LceyC7j$#YRTh6={;%JK~Q-|O3tBnlAM7)m6eFtJLw*$CG(ijPJuSeeyHVh za%GZZkSb?8-TE>KhjM73Ls#X(Go!Wbqa^#gUdE&SxPmi}Rh!@cZ?Gq3e@Wo%yV@COJ4Lmk_`Uc`K*dW9F zLFfBJuA*DZqPjmRD+`Zo7!{}3QF__%e6fA5F;0lVtRB8ymta8$)n4?QT^J@ofw(yu zbg;A)`Aj%^Ihh57ki&(Yk!|2_3k%1AZmNVAGhJ|CbcPsdcw-*vWlVUB2U3L!;h4$` za>@#D;%vL5^k_9k!`O1!(AQ@AL7Eaps1h}{VyFBZO10}xa(->QXvaQ$B+|<%r-h$_ z58ffm6EuXu%Zdn|9N5^6;>zO~n&h5`M&ix!dVFJazz8kzH9cZ(A4-T{mkr%`2{E&L zFXF^}J&??+ZT??Vg7zFMpe@xVjPjkennly)Z(0v#Il-jiQTS z`P#L=8P`2e@}gY}A7u;%_>LKBcuwc=QE_Hirh_D5n&l39EMk@Rr&p5%&6H(cTtb!P zeY=TJK9h6DW(LQ1hlt^FS-+#GAo{tIYh?J%Uy`Qm(^!tW%c`%&5t;PkJc&GL(}$k# zSrD&34YlxpQ-6kgsLgeHuVlqAFXUo<4Y6j_vg^ z;IO6re~kTJJws$tW6lKW$6*drlONK1L|R&#RE|89% zNw&XQS3b*#9AYz^m9M#5)S~tnyya>Z79e%5g}=E|W)$EwORcnmvCYN}WtQw(-wfJW z+wR{?drlWbMIbDUlLlu}F}Bb4y`wM0N^)md>ddJR79|+ba&`}di3Q5|-a?i`*Zmhu zzJ4dw?tiu~6u`dk=>!;A8!(X4L0oxVeO#x+_x(^R#Vh4dH?o!;4pk>HGT!kfdZ-S% zHgq8V)x(zV;LP~;U(Sb!#u!LdEdyF4owuS(cb1+GnuPrecQ&~lIlKn!-L1v1hRU>D$#)|7Q%b2wA z34T$aG3=ALbq9U9M_@fg@A#Wz&mT;nEwXRzDPiMo^1x{ZxZ_Dq*aK|yn5<0M2Mytq z`Onbkk7Zv)jE19x+;8MvI&8%{!UJ5wS05l6KW~4XaKKGE)KfBv&Wv#nKVzJKq&1e8 zc@Fe7t`_%QtEnSW^L;JcPK+-Q?e={CnaYMVq*XSkDMS$6%zLX>>R^0(>uFxq)-5WS z`CnTaBL5531R+P`+kXn0?B+k*Nbwo2VtF^2Z4-jv(EdL!z|>8txGto|!uCw!2QX{{ z|1u+3aLc$%d9fQko8ILT^dzjP`eWb7{(&V$X~np2`wsQ4Dn+&4a6;CRBjmbO#r*2V zU(>SCN9fU>D9UB;#+8D}!YJv5W{@mE0u`AzJ zr{A2q7;}6w;BYq!Rp4rR1{NRyK*N5g;Wtfr!@T~UqY!$@SG(u-q{_j_m#xy7Ngr4w z+DB@n%$vF1ZFX@r#zzVAb4Z>cm{!Z5f28?GHL6I(V@$q|evov(~WFXzDf{lwUyGRas6e(zbjO{bdtr4`%doBjX&~}`8brEixhS!?w(lRAk=Y#OpWo+al=+e7DFnAmrZd ziu5rm7om_YvqkGkfq-H$b#>2^ZTqVhddHUlBXIV&4k2 z_BeK(p0~!e5GzIm0~6%50QBSQ#i`OW$FtG0i0+ly53_W#Q=t$J9%H$zRPQJ>JR@K|T-3Dm;~gO3(GT;p zcda&lw<$63$|SnBmG~>9VuipQs@cJ1&p3miyuu8#>Z4asm6^;0$dS4yAle6*=}IG7Io6(T3Bltx-_vGr>1zkZ?=`hYOLplFlops^JT*u zE3%kVNnc%%UGk8tfbHEWpcZsNmuvmaaWRJMb1%8?p0BVVunL50N(>#72YEt<=$Ac9 z7``&edkud;C#@h}4&-BlEFi6C6>rlBW&#d0&wvCg&KW}9Cd6}gpa{iAeYd^BZs>%8 z)e5=x0h#rP_mbs`1&~0K-|X<_wR;#Qce9%;K7qxqLpi_i8@;v}az%~LcB1Jc*bKOB zVA_XYNZTlN-9>?k*q_BsL_hyJ{c83`herf>fPL-+=WV1SFH!qArZ*mvR3bB2j27>^ zW>eOsjlC%CO~w^$N0}lQ1-VGipT+FNK4Pc1OaiKR)65?Dn_5f}(@7e@_4h`!K;+#k zoUIW6zcv=5L_ScWq}HOw5>kE0YSJt%WdcTaeQOL*2bMe~ij1(-cf;NJJ3V$|AqU9g zN7(GNrgzi?e(cISYQY;g<=uker#OF=-}JCj@1S1is8XySyvFs}Jfje}VmPZujgs!W zj|K~~Sj+w8Hfm?8YMj|)YB6i3u!iNS6`LN)_NPUl--p%{fB1LPkIio$>6Fm@`PPz3 zh-Xzfd6AbtSDdT#CMXrdU2H*Gtk-rr04CS-b+Lwt%l*ws%V z_%&jiEHD53a6XLBc%VyBgr1P)84^>ra>6V=93|GivN^>0D+Vgj5hI)qa~ING3M9PX zkWFbt=YGTDRuu?Z+bTohlxr8~hHaG@ zptWVH>%|R6^>J^BQfS=70s3IY6xq2xJ|YBYD+YMFXLXGvUhSvhnMD5IUc=Xoj<01M zlN?KsH|=++M*ZRd9s4I(6GIZNEIdP4YKmV`f89uZm_`%@%mM0VKOdewQlJWB2I}vp z^bM9BX+X+dX3DN@^)EIaa55`z8_EyAMb1XtxsO_(H;(?Jgxs5s*I;Sshkj)%v)a4s zEsqPnbg^s{@jQV=l}t0J@ga19iu%x3oV zEwMD9``rJiBH)dKp1ZoUQ#$@$J;#TO4g{d2DupUT-e{5mNJ zZaTplIBvWLg!Li8Yw03JD$4)Gb;>R-uHnK9W<=(TFArz)zFY-_)2oC4#g%--%e4B> zk?v@_oO=~kXrCxi;e)U0h>>IW@4qA@)L~2&pf3jJRJ?`{*qc`59fKUUmwigIFSagP z;|GC9gzP)gE-B@!{-%^c8HIEa_OB# z2^S1kf^I)TXCxVc&!YZ@F6QsZE37+suMEwvUV!G^@cye7`((9n?9GN`!O&al`$WZH z=K5RNlwv^<2tS0gFqNjsX3;xHL7YgRW0-JuKJp#^iesT+Rn9IVWGZp)ln$M@VGRpE z_HnC?U-&SOy#Pf#x1(|0{Cq^u5rSnyYwcaVOSDKlO5_Iw2>ai2)c?N#K|V6h0S$@7 z{;_}feXgAn%As2<^E%;?D~%E9M|3OA#n)%UvuT&dA8kMK(JfAYs>tyNm+gU1GWs1@ z-L286$MHTjg>S7#MX}A5X0xVQ9s^bvq*kgLZ%^%i;g)b6wG^#g)HKOPt`wQm0lt~K zz3@Hpv4#ElsUec`HI=Gqf0tqIKb3+vIn#vJX{vIz`&^biiE8u{8SM5%-KFXkB2#tS z4OY7k2@Xo9Fk6PibedKktbGXQHl>v>YO0XE3cbF&4ZXd~_v)m@hrf1A2GBgbL0LYT zf7?2!rl%EXtk+Bulz#b|oG>oiIZcq>o6d-W)}5YNR_5w*8n;DGwsf`v>X(SsBp5gFu7~)$?VOhKmw~N}WW2nqMzb`>29x zu|9ue-mqHbdUmZJdb0#Ao|V}_WNhiCEzqrf{tR0KX!Vk-Ck(LR1fab5CNd-%beWqW zbw$Gp<N08)T3_LE>piK(P190EMzE z_9N{R^c|LzPVUicH$vmPk@>+Q#jG%)?2DZPZB)}=NEiJVp93^L0AS}nhHv_8AH*aL z6BhbN=>Si9XwZ=Y{<7`xkAy0@GrnsfCMefDvVpYno5>keefr%~gE_4Ml!g1gB#M0r zjKWdEHsYeoq0Myc{Pfi6-6ugFswqQmlXE4m!d}Ux6|2AboN{bTIWLs1E5GFk+Ax~5(QEgA<}OpSLgmHC_bs}H`7!WPcD~_=}Kqs z6}uitr_c(NP~SGPaegNyh>H8BUhr}r-eJ$WOR^{Msx+sG|6xX5j7j*mJ2d_Qnv(7} zed_oG6fG2(z};}W_Ck60=TW{$Xz#W-Ml^)X-Z4-tYUV?8+xokf>8AoL9WUxUuR3_~1KDPZVPK4UO>N zPceZTX z<{v2A<&EjCYl@N5g_fw|mnrhXHo3;rZIwigw+Y`#b{3 zQan_tfIMIwz3x;q!pN0R%4ntN_AbUrEZ@x&@VyDlv3==u1r_nfvX>aH2}|+z=Qm{U zEkg{fAd&i2y7E#rm)`*B>yu5_ia+TDygViKk@+Tr2l(vJp+%;jrKn$AyuRsu(|H*; zUSn!j;r!Xc7d$sEW`)u32xld@=ym%6{P$=@Vp_dFoAf;@gbYoLB8O%<<$SE{>*=5m z?pAp;wz$PEcgZmGH)o|({({8MxipVAl(%1OLH#OIw-jgOCbDbu7lr@)t!faL)!_w9 zyZ7L;F5QN09!yqim2`H|>zf8R^EPb@foA*Jv)t0dKhZLB^0(MqzmW2v?PPKXu6gv$JLPi5_0E0S)R^>iUiI(?=%>5PB-tI z-;pojANiUQ;NLGYk;RhYAG z8|a>BT1lWt@`Fxowz;%nXm-tgpt|1~xEa4lQnub_DXI*a7Dp%yDY?TNIO};W?gw*1 zJj7Tm0U-!I@OBu~Du!cKFedZ2bV}ShxLqQJsK_*s3YF|96t4Jd{>Wb$s;gF6xwE!svaa@)d-$$&@=F(3<(~vP$s&RV zR5t6T0A;?cG1upDqW z`A^)J3wDtimQ7r}wxeY6_}B~#V*gK=w8n{`qo0!q%kApMR(s3K>w$ z;+*{DY`lFcy5@2KpK`}$kl2i-{HECyLyOP7=@@ZG2=>RYbeLX8FRksnc~y3#(t#7^ z9slQwu3Lu6{mIe3&5rIV9|g!e)AW1PeHmLJ2hNjI5)%26bP(*e-2vS?e)hrY@0ftuGXoWuxOXleP;NJ5H}Wbz>2~Rzc@IxG zUPrz3dfKp`5lbz5RsIiOz7}mAdz?w7_i!jX%{OKiT(>>Kyy+{K?0pLN@{hprW^O&& z_RshF(e*&kkh`#43{qi+LljSV~yA;Exdmd9i=NicDPz|VB#^l!L zW*$9So8hA>TD0dN-%6#57emQdT?NkKN&&d?)Pz)~jTfC%@)GLxyzLH`#j#DTDME|| zqrC^5!rgzJc3b?90`!vb&`GX^>=W-N48$+fX7HgCf`lj~2FXF*>9oyV07_6Nedp>% z4@QCk(B-GKbUt}{K_GUzSdhEC)8cbc4ip%kH$!c$$6}1lXRp9IMu1>d9W3Xwh$hdq zd%?d2vB__qDKnGQ$t(0>)6|;?iVn>^L($*X}&ej@Xq9%!hQd|?%FDPN*lw?M5ZT`@E#h}hn4}g+l*4GT@w=3J z*|iZ8vSl%uHH56gcrYMy#lWRDHL@7oF_o{jZFcA{Bd|~PEiD5av7FYz)(kiX*?Xk> zIO2q}2gmwm&JA>o>_PHU-*?q*T+4D#Z zTR=K-i=nmf3!$xN8FgI&9)@3Uz&^t;$9F|CyUiDGq{D!PX5SPQXrj`$Js&K#t!Mlu@M%~lcKBXIZ?yWj9f~S`LA)66pW?dKuCnO&P}@F!!{qT& zfcuUUZk^8yxmdGO9Q40e1+2UsE7$oD)+XxKKU4>;#jbZ|Kw^#0?KF?iw7lZL^#}dC z#_|Nh-u3-fpMcdyw2Z}%gYj?a!A&fp7@_r30!Mdx-fDr#zJl^CZf%_o+pkP^8`acc#a2Tv{rw&bPRGV?yMz3@Pfns*cq|N?DyBBqk3d6iw0~*w9JN*Ljnn zudkWj4#~9WiEgKa-~Z@*YEdOUJ#TdTn-;Crn8x~dn}f_N`;Uu1$$!(NozYnT6HY%& zeyf~dk6MDls&1!qAJj8u)mUu51qyKHN6zC$zEU()119X6onK#|!#>h{@jM&N122?3 z)V@>?mUVfjpZ-;d^G{UKx9z*=xzk>hK*Rv`*R81vW4?=DiNoMq*EqGg3djeFbP%nr zTxGu-D}ar@sbPC}pJIXV$1+3SA=}J;*X@=h6oNSpelpks2aH*mpi{{@U*mq;=a|TJ z7Q3FC>J%7L*8?`?@abPyoq;2=uqbqg(Da+U$qxWXUFz!Lv zsWu>0`-hwKUkVdx&SPw~)4OADAsAGi+GIY#*!1$-GndnzG=b!;KH`Buaz)=-6raXDG)?3Z}UguRB3!*bcACC zD)FYxmf3C32^Cl144`t)B-Vodn7XC%70H;<28}T9M#CPh4)@WDR!tAD?5uoTEB~o3 zQvf8y!PbvavJ~=A9-;VRxeVt&rM~#}%86IB#-D})pgvLQx*rR7bZxce(5m^h$-3sb zJ}mEmq-}Q6>?~BX3#t)LW_dFY^)xA2F^aIk%?FeTP`lf-UmPuLnvD9U31WtD&iqZA zFb->&Yk9shm_b)J2E?S$!$v#x1lr3xS^>@u2HZ*Hw{igI|J=A1u}`&pftz&zKpa6^ zCzl}Avpq4Z*Z+;mm3^yZ3asd?o-k>q@qx>fRK zd$ivr$oSE626me^Ge8&e-l7j{kh1;G);5QcS}Dz)(e0MI?YuKv^@~I)a^&d^$U8lL zU@6x&gPs4Fp>C&BDn_rSvoA#{s}bVu?8iX=vRqV&&W1i>V4tU_T0Z_mkVUz(A%7hq z=-;gnnCBs7zaT>}oNuUOUjB|BJtS7!fO@iDy}jc7!H6X6jeV~vxM<&-> zQW3(YgX$vjE3T>x3MV&MXUR6CbV;|Kb*U`IWqoIKvnYA9Lk!&7rFUzJcM&zCt;4ec z9fihem(TTyS6P)Bepif;28x+QU$Tok`KSE2fTB!02WRWl)07Ly`0S?OF!@QmCce;>>z`rT08@qn7Zp|R<(2%HU)R0YU$SO0G9s%UFBL#F)xm4gb`Xt~-N zKAi$`!KIQrQIqOU<;y^?2X_#$!#zpi@jTv;rtN$a!I;RxhfuApxm2CSXqINC(nOYk z?c3zj%@390AFn;C(EJh_=n=yV$Qi>`rUAO`zm%I4S~rxf+bSDa#wq~!J@SQ7NA}GI zDaXI_&%uL9Ni7Lm<2l%D1H(vfXrAHX>z1@R`Mx`$41@@|_vaM%Z<7jJS_P9Ecqeu+ zlZIqbf;uW#enA`iz$|lLK3l&aUNS3(bxl#yHvoB7J_3s$5>#uaUY1r%O72^G`<}tv zH0p~ZYG&_V%k~gZIEc&seqbD4gNU85Yxe9HfFG!?MGXP3nuO{WU0)Q~l@Y#$soeIWz4`@sBNdkT zOE~={?175ogrJDK*T(F^3@J|PY83!inK!7
A;xgH-+*O`R7lSX6U@_0`3FHISa% zpRXCyoznl0n?*Dr;lb*(O4^t2d17nk$Oqr%bC#)|P?1_XLnbzr$+9=JtS`qd;99eX-(|`|T#c$Q6iTcO^Eh7&HXcnvedsUtDD&N=Q!b_~PpG$&~-!{NHF z?tDmnX#5&Lp*HgL2h7mKmuXpF60o^m=rPmF(b7NMzb*DIc zM6EF*4}W`jT^ILX)Wo`P8MF7AVDyj<8bp4Nn4ps1UL0C{Y(}$H;`DZ0{)>Sz63Of? z40OYytCG3M+*UntbBlL&I>h}Y%d)%^LXmWG=W4x-<@h; zIl#bf(Yb1D4RJZdgIA@UhogOJMTSR&N5y)c?8B`W`Sobg`sQytBY~7+4oln}k6+Oc zOlz<;q8<6hsVVQ!4nr~1*9tr7#z3!R90+UQROAh9CB8y%A2B1$TOOy>D>r=0yVRzw zyv#+&5V3T8in@Qo%2f=01+OXq@`){?(P3gUY8L^T@qaVWv?6(^)OLq-qZ|A5O`W!l z$UB5}ue6FM$$xp%!5{-`{Q~ zVhO}Ci|dAMHIuqm)5=%G=k6$`e=e}oYF!Xn1VU3ugIwfd1S`h_W z>v_j4d^FsRocjPSIV`LG@>7{X1uNxBn<;1Y1SAdfN}Gtx<2sk-L{(j55XYw@w^rq{ zm7sb40&7E@=2!5`uzJcX;v+`*+vT25h@L}j;I_uW!^@^?y1*a}He7 zol#;T?+qW=i)Vjy4O)^vuF=n2$Pz*=dg@j7|0J;qG$#tU8`fd0*4E1@ERff)LJ4OX z=>6Z>8*^1?!!s9oNOkCZ2a{*qe8)bY*~R=9?4MU_6{CY%0Ps=ub@HF>LqS^zS9I=H z&_6t)IxePRCNuj!g{SI2{lU1*P~eKQgkR=#VHe^Oc&Q1IW2VNlC}i7j#Odk5wk`Dk zX!^>ysGc`ox@+kMmy!mh8(EM>V(FCb?nZ>AO97=DmRhfY%z8x8n`Q#BO+d1 zT${EOU5Oi%Bu~Gx7A<-?`&Rw{5XcJ)mOu2Q1@tPwP8mf7nssh%#C+17Z~%5gV>1TJ z@-H8XWEWRZTEhu|I}?6Oj)|AD>^$Ln<={#U2vfLFL7uUdo=;l2h9-ESQ>mdb=sKGl zxrXMb0?bRFGlT}q2LppR!?TMh!}0E;=|foiI#q_LzCnyFEQybZq-ra^gOrmbCZ~}4 zt4^QU!6w_1EGBIOA$oq8FkO@*;|UD<1wnMyp@kU7IuV| zb`gqLO}oTApfCxaMrF3xaIasZV8#gAp7YPBrFSgzm41yZr(%F@*kx>ciR&n_Y$0xgg z>HpgkbB~@BMOsmA`*G(B@x8m)zwa9y?i5zDnwj?H_Bf>?Jl<^gn23*|kO4*A% z5k{@AXJL8t@pdm@nC_8_SA_hcuqLnD6c%1*kJXc9xp#O!SV#}mMBd+hEZ1XaUWzF2 zdh%14BjqSycaC`d<0h>1{p~LhbiXs~N0*btT+cZ^NelVRjhmW=gr4iutMZ@BXhb+F z8n-!mm;=mKwee;&pIR7eNy>i9aqIoJ%6GAz0jJPVT7_1w>90pgl#M4dhrwJxh(T-6 zLud8oa7A|Tfa%1fD2DV6AX_$XU!C#QaHt$hpJQ?XD8@R} z+PK%v%kY3fsgSC^*A;^>Y42O#>XQ)uM7&f~SPuUC;-=U)&~{8D!J3DApck2hiATH` z0^G0%qH@aw!&ELZQSSeH$pHVwI$4;x{$0y;G6g>rpa%WCl-KoAwl3o_1sQ%~e_Qi+ zA&TX=f~@<>ZhG(cBOY`^~;^q2jA?A;oRYI)R!X%oAqJZS)Ya`T1=psD>dpxXTy zYS2BsXC&!caTgMOyKSQjO1EfSMdTkcsMv+uZ~xj_d+Y|Kum8;ik3z=Rs;ho|cDHAZ zIgIPUih!_O%FcJHm_V#4MHiMKHJ=^%47xNN zKcq~9gx=E=*n>27lki^!B`&;R>xg{z)+;23z$SvTV?YQv&eS48#nD8g7XHQO4xwGt zr&8`%qzrX0u?FUj`W6ayM7Cdep7Z^>>du9n_&tju#lxuHm0NyqOmbzH{yY<}oA>L| z=i{8qn|dc;XZA`9;&Q$pMbL>rUJPyc)?lDTBQrWB5~DOT``TLkx`>$ieFe0AOOj6! z@q32bj}5HWsyXi0!9`XZ_sQojhuxe{f5M(o4+Ax>JesPRmFAhxtMc+*FNDt{vb?_Y zspCV6^AKS~T~pdI3#lb~t{HuZOW){drkWGEnhq*OtRl1=ilgG%6C3?k(NOWl=ZSca zO2mC8rPsGqeG-uwATM!PcuJ^oM&edry>GuJ#_qU|I1MwzoX@Ia1QliJdd}DFktr})sfStrkrK7TS zDxil@UJolQzyd|bOj7!y)FLmX4%*Y}#n|ZkE54FtAxD7N)o;sej^^LpU$a7j3vIyH zPXaLVKC(uxwHy=o5!%dd>w@dI>c{6_5?HU-!M+0nr+yZ@eCm{V{jVn=#iPEDLVaVK z<%V7ZNR2$e=b;BWb`(i(S?E0V|I^<)z-7jpP^@u^JCDMAt|(c-O{G&08cM(G$lf-s zD}p`+x`*`~7+nyZ4u9&yV+i#YoUDpO)C}s}1~(|i9dMjQGuK8@~Qc})_)cwu)qG$881hn2={%|r`PZ9?weB#zB)en=?46#QNUpF z?uYl$(P7t5)b&z*9*f^z+2PEMnF^NZv5i{kT(C>QN&lY$uAkS5oKYrGjbx>wm&fh|YP_BQTddky z|B-)kFctZkyLBkyR4PL(L~&))5jbvP`+94`uTX$^{tu&HM9lLG#vf@1qRFVp|6QJhBnd9c%uNlPzy^Z zplj*IVOJx{Pp~EcE4KJOVnbLKrTzPjM9}Sm7xcTkI@IeE!th^j}A+v`Y%dfC(le)7wuWpzwtWps~Tmby|BRmXj-gasdD+Z z^Bk%X8QPCTCJ>BJxjzl5SwD||2g#{1wf+Mx#oSR?@oB$3d#Y&ges16(URacsp zuPy5k0 z%KWQ{tFUNPCufl+*;m~UJ#0>>ruW{X7I&TZ+GqJ$2|=SyKqa8k&#$hIB-nGY**Bt3kj5Ly}tYvSg zgPJ^`QkHca@dn;X;W(;tNO zG9^0(t$OED13ONeORt*Df#96~i`i!?3u6bK>N{PCCJC>Ea?!hx4V5of2CE3NcYjL0 z@@xsK(P)^;(fC;sE`4%(_~CqIA>tO9uj+39_G1hEFOu#TG`L+8SDYZ}{F*`ki6hb0 zigvM}+8nuC8Qsdw8uhH{+frG{$d@ArE%lbSPBg+vertyy>$a-jSKlcc#n-FS9I#+- z;Icc|{4NDA2{CBqh(FNcrRfAL^qln6eA^dTRZ%wmo8fWHmdE#9X)2)Bl||)hJ}x+c zD)2EMff)~|jY-41o+1!=7T)?Tn_0Y|tX3kNE8*vb+cnqkl%jk2Py|!JYu$&_8T{BE zp%mB{s)8}Bc(E+XuqfjYBY zcP8)cT$BmJ&p3{aH;&7?G8V@;aANRtqy46L^f*5$5 zHc}V4Ya3OjPL$4OB4~V&qyEqQlpa-zb!sLAIIXMmG8H4d#y&71vz;z(1YdrWpm*3z zOQ$Au3Dm;U?v@AcH3LNoe}%ivWIK2sP+1AJXB}gPI;%E3 z#SZ=!ntwAcYpqrGw`;WCGv=Vqe7IZhAUUzEX5jt4ah{a>*&+4MilAQ6iwc1ztN4dy zsfq`2p_!8O3ReL)QQ7EBbVaY@`z7EnCL)+N{s5SqejUM0M~1Z+D%Of${suk$kd@T; zi6uyZOjLsC{PD(f^!5%1iyOuK+o23uO^*>6LvFLOc-d?fCf&Q83*mNsJh{_Pc1Vh% z_q!^3&28B=ou~a=mpr+!WG?kbD)RxfN;$ll0an{0>QTdDn*v8$kp`B`X=NGGzmY@b z6+0sMT~aU40oF-zSwi1NuVL7r@j1~cd0QepPHV9SncE^lVd6>*86wQxiNQ~U8BUuPCzHRGTxNlEIj)D-?QqPdaCc$J% z=7IF|{yS5mq|}0?@`r<{lrs-$#9c0C3(ZJYknyPXJ`R0l>!9D*FVXFZ+#0H+Y2t%0 z+8j#aq~880cAFKsh1K)844B^okuiHb;v<7Fv5M@CFQ0q+bzIU>u$irkppN!{-{>Ra z+Z&vz_@<4%qvLJFLgqYSg4h>dK;ws!r!I8GVK^|`8fuc+=%FqcHJG&;2}DMU*CGP` zyJ9Gu`y<&g_(HDTY;oQgrcnlp*l;S8d@oWNA)PYXl}I`HuT$}7dx(h;_*?WsW9RT0 zmag_4j(<4Y?z%^QQ{<)w-MMRJK8?d*IA9eX%V%+pIhNtIQ;5fxTVmDq@M3^bOW+$ zteGX^ZL-wM?*1Ov@wYg=l`iXSC~`d99;>--m#P~Pea1B!%soc)h4VCl_Bo>x4GH!| zI+UDn@3yRGv)eP@ugrJ&rVe!?-7ep#L4{5hZBqQ3$r~A>7QtYF--J@mc|;27iN)-r zV=OoWAF1#hI>#zxas_{JihU!-ns4gmEmFTzeK*iEAs6Cmu(=|lV^oNwU$frg-yNOV z;k@?efCVtK=rs~l4$FVuJFdIV$_(gL?u$%A2K5#oR?6kjADQ66T<#7-u4Wgh?+*EwJ{caM5wpaf$)JwZ_a(|pzMR@1(QF4YN|7Cnn$CHik#WILK z6~{l22umL}(c*CzZNGKijQ~y@tbUSd) z-O=J9r2!S9QmW4Dgst&9{s_X|+WamR9Inv!d`bNu?dP5rImjtX;0H0f7KYeMO|8%w zrk`C#28g@zYSKLOBI?(F8O5Swqqb7+vtR|kgR!OWcv2zk(GRND zhD{f=f0#sX?NMX;+RlBd3kxP$qVjFA_?hxfrCfSm2yVFE!>vDLASPedB|gtDV!h!~ z_E;f=X=A)OOLup#hDc^3!RNQuA-X~jxBE-wKmN#hvc8k% zt?ciTgPvPLN||RUAZ61F)nz36ca@z|cuuM&emtO&=v~CAu+{O$nHihm z?X#KhoEgn%L+<4|g|61TKOELZ?a^bTqwDpLZ8*qzdRq^gF@{o@NEW`U{lPV(8o>Os zvRltG(s%dLi3F`9<5kg$vYC7$vH+wK^>u;Sroa=$mYv;+NTFXbS35&U*4gs8h~bf1|?I3SjE!v}THL{LZXNfCU#IWjFoN#DydcE(KGotU+_2#ppDXg{_}}^2cIvUnc*8%#|GxRox9>&J2&*EYIlvr5YGr{zG-SU}xqYn)DQCn8dm<<1trGHMa z>rs-GH%ynJFL^L1qYn+!$~w|_^^smVS3TA#2uTeWGsR%Xy}x|O$_Gk@f`tMnH1cG& zod0@fz@H`U@|3TX*>s$z4m7VDR%CgG@()7cy>-wF)nlT8fj2?%HUmfEqzV^?_&j07(W7 zybi)PEMOny(d{d?a5{>IuoP(OYRtrhzDDhm{IQVD!Fm;I*Xj(&q_M;j~W!PG6?mJ0bb0TGgR? z9zJ&g<$f%QW{2j{M_>At&b@s|sdqm)-nm*!t-iT3f+JombTKqCCbRX4%%c~*_Bc^F_bkxc!Y4COHaSXrqt{Se zZG`)B>cXF#_+=3@u#a>7#?X~l-5*bHgYG}z;DPKcI#$Ec=FvM$pNF9x7E6+^C5^k~ z(({yC^_hYNzr8`^=VB^K91H5hdAsXh)=DUJGV1Gxk-l`=I8rtF>4R9Sf%brMJa{;O zRe_s-LTGQaIwzNZFhv@JPXep%BtAuIB#iHaF9pC4GJ66~VwGauWAcb+Kp*b*5RWz< z9@D}vx1HdBW$ZgwGjAeLeTgvl+mFA}fX&5_{3wphTj9zie!VlCm@mp8G0Kcc8{~BB z`Z2rP2<7Au^ww{BJpnG>XxmzEvSX(ic%&>0<2E<&?}k1ym$|P2T2|KufkqIvD$*V6 zshKAhpidRVZFX}*j2hfWpVa(>L#+^K);Z~oSc|P0Eo6IEwORRG;J2~Cr6G77>--`w zMiwC*mu`GA$+IzREed|Ht(NzXg=0pqJ=#wxdtr-4?A1I*LGH19O{9~3vQ`~4P-i#; zn-d_(qeLFgR}I&~f{F0;%@XsZisA7Vd1qvvY;(2eS|BX&Z`Rx8h(>?LF8h+g{7Puf z+vAxY%meH4BLp^Ltz1QWfTO*q%Mj!N$VegF_ha|SIX9a6^T0HfvF!m^=9EBKf*;8D zJmk@nF1xHi{pO&ec@Wt14V+l`Oa0|!FJ=%)lD35jII=c1$Q<?JRK6I2=W-|l^4^J9J$jIEQ8{{wNv|*c*}3?=-D|_qvLB`d$G14 z4t&8f>Om!UZe^=GB5i|qT@1Nb1{rGAl%AAA^}&~mxg}==d_n+J8IBj63r-c^i%uz@ za{{_7L1NE~C;fj1NJf4=#Iz0vf#kS>wLQMaZ{RaF+b7{uf5HL*I~Q6z9M7wG#$P{c zsD{#ntk*&KSb<}4)dRV2;oG^$4Rv@vX^SkDPaIblvdw7$ z{KY1}8*<d!6{O}t5pfnx6_F+ZM zD%!%}@`%Vkf|!t&z&^n3i@YU>8e+J4hn9z?0~zN4HoJAWU%!zdKAZ>oq(Z`gBY%1s zD^t7lKtJ6KO%z{XZKDNif+E;}MObg(uHeg-+!PlQ;Nl9ff=FR&;wVQSZUsf!p#eUb zfk;NswrIaq$>HzHYA&`XLmwAHUnY#Z0h?(Y#w3_D%*9@+>!2$71qjrivU~T$J0T|f zVG*{z9Fd!G5;kSLziX76I6E0BoUhVYj#MA-9oLP(%wYXV zjAyS9Z1^d5mRFz_8effMKvh)|xA?^!%~#0pkgUSL&%DtABw^tK(! zoN{@Zvs5mx4brB}z{YG_B*(Ro`qE%bX5tE~Nf%4j66=zGTWRkz2;ZjCu(pZLK?d=0&}S?H2{@$9ZW$ zxjAHLpYxW*%EX@j=h#Q^B`)+f?3?6yqAGRHZ}aFue)6lYhI2HTk6~lB-t0YZdEVE; z3?@?S++70mX41nyTCz=J?%n@E6xARLP!&p^N2zqv1(iz==!f=~s_{e*yu~?iRJLOQ ze6j!!!>_q>zuD(Q@_|6Yz||QUW$@-3xKh(~1ard50WIK@4p?4OH&m7zI8gaB-7>ct z2?EOkLZ`WG+Y6e81ROs@AE}M$7=~ScB~M>C>*k9_o0|VF_bsF>iMvht`dp-c_?CqL zIiA!jC*VET#l3`P&eM%sCgPD0ky9b3jC6Nkt)OMP1$M) zsl!Mk=W5~jjO}$_?QML#iT#fxS=0VMp4JC5r!Vyy29pQnb>WLPakqA%n&Cdrr~@nw zKgCsOTk3)Xjo>uaaXH_98h?(NR9n=|QKmfDrib3j5|`SI#MFC?=$%YcSablzGQN*% z%qix5`frCZvgVR{=f^Nfk&8Q_N(A%35IZO@P|!Aj_w@9Nf%6}JnGNaa!wjhOUl{bz zID}nfQs>MW82I->kCW-9JikDU3IQ1wAUnf)i}0t<t!kGlj5Ds`AQtsSKVO3GgWlY3>OB)|J13793~IGD<;raI%_OJQN<5 z!T#N&qoPPUMry;D?|0KY{9G0!xtAwX_E6^fx;=QkcM0k7Dl0+;D~v+JDS)b=f<}k; z8bj&a^qEWZ+i+PIM0&D++sj7W+L5^2x!<#H}cKN-!>hYlcf*wzgi)pIo_a@yzKh;v_$W~&sbv!jfFsdH8 z;Wl^NXY8^KZ(`CmM0>+mvi2=l%Vp@noTANFdT3`wIo!DydofFMifuiZ2~+Whit4KI znDXKDCno)|pqvv)-yp*-z`V6I*38;9dB)0Q!8sGT|J3Oq2Hjl|uM%DR-2+woYHjHB zQq1iew-RBx)mc$?)O7mRq6S~;zyWF2A**-3PHcRAXfgYPn?jdrVWiL0lr1Za6ukKV zE`JC$CNz^p1d}e#DKw^bxyKI5xa2~Bihnw@-Fpkap^u~ubYuj;Ox4JHj zf~LAyH45TY{QFau8}E@`< zMiyu1%dPG5#RPM<|2Mk&!Z+aV>rgp-$%ppY)AamD%qivICV`a+BCL&nov*S~1SU?) zE;&3|J8_JA6rbd0-#zl)U=C>wst_Ol5;`-H73cB4s5EBP3Yxx}JslCkjkz{mo8Mc4 zb})rZYio>wj@`oyhHJ#TPd+wH>*(s_NzO4%GU3GpD6Nc2`8W0$dHOZ5X`K`o6zYQC zwoA{zBxH7jocy#oP-9Ce^r5y5NcCnP{rzmg2Ot>L_0*rlFQqaYy^=(vAjI^Kkb7sv z*ry_6=t*$mW*dBl8KY8*(8>Bkk;K{P3HHF1%kd%g#fl760xy5h{r6J)dra5g_hSPm z5l<4-HtWe`k5XGtF^|_6$(ukuo4vn7Bqb4ue=IMeh{Yyk7~wb9TR}5XtWMj^n!FyE6y&uJSVwEXy6TtvYkKRhF67A z-pHoURY#`lAr2by?n#&L{Ff&zt+ohgd~saX@L*rMjp7rHs(68OFGe3J2q#(a-MD~# z$29-K9|$63`@jltkex;%^jr{&mtu+KL15fD_d@!ZK!c| zuxS4lEwST5JrT=MYHSm*_Pp>(d|S=s=Qq|F)@|92n@{ij{Yyt)IEHSLvV@1vo|RYkIr+Z!l7&S>J!+uW|E)7WplhYC^~LT_?W|De z{*VYt8VRrg?rJ(0j4F`6>p^k}x8vnQ86r#{JdmihB_812XC&B=Kxfo396)$CYZfwX z1WS_=_paU0s9E1NZ-5R=zCoBbObd12b-2Vnw@-h7#X6r;oMKgHR7NssK*i!9B7HFC z#c$HkZprp{p)?xd;c1XCfC6|7iX_QR`6b4eH~13RTnqW|9{to?Yka?GDC$5MaMKPU z(q*f90^lQtz1g`{kO4a>obqWGW=>=zf+`-7*n9W}^z8*WXF}~EmO3dr7-#@G0U*s= z0iRWUkAQYZSaA&;e0he3Mop7}f)nnf1i%g>IBrwj=cB|xA!DXVh8BJYJZZ>A?KY)8 zyf?$QFWy?(R(uj$3N7Q;Q-uVigkG?;Y&JW2It#dhJo=7XV%9h zk}X`o;D|GYei-=TO@s7%Z)WY2OU_*V=oDPZz_q}|22 z2eR}}Pn|EJi<-|un=pgdJIES4kip+9vamE;=xBx(=9yMw;1YzHuK*eFIp)HTEANsv`Y{7K9KW)|qFJS(l zJ02|x!p9G!5fWP9+J=?erWnrHHo<-OeJZgs)jb4(=LzG&OR~)BUCYa_LZ-98{$_4- zE2K$$Eb+m%d<%#Od+ob5h13x_PQe))0Ni9JC)Zo%gCxjKO%(rpF%rXU`J>805Qe~L z6zT-aFBccNyxqPkwWz-f{_4k^Z=-(-TdKy^NJ6JYQ3DQ1L)8u5)UkooY;1mnhMUc= zec`^912ymiwOHXJwOP7+^sZAHrm+2PgI)z!a9DW!$Mx6U6W#GXY^8*qIrud=0f6&Kgt~GVQQmN9SOG& zfcEgBsH3_F{4hR=NNTqXvAD-j;(p^Uj8__(OQCNgqS5_Rd!K=-m2BonQ z>DRpXPxTqw8*=0Jd@BI0x^>)6ouQZECB;L2;;V!-Lj}@H!s9G(~`-& zdgt_nvdZxBN)a;TEi+of=F z=0o9=EjZV3X&Dl5PJPZg`9yT zSaq3;v9xOl6J2Q?vZFuU)#oR=1!;Qn(}*#1w9RK6k$uvRqEo)*&#pl<;gdvIiWa^$ z3!fUZ(q;Go1?T?Bgk?65jU=m6*myCwac^hmXKZ`&H_3N1zc_KTcpas3vI%8TkYQaC z50%yy`S@EXX|uQ+qhzv0Ax!7>u{ihHmWIN4^$mrseaQoIGn>&ihp)WrA1u*^a0h3i zmGyDp*ELogj{GLk)=za=*57(o@>f{9Ys#@q1B?-=x&u|#%$_OJR(QVX`LxNk!SA+z zm6mEV%_~3oV8#?r2df5QZ~|&hgxVHKa>G68_d-^vsYo5p@ICy-(3_T{K4N0c`>j1G_Y6} zn2wF7GLPM2nv~`shlE><+12@S^WE7SBLMD}JgM!sG5X!uU-dw8IWCQBBEz#7NG6e4VR%IA1*So*&3?QahUkwed)|lQy8$6Jk;ctG&Z^z>Qp)@!F z5=M0g>C+rF{H6cW;Ev6uMwF{dN*<;9hAkytn*f%rKzlz-=Pt5fOl!sfNej?72@=E? z5p)y;G6sCIN@+iJBlo!#w83ATrpVAspMU*=NdG34Dx)ZAyws(MdSK{G?*VPn=RO^B zuLd#{Xl{8!!WzUPfsGl(2EOEnF$w^iDfZg^1=?zxnkOjh(uxe=;bri1abZEorp+VV zo@(IIQW+d*2tR#{GA7CH@m|BkzHDT=sl8kBp#Yd*tgluT1KsY!lN0$Qy((RayUf*iF_V zhd!sTk^(Z^o8afl3soWlS+Q$Gp-`j-N)&cW<>|rZc6d$8maP|zD#RLS zye*yU%vYkqnS}9)xz&Zug7GH$68m!L0yEgtc?i^_PHnorLis<(;gDV>f`p7P_?wcwN?1HWWTw)D&%Qc!~yV zhI&*%Z6DA9%jTftAw0vM0?>Ev-!5|(Cx1e3VNbdsF|v#U;fUW_iAeMK=A`*N1Sjw; zoKG+_C&8{mo-sywEhLy`NzyYf&eY@6dea|7o=_ef1?}>TA8*ACF3H?p$Py;?M{Z~t zJZL`6zF8ozJW4t$ZyXFjpGh1a(muNEho)j=k2*1+pr)cDWc+Q4>v569mMl)*-^lkh zSP#C1Gw5G#X#X&wxnapX0}cQ(?C;<+s1$}lCez?C^wugD9nEUk=g8{4{Vi{;=Ggd= zkuTccWO-I#5k z?#(Pq^EP3u*L>TrXZ@!nkv{%=HDrS!JgK|Bg+dn|4?kOMOp>%TkK3>8@QosC_IqHO ztPml|>r{URy-kKj6rpk-pHKwK<1(DqK}mvzfhLD)aXUm8Ze-xk;`U{LvFt+_>a<-A z;p3v@3c!AsOV^^pUr)`*{w!$fIZ8pN2KsPmi?46X*?n|Hd52<9sbRPlNRBrf{fydr z`%B1TVXM-NiD5)ShY;q~)l$3UVU^Bvabbj5V3`=*%0X_`Yih~V6?Xr|`N$PDgG;%# z`%4Dv+1to3K^Xmjii3qp$dc`o2p3 zZxC?{^V-MRN>(rR!EbL4JOdVQ{4P$7ZyN5T7o%PnIXXbqT?Qtqs=2DH$Z2vDyB7O3 z^L8%WTMG!m9Bmi5Gq!|jB}1prW~HBq-P7kgW<8G4?GxR(ZH;<<{0pLJhw`?p#dfv+ zMERx9fRV!nCT5pC`b^)XA4$RC%TN5fRfzl&3_Y4yTxv*s4fqv#Uc8Wniw6*>BqZuk z&G1wJwJa=|7Fkil)~3kNPZD#1BKbeV{IpP3)FTR2_Q|h*w5m#F7g(a>*2#Dw2_jeBl6_ zu?N$)o^MwdVwkbwTXi!s-wP!LNmymtL-#np-3Nx zWH`gouC`?wznCXce}co#g`mxGUd?~Y38y#<(M$#IWn&kein994J0YI#C35$q`I-=7#Q z0J+7G-{i%GOZ|PH>>m-0D#`ii8Qd`%ASUY%OjfVUfA^Q9UANk*l8#K89YdmkcIgvS8)LoiwTI8>j@09wC-(s;*wpy`$VUKwBL!OobQ zDn3V)n?=^K8e_#0T$HLqR))CeZs#Fh-t`!5AMHwj5RDi@N)wd?t%v5h+2K8-uh<;yl1y9a76d^=@3jBuLtT;l>I{cg{S#GkY3F+#!5B% zCTgt%5VA%zGQQvFBMhiU7C^hP_wde0IM}Pw?1;Cd09_`aM^c4@iG9JLjQQ6|&}N9y z%=e(_m8g76&=pxmHsMf!=b0tn=2aY2>K&Iq8ZC>`DN0gPu0?Q|{}`op%M)oGlxxqV zfyp(LLvx@=5g5D*WmIbw%9n)gTs=b>=!&d`G$( zmfvY97QY3fiKy0$$d1$sTSbR=X13IXV>q9(Oag*8s#^09cFe zR6iTclbXNL*ssBPVl505Pa5|JHp?v`%_w|s5vs}4n|zZ3TN$_cV6dZ01AmoUM}Wz<`a)ccu7`74|KBd$wTP@H_~yokytPNsDcaUj=%Xox z&s~@Djm^1UD!Q~Pr|^fgwM=l%Xc%_wLk{BYt;d%o)Xw#)BZy1BcK+v{%XzcAy7 z{EuiTodCR!h8b(p1iwBy6{xljrZ59XVxO~i52Jr^L|Yi&AAr>KjoRA&0|1uWK~Y{g z(A2@gb3V|F32M@!u=n@a#;ungDQM5WL#`zpAoZs>gQ~Bli#LL3veR=bRc%iRY4!Cr zZ#u~8yHf7dEH|f&Wzf%a6DE!jKG#j1;4^1jQ(?vgo{{70QFC_cG)s%J) zFYaIb^QE>DJe1sW+F2xPTM+3E=4wY<&5q@HBiz_l&#)kw#(?W-v$+wRyV1`z`n&ol z?yE@dk+b;J`RKs;ZrOqO*u}{svv@-4^_1};(p6oPqBp5(J$MlS7_;_f74O_8#azW1 z3vuBK@NZ|Y^q#rt=bQ=lzmBN1CH%)Egr;^$ukMdKEP-Z<9wn%ZsR)&(#Yea@e)wRR zh|1~?Dh`^@%1$K&V}Au9ytxVR)Z{IKEegrETK6heNd7G;k5-RBhKEd*z_T zDJj*Lcz0y_3=TEEi0Vz2x6W$x1@g5F!?rQ5D3`^<>k)&!cZ9`SnzVu$FSQJx*E0Tk zA+sbIB_tA-Uhi|Qj;&ulebo)q6CwkhyybGk6(aVfv*M6KoU>c1%CQ)6M-4Ka?_3lz zpBD`}miqo2J`?56W`4THQuxcK(ktxhHw!c-fNPH*C1J!EHGzG4ZwYR6SKZ5=vj$PT zOrNIsk3t8G2TUB@5o75)lcK5U5~3lk)^be4cd3=>QpPRmp+6vT{wuybIgR`jf^?oX6GRVqZAFQXN9Vzzrbn744;*2Bg z9 z9*B>YkIDDZ$0J|mEhFIh-i1v8!}<&pmidy!f_UsontBty-%pZ*PgL`L@k#GyMQ~!@ zH{m-2Q#Roud_vB{0w?vh({J5Q{ju6%pJKg%e9Y?z?c)a?4vd(sZX4roe{!1MPb&|; z81hE%N14wb$x-p;b-pD=Novg4$pj4HXszhg--L*=w#Q!ZJ{K9E@&i(GtukO$MLrt! zE#+6-6kn#7#M<)y%P?!<{3^C}7eeH?h+F2ODOvY-Oq}b)L>f;I>W1R;N|? zCi%S~0V`xL3sZH$5`lUU155(E=%^|DkvxeBex)_MpeVXMUnC*E*L>{|kI7q)vaF6h zy;_EaPKuuPeyD6lv3AF!qP>&3$(Ppzc=z9&mO0;f2)n=&vV<)Hc+jvGN1WMJb}ye{ zyYodYr+*2E$ZeYb2uqN!^DWB1JusRsp?4K&Q`zfWi@(VgPlB+-M;lG9Q`4bj0^4Vq zM4wM=W)}!?#vJh<`x%n1tSYm_KDQR&UWi)q=KF;I%oA_BR&MBM57WbPpsqxmG$MN}#IXTj*NyV$| zqQ}VS=U&52M2r~vQfiLqV?-p;6yGeCdL)N!t;o^m3Q9RTPEm_t`vR-=p9L&A2%z*0 zniWQQuj>{k5zc#$2>R^Zz}@8QbV3xW_@26~|KQsnMU)L3tX-IQhNf-ogmrR2D>(f*1CPJb#d*Y|9xH;-nm7Qc9vulfO&X?j;U zQv?4jO`1vpf5*TLqmTI=dCF<-r#kk#{{5l*&aUx zwT-hMZhH`-#e}FRyR&@okE&{IqP-O8FyU&^=|NEb?9$hMxU^*X9snV=8U5BCz_RpJ zB-8YV7H^sG8B5WVTp%mnZ7aKj9Sh4w=-=x#W9wfG9{CS3B-?6#{zGYk$H-0Le^2*A zr#87`R?yk5@BddsGH*_+{8*>(_gQ;|1rYg{Y-@GUDrWN=0T#=zm@+-)`)mmom+L2# zxY&c{CDn%JrE=fD!Wi2m_{49g>bzE7F!1_1IC%8dVXX9cSgLWVq$na;95X6D+I_ro zZUy5XO`FPjr_6ggAC~gh3R}qJZM+6{AI!0Q#eZgCW9(W23vV*f9XbYNIA_%j#4Co_*=*#tjwn$e=gDMc}((rn*} zVnxmWAxHas;hNJcH(i{SY?dfNd6G#pTq!Ha_^1Yb~ucExL71rEb zA9vny4zwJI+LB*5!#aG$@4gMp-l0FVKeIgQncqFuCjw_M^|G(Zv>M5?NSi8)JU0 zNgXc-O^Ny&K@SskhHB1AdWBEQbO)MAs{M6IA-yNTFVTXCa%RO(9Ouiec&#Zs*K(@X zPWw^5?oeWmEn$6A=e@*GSCVbdoEkfyg|}&TX_U3|^^<*clJMPNq&L36y8{}uR4!qu zBF#RdU&UB4`%60}Iq$FuLz&nAPf1rD5Y_X<-vxI^A0RDoASiLPf|5r!(xTK6(%q?d zv;u-ON-9z!A<`lTD4_@vqLL@5bSMo1zvuVIfAE&s-P!kMXJ$X2*(ay}VX4(49ct2) zT1}sNBtfA?Utiqh-*Whh-;p7(>kRpGg!-wrQvLwMgx1%%6f=Hbw!9K-w0LM-aP}-F zUy1GNvvq%vJ~0yeWi@&|U$xQBx-f8&S=BZb5`9+IYoBogg-U7*zxa^fJ%8*!vd(t4 z-`t2+DgWD28TMZhAOzaC55bH+$Y%|@*WpSJL<(`BG+`G^HtcB`#lBeV?sKBbfX=c* zI=l{c>%(f&Twmb#R_7D=Da-DzN7%&Xq-EjcU&}Fqf%HVH!0xLIFXNl({5BDpy_;*4 zgQgWl@`Qr|Sz!>e?dxeX*#BbV<^S zqzutZXcLOXsBO0#&SvaSK)|$Dss6>Tq;-&H0MdxA+=7w5@n>|Y>z_TUsvW$#6ny_E z%#VIDm*N8rdsD!zUOCoMC5MwWnHtXM`tMhgn8K*^-cI-csJSrf*JCltr?KrdMi|r( z<(R56PVw4_zvcLv7Qg(|_YKPu9NK#EW^b9J&VhR`Q1K z!yV6*{?{yMPN?z6PS1?bGa#CL6r}y6m#5EDix-1US^p*O`;XR?HoD~Qjc$CZZQ)uk)ovYtHr(=RG%7fD% z>%KR9)g#x*thkWsnl=D_5|1dn6k{BBS3hqXF6ST#^qe~bm-v#lHzP2i3Zbb94}VO# z<*L`kyt)1BLUHybvc;1Ed6~_@)l=>`jpJW`{tnzrCEQv}PpB`5tk`=rbFxY#WBs*z zR8tA$VEjyGud36~q-HIV%wS>>@wG3Idv~OCCi69s1S4%-6pwUcEHo96)ZV25qMPoX z-`yYQekIAt^7mX*fM>6qvSt*=cAHZuf4$g80H4fR%k`{m=<8W91apOz4m9tb!!d{5 zE(o|ke_2WPCH!R}LW;oDHr8hD;#1uR`S;u^f@C}C7w*%i4&M*60>k&`>ze8pKG{dK zLc0`6tfm|{>9$P{1fxKt!C7Rpgh~inDQir~1$eF4` z;B5V4NlioC7DlDFCsXtO53F}{a!Hp3R|C0ED1KWIuZi{>q^GW2^nG~!m6l>$DKin!IR$VYZusQ}5$Ir?Bd?%(huet~!!;esa zik)HdQPDlRmnxhAMnwhNgybMGHO1!L?`%M1N;tEbWpAtB=Uwm8q|@H`vzEwM2+n3D zgJrjuCT^BOK^9khmjBL*={8Ut2LdKeG<;d?uAk8H%E&b{rx@now$2H?85%Fk5`6^1 ztil-d=s7c{#0fve!g9dDv_lBDXSVl%tq1Kz*4l&ZY_B;@o-@8q;bzm8ELz>VIWs+k z{8ajecf1_l%4v0Q8AkZcHs}8hAWO-?3B{*q)T#cwsyvrf+=Rw>`zm-K+opiY*Ms4T z+5UusyO2qsHwgL(Vg>OXf`7u_jax}xi!yy0pgY3_Azo@O5~$+m2O%Zd%qZKg(XQSf zd)p4Jx~l%iF98*KpzeJ3Wk zlz}&lZap4nltcA4O7A$muE+p+s;kSv9&&0;QsI}6-L5P6a6ry~lm5l@L;SCG4#{gL z&Dv{5S29E?!0jv20;{$f%9um8T;CNS+lH)*wp``r0J@&%7I{@Gx(CghjQP>9C*g& z3p#L_Je~Bz4QK#0=|ctY3Jbt*$KTyo5{(f4DTqKR^V+9y@|<54LBkj0JY9o+>{za( zuS<&eu)8e^LBKzPNWG9gitRr;v)*6Y!(0$(eP8j522uX#f`?O}ue53Z=7-yly>>?) z|8}n(Ce#C08P~dTl0CN9itSSt0*HQN%RS?ABkaiPRXuta|HcbMF_rk09wd?ImsQr( zGET7?UOORn5X_Pm3U24M@b_B%>tov)xtWxEa)opuZ;-L=F>_RqX!74Q+812@N1aBD z;3m7@l%JzxG9=D*o)wF<$VC+NPzrvI?(Jrs)LE8AzfS$xfAcCBD@rPFc=xaW3uTIZK0LpR-qFLo$dMKTcA#kHW0lQRS6~w=nJ{W zkbk52t}4L~#J0>Lze{-TGP&HsilD1;rQyD^`%&0(y=Jc+D%3^CYpNV&L8MVXYfUKN zgRgYeqXfDFsPagKn;Lg3hmW@z*}X2XeKWLNw92KbFVZAG6Jh}1CsaiIs#wiF)5GSz zu%~P81~uObV!t#Cg_%5#>VK<6sFc6n#ge~?-)l+xml$mJKNF_~Ny`a4xrL6AVA2D7 znp%=OLOwiyvE3Hdb%EAhu8M+ z#sts5Rvy#Q@ffu)cx+U3=H9NP)NTUBed^Q)BR6SQ=QLW#_v@r8gQ2r~^2$t@G$u*f zMg@pZn@>Pt=C%UbTKx|DtpMIKUcaonoUo>%?<~*o-rABUw(LYw#&ay!On&N~XZF@} z!GGJKMQ`=rJF4MareCr+faudro|$d&@NvWZ{l$E6nPQg1dgP=l^WbrML{^F{vgP@?F)W<)hWBJP>&bj>7H7PJqM6XC>abJSV693oh|e?#q&M zJyO6AnXo-7)JpZ7%E|N5!Vh+xL=rv08K|RbWWQ+Ay*p5aOhJhxxsgpzpGAwIBYEnQqnF+CBVdeP|>+IA}kfLwI|ue&4H<@2W3_B%nf z#|l1a#Kzsie0`a)9y_q2fVsS&lbiGwrN|769T$we&s$sj!6p918!dbMR?YF9Nq>mT zMR@eML=g7j=@dDVE>%Nl{{hXSx})bzY#lw2qa(?Y6vd9cM3na$yI z96w$z7Y}V}Zc5&GuaBSv;QM1YFp0gEVg#HYuI|}tU*Mn+FCtb$5}g|xhLXwW%mrDP zh|%RAN(PSp$9zOQBTM+KKE*3U+2kML;xqg3kNUkIU!KGMR5{S!TTM*F4K%+oLuPKV@-2R2Up?w#rs{`BE7n*GFZ(W_U*6q8Sguw zYjop`_d1D59h*1~@@RoyiIZ%vaK6Z`)=a|}y3tQk{*i+J(iLaXl4Zvyfd}>k@H%O5 zH{bC-Rr6td&y^=-+h(C?FV=gOyb>9`=3b`K2=m>){P?(Lez2xUyzY8H#v3(PII2fm zD(UEyKBVvH-yTsCyda77aMd>4WMwjy^r?#RBakrg==M>>xnFub;iH#Dzv5Xv`+)NPDQ9qX!RQfb$rjdQ*24ybz69gj zV}|8jglQM5zGpG;X6od%Ywn9}p=*Jbb7)4fTXq{IYN}z3K(6Xhi`$3t4*j^d6b;4> z19urHbh2LH^Hfv$AaI`45#RK_QHco7Zh?EKA zZR9Y6OYi!N)Z_zB2zqEFm~nyZr~}12GMsQI5f#2Bw+bQGsw*_Z zI`EloeQBkd`%RC>_cc{3wyC%-{(Xw1xt*)KEl)D#$8_8ZG}Jac!`L_{2wcL1(&?dO zUa4HTjj2tAkS{-ikz6W11|Bj-4PCd3SB=7bVcNm7#xlevh*j2(#@3d6lv~(g-JE}| z$&s&|KLMm&lf6?kHwXRdbYSuRB=kwHneafDiT2frIl5WLON38S6jv2XtKKe2hLCW7 z(-DiF4_a@CID0G!&c-C;w)lkpzWBQ0ctSn{x$xkWZPH2fcT=NoR|xBMS&Z)^h8?IB zjW}C=Gnytgm8yFhFSd=#^RA7Or@vdeZ+F1~YJ1#);ro*VY!U4}dxT>bP7)DI&Dn8- zF}^pOfIGXE;T(1QYH>WNHT2zPZk+#D>k2~g?x~iI&|L|D!kyxr{w8R zzgkTh{5&CZ`}YrPjD4yjZN;12zLw3GkLS zY3sCG^19EtqKo!zsS1B{fORG0)7LB&Fyp0NUCBdJh`F7h@d#cpI%$@at-cI={h*kr z$rQwZ+fwQU#yydBkZjJrFWU;nLtA+rMw=bmJ=~1}VNWH;Zbxl9$ltFUnuC4#6pr*& zf_Wgf{Ak9NTz!>0oq@0`Sta=3EGCI^sK9_|Q((;YVzJDW8+gujK6POEI*f(-!7w!W zt>C?KM|Oq@-#!x}S#cl7k}M~6?(3DGjv^eWH##1`SM(Ie;c8KUtQ`cm9cndX0pjJI`Y3#{!?-=#8#yD|=N*Ua2D_(Ej}Vw81h3TK{b@ zHc6&+`K-r3@W7*Yg#YUcVd=uD=BF+v$J~uf<(MZ%rDp z7JFKWl%Q8952Tlq^RlU}Fon*UYV6lpA6tSLfM?a4+wl6 zAYJ6AQRW7MOOYzqV>((ECsqoQ12&y(+P3(*Ex7EXWHWf9#F`>buA8~&&3JvI%I0ch z5Sf$D-M7_?F0DFuM92E>G7B#zUk5g2K!y4HP$sxH45nhV`I29y5ln*K%k>Ftu*O}e zkcDnqKyYQmI=zI=J&OH8%~#TSj?ZU4%|-EjyNA2OHogcWAQ&&?E;boXL0%`V11#9K zBJ<^?f}aDksBtSfB9R$z z;(@m#hIb{g^dCAzXY<6x<&3@x(w>{fcZ#?DLb4wp>&QAI=IJnHGPEBaTLLZ{vC8Jl ztMaxq+aLBvW@p<)u8cvN)V>zn>O5`Z>c%5LW9iC*l8Fu%FLpTf%x_Gv6Bp4rhZzb{@GT6{jMTFI+wll&zq$*7kg-#Bo4%xw4ix3-&i7#`AU{BZZ&-HTh=f+w@x z4l_T=t1?`RK#BwWmvjPn;Wf&DDqex1mG_;8jk3zjb?Jm_8Hk^OHAE-gZhzp?g*;?ma! zjLlc5S-u7#bf8`IuIUO)4ZPJqPxs`bqx@I&K$`ugeIXxEv9fajXE;nxoWA$7;ARmV zurU2RS8ijfGt8f}Ut7gw22z4f6tZ7Bd`e36JvkwIo06tA~~a~t+wh^T!|MT zfN0eU3c{T0ZJ3}*I0XK2jRIy7?H4IhMo0BCj0Ug>lqXOD!fsY(yI0H=;ZIGt;#$)- z5XsCBr5$j-^09Nkb3CDr(btCsx5R>)q#(5G0AxR5K=5(wrm{HZK(IVqmse=vYUW}E zP@JC6Pl1ld2fr?asg~nD2?5o5P@o93UV)?3we=8sxWmiF#A!XL2Wsr8VNIf&0J-N) z$jfvU5eNpG`mvcC-3y|7734bEG1X&+kJk<1>rj#+KhKaOsGH!*U^p=pAf4x~fzGG) zx69O$lNVrnwjx5E6)So}6|bQ(XG5y%bR{;pmKtWvD`>PKge+|aNTijr;v~qPAm{ll zgmeO?t>xt2O*IMw6{TP?4RL26_F=AMn-JzQc$7!uz03lTn}^&0qcBL8o%0G85k~N; zua98PW)sVNUt_N0#t*|(>r&$qi6ka2@fR$Vf1N`=c@=bCgami_kz+>pFs)4 z3!^b|dYu>0{|X@RXZNiPTehtkarX*Z-KYii^il^viP#UU#ixHogDn2IC);Ycugpny zEn4cQ4}MBLYQ9(mVgcxvb<|bNAn-fLy5uVEZvfELYjW<4){<%A$}F9wmHAnXnEs1& zh(O0zhRop6bN@;(z?w!o;nKZve^4@IUrauCS~#|)OC?o-gwKdHwyXq)0h*!^`Pf&a zSJXsiNzQIzOY#LZLeXd>vW|8O-4tZY844T-mqCy8cI#blaPI|;t3NnG7xq!!+)a5E}^hT)-)1K>-+(iN<% z>D&3B%GNvz8>5P7Ou?zg-|H_Vv3XJ}D#-m5!|R#b+%T`L>Y)UbgsRP{DvBu|e`l zfzbx==1JA+^Oeq{*)Cn-o|XH-sRr9x0DHj)xR2<*KUADsj@V6-V=4~AOrDHyPA6rx5d=;-f~ZVQ(2MWDr?J2 z(4>pTbZcVx0`B!gEZ-+=OF#>Zyx}s&pBb0|GpPn}ZJ*<-T>=~lU?~R>gMKrig{jEs z^GAt7vd8qjMf_>y@%{eu@1|7+6tf{6V3CqKac9`UHBDN!_v@rZvmj~nj#j&qs?v0@ zu+3oHHFeLmJ0@7-d{)(w@yGi{<~}z*zmP1e^N@HmIVO3rAVvho7AS=w;?#cy0}?D+ zhpYwu@^yJrkmQY^yTX;F)r_LqhDes4Uwc7jK^{R0$jT~+dB+%}`&RBqC_{3>nCti4(Qk;NRh>1dUzP8VY4Xu;Cp@uE2>U)t z6bbDA7;y%rsrv!Gm~6fo7>U`E?4t&3jgEjC0Xd?z_P;4QDOkEqOb@ua|ISRS3&iOh zoaP|Gf<8zMr{?69PW=^LB+v&8L$!eKL#Fl2LoQ}PoaRx2dRAFxQfUHTA;}bm?_SB= zL2enCN4_#}w8eE(gxZs~1<`EDHD zY5{8S=c&Abxr^6!n+A~w7U59nQKH|+_?D}-Dm7%ZNLQHMbDqUL0zld$@SSQ(7Un$5 zEpHUM;p$GzWHhYPTmt?c-Txl zoW5%XB_?8_=Mx1;_d~#dUvy)n>d5JNlSrkLL{cJ6kBKf1EtUu&DH9ycc28?oKT6x` zt7pH1G6y4^1t77e^O2fanR@C@s5<8CYWHnKxnjz@9P8q$P1(xTAbl^C0f9vP1i6eP zJT=>`4BmX2u8VlOLj{2KLy}1L3^x%|yrH;Ulr=oRLWp1XKS>7qirY~ums}-g@9Po9 z%!4A|@7AWZ1W!PSda3Qo2suB`_h#hOT&kr!nr34i0hp}`01WDFq$vP+P5F*N3@=|# zJ^h^!efkq6UtZtzsyCAj@gf5n>P|{npTkqOc4O=qam124gZ-Pl#t)5j1!ZXhPCdKZ z4A*X-$DsBb*fKTe%GfM0GZ`SIUj%$Bs%CQ{B2Kgg`1$l4g$ZnE&@Z_WK10$CS}eY32`+Z0{3tZ;XNqSdX-MQ3`I< zVo}51xhcDjxwK^ALF%Qh!e%>le`AK5i~&r4Au{&*U4cV=l`D6TXG?VDvTwdDJ~^_` z5xAZ95<*J8lLbM&PVAoty$E`&)aOmKp~>gP`>Qtv3KI3Myp+z)Sh;LoVC0(v+5jVl zhu?HO0VO&xzOR4$nA5e{L>RLL^1B=n11EK;&+nUGr-LuLugL@#4*Lua73X`2E))Ah zAU`z#FOw`!TC)oA(#yajAY zVF;w8#K9N=EqS&N26h7c&%p*%IYcVJ7I6+8N(p?&B)@p?(y!3Q3{m?}tgX~12 z?Dhe>7c2JGx5Xbrq8IG`d-muugm3}DXR|^;K*b@L^U=3Eb_l+n;@bh>cm$+#t^x-# z+0?E#_qPcYfOrh_pGK@nHT;Ki#j!QFz(IqrR@c9-nbDzc>D@s_uV3kc3Q-0L9>h%} zYM|LshVYnr)pAHm@V_~gh;Od5VW!Q@I>A=y{$Pb4Eqk|dd-O0@37&)j83u?;Q-HJDiTtgnbj#dFu-ft8lM<;0C?O}03iTQ;exgmz*jSvZr^&m) zI#K_x_u5f7@WAXdC)jV%?J{uQU6`v-%h?lah$?6({VRcD3ukxC)_lMD8whxb?8r&v zC0|B}Pz0zEsk&$PWbkEhK%5y3X9T+aNV*$~2?QqM2N4{&5=0?p;BpRlZp#nEIuf&H zhUsCKjQ*3#2CiLJA0ESuzRZ9`S=kfnvX2jq!P{!2%nNMI=KjsL*93xdF@dOX^6^0< z*^|Vqr%wK|ZAp_us^nf&yfFv$ea{T|RA7etM1&K3&(%FRKJ+7>6aLq4cj-MOo&xaF zrhwbr2l;&L50w}0ghSahC{S5uqq1P%=4q}-P`0KY!B?TK@YwA<0>xUnq7@fZ4ce)C zGa#+j440OX*pI@}*)#2rg_52A6FkkowImO|JN_9|D1R0tst@|OwWttgh#WHiOrNxJ z1JsujD7~*@Wj8L!GY#xtkr8YK6a^?N(&r=c%d0Z}--@3SAcx{9_5-pI7hNg|#eMU@ zcl_WKicCRfH6s}52+)GA->EJIJc^Ow8+yTPkFdqJ6+n(OFEF$01GS?LDn}BWK#_*} z1d{FoB=$=kSGPE*bSLL5D&T$=6^e?H;U*I-)(5HzMY&Y1AT{=0r0X6D&`O=nLh`L4 zxU*7dbhL)L62*B#D2j>DK(wn^Y5%WLxBxSdsV9sPya(DROW$N<>=&XPq`Y!P{=dh6 z(y4&=Ld@t)eRZcRWDL2Tge7s3ZjzR(j)EUXfuEN*ICOtK3b+6>!%gM@`CY=6m@nPl zcW_z*gf!>1yP$L}P{qMsMtpxCRP%$vDdv?zRGQ^(Gmtn7@ZTihgEPS^0Pk$u3R@3{f{jzCa>icOlmy&u31Kll3w< zMBw-q)({*!%oQW-rmTKxkx0LEt2C1oV(t>c> z8>nsrl9D>Q@RAsN)WZNT6B{aAyC7WD-Z=pxiw@!70{+r^@`29^!Dn1lIC&wssH1ZN zR2JF{MUK*T-wHXyE>7|nsRF$O=}}9FD`i~qv%xj=y#I(O$ZQZJYv8lmeLl3xu%DNf zcF5qTD1LV?I$OFy<1OoZ(-?`hjiO)Hk9V%?07{r(lqqmalNSvPdfp|6&qrw@nN&jK zuBv@a5AYh5ry}TU@uulesaPVgPdH;4Lhi~gPCA`ZLD(pU^c^X1Kpajt_uC!P6%rL0 zMIz=9jYIBU0$c2z1M+C&aL!K7$Ivf~J_?HI-ss-xll6R$41X%ZV4NzZ!35RqPp-Jk zjkIVx{^bc4mDPpTWrfP7K`~<{C?~@~PjRv^9)49WrH{xPa#v)k`&JE_z<}4`5CNn_ zsEC6}dFzzcv^223(%*2uoDq-KiO(`rgq>(r3^gcPnEdr}A*N6*^vajEM~09zTN702 zB@?vRr6KeKy#>m7v8TU1sXZ{#?dL4DWC0$=O@s;HWP1*}EF?VzYl*(9c2z0mQX<#b zE589~DKJfupQQ;3k5$D)8Kb(?mxy_t69lAOsfaXYyeLP~fLrw?+e2j_1nN>g zqD4{^1V&w`h)%{Y8Qxovm2L%-AM*mkEytap^cSFX3xWNf5V5$+N4N?=+guQCLK%ml z8S9Xl?T0;uV$7eSwSVdd6#r#w;S8OaIU8uIqc8!$bRM*_I*@Elo&Q+Vj!`A_rJ;)U zSsxean%g+#V<;x882qoiZzl8CVv|OfMCO^Pv*@Csm>{q_uTo4hgtdI+3rUk~95R>Z zVPh%;n8;EQ#|^2v1$}imqF|l?cfh`~bd4S)?G~uwCKGfvQwS%-6FDJG#^`U`^j>=V zOoRgGuELu(DcwMwsF)?Ma=_BU6FNO}wzM#34wN#SgSyd3%hR_MggSg9@FYsdBE#9? z6u3v4ylK6X4e!*^Vvhc3?!f&y)~!~(dw_K=xDuDaWlp*6Tn-aiMts*IGvGVg&twvY z^Ee1Y+ceifEyAgYmkaX>G}m$`D7&wddPsHvZ3c^Rjor4*FKl{Ttzg|2HHk\", refused.status_code)\n", + "assert refused.status_code == 405" + ] + }, + { + "cell_type": "markdown", + "id": "74f4bebc", + "metadata": {}, + "source": [ + "## Stop\n", + "\n", + "`shutdown()` waits for in-flight requests, then forces the server closed. It\n", + "raises if the thread will not stop, so a silent failure cannot leave you\n", + "believing the port is free when it is not." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "53a3e8d4", + "metadata": {}, + "outputs": [], + "source": [ + "server.shutdown()\n", + "\n", + "# The port really is closed now.\n", + "try:\n", + " httpx.get(f\"{server.url}/zarr.json\", timeout=5)\n", + "except httpx.HTTPError as exc:\n", + " print(f\"as expected, no longer serving: {type(exc).__name__}\")\n", + "else:\n", + " raise AssertionError(\"server still responding after shutdown\")" + ] + }, + { + "cell_type": "markdown", + "id": "8a7742e0", + "metadata": {}, + "source": [ + "## If you forget to stop one\n", + "\n", + "The server thread is a daemon, so it dies with the kernel -- restarting the\n", + "kernel always clears it. Because `port=0` picks a fresh port each time, a\n", + "forgotten server does not block the next one either; it just holds a port\n", + "until the kernel exits.\n", + "\n", + "If you want the shutdown tied to a block rather than a cell, the context\n", + "manager form still works inside a single cell:\n", + "\n", + "```python\n", + "with serve_background(node_app(array)) as server:\n", + " ... # everything must happen in this cell\n", + "```" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/packages/zarr-http-server/justfile b/packages/zarr-http-server/justfile new file mode 100644 index 0000000000..d65b1b53b7 --- /dev/null +++ b/packages/zarr-http-server/justfile @@ -0,0 +1,68 @@ +# Development verbs for the zarr-http-server package. Recipes run with this +# directory as the working directory regardless of where `just` is invoked. +# +# CI calls these recipes rather than repeating their commands, so a green run +# in .github/workflows/zarr-http-server.yml means the same thing as a green +# `just check` here. + +# Pinned to the ruff that .pre-commit-config.yaml uses, so this and the +# pre-commit gate enforce one standard. An unpinned `uvx ruff` floats to the +# newest release: when ruff 0.16 began selecting BLE001 under the root +# config's `B` prefix, this job failed on rules the pinned ruff never enforced, +# with no code change to blame. Bump alongside the pre-commit rev. +ruff_version := "0.16.0" + +# List available recipes +default: + @just --list + +# The `examples` group carries the deps the README examples need, so the test +# that reads a served array back with a zarr client runs here instead of +# silently skipping. +# Run the test suite; extra args are passed to pytest +test *args: + uv run --group test --group examples pytest tests {{ args }} + +# Lint the package sources and tests +lint: + uvx ruff@{{ ruff_version }} check . + +# This package type-checks with mypy (see [tool.mypy] in pyproject.toml) +# rather than the pyright used by the other packages under packages/. +# Type-check the package sources +typecheck: + uv run --group test --with mypy mypy src + +# Run everything CI runs for this package +check: lint typecheck test docs-check + +# Preview the changelog that the next release would generate +changelog-draft: + uvx towncrier build --draft --version Unreleased + +# Build this package's documentation site, warnings as errors +docs-check: + env DISABLE_MKDOCS_2_WARNING=true uv run --group docs mkdocs build --strict + +# With no argument, uses port 8000 if free, otherwise an ephemeral free port; +# an explicitly requested port is used as-is so a conflict fails loudly. +# Serve this package's documentation site +docs-serve port="": + #!/usr/bin/env bash + set -euo pipefail + port="{{ port }}" + if [ -z "$port" ]; then + port=$(uv run --group docs python -c ' + import socket + s = socket.socket() + try: + s.bind(("127.0.0.1", 8000)) + except OSError: + s.close() + s = socket.socket() + s.bind(("127.0.0.1", 0)) + print(s.getsockname()[1]) + s.close() + ') + fi + exec env DISABLE_MKDOCS_2_WARNING=true uv run --group docs mkdocs serve -a "localhost:$port" diff --git a/packages/zarr-http-server/mkdocs.yml b/packages/zarr-http-server/mkdocs.yml new file mode 100644 index 0000000000..4e7843f36d --- /dev/null +++ b/packages/zarr-http-server/mkdocs.yml @@ -0,0 +1,99 @@ +site_name: zarr-http-server +# The package lives in the zarr-python monorepo; point the header source +# widget at the package directory rather than the repository root. +repo_name: zarr-python/packages/zarr-http-server +repo_url: https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-http-server +# Absolute because mkdocs would otherwise append this to repo_url's subpath. +edit_uri: https://github.com/zarr-developers/zarr-python/edit/main/packages/zarr-http-server/docs/ +site_description: HTTP server for Zarr stores, arrays, and groups. +site_author: Davis Bennett +site_url: !ENV [READTHEDOCS_CANONICAL_URL, 'https://zarr-http-server.readthedocs.io/'] +docs_dir: docs +use_directory_urls: true + +nav: + - index.md + - API Reference: + - api/index.md + - Changelog: https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/CHANGELOG.md + +watch: + - src + +theme: + language: en + name: material + logo: _static/logo_bw.png + favicon: _static/favicon-96x96.png + + palette: + # Light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to light mode + + font: + text: Roboto + code: Roboto Mono + + features: + - content.code.annotate + - content.code.copy + - navigation.indexes + - navigation.instant + - navigation.tracking + - search.suggest + - search.share + +plugins: + - autorefs + - search + - mkdocstrings: + enable_inventory: true + handlers: + python: + paths: [src] + options: + allow_inspection: true + docstring_section_style: list + docstring_style: numpy + inherited_members: true + line_length: 60 + separate_signature: true + show_root_heading: true + show_signature_annotations: true + show_source: true + show_symbol_type_toc: true + signature_crossrefs: true + show_if_no_docstring: true + extensions: + - griffe_inherited_docstrings + + inventories: + - https://docs.python.org/3/objects.inv + - https://zarr.readthedocs.io/en/stable/objects.inv + +markdown_extensions: + - admonition + - attr_list + - def_list + - footnotes + - md_in_html + - pymdownx.details + - pymdownx.superfences + - toc: + permalink: true + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite diff --git a/packages/zarr-http-server/pyproject.toml b/packages/zarr-http-server/pyproject.toml new file mode 100644 index 0000000000..ef38d67e49 --- /dev/null +++ b/packages/zarr-http-server/pyproject.toml @@ -0,0 +1,141 @@ +[build-system] +requires = ["hatchling>=1.29.0", "hatch-vcs"] +build-backend = "hatchling.build" + +[project] +name = "zarr-http-server" +dynamic = ["version"] +description = "HTTP server for Zarr stores, arrays, and groups." +readme = "README.md" +requires-python = ">=3.12" +license = "MIT" +license-files = ["LICENSE.txt"] +authors = [ + { name = "Davis Bennett", email = "davis.v.bennett@gmail.com" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Topic :: Scientific/Engineering", + "Topic :: Internet :: WWW/HTTP :: HTTP Servers", + "Typing :: Typed", +] +keywords = ["zarr", "http", "server", "asgi"] +dependencies = [ + "zarr>=3.1", + "starlette>=1.0", + "uvicorn>=0.29", +] + +[project.urls] +Homepage = "https://github.com/zarr-developers/zarr-python" +Source = "https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-http-server" +Issues = "https://github.com/zarr-developers/zarr-python/issues" +Changelog = "https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/CHANGELOG.md" +Documentation = "https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/README.md" + +[dependency-groups] +test = [ + "pytest", + "httpx", + "httpx2", + "hypothesis", + # Executing examples/serve_notebook.ipynb in the suite: nbformat reads it, + # nbclient runs it, ipykernel is the kernel it runs in. + "nbformat", + "nbclient", + "ipykernel", +] +examples = [ + # Optional dependencies to run the README examples. Reading a served + # array back with `zarr.open_array(url)` goes through FsspecStore, which + # needs an HTTP-capable fsspec; `examples/serve.py` uses httpx. + "fsspec[http]", + "httpx", +] +docs = [ + # Pins match the zarr-python docs environment in the repo-root + # pyproject.toml so the two sites render with the same toolchain. + "mkdocs-material==9.7.7", + "mkdocs==1.6.1", + "mkdocstrings==1.0.6", + "mkdocstrings-python==2.0.5", + "griffe-inherited-docstrings==1.1.3", + # mkdocstrings uses ruff to format rendered signatures + "ruff==0.16.0", +] + +# Dev-only: resolve zarr from the repo root so package tests run against +# in-repo zarr. Affects uv resolution only, not published metadata. +[tool.uv.sources] +zarr = { path = "../..", editable = true } + +[tool.hatch.version] +source = "vcs" +tag-pattern = '^zarr_http_server-v(?P.+)$' +# `git_describe_command` ensures we get the zarr_http_server tags instead of latest. +# `local_scheme` strips the git commit info so the appending info is just a counter from latest tag. +# test-pypi doesn't accept git commit info in tags, and the count should be enough to distinguish unique runs. +raw-options = { root = "../..", git_describe_command = "git describe --dirty --tags --long --match zarr_http_server-v*", local_scheme = "no-local-version" } + +[tool.hatch.build.targets.wheel] +packages = ["src/zarr_http_server"] + +[tool.ruff] +extend = "../../pyproject.toml" +target-version = "py312" + +[tool.pytest.ini_options] +minversion = "7" +testpaths = ["tests"] +xfail_strict = true +addopts = ["-ra", "--strict-config", "--strict-markers"] +filterwarnings = [ + "error", +] + +[tool.mypy] +files = ["src"] +python_version = "3.12" +ignore_missing_imports = true +namespace_packages = false +pretty = true +show_error_code_links = true +show_error_context = true +strict = true +warn_unreachable = true +enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool", "truthy-iterable"] + +[tool.numpydoc_validation] +# Mirrors the root zarr-python config so moved docstrings (written for that +# config) don't trip stricter defaults just because this package has its own +# pyproject.toml. See https://numpydoc.readthedocs.io/en/latest/validation.html#built-in-validation-checks +checks = [ + "GL10", + "SS04", + "PR02", + "PR03", + "PR05", + "PR06", +] + +[tool.towncrier] +# Fragments for this package live alongside the package source, separate +# from the parent zarr-python `changes/` directory, so a PR touching only +# `packages/zarr-http-server/` produces a release note for this package only. +directory = "changes" +filename = "CHANGELOG.md" +package = "zarr_http_server" +underlines = ["", "", ""] +title_format = "## {version} ({project_date})" +issue_format = "[#{issue}](https://github.com/zarr-developers/zarr-python/issues/{issue})" +start_string = "\n" diff --git a/packages/zarr-http-server/src/zarr_http_server/__init__.py b/packages/zarr-http-server/src/zarr_http_server/__init__.py new file mode 100644 index 0000000000..4f4fbd22f8 --- /dev/null +++ b/packages/zarr-http-server/src/zarr_http_server/__init__.py @@ -0,0 +1,38 @@ +"""Zarr-http-server: HTTP server for Zarr stores, arrays, and groups.""" + +from importlib.metadata import version + +from zarr_http_server._serve import ( + AUTO_PORT, + DEFAULT_MAX_BODY_SIZE, + DEFAULT_PORT, + READ_ONLY_HTTP_METHODS, + READ_WRITE_HTTP_METHODS, + BackgroundServer, + CorsOptions, + HTTPMethod, + ReadOnlyHTTPMethod, + node_app, + serve, + serve_background, + store_app, +) + +__version__ = version("zarr-http-server") + +__all__ = [ + "AUTO_PORT", + "DEFAULT_MAX_BODY_SIZE", + "DEFAULT_PORT", + "READ_ONLY_HTTP_METHODS", + "READ_WRITE_HTTP_METHODS", + "BackgroundServer", + "CorsOptions", + "HTTPMethod", + "ReadOnlyHTTPMethod", + "__version__", + "node_app", + "serve", + "serve_background", + "store_app", +] diff --git a/packages/zarr-http-server/src/zarr_http_server/_keys.py b/packages/zarr-http-server/src/zarr_http_server/_keys.py new file mode 100644 index 0000000000..e468cd066d --- /dev/null +++ b/packages/zarr-http-server/src/zarr_http_server/_keys.py @@ -0,0 +1,218 @@ +"""Utilities for determining the set of valid store keys for zarr nodes. + +A zarr node (array or group) implicitly defines a subset of keys in the +underlying store. For an **array** the valid keys are: + +* metadata documents (``zarr.json`` for v3, ``.zarray`` / ``.zattrs`` for v2) +* chunk (or shard) keys whose decoded coordinates fall within the storage grid + +For a **group** the valid keys are: + +* its own metadata documents +* any path ``/`` where ```` is a direct member and + ```` is recursively valid for that child +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +ZARR_JSON = "zarr.json" +ZARRAY_JSON = ".zarray" +ZGROUP_JSON = ".zgroup" +ZATTRS_JSON = ".zattrs" +ZMETADATA_V2_JSON = ".zmetadata" + +if TYPE_CHECKING: + from zarr import Array, Group + +_ARRAY_METADATA_KEYS_V3 = frozenset({ZARR_JSON}) +_ARRAY_METADATA_KEYS_V2 = frozenset({ZARRAY_JSON, ZATTRS_JSON}) +_GROUP_METADATA_KEYS_V3 = frozenset({ZARR_JSON}) +_GROUP_METADATA_KEYS_V2 = frozenset({ZGROUP_JSON, ZATTRS_JSON, ZMETADATA_V2_JSON}) + + +def array_metadata_keys(zarr_format: int) -> frozenset[str]: + """Return the metadata key basenames an array owns, for a zarr format. + + Parameters + ---------- + zarr_format : int + The zarr format version (2 or 3). + + Returns + ------- + frozenset of str + """ + if zarr_format == 3: + return _ARRAY_METADATA_KEYS_V3 + return _ARRAY_METADATA_KEYS_V2 + + +def group_metadata_keys(zarr_format: int) -> frozenset[str]: + """Return the metadata key basenames a group owns, for a zarr format. + + Parameters + ---------- + zarr_format : int + The zarr format version (2 or 3). + + Returns + ------- + frozenset of str + """ + if zarr_format == 3: + return _GROUP_METADATA_KEYS_V3 + return _GROUP_METADATA_KEYS_V2 + + +def decode_chunk_key(array: Array[Any], key: str) -> tuple[int, ...] | None: + """Try to decode *key* into chunk coordinates for *array*. + + Parameters + ---------- + array : Array + The array whose chunk key encoding should be used. + key : str + The candidate chunk key string. + + Returns + ------- + tuple of int, or None + The decoded coordinates, or ``None`` if *key* is not a valid chunk key. + """ + try: + if array.metadata.zarr_format == 2: + coords = tuple(int(p) for p in key.split(array.metadata.dimension_separator)) + # A 0-d v2 array holds its single chunk under "0", which decodes + # to a 1-tuple that no 0-d grid could match. + if len(array.shape) == 0: + return () if coords == (0,) else None + return coords + + # Ask zarr rather than predicting it: the encoding owns its own + # grammar, so a new or third-party chunk key encoding decodes here + # without this package knowing anything about it. + return array.metadata.chunk_key_encoding.decode_chunk_key(key) + except (ValueError, TypeError, NotImplementedError): + return None + + +def _shard_grid_shape(array: Array[Any]) -> tuple[int, ...]: + """Shape of the shard grid, falling back to the chunk grid when unsharded.""" + shard_shape = array.shards if array.shards is not None else array.chunks + return tuple(-(-s // c) for s, c in zip(array.shape, shard_shape, strict=True)) + + +def is_valid_chunk_key(array: Array[Any], key: str) -> bool: + """Check whether *key* is a valid chunk key for *array*. + + Decodes the key, checks that the resulting coordinates fall within the + storage grid (shard grid if sharding is used, chunk grid otherwise), and + requires the key to be spelled exactly as zarr itself would spell it. + + That last check is what makes the accepted key set equal to the set of + keys zarr can actually read. Decoding alone is lenient -- `int` accepts + leading zeros, a leading `+`/`-`, surrounding whitespace, underscore + separators, and non-ASCII decimal digits -- so `c/00/00` and `c/0/0` + decode to the same coordinates while naming *different* store keys. A + write to the non-canonical spelling would be stored under a key no reader + ever looks up: the client sees success and the data is invisible. + + Parameters + ---------- + array : Array + The array to validate against. + key : str + The candidate chunk key string. + + Returns + ------- + bool + """ + coords = decode_chunk_key(array, key) + if coords is None: + return False + grid = _shard_grid_shape(array) + if len(coords) != len(grid): + return False + if not all(0 <= c < g for c, g in zip(coords, grid, strict=True)): + return False + return array.metadata.encode_chunk_key(coords) == key + + +def is_valid_array_key(array: Array[Any], key: str) -> bool: + """Check whether *key* is a valid store key for *array*. + + Valid keys are metadata documents and chunk keys. + + Parameters + ---------- + array : Array + The array to validate against. + key : str + The candidate key, relative to the array's root. + + Returns + ------- + bool + """ + if key in array_metadata_keys(array.metadata.zarr_format): + return True + return is_valid_chunk_key(array, key) + + +def is_valid_node_key(node: Array[Any] | Group, key: str) -> bool: + """Check whether *key* is a valid store key relative to *node*. + + For an ``Array``, valid keys are metadata documents and chunk keys. + + For a ``Group``, valid keys are the group's own metadata documents, or + a path of the form ``/`` where ```` is a direct + member and ```` is recursively valid for that child. + + Parameters + ---------- + node : Array or Group + The zarr node to validate against. + key : str + The candidate key, relative to the node's root. + + Returns + ------- + bool + """ + from zarr import Array + + if isinstance(node, Array): + return is_valid_array_key(node, key) + + # Group + if key in group_metadata_keys(node.metadata.zarr_format): + return True + + # Try to match the first path component against a child member. + if "/" in key: + child_name, remainder = key.split("/", 1) + else: + # A bare name with no slash can't be a valid group-level key — + # groups contain children (which have subkeys), not bare keys. + return False + + try: + child = node[child_name] + except KeyError: + # There is no such member, so no key beneath it can be valid. + # + # Only a missing name is caught here. Anything else -- an I/O error + # reading the child's metadata, unparsable JSON, a codec from a + # plugin this process lacks -- means the key could not be *judged*, + # which is not the same as judging it absent. Reporting those as 404 + # would be a lie with teeth: under the v3 spec an absent chunk is an + # uninitialized one, so a correct reader answers a 404 by silently + # substituting the array's fill value over data that exists. Letting + # them propagate surfaces a 500, which is the honest answer and the + # one a client cannot mistake for data. + return False + + return is_valid_node_key(child, remainder) diff --git a/packages/zarr-http-server/src/zarr_http_server/_serve.py b/packages/zarr-http-server/src/zarr_http_server/_serve.py new file mode 100644 index 0000000000..dce1df6b12 --- /dev/null +++ b/packages/zarr-http-server/src/zarr_http_server/_serve.py @@ -0,0 +1,1170 @@ +from __future__ import annotations + +import asyncio +import errno +import logging +import ntpath +import socket +import sys +import threading +import time +from enum import Enum, auto +from functools import partial +from typing import TYPE_CHECKING, Any, Literal, Self, TypedDict, cast, get_args + +from zarr.abc.store import OffsetByteRequest, RangeByteRequest, SuffixByteRequest +from zarr.buffer import cpu + +from zarr_http_server._keys import array_metadata_keys, group_metadata_keys, is_valid_node_key + +if TYPE_CHECKING: + from collections.abc import Mapping + from collections.abc import Set as AbstractSet + + import uvicorn + from starlette.applications import Starlette + from starlette.requests import Request + from starlette.responses import Response + from zarr import Array, Group + from zarr.abc.store import ByteRequest, Store + +__all__ = [ + "AUTO_PORT", + "DEFAULT_MAX_BODY_SIZE", + "DEFAULT_PORT", + "READ_ONLY_HTTP_METHODS", + "READ_WRITE_HTTP_METHODS", + "BackgroundServer", + "CorsOptions", + "HTTPMethod", + "ReadOnlyHTTPMethod", + "node_app", + "serve", + "serve_background", + "store_app", +] + + +class CorsOptions(TypedDict, total=False): + """Options forwarded to Starlette's `CORSMiddleware`. + + Every parameter the middleware accepts appears here, so configuring CORS + never requires reaching around this package. Keys left out fall back to + the defaults described below; a key that is present is used verbatim, + including an empty list. + + Two defaults differ from Starlette's own, because this server knows + something its caller should not have to. It emits `Content-Range` on + every ranged response, which is *not* a CORS-safelisted response header -- + with Starlette's empty `expose_headers` a browser client can read the + bytes but not learn which bytes it got. And it accepts a `Range` request + header, which Starlette's empty `allow_headers` would reject at preflight. + + * `expose_headers` defaults to `["Content-Range"]` + * `allow_headers` defaults to `["Range"]` + + Everything else defaults to the middleware's own value: no origins, `GET` + only, no credentials, no origin regex, no private-network access, and a + 600-second preflight cache. + """ + + allow_origins: list[str] + allow_methods: list[str] + allow_headers: list[str] + allow_credentials: bool + allow_origin_regex: str | None + allow_private_network: bool + expose_headers: list[str] + max_age: int + + +_CORS_DEFAULTS: CorsOptions = { + "expose_headers": ["Content-Range"], + "allow_headers": ["Range"], +} + + +ReadOnlyHTTPMethod = Literal["GET", "HEAD"] +"""An HTTP method that cannot modify the store. + +Distinguished from `HTTPMethod` in the type domain, not only at runtime, so a +read-only interface can be *declared* rather than merely configured: a +parameter annotated `AbstractSet[ReadOnlyHTTPMethod]` cannot be handed `"PUT"` +without a type error, whatever the value turns out to be at runtime. + +`HEAD` belongs here because Starlette routes it wherever `GET` goes, which is +what RFC 9110 §9.3.2 asks of an origin server. It is answered from the value's +size rather than by building and discarding a body. +""" + +_WriteHTTPMethod = Literal["PUT"] +"""An HTTP method that modifies the store. + +Private because nothing needs to name "the write methods" on its own -- it +exists so `HTTPMethod` can be defined as the union rather than as a third +hand-written list of the same strings. +""" + +HTTPMethod = ReadOnlyHTTPMethod | _WriteHTTPMethod +"""An HTTP method this server implements. + +`GET` and `HEAD` read a key; `PUT` writes one. Other verbs are not accepted: +the handler has no behavior for them, so serving them would silently answer +as if they were `GET`. +""" + +# Derived from the types above rather than restated, so the runtime sets and +# the static types cannot disagree about what this server serves. Adding a +# method to a Literal is then the only edit needed. +READ_ONLY_HTTP_METHODS: frozenset[ReadOnlyHTTPMethod] = frozenset(get_args(ReadOnlyHTTPMethod)) +"""Methods that only read. The default for every app in this package. + +Naming the set makes a read-only deployment say so at the call site, rather +than being the absence of an argument: + + store_app(store, methods=READ_ONLY_HTTP_METHODS) + +Typed as a set of `ReadOnlyHTTPMethod`, so a caller building on it keeps the +static guarantee: adding `"PUT"` to a `frozenset[ReadOnlyHTTPMethod]` is a +type error, not a runtime surprise. + +The stronger guarantee is a read-only store, which holds however `methods` is +configured -- see `store.with_read_only(True)`. +""" + +READ_WRITE_HTTP_METHODS: frozenset[HTTPMethod] = frozenset( + get_args(ReadOnlyHTTPMethod) + get_args(_WriteHTTPMethod) +) +"""Methods that read and write. Serving these grants clients write access. + +Every writable app must name a method set, so this constant is also what makes +writable deployments findable: grepping for `READ_WRITE_HTTP_METHODS` (or for +`methods=` generally) turns up every place that opts in. +""" + +_SUPPORTED_METHODS: frozenset[str] = READ_WRITE_HTTP_METHODS + +_LOGGER = logging.getLogger("uvicorn.error") +"""uvicorn's own logger, so a port fallback appears alongside its startup lines.""" + +DEFAULT_PORT = 8000 +"""Port tried first when `port="auto"`.""" + +AUTO_PORT: Literal["auto"] = "auto" +"""Sentinel for `port`: prefer `DEFAULT_PORT`, but settle for any free port. + +An explicit port is a requirement -- it binds that port or fails -- because a +caller who names one usually has something else expecting the server there. +`"auto"` says the opposite: no particular port is needed, so a collision +should not stop the server from starting. `port=0` keeps its usual meaning of +"any free port", with no preference. +""" + +_STARTUP_TIMEOUT = 5.0 +"""Seconds to wait for a background server to report that it is listening.""" + +_STARTUP_ABANDON_TIMEOUT = 5.0 +"""Seconds to wait for a server that failed to start to stop again.""" + +_SHUTDOWN_JOIN_MARGIN = 1.0 +"""Seconds to wait beyond uvicorn's graceful bound before forcing shutdown. + +uvicorn spends a fixed ~0.2s tearing down (a 0.1s loop tick plus a 0.1s +sleep) before its own `timeout_graceful_shutdown` wait begins, so a join that +merely equals that bound is guaranteed to expire first and escalate to +`force_exit` -- which makes uvicorn skip ASGI lifespan shutdown. +""" + +DEFAULT_MAX_BODY_SIZE = 256 * 1024 * 1024 +"""Default cap on a `PUT` body, in bytes. + +`Store.set` takes a whole `Buffer`, so an accepted body is held in memory in +full; the body is read incrementally and abandoned once it passes this cap, +so one request cannot size the server's memory use. Pass +`max_body_size=None` to lift the cap and read the body whole. +""" + + +class BackgroundServer: + """A running background HTTP server that can be used as a context manager. + + Wraps a ``uvicorn.Server`` running in a daemon thread. When used as a + context manager the server is shut down automatically on exit. + + Parameters + ---------- + server : uvicorn.Server + The running uvicorn server instance. + thread : threading.Thread + The daemon thread running the server. + host : str or None + The host the server was asked to bind, or ``None`` when it is not + listening on a TCP socket. + port : int or None + The port actually bound, or ``None`` when the server is not listening + on a TCP socket. + scheme : str, optional + URL scheme the server is reachable over. Defaults to ``"http"``. + shutdown_timeout : int, optional + Seconds to wait for in-flight requests to finish gracefully during + :meth:`shutdown` before forcing the server closed. Defaults to ``5``. + + Examples + -------- + >>> with serve_background(node_app(arr)) as server: # doctest: +SKIP + ... print(f"Listening on {server.host}:{server.port}") + ... # server is shut down when the block exits + """ + + def __init__( + self, + server: uvicorn.Server, + thread: threading.Thread, + *, + host: str | None, + port: int | None, + scheme: str = "http", + shutdown_timeout: int = 5, + ) -> None: + self._server = server + self._thread = thread + self.host = host + self.port = port + self.scheme = scheme + self._shutdown_timeout = shutdown_timeout + + @property + def url(self) -> str | None: + """The base URL of the running server. + + ``None`` when the server is not listening on a TCP socket -- a unix + socket or an inherited file descriptor has no host and port, and + inventing one would be a URL that connects to nothing. + """ + if self.host is None or self.port is None: + return None + return f"{self.scheme}://{self.host}:{self.port}" + + def shutdown(self) -> None: + """Signal the server to shut down and wait for it to stop. + + Waits for the server thread to exit on its own, then escalates to + ``force_exit`` if it has not, so a request wedged outside uvicorn's + loop cannot block here forever. + + Raises + ------ + RuntimeError + If the thread is still running after both waits. Returning + normally would report success for a server that is still bound to + its port and still serving, which the caller cannot detect any + other way. + """ + self._server.should_exit = True + # Outlast uvicorn's own graceful wait rather than matching it. uvicorn + # spends roughly 0.2s on teardown (a 0.1s loop tick plus a 0.1s sleep) + # *before* its `timeout_graceful_shutdown` wait even begins, so an + # equal bound here always expires first -- escalating to force_exit on + # the path that is supposed to be the orderly one, which makes uvicorn + # skip ASGI lifespan shutdown entirely. + self._thread.join(timeout=self._graceful_timeout + _SHUTDOWN_JOIN_MARGIN) + if self._thread.is_alive(): + self._server.force_exit = True + self._thread.join(timeout=self._shutdown_timeout) + + if self._thread.is_alive(): + raise RuntimeError( + "Server thread did not stop within " + f"{self._graceful_timeout + _SHUTDOWN_JOIN_MARGIN + self._shutdown_timeout:.1f}s, " + "even after force_exit. The server may still be serving and " + "holding its port; a request blocked in a store call cannot be " + "cancelled from here." + ) + + @property + def _graceful_timeout(self) -> float: + """uvicorn's own graceful-shutdown bound, whoever configured it.""" + configured = self._server.config.timeout_graceful_shutdown + return float(configured) if configured is not None else float(self._shutdown_timeout) + + def __enter__(self) -> Self: + return self + + def __exit__(self, *args: object) -> None: + self.shutdown() + + +class _RangeVerdict(Enum): + """The outcome of a Range header that does not name a readable range.""" + + IGNORE = auto() + """Serve the full representation with 200, as if no Range had been sent.""" + + UNSATISFIABLE = auto() + """Answer 416: the range is well-formed but names nothing readable.""" + + +_MAX_BYTE_POS = sys.maxsize +"""Largest byte position this server will pass to a store. + +Range bounds arrive as arbitrary-precision Python integers, but a store +ultimately turns them into an index-sized `seek`/`read`. Feeding an oversized +value through raises `OverflowError`/`ValueError` from deep inside the store +rather than producing a response, so bounds are clamped or rejected here. +""" + + +def _parse_int(text: str) -> int | None: + """Parse a byte position, accepting only the canonical spelling of one. + + `int` is lenient in ways an HTTP byte position is not -- it accepts + surrounding whitespace, a leading `+`/`-`, underscore separators, and + non-ASCII decimal digits -- so `bytes=+0-1` and `bytes=0_0-1` would parse. + RFC 9110 defines a byte position as 1*DIGIT. + """ + if not text.isascii() or not text.isdigit(): + return None + return int(text) + + +def _parse_range_header(range_header: str) -> ByteRequest | _RangeVerdict: + """Parse an HTTP Range header into a ByteRequest. + + A header this server cannot turn into a single read is *ignored* rather + than rejected. RFC 9110 §14.2 requires a server to ignore a Range whose + unit it does not recognize, and permits ignoring one it cannot parse; in + both cases the correct answer is the full representation, not 416. + Answering 416 would tell a client the object is unreadable when it is + merely the request that was unsupported -- and a client coalescing two + chunk reads into one multi-range request would take that at face value. + + 416 is reserved for a well-formed range that genuinely names nothing. + + Parameters + ---------- + range_header : str + The value of the Range header, e.g. ``"bytes=0-99"`` or ``"bytes=-100"``. + + Returns + ------- + ByteRequest or _RangeVerdict + A ``RangeByteRequest``, ``OffsetByteRequest``, or ``SuffixByteRequest`` + for a readable range, otherwise the verdict to apply. + """ + if not range_header.startswith("bytes="): + # An unrecognized range unit; RFC 9110 §14.2 says MUST ignore. + return _RangeVerdict.IGNORE + range_spec = range_header[len("bytes=") :] + if "," in range_spec: + # A multipart range. Legal to send, and legal to answer with the whole + # representation; this server does not build multipart/byteranges. + return _RangeVerdict.IGNORE + + if range_spec.startswith("-"): + # suffix request: bytes=-N + suffix = _parse_int(range_spec[1:]) + if suffix is None: + return _RangeVerdict.IGNORE + if suffix == 0: + # "the last zero bytes" names nothing. + return _RangeVerdict.UNSATISFIABLE + return SuffixByteRequest(suffix=min(suffix, _MAX_BYTE_POS)) + + parts = range_spec.split("-", 1) + if len(parts) != 2: + return _RangeVerdict.IGNORE + start_str, end_str = parts + start = _parse_int(start_str) + if start is None: + return _RangeVerdict.IGNORE + if start > _MAX_BYTE_POS: + # No object can be this long, so the range starts past every end. + return _RangeVerdict.UNSATISFIABLE + if end_str == "": + # offset request: bytes=N- + return OffsetByteRequest(offset=start) + end_pos = _parse_int(end_str) + if end_pos is None: + return _RangeVerdict.IGNORE + # HTTP end is inclusive, ByteRequest end is exclusive. A last-byte-pos at + # or past the end of the object is satisfiable -- RFC 9110 §14.1.2 says to + # clamp it -- so an oversized bound is capped rather than refused. + end = min(end_pos, _MAX_BYTE_POS - 1) + 1 + if start >= end: + # An inverted range like "bytes=5-2" is unsatisfiable, not a read + # of negative length. + return _RangeVerdict.UNSATISFIABLE + return RangeByteRequest(start=start, end=end) + + +def _is_drive_qualified(path: str) -> bool: + """Whether *path* carries a drive or UNC prefix that would discard a store root. + + A drive-qualified key such as `C:/Windows`, or the drive-relative `a:b`, + replaces the root it is joined to rather than extending it. This is + rejected on every platform, not just Windows: the check is a string-level + gate in front of an arbitrary `Store`, and this package cannot know how a + given implementation resolves keys. + + The cost is that a node whose *first* path segment looks like `:...` + is unreachable -- `ntpath` treats any single character before a colon as + a drive, so there is no safe subset to admit. Such names are legal but + rare, and later segments are unaffected (`sub/a:b` is served normally). + + Parameters + ---------- + path : str + The candidate key, with separators already folded to `/`. + + Returns + ------- + bool + """ + return ntpath.splitdrive(path)[0] != "" + + +def _names_nothing(exc: OSError) -> bool: + """Whether an `OSError` answers about the *name*, rather than reporting failure. + + `ENAMETOOLONG` is the store saying no such name is expressible here. That + is an answer about the key -- nothing can be stored under it, so a miss is + honest -- and it is unreachable for real data, because `encode_chunk_key` + never produces a segment near a filesystem's length limit. Answering 404 + therefore cannot make a reader substitute fill values over a chunk that + exists, and it keeps a client from turning a freely chosen key into a 5xx. + + Every other `errno` describes a failure to complete the operation and must + surface as one. `EINVAL` was accepted here and was the dangerous case: it + is POSIX's catch-all, reachable on a perfectly ordinary short key through + a bad seek or an unsupported filesystem feature. Under the v3 spec an + absent chunk is an uninitialized one, so reporting such a failure as 404 + has a correct reader write fill values over data that is merely + unreadable. When in doubt the store's own signal is the one to trust: + `None` means absent, a raised error means the request could not be + answered. + + Parameters + ---------- + exc : OSError + The error raised by the store. + + Returns + ------- + bool + """ + return exc.errno == errno.ENAMETOOLONG + + +def _content_range(byte_range: RangeByteRequest | OffsetByteRequest, length: int) -> str: + """Build a `Content-Range` value for a 206 response. + + Parameters + ---------- + byte_range : RangeByteRequest or OffsetByteRequest + The range that was served. A suffix request is resolved to an absolute + range before reaching here, because RFC 9110 §15.3.7 requires every + single-part 206 to carry a `Content-Range` and a suffix's first-byte + position is not knowable without the object's size. + length : int + The number of bytes actually returned. + + Returns + ------- + str + A `bytes -/*` value. + """ + start = byte_range.start if isinstance(byte_range, RangeByteRequest) else byte_range.offset + # The total length is unknown here; RFC 9110 permits "*" in its place. + return f"bytes {start}-{start + length - 1}/*" + + +async def _resolve_suffix( + store: Store, path: str, byte_range: SuffixByteRequest +) -> RangeByteRequest | _RangeVerdict: + """Turn a suffix request into an absolute range using the object's size. + + A suffix range names its bytes relative to an end this server does not + otherwise need to know. Resolving it here is what lets the 206 carry a + `Content-Range`, which RFC 9110 requires and which a caller reading a + shard index needs in order to locate what it was given. + """ + try: + size = await store.getsize(path) + except FileNotFoundError: + return _RangeVerdict.UNSATISFIABLE + if size == 0: + return _RangeVerdict.UNSATISFIABLE + # A suffix longer than the object is satisfiable and yields the whole + # object, per RFC 9110 §14.1.2. + return RangeByteRequest(start=max(0, size - byte_range.suffix), end=size) + + +_JSON_BASENAMES = ( + array_metadata_keys(2) + | array_metadata_keys(3) + | group_metadata_keys(2) + | group_metadata_keys(3) +) +"""Metadata documents that are JSON, for every zarr format. + +Derived from the same tables that decide which keys a node owns, so a v2 +array's `.zarray` is typed as JSON rather than as opaque bytes -- and adding a +document in one place cannot leave the media type behind in the other. +""" + + +def content_type_for(path: str) -> str: + """Media type for a store key, chosen by its basename.""" + if path.rsplit("/", 1)[-1] in _JSON_BASENAMES: + return "application/json" + return "application/octet-stream" + + +async def _head_response(store: Store, path: str, content_type: str) -> Response: + """Answer a HEAD without transferring the value. + + A HEAD body is discarded at the wire, so routing HEAD through the GET + handler reads the whole object -- megabytes of chunk or shard -- to report + a length. `Store.getsize` is a `stat` on a filesystem store and an + info/HEAD call on a remote one. + """ + from starlette.responses import Response + + try: + size = await store.getsize(path) + except FileNotFoundError: + return Response(status_code=404) + except OSError as exc: + if not _names_nothing(exc): + raise + return Response(status_code=404) + return Response(status_code=200, media_type=content_type, headers={"Content-Length": str(size)}) + + +async def _get_response( + store: Store, + path: str, + byte_range: RangeByteRequest | OffsetByteRequest | None = None, +) -> Response: + """Fetch a key from the store and return an HTTP response.""" + from starlette.responses import Response + + proto = cpu.buffer_prototype + content_type = content_type_for(path) + + try: + buf = await store.get(path, proto, byte_range=byte_range) + except (MemoryError, OverflowError): + # The client's last-byte-pos is wider than the store can materialize + # -- it sizes its read from the range, not from the object. RFC 9110 + # §14.1.2 makes a last-byte-pos at or past the end of the object + # satisfiable and clamps it to the end, so re-read from the same start + # to EOF, which is what the clamped range denotes. Refusing with 416 + # would deny a request that is merely over-wide, and a client asking + # for "from here to well past the end" is asking a normal question. + if not isinstance(byte_range, RangeByteRequest): + raise + byte_range = OffsetByteRequest(offset=byte_range.start) + buf = await store.get(path, proto, byte_range=byte_range) + except OSError as exc: + if not _names_nothing(exc): + # A real I/O failure, which must not be reported as a miss. Under + # the v3 spec an absent chunk is an uninitialized one, and a + # reader is right to substitute the array's fill value for it -- + # so 404 asserts something about the store's contents. An + # unreadable chunk is not an uninitialized chunk, and answering + # 404 would have a correct client silently materialize fill + # values over data that exists. + raise + return Response(status_code=404) + if buf is None: + return Response(status_code=404) + + if byte_range is None: + return Response(content=buf.to_bytes(), status_code=200, media_type=content_type) + + body = buf.to_bytes() + if len(body) == 0: + # The range lies wholly beyond the end of the object. + return Response(status_code=416) + + headers = {"Content-Range": _content_range(byte_range, len(body))} + return Response(content=body, status_code=206, media_type=content_type, headers=headers) + + +async def _handle_request(request: Request) -> Response: + """Handle a request, optionally filtering by node validity.""" + from starlette.responses import Response + + store: Store = request.app.state.store + node: Array[Any] | Group | None = request.app.state.node + prefix: str = request.app.state.prefix + path = request.path_params.get("path", "") + + # Reject non-canonical / traversal-prone keys before touching the store. + # Starlette percent-decodes path params, so "..%2f" arrives as a literal + # ".." segment and "%2f"-encoded leading slashes arrive as an empty leading + # segment (making the key absolute, which escapes a filesystem store root). + # Backslashes are separators on Windows and drive-qualified or + # root-relative keys discard a filesystem store's root entirely, so fold + # separators before checking segments -- mirroring zarr's normalize_path + # (src/zarr/storage/_utils.py) plus a drive check it doesn't need. Legitimate + # zarr keys never contain empty, ".", or ".." segments, or a drive letter. + segments = path.replace("\\", "/").split("/") + if any(segment in ("", ".", "..") for segment in segments) or _is_drive_qualified(path): + return Response(status_code=404) + + # A NUL can never appear in a store key, and reaches the filesystem layer + # as a raised error rather than a miss. Rejecting it here keeps that out + # of the store, so the store's own errors always mean real I/O trouble. + if "\x00" in path: + return Response(status_code=404) + + # If serving a node, validate the key before touching the store. Group + # validation opens children through zarr's synchronous API, which drives + # the store to completion and would otherwise block the event loop for + # the duration -- serializing every concurrent request behind it, and + # outlasting the shutdown timeout. + if node is not None and not await asyncio.to_thread(is_valid_node_key, node, path): + return Response(status_code=404) + + # Resolve the full store key by prepending the node's prefix. + store_key = f"{prefix}/{path}" if prefix else path + + if request.method == "PUT": + if store.read_only: + # The store will refuse this with a ValueError from deep inside + # `set`, which is a 500 -- a server fault. Refusing to write to a + # read-only store is not a fault, it is the answer. + return Response(status_code=403) + + max_body_size: int | None = request.app.state.max_body_size + if max_body_size is None: + body = await request.body() + else: + declared = request.headers.get("content-length") + if declared is not None and declared.isdigit() and int(declared) > max_body_size: + return Response(status_code=413) + + # Read incrementally and stop at the cap. `request.body()` would + # buffer the whole body first, which a chunked request can use to + # exceed the cap by any amount before it is ever checked. + chunks: list[bytes] = [] + received = 0 + async for chunk in request.stream(): + received += len(chunk) + if received > max_body_size: + return Response(status_code=413) + chunks.append(chunk) + body = b"".join(chunks) + + buf = cpu.buffer_prototype.buffer.from_bytes(body) + try: + await store.set(store_key, buf) + except OSError as exc: + if not _names_nothing(exc): + # A real write failure -- a full disk, a read-only mount, a + # permissions problem. Reporting it as 404 would tell the + # client the write is pointless rather than failed. + raise + return Response(status_code=404) + return Response(status_code=204) + + if request.method == "HEAD": + # A HEAD body is discarded at the wire, so reading the value to build + # one transfers the whole object to answer a question about its size. + # `getsize` is a stat on a filesystem store and a HEAD/info call on a + # remote one. + return await _head_response(store, store_key, content_type_for(path)) + + range_header = request.headers.get("range") + byte_range: RangeByteRequest | OffsetByteRequest | None = None + if range_header is not None: + parsed = _parse_range_header(range_header) + if parsed is _RangeVerdict.UNSATISFIABLE: + return Response(status_code=416) + if isinstance(parsed, SuffixByteRequest): + parsed = await _resolve_suffix(store, store_key, parsed) + if parsed is _RangeVerdict.UNSATISFIABLE: + return Response(status_code=416) + # _RangeVerdict.IGNORE falls through with byte_range still None, which + # serves the full representation with 200. + if not isinstance(parsed, _RangeVerdict): + byte_range = parsed + + return await _get_response(store, store_key, byte_range) + + +def _make_starlette_app( + *, + methods: AbstractSet[HTTPMethod] | None = None, + cors_options: CorsOptions | None = None, +) -> Starlette: + """Create a Starlette app with the request handler. + + Raises + ------ + ValueError + If `methods` contains anything outside `GET`, `PUT`, and `HEAD`. + """ + from starlette.applications import Starlette + from starlette.middleware.cors import CORSMiddleware + from starlette.routing import Route + + if methods is None: + methods = READ_ONLY_HTTP_METHODS + + # An empty set must not reach Starlette: `Route` treats a falsy `methods` + # as "match every method", so asking for no methods would serve them all. + if not methods: + raise ValueError( + "methods must name at least one HTTP method; " + f"accepted methods are {', '.join(sorted(_SUPPORTED_METHODS))}." + ) + + unsupported = sorted(set(methods) - _SUPPORTED_METHODS) + if unsupported: + raise ValueError( + f"Unsupported HTTP method(s): {', '.join(unsupported)}. " + f"Accepted methods are {', '.join(sorted(_SUPPORTED_METHODS))}." + ) + + app = Starlette( + routes=[Route("/{path:path}", _handle_request, methods=list(methods))], + ) + + if cors_options is not None: + # Typed loosely on purpose: unpacking a merged TypedDict loses the + # per-key types, so the looseness is contained to this block rather + # than spread across casts at each use. + merged: dict[str, Any] = {**_CORS_DEFAULTS, **cors_options} + if "allow_methods" in merged: + # Only when the caller said something. Absent, Starlette's own + # `GET`-only default stands: widening it to everything served + # would newly advertise `PUT` cross-origin on a write-enabled app + # that never asked for it. + merged["allow_methods"] = _reconcile_allow_methods( + merged["allow_methods"], served=_served_methods(methods) + ) + app.add_middleware( + CORSMiddleware, + # Our defaults first, so a key the caller supplied wins outright + # rather than being merged into -- an explicit `expose_headers: []` + # means "expose nothing", not "expose our default". + **merged, + ) + return app + + +def _reject_writes_to_a_read_only_store( + store: Store, methods: AbstractSet[HTTPMethod] | None +) -> None: + """Refuse a configuration whose writes can never succeed. + + A store's `read_only` is fixed when it is built, so asking to serve `PUT` + from one is a contradiction that would only reveal itself as a 403 on the + first write a client attempts -- possibly long after deployment, and to + the client rather than to whoever misconfigured it. Saying so at + construction matches how unsupported `methods` and contradictory + `cors_options` are already handled. + + Raises + ------ + ValueError + If `methods` asks for `PUT` on a read-only store. + """ + if methods is not None and "PUT" in methods and store.read_only: + raise ValueError( + "methods asks for PUT, but the store is read-only, so no write " + "could ever succeed. Drop PUT to serve reads, or pass a writable " + "store (`store.with_read_only(False)`)." + ) + + +def _served_methods(methods: AbstractSet[HTTPMethod]) -> frozenset[str]: + """The methods the route will actually answer. + + Starlette adds `HEAD` to any route that serves `GET`, which RFC 9110 + §9.3.2 asks of every origin server, so `HEAD` is served whenever `GET` is + whether or not it was named. + """ + served = set(methods) + if "GET" in served: + served.add("HEAD") + return frozenset(served) + + +def _reconcile_allow_methods(allow_methods: list[str], *, served: frozenset[str]) -> list[str]: + """Check `cors_options["allow_methods"]` against what the route serves. + + An advertised method the route rejects is a promise the server cannot + keep: a browser caches the preflight and every later cross-origin call + fails with 405 after a successful handshake. The reverse is worse -- the + same silence lets `allow_methods=["*"]` on a write-enabled app hand every + origin on the internet write access, which is exactly the footgun the + `methods` validation above exists to prevent. + + `"*"` expands to what is actually served rather than being rejected: it + is the idiomatic spelling of "everything this app does", and the app + cannot do more than it serves. + """ + if "*" in allow_methods: + return sorted(served) + + unserved = sorted(set(allow_methods) - served) + if unserved: + raise ValueError( + f"cors_options['allow_methods'] advertises {', '.join(unserved)}, " + f"which this app does not serve (it serves {', '.join(sorted(served))}). " + "A browser would cache that preflight and every such request would " + "then fail with 405." + ) + return list(allow_methods) + + +def _build_server( + app: Starlette, + *, + host: str, + port: int | Literal["auto"], + shutdown_timeout: int, + uvicorn_options: Mapping[str, object] | None, +) -> tuple[uvicorn.Server, dict[str, object], socket.socket | None]: + """Configure a `uvicorn.Server` for *app*, and report how it will bind. + + Returns the options actually used -- a key from `uvicorn_options` may have + replaced one passed here -- and, for `port="auto"`, the socket already + bound on the caller's behalf, which must be handed to `Server.run`. + """ + import uvicorn + + options: dict[str, object] = { + "host": host, + "port": port, + "timeout_graceful_shutdown": shutdown_timeout, + } + if uvicorn_options is not None: + options.update(uvicorn_options) + + sock: socket.socket | None = None + if options.get("port") == AUTO_PORT: + if _binds_without_a_port(options): + # A uds or fd bind ignores host and port; leave a valid int in + # place of the sentinel so `Config` still type-checks. + options["port"] = DEFAULT_PORT + else: + # Bind here rather than probing and handing uvicorn a port number: + # probing would release the port before uvicorn claimed it, which + # is the bind-then-close race that makes "find a free port" helpers + # flaky. Holding the socket means nothing can take it in between. + sock = _bind_preferred_or_free(str(options["host"]), DEFAULT_PORT) + # Keep Config agreeing with reality, so uvicorn's own "running on + # ..." line names the port it is really serving. + options["port"] = sock.getsockname()[1] + + # uvicorn.Config's parameters are individually typed and there are ~50 of + # them; `Mapping[str, object]` is the honest type for the public argument, + # so the cast is confined to the call itself. + return uvicorn.Server(uvicorn.Config(app, **cast("dict[str, Any]", options))), options, sock + + +def _binds_without_a_port(options: Mapping[str, object]) -> bool: + """Whether these options bind something other than a TCP host and port.""" + return options.get("uds") is not None or options.get("fd") is not None + + +def _bind_preferred_or_free(host: str, preferred: int) -> socket.socket: + """Bind *preferred* on *host* if it is free, otherwise any free port. + + The address family comes from `getaddrinfo` rather than being assumed: + hard-coding `AF_INET` would fail for an IPv6 host such as ``"::1"``. + """ + for candidate in (preferred, 0): + family, socktype, proto, _, sockaddr = socket.getaddrinfo( + host, candidate, type=socket.SOCK_STREAM + )[0] + sock = socket.socket(family, socktype, proto) + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + try: + sock.bind(sockaddr) + except OSError: + sock.close() + if candidate == 0: + # Nothing is free, which is a real failure rather than a + # reason to keep looking. + raise + _LOGGER.info( + "port %d is in use; binding a free port instead. Pass an " + "explicit port to require a particular one.", + preferred, + ) + continue + return sock + raise AssertionError("unreachable") # pragma: no cover + + +def serve( + app: Starlette, + *, + host: str = "127.0.0.1", + port: int | Literal["auto"] = AUTO_PORT, + shutdown_timeout: int = 5, + uvicorn_options: Mapping[str, object] | None = None, +) -> None: + """Run an ASGI app under Uvicorn, blocking until it is stopped. + + Returns only when the server stops, so this is the shape for a process + whose job is to serve -- a script, a container entrypoint. Use + :func:`serve_background` when the caller has more to do. + + Build the app first with :func:`store_app` or :func:`node_app`, or compose + several of them; what an app serves is settled when it is built, and this + only decides how it runs. + + .. code-block:: python + + serve(store_app(store), host="0.0.0.0", port=8000) + + Parameters + ---------- + app : Starlette + The ASGI app to run. + host : str, optional + The host to bind to. Defaults to ``"127.0.0.1"``. + port : int, optional + The port to bind to. Defaults to ``8000``. + shutdown_timeout : int, optional + Seconds to wait for in-flight requests to finish gracefully when the + server is shut down, via uvicorn's ``timeout_graceful_shutdown``. + Defaults to ``5``. + uvicorn_options : Mapping[str, object], optional + Extra options passed straight to `uvicorn.Config`, merged over the + ones set here (`host`, `port`, `timeout_graceful_shutdown`), so a + caller key wins. This is the escape hatch for anything uvicorn can do + that this signature does not name -- TLS via `ssl_keyfile` / + `ssl_certfile`, `proxy_headers` and `forwarded_allow_ips` behind a + reverse proxy, `root_path` when mounted under a prefix, `log_level`, + `limit_concurrency`, or a `uds` / `fd` bind. + """ + server, _, sock = _build_server( + app, + host=host, + port=port, + shutdown_timeout=shutdown_timeout, + uvicorn_options=uvicorn_options, + ) + server.run(sockets=[sock] if sock is not None else None) + + +def serve_background( + app: Starlette, + *, + host: str = "127.0.0.1", + port: int | Literal["auto"] = AUTO_PORT, + shutdown_timeout: int = 5, + uvicorn_options: Mapping[str, object] | None = None, +) -> BackgroundServer: + """Start an ASGI app under Uvicorn in a daemon thread and return at once. + + Returns once the socket is listening, so the next statement can use the + server. The returned handle is also a context manager: + + .. code-block:: python + + with serve_background(node_app(array)) as server: + httpx.get(f"{server.url}/zarr.json") + + In a notebook, where the server must outlive the cell that started it, + keep the handle instead and call :meth:`BackgroundServer.shutdown` later. + + Parameters + ---------- + app : Starlette + The ASGI app to run. + host : str, optional + The host to bind to. Defaults to ``"127.0.0.1"``. + port : int, optional + The port to bind to. Defaults to ``0``, which asks the OS for a free + one -- unlike :func:`serve`, whose caller usually needs a port others + already know. A background server is normally reached through + :attr:`BackgroundServer.url`, and a fixed default would make starting + a second one, or re-running a notebook cell, fail on a port collision. + shutdown_timeout : int, optional + Seconds to wait for in-flight requests to finish gracefully, both for + uvicorn's ``timeout_graceful_shutdown`` and for the wait + :meth:`BackgroundServer.shutdown` uses before forcing the thread + closed. Defaults to ``5``. + uvicorn_options : Mapping[str, object], optional + Extra options passed straight to `uvicorn.Config`, merged over the + ones set here so a caller key wins. See :func:`serve`. Binding + somewhere other than a TCP host and port leaves + :attr:`BackgroundServer.url` as ``None``. + + Returns + ------- + BackgroundServer + A handle for the running server. + + Raises + ------ + RuntimeError + If the server does not start -- most often because the port is + already in use. + """ + server, options, sock = _build_server( + app, + host=host, + port=port, + shutdown_timeout=shutdown_timeout, + uvicorn_options=uvicorn_options, + ) + + # uvicorn skips signal-handler installation off the main thread + # (Server.capture_signals), so no workaround is needed here. + thread = threading.Thread( + target=partial(server.run, sockets=[sock] if sock is not None else None), daemon=True + ) + thread.start() + + deadline = time.monotonic() + _STARTUP_TIMEOUT + while not server.started: + if not thread.is_alive(): + # uvicorn logs the underlying error and calls sys.exit, which in a + # thread ends it without surfacing anything to the caller. The + # overwhelmingly common cause is a port already in use. + raise RuntimeError( + f"Server thread exited before startup completed; {host}:{port} " + "may already be in use. See the server log for the cause." + ) + if time.monotonic() > deadline: + # The thread is still alive here, unlike the branch above, and it + # is about to finish starting. Raising without stopping it would + # leave a server bound to the port with no handle to shut it down + # -- a daemon thread serving for the rest of the process, and a + # retry on the same port failing with the other error above. + server.should_exit = True + server.force_exit = True + thread.join(timeout=_STARTUP_ABANDON_TIMEOUT) + raise RuntimeError( + f"Server failed to start within {_STARTUP_TIMEOUT:g} seconds; " + "it has been signalled to stop." + ) + time.sleep(0.01) + + # Report the port the socket actually bound rather than the one asked for, + # so `port=0` ("pick a free port") yields a usable `url`. A unix-socket or + # file-descriptor bind has no host and port at all, so both stay None and + # `url` reports None rather than naming an address nothing is listening on. + bound_port: int | None = None + for bound in server.servers: + for sock in bound.sockets: + sockname = sock.getsockname() + if isinstance(sockname, tuple) and len(sockname) >= 2: + bound_port = int(sockname[1]) + break + break + + # The host is taken from the request rather than the socket: a wildcard + # bind reports "0.0.0.0", which is not an address a client can connect to. + requested_host = options.get("host") + bound_host = ( + str(requested_host) if bound_port is not None and requested_host is not None else None + ) + + return BackgroundServer( + server, + thread, + host=bound_host, + port=bound_port, + scheme="https" if server.config.is_ssl else "http", + shutdown_timeout=shutdown_timeout, + ) + + +def store_app( + store: Store, + *, + methods: AbstractSet[HTTPMethod] | None = None, + cors_options: CorsOptions | None = None, + max_body_size: int | None = DEFAULT_MAX_BODY_SIZE, +) -> Starlette: + """Create a Starlette ASGI app that serves every key in a zarr ``Store``. + + Parameters + ---------- + store : Store + The zarr store to serve. + methods : set of HTTPMethod, optional + The HTTP methods to accept: any of `"GET"`, `"HEAD"`, and `"PUT"`. + Defaults to `{"GET"}`, which also serves `HEAD`. Passing any other + method raises `ValueError`. + cors_options : CorsOptions, optional + If provided, CORS middleware will be added with the given options. + max_body_size : int or None, optional + Largest `PUT` body to accept, in bytes; larger requests get a 413. + `Store.set` takes a whole `Buffer`, so bodies cannot be streamed and + are held in memory in full. Defaults to `DEFAULT_MAX_BODY_SIZE`; + pass `None` to lift the cap. + + Returns + ------- + Starlette + An ASGI application. + """ + _reject_writes_to_a_read_only_store(store, methods) + app = _make_starlette_app(methods=methods, cors_options=cors_options) + app.state.store = store + app.state.node = None + app.state.prefix = "" + app.state.max_body_size = max_body_size + return app + + +def node_app( + node: Array[Any] | Group, + *, + methods: AbstractSet[HTTPMethod] | None = None, + cors_options: CorsOptions | None = None, + max_body_size: int | None = DEFAULT_MAX_BODY_SIZE, +) -> Starlette: + """Create a Starlette ASGI app that serves only the keys belonging to a + zarr ``Array`` or ``Group``. + + For an ``Array``, the served keys are the metadata document(s) and all + chunk (or shard) keys whose coordinates fall within the array's grid. + + For a ``Group``, the served keys are the group's own metadata plus any + path that resolves through the group's members to a valid array metadata + document or chunk key. + + Requests for keys outside this set receive a 404 response, even if the + underlying store contains data at that path. + + Parameters + ---------- + node : Array or Group + The zarr array or group to serve. + methods : set of HTTPMethod, optional + The HTTP methods to accept: any of `"GET"`, `"HEAD"`, and `"PUT"`. + Defaults to `{"GET"}`, which also serves `HEAD`. Passing any other + method raises `ValueError`. + cors_options : CorsOptions, optional + If provided, CORS middleware will be added with the given options. + max_body_size : int or None, optional + Largest `PUT` body to accept, in bytes; larger requests get a 413. + `Store.set` takes a whole `Buffer`, so bodies cannot be streamed and + are held in memory in full. Defaults to `DEFAULT_MAX_BODY_SIZE`; + pass `None` to lift the cap. + + Returns + ------- + Starlette + An ASGI application. + """ + _reject_writes_to_a_read_only_store(node.store_path.store, methods) + app = _make_starlette_app(methods=methods, cors_options=cors_options) + app.state.store = node.store_path.store + app.state.node = node + app.state.prefix = node.store_path.path + app.state.max_body_size = max_body_size + return app diff --git a/packages/zarr-http-server/src/zarr_http_server/py.typed b/packages/zarr-http-server/src/zarr_http_server/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/zarr-http-server/tests/conftest.py b/packages/zarr-http-server/tests/conftest.py new file mode 100644 index 0000000000..84694b42ba --- /dev/null +++ b/packages/zarr-http-server/tests/conftest.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Literal + +import pytest +from zarr.storage import MemoryStore + +if TYPE_CHECKING: + from zarr.abc.store import Store + +ZarrFormat = Literal[2, 3] + + +@pytest.fixture +def store(request: pytest.FixtureRequest) -> Store: + """Store fixture resolved via indirect parametrization.""" + if request.param != "memory": + raise ValueError(f"unsupported store param: {request.param!r}") + return MemoryStore() + + +@pytest.fixture(params=(2, 3), ids=["zarr2", "zarr3"]) +def zarr_format(request: pytest.FixtureRequest) -> ZarrFormat: + """Zarr format version fixture, parametrized over v2 and v3.""" + if request.param == 2: + return 2 + elif request.param == 3: + return 3 + msg = f"Invalid zarr format requested. Got {request.param}, expected one of (2, 3)." + raise ValueError(msg) diff --git a/packages/zarr-http-server/tests/test_examples.py b/packages/zarr-http-server/tests/test_examples.py new file mode 100644 index 0000000000..20a5d5b1b0 --- /dev/null +++ b/packages/zarr-http-server/tests/test_examples.py @@ -0,0 +1,60 @@ +"""The shipped examples must keep working. + +An example that has quietly rotted is worse than no example: it is the first +thing a new user copies. These run the real files rather than a paraphrase of +them, so a signature change or a behavior change fails here rather than in +someone's notebook. +""" + +from __future__ import annotations + +import pathlib +import runpy + +import pytest + +EXAMPLES = pathlib.Path(__file__).resolve().parent.parent / "examples" +NOTEBOOK = EXAMPLES / "serve_notebook.ipynb" +SCRIPT = EXAMPLES / "serve.py" + + +@pytest.mark.parametrize("path", [NOTEBOOK, SCRIPT], ids=["notebook", "script"]) +def test_example_exists(path: pathlib.Path) -> None: + """Guards the paths above: a renamed or moved example would otherwise turn + its execution test into a skip, or a no-op, that nobody notices.""" + assert path.is_file(), f"missing example at {path}" + + +def test_serve_script_runs() -> None: + """Run examples/serve.py top to bottom. + + In-process rather than as a subprocess: the script's inline uv metadata + resolves `zarr-http-server` from git, so `uv run` on it would test whatever + is on main instead of the working tree. + """ + runpy.run_path(str(SCRIPT), run_name="__main__") + + +def test_serve_notebook_executes() -> None: + """Run every cell in a real kernel. + + The notebook asserts its own expectations -- status codes, byte ranges, + that a PUT is refused, that the port is closed after `shutdown()` -- so + this is not merely a check that nothing raised. `NotebookClient.execute` + defaults to ``allow_errors=False``, so any failed cell raises + `CellExecutionError` and fails this test with that cell's traceback. + """ + nbformat = pytest.importorskip("nbformat") + nbclient = pytest.importorskip("nbclient") + pytest.importorskip("ipykernel", reason="a kernel is needed to execute the notebook") + + notebook = nbformat.read(NOTEBOOK, as_version=4) + + # Run with the notebook's own directory as cwd, so any relative path it + # uses means the same thing as when a reader opens it. + nbclient.NotebookClient( + notebook, + timeout=300, + kernel_name="python3", + resources={"metadata": {"path": str(EXAMPLES)}}, + ).execute() diff --git a/packages/zarr-http-server/tests/test_properties.py b/packages/zarr-http-server/tests/test_properties.py new file mode 100644 index 0000000000..ff54392dfc --- /dev/null +++ b/packages/zarr-http-server/tests/test_properties.py @@ -0,0 +1,580 @@ +"""Property-based tests driven against a real HTTP endpoint. + +Every test here talks to an actual uvicorn server over a socket, not to an +in-process ASGI client, so the properties cover the parts of the stack that +only exist on the wire: header parsing, method dispatch, and status codes. + +Each property checks **two** things after a request -- the response, and the +state of the backing store. That pairing is the point. A server can answer +correctly and corrupt the store, or refuse a request and write anyway, and a +response-only assertion sees neither. The bug that motivated this module did +exactly that: a `PUT` to a non-canonically spelled chunk key ("c/00/00" +instead of "c/0/0") answered `204 No Content` and stored the body under a key +no reader ever looks up, so the client saw success and the data was invisible. + +The vocabulary below splits keys into two families: + +* **in-band** -- keys the served node genuinely owns: its metadata documents + and the canonical spelling of each chunk key in its grid. These must be + served, and writes to them must be visible to a zarr reader. +* **out-of-band** -- everything else: non-canonical spellings of a valid + chunk key, coordinates outside the grid, traversal attempts, and keys + belonging to a sibling node. These must be refused *and* must leave the + store byte-for-byte unchanged. +""" + +from __future__ import annotations + +import re +from dataclasses import dataclass +from typing import TYPE_CHECKING, Any, Literal +from urllib.parse import quote + +import httpx +import numpy as np +import pytest +import zarr +from hypothesis import assume, given, settings +from hypothesis import strategies as st +from zarr.buffer import cpu +from zarr.core.sync import sync + +from zarr_http_server import node_app, serve_background, store_app +from zarr_http_server._keys import _shard_grid_shape + +if TYPE_CHECKING: + from collections.abc import Iterator + + from zarr import Array + from zarr.abc.store import Store + +# Real HTTP round trips are slower and jumpier than hypothesis' default +# deadline allows, and a CI runner under load makes that worse. +_HTTP = settings(deadline=None, max_examples=50) + +# An uncompressed array so a chunk's bytes are exactly its raw values: a PUT +# body of the right length is a legitimate chunk, which lets these tests +# assert that a write is readable through a zarr client rather than merely +# present in the store. +_SHAPE = (6, 4) +_CHUNKS = (2, 2) +_DTYPE = "int32" + + +@dataclass(frozen=True) +class Served: + """A running server plus the handles needed to reason about its keys.""" + + url: str + store: Store + array: Array[Any] + kind: Literal["store", "node"] + + http_prefix: str + """Prepended to an array-relative key to form the request path.""" + + store_prefix: str + """Prepended to an array-relative key to form the backing store key.""" + + def path(self, array_relative_key: str) -> str: + return f"{self.http_prefix}{array_relative_key}" + + def store_key(self, array_relative_key: str) -> str: + return f"{self.store_prefix}{array_relative_key}" + + +def _snapshot(store: Store) -> dict[str, bytes]: + """Every key in *store* mapped to its bytes. + + Comparing two snapshots is how these tests assert that a rejected request + changed nothing -- not just that it added no key, but that it modified + none either. + """ + + async def _read() -> dict[str, bytes]: + out: dict[str, bytes] = {} + async for key in store.list(): + buf = await store.get(key, cpu.buffer_prototype) + if buf is not None: + out[key] = buf.to_bytes() + return out + + return sync(_read()) + + +@pytest.fixture( + scope="module", + params=[ + ("store", 2, "memory"), + ("store", 3, "memory"), + ("node", 2, "memory"), + ("node", 3, "memory"), + # LocalStore reads through the filesystem, which sizes its read from + # the range rather than from the object and so raises on an over-wide + # one. MemoryStore just slices a `bytes` and is happy with any bound, + # so a memory-only matrix cannot tell a clamped range from a refused + # one -- the store backend is part of what these properties test. + ("store", 3, "local"), + ("node", 3, "local"), + ], + ids=["store-v2", "store-v3", "node-v2", "node-v3", "store-v3-local", "node-v3-local"], +) +def served( + request: pytest.FixtureRequest, tmp_path_factory: pytest.TempPathFactory +) -> Iterator[Served]: + """One real server per (app kind, zarr format, store backend). + + Module-scoped because hypothesis drives hundreds of requests per test and + a server per example would dominate the runtime. `port=0` lets the OS + choose the port and `server.url` reports what it actually bound, which + avoids the bind-then-close race of picking a port up front. + """ + kind, zarr_format, backend = request.param + + store: Store + if backend == "local": + root_dir = tmp_path_factory.mktemp(f"{kind}-v{zarr_format}") + store = zarr.storage.LocalStore(root_dir) + else: + store = zarr.storage.MemoryStore() + root = zarr.open_group(store, mode="w", zarr_format=zarr_format) + array = root.create_array( + "inside", shape=_SHAPE, chunks=_CHUNKS, dtype=_DTYPE, compressors=None + ) + array[:] = np.arange(int(np.prod(_SHAPE)), dtype=_DTYPE).reshape(_SHAPE) + # A sibling the node_app must never serve, and whose keys therefore make + # good out-of-band probes. + sibling = root.create_array( + "outside", shape=_CHUNKS, chunks=_CHUNKS, dtype=_DTYPE, compressors=None + ) + sibling[:] = 1 + + if kind == "node": + server = serve_background(node_app(array, methods={"GET", "PUT"}), host="127.0.0.1", port=0) + http_prefix = "" + else: + server = serve_background( + store_app(store, methods={"GET", "PUT"}), host="127.0.0.1", port=0 + ) + http_prefix = "inside/" + assert server is not None + + try: + yield Served( + url=server.url, + store=store, + array=array, + kind=kind, + http_prefix=http_prefix, + store_prefix="inside/", + ) + finally: + server.shutdown() + + +def _grid(array: Array[Any]) -> tuple[int, ...]: + return _shard_grid_shape(array) + + +@st.composite +def chunk_coords(draw: st.DrawFn, array: Array[Any]) -> tuple[int, ...]: + """Coordinates of a chunk that exists in *array*'s storage grid.""" + return tuple(draw(st.integers(min_value=0, max_value=g - 1)) for g in _grid(array)) + + +@st.composite +def out_of_grid_coords(draw: st.DrawFn, array: Array[Any]) -> tuple[int, ...]: + """Coordinates outside the grid, so the key is well-formed but names nothing.""" + grid = _grid(array) + axis = draw(st.integers(min_value=0, max_value=len(grid) - 1)) + coords = list(draw(chunk_coords(array))) + coords[axis] = draw(st.integers(min_value=grid[axis], max_value=grid[axis] + 50)) + return tuple(coords) + + +# The confusability with ASCII digits is the point: `int()` accepts these as +# decimal digits, so they name a different store key while decoding to the +# same coordinate. That is the defect these strategies probe for. +_ARABIC_INDIC = "٠١٢٣٤٥٦٧٨٩" +_FULLWIDTH = "0123456789" # noqa: RUF001 + + +def _respellings(digits: str) -> list[str]: + """Strings `int()` maps to the same value as *digits*, spelled differently. + + These are exactly the spellings that make decode-only validation unsafe: + each names a *different* store key while decoding to the same coordinate. + """ + value = int(digits) + return [ + f"0{digits}", + f"00{digits}", + f"+{digits}", + f" {digits}", + f"{digits} ", + f"\t{digits}", + "".join(_ARABIC_INDIC[int(d)] for d in digits), + "".join(_FULLWIDTH[int(d)] for d in digits), + *([f"-{digits}"] if value == 0 else []), + ] + + +@st.composite +def non_canonical_chunk_keys(draw: st.DrawFn, array: Array[Any]) -> str: + """A chunk key that decodes into the grid but is not zarr's own spelling. + + Built by taking the canonical key and re-spelling one of its digit runs, + which keeps this strategy independent of the chunk key encoding's grammar. + """ + coords = draw(chunk_coords(array)) + canonical = array.metadata.encode_chunk_key(coords) + runs = list(re.finditer(r"\d+", canonical)) + assume(runs) + run = draw(st.sampled_from(runs)) + replacement = draw(st.sampled_from(_respellings(run.group()))) + key = canonical[: run.start()] + replacement + canonical[run.end() :] + assume(key != canonical) + return key + + +TRAVERSAL_KEYS = [ + # Percent-encoded on purpose. An HTTP client resolves dot-segments before + # it sends -- httpx turns "../secret" into "/secret" and ".." into "/" per + # RFC 3986 §5.2.4 -- so a literal "../" probe never reaches the server as + # traversal and asserts nothing. Encoded, it survives the client intact + # and Starlette decodes it back into a real ".." segment on arrival, which + # is the form the server's own guard has to catch. + "..%2Fsecret", + "%2e%2e%2Fsecret", + "%2e%2e%2F%2e%2e%2Fetc%2Fpasswd", + "%2e%2e", + "%2e", + "%2e%2Fzarr.json", + "a%2F..%2F..%2Fb", + "%2Fabsolute", + "sub%2F%2Fempty", + "C%3A%2Fwindows", + "..%5Cwindows", + "a%5C..%5C..%5Cb", + "%00nul", +] + + +def _chunk_payload(array: Array[Any]) -> bytes: + """Bytes of a full, uncompressed chunk for *array*.""" + return np.zeros(_CHUNKS, dtype=array.dtype).tobytes() + + +def _url(served: Served, array_relative_key: str) -> str: + """Request URL for a key, percent-encoded so it survives the wire verbatim. + + Generated keys contain characters a URL cannot carry literally -- a tab + makes httpx raise `InvalidURL`, and a space or a non-ASCII digit would be + re-encoded on the way out anyway. Encoding here means Starlette decodes + the path param back to exactly the key the strategy produced, so the + property really is "for any key K, a request for K is refused" rather than + "for any key the URL parser happened to leave alone". + """ + return f"{served.url}/{quote(served.path(array_relative_key), safe='/')}" + + +def _require_node_scope(served: Served) -> None: + """Skip a property that only a node-scoped app can satisfy. + + `store_app` proxies the store's raw key space and has no array semantics + to validate against, so every syntactically acceptable key is in-band for + it by contract -- including a non-canonical chunk spelling. Only + `node_app` claims to serve exactly one node's keys, so only `node_app` can + be held to what that set contains. + """ + if served.kind != "node": + pytest.skip("store_app serves the raw key space; node scoping does not apply") + + +class TestInBandRequests: + """Keys the node owns are served, and writes to them are visible.""" + + @given(data=st.data()) + @_HTTP + def test_get_of_a_canonical_key_returns_the_stored_bytes( + self, served: Served, data: st.DataObject + ) -> None: + """A GET of an in-band key returns exactly what the store holds, and + reading never changes the store.""" + coords = data.draw(chunk_coords(served.array)) + relative = served.array.metadata.encode_chunk_key(coords) + + before = _snapshot(served.store) + response = httpx.get(_url(served, relative), timeout=30) + + expected = before.get(served.store_key(relative)) + if expected is None: + assert response.status_code == 404 + else: + assert response.status_code == 200 + assert response.content == expected + assert _snapshot(served.store) == before + + @given(data=st.data()) + @_HTTP + def test_put_of_a_canonical_key_is_stored_and_readable( + self, served: Served, data: st.DataObject + ) -> None: + """The headline property: a PUT that reports success must be visible. + + Success means three things at once -- a 2xx, the bytes landing under + the key the client named, and a zarr client subsequently reading back + the values that were written. The original defect satisfied the first + and failed the other two. + """ + coords = data.draw(chunk_coords(served.array)) + fill = data.draw(st.integers(min_value=-(2**31), max_value=2**31 - 1)) + relative = served.array.metadata.encode_chunk_key(coords) + payload = np.full(_CHUNKS, fill, dtype=served.array.dtype).tobytes() + + before = _snapshot(served.store) + response = httpx.put(_url(served, relative), content=payload, timeout=30) + assert response.status_code == 204 + + after = _snapshot(served.store) + key = served.store_key(relative) + assert after[key] == payload, "the body did not land under the key the client named" + assert set(after) - set(before) <= {key}, "the write touched a key the client did not name" + + # The write is not merely present, it is legible: reopen the array and + # read the chunk the coordinates address. + reread = zarr.open_array(served.store, path="inside") + block = tuple(slice(c * s, (c + 1) * s) for c, s in zip(coords, _CHUNKS, strict=True)) + assert np.array_equal(reread[block], np.full(_CHUNKS, fill, dtype=served.array.dtype)) + + @given(data=st.data()) + @_HTTP + def test_range_of_a_stored_key_returns_the_matching_slice( + self, served: Served, data: st.DataObject + ) -> None: + """A satisfiable range returns exactly the bytes it names, and says so + in Content-Range.""" + relative = served.array.metadata.encode_chunk_key(tuple(0 for _ in _grid(served.array))) + key = served.store_key(relative) + before = _snapshot(served.store) + assume(key in before) + body = before[key] + + start = data.draw(st.integers(min_value=0, max_value=len(body) - 1)) + end = data.draw(st.integers(min_value=start, max_value=len(body) - 1)) + + response = httpx.get( + _url(served, relative), headers={"Range": f"bytes={start}-{end}"}, timeout=30 + ) + + assert response.status_code == 206 + assert response.content == body[start : end + 1] + # RFC 9110 §15.3.7: a single-part 206 must carry Content-Range, and it + # must describe the bytes actually returned. + content_range = response.headers["content-range"] + assert content_range.startswith(f"bytes {start}-{start + len(response.content) - 1}/") + assert _snapshot(served.store) == before + + @given(suffix=st.integers(min_value=1, max_value=200)) + @_HTTP + def test_suffix_range_returns_the_tail_and_locates_it( + self, served: Served, suffix: int + ) -> None: + """A suffix range must report where in the object its bytes came from. + + Zarr's sharding codec reads a shard index this way, so a 206 without + Content-Range leaves the reader unable to tell a clamped whole-object + read from the tail it asked for. + """ + relative = served.array.metadata.encode_chunk_key(tuple(0 for _ in _grid(served.array))) + key = served.store_key(relative) + before = _snapshot(served.store) + assume(key in before) + body = before[key] + + response = httpx.get( + _url(served, relative), headers={"Range": f"bytes=-{suffix}"}, timeout=30 + ) + + assert response.status_code == 206 + expected = body[-suffix:] if suffix <= len(body) else body + assert response.content == expected + first = len(body) - len(expected) + assert response.headers["content-range"].startswith(f"bytes {first}-{len(body) - 1}/") + assert _snapshot(served.store) == before + + +class TestOutOfBandRequests: + """Keys the node does not own are refused, and change nothing.""" + + @given(data=st.data()) + @_HTTP + def test_non_canonical_chunk_key_is_refused_and_writes_nothing( + self, served: Served, data: st.DataObject + ) -> None: + """The regression that motivated this module. + + A key that decodes into the grid but is spelled differently from + zarr's own rendering names a store key no reader consults. Accepting a + write to it reports success and loses the data, so it must be refused + and the store must be untouched. + """ + _require_node_scope(served) + relative = data.draw(non_canonical_chunk_keys(served.array)) + payload = _chunk_payload(served.array) + + before = _snapshot(served.store) + put = httpx.put(_url(served, relative), content=payload, timeout=30) + assert put.status_code == 404 + assert _snapshot(served.store) == before, "a refused write still modified the store" + + get = httpx.get(_url(served, relative), timeout=30) + assert get.status_code == 404 + assert _snapshot(served.store) == before + + @given(data=st.data()) + @_HTTP + def test_out_of_grid_chunk_key_is_refused_and_writes_nothing( + self, served: Served, data: st.DataObject + ) -> None: + """Coordinates past the end of the grid address no chunk of this array.""" + _require_node_scope(served) + coords = data.draw(out_of_grid_coords(served.array)) + relative = served.array.metadata.encode_chunk_key(coords) + + before = _snapshot(served.store) + put = httpx.put(_url(served, relative), content=_chunk_payload(served.array), timeout=30) + get = httpx.get(_url(served, relative), timeout=30) + + assert put.status_code == 404 + assert get.status_code == 404 + assert _snapshot(served.store) == before + + @given(key=st.sampled_from(TRAVERSAL_KEYS)) + @_HTTP + def test_traversal_key_is_refused_and_writes_nothing(self, served: Served, key: str) -> None: + """Nothing that tries to leave the served scope may be served or written.""" + before = _snapshot(served.store) + put = httpx.put(f"{served.url}/{key}", content=b"payload", timeout=30) + get = httpx.get(f"{served.url}/{key}", timeout=30) + + assert put.status_code in (403, 404, 405), f"{key!r} was accepted for writing" + assert get.status_code in (403, 404, 405), f"{key!r} was served" + assert _snapshot(served.store) == before + + @given(data=st.data()) + @_HTTP + def test_node_app_never_serves_a_sibling(self, served: Served, data: st.DataObject) -> None: + """A node_app is scoped to one node, so a sibling's keys are invisible + even though they exist in the same store.""" + if served.kind != "node": + pytest.skip("store_app deliberately serves the whole store") + + coords = data.draw(chunk_coords(served.array)) + chunk = served.array.metadata.encode_chunk_key(coords) + relative = data.draw( + st.sampled_from( + [ + f"outside/{chunk}", + "outside/zarr.json", + "outside/.zarray", + f"../outside/{chunk}", + ] + ) + ) + + before = _snapshot(served.store) + get = httpx.get(f"{served.url}/{relative}", timeout=30) + put = httpx.put(f"{served.url}/{relative}", content=b"payload", timeout=30) + + assert get.status_code == 404 + assert put.status_code == 404 + assert _snapshot(served.store) == before + + +class TestMethodsAndRanges: + """Transport-level invariants that hold for every key.""" + + @given( + method=st.sampled_from(["DELETE", "POST", "PATCH", "OPTIONS"]), + data=st.data(), + ) + @_HTTP + def test_unconfigured_method_is_refused_and_writes_nothing( + self, served: Served, method: str, data: st.DataObject + ) -> None: + """Only the methods the app was configured with may reach the store.""" + coords = data.draw(chunk_coords(served.array)) + relative = served.array.metadata.encode_chunk_key(coords) + + before = _snapshot(served.store) + response = httpx.request(method, _url(served, relative), content=b"payload", timeout=30) + + assert response.status_code == 405 + assert _snapshot(served.store) == before + + @given( + header=st.sampled_from( + [ + "bytes=abc-def", + "bytes=0-1,4-5", + "chars=0-7", + "bytes=", + "nonsense", + "bytes=+0-1", + ] + ) + ) + @_HTTP + def test_unusable_range_serves_the_whole_object(self, served: Served, header: str) -> None: + """RFC 9110 §14.2: a Range the server cannot use is ignored, not refused.""" + relative = served.array.metadata.encode_chunk_key(tuple(0 for _ in _grid(served.array))) + before = _snapshot(served.store) + key = served.store_key(relative) + assume(key in before) + + response = httpx.get(_url(served, relative), headers={"Range": header}, timeout=30) + + assert response.status_code == 200 + assert response.content == before[key] + assert "content-range" not in response.headers + + @given( + header=st.sampled_from( + [ + "bytes=5-2", + "bytes=-0", + "bytes=99999999999999999999-", + "bytes=100000-100001", + ] + ) + ) + @_HTTP + def test_unsatisfiable_range_is_refused(self, served: Served, header: str) -> None: + """A well-formed range that names nothing readable is a 416.""" + relative = served.array.metadata.encode_chunk_key(tuple(0 for _ in _grid(served.array))) + before = _snapshot(served.store) + assume(served.store_key(relative) in before) + + response = httpx.get(_url(served, relative), headers={"Range": header}, timeout=30) + + assert response.status_code == 416 + assert _snapshot(served.store) == before + + @given(end=st.integers(min_value=10**19, max_value=10**30)) + @_HTTP + def test_absurdly_wide_range_is_clamped_not_refused(self, served: Served, end: int) -> None: + """RFC 9110 §14.1.2 clamps a last-byte-pos past the end of the object, + so an over-wide range reads to EOF rather than erroring.""" + relative = served.array.metadata.encode_chunk_key(tuple(0 for _ in _grid(served.array))) + key = served.store_key(relative) + before = _snapshot(served.store) + assume(key in before) + + response = httpx.get( + _url(served, relative), headers={"Range": f"bytes=0-{end}"}, timeout=30 + ) + + assert response.status_code == 206 + assert response.content == before[key] + assert _snapshot(served.store) == before diff --git a/packages/zarr-http-server/tests/test_serve.py b/packages/zarr-http-server/tests/test_serve.py new file mode 100644 index 0000000000..8db6752ba1 --- /dev/null +++ b/packages/zarr-http-server/tests/test_serve.py @@ -0,0 +1,1831 @@ +from __future__ import annotations + +import asyncio +import errno +import os +import socket +from typing import TYPE_CHECKING, Any, Literal, get_args + +import numpy as np +import pytest +import zarr +from starlette.applications import Starlette +from starlette.routing import Mount +from starlette.testclient import TestClient +from zarr.buffer import cpu +from zarr.storage import LocalStore, MemoryStore + +from zarr_http_server._serve import ( + _SHUTDOWN_JOIN_MARGIN, + READ_ONLY_HTTP_METHODS, + READ_WRITE_HTTP_METHODS, + CorsOptions, + ReadOnlyHTTPMethod, + _bind_preferred_or_free, + _parse_range_header, + _RangeVerdict, + node_app, + serve_background, + store_app, +) + +if TYPE_CHECKING: + import pathlib + from collections.abc import Coroutine, Iterator + + from zarr.abc.store import Store + +ZarrFormat = Literal[2, 3] + +SHUTDOWN_TIMEOUT = 1 +"""shutdown_timeout used by the bounded-shutdown test.""" + +SLOW_HANDLER_SECONDS = 5 +"""How long that test's handler sleeps -- far longer than the shutdown bound, +so an unbounded join would be obvious.""" + + +def sync[T](coro: Coroutine[Any, Any, T]) -> T: + """Run a store coroutine to completion (tests use MemoryStore only).""" + return asyncio.run(coro) + + +@pytest.fixture +def group_with_arrays(store: Store) -> zarr.Group: + """Create a group containing a regular array and a sharded array.""" + root = zarr.open_group(store, mode="w") + zarr.create_array(root.store_path / "regular", shape=(4, 4), chunks=(2, 2), dtype="f8") + zarr.create_array( + root.store_path / "sharded", + shape=(8, 8), + chunks=(2, 2), + shards=(4, 4), + dtype="i4", + ) + return root + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestNodeAppDoesNotExposeNonZarrKeys: + """node_app must never expose keys that are not part of the zarr hierarchy.""" + + def test_non_zarr_key_returns_404(self, store: Store, group_with_arrays: zarr.Group) -> None: + """A key that is not valid zarr metadata or a valid chunk key should return 404, + even if the underlying store contains data at that path.""" + non_zarr_buf = cpu.buffer_prototype.buffer.from_bytes(b"secret data") + sync(store.set("secret.txt", non_zarr_buf)) + + app = node_app(group_with_arrays) + client = TestClient(app) + + # The non-zarr key must not be accessible. + response = client.get("/secret.txt") + assert response.status_code == 404 + + def test_non_zarr_key_nested_returns_404( + self, store: Store, group_with_arrays: zarr.Group + ) -> None: + """A non-zarr key nested under a real array's path should return 404, + even though the path prefix matches a valid zarr node.""" + non_zarr_buf = cpu.buffer_prototype.buffer.from_bytes(b"not a chunk") + sync(store.set("regular/notes.txt", non_zarr_buf)) + + app = node_app(group_with_arrays) + client = TestClient(app) + + response = client.get("/regular/notes.txt") + assert response.status_code == 404 + + def test_valid_metadata_is_accessible(self, group_with_arrays: zarr.Group) -> None: + """Zarr metadata keys (zarr.json) for both the root group and child arrays + should be served with a 200 status.""" + app = node_app(group_with_arrays) + client = TestClient(app) + + # Root group metadata + response = client.get("/zarr.json") + assert response.status_code == 200 + + # Array metadata + response = client.get("/regular/zarr.json") + assert response.status_code == 200 + + def test_valid_chunk_is_accessible(self, group_with_arrays: zarr.Group) -> None: + """A valid, in-bounds chunk key for an array with written data should + be served with a 200 status.""" + arr = group_with_arrays["regular"] + assert isinstance(arr, zarr.Array) + arr[:] = np.ones((4, 4)) + + app = node_app(group_with_arrays) + client = TestClient(app) + + # c/0/0 is a valid chunk key for a (4,4) array with (2,2) chunks. + response = client.get("/regular/c/0/0") + assert response.status_code == 200 + + def test_out_of_bounds_chunk_key_returns_404( + self, store: Store, group_with_arrays: zarr.Group + ) -> None: + """A chunk key that is syntactically valid but references indices beyond + the array's chunk grid should return 404.""" + arr = group_with_arrays["regular"] + assert isinstance(arr, zarr.Array) + arr[:] = np.ones((4, 4)) + + # Put real data at the out-of-grid key, so that a 404 can only come + # from the bounds check -- not from the key merely being absent. + planted = cpu.buffer_prototype.buffer.from_bytes(b"out of grid") + sync(store.set("regular/c/99/99", planted)) + assert sync(store.get("regular/c/99/99", cpu.buffer_prototype)) is not None + + app = node_app(group_with_arrays) + client = TestClient(app) + + # (4,4) array with (2,2) chunks has grid shape (2,2), so c/99/99 is + # syntactically valid but out of bounds. + response = client.get("/regular/c/99/99") + assert response.status_code == 404 + + def test_empty_path_returns_404(self, group_with_arrays: zarr.Group) -> None: + """A request to the root path '/' should return 404 because an empty + string is not a valid zarr key.""" + app = node_app(group_with_arrays) + client = TestClient(app) + + response = client.get("/") + assert response.status_code == 404 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestShardedArrayByteRangeReads: + """Byte-range reads against a sharded array served via node_app.""" + + def test_range_read_returns_206(self, group_with_arrays: zarr.Group) -> None: + """A Range header requesting a specific byte range (e.g. bytes=0-7) should + return 206 Partial Content with exactly those bytes.""" + arr = group_with_arrays["sharded"] + assert isinstance(arr, zarr.Array) + arr[:] = np.arange(64, dtype="i4").reshape((8, 8)) + + app = node_app(group_with_arrays) + client = TestClient(app) + + # c/0/0 is the first shard key for an (8,8) array with (4,4) shards. + full_response = client.get("/sharded/c/0/0") + assert full_response.status_code == 200 + full_body = full_response.content + + # Request the first 8 bytes. + range_response = client.get("/sharded/c/0/0", headers={"Range": "bytes=0-7"}) + assert range_response.status_code == 206 + assert range_response.content == full_body[:8] + + def test_suffix_range_read(self, group_with_arrays: zarr.Group) -> None: + """A suffix byte range (e.g. bytes=-4) should return the last N bytes + of the resource with a 206 status.""" + arr = group_with_arrays["sharded"] + assert isinstance(arr, zarr.Array) + arr[:] = np.arange(64, dtype="i4").reshape((8, 8)) + + app = node_app(group_with_arrays) + client = TestClient(app) + + full_response = client.get("/sharded/c/0/0") + full_body = full_response.content + + # Request the last 4 bytes. + range_response = client.get("/sharded/c/0/0", headers={"Range": "bytes=-4"}) + assert range_response.status_code == 206 + assert range_response.content == full_body[-4:] + + def test_offset_range_read(self, group_with_arrays: zarr.Group) -> None: + """An offset byte range (e.g. bytes=4-) should return all bytes from + the given offset to the end, with a 206 status.""" + arr = group_with_arrays["sharded"] + assert isinstance(arr, zarr.Array) + arr[:] = np.arange(64, dtype="i4").reshape((8, 8)) + + app = node_app(group_with_arrays) + client = TestClient(app) + + full_response = client.get("/sharded/c/0/0") + full_body = full_response.content + + # Request everything from byte 4 onward. + range_response = client.get("/sharded/c/0/0", headers={"Range": "bytes=4-"}) + assert range_response.status_code == 206 + assert range_response.content == full_body[4:] + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestUnusableRangeHeadersAreIgnored: + """A Range this server cannot turn into a read is ignored, not refused. + + RFC 9110 §14.2 requires ignoring a Range whose unit is unrecognized and + permits ignoring one that will not parse; either way the answer is 200 + with the full representation. Refusing with 416 would tell a client the + object is unreadable when only the request shape was unsupported -- and + a multi-range request, which is legal to send and which proxies and + download accelerators do send, would take that at face value. + """ + + @pytest.mark.parametrize( + "header", + [ + "bytes=abc-def", + "bytes=-abc", + "bytes=abc-", + "bytes=0-7,10-20", + "chars=0-7", + "bytes=", + "bytes=+0-1", + ], + ) + def test_unusable_range_serves_full_representation(self, store: Store, header: str) -> None: + """Non-numeric bounds, multi-range, a non-'bytes' unit, an empty spec + and a non-canonical byte position all fall back to a plain 200.""" + body = b"some data here" + sync(store.set("key", cpu.buffer_prototype.buffer.from_bytes(body))) + + client = TestClient(store_app(store), raise_server_exceptions=False) + + response = client.get("/key", headers={"Range": header}) + assert response.status_code == 200 + assert response.content == body + assert "content-range" not in response.headers + + +class TestParseRangeHeader: + """Unit tests for _parse_range_header.""" + + def test_parser_rejects_an_inverted_range(self) -> None: + """Pin the parser itself: on a MemoryStore an unguarded inverted range + happens to return b"" and still yields 416, so the status code alone + cannot tell whether the guard is present.""" + assert _parse_range_header("bytes=5-2") is _RangeVerdict.UNSATISFIABLE + assert _parse_range_header("bytes=0-0") is not _RangeVerdict.UNSATISFIABLE + + def test_valid_range(self) -> None: + """'bytes=0-99' should parse into a RangeByteRequest with start=0 and + end=100 (end is exclusive, so the inclusive HTTP end is incremented).""" + from zarr.abc.store import RangeByteRequest + + result = _parse_range_header("bytes=0-99") + assert result == RangeByteRequest(start=0, end=100) + + def test_valid_suffix(self) -> None: + """'bytes=-50' should parse into a SuffixByteRequest requesting the + last 50 bytes of the resource.""" + from zarr.abc.store import SuffixByteRequest + + result = _parse_range_header("bytes=-50") + assert result == SuffixByteRequest(suffix=50) + + def test_valid_offset(self) -> None: + """'bytes=10-' should parse into an OffsetByteRequest starting at + byte 10 and reading to the end of the resource.""" + from zarr.abc.store import OffsetByteRequest + + result = _parse_range_header("bytes=10-") + assert result == OffsetByteRequest(offset=10) + + def test_non_bytes_unit(self) -> None: + """An unrecognized range unit must be ignored, per RFC 9110 §14.2.""" + assert _parse_range_header("chars=0-7") is _RangeVerdict.IGNORE + + def test_garbage_values(self) -> None: + """Non-numeric bounds are ignored rather than raising a ValueError.""" + assert _parse_range_header("bytes=abc-def") is _RangeVerdict.IGNORE + + def test_multi_range(self) -> None: + """Multi-range requests (e.g. bytes=0-7,10-20) are legal to send; this + server does not build multipart/byteranges, so it serves the whole + representation instead of refusing.""" + assert _parse_range_header("bytes=0-7,10-20") is _RangeVerdict.IGNORE + + def test_empty_spec(self) -> None: + """A Range header with no range specifier after 'bytes=' is ignored.""" + assert _parse_range_header("bytes=") is _RangeVerdict.IGNORE + + def test_non_canonical_byte_position(self) -> None: + """`int` would accept these; RFC 9110 defines a byte position as + 1*DIGIT, so they are not ranges and the header is ignored.""" + assert _parse_range_header("bytes=+0-1") is _RangeVerdict.IGNORE + assert _parse_range_header("bytes= 0-1") is _RangeVerdict.IGNORE + assert _parse_range_header("bytes=0_0-1") is _RangeVerdict.IGNORE + + def test_oversized_start_is_unsatisfiable(self) -> None: + """A first-byte-pos past any possible object names nothing.""" + assert _parse_range_header("bytes=99999999999999999999-") is _RangeVerdict.UNSATISFIABLE + + def test_zero_length_suffix_is_unsatisfiable(self) -> None: + """ "The last zero bytes" names nothing.""" + assert _parse_range_header("bytes=-0") is _RangeVerdict.UNSATISFIABLE + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestWriteViaPut: + """store_app and node_app can be configured to accept PUT writes.""" + + def test_put_writes_to_store(self, store: Store) -> None: + """A PUT request to store_app with PUT enabled should write the + request body into the store at the given key.""" + app = store_app(store, methods={"GET", "PUT"}) + client = TestClient(app) + + payload = b"hello zarr" + response = client.put("/some/key", content=payload) + assert response.status_code == 204 + + # Verify the data landed in the store. + buf = sync(store.get("some/key", cpu.buffer_prototype)) + assert buf is not None + assert buf.to_bytes() == payload + + def test_put_then_get_roundtrip(self, store: Store) -> None: + """Data written via PUT should be retrievable via a subsequent GET + at the same key.""" + app = store_app(store, methods={"GET", "PUT"}) + client = TestClient(app) + + payload = b"\x00\x01\x02\x03" + client.put("/data/blob", content=payload) + + response = client.get("/data/blob") + assert response.status_code == 200 + assert response.content == payload + + def test_put_rejected_when_not_configured(self, store: Store) -> None: + """PUT requests should return 405 Method Not Allowed when the server + is created with the default methods (GET only).""" + app = store_app(store) + client = TestClient(app) + + response = client.put("/some/key", content=b"data") + assert response.status_code == 405 + + def test_put_on_node_validates_key(self, store: Store, group_with_arrays: zarr.Group) -> None: + """PUT requests via node_app should be rejected with 404 when the + target key is not a valid zarr key (metadata or chunk).""" + app = node_app(group_with_arrays, methods={"GET", "PUT"}) + client = TestClient(app) + + response = client.put("/not_a_zarr_key.bin", content=b"data") + assert response.status_code == 404 + + def test_put_to_valid_chunk_key_succeeds(self, group_with_arrays: zarr.Group) -> None: + """PUT requests via node_app to a valid chunk key should succeed + with 204, and the written data should be retrievable via GET.""" + app = node_app(group_with_arrays, methods={"GET", "PUT"}) + client = TestClient(app) + + payload = b"\x00" * 32 + response = client.put("/regular/c/0/0", content=payload) + assert response.status_code == 204 + + # Confirm it round-trips. + get_response = client.get("/regular/c/0/0") + assert get_response.status_code == 200 + assert get_response.content == payload + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestMethodValidation: + """Only the methods the handler implements may be served.""" + + def test_supported_methods_are_served(self, store: Store) -> None: + """GET, PUT and HEAD each behave as their verb implies.""" + app = store_app(store, methods={"GET", "PUT", "HEAD"}) + client = TestClient(app) + + assert client.put("/zarr.json", content=b'{"a":1}').status_code == 204 + assert client.get("/zarr.json").content == b'{"a":1}' + + # HEAD reports the same status as GET but carries no body. + head = client.head("/zarr.json") + assert head.status_code == 200 + assert head.content == b"" + + def test_empty_method_set_raises(self, store: Store) -> None: + """Asking for no methods must be rejected rather than producing a + server that answers every verb, including writes: Starlette treats a + falsy `methods` on a Route as "match anything".""" + for build in ( + lambda: store_app(store, methods=set()), + lambda: node_app(zarr.open_group(store, mode="a"), methods=set()), + ): + with pytest.raises(ValueError, match="at least one"): + build() + + @pytest.mark.parametrize("method", ["DELETE", "POST", "PATCH", "OPTIONS", "TRACE"]) + def test_unsupported_method_raises(self, store: Store, method: str) -> None: + """A verb the handler cannot implement is rejected when the app is + built, rather than silently answering as if it were a GET.""" + for build in ( + lambda: store_app(store, methods={"GET", method}), # type: ignore[arg-type] + lambda: node_app(zarr.open_group(store, mode="a"), methods={"GET", method}), # type: ignore[arg-type] + ): + with pytest.raises(ValueError, match=method): + build() + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestStoreAppEdgeCases: + """Edge cases for store_app.""" + + def test_get_nonexistent_key_returns_404(self, store: Store) -> None: + """GET for a key that does not exist in the store should return 404.""" + app = store_app(store) + client = TestClient(app) + + response = client.get("/no/such/key") + assert response.status_code == 404 + + def test_empty_path_returns_404(self, store: Store) -> None: + """GET to the root path '/' (empty key) should return 404 because + an empty string is not a valid store key.""" + app = store_app(store) + client = TestClient(app) + + response = client.get("/") + assert response.status_code == 404 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestNodeAppDirectArray: + """Serve a single array directly (not through a group).""" + + def test_serve_nested_array_directly(self, store: Store) -> None: + """When node_app is given a nested array (not a group), requests + should use keys relative to that array's path. Metadata and in-bounds + chunks should return 200, and out-of-bounds chunks should return 404.""" + root = zarr.open_group(store, mode="w") + arr = zarr.create_array( + root.store_path / "sub/nested", + shape=(4,), + chunks=(2,), + dtype="f8", + ) + arr[:] = np.arange(4, dtype="f8") + + # Serve the array directly — its prefix is "sub/nested". + app = node_app(arr) + client = TestClient(app) + + # Metadata should be accessible at the array root. + response = client.get("/zarr.json") + assert response.status_code == 200 + + # Chunk keys are relative to the array. + response = client.get("/c/0") + assert response.status_code == 200 + + response = client.get("/c/1") + assert response.status_code == 200 + + # Out of bounds. + response = client.get("/c/99") + assert response.status_code == 404 + + def test_serve_root_array(self, store: Store) -> None: + """When node_app is given an array stored at the root of a store + (empty prefix), metadata and chunk keys should be accessible at + their natural paths.""" + arr = zarr.create_array( + store, + shape=(6,), + chunks=(3,), + dtype="i4", + ) + arr[:] = np.arange(6, dtype="i4") + + # Root-level array has prefix = "". + app = node_app(arr) + client = TestClient(app) + + response = client.get("/zarr.json") + assert response.status_code == 200 + + response = client.get("/c/0") + assert response.status_code == 200 + + response = client.get("/c/1") + assert response.status_code == 200 + + response = client.get("/c/2") + assert response.status_code == 404 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestContentType: + """Responses should have the correct Content-Type.""" + + def test_metadata_has_json_content_type(self, group_with_arrays: zarr.Group) -> None: + """Zarr metadata files (zarr.json) should be served with + Content-Type: application/json.""" + app = node_app(group_with_arrays) + client = TestClient(app) + + response = client.get("/zarr.json") + assert response.status_code == 200 + assert response.headers["content-type"] == "application/json" + + def test_chunk_has_octet_stream_content_type(self, group_with_arrays: zarr.Group) -> None: + """Chunk data should be served with Content-Type: application/octet-stream + since it is binary data.""" + arr = group_with_arrays["regular"] + assert isinstance(arr, zarr.Array) + arr[:] = np.ones((4, 4)) + + app = node_app(group_with_arrays) + client = TestClient(app) + + response = client.get("/regular/c/0/0") + assert response.status_code == 200 + assert response.headers["content-type"] == "application/octet-stream" + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestCorsMiddleware: + """CORS middleware should add the expected headers.""" + + def test_cors_headers_present(self, store: Store) -> None: + """When cors_options are provided, responses should include the + Access-Control-Allow-Origin header matching the request origin.""" + buf = cpu.buffer_prototype.buffer.from_bytes(b"data") + sync(store.set("key", buf)) + + cors = CorsOptions(allow_origins=["https://example.com"], allow_methods=["GET"]) + app = store_app(store, cors_options=cors) + client = TestClient(app) + + response = client.get("/key", headers={"Origin": "https://example.com"}) + assert response.status_code == 200 + assert response.headers["access-control-allow-origin"] == "https://example.com" + + def test_cors_preflight(self, store: Store) -> None: + """CORS preflight OPTIONS requests should return 200 with the + Access-Control-Allow-Origin header when CORS is configured.""" + cors = CorsOptions(allow_origins=["*"], allow_methods=["GET", "PUT"]) + app = store_app(store, methods={"GET", "PUT"}, cors_options=cors) + client = TestClient(app) + + response = client.options( + "/any/path", + headers={ + "Origin": "https://example.com", + "Access-Control-Request-Method": "PUT", + }, + ) + assert response.status_code == 200 + assert "access-control-allow-origin" in response.headers + + def test_no_cors_headers_without_option(self, store: Store) -> None: + """When no cors_options are provided, responses should not include + any CORS headers, even if the request includes an Origin header.""" + buf = cpu.buffer_prototype.buffer.from_bytes(b"data") + sync(store.set("key", buf)) + + app = store_app(store) + client = TestClient(app) + + response = client.get("/key", headers={"Origin": "https://example.com"}) + assert response.status_code == 200 + assert "access-control-allow-origin" not in response.headers + + +def _metadata_key(zarr_format: ZarrFormat) -> str: + """Return the metadata key for the given zarr format.""" + return "zarr.json" if zarr_format == 3 else ".zarray" + + +def _chunk_key(zarr_format: ZarrFormat, coords: str) -> str: + """Return a chunk key for the given format. + + *coords* is a dot-separated string like ``"0.0"``. For v3 this becomes + ``"c/0/0"``; for v2 it is returned unchanged. + """ + if zarr_format == 3: + return "c/" + coords.replace(".", "/") + return coords + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestNodeAppV2AndV3: + """Test node_app with both v2 and v3 arrays side by side.""" + + def test_metadata_accessible(self, store: Store, zarr_format: ZarrFormat) -> None: + """The format-appropriate metadata key should be served with 200.""" + arr = zarr.create_array(store, shape=(4,), chunks=(2,), dtype="f8", zarr_format=zarr_format) + app = node_app(arr) + client = TestClient(app) + + response = client.get(f"/{_metadata_key(zarr_format)}") + assert response.status_code == 200 + + def test_chunk_accessible(self, store: Store, zarr_format: ZarrFormat) -> None: + """An in-bounds chunk key should be served with 200 for both formats.""" + arr = zarr.create_array(store, shape=(4,), chunks=(2,), dtype="f8", zarr_format=zarr_format) + arr[:] = np.ones(4) + + app = node_app(arr) + client = TestClient(app) + + response = client.get(f"/{_chunk_key(zarr_format, '0')}") + assert response.status_code == 200 + + def test_out_of_bounds_chunk_returns_404(self, store: Store, zarr_format: ZarrFormat) -> None: + """An out-of-bounds chunk key should return 404 for both formats.""" + arr = zarr.create_array(store, shape=(4,), chunks=(2,), dtype="f8", zarr_format=zarr_format) + arr[:] = np.ones(4) + + # Plant data at the out-of-grid key so the 404 must come from the + # bounds check rather than from the key being absent. + key = _chunk_key(zarr_format, "99") + sync(store.set(key, cpu.buffer_prototype.buffer.from_bytes(b"out of grid"))) + assert sync(store.get(key, cpu.buffer_prototype)) is not None + + app = node_app(arr) + client = TestClient(app) + + response = client.get(f"/{key}") + assert response.status_code == 404 + + def test_non_zarr_key_returns_404(self, store: Store, zarr_format: ZarrFormat) -> None: + """A non-zarr key should return 404 regardless of format.""" + arr = zarr.create_array(store, shape=(4,), chunks=(2,), dtype="f8", zarr_format=zarr_format) + non_zarr_buf = cpu.buffer_prototype.buffer.from_bytes(b"secret") + sync(store.set("secret.txt", non_zarr_buf)) + + app = node_app(arr) + client = TestClient(app) + + response = client.get("/secret.txt") + assert response.status_code == 404 + + def test_data_roundtrip(self, store: Store, zarr_format: ZarrFormat) -> None: + """Data written to an array should be readable via store_app for + both formats.""" + arr = zarr.create_array(store, shape=(4,), chunks=(2,), dtype="f8", zarr_format=zarr_format) + arr[:] = np.arange(4, dtype="f8") + + app = store_app(store) + client = TestClient(app) + + # Metadata should be accessible. + response = client.get(f"/{_metadata_key(zarr_format)}") + assert response.status_code == 200 + + # First chunk should be accessible. + response = client.get(f"/{_chunk_key(zarr_format, '0')}") + assert response.status_code == 200 + assert len(response.content) > 0 + + +class TestPathTraversalProtection: + """store_app and node_app must reject path-traversal attempts before + touching the store, regardless of URL-encoding tricks.""" + + def test_get_traversal_outside_store_root_returns_404(self, tmp_path: Any) -> None: + """A GET for a percent-encoded '../secret.txt' must not escape the + store root and read a file outside it.""" + from zarr.storage import LocalStore + + root = tmp_path / "store_root" + root.mkdir() + secret = tmp_path / "secret.txt" + secret.write_text("top secret contents") + + store = LocalStore(root) + app = store_app(store, methods={"GET", "PUT"}) + client = TestClient(app) + + response = client.get("/..%2fsecret.txt") + assert response.status_code == 404 + assert b"top secret" not in response.content + + def test_put_traversal_outside_store_root_returns_404(self, tmp_path: Any) -> None: + """A PUT to a percent-encoded '../pwned.txt' must not escape the + store root and write a file outside it.""" + from zarr.storage import LocalStore + + root = tmp_path / "store_root" + root.mkdir() + pwned = tmp_path / "pwned.txt" + + store = LocalStore(root) + app = store_app(store, methods={"GET", "PUT"}) + client = TestClient(app) + + response = client.put("/..%2fpwned.txt", content=b"pwned") + assert response.status_code == 404 + assert not pwned.exists() + + @pytest.mark.parametrize( + ("encoded_path", "climb_depth"), + [ + ("/..%2fsecret.txt", 1), + ("/%2e%2e/secret.txt", 1), + ("/..%2f..%2fsecret.txt", 2), + ], + ) + def test_encoded_traversal_variants_return_404( + self, tmp_path: Any, encoded_path: str, climb_depth: int + ) -> None: + """Various percent-encoded traversal spellings must all be rejected. + + The store root is nested exactly ``climb_depth`` directories below + ``tmp_path`` and the secret lives at ``tmp_path/secret.txt`` -- the + exact location each traversal's ".." segments resolve to -- so a + case with a missing or deleted guard would actually reach the + secret instead of just returning 404 for an unrelated reason (e.g. + a two-level climb landing on a directory that happens to be empty). + """ + from zarr.storage import LocalStore + + parts = [f"level{i}" for i in range(climb_depth - 1)] + ["store_root"] + root = tmp_path.joinpath(*parts) + root.mkdir(parents=True) + secret = tmp_path / "secret.txt" + secret.write_text("top secret contents") + + store = LocalStore(root) + app = store_app(store, methods={"GET", "PUT"}) + client = TestClient(app) + + response = client.get(encoded_path) + assert response.status_code == 404 + assert b"top secret" not in response.content + + def test_get_absolute_key_bypass_returns_404(self, tmp_path: Any) -> None: + """A percent-encoded leading slash decodes to an ABSOLUTE path param + (e.g. request '/%2fetc%2fhostname' -> path param '/etc/hostname'). + '/etc/hostname'.split('/') -> ['', 'etc', 'hostname'] has no '.' or + '..' segment, so the two-element guard misses it, but LocalStore + resolves an absolute key by discarding its root entirely -- an + arbitrary-file read. The empty leading segment must be rejected.""" + from zarr.storage import LocalStore + + root = tmp_path / "store_root" + root.mkdir() + secret = tmp_path / "secret_abs.txt" + secret.write_text("top secret absolute contents") + + store = LocalStore(root) + app = store_app(store, methods={"GET", "PUT"}) + client = TestClient(app) + + # Mirror the exploit: percent-encode every "/" (including the + # leading one) in the absolute secret path as "%2f". + encoded_path = "/" + str(secret).replace("/", "%2f") + + response = client.get(encoded_path) + assert response.status_code == 404 + assert b"top secret absolute" not in response.content + assert secret.read_text() == "top secret absolute contents" + + def test_put_absolute_key_bypass_returns_404(self, tmp_path: Any) -> None: + """Same absolute-key vector as above, but for PUT: a percent-encoded + leading slash must not allow writing a file outside the store root.""" + from zarr.storage import LocalStore + + root = tmp_path / "store_root" + root.mkdir() + pwned = tmp_path / "pwned_abs.txt" + + store = LocalStore(root) + app = store_app(store, methods={"GET", "PUT"}) + client = TestClient(app) + + encoded_path = "/" + str(pwned).replace("/", "%2f") + + response = client.put(encoded_path, content=b"pwned") + assert response.status_code == 404 + assert not pwned.exists() + + @pytest.mark.parametrize( + "encoded_path", + [ + "/..%5C..%5Cwin.ini", + "/%5CWindows%5Cwin.ini", + "/C:/Windows/win.ini", + "/C:%5CWindows", + "/%5C%5Chost%5Cshare%5Cx", + ], + ) + def test_backslash_and_drive_traversal_variants_return_404(self, encoded_path: str) -> None: + """Backslash is a path separator on Windows, and a drive-qualified or + root-relative key discards a filesystem store's root entirely on + Windows, even though POSIX only ever treats '/' as a separator. The + guard must reject these purely from the string, before the store is + ever touched -- verified here by making the store raise if called.""" + from unittest.mock import AsyncMock + + from zarr.storage import MemoryStore + + store = MemoryStore() + store.get = AsyncMock(side_effect=AssertionError("store.get should not be called")) # type: ignore[method-assign] + store.set = AsyncMock(side_effect=AssertionError("store.set should not be called")) # type: ignore[method-assign] + + app = store_app(store, methods={"GET", "PUT"}) + client = TestClient(app) + + response = client.get(encoded_path) + assert response.status_code == 404 + + def test_put_backslash_traversal_returns_404(self) -> None: + """A PUT to a backslash-encoded '..\\..\\pwned.txt' must be rejected + before the store is touched, mirroring the GET case above.""" + from unittest.mock import AsyncMock + + from zarr.storage import MemoryStore + + store = MemoryStore() + store.set = AsyncMock(side_effect=AssertionError("store.set should not be called")) # type: ignore[method-assign] + + app = store_app(store, methods={"GET", "PUT"}) + client = TestClient(app) + + response = client.put("/..%5C..%5Cpwned.txt", content=b"pwned") + assert response.status_code == 404 + + +def _get_free_port() -> int: + """Return an unused TCP port on localhost.""" + import socket + + with socket.socket() as s: + s.bind(("127.0.0.1", 0)) + port: int = s.getsockname()[1] + return port + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestServeBackground: + """Test serve_background with store- and node-scoped apps.""" + + def test_background_server_over_a_store_app(self, store: Store) -> None: + """serve_background over a store app should return a BackgroundServer + that responds to HTTP requests and can be used as a context manager.""" + import httpx + + from zarr_http_server import serve_background + + buf = cpu.buffer_prototype.buffer.from_bytes(b"hello") + sync(store.set("key", buf)) + + port = _get_free_port() + with serve_background(store_app(store), host="127.0.0.1", port=port) as server: + assert server.host == "127.0.0.1" + assert server.port == port + assert server.url == f"http://127.0.0.1:{port}" + + response = httpx.get(f"{server.url}/key") + assert response.status_code == 200 + assert response.content == b"hello" + + def test_background_server_over_a_node_app(self, store: Store) -> None: + """serve_background over a node app should return a BackgroundServer + that responds to HTTP requests and can be used as a context manager.""" + import httpx + + from zarr_http_server import serve_background + + arr = zarr.create_array(store, shape=(4,), chunks=(2,), dtype="f8") + arr[:] = np.arange(4, dtype="f8") + + port = _get_free_port() + with serve_background(node_app(arr), host="127.0.0.1", port=port) as server: + response = httpx.get(f"{server.url}/zarr.json") + assert response.status_code == 200 + + +class TestStoreFailuresAreNotReportedAsMisses: + """Under the v3 spec an absent chunk is an uninitialized one, and a reader + is right to substitute the array's fill value for it. A 404 therefore + asserts something about the store's contents, and an I/O failure must not + borrow it -- that would have a correct client materialize fill values over + data that exists.""" + + @pytest.mark.skipif(os.geteuid() == 0, reason="root bypasses the permission bits under test") + def test_unreadable_key_is_a_server_error(self, tmp_path: pathlib.Path) -> None: + root = tmp_path / "root" + root.mkdir() + (root / "key").write_bytes(b"real data") + os.chmod(root / "key", 0o000) + + client = TestClient(store_app(LocalStore(str(root))), raise_server_exceptions=False) + try: + assert client.get("/key").status_code >= 500 + finally: + os.chmod(root / "key", 0o600) + + @pytest.mark.skipif(os.geteuid() == 0, reason="root bypasses the permission bits under test") + def test_unwritable_store_is_a_server_error(self, tmp_path: pathlib.Path) -> None: + root = tmp_path / "ro" + root.mkdir() + os.chmod(root, 0o500) + + client = TestClient( + store_app(LocalStore(str(root)), methods={"GET", "PUT"}), + raise_server_exceptions=False, + ) + try: + assert client.put("/key", content=b"data").status_code >= 500 + finally: + os.chmod(root, 0o700) + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestShardGridBounds: + """A sharded array's storage grid is its shard grid, not its chunk grid.""" + + def test_out_of_shard_grid_key_returns_404(self, store: Store) -> None: + arr = zarr.create_array(store, shape=(8, 8), chunks=(2, 2), shards=(4, 4), dtype="i4") + arr[:] = np.arange(64, dtype="i4").reshape(8, 8) + + # (8,8) with (4,4) shards has a 2x2 shard grid, so c/3/3 is out of it. + # Plant data there so the 404 must come from the bounds check. + sync(store.set("c/3/3", cpu.buffer_prototype.buffer.from_bytes(b"PLANTED"))) + assert sync(store.get("c/3/3", cpu.buffer_prototype)) is not None + + client = TestClient(node_app(arr)) + assert client.get("/c/0/0").status_code == 200 + assert client.get("/c/3/3").status_code == 404 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestWrongArityChunkKeys: + """A chunk key with the wrong number of coordinates is invalid, and must + not reach the grid comparison -- zip(strict=True) would raise there.""" + + @pytest.mark.parametrize("key", ["c/0", "c/0/0/0", "c/0/0/0/0"]) + def test_wrong_arity_returns_404(self, store: Store, key: str) -> None: + arr = zarr.create_array(store, shape=(4, 4), chunks=(2, 2), dtype="f8") + arr[:] = np.ones((4, 4)) + + sync(store.set(key, cpu.buffer_prototype.buffer.from_bytes(b"PLANTED"))) + + client = TestClient(node_app(arr), raise_server_exceptions=False) + assert client.get(f"/{key}").status_code == 404 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestNodeNamesContainingAColon: + """A leading `:` is a drive reference to `ntpath`, so the guard rejects + it on every platform to keep it a pure string gate in front of any store. + The documented cost is that such a name is unreachable in the first + segment -- but only there.""" + + def test_colon_named_node_in_a_later_segment_is_served(self, store: Store) -> None: + root = zarr.open_group(store, mode="w") + sub = root.create_group("sub") + sub.create_array("a:b", shape=(2,), chunks=(2,), dtype="f8") + + client = TestClient(node_app(root)) + assert client.get("/sub/a:b/zarr.json").status_code == 200 + + def test_colon_named_node_in_the_first_segment_is_rejected(self, store: Store) -> None: + root = zarr.open_group(store, mode="w") + root.create_array("a:b", shape=(2,), chunks=(2,), dtype="f8") + + client = TestClient(node_app(root)) + assert client.get("/a:b/zarr.json").status_code == 404 + + +class TestChunkedBodyIsCapped: + """A chunked request carries no Content-Length, so the cap has to hold + while the body is being read rather than after it is buffered.""" + + def test_chunked_body_over_cap_is_rejected(self, tmp_path: pathlib.Path) -> None: + store = LocalStore(str(tmp_path / "root")) + client = TestClient( + store_app(store, methods={"GET", "PUT"}, max_body_size=64), + raise_server_exceptions=False, + ) + + def body() -> Iterator[bytes]: + for _ in range(20): + yield b"x" * 32 + + # httpx sends an iterator body with Transfer-Encoding: chunked. + assert client.put("/key", content=body()).status_code == 413 + assert not (tmp_path / "root" / "key").exists() + + +class TestHostileKeysAreNotServerErrors: + """A key the store cannot express is a miss, not a server fault: the + server must never answer 5xx for input a client can choose freely. + + This needs a filesystem-backed store -- a `MemoryStore` accepts any key + as a dict key, so only `LocalStore` surfaces the underlying errors (an + embedded NUL, a name longer than the filesystem allows). + """ + + @pytest.mark.parametrize( + "path", ["/x%00y", "/ok.txt%00", "/" + "a" * 3000, "/" + "b" * 3000 + "/zarr.json"] + ) + def test_unexpressable_key_returns_404_not_500(self, tmp_path: pathlib.Path, path: str) -> None: + store = LocalStore(str(tmp_path / "root")) + client = TestClient(store_app(store, methods={"GET", "PUT"})) + + assert client.get(path).status_code == 404 + assert client.put(path, content=b"x").status_code == 404 + + +class TestGenericStoreFailuresAreNotMisses: + """Only an error that answers about the *name* may become a 404. + + `ENAMETOOLONG` says no such name is expressible, which is an answer about + the key. `EINVAL` is POSIX's catch-all and is reachable on a perfectly + ordinary short key -- a bad seek, an unsupported filesystem feature -- so + reporting it as absence would have a v3 reader write fill values over a + chunk that exists but could not be read. + """ + + @staticmethod + def _store_failing_with(code: int) -> Store: + class Failing(MemoryStore): + async def get(self, key: str, prototype: Any, byte_range: Any = None) -> Any: + raise OSError(code, os.strerror(code)) + + async def set(self, key: str, value: Any) -> None: + raise OSError(code, os.strerror(code)) + + return Failing() + + def test_einval_is_not_reported_as_absent(self) -> None: + """The regression this class exists for.""" + client = TestClient( + store_app(self._store_failing_with(errno.EINVAL), methods={"GET", "PUT"}), + raise_server_exceptions=False, + ) + + assert client.get("/c/0/0").status_code >= 500 + assert client.put("/c/0/0", content=b"data").status_code >= 500 + + def test_enametoolong_is_still_a_miss(self) -> None: + """A name the store cannot express holds nothing, so 404 is honest.""" + client = TestClient( + store_app(self._store_failing_with(errno.ENAMETOOLONG), methods={"GET", "PUT"}), + raise_server_exceptions=False, + ) + + assert client.get("/c/0/0").status_code == 404 + assert client.put("/c/0/0", content=b"data").status_code == 404 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestPutBodyLimit: + """`Store.set` takes a whole buffer, so an unbounded body would let one + request size the server's memory use.""" + + def test_body_over_the_limit_is_rejected(self, store: Store) -> None: + client = TestClient(store_app(store, methods={"GET", "PUT"}, max_body_size=64)) + + assert client.put("/key", content=b"x" * 65).status_code == 413 + # Nothing was written. + assert sync(store.get("key", cpu.buffer_prototype)) is None + # A body within the limit still succeeds. + assert client.put("/key", content=b"x" * 64).status_code == 204 + + def test_limit_can_be_lifted(self, store: Store) -> None: + client = TestClient(store_app(store, methods={"GET", "PUT"}, max_body_size=None)) + assert client.put("/key", content=b"x" * 5000).status_code == 204 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestRangeResponseCorrectness: + """A 206 must describe which bytes it carries, and a range that cannot be + satisfied must say so rather than returning an empty 206.""" + + def test_206_carries_content_range(self, store: Store) -> None: + sync(store.set("key", cpu.buffer_prototype.buffer.from_bytes(b"0123456789"))) + client = TestClient(store_app(store)) + + response = client.get("/key", headers={"Range": "bytes=2-5"}) + assert response.status_code == 206 + assert response.content == b"2345" + assert response.headers["Content-Range"] == "bytes 2-5/*" + + def test_range_beyond_end_is_416(self, store: Store) -> None: + sync(store.set("key", cpu.buffer_prototype.buffer.from_bytes(b"0123456789"))) + client = TestClient(store_app(store)) + + assert client.get("/key", headers={"Range": "bytes=1000-2000"}).status_code == 416 + + def test_inverted_range_is_416(self, store: Store) -> None: + sync(store.set("key", cpu.buffer_prototype.buffer.from_bytes(b"0123456789"))) + client = TestClient(store_app(store)) + + assert client.get("/key", headers={"Range": "bytes=5-2"}).status_code == 416 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestZeroDimensionalArray: + """A 0-d array has exactly one chunk, spelled `0` in v2 and `c` in v3.""" + + @pytest.mark.parametrize("zarr_format", [2, 3]) + def test_sole_chunk_is_served(self, store: Store, zarr_format: ZarrFormat) -> None: + arr = zarr.create_array(store, shape=(), dtype="i4", zarr_format=zarr_format) + arr[...] = 7 + + client = TestClient(node_app(arr)) + chunk_key = "0" if zarr_format == 2 else "c" + + assert client.get(f"/{chunk_key}").status_code == 200 + # A 1-d coordinate is not valid for a 0-d grid. + assert client.get("/0/0").status_code == 404 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestGroupAndArrayMetadataKeysAreDistinct: + """A v2 group owns `.zgroup`; `.zarray` belongs to arrays, and vice versa.""" + + def test_node_does_not_claim_the_other_kind_of_metadata(self, store: Store) -> None: + root = zarr.open_group(store, mode="w", zarr_format=2) + arr = root.create_array("a", shape=(2,), chunks=(2,), dtype="f8") + + # Plant both documents so a 404 reflects the key set, not absence. + sync(store.set(".zarray", cpu.buffer_prototype.buffer.from_bytes(b"{}"))) + sync(store.set("a/.zgroup", cpu.buffer_prototype.buffer.from_bytes(b"{}"))) + + assert TestClient(node_app(root)).get("/.zarray").status_code == 404 + assert TestClient(node_app(arr)).get("/.zgroup").status_code == 404 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestBackgroundServerReportsBoundPort: + """`port=0` asks the OS for a free port, so the server must report the + port it actually bound rather than the zero it was asked for.""" + + def test_port_zero_reports_the_bound_port(self, store: Store) -> None: + import httpx + + from zarr_http_server import serve_background + + sync(store.set("key", cpu.buffer_prototype.buffer.from_bytes(b"hello"))) + + with serve_background(store_app(store), host="127.0.0.1", port=0) as server: + assert server.port != 0 + assert server.url == f"http://127.0.0.1:{server.port}" + # The reported URL is the one that actually serves the data. + assert httpx.get(f"{server.url}/key").content == b"hello" + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestUnopenableChildIsAnError: + """A child that cannot be *judged* must not be reported as absent. + + 404 is a claim about the store's contents, and under the v3 spec an + absent chunk is an uninitialized one -- so a correct reader answers 404 + by silently substituting the array's fill value. Returning it for a child + whose metadata could not be read would materialize zeros over data that + exists. Only a genuinely missing member is a 404; corrupt metadata, an + I/O error, or a codec this process lacks all surface as 5xx. + """ + + def test_child_with_unparseable_metadata_is_not_reported_as_missing(self, store: Store) -> None: + """A corrupt child metadata document must not yield 404.""" + root = zarr.open_group(store, mode="w") + root.create_array("good", shape=(2,), chunks=(2,), dtype="f8") + sync(store.set("junk/zarr.json", cpu.buffer_prototype.buffer.from_bytes(b"not json"))) + + client = TestClient(node_app(root), raise_server_exceptions=False) + + assert client.get("/good/zarr.json").status_code == 200 + assert client.get("/junk/zarr.json").status_code >= 500 + assert client.get("/junk/c/0").status_code >= 500 + + def test_absent_child_is_reported_as_missing(self, store: Store) -> None: + """A member that simply is not there is still a plain 404.""" + root = zarr.open_group(store, mode="w") + root.create_array("good", shape=(2,), chunks=(2,), dtype="f8") + + client = TestClient(node_app(root), raise_server_exceptions=False) + + assert client.get("/nope/zarr.json").status_code == 404 + assert client.get("/junk/c/0").status_code == 404 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestReadBackWithZarrClient: + """The round-trip the README leads with: serve an array, then open it + with a zarr client over HTTP. + + This needs an HTTP-capable fsspec, which is a client-side concern that + `zarr-http-server` deliberately does not depend on -- it lives in the `docs` + dependency group, alongside the other deps the README examples need. + """ + + def test_served_array_reads_back_identically(self, store: Store) -> None: + """`zarr.open_array(server.url)` should return the same data that was + served, so the README's headline example stays true.""" + pytest.importorskip("fsspec") + pytest.importorskip("aiohttp") + + from zarr_http_server import serve_background + + expected = np.arange(100, dtype="uint8").reshape(10, 10) + arr = zarr.create_array(store, data=expected, chunks=(5, 5), write_data=True) + + port = _get_free_port() + with serve_background(node_app(arr), host="127.0.0.1", port=port) as server: + remote = zarr.open_array(server.url, mode="r") + np.testing.assert_array_equal(remote[:], expected) + + +class TestBackgroundServerBoundedShutdown: + """BackgroundServer.shutdown() must not hang forever on a slow or stuck + in-flight request.""" + + def test_shutdown_returns_promptly_with_slow_inflight_request(self) -> None: + """A request that takes far longer than shutdown_timeout must not + prevent shutdown() from returning within roughly shutdown_timeout, + via uvicorn's force_exit rather than an unbounded thread join.""" + import asyncio + import threading + import time + + import httpx + from starlette.applications import Starlette + from starlette.responses import Response + from starlette.routing import Route + + async def slow(request: Any) -> Response: + # Sleeps far longer than shutdown_timeout below, so a correct + # implementation must force the connection closed rather than + # wait for this to finish. + await asyncio.sleep(SLOW_HANDLER_SECONDS) + return Response(status_code=204) + + app = Starlette(routes=[Route("/slow", slow, methods=["GET"])]) + port = _get_free_port() + server = serve_background( + app, host="127.0.0.1", port=port, shutdown_timeout=SHUTDOWN_TIMEOUT + ) + assert server is not None + + request_errors: list[BaseException] = [] + + def make_slow_request() -> None: + try: + httpx.get(f"http://127.0.0.1:{port}/slow", timeout=10) + except Exception as exc: # noqa: BLE001 -- connection drop when the server force-closes is expected + request_errors.append(exc) + + request_thread = threading.Thread(target=make_slow_request, daemon=True) + request_thread.start() + time.sleep(0.2) # give the request time to actually start + + start = time.monotonic() + server.shutdown() + elapsed = time.monotonic() - start + + # The property is that shutdown is *bounded*, not that it hits a + # particular wall-clock number. Derive the bound from the timeouts + # that produce it rather than hard-coding one: shutdown() waits + # `shutdown_timeout + _SHUTDOWN_JOIN_MARGIN` for a graceful stop, then + # `shutdown_timeout` more after force_exit. A literal here silently + # loses its headroom whenever one of those constants changes -- which + # is what happened when the margin was introduced. + bound = (SHUTDOWN_TIMEOUT + _SHUTDOWN_JOIN_MARGIN) + SHUTDOWN_TIMEOUT + 1.0 + assert elapsed < bound, f"shutdown() took {elapsed:.2f}s, expected under {bound:.1f}s" + # ...and the point of it all: far less than the handler's own sleep, + # which an unbounded join would have waited out in full. + assert elapsed < SLOW_HANDLER_SECONDS + + request_thread.join(timeout=10) + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestCorsOptionsCoverTheMiddleware: + """`CorsOptions` exposes every `CORSMiddleware` parameter, with our own + defaults only for the two the server knows about.""" + + _ORIGIN = "https://viewer.example" + + def _client(self, store: Store, cors: CorsOptions) -> TestClient: + return TestClient(store_app(store, methods={"GET"}, cors_options=cors)) + + def test_ranged_response_is_readable_cross_origin(self, store: Store) -> None: + """`Content-Range` is not CORS-safelisted, so without `expose_headers` + a browser reads the bytes but cannot learn which bytes it got.""" + sync(store.set("k", cpu.buffer_prototype.buffer.from_bytes(b"0123456789"))) + client = self._client(store, {"allow_origins": [self._ORIGIN], "allow_methods": ["GET"]}) + + response = client.get("/k", headers={"Origin": self._ORIGIN, "Range": "bytes=0-3"}) + + assert response.status_code == 206 + assert response.headers["access-control-expose-headers"] == "Content-Range" + + def test_range_survives_a_preflight(self, store: Store) -> None: + """A preflight naming `Range` must be allowed, not answered 400.""" + client = self._client(store, {"allow_origins": [self._ORIGIN], "allow_methods": ["GET"]}) + + preflight = client.options( + "/k", + headers={ + "Origin": self._ORIGIN, + "Access-Control-Request-Method": "GET", + "Access-Control-Request-Headers": "range", + }, + ) + + assert preflight.status_code == 200 + assert "Range" in preflight.headers["access-control-allow-headers"] + + def test_caller_value_replaces_the_default(self, store: Store) -> None: + """Our defaults apply only to absent keys; a supplied key wins outright + so `expose_headers: []` means "expose nothing", not "expose ours".""" + sync(store.set("k", cpu.buffer_prototype.buffer.from_bytes(b"data"))) + base: CorsOptions = {"allow_origins": [self._ORIGIN], "allow_methods": ["GET"]} + + empty = self._client(store, {**base, "expose_headers": []}) + assert ( + "access-control-expose-headers" + not in empty.get("/k", headers={"Origin": self._ORIGIN}).headers + ) + + custom = self._client(store, {**base, "expose_headers": ["X-Custom"]}) + assert ( + custom.get("/k", headers={"Origin": self._ORIGIN}).headers[ + "access-control-expose-headers" + ] + == "X-Custom" + ) + + def test_parameters_beyond_the_original_two_are_reachable(self, store: Store) -> None: + """The regression this class exists for: `CorsOptions` used to carry + only `allow_origins` and `allow_methods`, sealing the rest away.""" + sync(store.set("k", cpu.buffer_prototype.buffer.from_bytes(b"data"))) + client = self._client( + store, + { + "allow_origin_regex": r"https://.*\.example", + "allow_credentials": True, + "max_age": 30, + }, + ) + origin = "https://sub.example" + + response = client.get("/k", headers={"Origin": origin}) + assert response.headers["access-control-allow-origin"] == origin + assert response.headers["access-control-allow-credentials"] == "true" + + preflight = client.options( + "/k", headers={"Origin": origin, "Access-Control-Request-Method": "GET"} + ) + assert preflight.headers["access-control-max-age"] == "30" + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestUvicornOptionsAreNotSealedOff: + """`uvicorn.Config` takes ~50 parameters; naming four of them and dropping + the rest would put TLS, proxy headers, `root_path` and log level out of + reach entirely.""" + + def test_options_reach_uvicorn_config(self, store: Store) -> None: + """A key this signature does not name still lands on the Config.""" + from zarr_http_server import serve_background + + server = serve_background( + store_app(store), + host="127.0.0.1", + port=0, + uvicorn_options={"root_path": "/api", "log_level": "warning"}, + ) + assert server is not None + try: + config = server._server.config + assert config.root_path == "/api" + assert config.log_level == "warning" + # Ours still apply where the caller did not override them. + assert config.timeout_graceful_shutdown == 5 + finally: + server.shutdown() + + def test_caller_options_win_over_ours(self, store: Store) -> None: + """The merge order is ours-then-theirs, so a caller can override even + an option this signature sets itself.""" + from zarr_http_server import serve_background + + server = serve_background( + store_app(store), + host="127.0.0.1", + port=0, + shutdown_timeout=5, + uvicorn_options={"timeout_graceful_shutdown": 11}, + ) + assert server is not None + try: + assert server._server.config.timeout_graceful_shutdown == 11 + finally: + server.shutdown() + + @pytest.mark.skipif(not hasattr(socket, "AF_UNIX"), reason="needs unix domain sockets") + def test_non_tcp_bind_reports_no_url(self, store: Store, tmp_path: pathlib.Path) -> None: + """A unix-socket bind has no host and port, so `url` must say so rather + than naming an address nothing is listening on.""" + import httpx + + from zarr_http_server import serve_background + + sock = str(tmp_path / "s.sock") + server = serve_background(store_app(store), uvicorn_options={"uds": sock}) + assert server is not None + try: + assert server.url is None + assert server.host is None + assert server.port is None + # ...and it really is serving, just not over TCP. + with httpx.Client(transport=httpx.HTTPTransport(uds=sock)) as client: + response = client.get("http://localhost/zarr.json", timeout=10) + assert response.status_code in (200, 404) + finally: + server.shutdown() + + +class TestHeadDoesNotTransferTheBody: + """A HEAD body is discarded at the wire, so building one is pure waste.""" + + def test_head_does_not_read_the_value(self, tmp_path: pathlib.Path) -> None: + """The regression this class exists for: HEAD used to fall through to + the GET handler and pull the whole object to report its length.""" + read = {"bytes": 0} + + class CountingLocal(LocalStore): + async def get(self, key: str, prototype: Any, byte_range: Any = None) -> Any: + buf = await super().get(key, prototype, byte_range) + if buf is not None: + read["bytes"] += len(buf) + return buf + + store = CountingLocal(str(tmp_path / "root")) + payload = b"x" * 100_000 + sync(store.set("big", cpu.buffer_prototype.buffer.from_bytes(payload))) + client = TestClient(store_app(store)) + + read["bytes"] = 0 + response = client.head("/big") + + assert response.status_code == 200 + assert response.headers["content-length"] == str(len(payload)) + assert read["bytes"] == 0, "HEAD read the value to report its length" + + @pytest.mark.parametrize("store", ["memory"], indirect=True) + def test_head_of_a_missing_key_is_404(self, store: Store) -> None: + client = TestClient(store_app(store)) + assert client.head("/nope").status_code == 404 + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestMetadataContentType: + """Metadata documents are JSON in every zarr format, not just v3.""" + + @pytest.mark.parametrize( + ("zarr_format", "key"), [(3, "zarr.json"), (2, ".zarray"), (2, ".zattrs")] + ) + def test_metadata_is_served_as_json( + self, store: Store, zarr_format: ZarrFormat, key: str + ) -> None: + zarr.create_array( + store, name="a", shape=(4,), chunks=(2,), dtype="i4", zarr_format=zarr_format + ) + sync(store.set(f"a/{key}", cpu.buffer_prototype.buffer.from_bytes(b"{}"))) + + response = TestClient(store_app(store)).get(f"/a/{key}") + + assert response.status_code == 200 + assert response.headers["content-type"].startswith("application/json") + + +@pytest.mark.parametrize("store", ["memory"], indirect=True) +class TestCorsAllowMethodsMatchTheRoute: + """Advertising a method the route rejects is a promise the server cannot + keep: the browser caches the preflight and every later call 405s.""" + + def test_wildcard_expands_to_what_is_served(self, store: Store) -> None: + """`"*"` is the idiomatic "everything this app does", so it expands to + exactly that rather than to every verb Starlette knows.""" + app = store_app( + store, methods={"GET"}, cors_options={"allow_origins": ["*"], "allow_methods": ["*"]} + ) + + preflight = TestClient(app).options( + "/k", headers={"Origin": "https://e.test", "Access-Control-Request-Method": "GET"} + ) + + advertised = preflight.headers["access-control-allow-methods"] + assert set(advertised.replace(" ", "").split(",")) == {"GET", "HEAD"} + + def test_advertising_an_unserved_method_is_rejected(self, store: Store) -> None: + with pytest.raises(ValueError, match="does not serve"): + store_app( + store, + methods={"GET"}, + cors_options={"allow_origins": ["*"], "allow_methods": ["GET", "DELETE"]}, + ) + + def test_head_counts_as_served_when_get_is(self, store: Store) -> None: + """Starlette routes HEAD wherever GET goes, so naming it is not an error.""" + store_app( + store, + methods={"GET"}, + cors_options={"allow_origins": ["*"], "allow_methods": ["GET", "HEAD"]}, + ) + + def test_absent_allow_methods_is_left_alone(self, store: Store) -> None: + """Starlette's GET-only default stands; widening it to everything + served would newly advertise PUT on a write-enabled app.""" + app = store_app(store, methods={"GET", "PUT"}, cors_options={"allow_origins": ["*"]}) + + preflight = TestClient(app).options( + "/k", headers={"Origin": "https://e.test", "Access-Control-Request-Method": "GET"} + ) + + assert "PUT" not in preflight.headers["access-control-allow-methods"] + + +class TestReadOnlyServing: + """The guarantees a read-only deployment rests on. + + Two independent layers: `methods` decides what the route answers, and the + store decides whether a write could succeed at all. The second is the one + that survives a misconfiguration of the first, so both are pinned here. + """ + + @pytest.mark.parametrize("store", ["memory"], indirect=True) + @pytest.mark.parametrize("method", ["PUT", "POST", "DELETE", "PATCH"]) + def test_default_app_refuses_every_mutating_method(self, store: Store, method: str) -> None: + """The default is read-only: no argument is needed to get there, and + nothing a client sends can write.""" + sync(store.set("k", cpu.buffer_prototype.buffer.from_bytes(b"data"))) + before = sync(store.get("k", cpu.buffer_prototype)).to_bytes() + client = TestClient(store_app(store), raise_server_exceptions=False) + + response = client.request(method, "/k", content=b"overwritten") + + assert response.status_code == 405 + assert sync(store.get("k", cpu.buffer_prototype)).to_bytes() == before + + @pytest.mark.parametrize("store", ["memory"], indirect=True) + def test_post_can_never_be_enabled(self, store: Store) -> None: + """POST is not merely unrouted, it is unconfigurable: there is no + handler behavior for it, so asking is an error rather than a no-op.""" + with pytest.raises(ValueError, match="Unsupported HTTP method"): + store_app(store, methods={"GET", "POST"}) # type: ignore[arg-type] + + def test_read_only_store_refuses_writes_independently_of_methods( + self, tmp_path: pathlib.Path + ) -> None: + """The layer that survives getting `methods` wrong. + + Constructed through the private builder because the public entry + points now reject this combination outright; the handler check stays + as the backstop for a store whose `read_only` is not fixed. + """ + from zarr_http_server._serve import _make_starlette_app + + writable = LocalStore(str(tmp_path / "root")) + sync(writable.set("k", cpu.buffer_prototype.buffer.from_bytes(b"data"))) + + app = _make_starlette_app(methods={"GET", "PUT"}) + app.state.store = writable.with_read_only(True) + app.state.node = None + app.state.prefix = "" + app.state.max_body_size = None + + response = TestClient(app, raise_server_exceptions=False).put("/k", content=b"x") + + assert response.status_code == 403 + assert sync(writable.get("k", cpu.buffer_prototype)).to_bytes() == b"data" + + def test_put_on_a_read_only_store_is_rejected_at_construction( + self, tmp_path: pathlib.Path + ) -> None: + """A write that could never succeed is a configuration error, not a + runtime 403 delivered to whoever happens to try first.""" + store = LocalStore(str(tmp_path / "root")).with_read_only(True) + + with pytest.raises(ValueError, match="store is read-only"): + store_app(store, methods={"GET", "PUT"}) + + def test_read_only_node_is_rejected_at_construction(self, tmp_path: pathlib.Path) -> None: + """The same check applies to a node, whose store it inherits.""" + store = LocalStore(str(tmp_path / "root")) + zarr.create_array(store, shape=(4,), chunks=(2,), dtype="i4", compressors=None) + read_only_array = zarr.open_array(store, mode="r") + + with pytest.raises(ValueError, match="store is read-only"): + node_app(read_only_array, methods={"GET", "PUT"}) + + +class TestMethodSetConstants: + """Named method sets let a call site state its intent, and make writable + deployments findable: every writable app must name one.""" + + @pytest.mark.parametrize("store", ["memory"], indirect=True) + def test_read_only_constant_matches_the_default(self, store: Store) -> None: + """Passing it explicitly and omitting `methods` are the same server, so + saying so out loud costs nothing.""" + sync(store.set("k", cpu.buffer_prototype.buffer.from_bytes(b"data"))) + + default = TestClient(store_app(store), raise_server_exceptions=False) + named = TestClient( + store_app(store, methods=READ_ONLY_HTTP_METHODS), raise_server_exceptions=False + ) + + for method in ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH"]: + assert default.request(method, "/k").status_code == ( + named.request(method, "/k").status_code + ) + + @pytest.mark.parametrize("store", ["memory"], indirect=True) + @pytest.mark.parametrize("method", ["PUT", "POST", "DELETE", "PATCH"]) + def test_read_only_constant_refuses_writes(self, store: Store, method: str) -> None: + sync(store.set("k", cpu.buffer_prototype.buffer.from_bytes(b"data"))) + client = TestClient( + store_app(store, methods=READ_ONLY_HTTP_METHODS), raise_server_exceptions=False + ) + + assert client.request(method, "/k", content=b"x").status_code == 405 + assert sync(store.get("k", cpu.buffer_prototype)).to_bytes() == b"data" + + @pytest.mark.parametrize("store", ["memory"], indirect=True) + def test_read_write_constant_permits_exactly_put(self, store: Store) -> None: + """It grants writes -- and still not POST, which has no handler.""" + client = TestClient( + store_app(store, methods=READ_WRITE_HTTP_METHODS), raise_server_exceptions=False + ) + + assert client.put("/k", content=b"data").status_code == 204 + assert client.post("/k", content=b"data").status_code == 405 + assert sync(store.get("k", cpu.buffer_prototype)).to_bytes() == b"data" + + def test_constants_cannot_be_mutated_by_a_caller(self) -> None: + """Frozen, so one caller cannot widen the default for every other.""" + assert isinstance(READ_ONLY_HTTP_METHODS, frozenset) + assert isinstance(READ_WRITE_HTTP_METHODS, frozenset) + assert "PUT" not in READ_ONLY_HTTP_METHODS + + def test_constants_match_the_types_they_model(self) -> None: + """The sets are derived from the Literals, so they cannot disagree + about what this server serves. Pinning the contents here makes + widening either type a deliberate, visible edit.""" + assert frozenset(get_args(ReadOnlyHTTPMethod)) == READ_ONLY_HTTP_METHODS + assert set(READ_ONLY_HTTP_METHODS) == {"GET", "HEAD"} + assert set(READ_WRITE_HTTP_METHODS) == {"GET", "HEAD", "PUT"} + # Read-only is a strict subset: the only difference is the write verb. + assert READ_ONLY_HTTP_METHODS < READ_WRITE_HTTP_METHODS + assert {"PUT"} == READ_WRITE_HTTP_METHODS - READ_ONLY_HTTP_METHODS + + +class TestServeAnyApp: + """`serve` runs whatever ASGI app it is handed, which is what makes + several nodes on one port possible.""" + + @staticmethod + def _two_mounted_arrays() -> tuple[Starlette, bytes, bytes]: + """Two arrays in *separate* stores, so no common parent exists and + mounting is the only way to serve both from one server.""" + first, second = MemoryStore(), MemoryStore() + one = zarr.create_array(first, shape=(4,), chunks=(2,), dtype="i4", compressors=None) + other = zarr.create_array(second, shape=(4,), chunks=(2,), dtype="i4", compressors=None) + one[:] = 7 + other[:] = 9 + + app = Starlette( + routes=[Mount("/first", app=node_app(one)), Mount("/second", app=node_app(other))] + ) + return app, np.full(2, 7, dtype="i4").tobytes(), np.full(2, 9, dtype="i4").tobytes() + + def test_mounted_apps_each_serve_their_own_node(self) -> None: + app, first_chunk, second_chunk = self._two_mounted_arrays() + client = TestClient(app, raise_server_exceptions=False) + + assert client.get("/first/zarr.json").status_code == 200 + assert client.get("/second/zarr.json").status_code == 200 + assert client.get("/first/c/0").content == first_chunk + assert client.get("/second/c/0").content == second_chunk + + @pytest.mark.parametrize( + "path", + [ + "/first/%2e%2e/second/zarr.json", + "/first/..%2f..%2fsecond/zarr.json", + "/first/%2e%2e%2fsecond/c/0", + "/first/%2fsecond/zarr.json", + ], + ) + def test_one_mount_cannot_reach_another(self, path: str) -> None: + """Per-node validation runs inside each mount, so composing apps does + not widen what any of them serves.""" + app, _, _ = self._two_mounted_arrays() + + assert TestClient(app, raise_server_exceptions=False).get(path).status_code == 404 + + def test_serve_runs_a_composed_app_in_the_background(self) -> None: + """The gap `serve` closes: a composed app previously had no way to use + the background-server ergonomics, only a blocking `uvicorn.run`.""" + import httpx + + app, first_chunk, second_chunk = self._two_mounted_arrays() + + server = serve_background(app, host="127.0.0.1", port=0) + try: + assert server.url is not None + assert httpx.get(f"{server.url}/first/c/0", timeout=30).content == first_chunk + assert httpx.get(f"{server.url}/second/c/0", timeout=30).content == second_chunk + finally: + server.shutdown() + + +class TestPortSelection: + """`port="auto"` prefers a predictable port but never fails over one. + + An explicit port means the opposite -- bind exactly that or fail -- because + a caller who names one usually has something else expecting the server + there, and silently moving would break it while looking healthy. + """ + + @staticmethod + def _free_port() -> int: + """A port that was free a moment ago. Only ever used as the *preferred* + port, never bound afterwards, so the usual bind-then-close race does + not apply: if something takes it, that is the case under test.""" + with socket.socket() as sock: + sock.bind(("127.0.0.1", 0)) + return int(sock.getsockname()[1]) + + def test_preferred_port_is_used_when_free(self) -> None: + preferred = self._free_port() + + sock = _bind_preferred_or_free("127.0.0.1", preferred) + try: + assert sock.getsockname()[1] == preferred + finally: + sock.close() + + def test_falls_back_when_the_preferred_port_is_taken(self) -> None: + with socket.socket() as squatter: + squatter.bind(("127.0.0.1", 0)) + squatter.listen() + taken = int(squatter.getsockname()[1]) + + sock = _bind_preferred_or_free("127.0.0.1", taken) + try: + assert sock.getsockname()[1] != taken + finally: + sock.close() + + def test_address_family_follows_the_host(self) -> None: + """Hard-coding AF_INET would bind the wrong family for an IPv6 host.""" + try: + sock = _bind_preferred_or_free("::1", 0) + except OSError: # pragma: no cover - depends on the host's networking + pytest.skip("no IPv6 loopback available") + try: + assert sock.family == socket.AF_INET6 + finally: + sock.close() + + @pytest.mark.parametrize("store", ["memory"], indirect=True) + def test_auto_produces_a_working_server(self, store: Store) -> None: + """Whichever port it lands on, `url` names it and the server answers.""" + import httpx + + server = serve_background(store_app(store)) + try: + assert server.url is not None + assert server.port is not None + assert httpx.get(f"{server.url}/nope", timeout=30).status_code == 404 + finally: + server.shutdown() + + # uvicorn answers a failed bind with `sys.exit` on its own thread, which + # pytest reports as an unhandled thread exception -- and this package turns + # warnings into errors. That exit is exactly what the RuntimeError below + # reports to the caller, so it is expected here rather than a defect. + @pytest.mark.filterwarnings("ignore::pytest.PytestUnhandledThreadExceptionWarning") + @pytest.mark.parametrize("store", ["memory"], indirect=True) + def test_an_explicit_port_that_is_taken_fails(self, store: Store) -> None: + """The regression this class exists for: `auto` must not leak into the + explicit case, where a collision has to be loud.""" + with socket.socket() as squatter: + squatter.bind(("127.0.0.1", 0)) + squatter.listen() + taken = int(squatter.getsockname()[1]) + + with pytest.raises(RuntimeError, match="may already be in use"): + serve_background(store_app(store), port=taken) + + @pytest.mark.parametrize("store", ["memory"], indirect=True) + def test_port_zero_still_means_any_free_port(self, store: Store) -> None: + """`0` keeps its OS meaning rather than being folded into `auto`.""" + server = serve_background(store_app(store), port=0) + try: + assert server.port not in (0, None) + finally: + server.shutdown() diff --git a/packages/zarr-http-server/uv.lock b/packages/zarr-http-server/uv.lock new file mode 100644 index 0000000000..946da90503 --- /dev/null +++ b/packages/zarr-http-server/uv.lock @@ -0,0 +1,2212 @@ +version = 1 +revision = 3 +requires-python = ">=3.12" + +[[package]] +name = "aiohappyeyeballs" +version = "2.7.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ce/f4/eec0465c2f67b2664688d0240b3212d5196fd89e741df67ddb81f8d35658/aiohappyeyeballs-2.7.1.tar.gz", hash = "sha256:065665c041c42a5938ed220bdcd7230f22527fbec085e1853d2402c8a3615d9d", size = 24757, upload-time = "2026-07-01T17:11:55.501Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/71/43/1947f06babed6b3f1d7f38b0c767f52df66bfb2bc10b468c4a7de9eceff2/aiohappyeyeballs-2.7.1-py3-none-any.whl", hash = "sha256:9243213661e29250eb41368e5daa826fc017156c3b8a11440826b2e3ed376472", size = 15038, upload-time = "2026-07-01T17:11:54.055Z" }, +] + +[[package]] +name = "aiohttp" +version = "3.14.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "aiohappyeyeballs" }, + { name = "aiosignal" }, + { name = "attrs" }, + { name = "frozenlist" }, + { name = "multidict" }, + { name = "propcache" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "yarl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/58/d9/22ce5786ac0c1653ae8b6c23bded02c1686d11f0dbb45b31ce128e0df985/aiohttp-3.14.3.tar.gz", hash = "sha256:9491196535a88924a60afd5b5f434b5b203b6cc616250878dbdb223a8f7844bc", size = 7971213, upload-time = "2026-07-23T01:57:27.037Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/d4/eb96299230e20acf2efae207cb8d69051f1f68e357e5ea5e479bf6fb097a/aiohttp-3.14.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:39aded8c7f3b935b54aab1d8d73c70ec0ee2d3ec3b943e0e86611bc150ba47f5", size = 754690, upload-time = "2026-07-23T01:53:47.332Z" }, + { url = "https://files.pythonhosted.org/packages/88/11/e7a70a209eb9a067c0d3212b518a0134e3484f5178c7533878b6b514d469/aiohttp-3.14.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5bcb6ff3fdab1258a192679ff1a05d44f59626430aa05cd1a9d2447423599228", size = 509484, upload-time = "2026-07-23T01:53:51.159Z" }, + { url = "https://files.pythonhosted.org/packages/30/07/4bbc222cc8dbe31d4c3e8a5baad2286e4d42026ac0c570027b89afce6344/aiohttp-3.14.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:617105e2c3018ee38d0c8ce5ee3c84f621a6d8b9f723202aacaff28449ca91ee", size = 511949, upload-time = "2026-07-23T01:53:55.083Z" }, + { url = "https://files.pythonhosted.org/packages/54/b9/42e74c46b7b7c794b995bbc1f573fb48950c38b19d8600c62a6804ee2d67/aiohttp-3.14.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f631fe87a6f30df5fbe6d79640b25e4cffb38c31c7fb6f10871517b84b0f8c1a", size = 1765282, upload-time = "2026-07-23T01:53:59.662Z" }, + { url = "https://files.pythonhosted.org/packages/6b/ed/62bc4d74363ad346d518e0720363a949f63e2e23439a79eb5813d4d29bb3/aiohttp-3.14.3-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a94dbaae5ae27bd849c93570669bff91e0510f33a80805738e3de72a7be0447b", size = 1741511, upload-time = "2026-07-23T01:54:04.063Z" }, + { url = "https://files.pythonhosted.org/packages/d0/9f/181e8a8bc79e47d13c7fc4540bd7a3b729d9505609c61f392a8dd2fbfe55/aiohttp-3.14.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8f2f1c4c032c7cedd7d8da6f54c97b70266c6570c3108d3fdffee7188bb70529", size = 1810680, upload-time = "2026-07-23T01:54:09.882Z" }, + { url = "https://files.pythonhosted.org/packages/5c/9a/dec94d6ad694552fe3424e3f1928d7a606a5d9d9433a04e7ecdd9d38ae7f/aiohttp-3.14.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ea05e1f97ceea523942d9b2a7d7c0359d781d683d6b043f5943a602b14da4787", size = 1905646, upload-time = "2026-07-23T01:54:13.475Z" }, + { url = "https://files.pythonhosted.org/packages/52/b7/7cd31f29d6055bd711ae6e669367fba6f5ae9de463910a793e30556a8db7/aiohttp-3.14.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:543906c127fb1d929b95076db19b83fa2d46751006ff1e23b093aa5ac4d8db42", size = 1792122, upload-time = "2026-07-23T01:54:15.752Z" }, + { url = "https://files.pythonhosted.org/packages/66/73/10b1ef93afa61f4963c746257b70ced619cf31a4798671de5fdb2608501d/aiohttp-3.14.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0a5ff2dfbb9ce645fa5b8ef3e02c6c0b9cc3f6030ff863d0c51fffc50cb5541b", size = 1591127, upload-time = "2026-07-23T01:54:19.489Z" }, + { url = "https://files.pythonhosted.org/packages/49/ed/3b203fa6de1b338c14acdc06bf6ca9b043b7944f005966958c2ced932cde/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:041badb8f84396357c4d3ad26de6afd7a32b112f43d3c63045c0c8278cfd2043", size = 1725210, upload-time = "2026-07-23T01:54:24.129Z" }, + { url = "https://files.pythonhosted.org/packages/28/b7/1c2aab8c706436dcc28598452488ac9cd7c409da815237c28c27d58993e6/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:530125ee1163c4219af35dc3aa1206e541e7b31b6efc1a3f93b70a136f65d427", size = 1764848, upload-time = "2026-07-23T01:54:27.973Z" }, + { url = "https://files.pythonhosted.org/packages/54/50/94c28f08b131c4bf10984ea2c7a536c9920608bb2d6e7f95642c30cc87b7/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c8653fd547c93a61aadc612007790f5555cdd18946fa48cf45e26d8ea4ea473d", size = 1777102, upload-time = "2026-07-23T01:54:31.775Z" }, + { url = "https://files.pythonhosted.org/packages/13/d4/e7d09ba7d345fb2d74440fd2fa033c5e079fac05552927705986f41a364f/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:89176250f686cb9853c0fb7ead90e639e915b84a6f43eedc2a4e7ec21f1037f0", size = 1580205, upload-time = "2026-07-23T01:54:34.518Z" }, + { url = "https://files.pythonhosted.org/packages/a3/84/072a91d68e1e1eb587985b54baab94221277f877e8ef274fc213a0ceae28/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3a26434dafe408229ff3403458ca58de24fb51936504decac49ce6755f77e59d", size = 1797219, upload-time = "2026-07-23T01:54:36.995Z" }, + { url = "https://files.pythonhosted.org/packages/e0/eb/aad34e897e668424d6e995da5dff8a4a09af93363d3392488772957a63aa/aiohttp-3.14.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d1558173930a5a8d3069cee5c92fc91c87c4dbcb099debbb3622053717145a19", size = 1768629, upload-time = "2026-07-23T01:54:40.103Z" }, + { url = "https://files.pythonhosted.org/packages/b6/2b/6bb88ddba0fecd9122aa3ebcad25996cf6c083a4a7040dbb3a4f97972af6/aiohttp-3.14.3-cp312-cp312-win32.whl", hash = "sha256:16100ad3ab8d649fdfbee87602d9d2dcdca9df0b9eda8a1b5fdc0d41f96da559", size = 451481, upload-time = "2026-07-23T01:54:42.547Z" }, + { url = "https://files.pythonhosted.org/packages/76/9b/f2f8f108da17ecef2cc3efc424e8b7ad3782b1a8360f7b8eae8ced84f6ea/aiohttp-3.14.3-cp312-cp312-win_amd64.whl", hash = "sha256:33a2d7c28d33797a2e99923dffa63f83d908a19b6bf26cfe80fa790aa5e1a75a", size = 476845, upload-time = "2026-07-23T01:54:44.853Z" }, + { url = "https://files.pythonhosted.org/packages/3e/44/28dac80a8941b604f4da10ce21097614ca1bf905ce93dca28d8d7de9c1e7/aiohttp-3.14.3-cp312-cp312-win_arm64.whl", hash = "sha256:362a3fd481769cac1a824514bcd86fda51c65e8fe6e051099e008fddde6db17c", size = 448050, upload-time = "2026-07-23T01:54:47.087Z" }, + { url = "https://files.pythonhosted.org/packages/57/be/5afd201cc0ab139029aadb75392efe85a293403d9dd3a3226161c21ce00c/aiohttp-3.14.3-cp313-cp313-android_21_arm64_v8a.whl", hash = "sha256:2e9878ae68e4a5f1c0abe4dd497dbc3d51946f5837b56759e2a02e78fa90ef86", size = 506269, upload-time = "2026-07-23T01:54:49.075Z" }, + { url = "https://files.pythonhosted.org/packages/22/09/dec8189d62b45ade009f6792a2264b942a90cb88aeaf181239933cd72c3c/aiohttp-3.14.3-cp313-cp313-android_21_x86_64.whl", hash = "sha256:f3d2669fe7dec7fc359ecdb5984b29b50d85d5d00f8c1cb61de4f4a24ee42627", size = 515166, upload-time = "2026-07-23T01:54:51.894Z" }, + { url = "https://files.pythonhosted.org/packages/28/24/2854869d29ed8a8b19d74f9ec6629515f7e04d02dd329d9d179201e58e47/aiohttp-3.14.3-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:cc7cb243a68167172f48c1fd43cee91ec4b1d40cefd190edd43369d1a6bc9c82", size = 486263, upload-time = "2026-07-23T01:54:54.223Z" }, + { url = "https://files.pythonhosted.org/packages/d4/dd/57187c8be2a35aea65eaee3bd2c3dcbbcf0204f5106c89637e3610380cd1/aiohttp-3.14.3-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:78253b573e6ffab5028924fc98bc281aae05445969982a10864bc360dea2016c", size = 492299, upload-time = "2026-07-23T01:54:56.236Z" }, + { url = "https://files.pythonhosted.org/packages/b9/11/06ae6ed8f0d414edf4068861e233d8fe23ee699bfd4b3ceb8663db948a62/aiohttp-3.14.3-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:7041d52c3a7fa20c9e8c182b534704abb19502c8bdcbde7ab23bfda6f642394f", size = 502235, upload-time = "2026-07-23T01:54:58.377Z" }, + { url = "https://files.pythonhosted.org/packages/7e/a3/559639c34a345d2cf7c52dff6838119f2eaf29eb508227b5b83f573af813/aiohttp-3.14.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ac74facc01463f138b0da5580329cfcc82818dea5656e83ddcd11268fc12ff80", size = 750883, upload-time = "2026-07-23T01:55:00.65Z" }, + { url = "https://files.pythonhosted.org/packages/91/cd/41e131f13afd1e7b0172a9d9eda085ef90eb8439f41f0d279db81ed3ae60/aiohttp-3.14.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d6218d92e450824e9b4881f44e8c09f1853b490f9a64130801024a4793b1b3b0", size = 508473, upload-time = "2026-07-23T01:55:02.945Z" }, + { url = "https://files.pythonhosted.org/packages/bc/6b/e7f13410d391c6e55b4c007a8de024355389d7d459e3d64c42b2d33617e5/aiohttp-3.14.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:11fb37ef075669eee52ab1928fbf6e1741fada40409fa309ebde9607a962aebf", size = 509190, upload-time = "2026-07-23T01:55:05.173Z" }, + { url = "https://files.pythonhosted.org/packages/97/21/6464573e53d69672cc1eada3e5c5cb2d2efa82701e8305a0f2047a576967/aiohttp-3.14.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:55bdcc472aafe2de4a253045cc128007a64f1e0264fb675791e132ea5edaa3bd", size = 1761478, upload-time = "2026-07-23T01:55:07.383Z" }, + { url = "https://files.pythonhosted.org/packages/1a/81/d217043a4c17fbce360905e3b2bdd20139ebc9a2de836d035d179c4da006/aiohttp-3.14.3-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c39846c3aad97a8530c89d7a3869a8f8e9e3762c6ac0504481e5c80948f7e807", size = 1735092, upload-time = "2026-07-23T01:55:09.803Z" }, + { url = "https://files.pythonhosted.org/packages/a1/66/e13a02d0eeb1a9a502402a977abb4e4abff9fe4051c26f80558c57a7c975/aiohttp-3.14.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5895ef58c4620afe02fa16044f023dc4dafec08158f9d08874a46a7dbc0341b8", size = 1800546, upload-time = "2026-07-23T01:55:12.012Z" }, + { url = "https://files.pythonhosted.org/packages/26/5e/57d42fca1d18cb5acc1cad945d017fabc5d6ae71d8a08ad66be8dc3ee544/aiohttp-3.14.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fa9467a8113aa69d3d7c55a70ef0b7c636010a40993f3df9d9d0d73b3eb7ef24", size = 1895250, upload-time = "2026-07-23T01:55:14.357Z" }, + { url = "https://files.pythonhosted.org/packages/ca/1c/7da8d08e74d56f00070822f9638ff3f1c563f8ad87d1efa996c87bfc8644/aiohttp-3.14.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d7d2deec16eeedf55f2c7cf75b521ea3856a5177e123844f8fd0f114ce252cb5", size = 1789289, upload-time = "2026-07-23T01:55:16.668Z" }, + { url = "https://files.pythonhosted.org/packages/cd/0f/cf16bcf56896981c1a0319f5d5db9337994b5165730c48a8fa07e9b34be6/aiohttp-3.14.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:dd54d0e8717de95939766febac482ac0474d8ac3b048115f9f2b1d23a16e7db4", size = 1586706, upload-time = "2026-07-23T01:55:18.913Z" }, + { url = "https://files.pythonhosted.org/packages/fe/6f/76eac12a7f2480e1e304f842efdb07db33256b0d9165b866b6ef0806c202/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:df82f3787c940c94986b34222d59c9e38843fba85139f36e85255a82ad5355a9", size = 1724652, upload-time = "2026-07-23T01:55:21.296Z" }, + { url = "https://files.pythonhosted.org/packages/39/b6/19c8c592baeeb94b75f966547d40c02ac7590902306ec5863d5c027cf506/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:42a67efc36300d052fb4508a53e8b6901b9284b599ae63945c377569c5fcc1e1", size = 1756239, upload-time = "2026-07-23T01:55:23.705Z" }, + { url = "https://files.pythonhosted.org/packages/dc/c9/4e9383150296f97f873b680c4de8fb2cd88608fb9f48c79edcb111611abc/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:7a75aa63cbf9b21cfaf60dc2657e19df2c2867d91707d653fee171ffeedd1371", size = 1769161, upload-time = "2026-07-23T01:55:26.082Z" }, + { url = "https://files.pythonhosted.org/packages/aa/1e/147bdc6cc5de5f3ab011be8bf5d6e786633249f22c20bae06f85e45f5387/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:e92eb8acc45eb6a9f4935071a77edf5b85cc6f8dfad5cd99e97653c26593cdde", size = 1578759, upload-time = "2026-07-23T01:55:28.846Z" }, + { url = "https://files.pythonhosted.org/packages/fd/31/78388a9d6040ece2e11df62ea229a822cf5e52d238374b220ae9975b2623/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b014a6ed7cf912e787149fdc529166d3ceabac23f26efeea3158c9aba2354e7e", size = 1792025, upload-time = "2026-07-23T01:55:31.457Z" }, + { url = "https://files.pythonhosted.org/packages/03/51/a3d29fdf2c25d796746af8ad6fe56a45d6256c38b0a8a2ed752e1160b3a2/aiohttp-3.14.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:3d4f72af88ac2474bb5bca640030320e3d38a0163a1d7533500e87be458eef71", size = 1768477, upload-time = "2026-07-23T01:55:33.87Z" }, + { url = "https://files.pythonhosted.org/packages/29/a6/442e18b5afeade534d877a2dc3c3e392aff8d49787890b0cf84790410267/aiohttp-3.14.3-cp313-cp313-win32.whl", hash = "sha256:5f08ec777f35ee70720233b8b9811d3bb5d728137f30ac91b7457709c3261ac0", size = 451069, upload-time = "2026-07-23T01:55:36.121Z" }, + { url = "https://files.pythonhosted.org/packages/9d/69/3d876ac02659f271cf7f6769f14a8e3de5b6e888ed8b5a7e998086a4cec8/aiohttp-3.14.3-cp313-cp313-win_amd64.whl", hash = "sha256:dff9461ec275f22135650d5ba4b4931a11f3958df7dfbb8db630000d4dee0883", size = 476518, upload-time = "2026-07-23T01:55:38.303Z" }, + { url = "https://files.pythonhosted.org/packages/b2/0e/50d6e6471cd31edce8b282bdec59375a3a69124d8a989a0b1313355cae52/aiohttp-3.14.3-cp313-cp313-win_arm64.whl", hash = "sha256:ddcac3c6b382e81f1dd0499199d4136b877beb4cb5ef770bbbfba56c4b8f55d2", size = 447676, upload-time = "2026-07-23T01:55:40.451Z" }, + { url = "https://files.pythonhosted.org/packages/c8/20/887fdcf832326571b370ffc347b3e70abe101096f3720126aac161b1d872/aiohttp-3.14.3-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:49f7325beb0f85ef4aef5f48f490269575f83e6e2acad00a1d80b807eb027062", size = 509067, upload-time = "2026-07-23T01:55:42.618Z" }, + { url = "https://files.pythonhosted.org/packages/ad/a3/92cec936f78cc4bf0fa5554ebe593b73459d94e3c62303e1902a4cccb6f7/aiohttp-3.14.3-cp314-cp314-android_24_x86_64.whl", hash = "sha256:e3be98a7c30b8c25d573dafba7171d66dfb05ee6a9070fc46535464ff97700a6", size = 514774, upload-time = "2026-07-23T01:55:44.937Z" }, + { url = "https://files.pythonhosted.org/packages/29/ba/2a0c38df3fc557620b6a5acd98364af050053b6285b4dc7ee74100c63c18/aiohttp-3.14.3-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:614c61d478b83953e261d02bb2df750f17227cd33ef8002945bf5aebbde21919", size = 488134, upload-time = "2026-07-23T01:55:47.135Z" }, + { url = "https://files.pythonhosted.org/packages/48/d6/d51b7d4bf309af3693940d8ffd2b9ed0b682434ef85959b7c9c137f60cf8/aiohttp-3.14.3-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:1caa7b0d05f3e3a36f87788c59e970a7ee1cefcfcbb924a9f138c4a6551c9cb7", size = 494201, upload-time = "2026-07-23T01:55:49.451Z" }, + { url = "https://files.pythonhosted.org/packages/3f/5a/8f624384e5f1efabb5229b94157eb966b021e97bdb188c62860c2ae243c2/aiohttp-3.14.3-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:dfa68deb2a443bdaa3ea5297b0699c1464f08aef3812b486d1348eee61b07dc0", size = 502766, upload-time = "2026-07-23T01:55:51.656Z" }, + { url = "https://files.pythonhosted.org/packages/a6/26/4ff0164370deec18fb19254ee4ab10b7a73304ac0c860b13f5f84663759b/aiohttp-3.14.3-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:e72ee89e28d907a18f46959b4eb0bb06701cc7f8cf4366e00029e2ccfaaf5924", size = 756557, upload-time = "2026-07-23T01:55:53.964Z" }, + { url = "https://files.pythonhosted.org/packages/97/a3/7056b86dc0d9ec709ea9777eae3b0161428f943372f8b98c01c11593b682/aiohttp-3.14.3-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:ad4c8b7488d745d2ca4838ebd8ae5ba9b56341d30b1da43640e4ce87f9f49646", size = 510168, upload-time = "2026-07-23T01:55:56.22Z" }, + { url = "https://files.pythonhosted.org/packages/85/ed/0357a015892fd68058bf2d39d3fd1958e459b997a7db30aaa6aaa434ae96/aiohttp-3.14.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:db332af25642007330fca8be5c4d194caf2bea7a7fc84415aff3497af5dfee6b", size = 512957, upload-time = "2026-07-23T01:55:58.437Z" }, + { url = "https://files.pythonhosted.org/packages/47/d1/8aba53f15ccb2238405f5e9d30e2a8ca44f93878c26e7165ade00d374b1c/aiohttp-3.14.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:25bd2708db6bdf6a6630dd37bdcdfcb47c4434d22ac69c64665b802910140b30", size = 1750149, upload-time = "2026-07-23T01:56:00.856Z" }, + { url = "https://files.pythonhosted.org/packages/49/bd/40c3fee327529284375c6701cbb0fa4600cc2e8432af1378f897e2ef7d3a/aiohttp-3.14.3-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:cef89a58e628c4efcac3275c2d68083f82426dcdc89c1492a6f654f9f7ea6ab9", size = 1707685, upload-time = "2026-07-23T01:56:03.371Z" }, + { url = "https://files.pythonhosted.org/packages/2a/a3/ca0cc6724cca8114b05694abd916060758c79894c3aa5b012cdadc1bc28e/aiohttp-3.14.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c23ec8ee9d5ab2f5421f9c7fffce208435607af27fd46d4a44e031954352838f", size = 1803911, upload-time = "2026-07-23T01:56:05.817Z" }, + { url = "https://files.pythonhosted.org/packages/95/b5/85b099c299c3ffd38ad9b3e43694c8a346934e4a30c88c4fd5a841234f77/aiohttp-3.14.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e2667f0bbe7eb6c74eae5e9691441ad186e5845ca3cff63230fc09c4e7514f5d", size = 1876929, upload-time = "2026-07-23T01:56:08.413Z" }, + { url = "https://files.pythonhosted.org/packages/d5/b7/1da684a04175473fa4cddbf9a2f572e79514c3fd27a74597f43057d4f3da/aiohttp-3.14.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:18cb43369747b2ae007bd2655fb8e63a099c2ff1d207962943636dac989b3147", size = 1761112, upload-time = "2026-07-23T01:56:10.918Z" }, + { url = "https://files.pythonhosted.org/packages/d1/16/bc4b55e3e5cb175fd69c53c90d60d2f47797cb343da5106e23863dc4dba4/aiohttp-3.14.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d77640cc618c1d99fc4f8589c0f24a730adfa54eb1e57ef7bf0c8dfb78da898c", size = 1583500, upload-time = "2026-07-23T01:56:13.613Z" }, + { url = "https://files.pythonhosted.org/packages/2a/e8/13a9d957a1ee40837f46aa30f0f4c657e673ad86a2e6362a9f9be20d26d9/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:53e5179d8abb5710f8e83ba207c41c8d1261fcffd4616500e15ca2b7a33be10a", size = 1713940, upload-time = "2026-07-23T01:56:15.969Z" }, + { url = "https://files.pythonhosted.org/packages/38/05/d33c680c1bcf1c7e130f9cbfc1fc02fe8bb0c4af2a94a53dd5fb56131e5c/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:cd817772b2fcf2b8c0905795318485f9ec16eae60b29feb7f4c77085311637f0", size = 1724413, upload-time = "2026-07-23T01:56:18.591Z" }, + { url = "https://files.pythonhosted.org/packages/85/1d/af798d306f7a74b6a632dbcabcf62a4c91391b7582d2a8c6d7712e2cc54e/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:4e3ac92d90e92773b2362d506068e9a948192bd553e743c5b2429e28527c8661", size = 1770748, upload-time = "2026-07-23T01:56:21.074Z" }, + { url = "https://files.pythonhosted.org/packages/a8/92/ad720d472556a995049206867765e9410969684f86ee09423ff9969044c1/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:3f42e9b78301f11c8f861746175d8b9c1ccef713fcad9eab396e2f6db8ed4a22", size = 1577564, upload-time = "2026-07-23T01:56:23.475Z" }, + { url = "https://files.pythonhosted.org/packages/60/ad/0ed7586cbef7a884e23a752fa2bb987a122e6a5dd50dab109258d0a95193/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:9d9edccfe496b476db5f398d97b865e9a6752bcf8aec4eef8390ce20fb64bb41", size = 1782080, upload-time = "2026-07-23T01:56:25.994Z" }, + { url = "https://files.pythonhosted.org/packages/97/ea/dbaed0d73e8a69aad653b045dab451c67c2454bb731a37b45a86593e9422/aiohttp-3.14.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:1c5ec8fb1bcc31a8466f74aaf26c345d5c386fa4bd08a3f0eb9c7a4a3fe8b5bf", size = 1745813, upload-time = "2026-07-23T01:56:28.604Z" }, + { url = "https://files.pythonhosted.org/packages/81/1b/6893d4bc57e434fc93a6c9217c637d967a0b651d989f6e3265179375754a/aiohttp-3.14.3-cp314-cp314-win32.whl", hash = "sha256:38901a84da3ce22249f6e860bf8f90d141bcab7da090cc398f8bb58c0e44b7da", size = 455872, upload-time = "2026-07-23T01:56:31.031Z" }, + { url = "https://files.pythonhosted.org/packages/f5/8b/c7baa1ba1eda4db6989baefe5de6d99834921b84ebd7918624febcb9f290/aiohttp-3.14.3-cp314-cp314-win_amd64.whl", hash = "sha256:8b3b60de05f3dcb6f6a00f818bb2ec781cee4de0645f59ccaf99b1d1823b6100", size = 481030, upload-time = "2026-07-23T01:56:33.365Z" }, + { url = "https://files.pythonhosted.org/packages/22/8c/c29d067df825a2df88ca432db848aa2fe8199598359cc06c12b09320cac9/aiohttp-3.14.3-cp314-cp314-win_arm64.whl", hash = "sha256:1576145bdceeb92382d899751e12743a3a5b8e460a841e3e50543859e54864dc", size = 453669, upload-time = "2026-07-23T01:56:35.731Z" }, + { url = "https://files.pythonhosted.org/packages/6a/a4/9c033beb355d39b6147980597ec9645e4729243f686ee4dc73945de72030/aiohttp-3.14.3-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:8800c996b01c2772a783e3e46f3e1abd5823029adca0df54231960de9bfefa5b", size = 791403, upload-time = "2026-07-23T01:56:37.972Z" }, + { url = "https://files.pythonhosted.org/packages/80/ca/87c32a0a7704583cfc49660bd817889bae5b830bf53b5dcb4e92145ac2da/aiohttp-3.14.3-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:ebe8e504f058fe91223351cecd2d9d6946c9d241bb0250d898ffbdf584cc72b0", size = 526413, upload-time = "2026-07-23T01:56:40.523Z" }, + { url = "https://files.pythonhosted.org/packages/9e/d8/8ec0e471248c500acdce2be3f46db8fb62b5eb60efef072529cc85ee1d26/aiohttp-3.14.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:30402d03a7c0ff52bce290b57e564e9079fd9d0cb545c8aba73f86a103162d2e", size = 532135, upload-time = "2026-07-23T01:56:42.876Z" }, + { url = "https://files.pythonhosted.org/packages/fe/45/f8919fd936e8b79fcd9bda7b6d8e62613462a713f4f17987fd7c34399142/aiohttp-3.14.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9fc7b5bfec6573f3ae844f457fdde5adeb713f8b8e4a81ad64fc207b49383716", size = 1922742, upload-time = "2026-07-23T01:56:45.528Z" }, + { url = "https://files.pythonhosted.org/packages/f6/ec/9ca76b28a27525b0cc53e20842e0228b022f301ce1f436b7d814b4aaf2df/aiohttp-3.14.3-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8a5fd34f7f7410d1730d5c2ba873cacb2eed3fede366feb268a70ba22581ed8f", size = 1787371, upload-time = "2026-07-23T01:56:48.045Z" }, + { url = "https://files.pythonhosted.org/packages/b1/04/6acdbf17315f7b55f1937e3387acb89a3cddeb4995689553d064af8e92ab/aiohttp-3.14.3-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:270d3dace9ca2f10f0da5d8ebe519b7a310fc6112ed916e32df5866df0888553", size = 1912623, upload-time = "2026-07-23T01:56:50.605Z" }, + { url = "https://files.pythonhosted.org/packages/86/e6/438b0c79ca6f45eb9fd9817dd4c01a91919a38c0de5ee9e05e2b4dc0ece7/aiohttp-3.14.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3ae5b3a59436d089b5395d910121a390feed4d00578eb95a0fd1a329fe963100", size = 2005515, upload-time = "2026-07-23T01:56:53.153Z" }, + { url = "https://files.pythonhosted.org/packages/bb/6b/62cbd6577758699525f5c712d1ddef57d9875fbab0ae8d5f5a202fd598f8/aiohttp-3.14.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2498f0fe69ead802f9675beca44a7c21c62fdaa4ec5145ea1c3ad6edbee29f85", size = 1879906, upload-time = "2026-07-23T01:56:55.818Z" }, + { url = "https://files.pythonhosted.org/packages/00/95/18bcbf830a21dc3aae24d8f6b6feaf3db1d2090242d00a7868db2ffb0b67/aiohttp-3.14.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a0dc483c00da8b673abbb367eb6f8d8f4bcec30eb58529ea13cb42e7fd2dfa33", size = 1675849, upload-time = "2026-07-23T01:56:58.861Z" }, + { url = "https://files.pythonhosted.org/packages/a9/19/47f4968659c5e23606c3790c80fc624e691c153d036148449ee84d31b287/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:c7d3a97c678d34fc5b59da671ee9cd630096ddc643e7b5a30d54a2a6f3574d3f", size = 1843496, upload-time = "2026-07-23T01:57:01.591Z" }, + { url = "https://files.pythonhosted.org/packages/64/af/38c33c4dd82fddcb4e56c4653b6f1072a8edbc6b7fa15809f14932c41e2d/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:f8fb78a83c9e5f741ca3a68cfb455c1f5bb83b4e7249a3848b3cd78d0a8563b0", size = 1827746, upload-time = "2026-07-23T01:57:05.131Z" }, + { url = "https://files.pythonhosted.org/packages/a1/9d/0537cda4885ac8f5b7053d164dd06312f4c483a4edcb8ee5b8aaf2a989bf/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:74ab5b6a9fb13e873e5a90946588baecaf488745e1db1a4a5c433f971f035098", size = 1853810, upload-time = "2026-07-23T01:57:08.043Z" }, + { url = "https://files.pythonhosted.org/packages/19/fe/26f9c5e6458385aa86497836b0dea6fb2f027827d63f37c7856cce9286ee/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:bd52f811e65f6fb634b1047159657c98f52b407f8efec907bcfc09da9a4c0a25", size = 1668895, upload-time = "2026-07-23T01:57:10.837Z" }, + { url = "https://files.pythonhosted.org/packages/ec/4c/618b1db9b9ba079b8875d2cdf78e7c4a3bf72903bd5850fee7dd9544600a/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:f0f177d1b195b9e06376cfd7d308d8a1b920909a609d03ac82a8c73bbb16d3b9", size = 1883833, upload-time = "2026-07-23T01:57:13.672Z" }, + { url = "https://files.pythonhosted.org/packages/94/c6/bd959bd1e4771f9fd944e9e436224c48c77b018b73b519b5aad346335bcc/aiohttp-3.14.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:498c6c623134f8e09a3c4e60bcd607a0b4590dd7dbf08dd40851b27cbb520ccb", size = 1844251, upload-time = "2026-07-23T01:57:16.593Z" }, + { url = "https://files.pythonhosted.org/packages/5e/19/08d41839658bdd44a0ed2480f3891705ecb487ce28c0dde62c9040c997e0/aiohttp-3.14.3-cp314-cp314t-win32.whl", hash = "sha256:b304db572b4368edd8dda8a2274f73156fe15558fca4a917cb8a09fc47af5963", size = 474180, upload-time = "2026-07-23T01:57:19.306Z" }, + { url = "https://files.pythonhosted.org/packages/99/5d/3cd6ef0a2b2851f7ab913b5b079334781bd50ff56a323e4454063377a080/aiohttp-3.14.3-cp314-cp314t-win_amd64.whl", hash = "sha256:b20032766aedf6261c7a566585a40867d092ac03a0d81592d5370ef9b054f99b", size = 500528, upload-time = "2026-07-23T01:57:21.762Z" }, + { url = "https://files.pythonhosted.org/packages/a4/37/cfd1ed540a4d318da025590d96b728e63713c09e9377950fc655dadeb856/aiohttp-3.14.3-cp314-cp314t-win_arm64.whl", hash = "sha256:2e1161602f45a54de2ce0905243a95f58cb42dcd378402f3697f5e0b21e9d2e7", size = 469280, upload-time = "2026-07-23T01:57:24.241Z" }, +] + +[[package]] +name = "aiosignal" +version = "1.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "frozenlist" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/61/62/06741b579156360248d1ec624842ad0edf697050bbaf7c3e46394e106ad1/aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7", size = 25007, upload-time = "2025-07-03T22:54:43.528Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/76/641ae371508676492379f16e2fa48f4e2c11741bd63c48be4b12a6b09cba/aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e", size = 7490, upload-time = "2025-07-03T22:54:42.156Z" }, +] + +[[package]] +name = "anyio" +version = "4.14.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/61/cc/a381afa6efea9f496eff839d4a6a1aed3bfafc7b3ab4b0d1b243a12573dd/anyio-4.14.2.tar.gz", hash = "sha256:cfa139f3ed1a23ee8f88a145ddb5ac7605b8bbfd8592baacd7ce3d8bb4313c7f", size = 260176, upload-time = "2026-07-12T20:29:07.082Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/da/35/f2287558c17e29fafc8ef3daf819bb9834061cfa43bff8014f7df7f63bdc/anyio-4.14.2-py3-none-any.whl", hash = "sha256:9f505dda5ac9f0c8309b5e8bd445a8c2bf7246f3ce950121e45ea15bc41d1494", size = 125813, upload-time = "2026-07-12T20:29:05.763Z" }, +] + +[[package]] +name = "appnope" +version = "0.1.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/35/5d/752690df9ef5b76e169e68d6a129fa6d08a7100ca7f754c89495db3c6019/appnope-0.1.4.tar.gz", hash = "sha256:1de3860566df9caf38f01f86f65e0e13e379af54f9e4bee1e66b48f2efffd1ee", size = 4170, upload-time = "2024-02-06T09:43:11.258Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/81/29/5ecc3a15d5a33e31b26c11426c45c501e439cb865d0bff96315d86443b78/appnope-0.1.4-py2.py3-none-any.whl", hash = "sha256:502575ee11cd7a28c0205f379b525beefebab9d161b7c964670864014ed7213c", size = 4321, upload-time = "2024-02-06T09:43:09.663Z" }, +] + +[[package]] +name = "asttokens" +version = "3.0.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/25/1e/faf0f247f6f881b98fc4d6d07e14085cb89d13665084e6d6ac1dc2c03d0b/asttokens-3.0.2.tar.gz", hash = "sha256:3ecdbd8f2cc195f53ccada3a613538bb5f9ef6f6869129f13e03c30a677b8fe2", size = 63136, upload-time = "2026-07-12T03:31:49.084Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d4/2b/04b8a15f3a1c77bc79ddf5c73875327f34b4fa75982df2b76e45e402d364/asttokens-3.0.2-py3-none-any.whl", hash = "sha256:9da13157f5b28becde0bd374fc677dcd3c290614264eff096f167c469cd9f933", size = 28702, upload-time = "2026-07-12T03:31:47.542Z" }, +] + +[[package]] +name = "attrs" +version = "26.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/9a/8e/82a0fe20a541c03148528be8cac2408564a6c9a0cc7e9171802bc1d26985/attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32", size = 952055, upload-time = "2026-03-19T14:22:25.026Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309", size = 67548, upload-time = "2026-03-19T14:22:23.645Z" }, +] + +[[package]] +name = "babel" +version = "2.18.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/b2/51899539b6ceeeb420d40ed3cd4b7a40519404f9baf3d4ac99dc413a834b/babel-2.18.0.tar.gz", hash = "sha256:b80b99a14bd085fcacfa15c9165f651fbb3406e66cc603abf11c5750937c992d", size = 9959554, upload-time = "2026-02-01T12:30:56.078Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/f5/21d2de20e8b8b0408f0681956ca2c69f1320a3848ac50e6e7f39c6159675/babel-2.18.0-py3-none-any.whl", hash = "sha256:e2b422b277c2b9a9630c1d7903c2a00d0830c409c59ac8cae9081c92f1aeba35", size = 10196845, upload-time = "2026-02-01T12:30:53.445Z" }, +] + +[[package]] +name = "backrefs" +version = "8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ec/56/4744bcd0c82184e80c52b0ac4076c261a8ffa1f1b343ff2f6e89ce0e1cef/backrefs-8.0.tar.gz", hash = "sha256:b556cd7d36c3a3a2f256b89590b176b8eddfb73bcfaee3a3ddd84ea66d21ce50", size = 7013081, upload-time = "2026-07-26T19:54:24.638Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e3/fd/9bf53b6a6f6f519ffaac765df2f2a25e5c2fc6d32cfd2b2747099e72c911/backrefs-8.0-py310-none-any.whl", hash = "sha256:4a627b817fd2dce43b79ab48da63613340509381cd8ce0897078a0bce79a2ab8", size = 380377, upload-time = "2026-07-26T19:54:17.457Z" }, + { url = "https://files.pythonhosted.org/packages/e1/29/4bd7ae72a2634da00379c2b3bcc5439e7c94620235c6afea8af15229a973/backrefs-8.0-py311-none-any.whl", hash = "sha256:f0c35cf0102ba6b6070c12a492be3c1c1d3f5839529784b9a9565d6d04569a01", size = 392169, upload-time = "2026-07-26T19:54:18.782Z" }, + { url = "https://files.pythonhosted.org/packages/29/13/232505664e8e2a0c7a2eb0c505cfade9d715538f89a5d62bc4c272968f62/backrefs-8.0-py312-none-any.whl", hash = "sha256:87f0fae8c5f207fe9f4b2887efc71d42f4900ac78faa1af08d675ef303692dc5", size = 398084, upload-time = "2026-07-26T19:54:19.954Z" }, + { url = "https://files.pythonhosted.org/packages/8a/69/47a3dc20abc4fa5486655fde681bd55e63211b46c886d8c02223d6468431/backrefs-8.0-py313-none-any.whl", hash = "sha256:601ce68ca12385dbda06ce264406b4c4210cf5b79fd0fd627592365c92f29a88", size = 400040, upload-time = "2026-07-26T19:54:21.194Z" }, + { url = "https://files.pythonhosted.org/packages/1c/cf/e5f9b68a5b0e939a2fb933a66c20180d0c9241bf8927f7a47fa48c1675e9/backrefs-8.0-py314-none-any.whl", hash = "sha256:9ec96efa080938be92323e8e730e57718c9c88eb15ad70bbef4e1766df591408", size = 411903, upload-time = "2026-07-26T19:54:23.221Z" }, +] + +[[package]] +name = "certifi" +version = "2026.7.22" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" }, +] + +[[package]] +name = "cffi" +version = "2.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pycparser" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be", size = 530807, upload-time = "2026-08-03T21:21:18.939Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/10/69/43965eccfdead3b9220015fd1320e117be8c6ed01a62ffab76eeb752f5d5/cffi-2.1.1-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0", size = 184821, upload-time = "2026-08-03T21:19:44.887Z" }, + { url = "https://files.pythonhosted.org/packages/54/7d/16e5a096677b5e313ca80cd5e5170efa3ea44624a82bb111925522da64b1/cffi-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf", size = 184719, upload-time = "2026-08-03T21:19:46.129Z" }, + { url = "https://files.pythonhosted.org/packages/56/e6/8941622732edec876dd17d0453dce07317ae96db34f2ec1436c9d3785986/cffi-2.1.1-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a", size = 214799, upload-time = "2026-08-03T21:19:47.218Z" }, + { url = "https://files.pythonhosted.org/packages/44/de/f98430906df1545ffde0d543dd124a7a439bc2cd32b36b9c53f805df7333/cffi-2.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890", size = 222389, upload-time = "2026-08-03T21:19:48.331Z" }, + { url = "https://files.pythonhosted.org/packages/6a/5b/717f1526b9957b34456313c31645c5b82b8fb5c3fe9e4752999be7128bfc/cffi-2.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50", size = 210249, upload-time = "2026-08-03T21:19:49.543Z" }, + { url = "https://files.pythonhosted.org/packages/64/b3/f8aa4f3e34986c7e4ec45072d1b1b9dd295b6b18007b45518d79726dd725/cffi-2.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e", size = 208775, upload-time = "2026-08-03T21:19:50.918Z" }, + { url = "https://files.pythonhosted.org/packages/b1/db/dceb9dd5b231e1da801793f8acc9f3c52a7e1afe40bb1aae37e02b0faad5/cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf", size = 221822, upload-time = "2026-08-03T21:19:52.054Z" }, + { url = "https://files.pythonhosted.org/packages/a0/d2/6cd24ae3be000a634109c247d1475d62e5616d0dc78c82770942ec384248/cffi-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517", size = 225232, upload-time = "2026-08-03T21:19:53.109Z" }, + { url = "https://files.pythonhosted.org/packages/cb/52/3fa190537004dd7f0ab860a6dc7c0175b8667f68d1e618a46f5498d30250/cffi-2.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735", size = 223597, upload-time = "2026-08-03T21:19:54.515Z" }, + { url = "https://files.pythonhosted.org/packages/80/fb/0bb75b7039588c074b37ae99f40d9bfddf990ecb2fbc346ebccd2e56b9be/cffi-2.1.1-cp312-cp312-win32.whl", hash = "sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e", size = 175292, upload-time = "2026-08-03T21:19:55.566Z" }, + { url = "https://files.pythonhosted.org/packages/d9/79/615cc094e2fb508cade7de88d3b4f6c4ec2bab695c97bce9153dc65aadf5/cffi-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a", size = 185919, upload-time = "2026-08-03T21:19:56.89Z" }, + { url = "https://files.pythonhosted.org/packages/70/c6/d0ea84713fe46b243a436a18fcd47d639732747e21635c8a27191b06dc30/cffi-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80", size = 180093, upload-time = "2026-08-03T21:19:58.155Z" }, + { url = "https://files.pythonhosted.org/packages/9d/f4/035513d4117049066b4779dc3b7c0c0fdad175fa13731c9f4003f1cd1478/cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e", size = 194248, upload-time = "2026-08-03T21:19:59.399Z" }, + { url = "https://files.pythonhosted.org/packages/76/af/2aeb4dbb5fc41a04161ae9ff1518de7cec08e164f44a8ce6a4cf7fd2cd1d/cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c", size = 196908, upload-time = "2026-08-03T21:20:00.746Z" }, + { url = "https://files.pythonhosted.org/packages/a7/46/2e5fdde8555706dd98139a910ca11be02809f3f605ce956f655d0214e100/cffi-2.1.1-cp313-cp313-macosx_10_15_x86_64.whl", hash = "sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6", size = 184805, upload-time = "2026-08-03T21:20:02.02Z" }, + { url = "https://files.pythonhosted.org/packages/55/41/4c7042f317b9217502988f0873af87e16ad606dc20f84e546e3e6ce9764c/cffi-2.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971", size = 184764, upload-time = "2026-08-03T21:20:03.141Z" }, + { url = "https://files.pythonhosted.org/packages/43/1f/1c3d90d91811c8f86ced9ed637956c54bfe5b79ca98fe976d7f8c8979f6b/cffi-2.1.1-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c", size = 214722, upload-time = "2026-08-03T21:20:04.377Z" }, + { url = "https://files.pythonhosted.org/packages/37/6f/3b5ce4c3b2192d250f04908f2bfd91ef34552ec8f7716a5d4abdb8d67bb2/cffi-2.1.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125", size = 222369, upload-time = "2026-08-03T21:20:05.544Z" }, + { url = "https://files.pythonhosted.org/packages/02/10/4b3c75dde3d9663c9e02ba05c2668b954f671d4bbe346413ca8c696b295a/cffi-2.1.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264", size = 210175, upload-time = "2026-08-03T21:20:06.75Z" }, + { url = "https://files.pythonhosted.org/packages/df/62/14f74b9543e605d17701dc797b815958b8bb70b7624ce1b832ddad48ed6c/cffi-2.1.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3", size = 208670, upload-time = "2026-08-03T21:20:08.04Z" }, + { url = "https://files.pythonhosted.org/packages/95/95/86342356ff5953b3fb06f7ef7c5bee212d45e770abc7218d451b9148313c/cffi-2.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2", size = 221824, upload-time = "2026-08-03T21:20:09.274Z" }, + { url = "https://files.pythonhosted.org/packages/eb/ff/7b3429ff53aafe931ed8a5fc69f481bbef7ba6de87ddcbb63d08f483f613/cffi-2.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b", size = 225148, upload-time = "2026-08-03T21:20:10.7Z" }, + { url = "https://files.pythonhosted.org/packages/34/34/a95870b9221e09cf4f2ce3178b1a210abdfe63a1bd357da940418d7b8d15/cffi-2.1.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7", size = 223564, upload-time = "2026-08-03T21:20:12.165Z" }, + { url = "https://files.pythonhosted.org/packages/70/ea/839b50531021a647fb5e929f72cf97bc1ff702b5472166164b5b6e76b851/cffi-2.1.1-cp313-cp313-win32.whl", hash = "sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac", size = 175263, upload-time = "2026-08-03T21:20:13.559Z" }, + { url = "https://files.pythonhosted.org/packages/60/a6/8b149b2c3f2e11aaa1618ef64500b45f50f22c57a977a4dff1aff1f91042/cffi-2.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d", size = 185688, upload-time = "2026-08-03T21:20:14.69Z" }, + { url = "https://files.pythonhosted.org/packages/01/9a/11f687cb39d6a3504060d5242f04f48c735afb4d3d533958a20594890cb2/cffi-2.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973", size = 180078, upload-time = "2026-08-03T21:20:15.917Z" }, + { url = "https://files.pythonhosted.org/packages/d3/7b/d6bbf82b8b96e7391438898c42f5bd96dd02030fd5b64937d248220003e2/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c", size = 194064, upload-time = "2026-08-03T21:20:17.148Z" }, + { url = "https://files.pythonhosted.org/packages/94/e6/bcc91b283be94735e268487a054004f0aa19947b6348fa367db53230abc8/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb", size = 196720, upload-time = "2026-08-03T21:20:18.268Z" }, + { url = "https://files.pythonhosted.org/packages/d9/99/c4b0c17cacdc9c3b8f280026286a9826d6a208c0f047591a3c3ce99b91fd/cffi-2.1.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54", size = 184964, upload-time = "2026-08-03T21:20:19.708Z" }, + { url = "https://files.pythonhosted.org/packages/b3/a9/9db617d05d7367c1ad0ab00b3aa6e6f9281edd689b4ee9ea0e5a84e89c97/cffi-2.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72", size = 184962, upload-time = "2026-08-03T21:20:20.833Z" }, + { url = "https://files.pythonhosted.org/packages/67/b8/b42132ca113dc567d37684437b46ca1dafc885902b02a110a02d5b511857/cffi-2.1.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1", size = 222328, upload-time = "2026-08-03T21:20:22.118Z" }, + { url = "https://files.pythonhosted.org/packages/80/10/c5c0cbf0a657aecf59ef511409734230bf556f05a0d6c9eed7aa5c0a0166/cffi-2.1.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062", size = 209985, upload-time = "2026-08-03T21:20:23.401Z" }, + { url = "https://files.pythonhosted.org/packages/d5/6c/bfa0b87b03b9238148beca990292843c9396ba069b54496596594173de7b/cffi-2.1.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03", size = 208530, upload-time = "2026-08-03T21:20:24.628Z" }, + { url = "https://files.pythonhosted.org/packages/e9/02/4e7d553a7ac4b4238b38b3c1b80d486e9d4436f8d2acbf87a0997fe3f402/cffi-2.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96", size = 221525, upload-time = "2026-08-03T21:20:25.758Z" }, + { url = "https://files.pythonhosted.org/packages/82/1d/a4aaf9babd75acb4d5f223bff71533bee748dd770a382619a798960ee9ba/cffi-2.1.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527", size = 225053, upload-time = "2026-08-03T21:20:26.985Z" }, + { url = "https://files.pythonhosted.org/packages/81/10/5dc0e7bdd18e22107054288283380fc97a06ae3f1656a106908d666a3c88/cffi-2.1.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13", size = 223213, upload-time = "2026-08-03T21:20:28.277Z" }, + { url = "https://files.pythonhosted.org/packages/0b/e9/d0061c364cde06ee43168a0d076ac1da512cbc380d44767b844ba34fe2b6/cffi-2.1.1-cp314-cp314-win32.whl", hash = "sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c", size = 177682, upload-time = "2026-08-03T21:20:44.288Z" }, + { url = "https://files.pythonhosted.org/packages/a7/06/1c3e01e3ba14c39f6d10bfbac52753b7e22259e38088e5cfe1d704918690/cffi-2.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48", size = 187949, upload-time = "2026-08-03T21:20:45.623Z" }, + { url = "https://files.pythonhosted.org/packages/87/5b/da4e39efe18eeb89cf580ea9cfc66b6a7c3eadb808fc0cc1d3a295cb5a5d/cffi-2.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836", size = 182947, upload-time = "2026-08-03T21:20:46.955Z" }, + { url = "https://files.pythonhosted.org/packages/23/59/40338bf421c5accea1d45158170c87006ef1cd371b05c077e76476949728/cffi-2.1.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3", size = 188504, upload-time = "2026-08-03T21:20:29.495Z" }, + { url = "https://files.pythonhosted.org/packages/7d/47/5ecf1023850036e674c77ec4de86182d309ae344e39e7cba984b7df5d647/cffi-2.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2", size = 188259, upload-time = "2026-08-03T21:20:31.291Z" }, + { url = "https://files.pythonhosted.org/packages/2a/9c/92934c3bea9f785b23eba304538c0b4d37a2a96d2431eb3a1bc87a11aa19/cffi-2.1.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94", size = 223864, upload-time = "2026-08-03T21:20:32.571Z" }, + { url = "https://files.pythonhosted.org/packages/4d/45/ba4c93527bc38616a8bd36488acb69a2212d60486794f0c1f318949bbb76/cffi-2.1.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc", size = 211538, upload-time = "2026-08-03T21:20:33.808Z" }, + { url = "https://files.pythonhosted.org/packages/80/e9/b6ef565e452acb932fb0cb5443f44a78efbd1233e566f02b5a83855e9115/cffi-2.1.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29", size = 210688, upload-time = "2026-08-03T21:20:34.974Z" }, + { url = "https://files.pythonhosted.org/packages/9a/95/eff5f0cee78d2eabc7eebffec40d3fc1876b5f3c95582e018bb4b99601f2/cffi-2.1.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676", size = 223803, upload-time = "2026-08-03T21:20:36.564Z" }, + { url = "https://files.pythonhosted.org/packages/fa/01/579d39fb8bef00a335a23d83757b44feb24cd6345a2c451b64cb67b9c362/cffi-2.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e", size = 226763, upload-time = "2026-08-03T21:20:37.816Z" }, + { url = "https://files.pythonhosted.org/packages/8d/b0/0b44f47c60b01b57b6e2bbd92343f13a85a1d93bc46ccf6e47e244acd99c/cffi-2.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f", size = 225688, upload-time = "2026-08-03T21:20:38.959Z" }, + { url = "https://files.pythonhosted.org/packages/eb/d2/3b7176cb570a1d3e27faf67b72f591af508036e0d8b2be2ef9af9e8c84bb/cffi-2.1.1-cp314-cp314t-win32.whl", hash = "sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4", size = 182868, upload-time = "2026-08-03T21:20:40.388Z" }, + { url = "https://files.pythonhosted.org/packages/56/78/31f00c1bcd97c9bbf55f1bfdf5bc809a5de8887473e90bb9960dca825e80/cffi-2.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e", size = 194104, upload-time = "2026-08-03T21:20:41.725Z" }, + { url = "https://files.pythonhosted.org/packages/7b/1b/58496f2ed0a35de575250c02a43ab3cc2c04d494a88fed31c1cabc0fd176/cffi-2.1.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5", size = 186402, upload-time = "2026-08-03T21:20:43.042Z" }, + { url = "https://files.pythonhosted.org/packages/c1/8f/9ebe220eab48a093d1a5a5e339ab0dc7316eef3bb04d63c42f0251b61f50/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d", size = 194043, upload-time = "2026-08-03T21:20:48.179Z" }, + { url = "https://files.pythonhosted.org/packages/ff/69/844bad3ece306c4782c2ecb93597035b6690d48704b803914c199da1e8b3/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b", size = 196737, upload-time = "2026-08-03T21:20:49.457Z" }, + { url = "https://files.pythonhosted.org/packages/1b/8a/af668013284634733f02d683458a0728739c7d6ddb5e14cb0c20832266fe/cffi-2.1.1-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4", size = 184933, upload-time = "2026-08-03T21:20:50.639Z" }, + { url = "https://files.pythonhosted.org/packages/0c/75/2f5207ff6d1a613133b23a5203cc0c2a628313b5eb3974d7956ae3c57950/cffi-2.1.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8", size = 185002, upload-time = "2026-08-03T21:20:52.173Z" }, + { url = "https://files.pythonhosted.org/packages/e2/31/9e1313b0a6e30e91b3b3d3fff51ae99c857c07738e3afcce1f7334e1b7ab/cffi-2.1.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6", size = 222271, upload-time = "2026-08-03T21:20:53.462Z" }, + { url = "https://files.pythonhosted.org/packages/50/e3/f6234a833e6e08c7007003074723c406559eecf9b48dfc97471e5a8eb7a0/cffi-2.1.1-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80", size = 209919, upload-time = "2026-08-03T21:20:54.783Z" }, + { url = "https://files.pythonhosted.org/packages/0d/fc/5f74e293fced6edb51af3a46c4ccf6c23c9943774ecb375ddbd522c76add/cffi-2.1.1-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779", size = 208529, upload-time = "2026-08-03T21:20:56.066Z" }, + { url = "https://files.pythonhosted.org/packages/44/16/29e6d01b388bef055ecd6ca8244b3f4d336bd09e92d5d892187b9601084e/cffi-2.1.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399", size = 221630, upload-time = "2026-08-03T21:20:57.336Z" }, + { url = "https://files.pythonhosted.org/packages/a4/18/fa7f1f6857d5eb88a4ca99ffcbfb7c387a287ccc154c64a73e86314745d7/cffi-2.1.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688", size = 225134, upload-time = "2026-08-03T21:20:58.675Z" }, + { url = "https://files.pythonhosted.org/packages/e0/9f/e8e3dfa04a1b4c241f8c91faacad872b4d4efd051d49764ad4e2fd4b9fea/cffi-2.1.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7", size = 223197, upload-time = "2026-08-03T21:20:59.968Z" }, + { url = "https://files.pythonhosted.org/packages/f8/7e/8debeb04f1ab9fe2a6963964cd6f1aaf7192627b83926586a6a4e089c9fa/cffi-2.1.1-cp315-cp315-win32.whl", hash = "sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac", size = 177683, upload-time = "2026-08-03T21:21:14.901Z" }, + { url = "https://files.pythonhosted.org/packages/e0/31/5158704cc474ab65c1647932e88be78dc0873f47130e253be38bcaf13d01/cffi-2.1.1-cp315-cp315-win_amd64.whl", hash = "sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960", size = 187897, upload-time = "2026-08-03T21:21:16.108Z" }, + { url = "https://files.pythonhosted.org/packages/cc/4b/b3a2da8570c704ffc0f9762cdc3ec0f02c8573798e0b5cf7f11c82bbb70f/cffi-2.1.1-cp315-cp315-win_arm64.whl", hash = "sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1", size = 182935, upload-time = "2026-08-03T21:21:17.271Z" }, + { url = "https://files.pythonhosted.org/packages/d0/ef/5443574510a1207e6f6bc38ba6e1f1de36cb48fef07b2728bb896a21f430/cffi-2.1.1-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc", size = 188464, upload-time = "2026-08-03T21:21:01.163Z" }, + { url = "https://files.pythonhosted.org/packages/7e/ae/a56fa8c4686ad50e148fcbc8d3ae0d03915ff5c30d795058988c24118cef/cffi-2.1.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab", size = 188262, upload-time = "2026-08-03T21:21:02.382Z" }, + { url = "https://files.pythonhosted.org/packages/53/b2/6187f46f2912276a3ae284076109cc5c8680482f11f766ccf26db4a86427/cffi-2.1.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e", size = 223779, upload-time = "2026-08-03T21:21:03.553Z" }, + { url = "https://files.pythonhosted.org/packages/8a/f6/c3ad28bd19f77047a03084424fbd4cbe997303267c14423737324be0385d/cffi-2.1.1-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358", size = 211520, upload-time = "2026-08-03T21:21:04.863Z" }, + { url = "https://files.pythonhosted.org/packages/a0/cd/ccac9013a5bd9fd764de118674ab9c805b5ca10c19270d90ee273f8b2240/cffi-2.1.1-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231", size = 210673, upload-time = "2026-08-03T21:21:06.223Z" }, + { url = "https://files.pythonhosted.org/packages/52/86/2976131c639aead931c5bee5aba67e4b09fbeb8018b6f282f70803f923a7/cffi-2.1.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6", size = 223835, upload-time = "2026-08-03T21:21:07.539Z" }, + { url = "https://files.pythonhosted.org/packages/ac/0c/33a7aeab2f9c76918c52e084beb39c570db3588133412929e8ec06fab90b/cffi-2.1.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94", size = 226705, upload-time = "2026-08-03T21:21:08.774Z" }, + { url = "https://files.pythonhosted.org/packages/e3/26/2cde30fdde421130bfc18f70395731a6e6b2053c6a1978a5258ff04e72fa/cffi-2.1.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5", size = 225539, upload-time = "2026-08-03T21:21:09.911Z" }, + { url = "https://files.pythonhosted.org/packages/6d/cd/a361394c94b2129d604bb846f624a8e88255a3ee33129c434a00d715e64f/cffi-2.1.1-cp315-cp315t-win32.whl", hash = "sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66", size = 182707, upload-time = "2026-08-03T21:21:11.226Z" }, + { url = "https://files.pythonhosted.org/packages/9b/b5/ba2b299993c26577d529b6ae29841f9e15b9fcf004d65f423f4fcf94ade9/cffi-2.1.1-cp315-cp315t-win_amd64.whl", hash = "sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3", size = 193772, upload-time = "2026-08-03T21:21:12.39Z" }, + { url = "https://files.pythonhosted.org/packages/aa/29/35e016098c814cd93de9cd320c66b5bfba14dc6ecedd3cb518fa7c408c69/cffi-2.1.1-cp315-cp315t-win_arm64.whl", hash = "sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692", size = 186360, upload-time = "2026-08-03T21:21:13.636Z" }, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bd/2a/23f34ec9d04624958e137efdc394888716353190e75f25dd22c7a2c7a8aa/charset_normalizer-3.4.9.tar.gz", hash = "sha256:673611bbd43f0810bec0b0f028ddeaaa501190339cac411f347ac76917c3ae7b", size = 152439, upload-time = "2026-07-07T14:34:58.454Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/70/4a/ecbd131485c07fcdfad54e28946d513e3da22ef3b4bd854dcafae54ec739/charset_normalizer-3.4.9-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:45b0cc4e3556cd875e09102988d1ab8356c998b596c9fced84547c8138b487a0", size = 319300, upload-time = "2026-07-07T14:33:15.666Z" }, + { url = "https://files.pythonhosted.org/packages/ec/96/5d9364e3342d69f3a045e1777bc47c85c383e6e9466d561b33fdb419d1f9/charset_normalizer-3.4.9-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9b2aff1c7b3884512b9512c3eaadd9bab39fb45042ffaaa1dd08ff2b9f8109d9", size = 215802, upload-time = "2026-07-07T14:33:17.031Z" }, + { url = "https://files.pythonhosted.org/packages/4b/4c/5361f9aa7f2cb58d94f2ab831b3d493f69efb1d239654b4744e3c09527cb/charset_normalizer-3.4.9-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9104ed0bd76a429d46f9ec0dbc9b08ad1d2dcdf2b00a5a0daa1c145329b35b44", size = 237171, upload-time = "2026-07-07T14:33:18.576Z" }, + { url = "https://files.pythonhosted.org/packages/50/78/ce342ca4ff30b2eb49fe6d9578df85974f90c67d294113e94efdd9664cbd/charset_normalizer-3.4.9-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7b86a2b16095d250c6f58b3d9b2eee6f4147754344f3dab0922f7c9bf7d226c9", size = 233075, upload-time = "2026-07-07T14:33:20.084Z" }, + { url = "https://files.pythonhosted.org/packages/01/c4/4fa4c8b3097a11f3c5f09a35b72ed6855fb1d332469504962ab7bafcc702/charset_normalizer-3.4.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e226f6218febc71f6c1fc2fafb91c226f75bdc1d8fb12d66823716e891608fd", size = 224256, upload-time = "2026-07-07T14:33:21.747Z" }, + { url = "https://files.pythonhosted.org/packages/87/3a/ad914516df7e358a81aae018caa5e0470ba827fa6d763b1d2e87d920a5f6/charset_normalizer-3.4.9-cp312-cp312-manylinux_2_31_armv7l.whl", hash = "sha256:90c44bc373b7687f6948b693cceaea1348ae0975d7474746559494468e3c1d84", size = 208784, upload-time = "2026-07-07T14:33:23.313Z" }, + { url = "https://files.pythonhosted.org/packages/d7/74/3c12f9755717dfe5c5c87da63f35d765fa0c00382ec26bf23f7fae34f2ba/charset_normalizer-3.4.9-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9cdef90ae47919cae358d8ab15797a800ed41da7aba5d72419fb510729e2ed4b", size = 219928, upload-time = "2026-07-07T14:33:24.814Z" }, + { url = "https://files.pythonhosted.org/packages/33/9a/895095b83e7907abd6d3d99aad3a38ad0d9686cc186cb0c94c24320fe63e/charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:60f44ade2cf573dad7a277e6f8ca9a51a21dda572b13bd7d8539bb3cd5dbedde", size = 218489, upload-time = "2026-07-07T14:33:26.42Z" }, + { url = "https://files.pythonhosted.org/packages/a1/34/ef5c05f412f42520d7709b7d3784d19640839eb7366ded1755511585429f/charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:a1786910334ed46ab1dd73222f2cd1e05c2c3bb39f6dddb4f8b36fc382058a39", size = 210267, upload-time = "2026-07-07T14:33:27.952Z" }, + { url = "https://files.pythonhosted.org/packages/83/dc/9b29fa4412b318bf3bfea985c35d67eb55e04b59a7c3f2237168b0e0be6f/charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:03d07803992c6c7bbc976327f34b18b6160327fc81cb82c9d504720ac0be3b62", size = 226030, upload-time = "2026-07-07T14:33:29.397Z" }, + { url = "https://files.pythonhosted.org/packages/0e/42/6dbc00b8cd16011691203e33570fa42ed5746599a2e878112d16eab403a3/charset_normalizer-3.4.9-cp312-cp312-win32.whl", hash = "sha256:78841cccf1af7b40f6f716338d50c0902dbe88d9f800b3c973b7a9a0a693a642", size = 151185, upload-time = "2026-07-07T14:33:30.781Z" }, + { url = "https://files.pythonhosted.org/packages/80/cc/f920afd1a23c58ccd53c1d36085a71893a4737ff5e66e0371efab6809850/charset_normalizer-3.4.9-cp312-cp312-win_amd64.whl", hash = "sha256:4b3dac63058cc36820b0dd072f89898604e2d39686fe05321729d00d8ac185a0", size = 162557, upload-time = "2026-07-07T14:33:32.176Z" }, + { url = "https://files.pythonhosted.org/packages/f0/e6/0386d43a261ff4e4b30c5857af7df877254b46bec7b9d1b74b6bf969a90b/charset_normalizer-3.4.9-cp312-cp312-win_arm64.whl", hash = "sha256:78fa18e436a1a0e58dbd7e02fc4473f3f32cceb12df9dfca542d075961c307d2", size = 152665, upload-time = "2026-07-07T14:33:33.711Z" }, + { url = "https://files.pythonhosted.org/packages/b2/06/97ec2aeae780b31d742b6352218b43841a6871e2564578ca522dce4a45c3/charset_normalizer-3.4.9-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:440eede837960000d74978f0eba527be106b5b9aee0daf779d395276ed0b0614", size = 317688, upload-time = "2026-07-07T14:33:35.408Z" }, + { url = "https://files.pythonhosted.org/packages/d0/39/8ff066c672434225f8d25f8b739f992af250944392173dcc88362681c9bf/charset_normalizer-3.4.9-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:21e764fd1e70b6a3e205a0e46f3051701f98a8cb3fad66eeb80e48bb502f8698", size = 214982, upload-time = "2026-07-07T14:33:36.996Z" }, + { url = "https://files.pythonhosted.org/packages/92/8f/3a47a3667c83c2df9483d91644c6c107de3bf8874aa1793da9d3012eb986/charset_normalizer-3.4.9-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e4fd89cc178bced6ad29cb3e6dd4aa63fa5017c3524dbd0b25998fb64a87cc8b", size = 236460, upload-time = "2026-07-07T14:33:38.536Z" }, + { url = "https://files.pythonhosted.org/packages/f1/60/b22cdbee7e4013dab8b0d7647fc6181120fbbbc8f7025c226d15bd5a47fc/charset_normalizer-3.4.9-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:bd47ba7fc3ca94896759ea0109775132d3e7ab921fbf54038e1bab2e46c313c9", size = 232003, upload-time = "2026-07-07T14:33:40.059Z" }, + { url = "https://files.pythonhosted.org/packages/ea/f8/72eb13dcabe7257035cea8aefd922caad2f110d252bf9f67c4c2ca763aee/charset_normalizer-3.4.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:84fd18bcc17526fc2b3c1af7d2b9217d32c9c04448c16ec693b9b4f1985c3d33", size = 223149, upload-time = "2026-07-07T14:33:41.631Z" }, + { url = "https://files.pythonhosted.org/packages/b0/3e/faee8f9de92b14ee1198e9163252bb15efee7301b31256a3b6d9ebfdd0dd/charset_normalizer-3.4.9-cp313-cp313-manylinux_2_31_armv7l.whl", hash = "sha256:5b10cd92fc5c498b35a8635df6d5a100207f88b63a4dc1de7ef9a548e1e2cd63", size = 207901, upload-time = "2026-07-07T14:33:43.209Z" }, + { url = "https://files.pythonhosted.org/packages/3a/25/45f30093ae27dd7b92a793b61882a38685f993700113ca36e0c9c14965e1/charset_normalizer-3.4.9-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a4fbdde9dd4a9ce5fd52c2b3a347bb50cc89483ef783f1cb00d408c13f7a96c0", size = 219176, upload-time = "2026-07-07T14:33:44.725Z" }, + { url = "https://files.pythonhosted.org/packages/48/18/c8f397329c35e32f6a837e488986f4ae03bd2abebc453b48714991630c2f/charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:416c229f77e5ea25b3dfd4b582f8d73d7e43c22320302b9ab128a2d3a0b38efe", size = 217356, upload-time = "2026-07-07T14:33:46.192Z" }, + { url = "https://files.pythonhosted.org/packages/86/7e/5ce0bba863470fd1902d5e5843968951bddf38abe4742fc97116ef4598b3/charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:75286256590a6320cf106a0d28970d3560aad9ee09aa7b34fb40524792436d35", size = 209614, upload-time = "2026-07-07T14:33:47.705Z" }, + { url = "https://files.pythonhosted.org/packages/6c/ef/2473d3c4d869155be4af1191111d59c4d5c4e0173026f7e85b176e23bf65/charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:69b157c5d3292bcd443faca052f3096f637f1e074b98212a933c074ae23dc3b8", size = 224991, upload-time = "2026-07-07T14:33:49.238Z" }, + { url = "https://files.pythonhosted.org/packages/d0/a3/53ddae3db108a088156aa8ddfafd411ebbc1340f48c5573f697b27f69a39/charset_normalizer-3.4.9-cp313-cp313-win32.whl", hash = "sha256:51307f5c71007673a2bf8232ad973483d281e74cb99c8c5a990af1eefa6277d9", size = 150622, upload-time = "2026-07-07T14:33:50.711Z" }, + { url = "https://files.pythonhosted.org/packages/e8/ef/6953a77c7cf2c2ff9998e6f575ab3e380119f100223381565a4f94c1f836/charset_normalizer-3.4.9-cp313-cp313-win_amd64.whl", hash = "sha256:fe2c7201c642b7c308f1675355ad7ff7b66acfe3541625efe5a3ad38f29d6115", size = 161947, upload-time = "2026-07-07T14:33:52.197Z" }, + { url = "https://files.pythonhosted.org/packages/6e/fb/d560d1d1555debbfe7849d9cac6145c1b537709d79576bf22557ed803b82/charset_normalizer-3.4.9-cp313-cp313-win_arm64.whl", hash = "sha256:611057cc5d5c0afc743ba8be6bd828c17e0aaa8643f9d0a9b9bb7dea80eb8012", size = 152594, upload-time = "2026-07-07T14:33:53.486Z" }, + { url = "https://files.pythonhosted.org/packages/7e/8d/496817fa0944239ecae662dd57ea765cfeaec6a735f9f025d4b7b72e7143/charset_normalizer-3.4.9-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:0327fcd59a935777d83410750c50600ee9571af2846f71ce40f25b13da1ef380", size = 317253, upload-time = "2026-07-07T14:33:54.994Z" }, + { url = "https://files.pythonhosted.org/packages/2b/f9/ef4a69ea338ad3c0deceea0f5f7d2380ae8b52132b06d652cb0d2cd86706/charset_normalizer-3.4.9-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8a79d9f4d8001473a30c163556b3c3bfebec837495a412dde78b51672f6134f9", size = 215898, upload-time = "2026-07-07T14:33:56.334Z" }, + { url = "https://files.pythonhosted.org/packages/8c/e7/5ddfd76fc061eb52de219658a4aa431cbacadf0a0219c8854f00da50d289/charset_normalizer-3.4.9-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:33bdcc2a32c0a0e861f60841a512c8acc658c87c2ac59d89e3a46dacf7d866e4", size = 236718, upload-time = "2026-07-07T14:33:57.9Z" }, + { url = "https://files.pythonhosted.org/packages/49/ba/768fa3f36048d81c477a0ce61f813bc1454d80917ccfe550abd9f44f5e24/charset_normalizer-3.4.9-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f840ed6d8ecba8255df8c42b87fadeda98ddfc6eeec05e2dc66e26d46dd6f58a", size = 232519, upload-time = "2026-07-07T14:33:59.811Z" }, + { url = "https://files.pythonhosted.org/packages/f4/c4/b3e049d2aa3766180c78507110543d9d50894cc97f57de543f1be521dcdc/charset_normalizer-3.4.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c25fe15c70c59eb7c5ce8c06a1f3fa1da0ecc5ea1e7a5922c40fd2fa9b0d5046", size = 223143, upload-time = "2026-07-07T14:34:01.517Z" }, + { url = "https://files.pythonhosted.org/packages/19/79/55c32d06d76ae4feafe053f061f3e3ab70bcf19f4007797ce8c3efda7830/charset_normalizer-3.4.9-cp314-cp314-manylinux_2_31_armv7l.whl", hash = "sha256:f7fb7d750cfa0a070d2c24e831fd3481019a60dd317ea2b39acbcebc08b6ed81", size = 206742, upload-time = "2026-07-07T14:34:03.04Z" }, + { url = "https://files.pythonhosted.org/packages/10/e0/47c079dd82d217c807479cd59ffd30af56307ea31c108b75758970459ad3/charset_normalizer-3.4.9-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4d1c96a7a18b9690a4d46df09e3e3382406ae3213727cd1019ebade1c4a81917", size = 219191, upload-time = "2026-07-07T14:34:04.657Z" }, + { url = "https://files.pythonhosted.org/packages/42/ab/b9bc2e77d6b44a7e46ef62ec5cac1c9a6ba7b9135a5d560f002696ec9995/charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a4cfde78a9f2880208d16a93b795726a3017d5977e08d1e162a7a31322479c41", size = 218328, upload-time = "2026-07-07T14:34:06.115Z" }, + { url = "https://files.pythonhosted.org/packages/f1/78/c9c71d599f5aa2d42bcdd35cbbd46d7f535351a57e40ff7d8e5a7e219401/charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:d4d6fcde76f94f5cb9e43e9e9a61f16dacefd228cbbf6f1a09bd9b219a92f1a1", size = 207406, upload-time = "2026-07-07T14:34:07.554Z" }, + { url = "https://files.pythonhosted.org/packages/f6/39/c914445c321a845097ce4f6ac7de9a18228a77b766272125a1ce00d851eb/charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:898f0e9068ca27d37f8e83a5b962821df851532e6c4a7d615c1c033f9da6eedf", size = 225157, upload-time = "2026-07-07T14:34:09.061Z" }, + { url = "https://files.pythonhosted.org/packages/9b/f2/c0d4b8508565a36bc5c624e88ed297f5b0b1095011034d7f5b83a69908b5/charset_normalizer-3.4.9-cp314-cp314-win32.whl", hash = "sha256:c1c948747b03be832dceed96ca815cef7360de9aa19d37c730f8e3f6101aca48", size = 151095, upload-time = "2026-07-07T14:34:10.901Z" }, + { url = "https://files.pythonhosted.org/packages/49/fd/a1d26144398c67486422a72bf5812cda22cb4ccfcd95a290fb41ceb4b8e2/charset_normalizer-3.4.9-cp314-cp314-win_amd64.whl", hash = "sha256:16b65ea0f2465b6fb52aa22de5eca612aa964ddfec00a912e26f4656cbef890b", size = 162796, upload-time = "2026-07-07T14:34:12.47Z" }, + { url = "https://files.pythonhosted.org/packages/20/95/d75e82f8ce9fd323ebf059c16c9aadefb22a1ecde13b7840b35835e4886c/charset_normalizer-3.4.9-cp314-cp314-win_arm64.whl", hash = "sha256:40a126142a56b2dfc0aacbad1de8310cbf60da7656db0e6b16eebd48e3e93519", size = 153334, upload-time = "2026-07-07T14:34:14.044Z" }, + { url = "https://files.pythonhosted.org/packages/00/5e/17398df3a139985ba9d11ed072531986f408c8fca952835ef1ab1820c02b/charset_normalizer-3.4.9-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:609b3ba8fcc0fb5ab7af00719d0fb6ad0cb518e48e7712d12fd68f1327951198", size = 338848, upload-time = "2026-07-07T14:34:15.688Z" }, + { url = "https://files.pythonhosted.org/packages/cd/91/7253a32e86b7e1d1239b1b36ba6dd0f021a21107ab33054b53119cc083b9/charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:51447e9aa2684679af07ca5021c3db526e0284347ebf4ffcec1154c3350cfe32", size = 223022, upload-time = "2026-07-07T14:34:17.248Z" }, + { url = "https://files.pythonhosted.org/packages/cb/32/2e64bd2be10e89c61e57ebe6a93fd98ae88eb7ebe414b5121f22c96c69eb/charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cc1b0fff8ead343dae06305f954eb8468ba0ec1a97881f42489d198e4ce3c632", size = 241590, upload-time = "2026-07-07T14:34:18.813Z" }, + { url = "https://files.pythonhosted.org/packages/3d/ef/d96ec496cfea0c21db43b0ad03891308b02388d054cc902cf0e5a1ad6a88/charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fa36ec09ef71d158186bc79e359ff5fdd6e7996fe8ab638f00d6b93139ba4fcf", size = 239584, upload-time = "2026-07-07T14:34:20.52Z" }, + { url = "https://files.pythonhosted.org/packages/d4/ce/9af95f7876194bd7a14e3dfe4a4de2e0bff02666a3910d72beafd06cc297/charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:df115d4d83168fdf2cae48ef1ff6d1cb4c466364e30861b37121de0f3bf1b990", size = 230224, upload-time = "2026-07-07T14:34:22.189Z" }, + { url = "https://files.pythonhosted.org/packages/52/94/af74dde74a3996bd959c350709bfe50e297823d70a8c1cbd54b838880863/charset_normalizer-3.4.9-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:f86c6358749bd4fda175388691e3ba8c46e24c5347d0afd20f9b7edfc9faf07d", size = 212667, upload-time = "2026-07-07T14:34:23.857Z" }, + { url = "https://files.pythonhosted.org/packages/ee/f0/f1c4fe746c395922961b5916ed1d7d6e7d4c84851d19ed43cc89980ec953/charset_normalizer-3.4.9-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:32286a2c8d167e897177b673176c1e3e00d4057caf5d2b64eef9a3666b03018e", size = 227179, upload-time = "2026-07-07T14:34:25.586Z" }, + { url = "https://files.pythonhosted.org/packages/e4/56/6c745619ac397e8871e2bcd3cea1eec86b877488f33888b3aef5c3ed506e/charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:83aed2c10721ddd90f68140685391b50811a880af20654c59af6b6c66c40513c", size = 225372, upload-time = "2026-07-07T14:34:27.212Z" }, + { url = "https://files.pythonhosted.org/packages/78/ad/98aae8630ac71f16711968e38a5acfecce41b778bf2f0312851020f565a8/charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:cd6c3d4b783c556fa00bf540854e42f135e2f256abd29669fcd0da0f2dec79c2", size = 215222, upload-time = "2026-07-07T14:34:28.774Z" }, + { url = "https://files.pythonhosted.org/packages/f7/40/9593d54209765207a7f11073c06494c1721e4ca4a0a426c597679bf7f91e/charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ee2f2a527e3c1a6e6411eb4209642e138b544a2d72fe5d0d76daf77b24063534", size = 231958, upload-time = "2026-07-07T14:34:30.345Z" }, + { url = "https://files.pythonhosted.org/packages/b1/27/693ee5e8a18191eb38647360c51cd505013e2bd3b366aa43fd5344c21e3c/charset_normalizer-3.4.9-cp314-cp314t-win32.whl", hash = "sha256:0d861473f743244d349b50f850d10eb87aeb22bbdcc8e64f79273c94af5a8226", size = 155580, upload-time = "2026-07-07T14:34:31.884Z" }, + { url = "https://files.pythonhosted.org/packages/80/3f/bd97d3d9c613013d07cb7733d299385b41df37f0471310f5a73dc359f0b8/charset_normalizer-3.4.9-cp314-cp314t-win_amd64.whl", hash = "sha256:9b8e0f3107e2200b76f6054de99016eac3ee6762713587b36baaa7e4bd2ae177", size = 167620, upload-time = "2026-07-07T14:34:33.438Z" }, + { url = "https://files.pythonhosted.org/packages/3d/c6/eee9dca4439b1061f76373f06ea855678cc4a64c1c3c90b50e479edbb8eb/charset_normalizer-3.4.9-cp314-cp314t-win_arm64.whl", hash = "sha256:19ac87f93086ce37b86e098888555c4b4bc48102279bae3350098c0ed664b501", size = 158037, upload-time = "2026-07-07T14:34:35.018Z" }, + { url = "https://files.pythonhosted.org/packages/98/2b/f97f1c193fb855c345d678f5077d6926034db0722df74c8f057020e05a25/charset_normalizer-3.4.9-py3-none-any.whl", hash = "sha256:68e5f26a1ad57ded6d1cfb85331d1c1a195314756471d97758c48498bb4dcdf5", size = 64538, upload-time = "2026-07-07T14:34:56.993Z" }, +] + +[[package]] +name = "click" +version = "8.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/76/d4/81420972a676e8ffea40450d8c8c92943e7218a78fe9b64359836cc9876b/click-8.4.2.tar.gz", hash = "sha256:9a6cea6e60b17ebe0a44c5cc636d94f09bd66142c1cd7d8b4cd731c4917a15f6", size = 338000, upload-time = "2026-06-24T17:45:15.148Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/e2/79c688af8b210d232694e31e59da9f6ec747bae31c3f5946e4e9b98860d5/click-8.4.2-py3-none-any.whl", hash = "sha256:e6f9f66136c816745b9d65817da91d61d957fb16e02e4dcd0552553c5a197b76", size = 119243, upload-time = "2026-06-24T17:45:13.73Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "comm" +version = "0.2.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4c/13/7d740c5849255756bc17888787313b61fd38a0a8304fc4f073dfc46122aa/comm-0.2.3.tar.gz", hash = "sha256:2dc8048c10962d55d7ad693be1e7045d891b7ce8d999c97963a5e3e99c055971", size = 6319, upload-time = "2025-07-25T14:02:04.452Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/60/97/891a0971e1e4a8c5d2b20bbe0e524dc04548d2307fee33cdeba148fd4fc7/comm-0.2.3-py3-none-any.whl", hash = "sha256:c615d91d75f7f04f095b30d1c1711babd43bdc6419c1be9886a85f2f4e489417", size = 7294, upload-time = "2025-07-25T14:02:02.896Z" }, +] + +[[package]] +name = "debugpy" +version = "1.8.21" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f2/aa/12037145b7a56eaa5b29b41872f7a21b538e807e13f32c4d3c46e59be084/debugpy-1.8.21.tar.gz", hash = "sha256:a3c53278e84c94e11bd87c53970ec391d1a67396c8b22609fcac576520e611a6", size = 1697577, upload-time = "2026-06-01T19:30:35.156Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/df/bf625547431a9cadc9f4cbfeda38866e2b17f6aed147b625377e87834449/debugpy-1.8.21-cp312-cp312-macosx_15_0_universal2.whl", hash = "sha256:9f96713896f39c3dff0ee841f47320c3f2983d33c341e009361bb0ebc79adc4e", size = 2483609, upload-time = "2026-06-01T19:30:50.794Z" }, + { url = "https://files.pythonhosted.org/packages/bf/09/59324b903599031ff9faaec1758292409f6561a0ec2492fe4b703327705a/debugpy-1.8.21-cp312-cp312-manylinux_2_34_x86_64.whl", hash = "sha256:c193d474f0a211191f2b4449d2d06157c689013035bd952f3b617e0ef422b176", size = 3968900, upload-time = "2026-06-01T19:30:52.341Z" }, + { url = "https://files.pythonhosted.org/packages/14/cd/27f65b805d7fe005c44e1a36b9183ecdfbcdbf9d3e721a5115d461ecc7ee/debugpy-1.8.21-cp312-cp312-win32.whl", hash = "sha256:4743373c1cac7f9e74a1b9915bf1dbe0e900eca657ffb170ae07ac8363205ae9", size = 5336340, upload-time = "2026-06-01T19:30:54.047Z" }, + { url = "https://files.pythonhosted.org/packages/77/1d/c84e30c0c674184948b66f076ab271c01d940618a2824c23cd035a27bc20/debugpy-1.8.21-cp312-cp312-win_amd64.whl", hash = "sha256:bd7ba9dd3daa7c2f942c6ca8d4695a16bf9ac16b63615261c7982bc74f7ed20c", size = 5374751, upload-time = "2026-06-01T19:30:55.891Z" }, + { url = "https://files.pythonhosted.org/packages/77/6b/d817e1f8cc77aa055d37fba092e0febfdff40fe652d8d53d4cd7a86ad98d/debugpy-1.8.21-cp313-cp313-macosx_15_0_universal2.whl", hash = "sha256:13678151fc401e2d68c9880b91e28714f797d40422994572b24560ef80910a88", size = 2477398, upload-time = "2026-06-01T19:30:57.644Z" }, + { url = "https://files.pythonhosted.org/packages/48/57/412421516afc3055fa577516f00beec3d663f9b0ab330639547ae6c57720/debugpy-1.8.21-cp313-cp313-manylinux_2_34_x86_64.whl", hash = "sha256:ecbd158386c31ffe71d46f72d44d56e66331ab9b16cad649156d514368f23ab2", size = 3962096, upload-time = "2026-06-01T19:30:59.235Z" }, + { url = "https://files.pythonhosted.org/packages/c1/62/2c616337cf6ba7b07ebbc97f02c6c945a8e2f76b365e33ee809c32ee36d1/debugpy-1.8.21-cp313-cp313-win32.whl", hash = "sha256:2c2ae706dec41d99a9ca1f7ebc987a83e65578363be6f6b3ac9067504917fae1", size = 5336288, upload-time = "2026-06-01T19:31:00.79Z" }, + { url = "https://files.pythonhosted.org/packages/f8/99/9175103392f84c4b1bf7622888cdc68da07f0ff7d9e581266428f6776033/debugpy-1.8.21-cp313-cp313-win_amd64.whl", hash = "sha256:aa648733047443eb1d07682c4ef287d36a54507b643ffdf38b09a3ef002c72a0", size = 5376567, upload-time = "2026-06-01T19:31:02.56Z" }, + { url = "https://files.pythonhosted.org/packages/ce/3d/f4bbb323a548bfab2af3d6b4ffd9bf22636e55956a1285d317a1de643aad/debugpy-1.8.21-cp314-cp314-macosx_15_0_universal2.whl", hash = "sha256:9bb2a685287a2ac9b181cde89edcec64845cb51de7faaa75badb9a698bc24782", size = 2477209, upload-time = "2026-06-01T19:31:04.157Z" }, + { url = "https://files.pythonhosted.org/packages/8c/2d/6e7ec524984a1702777868de49a4c53202bddac2a432a76a093469587750/debugpy-1.8.21-cp314-cp314-manylinux_2_34_x86_64.whl", hash = "sha256:3d6922439bf33fd38a3e2c447869ebc7b97da5cd3d329ff1ef9bc06c4903437e", size = 3927115, upload-time = "2026-06-01T19:31:05.863Z" }, + { url = "https://files.pythonhosted.org/packages/97/47/d1aa6d64005a98a9144647d99306b419396f9ad7bf1d73c119e17a81fb4d/debugpy-1.8.21-cp314-cp314-win32.whl", hash = "sha256:15d4963bd5ffa48f0da0947fd06757fa7621945048a14ad7705431566d3c0e7c", size = 5336724, upload-time = "2026-06-01T19:31:07.711Z" }, + { url = "https://files.pythonhosted.org/packages/5f/67/b905b90d163af11878c1af8abafa4a25206335e112e284e413454543a6da/debugpy-1.8.21-cp314-cp314-win_amd64.whl", hash = "sha256:fe0744a12353406de0ae8ccff0d0a4a666f00801a3db8fd04e7a5f761cd520e8", size = 5373803, upload-time = "2026-06-01T19:31:09.469Z" }, + { url = "https://files.pythonhosted.org/packages/95/51/67e7cf11a53e40694f720457d5b3a1cdaaa3d5a9a633e482f225456b93ff/debugpy-1.8.21-py2.py3-none-any.whl", hash = "sha256:b1e37d333663c8851516a47364ef473da127f9caebe4417e6df6f5825a7e9a92", size = 5352888, upload-time = "2026-06-01T19:31:25.186Z" }, +] + +[[package]] +name = "donfig" +version = "0.8.1.post1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/25/71/80cc718ff6d7abfbabacb1f57aaa42e9c1552bfdd01e64ddd704e4a03638/donfig-0.8.1.post1.tar.gz", hash = "sha256:3bef3413a4c1c601b585e8d297256d0c1470ea012afa6e8461dc28bfb7c23f52", size = 19506, upload-time = "2024-05-23T14:14:31.513Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/d5/c5db1ea3394c6e1732fb3286b3bd878b59507a8f77d32a2cebda7d7b7cd4/donfig-0.8.1.post1-py3-none-any.whl", hash = "sha256:2a3175ce74a06109ff9307d90a230f81215cbac9a751f4d1c6194644b8204f9d", size = 21592, upload-time = "2024-05-23T14:13:55.283Z" }, +] + +[[package]] +name = "executing" +version = "2.2.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cc/28/c14e053b6762b1044f34a13aab6859bbf40456d37d23aa286ac24cfd9a5d/executing-2.2.1.tar.gz", hash = "sha256:3632cc370565f6648cc328b32435bd120a1e4ebb20c77e3fdde9a13cd1e533c4", size = 1129488, upload-time = "2025-09-01T09:48:10.866Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c1/ea/53f2148663b321f21b5a606bd5f191517cf40b7072c0497d3c92c4a13b1e/executing-2.2.1-py2.py3-none-any.whl", hash = "sha256:760643d3452b4d777d295bb167ccc74c64a81df23fb5e08eff250c425a4b2017", size = 28317, upload-time = "2025-09-01T09:48:08.5Z" }, +] + +[[package]] +name = "fastjsonschema" +version = "2.22.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e4/98/474719c58eddaf77fa443b063693e76d49db32bbe851bcbaf58d2700119f/fastjsonschema-2.22.1.tar.gz", hash = "sha256:0b83d1ce8d7845b959dcb20e1a5c3c8883b6541d9c52ab02cce5166b75ec805f", size = 382291, upload-time = "2026-07-27T13:31:08.515Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/17/e1/62cc96341f01bdff2ba967441939178fcd1900d11ce7e6554d9954a5d7ec/fastjsonschema-2.22.1-py3-none-any.whl", hash = "sha256:cf377ff5c9a6f4f3125fb35f75a2c5767bd824ffbcf62c209a93cd48d1453999", size = 26239, upload-time = "2026-07-27T13:31:03.251Z" }, +] + +[[package]] +name = "frozenlist" +version = "1.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/2d/f5/c831fac6cc817d26fd54c7eaccd04ef7e0288806943f7cc5bbf69f3ac1f0/frozenlist-1.8.0.tar.gz", hash = "sha256:3ede829ed8d842f6cd48fc7081d7a41001a56f1f38603f9d49bf3020d59a31ad", size = 45875, upload-time = "2025-10-06T05:38:17.865Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/69/29/948b9aa87e75820a38650af445d2ef2b6b8a6fab1a23b6bb9e4ef0be2d59/frozenlist-1.8.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:78f7b9e5d6f2fdb88cdde9440dc147259b62b9d3b019924def9f6478be254ac1", size = 87782, upload-time = "2025-10-06T05:36:06.649Z" }, + { url = "https://files.pythonhosted.org/packages/64/80/4f6e318ee2a7c0750ed724fa33a4bdf1eacdc5a39a7a24e818a773cd91af/frozenlist-1.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:229bf37d2e4acdaf808fd3f06e854a4a7a3661e871b10dc1f8f1896a3b05f18b", size = 50594, upload-time = "2025-10-06T05:36:07.69Z" }, + { url = "https://files.pythonhosted.org/packages/2b/94/5c8a2b50a496b11dd519f4a24cb5496cf125681dd99e94c604ccdea9419a/frozenlist-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f833670942247a14eafbb675458b4e61c82e002a148f49e68257b79296e865c4", size = 50448, upload-time = "2025-10-06T05:36:08.78Z" }, + { url = "https://files.pythonhosted.org/packages/6a/bd/d91c5e39f490a49df14320f4e8c80161cfcce09f1e2cde1edd16a551abb3/frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:494a5952b1c597ba44e0e78113a7266e656b9794eec897b19ead706bd7074383", size = 242411, upload-time = "2025-10-06T05:36:09.801Z" }, + { url = "https://files.pythonhosted.org/packages/8f/83/f61505a05109ef3293dfb1ff594d13d64a2324ac3482be2cedc2be818256/frozenlist-1.8.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96f423a119f4777a4a056b66ce11527366a8bb92f54e541ade21f2374433f6d4", size = 243014, upload-time = "2025-10-06T05:36:11.394Z" }, + { url = "https://files.pythonhosted.org/packages/d8/cb/cb6c7b0f7d4023ddda30cf56b8b17494eb3a79e3fda666bf735f63118b35/frozenlist-1.8.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3462dd9475af2025c31cc61be6652dfa25cbfb56cbbf52f4ccfe029f38decaf8", size = 234909, upload-time = "2025-10-06T05:36:12.598Z" }, + { url = "https://files.pythonhosted.org/packages/31/c5/cd7a1f3b8b34af009fb17d4123c5a778b44ae2804e3ad6b86204255f9ec5/frozenlist-1.8.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c4c800524c9cd9bac5166cd6f55285957fcfc907db323e193f2afcd4d9abd69b", size = 250049, upload-time = "2025-10-06T05:36:14.065Z" }, + { url = "https://files.pythonhosted.org/packages/c0/01/2f95d3b416c584a1e7f0e1d6d31998c4a795f7544069ee2e0962a4b60740/frozenlist-1.8.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d6a5df73acd3399d893dafc71663ad22534b5aa4f94e8a2fabfe856c3c1b6a52", size = 256485, upload-time = "2025-10-06T05:36:15.39Z" }, + { url = "https://files.pythonhosted.org/packages/ce/03/024bf7720b3abaebcff6d0793d73c154237b85bdf67b7ed55e5e9596dc9a/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:405e8fe955c2280ce66428b3ca55e12b3c4e9c336fb2103a4937e891c69a4a29", size = 237619, upload-time = "2025-10-06T05:36:16.558Z" }, + { url = "https://files.pythonhosted.org/packages/69/fa/f8abdfe7d76b731f5d8bd217827cf6764d4f1d9763407e42717b4bed50a0/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:908bd3f6439f2fef9e85031b59fd4f1297af54415fb60e4254a95f75b3cab3f3", size = 250320, upload-time = "2025-10-06T05:36:17.821Z" }, + { url = "https://files.pythonhosted.org/packages/f5/3c/b051329f718b463b22613e269ad72138cc256c540f78a6de89452803a47d/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:294e487f9ec720bd8ffcebc99d575f7eff3568a08a253d1ee1a0378754b74143", size = 246820, upload-time = "2025-10-06T05:36:19.046Z" }, + { url = "https://files.pythonhosted.org/packages/0f/ae/58282e8f98e444b3f4dd42448ff36fa38bef29e40d40f330b22e7108f565/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:74c51543498289c0c43656701be6b077f4b265868fa7f8a8859c197006efb608", size = 250518, upload-time = "2025-10-06T05:36:20.763Z" }, + { url = "https://files.pythonhosted.org/packages/8f/96/007e5944694d66123183845a106547a15944fbbb7154788cbf7272789536/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:776f352e8329135506a1d6bf16ac3f87bc25b28e765949282dcc627af36123aa", size = 239096, upload-time = "2025-10-06T05:36:22.129Z" }, + { url = "https://files.pythonhosted.org/packages/66/bb/852b9d6db2fa40be96f29c0d1205c306288f0684df8fd26ca1951d461a56/frozenlist-1.8.0-cp312-cp312-win32.whl", hash = "sha256:433403ae80709741ce34038da08511d4a77062aa924baf411ef73d1146e74faf", size = 39985, upload-time = "2025-10-06T05:36:23.661Z" }, + { url = "https://files.pythonhosted.org/packages/b8/af/38e51a553dd66eb064cdf193841f16f077585d4d28394c2fa6235cb41765/frozenlist-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:34187385b08f866104f0c0617404c8eb08165ab1272e884abc89c112e9c00746", size = 44591, upload-time = "2025-10-06T05:36:24.958Z" }, + { url = "https://files.pythonhosted.org/packages/a7/06/1dc65480ab147339fecc70797e9c2f69d9cea9cf38934ce08df070fdb9cb/frozenlist-1.8.0-cp312-cp312-win_arm64.whl", hash = "sha256:fe3c58d2f5db5fbd18c2987cba06d51b0529f52bc3a6cdc33d3f4eab725104bd", size = 40102, upload-time = "2025-10-06T05:36:26.333Z" }, + { url = "https://files.pythonhosted.org/packages/2d/40/0832c31a37d60f60ed79e9dfb5a92e1e2af4f40a16a29abcc7992af9edff/frozenlist-1.8.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8d92f1a84bb12d9e56f818b3a746f3efba93c1b63c8387a73dde655e1e42282a", size = 85717, upload-time = "2025-10-06T05:36:27.341Z" }, + { url = "https://files.pythonhosted.org/packages/30/ba/b0b3de23f40bc55a7057bd38434e25c34fa48e17f20ee273bbde5e0650f3/frozenlist-1.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:96153e77a591c8adc2ee805756c61f59fef4cf4073a9275ee86fe8cba41241f7", size = 49651, upload-time = "2025-10-06T05:36:28.855Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ab/6e5080ee374f875296c4243c381bbdef97a9ac39c6e3ce1d5f7d42cb78d6/frozenlist-1.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f21f00a91358803399890ab167098c131ec2ddd5f8f5fd5fe9c9f2c6fcd91e40", size = 49417, upload-time = "2025-10-06T05:36:29.877Z" }, + { url = "https://files.pythonhosted.org/packages/d5/4e/e4691508f9477ce67da2015d8c00acd751e6287739123113a9fca6f1604e/frozenlist-1.8.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fb30f9626572a76dfe4293c7194a09fb1fe93ba94c7d4f720dfae3b646b45027", size = 234391, upload-time = "2025-10-06T05:36:31.301Z" }, + { url = "https://files.pythonhosted.org/packages/40/76/c202df58e3acdf12969a7895fd6f3bc016c642e6726aa63bd3025e0fc71c/frozenlist-1.8.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eaa352d7047a31d87dafcacbabe89df0aa506abb5b1b85a2fb91bc3faa02d822", size = 233048, upload-time = "2025-10-06T05:36:32.531Z" }, + { url = "https://files.pythonhosted.org/packages/f9/c0/8746afb90f17b73ca5979c7a3958116e105ff796e718575175319b5bb4ce/frozenlist-1.8.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:03ae967b4e297f58f8c774c7eabcce57fe3c2434817d4385c50661845a058121", size = 226549, upload-time = "2025-10-06T05:36:33.706Z" }, + { url = "https://files.pythonhosted.org/packages/7e/eb/4c7eefc718ff72f9b6c4893291abaae5fbc0c82226a32dcd8ef4f7a5dbef/frozenlist-1.8.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f6292f1de555ffcc675941d65fffffb0a5bcd992905015f85d0592201793e0e5", size = 239833, upload-time = "2025-10-06T05:36:34.947Z" }, + { url = "https://files.pythonhosted.org/packages/c2/4e/e5c02187cf704224f8b21bee886f3d713ca379535f16893233b9d672ea71/frozenlist-1.8.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29548f9b5b5e3460ce7378144c3010363d8035cea44bc0bf02d57f5a685e084e", size = 245363, upload-time = "2025-10-06T05:36:36.534Z" }, + { url = "https://files.pythonhosted.org/packages/1f/96/cb85ec608464472e82ad37a17f844889c36100eed57bea094518bf270692/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ec3cc8c5d4084591b4237c0a272cc4f50a5b03396a47d9caaf76f5d7b38a4f11", size = 229314, upload-time = "2025-10-06T05:36:38.582Z" }, + { url = "https://files.pythonhosted.org/packages/5d/6f/4ae69c550e4cee66b57887daeebe006fe985917c01d0fff9caab9883f6d0/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:517279f58009d0b1f2e7c1b130b377a349405da3f7621ed6bfae50b10adf20c1", size = 243365, upload-time = "2025-10-06T05:36:40.152Z" }, + { url = "https://files.pythonhosted.org/packages/7a/58/afd56de246cf11780a40a2c28dc7cbabbf06337cc8ddb1c780a2d97e88d8/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:db1e72ede2d0d7ccb213f218df6a078a9c09a7de257c2fe8fcef16d5925230b1", size = 237763, upload-time = "2025-10-06T05:36:41.355Z" }, + { url = "https://files.pythonhosted.org/packages/cb/36/cdfaf6ed42e2644740d4a10452d8e97fa1c062e2a8006e4b09f1b5fd7d63/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b4dec9482a65c54a5044486847b8a66bf10c9cb4926d42927ec4e8fd5db7fed8", size = 240110, upload-time = "2025-10-06T05:36:42.716Z" }, + { url = "https://files.pythonhosted.org/packages/03/a8/9ea226fbefad669f11b52e864c55f0bd57d3c8d7eb07e9f2e9a0b39502e1/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:21900c48ae04d13d416f0e1e0c4d81f7931f73a9dfa0b7a8746fb2fe7dd970ed", size = 233717, upload-time = "2025-10-06T05:36:44.251Z" }, + { url = "https://files.pythonhosted.org/packages/1e/0b/1b5531611e83ba7d13ccc9988967ea1b51186af64c42b7a7af465dcc9568/frozenlist-1.8.0-cp313-cp313-win32.whl", hash = "sha256:8b7b94a067d1c504ee0b16def57ad5738701e4ba10cec90529f13fa03c833496", size = 39628, upload-time = "2025-10-06T05:36:45.423Z" }, + { url = "https://files.pythonhosted.org/packages/d8/cf/174c91dbc9cc49bc7b7aab74d8b734e974d1faa8f191c74af9b7e80848e6/frozenlist-1.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:878be833caa6a3821caf85eb39c5ba92d28e85df26d57afb06b35b2efd937231", size = 43882, upload-time = "2025-10-06T05:36:46.796Z" }, + { url = "https://files.pythonhosted.org/packages/c1/17/502cd212cbfa96eb1388614fe39a3fc9ab87dbbe042b66f97acb57474834/frozenlist-1.8.0-cp313-cp313-win_arm64.whl", hash = "sha256:44389d135b3ff43ba8cc89ff7f51f5a0bb6b63d829c8300f79a2fe4fe61bcc62", size = 39676, upload-time = "2025-10-06T05:36:47.8Z" }, + { url = "https://files.pythonhosted.org/packages/d2/5c/3bbfaa920dfab09e76946a5d2833a7cbdf7b9b4a91c714666ac4855b88b4/frozenlist-1.8.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:e25ac20a2ef37e91c1b39938b591457666a0fa835c7783c3a8f33ea42870db94", size = 89235, upload-time = "2025-10-06T05:36:48.78Z" }, + { url = "https://files.pythonhosted.org/packages/d2/d6/f03961ef72166cec1687e84e8925838442b615bd0b8854b54923ce5b7b8a/frozenlist-1.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:07cdca25a91a4386d2e76ad992916a85038a9b97561bf7a3fd12d5d9ce31870c", size = 50742, upload-time = "2025-10-06T05:36:49.837Z" }, + { url = "https://files.pythonhosted.org/packages/1e/bb/a6d12b7ba4c3337667d0e421f7181c82dda448ce4e7ad7ecd249a16fa806/frozenlist-1.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:4e0c11f2cc6717e0a741f84a527c52616140741cd812a50422f83dc31749fb52", size = 51725, upload-time = "2025-10-06T05:36:50.851Z" }, + { url = "https://files.pythonhosted.org/packages/bc/71/d1fed0ffe2c2ccd70b43714c6cab0f4188f09f8a67a7914a6b46ee30f274/frozenlist-1.8.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b3210649ee28062ea6099cfda39e147fa1bc039583c8ee4481cb7811e2448c51", size = 284533, upload-time = "2025-10-06T05:36:51.898Z" }, + { url = "https://files.pythonhosted.org/packages/c9/1f/fb1685a7b009d89f9bf78a42d94461bc06581f6e718c39344754a5d9bada/frozenlist-1.8.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:581ef5194c48035a7de2aefc72ac6539823bb71508189e5de01d60c9dcd5fa65", size = 292506, upload-time = "2025-10-06T05:36:53.101Z" }, + { url = "https://files.pythonhosted.org/packages/e6/3b/b991fe1612703f7e0d05c0cf734c1b77aaf7c7d321df4572e8d36e7048c8/frozenlist-1.8.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3ef2d026f16a2b1866e1d86fc4e1291e1ed8a387b2c333809419a2f8b3a77b82", size = 274161, upload-time = "2025-10-06T05:36:54.309Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ec/c5c618767bcdf66e88945ec0157d7f6c4a1322f1473392319b7a2501ded7/frozenlist-1.8.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5500ef82073f599ac84d888e3a8c1f77ac831183244bfd7f11eaa0289fb30714", size = 294676, upload-time = "2025-10-06T05:36:55.566Z" }, + { url = "https://files.pythonhosted.org/packages/7c/ce/3934758637d8f8a88d11f0585d6495ef54b2044ed6ec84492a91fa3b27aa/frozenlist-1.8.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:50066c3997d0091c411a66e710f4e11752251e6d2d73d70d8d5d4c76442a199d", size = 300638, upload-time = "2025-10-06T05:36:56.758Z" }, + { url = "https://files.pythonhosted.org/packages/fc/4f/a7e4d0d467298f42de4b41cbc7ddaf19d3cfeabaf9ff97c20c6c7ee409f9/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:5c1c8e78426e59b3f8005e9b19f6ff46e5845895adbde20ece9218319eca6506", size = 283067, upload-time = "2025-10-06T05:36:57.965Z" }, + { url = "https://files.pythonhosted.org/packages/dc/48/c7b163063d55a83772b268e6d1affb960771b0e203b632cfe09522d67ea5/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:eefdba20de0d938cec6a89bd4d70f346a03108a19b9df4248d3cf0d88f1b0f51", size = 292101, upload-time = "2025-10-06T05:36:59.237Z" }, + { url = "https://files.pythonhosted.org/packages/9f/d0/2366d3c4ecdc2fd391e0afa6e11500bfba0ea772764d631bbf82f0136c9d/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:cf253e0e1c3ceb4aaff6df637ce033ff6535fb8c70a764a8f46aafd3d6ab798e", size = 289901, upload-time = "2025-10-06T05:37:00.811Z" }, + { url = "https://files.pythonhosted.org/packages/b8/94/daff920e82c1b70e3618a2ac39fbc01ae3e2ff6124e80739ce5d71c9b920/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:032efa2674356903cd0261c4317a561a6850f3ac864a63fc1583147fb05a79b0", size = 289395, upload-time = "2025-10-06T05:37:02.115Z" }, + { url = "https://files.pythonhosted.org/packages/e3/20/bba307ab4235a09fdcd3cc5508dbabd17c4634a1af4b96e0f69bfe551ebd/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6da155091429aeba16851ecb10a9104a108bcd32f6c1642867eadaee401c1c41", size = 283659, upload-time = "2025-10-06T05:37:03.711Z" }, + { url = "https://files.pythonhosted.org/packages/fd/00/04ca1c3a7a124b6de4f8a9a17cc2fcad138b4608e7a3fc5877804b8715d7/frozenlist-1.8.0-cp313-cp313t-win32.whl", hash = "sha256:0f96534f8bfebc1a394209427d0f8a63d343c9779cda6fc25e8e121b5fd8555b", size = 43492, upload-time = "2025-10-06T05:37:04.915Z" }, + { url = "https://files.pythonhosted.org/packages/59/5e/c69f733a86a94ab10f68e496dc6b7e8bc078ebb415281d5698313e3af3a1/frozenlist-1.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:5d63a068f978fc69421fb0e6eb91a9603187527c86b7cd3f534a5b77a592b888", size = 48034, upload-time = "2025-10-06T05:37:06.343Z" }, + { url = "https://files.pythonhosted.org/packages/16/6c/be9d79775d8abe79b05fa6d23da99ad6e7763a1d080fbae7290b286093fd/frozenlist-1.8.0-cp313-cp313t-win_arm64.whl", hash = "sha256:bf0a7e10b077bf5fb9380ad3ae8ce20ef919a6ad93b4552896419ac7e1d8e042", size = 41749, upload-time = "2025-10-06T05:37:07.431Z" }, + { url = "https://files.pythonhosted.org/packages/f1/c8/85da824b7e7b9b6e7f7705b2ecaf9591ba6f79c1177f324c2735e41d36a2/frozenlist-1.8.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:cee686f1f4cadeb2136007ddedd0aaf928ab95216e7691c63e50a8ec066336d0", size = 86127, upload-time = "2025-10-06T05:37:08.438Z" }, + { url = "https://files.pythonhosted.org/packages/8e/e8/a1185e236ec66c20afd72399522f142c3724c785789255202d27ae992818/frozenlist-1.8.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:119fb2a1bd47307e899c2fac7f28e85b9a543864df47aa7ec9d3c1b4545f096f", size = 49698, upload-time = "2025-10-06T05:37:09.48Z" }, + { url = "https://files.pythonhosted.org/packages/a1/93/72b1736d68f03fda5fdf0f2180fb6caaae3894f1b854d006ac61ecc727ee/frozenlist-1.8.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4970ece02dbc8c3a92fcc5228e36a3e933a01a999f7094ff7c23fbd2beeaa67c", size = 49749, upload-time = "2025-10-06T05:37:10.569Z" }, + { url = "https://files.pythonhosted.org/packages/a7/b2/fabede9fafd976b991e9f1b9c8c873ed86f202889b864756f240ce6dd855/frozenlist-1.8.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:cba69cb73723c3f329622e34bdbf5ce1f80c21c290ff04256cff1cd3c2036ed2", size = 231298, upload-time = "2025-10-06T05:37:11.993Z" }, + { url = "https://files.pythonhosted.org/packages/3a/3b/d9b1e0b0eed36e70477ffb8360c49c85c8ca8ef9700a4e6711f39a6e8b45/frozenlist-1.8.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:778a11b15673f6f1df23d9586f83c4846c471a8af693a22e066508b77d201ec8", size = 232015, upload-time = "2025-10-06T05:37:13.194Z" }, + { url = "https://files.pythonhosted.org/packages/dc/94/be719d2766c1138148564a3960fc2c06eb688da592bdc25adcf856101be7/frozenlist-1.8.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0325024fe97f94c41c08872db482cf8ac4800d80e79222c6b0b7b162d5b13686", size = 225038, upload-time = "2025-10-06T05:37:14.577Z" }, + { url = "https://files.pythonhosted.org/packages/e4/09/6712b6c5465f083f52f50cf74167b92d4ea2f50e46a9eea0523d658454ae/frozenlist-1.8.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:97260ff46b207a82a7567b581ab4190bd4dfa09f4db8a8b49d1a958f6aa4940e", size = 240130, upload-time = "2025-10-06T05:37:15.781Z" }, + { url = "https://files.pythonhosted.org/packages/f8/d4/cd065cdcf21550b54f3ce6a22e143ac9e4836ca42a0de1022da8498eac89/frozenlist-1.8.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:54b2077180eb7f83dd52c40b2750d0a9f175e06a42e3213ce047219de902717a", size = 242845, upload-time = "2025-10-06T05:37:17.037Z" }, + { url = "https://files.pythonhosted.org/packages/62/c3/f57a5c8c70cd1ead3d5d5f776f89d33110b1addae0ab010ad774d9a44fb9/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:2f05983daecab868a31e1da44462873306d3cbfd76d1f0b5b69c473d21dbb128", size = 229131, upload-time = "2025-10-06T05:37:18.221Z" }, + { url = "https://files.pythonhosted.org/packages/6c/52/232476fe9cb64f0742f3fde2b7d26c1dac18b6d62071c74d4ded55e0ef94/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:33f48f51a446114bc5d251fb2954ab0164d5be02ad3382abcbfe07e2531d650f", size = 240542, upload-time = "2025-10-06T05:37:19.771Z" }, + { url = "https://files.pythonhosted.org/packages/5f/85/07bf3f5d0fb5414aee5f47d33c6f5c77bfe49aac680bfece33d4fdf6a246/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:154e55ec0655291b5dd1b8731c637ecdb50975a2ae70c606d100750a540082f7", size = 237308, upload-time = "2025-10-06T05:37:20.969Z" }, + { url = "https://files.pythonhosted.org/packages/11/99/ae3a33d5befd41ac0ca2cc7fd3aa707c9c324de2e89db0e0f45db9a64c26/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:4314debad13beb564b708b4a496020e5306c7333fa9a3ab90374169a20ffab30", size = 238210, upload-time = "2025-10-06T05:37:22.252Z" }, + { url = "https://files.pythonhosted.org/packages/b2/60/b1d2da22f4970e7a155f0adde9b1435712ece01b3cd45ba63702aea33938/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:073f8bf8becba60aa931eb3bc420b217bb7d5b8f4750e6f8b3be7f3da85d38b7", size = 231972, upload-time = "2025-10-06T05:37:23.5Z" }, + { url = "https://files.pythonhosted.org/packages/3f/ab/945b2f32de889993b9c9133216c068b7fcf257d8595a0ac420ac8677cab0/frozenlist-1.8.0-cp314-cp314-win32.whl", hash = "sha256:bac9c42ba2ac65ddc115d930c78d24ab8d4f465fd3fc473cdedfccadb9429806", size = 40536, upload-time = "2025-10-06T05:37:25.581Z" }, + { url = "https://files.pythonhosted.org/packages/59/ad/9caa9b9c836d9ad6f067157a531ac48b7d36499f5036d4141ce78c230b1b/frozenlist-1.8.0-cp314-cp314-win_amd64.whl", hash = "sha256:3e0761f4d1a44f1d1a47996511752cf3dcec5bbdd9cc2b4fe595caf97754b7a0", size = 44330, upload-time = "2025-10-06T05:37:26.928Z" }, + { url = "https://files.pythonhosted.org/packages/82/13/e6950121764f2676f43534c555249f57030150260aee9dcf7d64efda11dd/frozenlist-1.8.0-cp314-cp314-win_arm64.whl", hash = "sha256:d1eaff1d00c7751b7c6662e9c5ba6eb2c17a2306ba5e2a37f24ddf3cc953402b", size = 40627, upload-time = "2025-10-06T05:37:28.075Z" }, + { url = "https://files.pythonhosted.org/packages/c0/c7/43200656ecc4e02d3f8bc248df68256cd9572b3f0017f0a0c4e93440ae23/frozenlist-1.8.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:d3bb933317c52d7ea5004a1c442eef86f426886fba134ef8cf4226ea6ee1821d", size = 89238, upload-time = "2025-10-06T05:37:29.373Z" }, + { url = "https://files.pythonhosted.org/packages/d1/29/55c5f0689b9c0fb765055629f472c0de484dcaf0acee2f7707266ae3583c/frozenlist-1.8.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:8009897cdef112072f93a0efdce29cd819e717fd2f649ee3016efd3cd885a7ed", size = 50738, upload-time = "2025-10-06T05:37:30.792Z" }, + { url = "https://files.pythonhosted.org/packages/ba/7d/b7282a445956506fa11da8c2db7d276adcbf2b17d8bb8407a47685263f90/frozenlist-1.8.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2c5dcbbc55383e5883246d11fd179782a9d07a986c40f49abe89ddf865913930", size = 51739, upload-time = "2025-10-06T05:37:32.127Z" }, + { url = "https://files.pythonhosted.org/packages/62/1c/3d8622e60d0b767a5510d1d3cf21065b9db874696a51ea6d7a43180a259c/frozenlist-1.8.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:39ecbc32f1390387d2aa4f5a995e465e9e2f79ba3adcac92d68e3e0afae6657c", size = 284186, upload-time = "2025-10-06T05:37:33.21Z" }, + { url = "https://files.pythonhosted.org/packages/2d/14/aa36d5f85a89679a85a1d44cd7a6657e0b1c75f61e7cad987b203d2daca8/frozenlist-1.8.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:92db2bf818d5cc8d9c1f1fc56b897662e24ea5adb36ad1f1d82875bd64e03c24", size = 292196, upload-time = "2025-10-06T05:37:36.107Z" }, + { url = "https://files.pythonhosted.org/packages/05/23/6bde59eb55abd407d34f77d39a5126fb7b4f109a3f611d3929f14b700c66/frozenlist-1.8.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2dc43a022e555de94c3b68a4ef0b11c4f747d12c024a520c7101709a2144fb37", size = 273830, upload-time = "2025-10-06T05:37:37.663Z" }, + { url = "https://files.pythonhosted.org/packages/d2/3f/22cff331bfad7a8afa616289000ba793347fcd7bc275f3b28ecea2a27909/frozenlist-1.8.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cb89a7f2de3602cfed448095bab3f178399646ab7c61454315089787df07733a", size = 294289, upload-time = "2025-10-06T05:37:39.261Z" }, + { url = "https://files.pythonhosted.org/packages/a4/89/5b057c799de4838b6c69aa82b79705f2027615e01be996d2486a69ca99c4/frozenlist-1.8.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:33139dc858c580ea50e7e60a1b0ea003efa1fd42e6ec7fdbad78fff65fad2fd2", size = 300318, upload-time = "2025-10-06T05:37:43.213Z" }, + { url = "https://files.pythonhosted.org/packages/30/de/2c22ab3eb2a8af6d69dc799e48455813bab3690c760de58e1bf43b36da3e/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:168c0969a329b416119507ba30b9ea13688fafffac1b7822802537569a1cb0ef", size = 282814, upload-time = "2025-10-06T05:37:45.337Z" }, + { url = "https://files.pythonhosted.org/packages/59/f7/970141a6a8dbd7f556d94977858cfb36fa9b66e0892c6dd780d2219d8cd8/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:28bd570e8e189d7f7b001966435f9dac6718324b5be2990ac496cf1ea9ddb7fe", size = 291762, upload-time = "2025-10-06T05:37:46.657Z" }, + { url = "https://files.pythonhosted.org/packages/c1/15/ca1adae83a719f82df9116d66f5bb28bb95557b3951903d39135620ef157/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b2a095d45c5d46e5e79ba1e5b9cb787f541a8dee0433836cea4b96a2c439dcd8", size = 289470, upload-time = "2025-10-06T05:37:47.946Z" }, + { url = "https://files.pythonhosted.org/packages/ac/83/dca6dc53bf657d371fbc88ddeb21b79891e747189c5de990b9dfff2ccba1/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:eab8145831a0d56ec9c4139b6c3e594c7a83c2c8be25d5bcf2d86136a532287a", size = 289042, upload-time = "2025-10-06T05:37:49.499Z" }, + { url = "https://files.pythonhosted.org/packages/96/52/abddd34ca99be142f354398700536c5bd315880ed0a213812bc491cff5e4/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:974b28cf63cc99dfb2188d8d222bc6843656188164848c4f679e63dae4b0708e", size = 283148, upload-time = "2025-10-06T05:37:50.745Z" }, + { url = "https://files.pythonhosted.org/packages/af/d3/76bd4ed4317e7119c2b7f57c3f6934aba26d277acc6309f873341640e21f/frozenlist-1.8.0-cp314-cp314t-win32.whl", hash = "sha256:342c97bf697ac5480c0a7ec73cd700ecfa5a8a40ac923bd035484616efecc2df", size = 44676, upload-time = "2025-10-06T05:37:52.222Z" }, + { url = "https://files.pythonhosted.org/packages/89/76/c615883b7b521ead2944bb3480398cbb07e12b7b4e4d073d3752eb721558/frozenlist-1.8.0-cp314-cp314t-win_amd64.whl", hash = "sha256:06be8f67f39c8b1dc671f5d83aaefd3358ae5cdcf8314552c57e7ed3e6475bdd", size = 49451, upload-time = "2025-10-06T05:37:53.425Z" }, + { url = "https://files.pythonhosted.org/packages/e0/a3/5982da14e113d07b325230f95060e2169f5311b1017ea8af2a29b374c289/frozenlist-1.8.0-cp314-cp314t-win_arm64.whl", hash = "sha256:102e6314ca4da683dca92e3b1355490fed5f313b768500084fbe6371fddfdb79", size = 42507, upload-time = "2025-10-06T05:37:54.513Z" }, + { url = "https://files.pythonhosted.org/packages/9a/9a/e35b4a917281c0b8419d4207f4334c8e8c5dbf4f3f5f9ada73958d937dcc/frozenlist-1.8.0-py3-none-any.whl", hash = "sha256:0c18a16eab41e82c295618a77502e17b195883241c563b00f0aa5106fc4eaa0d", size = 13409, upload-time = "2025-10-06T05:38:16.721Z" }, +] + +[[package]] +name = "fsspec" +version = "2026.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/00/78/f34251dadb8f3921264a1d9b8946f5e542014ee2614b285261b4e40e6775/fsspec-2026.7.0.tar.gz", hash = "sha256:c803c40f4cf860b49dea58ee3e1c33cb9c790520e233537e1340049f89b82a88", size = 317040, upload-time = "2026-07-28T16:34:51.052Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fd/3c/6a2bf344106328fd04963664a60b9bb6496fc25df8e962fcdc1367285fb9/fsspec-2026.7.0-py3-none-any.whl", hash = "sha256:b57ddbafedfaef7018c1ecab32aa200a9d7ca26b77965f64e48b70061249d279", size = 206583, upload-time = "2026-07-28T16:34:49.538Z" }, +] + +[package.optional-dependencies] +http = [ + { name = "aiohttp" }, +] + +[[package]] +name = "ghp-import" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "python-dateutil" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d9/29/d40217cbe2f6b1359e00c6c307bb3fc876ba74068cbab3dde77f03ca0dc4/ghp-import-2.1.0.tar.gz", hash = "sha256:9c535c4c61193c2df8871222567d7fd7e5014d835f97dc7b7439069e2413d343", size = 10943, upload-time = "2022-05-02T15:47:16.11Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f7/ec/67fbef5d497f86283db54c22eec6f6140243aae73265799baaaa19cd17fb/ghp_import-2.1.0-py3-none-any.whl", hash = "sha256:8337dd7b50877f163d4c0289bc1f1c7f127550241988d568c1db512c4324a619", size = 11034, upload-time = "2022-05-02T15:47:14.552Z" }, +] + +[[package]] +name = "google-crc32c" +version = "1.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/03/41/4b9c02f99e4c5fb477122cd5437403b552873f014616ac1d19ac8221a58d/google_crc32c-1.8.0.tar.gz", hash = "sha256:a428e25fb7691024de47fecfbff7ff957214da51eddded0da0ae0e0f03a2cf79", size = 14192, upload-time = "2025-12-16T00:35:25.142Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e9/5f/7307325b1198b59324c0fa9807cafb551afb65e831699f2ce211ad5c8240/google_crc32c-1.8.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:4b8286b659c1335172e39563ab0a768b8015e88e08329fa5321f774275fc3113", size = 31300, upload-time = "2025-12-16T00:21:56.723Z" }, + { url = "https://files.pythonhosted.org/packages/21/8e/58c0d5d86e2220e6a37befe7e6a94dd2f6006044b1a33edf1ff6d9f7e319/google_crc32c-1.8.0-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:2a3dc3318507de089c5384cc74d54318401410f82aa65b2d9cdde9d297aca7cb", size = 30867, upload-time = "2025-12-16T00:38:31.302Z" }, + { url = "https://files.pythonhosted.org/packages/ce/a9/a780cc66f86335a6019f557a8aaca8fbb970728f0efd2430d15ff1beae0e/google_crc32c-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:14f87e04d613dfa218d6135e81b78272c3b904e2a7053b841481b38a7d901411", size = 33364, upload-time = "2025-12-16T00:40:22.96Z" }, + { url = "https://files.pythonhosted.org/packages/21/3f/3457ea803db0198c9aaca2dd373750972ce28a26f00544b6b85088811939/google_crc32c-1.8.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cb5c869c2923d56cb0c8e6bcdd73c009c36ae39b652dbe46a05eb4ef0ad01454", size = 33740, upload-time = "2025-12-16T00:40:23.96Z" }, + { url = "https://files.pythonhosted.org/packages/df/c0/87c2073e0c72515bb8733d4eef7b21548e8d189f094b5dad20b0ecaf64f6/google_crc32c-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:3cc0c8912038065eafa603b238abf252e204accab2a704c63b9e14837a854962", size = 34437, upload-time = "2025-12-16T00:35:21.395Z" }, + { url = "https://files.pythonhosted.org/packages/d1/db/000f15b41724589b0e7bc24bc7a8967898d8d3bc8caf64c513d91ef1f6c0/google_crc32c-1.8.0-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:3ebb04528e83b2634857f43f9bb8ef5b2bbe7f10f140daeb01b58f972d04736b", size = 31297, upload-time = "2025-12-16T00:23:20.709Z" }, + { url = "https://files.pythonhosted.org/packages/d7/0d/8ebed0c39c53a7e838e2a486da8abb0e52de135f1b376ae2f0b160eb4c1a/google_crc32c-1.8.0-cp313-cp313-macosx_12_0_x86_64.whl", hash = "sha256:450dc98429d3e33ed2926fc99ee81001928d63460f8538f21a5d6060912a8e27", size = 30867, upload-time = "2025-12-16T00:43:14.628Z" }, + { url = "https://files.pythonhosted.org/packages/ce/42/b468aec74a0354b34c8cbf748db20d6e350a68a2b0912e128cabee49806c/google_crc32c-1.8.0-cp313-cp313-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:3b9776774b24ba76831609ffbabce8cdf6fa2bd5e9df37b594221c7e333a81fa", size = 33344, upload-time = "2025-12-16T00:40:24.742Z" }, + { url = "https://files.pythonhosted.org/packages/1c/e8/b33784d6fc77fb5062a8a7854e43e1e618b87d5ddf610a88025e4de6226e/google_crc32c-1.8.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:89c17d53d75562edfff86679244830599ee0a48efc216200691de8b02ab6b2b8", size = 33694, upload-time = "2025-12-16T00:40:25.505Z" }, + { url = "https://files.pythonhosted.org/packages/92/b1/d3cbd4d988afb3d8e4db94ca953df429ed6db7282ed0e700d25e6c7bfc8d/google_crc32c-1.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:57a50a9035b75643996fbf224d6661e386c7162d1dfdab9bc4ca790947d1007f", size = 34435, upload-time = "2025-12-16T00:35:22.107Z" }, + { url = "https://files.pythonhosted.org/packages/21/88/8ecf3c2b864a490b9e7010c84fd203ec8cf3b280651106a3a74dd1b0ca72/google_crc32c-1.8.0-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:e6584b12cb06796d285d09e33f63309a09368b9d806a551d8036a4207ea43697", size = 31301, upload-time = "2025-12-16T00:24:48.527Z" }, + { url = "https://files.pythonhosted.org/packages/36/c6/f7ff6c11f5ca215d9f43d3629163727a272eabc356e5c9b2853df2bfe965/google_crc32c-1.8.0-cp314-cp314-macosx_12_0_x86_64.whl", hash = "sha256:f4b51844ef67d6cf2e9425983274da75f18b1597bb2c998e1c0a0e8d46f8f651", size = 30868, upload-time = "2025-12-16T00:48:12.163Z" }, + { url = "https://files.pythonhosted.org/packages/56/15/c25671c7aad70f8179d858c55a6ae8404902abe0cdcf32a29d581792b491/google_crc32c-1.8.0-cp314-cp314-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b0d1a7afc6e8e4635564ba8aa5c0548e3173e41b6384d7711a9123165f582de2", size = 33381, upload-time = "2025-12-16T00:40:26.268Z" }, + { url = "https://files.pythonhosted.org/packages/42/fa/f50f51260d7b0ef5d4898af122d8a7ec5a84e2984f676f746445f783705f/google_crc32c-1.8.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8b3f68782f3cbd1bce027e48768293072813469af6a61a86f6bb4977a4380f21", size = 33734, upload-time = "2025-12-16T00:40:27.028Z" }, + { url = "https://files.pythonhosted.org/packages/08/a5/7b059810934a09fb3ccb657e0843813c1fee1183d3bc2c8041800374aa2c/google_crc32c-1.8.0-cp314-cp314-win_amd64.whl", hash = "sha256:d511b3153e7011a27ab6ee6bb3a5404a55b994dc1a7322c0b87b29606d9790e2", size = 34878, upload-time = "2025-12-16T00:35:23.142Z" }, +] + +[[package]] +name = "griffe-inherited-docstrings" +version = "1.1.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "griffelib" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cb/da/fd002dc5f215cd896bfccaebe8b4aa1cdeed8ea1d9d60633685bd61ff933/griffe_inherited_docstrings-1.1.3.tar.gz", hash = "sha256:cd1f937ec9336a790e5425e7f9b92f5a5ab17f292ba86917f1c681c0704cb64e", size = 26738, upload-time = "2026-02-21T09:38:44.312Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/16/20/4bc15f242181daad1c104e0a7d33be49e712461ea89e548152be0365b9ea/griffe_inherited_docstrings-1.1.3-py3-none-any.whl", hash = "sha256:aa7f6e624515c50d9325a5cfdf4b2acac547f1889aca89092d5da7278f739695", size = 6710, upload-time = "2026-02-20T11:06:38.75Z" }, +] + +[[package]] +name = "griffelib" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/33/e4/8d187ea29c2e30b3a09505c567513077d6117861bde1fbd997a167f262ec/griffelib-2.1.0.tar.gz", hash = "sha256:762a186d2c6fd6794d4ea20d428d597ffb857cb56b66421651cbba15bdd5e813", size = 216234, upload-time = "2026-06-19T12:05:42.278Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e4/d3/5268aeabf2ad82658c4e2ff3a060648d0f02f3926cb53247c0e4d0dab49e/griffelib-2.1.0-py3-none-any.whl", hash = "sha256:cc7b3d2d2865ad0b909fcc38086e3f554b5ea7acbaa7bbb7ecaa3f5dfb7d9f00", size = 142560, upload-time = "2026-06-19T12:05:38.742Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpcore2" +version = "2.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "h11" }, + { name = "truststore" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/39/a8/20ed1ed79cbc2ecdf5301c0968ab7c85547212e2a7bd126ddd2d986e206e/httpcore2-2.9.1.tar.gz", hash = "sha256:4d8acbf8b306f48c9d6046591fd5ba4037d1b1b1000d140fc2c3eab1e9a0c0e2", size = 67089, upload-time = "2026-07-24T09:21:03.867Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9f/fb/46c52b781975c335a2bcf1072c7bbc007cbdc8d674217f5ee1daba2c848b/httpcore2-2.9.1-py3-none-any.whl", hash = "sha256:6182472379e855fe4221246a2bb7ecede403bc61c6798062ae1787d051ccde26", size = 82809, upload-time = "2026-07-24T09:21:01.178Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "httpx2" +version = "2.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpcore2" }, + { name = "idna" }, + { name = "truststore" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/21/14/38128fbafd7e0ed41d874df6c9a653d47c2d111cfe59e2b4ac95161b4abd/httpx2-2.9.1.tar.gz", hash = "sha256:1932a768737e3666291582833da748cc4e563c337cf96706fccc04fa6e58764a", size = 95458, upload-time = "2026-07-24T09:21:04.972Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/13/b8/cfd91c4ab9134d386d48f0b6ac662ff3d4be6efdee59ee1c67ebc3c0487c/httpx2-2.9.1-py3-none-any.whl", hash = "sha256:1820fe14a9ab1107bfeff39259987429450b070ec0ff38cc87eb0d8c97fdc71a", size = 91191, upload-time = "2026-07-24T09:21:02.6Z" }, +] + +[[package]] +name = "hypothesis" +version = "6.165.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "sortedcontainers" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/18/7a/7a277ac07776191be594f74f6425649d529e4876f7d3ff1ee96d393ffdbc/hypothesis-6.165.3.tar.gz", hash = "sha256:687c5abb1a9c11478577c2cf18685c0eb82150d278477d3e14da290a1ef2a098", size = 502263, upload-time = "2026-08-11T01:23:09.1Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f9/c7/18152acad5f85f91554b2030000319b952a54151509953651ec40f37d50d/hypothesis-6.165.3-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:56af539c811b11ab5475704c300b8f0b46cc6dd0edc267e02a16487e803c77f8", size = 781671, upload-time = "2026-08-11T01:22:09.176Z" }, + { url = "https://files.pythonhosted.org/packages/d3/77/4293ea8a7fdb713956a8bf460b9070115df69f8216a900507633f9cdb225/hypothesis-6.165.3-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:f40c10cfdb1ea2cd75e5d4e6e0cfdcb6198ab8406e8922666480e6dc11eea341", size = 777291, upload-time = "2026-08-11T01:22:15.991Z" }, + { url = "https://files.pythonhosted.org/packages/02/fa/fa2071a6afaefc082dc7a033f41ae61436caf442d5973ba8ca9c29a69460/hypothesis-6.165.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a0854b1de4577f7e1beb1d681360285b5d678b65a809787ff4eab5b8b25efca", size = 1106490, upload-time = "2026-08-11T01:22:07.858Z" }, + { url = "https://files.pythonhosted.org/packages/ba/86/de724b7f9cd10e3be4efa21770457172e549d7576b1d8e29d6177eef5e47/hypothesis-6.165.3-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:360991cda8e488924905af48949033b90d4877ac97b9ad5d826d4d0f5a4b8cfb", size = 1135054, upload-time = "2026-08-11T01:22:29.499Z" }, + { url = "https://files.pythonhosted.org/packages/12/6a/96721cf447bd3c64b5e6843dde4444b20f3ddd901ad366cc73d0e7314bf5/hypothesis-6.165.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf502000f4a8ef4c9ab9493ca3b4fe17ae3033c18a8e2a31cdd69515dc7d97be", size = 1155997, upload-time = "2026-08-11T01:21:48.496Z" }, + { url = "https://files.pythonhosted.org/packages/0f/ae/a793cce6497f233b155f97684bf7d0e424c25613dd87b8af8a4e87820232/hypothesis-6.165.3-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:b9fcf47ad18f87f7c15bd36289bd45708bbfd250129d73bf554653e2f9afc931", size = 1111326, upload-time = "2026-08-11T01:22:21.9Z" }, + { url = "https://files.pythonhosted.org/packages/28/8d/dc3cdfd55843d038effa2458a9c9bd73002218a8c0fd58c2c0ab7fa328db/hypothesis-6.165.3-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2fb05529cbcab5a317d03d7bb0e90d382f79ef1643e3568577916d0e24bfe70b", size = 1148079, upload-time = "2026-08-11T01:21:51.071Z" }, + { url = "https://files.pythonhosted.org/packages/db/4b/2f62924ac41f3d3482b29ded4c213f27ff4a103e56e84eeb528d4900cac7/hypothesis-6.165.3-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:57eae10a64340cd621a78eae9cb0459bd68ea99fbaa933c4f00e34d5087b6376", size = 1281862, upload-time = "2026-08-11T01:21:39.274Z" }, + { url = "https://files.pythonhosted.org/packages/7e/d4/01c78b7b7348b6e8cef9b999109dfb93b14c7e1e38bc22170129f8b17181/hypothesis-6.165.3-cp310-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:19df0f2239052e9a870634a1d9bcdff95e2a2ab508573e5dd5c3d1ca545f5b3c", size = 1408437, upload-time = "2026-08-11T01:22:13.243Z" }, + { url = "https://files.pythonhosted.org/packages/35/76/e940b5a5aaf75bcd4784f1f3f9bf2b9a642a706bc0a9639077ca84f1325f/hypothesis-6.165.3-cp310-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:9781a8026adff4b4516404cf0e5f2cadcb471318c2882a264e1c57c4c092266f", size = 1281168, upload-time = "2026-08-11T01:21:58.964Z" }, + { url = "https://files.pythonhosted.org/packages/fc/84/b153e81a614f45e0902e3b9e8a8b079e64214c50abb6fbe9acc62ccf686d/hypothesis-6.165.3-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:1dd7e05f88e3e108a5e4f5f71a3eaf205559e8951e3c1f1ffd04cea82ed3b731", size = 1323263, upload-time = "2026-08-11T01:21:52.374Z" }, + { url = "https://files.pythonhosted.org/packages/fb/5f/e5144d9e91ab7260650cb1ee032ca23208d49ebb1334845baf6407c1a9d9/hypothesis-6.165.3-cp310-abi3-win32.whl", hash = "sha256:d1389bda38cb222acc109aef5b31643ce799a39a76294a50ad8b84e32f92d76d", size = 667499, upload-time = "2026-08-11T01:21:47.36Z" }, + { url = "https://files.pythonhosted.org/packages/a9/18/f008b6f1f1c293d51c2776f8815d95bccb777dcf87df2a0ab56b273b47dc/hypothesis-6.165.3-cp310-abi3-win_amd64.whl", hash = "sha256:10cda6988ca4b1da389548b6fdd71af236b588a601fc1757e56eb8988e4240d8", size = 673643, upload-time = "2026-08-11T01:22:46.975Z" }, + { url = "https://files.pythonhosted.org/packages/e2/3d/e7eade134bd7f57d4071d82ae84691bc3017fe6945af0bb149578ba8b565/hypothesis-6.165.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f88fe4915f8dd4f8999a197f9e22c3a7177042aa994d35c0c7c7b22541d2885b", size = 783298, upload-time = "2026-08-11T01:22:14.706Z" }, + { url = "https://files.pythonhosted.org/packages/d6/a5/668810f493feaf886a9240ad689792fb32450667c8e5770c3bcaa7fabeac/hypothesis-6.165.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c7d9f6c36b812f6069c7436492e12812cf541391954e21d5bd7fcafc9fb46700", size = 774856, upload-time = "2026-08-11T01:22:35.836Z" }, + { url = "https://files.pythonhosted.org/packages/e4/a0/0af93a70f5128763079ab714277ccad4a7de42d442d67dd43e3029178162/hypothesis-6.165.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:423ca8e30087bb41db7e6f47dbf98690a2155241b9f1057e366dc138d7dcc4fe", size = 1105274, upload-time = "2026-08-11T01:23:03.591Z" }, + { url = "https://files.pythonhosted.org/packages/7b/00/ddcdc99beee469573addf5cfcd817c9a20a71832b1ca88404b6d3f99c44c/hypothesis-6.165.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c58c66f3e1b8d4091bb52664d5af4b0c1715293c6822d5344b166494534cd498", size = 1155379, upload-time = "2026-08-11T01:22:23.371Z" }, + { url = "https://files.pythonhosted.org/packages/de/10/d574b21e63f16a1cad9c0cf4592aa170285940f034d04bb33a1e08025397/hypothesis-6.165.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3774882c4685e5474b7940697da55963e591b71c6dce593d90ac4128766371ad", size = 1279259, upload-time = "2026-08-11T01:21:53.63Z" }, + { url = "https://files.pythonhosted.org/packages/b9/3f/13f6b6c7d7d0b9bb570a18617eb659b015c312b1d8d1d3aaf9f2edea9628/hypothesis-6.165.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5cb3a397a5422c67387f4408989dbdfc2b1e0306f883f2aa79b9472c80958464", size = 1322605, upload-time = "2026-08-11T01:21:42.853Z" }, + { url = "https://files.pythonhosted.org/packages/6c/dd/243317f5fb8497601dc65d3ded984834eb5f36b8ec59e7853ef753ec0ee1/hypothesis-6.165.3-cp312-cp312-win_amd64.whl", hash = "sha256:dbb74811d54b6317ba0d2047aad269c09afefaa25d1849f8f33f80a638b0c3af", size = 670812, upload-time = "2026-08-11T01:22:50.245Z" }, + { url = "https://files.pythonhosted.org/packages/03/3e/95cba31dbe775b99a4548cdae192e1ad15cee7b64fbdfe6cd4c9d00031b4/hypothesis-6.165.3-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:447f139d6dd70a5d8b178ef507463fb0430ace9ce42e3b2351d2803a391fe774", size = 783183, upload-time = "2026-08-11T01:22:45.286Z" }, + { url = "https://files.pythonhosted.org/packages/56/0e/51bf125cdf7855b69097b8f59c73ef3cf5f4e3d68a16e808d2d1f08a1ff1/hypothesis-6.165.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:6152c718606f1705e673c6b30a6ebd3ff08d340da85291dd3c432c73b28a9b3a", size = 774820, upload-time = "2026-08-11T01:22:24.825Z" }, + { url = "https://files.pythonhosted.org/packages/0a/69/b954f742b97441a5c49f8f8704826ee0637a6cce3a7d06ce85fbefc54ac5/hypothesis-6.165.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:27fe7826ad83ccc2e8062f0fab43b137bab34cef1a149a926b34a7b8382ee22c", size = 1105186, upload-time = "2026-08-11T01:21:41.733Z" }, + { url = "https://files.pythonhosted.org/packages/6e/8a/33e41d9cc1be7661e0b4129c225a93c3f12544714300aadb95ae7eedf894/hypothesis-6.165.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a1ff92876a324f7b9cdb92cedf103e380b7a12aa7df55ebcb16dd0f495a879e8", size = 1155215, upload-time = "2026-08-11T01:22:06.604Z" }, + { url = "https://files.pythonhosted.org/packages/ee/53/ba09526c9100ace5752908ac7251d2dc3960ce7e0e97a31152aaa26c33ee/hypothesis-6.165.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:53f1564c97d27fc109f212404d49cd71d7789777dbe0685628ffe9838df56240", size = 1279245, upload-time = "2026-08-11T01:21:56.182Z" }, + { url = "https://files.pythonhosted.org/packages/c1/93/fc637d355791a65364a3409ff06ade7ba5d3fc6f1d07a729781dec315fa0/hypothesis-6.165.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:788a9b0a7aae719a2b71a1c2f07e51deb1d0fe990164a9090c686833ed4bfbad", size = 1322370, upload-time = "2026-08-11T01:22:48.492Z" }, + { url = "https://files.pythonhosted.org/packages/b6/8d/826053ba0263143fed2b0e8af009dc868d8a932e7246e191deb8ca7ce8ff/hypothesis-6.165.3-cp313-cp313-win_amd64.whl", hash = "sha256:37830f0795abfdf738d2a5b6f829a73f3ab498de45a2e61b0bf3bd38d8c9ddb9", size = 670804, upload-time = "2026-08-11T01:22:00.103Z" }, + { url = "https://files.pythonhosted.org/packages/e7/27/3230f8de3d853b2b547731916ae1d1026bd197cd3f2d35dafc0b445da46b/hypothesis-6.165.3-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:38826441dbf528cc156388d0a05526086a12da3e1348353d3fa14de03e57c4b2", size = 783286, upload-time = "2026-08-11T01:22:40.816Z" }, + { url = "https://files.pythonhosted.org/packages/6c/28/9f9ca830d376c50babe55c616f6d99eea886c6ebcd8b512dcd5d56f9e40c/hypothesis-6.165.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:87490115edd34a246a4ba8b1144cbdf571438c46c406ece05caf65908667c9a9", size = 774963, upload-time = "2026-08-11T01:23:05.409Z" }, + { url = "https://files.pythonhosted.org/packages/33/3c/3c81f08ec1edce160da509c5785d78c0e25a7913899c4b9ff724bfd01420/hypothesis-6.165.3-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f51f4346cfa26bca68c68f7bbbd2b1812208bc9f572187c95ecab080ed402153", size = 1105730, upload-time = "2026-08-11T01:22:42.311Z" }, + { url = "https://files.pythonhosted.org/packages/bf/b5/f6f81b9aec9999ec63920d168617cab67a038be05487eff3410ccd072bfe/hypothesis-6.165.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4da89eb4b36b3260ff714d2ecc3274b9bd599fd96687d2d9ed53d5e1a801a7a7", size = 1155383, upload-time = "2026-08-11T01:21:57.58Z" }, + { url = "https://files.pythonhosted.org/packages/dd/27/7f3a8c6101675bf95c80cd8c9173d65892ca0b7b640551156dc4537fab1f/hypothesis-6.165.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:eb6d31c14d7bdfe03e501d88ee296c149a74cc93e3d01c76ea335e64ee5f33ec", size = 1279606, upload-time = "2026-08-11T01:22:37.56Z" }, + { url = "https://files.pythonhosted.org/packages/d9/16/0c23e06a24e421e532f62a95021fae34f685f3a194c081c6991b4ab202b3/hypothesis-6.165.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:0863e1a9258bc103abe616fa9471cfa66a1535ea404dd8a0bf360e0a29502397", size = 1322697, upload-time = "2026-08-11T01:22:27.857Z" }, + { url = "https://files.pythonhosted.org/packages/dc/56/8356dadf45e5c635b46aa2b57fa74f3210250a8e38b860b6b75f50ed0b42/hypothesis-6.165.3-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:53c56155f2cfbb45ec97fef9ea3b8453b4a34c48c3c5cacee16f97dd2a037994", size = 614859, upload-time = "2026-08-11T01:22:01.304Z" }, + { url = "https://files.pythonhosted.org/packages/e3/79/124d4faf235219acd685c359760a5cb3995609bc50ce465e54c3249841ee/hypothesis-6.165.3-cp314-cp314-win_amd64.whl", hash = "sha256:c48f41e950b5e602e2fdf8f92dcc8ac7bf715a003bf822afb7c9d5cbc41bc344", size = 670600, upload-time = "2026-08-11T01:22:10.356Z" }, + { url = "https://files.pythonhosted.org/packages/01/7a/41ac5e68d9ce079d1b76d4c54126354df61b948c3d519d1289aca877eedc/hypothesis-6.165.3-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:9563d3040178fb1f522665bcec6458cc0d21ab77d7c637058a8be4ea8c01d236", size = 781746, upload-time = "2026-08-11T01:22:34.472Z" }, + { url = "https://files.pythonhosted.org/packages/5d/fb/7ecc21aae63a83dbc8036f9a0544c6b3d798db566b97b5202bdf8e770f80/hypothesis-6.165.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1fe1783543b43ba9808c016950e5e84b3804dc3365ba77c37c427b5896a558a1", size = 773382, upload-time = "2026-08-11T01:22:55.279Z" }, + { url = "https://files.pythonhosted.org/packages/cb/f2/9cc2a4768f9a483b12e307ba585f5eb9c7f5500bd16ff82ddbf62a9a1b88/hypothesis-6.165.3-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9ea34806a4df4e8305a096dcf8e53cdd903c96c1e0d2dd5b001d2283f639c3f1", size = 1103911, upload-time = "2026-08-11T01:23:00.286Z" }, + { url = "https://files.pythonhosted.org/packages/54/9e/b551a494f84976ee5bb9374c197ccc126dea2ec6f22098d5f70705237473/hypothesis-6.165.3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d188454b95ce46ba991e3c52161255d76af25170ad28591f6b30b045e501216e", size = 1154060, upload-time = "2026-08-11T01:22:20.413Z" }, + { url = "https://files.pythonhosted.org/packages/69/37/8e22a236f1f1e599525549a34672fb0523109f571486fe209b12a84a942e/hypothesis-6.165.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:a1c47b15ce97a9b1346bc7d7013c5f215380f78ae01c0f73a1638bd8b98bdd76", size = 1277631, upload-time = "2026-08-11T01:22:30.965Z" }, + { url = "https://files.pythonhosted.org/packages/13/0f/feb33bfc23853b4ba6360ff5e34235cd8bea0d7dd1eb21e17491f581c4e2/hypothesis-6.165.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:996077ef7a3bb332b6638f698ddf7555c82784b58dde80eeba3f07c0a322b40f", size = 1321326, upload-time = "2026-08-11T01:21:45.089Z" }, + { url = "https://files.pythonhosted.org/packages/9f/3b/ad56b56540a0719f493edec0dd442ebb21272147d2482ef505d19760a6d3/hypothesis-6.165.3-cp314-cp314t-win_amd64.whl", hash = "sha256:57a8273bdafe3f450afe66999fd130d4935d775eaf4ef63fcac0bee8015fc512", size = 670613, upload-time = "2026-08-11T01:22:05.294Z" }, +] + +[[package]] +name = "idna" +version = "3.18" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cd/63/9496c57188a2ee585e0f1db071d75089a11e98aa86eb99d9d7618fc1edce/idna-3.18.tar.gz", hash = "sha256:ffb385a7e039654cef1ab9ef32c6fafe283c0c0467bba1d9029738ce4a14a848", size = 196711, upload-time = "2026-06-02T14:34:07.794Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/5e/d4e9f1a599fb8e573b7b87160658329fbf28d19eac2718f51fc3def3aa5a/idna-3.18-py3-none-any.whl", hash = "sha256:7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2", size = 65455, upload-time = "2026-06-02T14:34:06.319Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "ipykernel" +version = "7.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "appnope", marker = "sys_platform == 'darwin'" }, + { name = "comm" }, + { name = "debugpy" }, + { name = "ipython" }, + { name = "jupyter-client" }, + { name = "jupyter-core" }, + { name = "matplotlib-inline" }, + { name = "nest-asyncio2" }, + { name = "packaging" }, + { name = "psutil" }, + { name = "pyzmq" }, + { name = "tornado" }, + { name = "traitlets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3d/c4/e4a38f579de4225a561305666f7541cdabb30075def2aa1ac17bd73c1fb5/ipykernel-7.3.0.tar.gz", hash = "sha256:9acaaaf97d16355166e4085afe9d225bfbdf2b7ef520f9df3be8f2b248275e09", size = 184899, upload-time = "2026-06-10T08:41:25.481Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3d/02/77b271f5dc58bfbc0b577c877b2365d1ffea2afe66a80c13f2312820348c/ipykernel-7.3.0-py3-none-any.whl", hash = "sha256:897eb64da762549ef610698fca5e9675195ec6ac8ec7f19d81ce1ca20c876057", size = 120583, upload-time = "2026-06-10T08:41:23.648Z" }, +] + +[[package]] +name = "ipython" +version = "9.16.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "ipython-pygments-lexers" }, + { name = "jedi" }, + { name = "matplotlib-inline" }, + { name = "pexpect", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" }, + { name = "prompt-toolkit" }, + { name = "psutil", marker = "sys_platform != 'cygwin' and sys_platform != 'emscripten'" }, + { name = "pygments" }, + { name = "stack-data" }, + { name = "traitlets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/96/b150fe7e25a5a29ae9ac1374e71488639605d39a1ea4abb74c9ce33af235/ipython-9.16.1.tar.gz", hash = "sha256:5a3d1f9a47ff216d6cf9cf863124f6a2c1a198d1354c546a4d24a370a283b64c", size = 4515302, upload-time = "2026-08-03T08:36:15.571Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bc/8e/1239df488393d61076653bfb29f759d0f60cab8e030abdf7c17c31539b51/ipython-9.16.1-py3-none-any.whl", hash = "sha256:4acae635506f6d352d94c4899a19d5f85f8bc4d230932342dca556fdab1c69b4", size = 625974, upload-time = "2026-08-03T08:36:13.654Z" }, +] + +[[package]] +name = "ipython-pygments-lexers" +version = "1.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ef/4c/5dd1d8af08107f88c7f741ead7a40854b8ac24ddf9ae850afbcf698aa552/ipython_pygments_lexers-1.1.1.tar.gz", hash = "sha256:09c0138009e56b6854f9535736f4171d855c8c08a563a0dcd8022f78355c7e81", size = 8393, upload-time = "2025-01-17T11:24:34.505Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d9/33/1f075bf72b0b747cb3288d011319aaf64083cf2efef8354174e3ed4540e2/ipython_pygments_lexers-1.1.1-py3-none-any.whl", hash = "sha256:a9462224a505ade19a605f71f8fa63c2048833ce50abc86768a0d81d876dc81c", size = 8074, upload-time = "2025-01-17T11:24:33.271Z" }, +] + +[[package]] +name = "jedi" +version = "0.20.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "parso" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/46/b7/a3635f6a2d7cf5b5dd98064fc1d5fbbafcb25477bcea204a3a92145d158b/jedi-0.20.0.tar.gz", hash = "sha256:c3f4ccbd276696f4b19c54618d4fb18f9fc24b0aef02acf704b23f487daa1011", size = 3119416, upload-time = "2026-05-01T23:38:47.814Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9a/93/242e2eab5fe682ffcb8b0084bde703a41d51e17ee0f3a31ff0d9d813620a/jedi-0.20.0-py2.py3-none-any.whl", hash = "sha256:7bdd9c2634f56713299976f4cbd59cb3fa92165cc5e05ea811fb253480728b67", size = 4884812, upload-time = "2026-05-01T23:38:43.919Z" }, +] + +[[package]] +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + +[[package]] +name = "jsonschema" +version = "4.26.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "jsonschema-specifications" }, + { name = "referencing" }, + { name = "rpds-py" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b3/fc/e067678238fa451312d4c62bf6e6cf5ec56375422aee02f9cb5f909b3047/jsonschema-4.26.0.tar.gz", hash = "sha256:0c26707e2efad8aa1bfc5b7ce170f3fccc2e4918ff85989ba9ffa9facb2be326", size = 366583, upload-time = "2026-01-07T13:41:07.246Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/69/90/f63fb5873511e014207a475e2bb4e8b2e570d655b00ac19a9a0ca0a385ee/jsonschema-4.26.0-py3-none-any.whl", hash = "sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce", size = 90630, upload-time = "2026-01-07T13:41:05.306Z" }, +] + +[[package]] +name = "jsonschema-specifications" +version = "2025.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "referencing" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/19/74/a633ee74eb36c44aa6d1095e7cc5569bebf04342ee146178e2d36600708b/jsonschema_specifications-2025.9.1.tar.gz", hash = "sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d", size = 32855, upload-time = "2025-09-08T01:34:59.186Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/41/45/1a4ed80516f02155c51f51e8cedb3c1902296743db0bbc66608a0db2814f/jsonschema_specifications-2025.9.1-py3-none-any.whl", hash = "sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe", size = 18437, upload-time = "2025-09-08T01:34:57.871Z" }, +] + +[[package]] +name = "jupyter-client" +version = "8.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "jupyter-core" }, + { name = "python-dateutil" }, + { name = "pyzmq" }, + { name = "tornado" }, + { name = "traitlets" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7d/dc/5512503b088997c2250b8bf18258fba9d9ce5ead641183700960d3c9d342/jupyter_client-8.9.1.tar.gz", hash = "sha256:a58f730dd9e728ba16ba1d62ebccf7ffe1ebbdbce4e95cfae941b7321ae1f4fa", size = 359256, upload-time = "2026-06-09T13:15:01.033Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3f/6f/56d39bf385c5c27988aebaf0c18a2a17e960575740100973511018bd904e/jupyter_client-8.9.1-py3-none-any.whl", hash = "sha256:0b7a295bc46e8751e9adae84781f726c851c1d911bd793edc4a3bde942e3da81", size = 109828, upload-time = "2026-06-09T13:14:58.835Z" }, +] + +[[package]] +name = "jupyter-core" +version = "5.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "platformdirs" }, + { name = "traitlets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/02/49/9d1284d0dc65e2c757b74c6687b6d319b02f822ad039e5c512df9194d9dd/jupyter_core-5.9.1.tar.gz", hash = "sha256:4d09aaff303b9566c3ce657f580bd089ff5c91f5f89cf7d8846c3cdf465b5508", size = 89814, upload-time = "2025-10-16T19:19:18.444Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e7/e7/80988e32bf6f73919a113473a604f5a8f09094de312b9d52b79c2df7612b/jupyter_core-5.9.1-py3-none-any.whl", hash = "sha256:ebf87fdc6073d142e114c72c9e29a9d7ca03fad818c5d300ce2adc1fb0743407", size = 29032, upload-time = "2025-10-16T19:19:16.783Z" }, +] + +[[package]] +name = "markdown" +version = "3.10.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/29/6f/da4c6aea59b3001f2e8c0ec7497475aadaf3b021c10cab5b2858f0f32b26/markdown-3.10.3.tar.gz", hash = "sha256:3589362618f743188b4d955b874402bc814f4f83f544dc207719f4baa7d9c45f", size = 372596, upload-time = "2026-07-30T19:05:29.005Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/69/4a5af2bc115a9a33fefe51709749de8262be3f9ba063d1753a837cdbc49c/markdown-3.10.3-py3-none-any.whl", hash = "sha256:fa6c92a00a4a3c98b22728c64a935ae1928250ae65058a6ded814d2cc29a4cea", size = 110757, upload-time = "2026-07-30T19:05:27.883Z" }, +] + +[[package]] +name = "markupsafe" +version = "3.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, + { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, + { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" }, + { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" }, + { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" }, + { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" }, + { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" }, + { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" }, + { url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" }, + { url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" }, + { url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" }, + { url = "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676", size = 22980, upload-time = "2025-09-27T18:36:45.385Z" }, + { url = "https://files.pythonhosted.org/packages/7f/71/544260864f893f18b6827315b988c146b559391e6e7e8f7252839b1b846a/markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9", size = 21990, upload-time = "2025-09-27T18:36:46.916Z" }, + { url = "https://files.pythonhosted.org/packages/c2/28/b50fc2f74d1ad761af2f5dcce7492648b983d00a65b8c0e0cb457c82ebbe/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1", size = 23784, upload-time = "2025-09-27T18:36:47.884Z" }, + { url = "https://files.pythonhosted.org/packages/ed/76/104b2aa106a208da8b17a2fb72e033a5a9d7073c68f7e508b94916ed47a9/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc", size = 21588, upload-time = "2025-09-27T18:36:48.82Z" }, + { url = "https://files.pythonhosted.org/packages/b5/99/16a5eb2d140087ebd97180d95249b00a03aa87e29cc224056274f2e45fd6/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12", size = 23041, upload-time = "2025-09-27T18:36:49.797Z" }, + { url = "https://files.pythonhosted.org/packages/19/bc/e7140ed90c5d61d77cea142eed9f9c303f4c4806f60a1044c13e3f1471d0/markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed", size = 14543, upload-time = "2025-09-27T18:36:51.584Z" }, + { url = "https://files.pythonhosted.org/packages/05/73/c4abe620b841b6b791f2edc248f556900667a5a1cf023a6646967ae98335/markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5", size = 15113, upload-time = "2025-09-27T18:36:52.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3a/fa34a0f7cfef23cf9500d68cb7c32dd64ffd58a12b09225fb03dd37d5b80/markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485", size = 13911, upload-time = "2025-09-27T18:36:53.513Z" }, + { url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" }, + { url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e6/fa0ffcda717ef64a5108eaa7b4f5ed28d56122c9a6d70ab8b72f9f715c80/markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19", size = 25639, upload-time = "2025-09-27T18:36:56.908Z" }, + { url = "https://files.pythonhosted.org/packages/96/ec/2102e881fe9d25fc16cb4b25d5f5cde50970967ffa5dddafdb771237062d/markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025", size = 23569, upload-time = "2025-09-27T18:36:57.913Z" }, + { url = "https://files.pythonhosted.org/packages/4b/30/6f2fce1f1f205fc9323255b216ca8a235b15860c34b6798f810f05828e32/markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6", size = 23284, upload-time = "2025-09-27T18:36:58.833Z" }, + { url = "https://files.pythonhosted.org/packages/58/47/4a0ccea4ab9f5dcb6f79c0236d954acb382202721e704223a8aafa38b5c8/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f", size = 24801, upload-time = "2025-09-27T18:36:59.739Z" }, + { url = "https://files.pythonhosted.org/packages/6a/70/3780e9b72180b6fecb83a4814d84c3bf4b4ae4bf0b19c27196104149734c/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb", size = 22769, upload-time = "2025-09-27T18:37:00.719Z" }, + { url = "https://files.pythonhosted.org/packages/98/c5/c03c7f4125180fc215220c035beac6b9cb684bc7a067c84fc69414d315f5/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009", size = 23642, upload-time = "2025-09-27T18:37:01.673Z" }, + { url = "https://files.pythonhosted.org/packages/80/d6/2d1b89f6ca4bff1036499b1e29a1d02d282259f3681540e16563f27ebc23/markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354", size = 14612, upload-time = "2025-09-27T18:37:02.639Z" }, + { url = "https://files.pythonhosted.org/packages/2b/98/e48a4bfba0a0ffcf9925fe2d69240bfaa19c6f7507b8cd09c70684a53c1e/markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218", size = 15200, upload-time = "2025-09-27T18:37:03.582Z" }, + { url = "https://files.pythonhosted.org/packages/0e/72/e3cc540f351f316e9ed0f092757459afbc595824ca724cbc5a5d4263713f/markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287", size = 13973, upload-time = "2025-09-27T18:37:04.929Z" }, + { url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" }, + { url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" }, + { url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" }, + { url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" }, + { url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" }, + { url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" }, + { url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" }, + { url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" }, + { url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" }, + { url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" }, + { url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" }, + { url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" }, + { url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" }, + { url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" }, + { url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" }, + { url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" }, + { url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" }, + { url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" }, + { url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" }, + { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, +] + +[[package]] +name = "matplotlib-inline" +version = "0.2.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "traitlets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bd/c0/9f7c9a46090390368a4d7bcb76bb87a4a36c421e4c0792cdb53486ffac7a/matplotlib_inline-0.2.2.tar.gz", hash = "sha256:72f3fe8fce36b70d4a5b612f899090cd0401deddc4ea90e1572b9f4bfb058c79", size = 8150, upload-time = "2026-05-08T17:33:33.49Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/41/09/5b161152e2d90f7b87f781c2e1267494aef9c32498df793f73ad0a0a494a/matplotlib_inline-0.2.2-py3-none-any.whl", hash = "sha256:3c821cf1c209f59fb2d2d64abbf5b23b67bcb2210d663f9918dd851c6da1fcf6", size = 9534, upload-time = "2026-05-08T17:33:32.055Z" }, +] + +[[package]] +name = "mergedeep" +version = "1.3.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/3a/41/580bb4006e3ed0361b8151a01d324fb03f420815446c7def45d02f74c270/mergedeep-1.3.4.tar.gz", hash = "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8", size = 4661, upload-time = "2021-02-05T18:55:30.623Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/19/04f9b178c2d8a15b076c8b5140708fa6ffc5601fb6f1e975537072df5b2a/mergedeep-1.3.4-py3-none-any.whl", hash = "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307", size = 6354, upload-time = "2021-02-05T18:55:29.583Z" }, +] + +[[package]] +name = "mkdocs" +version = "1.6.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "ghp-import" }, + { name = "jinja2" }, + { name = "markdown" }, + { name = "markupsafe" }, + { name = "mergedeep" }, + { name = "mkdocs-get-deps" }, + { name = "packaging" }, + { name = "pathspec" }, + { name = "pyyaml" }, + { name = "pyyaml-env-tag" }, + { name = "watchdog" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bc/c6/bbd4f061bd16b378247f12953ffcb04786a618ce5e904b8c5a01a0309061/mkdocs-1.6.1.tar.gz", hash = "sha256:7b432f01d928c084353ab39c57282f29f92136665bdd6abf7c1ec8d822ef86f2", size = 3889159, upload-time = "2024-08-30T12:24:06.899Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/22/5b/dbc6a8cddc9cfa9c4971d59fb12bb8d42e161b7e7f8cc89e49137c5b279c/mkdocs-1.6.1-py3-none-any.whl", hash = "sha256:db91759624d1647f3f34aa0c3f327dd2601beae39a366d6e064c03468d35c20e", size = 3864451, upload-time = "2024-08-30T12:24:05.054Z" }, +] + +[[package]] +name = "mkdocs-autorefs" +version = "1.4.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown" }, + { name = "markupsafe" }, + { name = "mkdocs" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/52/c0/f641843de3f612a6b48253f39244165acff36657a91cc903633d456ae1ac/mkdocs_autorefs-1.4.4.tar.gz", hash = "sha256:d54a284f27a7346b9c38f1f852177940c222da508e66edc816a0fa55fc6da197", size = 56588, upload-time = "2026-02-10T15:23:55.105Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/28/de/a3e710469772c6a89595fc52816da05c1e164b4c866a89e3cb82fb1b67c5/mkdocs_autorefs-1.4.4-py3-none-any.whl", hash = "sha256:834ef5408d827071ad1bc69e0f39704fa34c7fc05bc8e1c72b227dfdc5c76089", size = 25530, upload-time = "2026-02-10T15:23:53.817Z" }, +] + +[[package]] +name = "mkdocs-get-deps" +version = "0.2.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mergedeep" }, + { name = "platformdirs" }, + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ce/25/b3cccb187655b9393572bde9b09261d267c3bf2f2cdabe347673be5976a6/mkdocs_get_deps-0.2.2.tar.gz", hash = "sha256:8ee8d5f316cdbbb2834bc1df6e69c08fe769a83e040060de26d3c19fad3599a1", size = 11047, upload-time = "2026-03-10T02:46:33.632Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/29/744136411e785c4b0b744d5413e56555265939ab3a104c6a4b719dad33fd/mkdocs_get_deps-0.2.2-py3-none-any.whl", hash = "sha256:e7878cbeac04860b8b5e0ca31d3abad3df9411a75a32cde82f8e44b6c16ff650", size = 9555, upload-time = "2026-03-10T02:46:32.256Z" }, +] + +[[package]] +name = "mkdocs-material" +version = "9.7.7" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "babel" }, + { name = "backrefs" }, + { name = "colorama" }, + { name = "jinja2" }, + { name = "markdown" }, + { name = "mkdocs" }, + { name = "mkdocs-material-extensions" }, + { name = "paginate" }, + { name = "pygments" }, + { name = "pymdown-extensions" }, + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f1/cd/c05d3a530ba7934f144fb45f7203cd236adc25c7bdcc34673d202f4b0278/mkdocs_material-9.7.7.tar.gz", hash = "sha256:c0649c065b1b0512d60aad8c10f947f8e455284475239b364b610f2deb4d0855", size = 4097923, upload-time = "2026-07-17T16:21:33.156Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ad/21/17c1bc9e6f47c972ad66fb2ac2568f99f90f1207eeb6fc3b34d094dba7b5/mkdocs_material-9.7.7-py3-none-any.whl", hash = "sha256:8ea9bb1737a5b524a5f9dcf2e1b4ebda8274ae3008aa7845720a97083bef708f", size = 9305438, upload-time = "2026-07-17T16:21:30.017Z" }, +] + +[[package]] +name = "mkdocs-material-extensions" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/79/9b/9b4c96d6593b2a541e1cb8b34899a6d021d208bb357042823d4d2cabdbe7/mkdocs_material_extensions-1.3.1.tar.gz", hash = "sha256:10c9511cea88f568257f960358a467d12b970e1f7b2c0e5fb2bb48cab1928443", size = 11847, upload-time = "2023-11-22T19:09:45.208Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5b/54/662a4743aa81d9582ee9339d4ffa3c8fd40a4965e033d77b9da9774d3960/mkdocs_material_extensions-1.3.1-py3-none-any.whl", hash = "sha256:adff8b62700b25cb77b53358dad940f3ef973dd6db797907c49e3c2ef3ab4e31", size = 8728, upload-time = "2023-11-22T19:09:43.465Z" }, +] + +[[package]] +name = "mkdocstrings" +version = "1.0.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "jinja2" }, + { name = "markdown" }, + { name = "markupsafe" }, + { name = "mkdocs" }, + { name = "mkdocs-autorefs" }, + { name = "pymdown-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/53/71/f85bdf13355073ae15a7375f09879375a830553552e58c1c4b7e0bbc5c8b/mkdocstrings-1.0.6.tar.gz", hash = "sha256:a0b8c2bdd29a6416c80d717aa369bbf7831946bd9f23c2a66db1b1dbe7693dbd", size = 100649, upload-time = "2026-07-11T19:38:05.732Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5d/5b/4c1902e8bdd5c4db63284e9d101dece4038d4025d6d88850ffe0a1578980/mkdocstrings-1.0.6-py3-none-any.whl", hash = "sha256:2703708697487d1b6d6d7b412e176fa436edf120c1bf81dc9e126b12d00893c7", size = 35787, upload-time = "2026-07-11T19:38:04.417Z" }, +] + +[[package]] +name = "mkdocstrings-python" +version = "2.0.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "griffelib" }, + { name = "mkdocs-autorefs" }, + { name = "mkdocstrings" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/b6/e858701499d57eee8b3fd8e78168083956c6683ddbe727b46758b19e1119/mkdocstrings_python-2.0.5.tar.gz", hash = "sha256:3a4d92556ad39637e88af94a5374213af9a8e3040c3824ceaed04b486c017594", size = 199578, upload-time = "2026-06-19T10:41:08.868Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/fc/10ab7e80650a9c9e8f4f1105f8c8e73567f88ed0c06ada589ab81d38687c/mkdocstrings_python-2.0.5-py3-none-any.whl", hash = "sha256:30c837bbff016549f659fcba6539ac351303f0fd7e713c89a040611072236e9d", size = 104951, upload-time = "2026-06-19T10:41:07.378Z" }, +] + +[[package]] +name = "multidict" +version = "6.7.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1a/c2/c2d94cbe6ac1753f3fc980da97b3d930efe1da3af3c9f5125354436c073d/multidict-6.7.1.tar.gz", hash = "sha256:ec6652a1bee61c53a3e5776b6049172c53b6aaba34f18c9ad04f82712bac623d", size = 102010, upload-time = "2026-01-26T02:46:45.979Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8d/9c/f20e0e2cf80e4b2e4b1c365bf5fe104ee633c751a724246262db8f1a0b13/multidict-6.7.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a90f75c956e32891a4eda3639ce6dd86e87105271f43d43442a3aedf3cddf172", size = 76893, upload-time = "2026-01-26T02:43:52.754Z" }, + { url = "https://files.pythonhosted.org/packages/fe/cf/18ef143a81610136d3da8193da9d80bfe1cb548a1e2d1c775f26b23d024a/multidict-6.7.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3fccb473e87eaa1382689053e4a4618e7ba7b9b9b8d6adf2027ee474597128cd", size = 45456, upload-time = "2026-01-26T02:43:53.893Z" }, + { url = "https://files.pythonhosted.org/packages/a9/65/1caac9d4cd32e8433908683446eebc953e82d22b03d10d41a5f0fefe991b/multidict-6.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0fa96985700739c4c7853a43c0b3e169360d6855780021bfc6d0f1ce7c123e7", size = 43872, upload-time = "2026-01-26T02:43:55.041Z" }, + { url = "https://files.pythonhosted.org/packages/cf/3b/d6bd75dc4f3ff7c73766e04e705b00ed6dbbaccf670d9e05a12b006f5a21/multidict-6.7.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cb2a55f408c3043e42b40cc8eecd575afa27b7e0b956dfb190de0f8499a57a53", size = 251018, upload-time = "2026-01-26T02:43:56.198Z" }, + { url = "https://files.pythonhosted.org/packages/fd/80/c959c5933adedb9ac15152e4067c702a808ea183a8b64cf8f31af8ad3155/multidict-6.7.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb0ce7b2a32d09892b3dd6cc44877a0d02a33241fafca5f25c8b6b62374f8b75", size = 258883, upload-time = "2026-01-26T02:43:57.499Z" }, + { url = "https://files.pythonhosted.org/packages/86/85/7ed40adafea3d4f1c8b916e3b5cc3a8e07dfcdcb9cd72800f4ed3ca1b387/multidict-6.7.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c3a32d23520ee37bf327d1e1a656fec76a2edd5c038bf43eddfa0572ec49c60b", size = 242413, upload-time = "2026-01-26T02:43:58.755Z" }, + { url = "https://files.pythonhosted.org/packages/d2/57/b8565ff533e48595503c785f8361ff9a4fde4d67de25c207cd0ba3befd03/multidict-6.7.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9c90fed18bffc0189ba814749fdcc102b536e83a9f738a9003e569acd540a733", size = 268404, upload-time = "2026-01-26T02:44:00.216Z" }, + { url = "https://files.pythonhosted.org/packages/e0/50/9810c5c29350f7258180dfdcb2e52783a0632862eb334c4896ac717cebcb/multidict-6.7.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:da62917e6076f512daccfbbde27f46fed1c98fee202f0559adec8ee0de67f71a", size = 269456, upload-time = "2026-01-26T02:44:02.202Z" }, + { url = "https://files.pythonhosted.org/packages/f3/8d/5e5be3ced1d12966fefb5c4ea3b2a5b480afcea36406559442c6e31d4a48/multidict-6.7.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bfde23ef6ed9db7eaee6c37dcec08524cb43903c60b285b172b6c094711b3961", size = 256322, upload-time = "2026-01-26T02:44:03.56Z" }, + { url = "https://files.pythonhosted.org/packages/31/6e/d8a26d81ac166a5592782d208dd90dfdc0a7a218adaa52b45a672b46c122/multidict-6.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3758692429e4e32f1ba0df23219cd0b4fc0a52f476726fff9337d1a57676a582", size = 253955, upload-time = "2026-01-26T02:44:04.845Z" }, + { url = "https://files.pythonhosted.org/packages/59/4c/7c672c8aad41534ba619bcd4ade7a0dc87ed6b8b5c06149b85d3dd03f0cd/multidict-6.7.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:398c1478926eca669f2fd6a5856b6de9c0acf23a2cb59a14c0ba5844fa38077e", size = 251254, upload-time = "2026-01-26T02:44:06.133Z" }, + { url = "https://files.pythonhosted.org/packages/7b/bd/84c24de512cbafbdbc39439f74e967f19570ce7924e3007174a29c348916/multidict-6.7.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c102791b1c4f3ab36ce4101154549105a53dc828f016356b3e3bcae2e3a039d3", size = 252059, upload-time = "2026-01-26T02:44:07.518Z" }, + { url = "https://files.pythonhosted.org/packages/fa/ba/f5449385510825b73d01c2d4087bf6d2fccc20a2d42ac34df93191d3dd03/multidict-6.7.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:a088b62bd733e2ad12c50dad01b7d0166c30287c166e137433d3b410add807a6", size = 263588, upload-time = "2026-01-26T02:44:09.382Z" }, + { url = "https://files.pythonhosted.org/packages/d7/11/afc7c677f68f75c84a69fe37184f0f82fce13ce4b92f49f3db280b7e92b3/multidict-6.7.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3d51ff4785d58d3f6c91bdbffcb5e1f7ddfda557727043aa20d20ec4f65e324a", size = 259642, upload-time = "2026-01-26T02:44:10.73Z" }, + { url = "https://files.pythonhosted.org/packages/2b/17/ebb9644da78c4ab36403739e0e6e0e30ebb135b9caf3440825001a0bddcb/multidict-6.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc5907494fccf3e7d3f94f95c91d6336b092b5fc83811720fae5e2765890dfba", size = 251377, upload-time = "2026-01-26T02:44:12.042Z" }, + { url = "https://files.pythonhosted.org/packages/ca/a4/840f5b97339e27846c46307f2530a2805d9d537d8b8bd416af031cad7fa0/multidict-6.7.1-cp312-cp312-win32.whl", hash = "sha256:28ca5ce2fd9716631133d0e9a9b9a745ad7f60bac2bccafb56aa380fc0b6c511", size = 41887, upload-time = "2026-01-26T02:44:14.245Z" }, + { url = "https://files.pythonhosted.org/packages/80/31/0b2517913687895f5904325c2069d6a3b78f66cc641a86a2baf75a05dcbb/multidict-6.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcee94dfbd638784645b066074b338bc9cc155d4b4bffa4adce1615c5a426c19", size = 46053, upload-time = "2026-01-26T02:44:15.371Z" }, + { url = "https://files.pythonhosted.org/packages/0c/5b/aba28e4ee4006ae4c7df8d327d31025d760ffa992ea23812a601d226e682/multidict-6.7.1-cp312-cp312-win_arm64.whl", hash = "sha256:ba0a9fb644d0c1a2194cf7ffb043bd852cea63a57f66fbd33959f7dae18517bf", size = 43307, upload-time = "2026-01-26T02:44:16.852Z" }, + { url = "https://files.pythonhosted.org/packages/f2/22/929c141d6c0dba87d3e1d38fbdf1ba8baba86b7776469f2bc2d3227a1e67/multidict-6.7.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:2b41f5fed0ed563624f1c17630cb9941cf2309d4df00e494b551b5f3e3d67a23", size = 76174, upload-time = "2026-01-26T02:44:18.509Z" }, + { url = "https://files.pythonhosted.org/packages/c7/75/bc704ae15fee974f8fccd871305e254754167dce5f9e42d88a2def741a1d/multidict-6.7.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84e61e3af5463c19b67ced91f6c634effb89ef8bfc5ca0267f954451ed4bb6a2", size = 45116, upload-time = "2026-01-26T02:44:19.745Z" }, + { url = "https://files.pythonhosted.org/packages/79/76/55cd7186f498ed080a18440c9013011eb548f77ae1b297206d030eb1180a/multidict-6.7.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:935434b9853c7c112eee7ac891bc4cb86455aa631269ae35442cb316790c1445", size = 43524, upload-time = "2026-01-26T02:44:21.571Z" }, + { url = "https://files.pythonhosted.org/packages/e9/3c/414842ef8d5a1628d68edee29ba0e5bcf235dbfb3ccd3ea303a7fe8c72ff/multidict-6.7.1-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:432feb25a1cb67fe82a9680b4d65fb542e4635cb3166cd9c01560651ad60f177", size = 249368, upload-time = "2026-01-26T02:44:22.803Z" }, + { url = "https://files.pythonhosted.org/packages/f6/32/befed7f74c458b4a525e60519fe8d87eef72bb1e99924fa2b0f9d97a221e/multidict-6.7.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e82d14e3c948952a1a85503817e038cba5905a3352de76b9a465075d072fba23", size = 256952, upload-time = "2026-01-26T02:44:24.306Z" }, + { url = "https://files.pythonhosted.org/packages/03/d6/c878a44ba877f366630c860fdf74bfb203c33778f12b6ac274936853c451/multidict-6.7.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:4cfb48c6ea66c83bcaaf7e4dfa7ec1b6bbcf751b7db85a328902796dfde4c060", size = 240317, upload-time = "2026-01-26T02:44:25.772Z" }, + { url = "https://files.pythonhosted.org/packages/68/49/57421b4d7ad2e9e60e25922b08ceb37e077b90444bde6ead629095327a6f/multidict-6.7.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1d540e51b7e8e170174555edecddbd5538105443754539193e3e1061864d444d", size = 267132, upload-time = "2026-01-26T02:44:27.648Z" }, + { url = "https://files.pythonhosted.org/packages/b7/fe/ec0edd52ddbcea2a2e89e174f0206444a61440b40f39704e64dc807a70bd/multidict-6.7.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:273d23f4b40f3dce4d6c8a821c741a86dec62cded82e1175ba3d99be128147ed", size = 268140, upload-time = "2026-01-26T02:44:29.588Z" }, + { url = "https://files.pythonhosted.org/packages/b0/73/6e1b01cbeb458807aa0831742232dbdd1fa92bfa33f52a3f176b4ff3dc11/multidict-6.7.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d624335fd4fa1c08a53f8b4be7676ebde19cd092b3895c421045ca87895b429", size = 254277, upload-time = "2026-01-26T02:44:30.902Z" }, + { url = "https://files.pythonhosted.org/packages/6a/b2/5fb8c124d7561a4974c342bc8c778b471ebbeb3cc17df696f034a7e9afe7/multidict-6.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:12fad252f8b267cc75b66e8fc51b3079604e8d43a75428ffe193cd9e2195dfd6", size = 252291, upload-time = "2026-01-26T02:44:32.31Z" }, + { url = "https://files.pythonhosted.org/packages/5a/96/51d4e4e06bcce92577fcd488e22600bd38e4fd59c20cb49434d054903bd2/multidict-6.7.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:03ede2a6ffbe8ef936b92cb4529f27f42be7f56afcdab5ab739cd5f27fb1cbf9", size = 250156, upload-time = "2026-01-26T02:44:33.734Z" }, + { url = "https://files.pythonhosted.org/packages/db/6b/420e173eec5fba721a50e2a9f89eda89d9c98fded1124f8d5c675f7a0c0f/multidict-6.7.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:90efbcf47dbe33dcf643a1e400d67d59abeac5db07dc3f27d6bdeae497a2198c", size = 249742, upload-time = "2026-01-26T02:44:35.222Z" }, + { url = "https://files.pythonhosted.org/packages/44/a3/ec5b5bd98f306bc2aa297b8c6f11a46714a56b1e6ef5ebda50a4f5d7c5fb/multidict-6.7.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5c4b9bfc148f5a91be9244d6264c53035c8a0dcd2f51f1c3c6e30e30ebaa1c84", size = 262221, upload-time = "2026-01-26T02:44:36.604Z" }, + { url = "https://files.pythonhosted.org/packages/cd/f7/e8c0d0da0cd1e28d10e624604e1a36bcc3353aaebdfdc3a43c72bc683a12/multidict-6.7.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:401c5a650f3add2472d1d288c26deebc540f99e2fb83e9525007a74cd2116f1d", size = 258664, upload-time = "2026-01-26T02:44:38.008Z" }, + { url = "https://files.pythonhosted.org/packages/52/da/151a44e8016dd33feed44f730bd856a66257c1ee7aed4f44b649fb7edeb3/multidict-6.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:97891f3b1b3ffbded884e2916cacf3c6fc87b66bb0dde46f7357404750559f33", size = 249490, upload-time = "2026-01-26T02:44:39.386Z" }, + { url = "https://files.pythonhosted.org/packages/87/af/a3b86bf9630b732897f6fc3f4c4714b90aa4361983ccbdcd6c0339b21b0c/multidict-6.7.1-cp313-cp313-win32.whl", hash = "sha256:e1c5988359516095535c4301af38d8a8838534158f649c05dd1050222321bcb3", size = 41695, upload-time = "2026-01-26T02:44:41.318Z" }, + { url = "https://files.pythonhosted.org/packages/b2/35/e994121b0e90e46134673422dd564623f93304614f5d11886b1b3e06f503/multidict-6.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:960c83bf01a95b12b08fd54324a4eb1d5b52c88932b5cba5d6e712bb3ed12eb5", size = 45884, upload-time = "2026-01-26T02:44:42.488Z" }, + { url = "https://files.pythonhosted.org/packages/ca/61/42d3e5dbf661242a69c97ea363f2d7b46c567da8eadef8890022be6e2ab0/multidict-6.7.1-cp313-cp313-win_arm64.whl", hash = "sha256:563fe25c678aaba333d5399408f5ec3c383ca5b663e7f774dd179a520b8144df", size = 43122, upload-time = "2026-01-26T02:44:43.664Z" }, + { url = "https://files.pythonhosted.org/packages/6d/b3/e6b21c6c4f314bb956016b0b3ef2162590a529b84cb831c257519e7fde44/multidict-6.7.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:c76c4bec1538375dad9d452d246ca5368ad6e1c9039dadcf007ae59c70619ea1", size = 83175, upload-time = "2026-01-26T02:44:44.894Z" }, + { url = "https://files.pythonhosted.org/packages/fb/76/23ecd2abfe0957b234f6c960f4ade497f55f2c16aeb684d4ecdbf1c95791/multidict-6.7.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:57b46b24b5d5ebcc978da4ec23a819a9402b4228b8a90d9c656422b4bdd8a963", size = 48460, upload-time = "2026-01-26T02:44:46.106Z" }, + { url = "https://files.pythonhosted.org/packages/c4/57/a0ed92b23f3a042c36bc4227b72b97eca803f5f1801c1ab77c8a212d455e/multidict-6.7.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e954b24433c768ce78ab7929e84ccf3422e46deb45a4dc9f93438f8217fa2d34", size = 46930, upload-time = "2026-01-26T02:44:47.278Z" }, + { url = "https://files.pythonhosted.org/packages/b5/66/02ec7ace29162e447f6382c495dc95826bf931d3818799bbef11e8f7df1a/multidict-6.7.1-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3bd231490fa7217cc832528e1cd8752a96f0125ddd2b5749390f7c3ec8721b65", size = 242582, upload-time = "2026-01-26T02:44:48.604Z" }, + { url = "https://files.pythonhosted.org/packages/58/18/64f5a795e7677670e872673aca234162514696274597b3708b2c0d276cce/multidict-6.7.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:253282d70d67885a15c8a7716f3a73edf2d635793ceda8173b9ecc21f2fb8292", size = 250031, upload-time = "2026-01-26T02:44:50.544Z" }, + { url = "https://files.pythonhosted.org/packages/c8/ed/e192291dbbe51a8290c5686f482084d31bcd9d09af24f63358c3d42fd284/multidict-6.7.1-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0b4c48648d7649c9335cf1927a8b87fa692de3dcb15faa676c6a6f1f1aabda43", size = 228596, upload-time = "2026-01-26T02:44:51.951Z" }, + { url = "https://files.pythonhosted.org/packages/1e/7e/3562a15a60cf747397e7f2180b0a11dc0c38d9175a650e75fa1b4d325e15/multidict-6.7.1-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:98bc624954ec4d2c7cb074b8eefc2b5d0ce7d482e410df446414355d158fe4ca", size = 257492, upload-time = "2026-01-26T02:44:53.902Z" }, + { url = "https://files.pythonhosted.org/packages/24/02/7d0f9eae92b5249bb50ac1595b295f10e263dd0078ebb55115c31e0eaccd/multidict-6.7.1-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1b99af4d9eec0b49927b4402bcbb58dea89d3e0db8806a4086117019939ad3dd", size = 255899, upload-time = "2026-01-26T02:44:55.316Z" }, + { url = "https://files.pythonhosted.org/packages/00/e3/9b60ed9e23e64c73a5cde95269ef1330678e9c6e34dd4eb6b431b85b5a10/multidict-6.7.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6aac4f16b472d5b7dc6f66a0d49dd57b0e0902090be16594dc9ebfd3d17c47e7", size = 247970, upload-time = "2026-01-26T02:44:56.783Z" }, + { url = "https://files.pythonhosted.org/packages/3e/06/538e58a63ed5cfb0bd4517e346b91da32fde409d839720f664e9a4ae4f9d/multidict-6.7.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:21f830fe223215dffd51f538e78c172ed7c7f60c9b96a2bf05c4848ad49921c3", size = 245060, upload-time = "2026-01-26T02:44:58.195Z" }, + { url = "https://files.pythonhosted.org/packages/b2/2f/d743a3045a97c895d401e9bd29aaa09b94f5cbdf1bd561609e5a6c431c70/multidict-6.7.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:f5dd81c45b05518b9aa4da4aa74e1c93d715efa234fd3e8a179df611cc85e5f4", size = 235888, upload-time = "2026-01-26T02:44:59.57Z" }, + { url = "https://files.pythonhosted.org/packages/38/83/5a325cac191ab28b63c52f14f1131f3b0a55ba3b9aa65a6d0bf2a9b921a0/multidict-6.7.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:eb304767bca2bb92fb9c5bd33cedc95baee5bb5f6c88e63706533a1c06ad08c8", size = 243554, upload-time = "2026-01-26T02:45:01.054Z" }, + { url = "https://files.pythonhosted.org/packages/20/1f/9d2327086bd15da2725ef6aae624208e2ef828ed99892b17f60c344e57ed/multidict-6.7.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:c9035dde0f916702850ef66460bc4239d89d08df4d02023a5926e7446724212c", size = 252341, upload-time = "2026-01-26T02:45:02.484Z" }, + { url = "https://files.pythonhosted.org/packages/e8/2c/2a1aa0280cf579d0f6eed8ee5211c4f1730bd7e06c636ba2ee6aafda302e/multidict-6.7.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:af959b9beeb66c822380f222f0e0a1889331597e81f1ded7f374f3ecb0fd6c52", size = 246391, upload-time = "2026-01-26T02:45:03.862Z" }, + { url = "https://files.pythonhosted.org/packages/e5/03/7ca022ffc36c5a3f6e03b179a5ceb829be9da5783e6fe395f347c0794680/multidict-6.7.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:41f2952231456154ee479651491e94118229844dd7226541788be783be2b5108", size = 243422, upload-time = "2026-01-26T02:45:05.296Z" }, + { url = "https://files.pythonhosted.org/packages/dc/1d/b31650eab6c5778aceed46ba735bd97f7c7d2f54b319fa916c0f96e7805b/multidict-6.7.1-cp313-cp313t-win32.whl", hash = "sha256:df9f19c28adcb40b6aae30bbaa1478c389efd50c28d541d76760199fc1037c32", size = 47770, upload-time = "2026-01-26T02:45:06.754Z" }, + { url = "https://files.pythonhosted.org/packages/ac/5b/2d2d1d522e51285bd61b1e20df8f47ae1a9d80839db0b24ea783b3832832/multidict-6.7.1-cp313-cp313t-win_amd64.whl", hash = "sha256:d54ecf9f301853f2c5e802da559604b3e95bb7a3b01a9c295c6ee591b9882de8", size = 53109, upload-time = "2026-01-26T02:45:08.044Z" }, + { url = "https://files.pythonhosted.org/packages/3d/a3/cc409ba012c83ca024a308516703cf339bdc4b696195644a7215a5164a24/multidict-6.7.1-cp313-cp313t-win_arm64.whl", hash = "sha256:5a37ca18e360377cfda1d62f5f382ff41f2b8c4ccb329ed974cc2e1643440118", size = 45573, upload-time = "2026-01-26T02:45:09.349Z" }, + { url = "https://files.pythonhosted.org/packages/91/cc/db74228a8be41884a567e88a62fd589a913708fcf180d029898c17a9a371/multidict-6.7.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8f333ec9c5eb1b7105e3b84b53141e66ca05a19a605368c55450b6ba208cb9ee", size = 75190, upload-time = "2026-01-26T02:45:10.651Z" }, + { url = "https://files.pythonhosted.org/packages/d5/22/492f2246bb5b534abd44804292e81eeaf835388901f0c574bac4eeec73c5/multidict-6.7.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:a407f13c188f804c759fc6a9f88286a565c242a76b27626594c133b82883b5c2", size = 44486, upload-time = "2026-01-26T02:45:11.938Z" }, + { url = "https://files.pythonhosted.org/packages/f1/4f/733c48f270565d78b4544f2baddc2fb2a245e5a8640254b12c36ac7ac68e/multidict-6.7.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0e161ddf326db5577c3a4cc2d8648f81456e8a20d40415541587a71620d7a7d1", size = 43219, upload-time = "2026-01-26T02:45:14.346Z" }, + { url = "https://files.pythonhosted.org/packages/24/bb/2c0c2287963f4259c85e8bcbba9182ced8d7fca65c780c38e99e61629d11/multidict-6.7.1-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:1e3a8bb24342a8201d178c3b4984c26ba81a577c80d4d525727427460a50c22d", size = 245132, upload-time = "2026-01-26T02:45:15.712Z" }, + { url = "https://files.pythonhosted.org/packages/a7/f9/44d4b3064c65079d2467888794dea218d1601898ac50222ab8a9a8094460/multidict-6.7.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:97231140a50f5d447d3164f994b86a0bed7cd016e2682f8650d6a9158e14fd31", size = 252420, upload-time = "2026-01-26T02:45:17.293Z" }, + { url = "https://files.pythonhosted.org/packages/8b/13/78f7275e73fa17b24c9a51b0bd9d73ba64bb32d0ed51b02a746eb876abe7/multidict-6.7.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6b10359683bd8806a200fd2909e7c8ca3a7b24ec1d8132e483d58e791d881048", size = 233510, upload-time = "2026-01-26T02:45:19.356Z" }, + { url = "https://files.pythonhosted.org/packages/4b/25/8167187f62ae3cbd52da7893f58cb036b47ea3fb67138787c76800158982/multidict-6.7.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:283ddac99f7ac25a4acadbf004cb5ae34480bbeb063520f70ce397b281859362", size = 264094, upload-time = "2026-01-26T02:45:20.834Z" }, + { url = "https://files.pythonhosted.org/packages/a1/e7/69a3a83b7b030cf283fb06ce074a05a02322359783424d7edf0f15fe5022/multidict-6.7.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:538cec1e18c067d0e6103aa9a74f9e832904c957adc260e61cd9d8cf0c3b3d37", size = 260786, upload-time = "2026-01-26T02:45:22.818Z" }, + { url = "https://files.pythonhosted.org/packages/fe/3b/8ec5074bcfc450fe84273713b4b0a0dd47c0249358f5d82eb8104ffe2520/multidict-6.7.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7eee46ccb30ff48a1e35bb818cc90846c6be2b68240e42a78599166722cea709", size = 248483, upload-time = "2026-01-26T02:45:24.368Z" }, + { url = "https://files.pythonhosted.org/packages/48/5a/d5a99e3acbca0e29c5d9cba8f92ceb15dce78bab963b308ae692981e3a5d/multidict-6.7.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:fa263a02f4f2dd2d11a7b1bb4362aa7cb1049f84a9235d31adf63f30143469a0", size = 248403, upload-time = "2026-01-26T02:45:25.982Z" }, + { url = "https://files.pythonhosted.org/packages/35/48/e58cd31f6c7d5102f2a4bf89f96b9cf7e00b6c6f3d04ecc44417c00a5a3c/multidict-6.7.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:2e1425e2f99ec5bd36c15a01b690a1a2456209c5deed58f95469ffb46039ccbb", size = 240315, upload-time = "2026-01-26T02:45:27.487Z" }, + { url = "https://files.pythonhosted.org/packages/94/33/1cd210229559cb90b6786c30676bb0c58249ff42f942765f88793b41fdce/multidict-6.7.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:497394b3239fc6f0e13a78a3e1b61296e72bf1c5f94b4c4eb80b265c37a131cd", size = 245528, upload-time = "2026-01-26T02:45:28.991Z" }, + { url = "https://files.pythonhosted.org/packages/64/f2/6e1107d226278c876c783056b7db43d800bb64c6131cec9c8dfb6903698e/multidict-6.7.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:233b398c29d3f1b9676b4b6f75c518a06fcb2ea0b925119fb2c1bc35c05e1601", size = 258784, upload-time = "2026-01-26T02:45:30.503Z" }, + { url = "https://files.pythonhosted.org/packages/4d/c1/11f664f14d525e4a1b5327a82d4de61a1db604ab34c6603bb3c2cc63ad34/multidict-6.7.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:93b1818e4a6e0930454f0f2af7dfce69307ca03cdcfb3739bf4d91241967b6c1", size = 251980, upload-time = "2026-01-26T02:45:32.603Z" }, + { url = "https://files.pythonhosted.org/packages/e1/9f/75a9ac888121d0c5bbd4ecf4eead45668b1766f6baabfb3b7f66a410e231/multidict-6.7.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f33dc2a3abe9249ea5d8360f969ec7f4142e7ac45ee7014d8f8d5acddf178b7b", size = 243602, upload-time = "2026-01-26T02:45:34.043Z" }, + { url = "https://files.pythonhosted.org/packages/9a/e7/50bf7b004cc8525d80dbbbedfdc7aed3e4c323810890be4413e589074032/multidict-6.7.1-cp314-cp314-win32.whl", hash = "sha256:3ab8b9d8b75aef9df299595d5388b14530839f6422333357af1339443cff777d", size = 40930, upload-time = "2026-01-26T02:45:36.278Z" }, + { url = "https://files.pythonhosted.org/packages/e0/bf/52f25716bbe93745595800f36fb17b73711f14da59ed0bb2eba141bc9f0f/multidict-6.7.1-cp314-cp314-win_amd64.whl", hash = "sha256:5e01429a929600e7dab7b166062d9bb54a5eed752384c7384c968c2afab8f50f", size = 45074, upload-time = "2026-01-26T02:45:37.546Z" }, + { url = "https://files.pythonhosted.org/packages/97/ab/22803b03285fa3a525f48217963da3a65ae40f6a1b6f6cf2768879e208f9/multidict-6.7.1-cp314-cp314-win_arm64.whl", hash = "sha256:4885cb0e817aef5d00a2e8451d4665c1808378dc27c2705f1bf4ef8505c0d2e5", size = 42471, upload-time = "2026-01-26T02:45:38.889Z" }, + { url = "https://files.pythonhosted.org/packages/e0/6d/f9293baa6146ba9507e360ea0292b6422b016907c393e2f63fc40ab7b7b5/multidict-6.7.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0458c978acd8e6ea53c81eefaddbbee9c6c5e591f41b3f5e8e194780fe026581", size = 82401, upload-time = "2026-01-26T02:45:40.254Z" }, + { url = "https://files.pythonhosted.org/packages/7a/68/53b5494738d83558d87c3c71a486504d8373421c3e0dbb6d0db48ad42ee0/multidict-6.7.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:c0abd12629b0af3cf590982c0b413b1e7395cd4ec026f30986818ab95bfaa94a", size = 48143, upload-time = "2026-01-26T02:45:41.635Z" }, + { url = "https://files.pythonhosted.org/packages/37/e8/5284c53310dcdc99ce5d66563f6e5773531a9b9fe9ec7a615e9bc306b05f/multidict-6.7.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:14525a5f61d7d0c94b368a42cff4c9a4e7ba2d52e2672a7b23d84dc86fb02b0c", size = 46507, upload-time = "2026-01-26T02:45:42.99Z" }, + { url = "https://files.pythonhosted.org/packages/e4/fc/6800d0e5b3875568b4083ecf5f310dcf91d86d52573160834fb4bfcf5e4f/multidict-6.7.1-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:17307b22c217b4cf05033dabefe68255a534d637c6c9b0cc8382718f87be4262", size = 239358, upload-time = "2026-01-26T02:45:44.376Z" }, + { url = "https://files.pythonhosted.org/packages/41/75/4ad0973179361cdf3a113905e6e088173198349131be2b390f9fa4da5fc6/multidict-6.7.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7a7e590ff876a3eaf1c02a4dfe0724b6e69a9e9de6d8f556816f29c496046e59", size = 246884, upload-time = "2026-01-26T02:45:47.167Z" }, + { url = "https://files.pythonhosted.org/packages/c3/9c/095bb28b5da139bd41fb9a5d5caff412584f377914bd8787c2aa98717130/multidict-6.7.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:5fa6a95dfee63893d80a34758cd0e0c118a30b8dcb46372bf75106c591b77889", size = 225878, upload-time = "2026-01-26T02:45:48.698Z" }, + { url = "https://files.pythonhosted.org/packages/07/d0/c0a72000243756e8f5a277b6b514fa005f2c73d481b7d9e47cd4568aa2e4/multidict-6.7.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a0543217a6a017692aa6ae5cc39adb75e587af0f3a82288b1492eb73dd6cc2a4", size = 253542, upload-time = "2026-01-26T02:45:50.164Z" }, + { url = "https://files.pythonhosted.org/packages/c0/6b/f69da15289e384ecf2a68837ec8b5ad8c33e973aa18b266f50fe55f24b8c/multidict-6.7.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f99fe611c312b3c1c0ace793f92464d8cd263cc3b26b5721950d977b006b6c4d", size = 252403, upload-time = "2026-01-26T02:45:51.779Z" }, + { url = "https://files.pythonhosted.org/packages/a2/76/b9669547afa5a1a25cd93eaca91c0da1c095b06b6d2d8ec25b713588d3a1/multidict-6.7.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9004d8386d133b7e6135679424c91b0b854d2d164af6ea3f289f8f2761064609", size = 244889, upload-time = "2026-01-26T02:45:53.27Z" }, + { url = "https://files.pythonhosted.org/packages/7e/a9/a50d2669e506dad33cfc45b5d574a205587b7b8a5f426f2fbb2e90882588/multidict-6.7.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e628ef0e6859ffd8273c69412a2465c4be4a9517d07261b33334b5ec6f3c7489", size = 241982, upload-time = "2026-01-26T02:45:54.919Z" }, + { url = "https://files.pythonhosted.org/packages/c5/bb/1609558ad8b456b4827d3c5a5b775c93b87878fd3117ed3db3423dfbce1b/multidict-6.7.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:841189848ba629c3552035a6a7f5bf3b02eb304e9fea7492ca220a8eda6b0e5c", size = 232415, upload-time = "2026-01-26T02:45:56.981Z" }, + { url = "https://files.pythonhosted.org/packages/d8/59/6f61039d2aa9261871e03ab9dc058a550d240f25859b05b67fd70f80d4b3/multidict-6.7.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:ce1bbd7d780bb5a0da032e095c951f7014d6b0a205f8318308140f1a6aba159e", size = 240337, upload-time = "2026-01-26T02:45:58.698Z" }, + { url = "https://files.pythonhosted.org/packages/a1/29/fdc6a43c203890dc2ae9249971ecd0c41deaedfe00d25cb6564b2edd99eb/multidict-6.7.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b26684587228afed0d50cf804cc71062cc9c1cdf55051c4c6345d372947b268c", size = 248788, upload-time = "2026-01-26T02:46:00.862Z" }, + { url = "https://files.pythonhosted.org/packages/a9/14/a153a06101323e4cf086ecee3faadba52ff71633d471f9685c42e3736163/multidict-6.7.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:9f9af11306994335398293f9958071019e3ab95e9a707dc1383a35613f6abcb9", size = 242842, upload-time = "2026-01-26T02:46:02.824Z" }, + { url = "https://files.pythonhosted.org/packages/41/5f/604ae839e64a4a6efc80db94465348d3b328ee955e37acb24badbcd24d83/multidict-6.7.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b4938326284c4f1224178a560987b6cf8b4d38458b113d9b8c1db1a836e640a2", size = 240237, upload-time = "2026-01-26T02:46:05.898Z" }, + { url = "https://files.pythonhosted.org/packages/5f/60/c3a5187bf66f6fb546ff4ab8fb5a077cbdd832d7b1908d4365c7f74a1917/multidict-6.7.1-cp314-cp314t-win32.whl", hash = "sha256:98655c737850c064a65e006a3df7c997cd3b220be4ec8fe26215760b9697d4d7", size = 48008, upload-time = "2026-01-26T02:46:07.468Z" }, + { url = "https://files.pythonhosted.org/packages/0c/f7/addf1087b860ac60e6f382240f64fb99f8bfb532bb06f7c542b83c29ca61/multidict-6.7.1-cp314-cp314t-win_amd64.whl", hash = "sha256:497bde6223c212ba11d462853cfa4f0ae6ef97465033e7dc9940cdb3ab5b48e5", size = 53542, upload-time = "2026-01-26T02:46:08.809Z" }, + { url = "https://files.pythonhosted.org/packages/4c/81/4629d0aa32302ef7b2ec65c75a728cc5ff4fa410c50096174c1632e70b3e/multidict-6.7.1-cp314-cp314t-win_arm64.whl", hash = "sha256:2bbd113e0d4af5db41d5ebfe9ccaff89de2120578164f86a5d17d5a576d1e5b2", size = 44719, upload-time = "2026-01-26T02:46:11.146Z" }, + { url = "https://files.pythonhosted.org/packages/81/08/7036c080d7117f28a4af526d794aab6a84463126db031b007717c1a6676e/multidict-6.7.1-py3-none-any.whl", hash = "sha256:55d97cc6dae627efa6a6e548885712d4864b81110ac76fa4e534c03819fa4a56", size = 12319, upload-time = "2026-01-26T02:46:44.004Z" }, +] + +[[package]] +name = "nbclient" +version = "0.11.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "jupyter-client" }, + { name = "jupyter-core" }, + { name = "nbformat" }, + { name = "traitlets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/28/a5/b3bae4b590c0cbcada2c63a34f7580024e834a8ba213e949a2f906705787/nbclient-0.11.0.tar.gz", hash = "sha256:04a134a5b087f2c5887f228aca155db50169b8cd9334dee6942c8e927e56081a", size = 62535, upload-time = "2026-06-05T07:52:41.746Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/36/c9/94d73e5a01c5b926c3fa2496e97d7a8dc28ed5a77c0b2ed712f1a62e6694/nbclient-0.11.0-py3-none-any.whl", hash = "sha256:ef7fa0d59d6e1d41103933d8a445a18d5de860ca6b613b87b8574accdb3c2895", size = 25288, upload-time = "2026-06-05T07:52:40.115Z" }, +] + +[[package]] +name = "nbformat" +version = "5.11.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "fastjsonschema" }, + { name = "jsonschema" }, + { name = "jupyter-core" }, + { name = "traitlets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b2/fd/80f407a9525bc5bd9865e5c37db3b78867fa43217f8aac5eab22b5f028b3/nbformat-5.11.0.tar.gz", hash = "sha256:7dbaed4a69cae28c2b4d44ab7430a6af4544fb89455023f6f21550be757b60c8", size = 151822, upload-time = "2026-08-06T12:29:55.597Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/be/4a/0eece9dad5e73230ca972f7bc29456ce7d74772f123d401fcf67379008f7/nbformat-5.11.0-py3-none-any.whl", hash = "sha256:f70a17f591a9ccd1c601d5e61a4b20972703926df0ba42458ce14bf575766bb6", size = 79820, upload-time = "2026-08-06T12:29:54.178Z" }, +] + +[[package]] +name = "nest-asyncio2" +version = "1.7.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b4/73/731debf26e27e0a0323d7bda270dc2f634b398e38f040a09da1f4351d0aa/nest_asyncio2-1.7.2.tar.gz", hash = "sha256:1921d70b92cc4612c374928d081552efb59b83d91b2b789d935c665fa01729a8", size = 14743, upload-time = "2026-02-13T00:34:04.386Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c5/3c/3179b85b0e1c3659f0369940200cd6d0fa900e6cefcc7ea0bc6dd0e29ffb/nest_asyncio2-1.7.2-py3-none-any.whl", hash = "sha256:f5dfa702f3f81f6a03857e9a19e2ba578c0946a4ad417b4c50a24d7ba641fe01", size = 7843, upload-time = "2026-02-13T00:34:02.691Z" }, +] + +[[package]] +name = "numcodecs" +version = "0.16.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/44/bd/8a391e7c356366224734efd24da929cc4796fff468bfb179fe1af6548535/numcodecs-0.16.5.tar.gz", hash = "sha256:0d0fb60852f84c0bd9543cc4d2ab9eefd37fc8efcc410acd4777e62a1d300318", size = 6276387, upload-time = "2025-11-21T02:49:48.986Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/75/cc/55420f3641a67f78392dc0bc5d02cb9eb0a9dcebf2848d1ac77253ca61fa/numcodecs-0.16.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:24e675dc8d1550cd976a99479b87d872cb142632c75cc402fea04c08c4898523", size = 1656287, upload-time = "2025-11-21T02:49:25.755Z" }, + { url = "https://files.pythonhosted.org/packages/f5/6c/86644987505dcb90ba6d627d6989c27bafb0699f9fd00187e06d05ea8594/numcodecs-0.16.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:94ddfa4341d1a3ab99989d13b01b5134abb687d3dab2ead54b450aefe4ad5bd6", size = 1148899, upload-time = "2025-11-21T02:49:26.87Z" }, + { url = "https://files.pythonhosted.org/packages/97/1e/98aaddf272552d9fef1f0296a9939d1487914a239e98678f6b20f8b0a5c8/numcodecs-0.16.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b554ab9ecf69de7ca2b6b5e8bc696bd9747559cb4dd5127bd08d7a28bec59c3a", size = 8534814, upload-time = "2025-11-21T02:49:28.547Z" }, + { url = "https://files.pythonhosted.org/packages/fb/53/78c98ef5c8b2b784453487f3e4d6c017b20747c58b470393e230c78d18e8/numcodecs-0.16.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ad1a379a45bd3491deab8ae6548313946744f868c21d5340116977ea3be5b1d6", size = 9173471, upload-time = "2025-11-21T02:49:30.444Z" }, + { url = "https://files.pythonhosted.org/packages/1c/20/2fdec87fc7f8cec950d2b0bea603c12dc9f05b4966dc5924ba5a36a61bf6/numcodecs-0.16.5-cp312-cp312-win_amd64.whl", hash = "sha256:845a9857886ffe4a3172ba1c537ae5bcc01e65068c31cf1fce1a844bd1da050f", size = 801412, upload-time = "2025-11-21T02:49:32.123Z" }, + { url = "https://files.pythonhosted.org/packages/38/38/071ced5a5fd1c85ba0e14ba721b66b053823e5176298c2f707e50bed11d9/numcodecs-0.16.5-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:25be3a516ab677dad890760d357cfe081a371d9c0a2e9a204562318ac5969de3", size = 1654359, upload-time = "2025-11-21T02:49:33.673Z" }, + { url = "https://files.pythonhosted.org/packages/d1/c0/5f84ba7525577c1b9909fc2d06ef11314825fc4ad4378f61d0e4c9883b4a/numcodecs-0.16.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0107e839ef75b854e969cb577e140b1aadb9847893937636582d23a2a4c6ce50", size = 1144237, upload-time = "2025-11-21T02:49:35.294Z" }, + { url = "https://files.pythonhosted.org/packages/0b/00/787ea5f237b8ea7bc67140c99155f9c00b5baf11c49afc5f3bfefa298f95/numcodecs-0.16.5-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:015a7c859ecc2a06e2a548f64008c0ec3aaecabc26456c2c62f4278d8fc20597", size = 8483064, upload-time = "2025-11-21T02:49:36.454Z" }, + { url = "https://files.pythonhosted.org/packages/c4/e6/d359fdd37498e74d26a167f7a51e54542e642ea47181eb4e643a69a066c3/numcodecs-0.16.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:84230b4b9dad2392f2a84242bd6e3e659ac137b5a1ce3571d6965fca673e0903", size = 9126063, upload-time = "2025-11-21T02:49:38.018Z" }, + { url = "https://files.pythonhosted.org/packages/27/72/6663cc0382ddbb866136c255c837bcb96cc7ce5e83562efec55e1b995941/numcodecs-0.16.5-cp313-cp313-win_amd64.whl", hash = "sha256:5088145502ad1ebf677ec47d00eb6f0fd600658217db3e0c070c321c85d6cf3d", size = 799275, upload-time = "2025-11-21T02:49:39.558Z" }, + { url = "https://files.pythonhosted.org/packages/3c/9e/38e7ca8184c958b51f45d56a4aeceb1134ecde2d8bd157efadc98502cc42/numcodecs-0.16.5-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:b05647b8b769e6bc8016e9fd4843c823ce5c9f2337c089fb5c9c4da05e5275de", size = 1654721, upload-time = "2025-11-21T02:49:40.602Z" }, + { url = "https://files.pythonhosted.org/packages/a1/37/260fa42e7b2b08e6e00ad632f8dd620961a60a459426c26cea390f8c68d0/numcodecs-0.16.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:3832bd1b5af8bb3e413076b7d93318c8e7d7b68935006b9fa36ca057d1725a8f", size = 1146887, upload-time = "2025-11-21T02:49:41.721Z" }, + { url = "https://files.pythonhosted.org/packages/4e/15/e2e1151b5a8b14a15dfd4bb4abccce7fff7580f39bc34092780088835f3a/numcodecs-0.16.5-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:49f7b7d24f103187f53135bed28bb9f0ed6b2e14c604664726487bb6d7c882e1", size = 8476987, upload-time = "2025-11-21T02:49:43.363Z" }, + { url = "https://files.pythonhosted.org/packages/6d/30/16a57fc4d9fb0ba06c600408bd6634f2f1753c54a7a351c99c5e09b51ee2/numcodecs-0.16.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:aec9736d81b70f337d89c4070ee3ffeff113f386fd789492fa152d26a15043e4", size = 9102377, upload-time = "2025-11-21T02:49:45.508Z" }, + { url = "https://files.pythonhosted.org/packages/31/a5/a0425af36c20d55a3ea884db4b4efca25a43bea9214ba69ca7932dd997b4/numcodecs-0.16.5-cp314-cp314-win_amd64.whl", hash = "sha256:b16a14303800e9fb88abc39463ab4706c037647ac17e49e297faa5f7d7dbbf1d", size = 819022, upload-time = "2025-11-21T02:49:47.39Z" }, +] + +[[package]] +name = "numpy" +version = "2.5.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/22/fd/89965aa4ac08c74998539fcbf24fa3540f3e15237fbeb6bcf9c908f4aade/numpy-2.5.1.tar.gz", hash = "sha256:a48a113e6afea91f5608793bafa7ef2ad481fefbda87ec5069f483de61cb9fa3", size = 20755553, upload-time = "2026-07-04T17:08:00.933Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/7b/14687aa674250e5e546f616f486b0d56d3631cd5b2415739141ce40bdcea/numpy-2.5.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2c889b56fe48b1018f764b0eec8df59ab654e9148aa91faa12596043500de277", size = 16801574, upload-time = "2026-07-04T17:06:12.423Z" }, + { url = "https://files.pythonhosted.org/packages/e1/19/cc5bb2a3f2913d27d6dbb2c78d25921fabaedc6741d4a5a615a11f3c5bf3/numpy-2.5.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ab451b59c5643c570974c43aef780703ef1d3b4965d2be07afd530615a9358d1", size = 11772250, upload-time = "2026-07-04T17:06:15.726Z" }, + { url = "https://files.pythonhosted.org/packages/42/77/fdf34a71dd30f54979b18603bee915e0aaf825b07afe79acd60b04b691e2/numpy-2.5.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:78798bd5b9ad744056af8efa90e3b9ddaa53272a0848a483084a1cc0a13b2dc0", size = 5331516, upload-time = "2026-07-04T17:06:17.913Z" }, + { url = "https://files.pythonhosted.org/packages/ce/e2/eb7efa015b4cce41e2517bf182a7fce0d7d5b9d9ed76a29bfa0f4fe4505c/numpy-2.5.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:2ae0ca40bcb22d6ba59c1dfd5446f49940b0f2d821fde133f10dda11f816b84e", size = 6664863, upload-time = "2026-07-04T17:06:20.02Z" }, + { url = "https://files.pythonhosted.org/packages/a9/4b/a2b32dd94ee9ffbeecb28152240042a3949db33b1c834d44090b80e1b3b8/numpy-2.5.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:61ac47e772e6b8ea489e1d2f441a34c5c3ac17327e7ce294cbdf535795ad4e75", size = 15167977, upload-time = "2026-07-04T17:06:21.621Z" }, + { url = "https://files.pythonhosted.org/packages/b8/a9/6e73d68500f80773f65f0654ea932019d6694329a0eb0ed0533de38df376/numpy-2.5.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:59fda5e192b570217ec2580c96f00e9a7e12ef6866a900eb089b62c1a32545ca", size = 16672469, upload-time = "2026-07-04T17:06:24.064Z" }, + { url = "https://files.pythonhosted.org/packages/24/7d/ad3e59015135f5261c95fd4cafeff159c955febd83a99a1d9250c4233815/numpy-2.5.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f7119ebff1a9829e9f431a4f9d28e703023bb6b9fe7c8f724467dbfc27c94ab3", size = 16527531, upload-time = "2026-07-04T17:06:26.69Z" }, + { url = "https://files.pythonhosted.org/packages/83/d0/a39b2fbcde9cb17a1dac678f254b33a6336298af9df338824c685425d5e8/numpy-2.5.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e824c2acf8862052246be5a44c15da1777940c60d010dd2aab897824d9c430f9", size = 18431940, upload-time = "2026-07-04T17:06:29.521Z" }, + { url = "https://files.pythonhosted.org/packages/04/12/cff070947791c1ed425ff76413189adbdc2fbe215eba7ce7fa454a03c7f8/numpy-2.5.1-cp312-cp312-win32.whl", hash = "sha256:08d60c810432eb83360958dea0999ac4cfb94531ea8efcbf0b7f277c2068aeb2", size = 6066764, upload-time = "2026-07-04T17:06:32.571Z" }, + { url = "https://files.pythonhosted.org/packages/65/66/53f31807a48a750f9d748da273bc3fcedd12b27ff1f3e373bfec55ef2dc0/numpy-2.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:f7d60026c0bdb1380e83bfa7a0419c4577ee4b9a08880afcb6dadeb74c649fa2", size = 12430966, upload-time = "2026-07-04T17:06:34.926Z" }, + { url = "https://files.pythonhosted.org/packages/2b/2a/d1a88066b1c14186f5d3c0d18c94f17b064511982bab0578d49ee9d43c29/numpy-2.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:17a25e09640602e10bc8de0e6fa2b3fd68eedd84ba6d7842dc8f32f9ab87bd0b", size = 10350488, upload-time = "2026-07-04T17:06:37.785Z" }, + { url = "https://files.pythonhosted.org/packages/eb/07/ec2a3f0c91761581d4b7104a740791800025983f9a4dc4e73f91a99aeac4/numpy-2.5.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0bfebd8695f9863592fe744be833a258120b14a9f39da255e8aa8fade2c0ddd1", size = 16796419, upload-time = "2026-07-04T17:06:40.37Z" }, + { url = "https://files.pythonhosted.org/packages/ab/ab/ddb499fc4f8780354395face5b65c7fd107bcd6e1d667a5f07d046956f6f/numpy-2.5.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:30b44a6b53a7ae63c54c089a8726e5563ed302716c5b7ccc85afade40b0e7ff6", size = 11765832, upload-time = "2026-07-04T17:06:42.768Z" }, + { url = "https://files.pythonhosted.org/packages/88/b3/3c28c558a09fc72100c646dac6d2fce8e834c471b0edca01a29996706117/numpy-2.5.1-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:6165343f81b56ef8f514f396989e529b61d9dc709b99421b07e9f3e698e2287d", size = 5325143, upload-time = "2026-07-04T17:06:45.466Z" }, + { url = "https://files.pythonhosted.org/packages/5e/0e/ce19b985bb15c596f4f05954e76cccc77c845083b3b8f938a6c68e523128/numpy-2.5.1-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:4939237038ada79308dda3204ac6462df056b5672b2e25db1149cf873668b3e1", size = 6659749, upload-time = "2026-07-04T17:06:47.288Z" }, + { url = "https://files.pythonhosted.org/packages/2e/20/1ee6614d64332a1bba6411f38e68cb79eec1b2459e20a623777c5c5492a2/numpy-2.5.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1c6759f538fb912fc46de0a6b1758ccf7b57bc7c7ebebc23974fdac3de8db0cd", size = 15164716, upload-time = "2026-07-04T17:06:49.494Z" }, + { url = "https://files.pythonhosted.org/packages/ed/a7/2bcd3fdbb87804755c35b729bf8709d62025c5f4cfd7d5b2415997097515/numpy-2.5.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9726558e8db4a5bf7929a70ae50f63abda4daf0efe810e3bfbab95976f75fc1a", size = 16661440, upload-time = "2026-07-04T17:06:52.061Z" }, + { url = "https://files.pythonhosted.org/packages/fc/d7/a41e3310c886fe457d36e670bbf24fae411aca8a7b6ad92a32afd924077c/numpy-2.5.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3935f3b419b244a02732676fa5317a9193cc596a4c0646db07e5b421229ac9f7", size = 16526305, upload-time = "2026-07-04T17:06:54.605Z" }, + { url = "https://files.pythonhosted.org/packages/53/75/4333a9a707c1edd3a4e1a0c58eca52c0f31e55089fa80db02b5565b24df7/numpy-2.5.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:dc932a65ded7ce9013d120845a2514dcccb1a67bfc8deb8d37633762951904a6", size = 18423008, upload-time = "2026-07-04T17:06:57.54Z" }, + { url = "https://files.pythonhosted.org/packages/ee/90/e314a32b1c11a2ffe818ddad3a57b50b4b6e1b6c487192eb50cdef0415d0/numpy-2.5.1-cp313-cp313-win32.whl", hash = "sha256:4b4ff1608417eb7a59da7b967bbb798cacfe071d2caf526a24281cd562072ed9", size = 6063885, upload-time = "2026-07-04T17:07:00.14Z" }, + { url = "https://files.pythonhosted.org/packages/10/70/800b3fca480af32df9e8ea9f3d4a0c8feb4b32d7f195d174eabbda4829ad/numpy-2.5.1-cp313-cp313-win_amd64.whl", hash = "sha256:6c3fe51bc6a16453d452997053454f309e8e0ed7b42d6b361ce4ac8c32913d74", size = 12425674, upload-time = "2026-07-04T17:07:02.387Z" }, + { url = "https://files.pythonhosted.org/packages/8b/0b/196350c122f50f6ca56846f2d71efd5e0d24b7b2e07355e019b2e2c7a11e/numpy-2.5.1-cp313-cp313-win_arm64.whl", hash = "sha256:f7feb014281029e628ba2d5a007407443b06e418b6fe451d1e2adcbc8eba0107", size = 10350256, upload-time = "2026-07-04T17:07:04.878Z" }, + { url = "https://files.pythonhosted.org/packages/db/f4/731b6085a83faf6ca843394cbd5e217280c214399f7e8b21b9f552af0ae2/numpy-2.5.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:7c786fe9a5bbe360022e584c5a34cf6b54265c71bd7ec8ac3d8fec38968071f8", size = 16795063, upload-time = "2026-07-04T17:07:07.374Z" }, + { url = "https://files.pythonhosted.org/packages/bf/64/0e215f2048dd11a55bb989ed41b3585ef57452404e638d703a211a3e4157/numpy-2.5.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:32985c896d897419ef8da6917872d80b78ad0ea26d85b23245c7366ffde76d75", size = 11776652, upload-time = "2026-07-04T17:07:09.907Z" }, + { url = "https://files.pythonhosted.org/packages/b5/59/2b844c7a6e9deff69b404a66221e1542937734f65d5e6e39411876053862/numpy-2.5.1-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:efd736408cc97c79b9e6917338dfc8f06013b2274f992e96b1d9a81a71e2a2c2", size = 5335944, upload-time = "2026-07-04T17:07:12.227Z" }, + { url = "https://files.pythonhosted.org/packages/86/51/9bf7cb2cabcebc9e017e4ec7e6322b378317a542c08b4cb68479c1efc716/numpy-2.5.1-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:ab84dc6b074fa881cae55bea94cc4f68e285181ba7f32497bf7dee6b1496165b", size = 6656266, upload-time = "2026-07-04T17:07:14.368Z" }, + { url = "https://files.pythonhosted.org/packages/83/3e/fb7615b211b82a32f44d5180a6d421b61f84d4fadd578b48ba4ac34e189f/numpy-2.5.1-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caf3e317d33d60c37986b452613f4ab51246d0691350c03d0cb4a898627f4a95", size = 15179720, upload-time = "2026-07-04T17:07:16.272Z" }, + { url = "https://files.pythonhosted.org/packages/41/5f/0f992cb24560673496c5d68de61913b57166ce530ffda07c1f280e0cc464/numpy-2.5.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:54ad769f17bc2d833b620851989f62054fb9ab93c969d9e1dc3c8e3d56beea21", size = 16664835, upload-time = "2026-07-04T17:07:19.021Z" }, + { url = "https://files.pythonhosted.org/packages/a2/2f/97d6475ee91afe2587797d09446f9d3e475ad4cb681662d824809327b75a/numpy-2.5.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c12afb53450fa976d4c681c50a7423729a4c51c0465ed9f32b8a9cabbc472373", size = 16539135, upload-time = "2026-07-04T17:07:22.015Z" }, + { url = "https://files.pythonhosted.org/packages/c4/5b/4db81e4ba0be7e2776b1de68c82aa862c7f8ec27e1b4927d4ae075e20678/numpy-2.5.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:e8c11c405efc5ff6816d5983c96cdfa215bab3428961243af3ff59b228490438", size = 18426684, upload-time = "2026-07-04T17:07:24.941Z" }, + { url = "https://files.pythonhosted.org/packages/1f/64/c0ba2d90724d450279a7df8f32057241070250a26a7e2b5337d77347f481/numpy-2.5.1-cp314-cp314-win32.whl", hash = "sha256:f2479a47f8d5932d1718168a681ad6e536a9df484c83cfcf9de365e164537ace", size = 6116103, upload-time = "2026-07-04T17:07:27.622Z" }, + { url = "https://files.pythonhosted.org/packages/c1/1a/837f9ed7405adcd7a40538792eb169eddd8fa5630c16a1ef49dae71a30f4/numpy-2.5.1-cp314-cp314-win_amd64.whl", hash = "sha256:24d0eb82c0541d3415a33425db64ae439dffccd7b4dbcb30e7c35120205c506a", size = 12562177, upload-time = "2026-07-04T17:07:29.887Z" }, + { url = "https://files.pythonhosted.org/packages/22/ed/49707938b6dd0a78a9178dd93227dc89e4c11af47f5c798d70366e8d0483/numpy-2.5.1-cp314-cp314-win_arm64.whl", hash = "sha256:5a4c988b38d261deeeaad9954e3deb091ad905c94e8bb6708654ef1d97f286b0", size = 10627739, upload-time = "2026-07-04T17:07:32.568Z" }, + { url = "https://files.pythonhosted.org/packages/a6/c7/bb4b882cfe7f299cbc8b66e42e7dd78cf9d14e40f9469fc5e3db7e15b3bd/numpy-2.5.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a33276be12fa045805f477f22482088b66bb758ffbe89a9d21457de863a32e22", size = 11894709, upload-time = "2026-07-04T17:07:34.941Z" }, + { url = "https://files.pythonhosted.org/packages/40/3f/5af7f4a7f6224aef48017aa82bb6174c7a659d724be0c75017b7e64a55b4/numpy-2.5.1-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:f089d7b00756190aacf1f5d34bdf38c3c430ac82b4f868f8cede73380460fce7", size = 5453810, upload-time = "2026-07-04T17:07:37.495Z" }, + { url = "https://files.pythonhosted.org/packages/20/c9/3474309bc94d634d3f9c3eddf03250ecb8c22cd948ef16fef69a77cc5d7b/numpy-2.5.1-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:09e9bfd8d2cf479c7d174804fb3811c53a8e9f20a37444008606b57d6b7a826d", size = 6761189, upload-time = "2026-07-04T17:07:39.563Z" }, + { url = "https://files.pythonhosted.org/packages/90/8a/558ae39fdd55d7e7f7fef9a84a6e964ac6b23edbd2a07e52bb084500507d/numpy-2.5.1-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e68d8dd1e7eba712948f2053a29ec86917bc70ba1358df869d9f06649ef9cf09", size = 15225039, upload-time = "2026-07-04T17:07:41.682Z" }, + { url = "https://files.pythonhosted.org/packages/63/27/ca7392b2d030277bdf0273e7d23255b3ee57d57a7c170a6f4fb3981e1e5d/numpy-2.5.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:99d5095fa265a0c4152e7bb12759e14381ef5496152f1ce58f44bdf55c44beb4", size = 16701306, upload-time = "2026-07-04T17:07:44.611Z" }, + { url = "https://files.pythonhosted.org/packages/02/42/03d53ae7996c44d4374a8262e9dc41671fd56cbb98f7d47ef85cf5da4c6b/numpy-2.5.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ab87a91b3cc3382b8956095bd8f95e00cf679bb81554339be1a2ba404a1473c1", size = 16589955, upload-time = "2026-07-04T17:07:47.694Z" }, + { url = "https://files.pythonhosted.org/packages/7b/15/6c1784ae469640e65db111e9a34b3d0f14d91e8a38b9ce34810ced370dbb/numpy-2.5.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:224ca51130ef7da85bea2191625181cb4f337f9cb64b471f10c1a12aa8b60077", size = 18464252, upload-time = "2026-07-04T17:07:50.684Z" }, + { url = "https://files.pythonhosted.org/packages/94/a8/f98e50356cf167df656c526c2dfeec2d7dde182f2a3da4b458a5938e2776/numpy-2.5.1-cp314-cp314t-win32.whl", hash = "sha256:6eab239876581b2b3c5a242281b6007bbdbcd1c7085d7709bb57c5929b11e6bf", size = 6263298, upload-time = "2026-07-04T17:07:53.445Z" }, + { url = "https://files.pythonhosted.org/packages/72/ac/96ae880cdecad0b3275d9359fcec72667b49a4863c9f12942e43679dda02/numpy-2.5.1-cp314-cp314t-win_amd64.whl", hash = "sha256:83ce9c80d5b521b0d77ddcbe5447c218d247929b6cc056ca5351342accfff0af", size = 12748623, upload-time = "2026-07-04T17:07:55.384Z" }, + { url = "https://files.pythonhosted.org/packages/a1/5a/4d2b1601df3602dba7a14f3348ba9bfe94a18adb428e693df6154c293831/numpy-2.5.1-cp314-cp314t-win_arm64.whl", hash = "sha256:5a6db61f9aaa57e369905c67d852045d3c4f7126405b29d09b19dec118e9c9cb", size = 10697674, upload-time = "2026-07-04T17:07:58.506Z" }, +] + +[[package]] +name = "packaging" +version = "26.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" }, +] + +[[package]] +name = "paginate" +version = "0.5.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ec/46/68dde5b6bc00c1296ec6466ab27dddede6aec9af1b99090e1107091b3b84/paginate-0.5.7.tar.gz", hash = "sha256:22bd083ab41e1a8b4f3690544afb2c60c25e5c9a63a30fa2f483f6c60c8e5945", size = 19252, upload-time = "2024-08-25T14:17:24.139Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/90/96/04b8e52da071d28f5e21a805b19cb9390aa17a47462ac87f5e2696b9566d/paginate-0.5.7-py2.py3-none-any.whl", hash = "sha256:b885e2af73abcf01d9559fd5216b57ef722f8c42affbb63942377668e35c7591", size = 13746, upload-time = "2024-08-25T14:17:22.55Z" }, +] + +[[package]] +name = "parso" +version = "0.8.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/30/4b/90c937815137d43ce71ba043cd3566221e9df6b9c805f24b5d138c9d40a7/parso-0.8.7.tar.gz", hash = "sha256:eaaac4c9fdd5e9e8852dc778d2d7405897ec510f2a298071453e5e3a07914bb1", size = 401824, upload-time = "2026-05-01T23:13:02.138Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/99/5d/8268b644392ee874ee82a635cd0df1773de230bde356c38de28e298392cc/parso-0.8.7-py2.py3-none-any.whl", hash = "sha256:a8926eb2a1b915486941fdbd31e86a4baf88fe8c210f25f2f35ecec5b574ca1c", size = 107025, upload-time = "2026-05-01T23:12:58.867Z" }, +] + +[[package]] +name = "pathspec" +version = "1.1.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/82/42f767fc1c1143d6fd36efb827202a2d997a375e160a71eb2888a925aac1/pathspec-1.1.1.tar.gz", hash = "sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a", size = 135180, upload-time = "2026-04-27T01:46:08.907Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f1/d9/7fb5aa316bc299258e68c73ba3bddbc499654a07f151cba08f6153988714/pathspec-1.1.1-py3-none-any.whl", hash = "sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189", size = 57328, upload-time = "2026-04-27T01:46:07.06Z" }, +] + +[[package]] +name = "pexpect" +version = "4.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "ptyprocess" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/42/92/cc564bf6381ff43ce1f4d06852fc19a2f11d180f23dc32d9588bee2f149d/pexpect-4.9.0.tar.gz", hash = "sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f", size = 166450, upload-time = "2023-11-25T09:07:26.339Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9e/c3/059298687310d527a58bb01f3b1965787ee3b40dce76752eda8b44e9a2c5/pexpect-4.9.0-py2.py3-none-any.whl", hash = "sha256:7236d1e080e4936be2dc3e326cec0af72acf9212a7e1d060210e70a47e253523", size = 63772, upload-time = "2023-11-25T06:56:14.81Z" }, +] + +[[package]] +name = "platformdirs" +version = "4.11.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e5/98/0bf930c4f97d0266b58a89e36c015f56232c52b5d2f207215d48cca9e8f7/platformdirs-4.11.2.tar.gz", hash = "sha256:3a2ae5fca3520a01ab1be8b45613537f52ddf5b5f6f53d88233892dfbf0cd82d", size = 32716, upload-time = "2026-08-10T15:48:06.092Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/e2/4e6eee633809c376c024821b91ade709cbfd040ec53939ffbcc292aa7eee/platformdirs-4.11.2-py3-none-any.whl", hash = "sha256:7f89089b6ea71bda7962953edcf784b2e2d9d285b40ad88be2bb75c6e9d82ab4", size = 23361, upload-time = "2026-08-10T15:48:04.855Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "prompt-toolkit" +version = "3.0.53" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "wcwidth" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7d/ea/39b988c938f75cb75d7045b5c69f8bfed47ee2152c8837fb403de29d6fb8/prompt_toolkit-3.0.53.tar.gz", hash = "sha256:9ec8a0ad96d5c56148b3f914aa79c1564c3fde5d2e6b876e7bc327e353cf8fa6", size = 435492, upload-time = "2026-07-26T20:56:14.758Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/6f/84908cad2d6aa5144abcf7b42709fe4fdb459bc640ec7ac5786e7693dabc/prompt_toolkit-3.0.53-py3-none-any.whl", hash = "sha256:01c0891d7f9237d5e339f7d3e42cdae80b7534abb1c7c0e3352efba6231492f2", size = 392288, upload-time = "2026-07-26T20:56:12.512Z" }, +] + +[[package]] +name = "propcache" +version = "0.5.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ec/44/c87281c333769159c50594f22610f77398a47ccbfbbf23074e744e86f87c/propcache-0.5.2.tar.gz", hash = "sha256:01c4fc7480cd0598bb4b57022df55b9ca296da7fc5a8760bd8451a7e63a7d427", size = 50208, upload-time = "2026-05-08T21:02:12.199Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4a/cb/e27bc2b2737a0bb49962b275efa051e8f1c35a936df7d5139b6b658b7dc9/propcache-0.5.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:806719138ecd720339a12410fb9614ac9b2b2d3a5fdf8235d56981c36f4039ba", size = 95887, upload-time = "2026-05-08T21:00:11.277Z" }, + { url = "https://files.pythonhosted.org/packages/e6/13/b8ae04c59392f8d11c6cd9fb4011d1dc7c86b81225c770280300e259ffe1/propcache-0.5.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:db2b80ea58eab4f86b2beec3cc8b39e8ff9276ac20e96b7cce43c8ae84cd6b5a", size = 54654, upload-time = "2026-05-08T21:00:12.604Z" }, + { url = "https://files.pythonhosted.org/packages/2c/7d/49777a3e20b55863d4794384a38acd460c04157b0a00f8602b0d508b8431/propcache-0.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e5cbfac9f61484f7e9f3597775500cd3ebe8274e9b050c38f9525c77c97520bf", size = 55190, upload-time = "2026-05-08T21:00:13.935Z" }, + { url = "https://files.pythonhosted.org/packages/44/c7/085d0cd63062e84044e3f05797749c3f8e3938ff3aeb0eb2f69d43fafc91/propcache-0.5.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5dbc581d2814337da56222fab8dc5f161cd798a434e49bac27930aaef798e144", size = 59995, upload-time = "2026-05-08T21:00:15.526Z" }, + { url = "https://files.pythonhosted.org/packages/9c/42/32cf8e3009e92b2645cf1e944f701e8ea4e924dffde1ee26db860bcbf7e4/propcache-0.5.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:857187f381f88c8e2fa2fe56ab94879d011b883d5a2ee5a1b60a8cd2a06846d9", size = 63422, upload-time = "2026-05-08T21:00:16.824Z" }, + { url = "https://files.pythonhosted.org/packages/9e/1b/f112433f99fc979431b87a39ef169e3f8df070d99a72792c56d6937ac48b/propcache-0.5.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:178b4a2cdaac1818e2bf1c5a99b94383fa73ea5382e032a48dec07dc5668dc42", size = 64342, upload-time = "2026-05-08T21:00:18.362Z" }, + { url = "https://files.pythonhosted.org/packages/14/15/5574111ae50dd6e879456888c0eadd4c5a869959775854e18e18a6b345f3/propcache-0.5.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6f328175a2cde1f0ff2c4ed8ce968b9dcfb55f3a7153f39e2957ed994da13476", size = 61639, upload-time = "2026-05-08T21:00:19.692Z" }, + { url = "https://files.pythonhosted.org/packages/cc/da/4d775080b1490c0ae604acda868bd71aabe3a89ed16f2aa4339eb8a283e7/propcache-0.5.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5671d09a36b06d0fd4a3da0fccbcae360e9b1570924171a15e9e0997f0249fba", size = 61588, upload-time = "2026-05-08T21:00:21.155Z" }, + { url = "https://files.pythonhosted.org/packages/04/ac/f076982cbe2195ee9cf32de5a1e46951d9fb399fc207f390562dd0fd8fb2/propcache-0.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:80168e2ebe4d3ec6599d10ad8f520304ae1cad9b6c5a95372aef1b66b7bfb53a", size = 60029, upload-time = "2026-05-08T21:00:22.713Z" }, + { url = "https://files.pythonhosted.org/packages/70/60/189be62e0dd898dce3b331e1b8c7a543cd3a405ac0c81fe8ee8a9d5d77e1/propcache-0.5.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:45f11346f884bc47444f6e6647131055844134c3175b629f84952e2b5cd62b64", size = 56774, upload-time = "2026-05-08T21:00:24.001Z" }, + { url = "https://files.pythonhosted.org/packages/ea/9e/93377b9c7939c1ffae98f878dee955efadfd638078bc86dbc21f9d52f651/propcache-0.5.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8e778ebd44ef4f66ed60a0416b06b489687db264a9c0b3620362f26489492913", size = 63532, upload-time = "2026-05-08T21:00:25.545Z" }, + { url = "https://files.pythonhosted.org/packages/14/f9/590ef6cfb9b8028d516d287812ece32bb0bc5f11fbb9c8bf6b2e6313fec8/propcache-0.5.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:c0cb9ed24c8964e172768d455a38254c2dd8a552905729ce006cad3d3dda59b1", size = 61592, upload-time = "2026-05-08T21:00:27.186Z" }, + { url = "https://files.pythonhosted.org/packages/b4/5e/70958b3034c297a630bba2f17ca7abc2d5f39a803ad7e370ab79d1ecd022/propcache-0.5.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:1d1ad32d9d4355e2be65574fd0bfd3677e7066b009cd5b9b2dee8aa6a6393b33", size = 64788, upload-time = "2026-05-08T21:00:28.8Z" }, + { url = "https://files.pythonhosted.org/packages/12/fd/77fe5936d8c3086ca9048f7f415f122ed82e53884a9ec193646b42deef06/propcache-0.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c80f4ba3e8f00189165999a742ee526ebeccedf6c3f7beb0c7df821e9772435a", size = 62514, upload-time = "2026-05-08T21:00:30.098Z" }, + { url = "https://files.pythonhosted.org/packages/cf/74/66bd798b5b3be70aa1b391f5cc9d6a0a5532d7fd3b19ec0b213e72e6ad9d/propcache-0.5.2-cp312-cp312-win32.whl", hash = "sha256:8c7972d8f193740d9175f0998ab38717e6cd322d5935c5b0fef8c0d323fd9031", size = 39018, upload-time = "2026-05-08T21:00:31.622Z" }, + { url = "https://files.pythonhosted.org/packages/61/7c/5c0d34aa3024694d6dcb9271cdbdd08c4e47c1c0ad95ec7e7bc74cdea145/propcache-0.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:d9ee8826a7d47863a08ac44e1a5f611a462eefc3a194b492da242128bec75b42", size = 42322, upload-time = "2026-05-08T21:00:32.918Z" }, + { url = "https://files.pythonhosted.org/packages/4d/91/875812f1a3feb20ceba818ef39fbe4d92f1081e04ac815c822496d0d038b/propcache-0.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:2800a4a8ead6b28cccd1ec54b59346f0def7922ee1c7598e8499c733cfbb7c84", size = 38172, upload-time = "2026-05-08T21:00:35.124Z" }, + { url = "https://files.pythonhosted.org/packages/c5/09/f049e45385503fe67db75a6b6186a7b9f0c3930366dc960522c312a825b1/propcache-0.5.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:099aaf4b4d1a02265b92a977edf00b5c4f63b3b17ac6de39b0d637c9cac0188a", size = 94457, upload-time = "2026-05-08T21:00:36.355Z" }, + { url = "https://files.pythonhosted.org/packages/6b/65/83d1d05655baf63113731bd5a1008435e14f8d1e5a06cbe4ec5b23ad7a31/propcache-0.5.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:68ce1c44c7a813a7f71ea04315a8c7b330b63db99d059a797a4651bb6f69f117", size = 53835, upload-time = "2026-05-08T21:00:38.072Z" }, + { url = "https://files.pythonhosted.org/packages/a9/12/a6ba6482bb5ea3260c000c9b20881c95fa11c6b30173715668259f844ed7/propcache-0.5.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:fc299c129490f55f254cd90be0deca4764e36e9a7c08b4aa588479a3bbed3098", size = 54545, upload-time = "2026-05-08T21:00:39.319Z" }, + { url = "https://files.pythonhosted.org/packages/a9/19/7fa086f5764c59ec8a8e157cd93aa8497acc00aba9dcdec56bfffb32602d/propcache-0.5.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a6ae2198be502c10f09b2516e7b5d019816924bc3183a43ce792a7bd6625e6f4", size = 59886, upload-time = "2026-05-08T21:00:40.621Z" }, + { url = "https://files.pythonhosted.org/packages/a1/e4/5d7663dc8235956c8f5281698a3af1d351d8820341ddd890f59d9a9127f2/propcache-0.5.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6041d31504dc1779d700e1edcfb08eea334b357620b06681a4eabb57a74e574e", size = 63261, upload-time = "2026-05-08T21:00:41.775Z" }, + { url = "https://files.pythonhosted.org/packages/4a/4a/15a03adee24d6350da4292caeac44c34c033d2afe5e87eb370f38854560f/propcache-0.5.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f7eabc04151c78a9f4d5bbb5f1faf571e4defeb4b585e0fe95b60ff2dbe4d3d7", size = 64184, upload-time = "2026-05-08T21:00:43.018Z" }, + { url = "https://files.pythonhosted.org/packages/8b/c6/979176efdaa3d239e36d503d5af63a0a773b36662ed8f52e5b6a6d9fd40e/propcache-0.5.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4db0ba63d693afd40d249bd93f842b5f144f8fcbb83de05660373bcf30517b1d", size = 61534, upload-time = "2026-05-08T21:00:44.507Z" }, + { url = "https://files.pythonhosted.org/packages/c8/22/63e8cd1bae4c2d2be6493b6b7d10566ddafad88137cfbc99964a1119853c/propcache-0.5.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1dbcf7675229b35d31abb6547d8ebc8c27a830ac3f9a794edff6254873ec7c0a", size = 61500, upload-time = "2026-05-08T21:00:45.796Z" }, + { url = "https://files.pythonhosted.org/packages/60/5a/28e5d9acbac1cc9ccb67045e8c1b943aa8d79fdf39c93bd73cacd68008ea/propcache-0.5.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d310c013aad2c72f1c3f2f8dd3279d460a858c551f97aeb8c63e4693cca7b4d2", size = 59994, upload-time = "2026-05-08T21:00:47.093Z" }, + { url = "https://files.pythonhosted.org/packages/f3/40/db650677f554a95b9c01a7c9d93d629e93a15562f5deb4573c9ee136fed2/propcache-0.5.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:06187263ddad280d05b4d8a8b3bb7d164cbebd469236544a42e6d9b28ac6a4fa", size = 56884, upload-time = "2026-05-08T21:00:48.376Z" }, + { url = "https://files.pythonhosted.org/packages/80/45/70b39b89516ff8b96bf732fa6fded8cef20f293cb1508690101c3c07ec51/propcache-0.5.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3115559b8effafd63b142ea5ed53d63a16ea6469cbc63dce4ee194b42db5d853", size = 63464, upload-time = "2026-05-08T21:00:49.954Z" }, + { url = "https://files.pythonhosted.org/packages/f9/e2/fa59d3a89eac5534293124af4f1d0d0ada091ce4a0ab4610ce03fd2bdd8d/propcache-0.5.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:c60462af8e6dc30c35407c7237ea908d777b22862bbee27bc4699c0d8bcdc45a", size = 61588, upload-time = "2026-05-08T21:00:51.281Z" }, + { url = "https://files.pythonhosted.org/packages/0b/97/efb547a55c4bc7381cfb202d6a2239ac621045277bc1ea5dfd3a7f0516c0/propcache-0.5.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:40314bca9ac559716fe374094fc81c11dcc34b64fd6c585360f5775690505704", size = 64667, upload-time = "2026-05-08T21:00:52.602Z" }, + { url = "https://files.pythonhosted.org/packages/92/56/f5c7d9b4b7595d5127da38974d791b2153f3d1eae6c674af3583ace92ad3/propcache-0.5.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:cfa21e036ce1e1db2be04ba3b85d2df1bb1702fa01932d984c5464c665228ff4", size = 62463, upload-time = "2026-05-08T21:00:54.303Z" }, + { url = "https://files.pythonhosted.org/packages/bd/3b/484a3a65fc9f9f60c41dcd17b428bace5389544e2c680994534a20755066/propcache-0.5.2-cp313-cp313-win32.whl", hash = "sha256:f156a3529f38063b6dbaf356e15602a7f95f8055b1295a438433a6386f10463d", size = 38621, upload-time = "2026-05-08T21:00:55.808Z" }, + { url = "https://files.pythonhosted.org/packages/1c/fd/3f0f10dba4dabad3bf53102be007abf55481067952bde0fdddff439e7c61/propcache-0.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:dfed59d0a5aeb01e242e66ff0300bc4a265a7c05f612d30016f0b60b1017d757", size = 41649, upload-time = "2026-05-08T21:00:57.061Z" }, + { url = "https://files.pythonhosted.org/packages/90/ec/6ce619cc32bb500a482f811f9cd509368b4e58e638d13f2c68f370d6b475/propcache-0.5.2-cp313-cp313-win_arm64.whl", hash = "sha256:ba338430e87ceb9c8f0cf754de38a9860560261e56c00376debd628698a7364f", size = 37636, upload-time = "2026-05-08T21:00:58.646Z" }, + { url = "https://files.pythonhosted.org/packages/1b/82/c1d268bbbf2ef981c5bf0fbbe746db617c66e3bcefe431a1aa8943fbe23a/propcache-0.5.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:a592f5f3da71c8691c788c13cb6734b6d17663d2e1cb8caddf0673d01ef8847d", size = 98872, upload-time = "2026-05-08T21:00:59.889Z" }, + { url = "https://files.pythonhosted.org/packages/f4/d4/52c871e73e864e6b34c0e2d58ac1ec5ccd149497ddc7ad2137ae98323a35/propcache-0.5.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:6a997d0489e9668a384fcfd5061b857aa5361de73191cac204d04b889cfbbafa", size = 56257, upload-time = "2026-05-08T21:01:01.195Z" }, + { url = "https://files.pythonhosted.org/packages/67/f0/9b90ca2a210b3d09bcfcd96ecd0f55545c091535abce2a45de2775cfd357/propcache-0.5.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:10734b5484ea113152ee25a91dccedf81631791805d2c9ccb054958e51842c94", size = 56696, upload-time = "2026-05-08T21:01:02.941Z" }, + { url = "https://files.pythonhosted.org/packages/9d/0e/6e9d4ba07c8e56e21ddec1e75f12148142b21ca83a51871babce095334f4/propcache-0.5.2-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cafca7e56c12bb02ae16d283742bef25a61122e9dab2b5b3f2ccbe589ce32164", size = 62378, upload-time = "2026-05-08T21:01:04.475Z" }, + { url = "https://files.pythonhosted.org/packages/65/19/c10badaa463dde8a27ce884f8ee2ec37e6035b7c9f5ff0c8f74f06f08dac/propcache-0.5.2-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f064f8d2b59177878b7615df1735cd8fe3462ed6be8c7b217d17a276489c2b7f", size = 65283, upload-time = "2026-05-08T21:01:05.959Z" }, + { url = "https://files.pythonhosted.org/packages/b0/b6/93bea99ca80e19cef6512a8580e5b7857bbe09422d9daa7fd4ef5723306c/propcache-0.5.2-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f78abfa8dfc32376fd1aacf597b2f2fbbe0ea751419aee718af5d4f82537ef8c", size = 66616, upload-time = "2026-05-08T21:01:07.228Z" }, + { url = "https://files.pythonhosted.org/packages/83/e4/5c7462e50625f051f37fb38b8224f7639f667184bbd34424ec83819bb1b7/propcache-0.5.2-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f7467da8a9822bf1a55336f877340c5bcbd3c482afc43a99771169f74a26dedc", size = 63773, upload-time = "2026-05-08T21:01:08.514Z" }, + { url = "https://files.pythonhosted.org/packages/ca/b6/99238894047b13c823be25027e736626cd414a52a5e30d2c3347c2733529/propcache-0.5.2-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a6ddc6ac9e25de626c1f129c1b467d7ecd33ce2237d3fd0c4e429feef0a7ee1f", size = 63664, upload-time = "2026-05-08T21:01:09.874Z" }, + { url = "https://files.pythonhosted.org/packages/85/1e/a3a1a63116a2b8edb415a8bb9a6f0c34bd03830b1e18e8ce2904e1dc1cf4/propcache-0.5.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:2f22cbbac9e26a8e864c0985ff1268d5d939d53d9d9411a9824279097e03a2cb", size = 62643, upload-time = "2026-05-08T21:01:11.132Z" }, + { url = "https://files.pythonhosted.org/packages/e4/03/893cf147de2fc6543c5eaa07ad833170e7e2a2385725bbebe8c0503723bb/propcache-0.5.2-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:fc76378c62a0f04d0cd82fbb1a2cd2d7e28fcb40d5873f28a6c44e388aaa2751", size = 59595, upload-time = "2026-05-08T21:01:12.387Z" }, + { url = "https://files.pythonhosted.org/packages/86/3b/04c1a2e12c57766568ba75ba72b3bf2042818d4c1425fab6fc07155c7cff/propcache-0.5.2-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:acd2c8edba48e31e58a363b8cf4e5c7db3b04b3f9e371f601df30d9b0d244836", size = 65711, upload-time = "2026-05-08T21:01:13.676Z" }, + { url = "https://files.pythonhosted.org/packages/1c/34/80f8d0099f8d6bacc4de1624c85672681c8cd1149ca2da0e38fd120b817f/propcache-0.5.2-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:452b5065457eb9991ec5eb38ff41d6cd4c991c9ac7c531c4d5849ae473a9a13f", size = 64247, upload-time = "2026-05-08T21:01:14.936Z" }, + { url = "https://files.pythonhosted.org/packages/f3/1a/8b08f3a5f1037e9e370c55883ceeeee0f6dd0416fb2d2d67b8bfc91f2a79/propcache-0.5.2-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:3430bb2bfe1331885c427745a751e774ee679fd4344f80b97bf879815fe8fa55", size = 67102, upload-time = "2026-05-08T21:01:16.281Z" }, + { url = "https://files.pythonhosted.org/packages/34/68/8bdb7bb7756d76e005490649d10e4a8369e610c74d619f71e1aedf889e9c/propcache-0.5.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:cef6cea3922890dd6c9654971001fa797b526c16ab5e1e46c05fd6f877be7568", size = 64964, upload-time = "2026-05-08T21:01:17.57Z" }, + { url = "https://files.pythonhosted.org/packages/0a/aa/50fb0b5d3968b61a510926ff8b8465f1d6e976b3ab74496d7a4b9fc42515/propcache-0.5.2-cp313-cp313t-win32.whl", hash = "sha256:72d61e16dd78228b58c5d47be830ff3da7e5f139abdf0aef9d86cde1c5cf2191", size = 42546, upload-time = "2026-05-08T21:01:18.946Z" }, + { url = "https://files.pythonhosted.org/packages/ae/4c/0ddbae64321bd4a95bcbfc19307238016b5b1fee645c84626c8d539e5b74/propcache-0.5.2-cp313-cp313t-win_amd64.whl", hash = "sha256:0958834041a0166d343b8d2cedcd8bcbaeb4fdbe0cf08320c5379f143c3be6e7", size = 46330, upload-time = "2026-05-08T21:01:20.162Z" }, + { url = "https://files.pythonhosted.org/packages/00/d9/9cddc8efb78d8af264c5ec9f6d10b62f57c515feda8d321595f56010fb23/propcache-0.5.2-cp313-cp313t-win_arm64.whl", hash = "sha256:6de8bd93ddde9b992cf2b2e0d796d501a19026b5b9fd87356d7d0779531a8d96", size = 40521, upload-time = "2026-05-08T21:01:21.399Z" }, + { url = "https://files.pythonhosted.org/packages/e2/ea/23ee535d90ce8bcc465a3028eb3cc0ce3bd1005f4bb27710b30587de798d/propcache-0.5.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:46088abff4cba581dea21ae0467a480526cb25aa5f3c269e909f800328bc3999", size = 94662, upload-time = "2026-05-08T21:01:22.683Z" }, + { url = "https://files.pythonhosted.org/packages/b5/06/c5a52f419b5d8972f8d46a7577476090d8e3263ff589ce40b5ca4968d5be/propcache-0.5.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:fc88b26f08d634f7bc819a7852e5214f5802641ab8d9fd5326892292eee1993e", size = 53928, upload-time = "2026-05-08T21:01:23.986Z" }, + { url = "https://files.pythonhosted.org/packages/63/b1/4260d67d6bd85e58a66b72d54ce15d5de789b6f3870cc6bedf8ff9667401/propcache-0.5.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:97797ebb098e670a2f92dd66f32897e30d7615b14e7f59711de23e30a9072539", size = 54650, upload-time = "2026-05-08T21:01:25.305Z" }, + { url = "https://files.pythonhosted.org/packages/70/06/2f46c318e3307cd7a6a7481def374ce838c0fe20084b39dd54b0879d0e99/propcache-0.5.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba57fffe4ac99c5d30076161b5866336d97600769bad35cc68f7774b15298a4e", size = 59912, upload-time = "2026-05-08T21:01:26.545Z" }, + { url = "https://files.pythonhosted.org/packages/4c/29/fe1aebec2ce57ab985a9c382bded1124431f85078113aa222c5d278430d4/propcache-0.5.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:583c19759d9eec1e5b69e2fbef36a7d9c326041be9746cb822d335c8cedc2979", size = 63300, upload-time = "2026-05-08T21:01:27.937Z" }, + { url = "https://files.pythonhosted.org/packages/b4/18/2334b26768b6c82be8c69e83671b767d5ef426aa09b0cba6c2ea47816774/propcache-0.5.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d0326e2e5e1f3163fa306c834e48e8d490e5fae607a097a40c0648109b47ba80", size = 64208, upload-time = "2026-05-08T21:01:29.484Z" }, + { url = "https://files.pythonhosted.org/packages/2b/76/7f1bfd6afff4c5e38e36a3c6d68eb5f4b7311ea80baf693db78d95b603c4/propcache-0.5.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e00820e192c8dbebcafb383ebbf99030895f09905e7a0eb2e0340a0bcc2bc825", size = 61633, upload-time = "2026-05-08T21:01:31.068Z" }, + { url = "https://files.pythonhosted.org/packages/c4/46/b3ff8aba2b4953a3e50de2cf72f1b5748b8eca93b15f3dc2c84339084c09/propcache-0.5.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c66afea89b1e43725731d2004732a046fe6fe955d51f952c3e95a7314a284a39", size = 61724, upload-time = "2026-05-08T21:01:32.374Z" }, + { url = "https://files.pythonhosted.org/packages/c5/01/814cfcafbcff954f94c01cf30e097ddc88a076b5440fbcf4570753437d40/propcache-0.5.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:d4dc37dec6c6cdad0b57881a5658fd14fbf53e333b1a86cf86559f190e1d9ec4", size = 60069, upload-time = "2026-05-08T21:01:33.67Z" }, + { url = "https://files.pythonhosted.org/packages/da/68/5c6f7622d510cc666a300687e06fd060c1a43361c0c9b20d284f06d8096a/propcache-0.5.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:5570dbcc97571c15f68068e529c92715a12f8d54030e272d264b377e22bd17a5", size = 57099, upload-time = "2026-05-08T21:01:34.915Z" }, + { url = "https://files.pythonhosted.org/packages/55/27/9cb0b4c679124085327957d42521c99dba04c88c90c3e55a6f0b633ebccc/propcache-0.5.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:f814362777a9f841adddb200ecdf8f5cb1e5a3c4b7a86378edbd6ccb26edd702", size = 63391, upload-time = "2026-05-08T21:01:36.231Z" }, + { url = "https://files.pythonhosted.org/packages/f0/9d/7258aaa5bdf60fc6f27591eef6fe52768cb0beda7140be477c8b12c9794a/propcache-0.5.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:196913dea116aeb5a2ba95af4ddcb7ea85559ae07d8eee8751688310d09168c3", size = 61626, upload-time = "2026-05-08T21:01:37.545Z" }, + { url = "https://files.pythonhosted.org/packages/8e/0d/41c602003e8a9b16fe1e7eadf62c7bfba9d5474370b24200bf48b315f45f/propcache-0.5.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:6e7b8719005dd1175be4ab1cd25e9b98659a5e0347331506ec6760d2773a7fb5", size = 64781, upload-time = "2026-05-08T21:01:38.83Z" }, + { url = "https://files.pythonhosted.org/packages/8b/f3/38e66b1856e9bd079deea015bc4a55f7767c0e4db2f7dcf69e7e680ba4ce/propcache-0.5.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:51f96d685ab16e88cab128cd37a52c5da540809c8b879fa047731bfcb4ad35a4", size = 62570, upload-time = "2026-05-08T21:01:40.415Z" }, + { url = "https://files.pythonhosted.org/packages/95/ca/bbfe9b910ce57dde8bb4876b4520fc02a4e89497c10de26be936758a3aaa/propcache-0.5.2-cp314-cp314-win32.whl", hash = "sha256:cc6fc3cc62e8501d3ed62894425040d2728ecddb1ed072737a5c70bd537aa9f0", size = 39436, upload-time = "2026-05-08T21:01:41.654Z" }, + { url = "https://files.pythonhosted.org/packages/61/d2/45c9defbaa1ea297035d9d4cce9e8f80daafbf19319c6007f157c6256ea9/propcache-0.5.2-cp314-cp314-win_amd64.whl", hash = "sha256:81e3a30b0bb60caa22033dd0f8a3618d1d67356212514f62c57db75cb0ef410c", size = 42373, upload-time = "2026-05-08T21:01:43.041Z" }, + { url = "https://files.pythonhosted.org/packages/44/68/9ea5103f41d5217d7d6ec24db90018e23aebec070c3f9a6e54d12b841fd8/propcache-0.5.2-cp314-cp314-win_arm64.whl", hash = "sha256:0d2c9bf8528f135dbb805ce027567e09164f7efa51a2be07458a2c0420f292d0", size = 38554, upload-time = "2026-05-08T21:01:44.336Z" }, + { url = "https://files.pythonhosted.org/packages/8a/81/fadf555f42d3b762eea8a53950b0489fdc0aa9da5f8ed9e10ce0a4e01b48/propcache-0.5.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:4bc8ff1feffc6a61c7002ffe84634c41b822e104990ae009f44a0834430070bb", size = 99395, upload-time = "2026-05-08T21:01:45.883Z" }, + { url = "https://files.pythonhosted.org/packages/f5/c9/c61e134a686949cf7971af3a390148b1156f7be81c73bc0cd12c873e2d48/propcache-0.5.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:79aa3ff0a9b566633b642fa9caf7e21ed1c13d6feca718187873f199e1514078", size = 56653, upload-time = "2026-05-08T21:01:47.307Z" }, + { url = "https://files.pythonhosted.org/packages/cb/73/daf935ea7048ddd7ec8eec5345b4a40b619d2d178b3c0a0900796bc3c794/propcache-0.5.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1b31822f4474c4036bae62de9402710051d431a606d6a0f907fec79935a071aa", size = 56914, upload-time = "2026-05-08T21:01:48.573Z" }, + { url = "https://files.pythonhosted.org/packages/79/9f/aba959b435ea18617edd7cf0a7ad0b9c574b8fc7e3d2cd55fb59cb255d33/propcache-0.5.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:13fef48778b5a2a756523fdb781326b028ca75e32858b04f2cdd19f394564917", size = 62567, upload-time = "2026-05-08T21:01:49.903Z" }, + { url = "https://files.pythonhosted.org/packages/6c/a1/859942de9a791ff42f6141736f5b37749b8f53e65edfa49638c67dd67e6a/propcache-0.5.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8b73ab70f1a3351fbc71f663b3e645af6dd0329100c353081cf69c37433fc6fe", size = 65542, upload-time = "2026-05-08T21:01:51.204Z" }, + { url = "https://files.pythonhosted.org/packages/b5/61/315bc0fd6c0fc7f80a528b8afd209e5fc4a875ea79571b91b8f50f442907/propcache-0.5.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5538d2c13d93e4698af7e092b57bc7298fd35d1d58e656ae18f23ee0d0378e03", size = 66845, upload-time = "2026-05-08T21:01:52.539Z" }, + { url = "https://files.pythonhosted.org/packages/47/f7/9f8122e3132e8e354ac41975ef8f1099be7d5a16bc7ae562734e993665c0/propcache-0.5.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cd645f03898405cabe694fb8bc35241e3a9c332ec85627584fe3de201452b335", size = 63985, upload-time = "2026-05-08T21:01:53.847Z" }, + { url = "https://files.pythonhosted.org/packages/c8/54/c317819ec157cbf6f35df9df9657a6f82daf34d5faf15948b2f639c2192e/propcache-0.5.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a473b3440261e0c60706e732b2ed2f517857344fc21bf48fdfe211e2d98eb285", size = 63999, upload-time = "2026-05-08T21:01:55.179Z" }, + { url = "https://files.pythonhosted.org/packages/5a/56/387e3f7dfce0a9233df41fb888aa1c30222cb4bbbf09537c02dd9bd85fe2/propcache-0.5.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:7afa37062e6650640e932e4cc9297d81f9f42d9944029cc386b8247dea4da837", size = 62779, upload-time = "2026-05-08T21:01:57.489Z" }, + { url = "https://files.pythonhosted.org/packages/a1/9c/596784cb5824ed61ee960d3f8655a3f0993e107c6e98ab6c818b7fb92ccb/propcache-0.5.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:8a90efd5777e996e42d568db9ac740b944d691e565cbfd31b2f7832f9184b2b8", size = 59796, upload-time = "2026-05-08T21:01:58.736Z" }, + { url = "https://files.pythonhosted.org/packages/c2/3d/1a6cfa1726a48542c1e8784a0761421476a5b68e09b7f36bf95eb954aaba/propcache-0.5.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:f19bb891234d72535764d703bfed1153cc34f4214d5bd7150aee1eec9e8f4366", size = 66023, upload-time = "2026-05-08T21:02:00.228Z" }, + { url = "https://files.pythonhosted.org/packages/e4/0e/05fd6990369477076e4e280bcb970de760fddf0161a46e988bc95f7940ec/propcache-0.5.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:32775082acd2d807ee3db715c7770d38767b817870acfa08c29e057f3c4d5b56", size = 64448, upload-time = "2026-05-08T21:02:01.888Z" }, + { url = "https://files.pythonhosted.org/packages/cd/86/5f8da315a4309c62c10c0b2516b17492d5d3bbe1bb862b96604db67e2a37/propcache-0.5.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:9282fb1a3bccd038da9f768b927b24a0c753e466c086b7c4f3c6982851eefb2d", size = 67329, upload-time = "2026-05-08T21:02:03.484Z" }, + { url = "https://files.pythonhosted.org/packages/da/d3/3368efe79ab21f0cdf86ef49895811c9cc933131d4cde1f28a624e22e712/propcache-0.5.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cc49723e2f60d6b32a0f0b08a3fd6d13203c07f1cd9566cfce0f12a917c967a2", size = 65172, upload-time = "2026-05-08T21:02:04.745Z" }, + { url = "https://files.pythonhosted.org/packages/d5/07/127e8b0bacfb325396196f9d976a22453049b89b9b2b08477cc3145faa44/propcache-0.5.2-cp314-cp314t-win32.whl", hash = "sha256:2d7aa89ebca5acc98cba9d1472d976e394782f587bad6661003602a619fd1821", size = 43813, upload-time = "2026-05-08T21:02:06.025Z" }, + { url = "https://files.pythonhosted.org/packages/88/fb/46dad6c0ae49ed230ab1b16c890c2b6314e2403e6c412976f4a72d64a527/propcache-0.5.2-cp314-cp314t-win_amd64.whl", hash = "sha256:d447bb0b3054be5818458fbb171208b1d9ff11eba14e18ca18b90cbb45767370", size = 47764, upload-time = "2026-05-08T21:02:07.353Z" }, + { url = "https://files.pythonhosted.org/packages/e7/c4/a47d0a63aa309d10d59ede6e9d4cff03a344a79d1f0f4cd0cd74997b53e0/propcache-0.5.2-cp314-cp314t-win_arm64.whl", hash = "sha256:fe67a3d11cd9b4efabfa45c3d00ffba2b26811442a73a581a94b67c2b5faccf6", size = 41140, upload-time = "2026-05-08T21:02:09.065Z" }, + { url = "https://files.pythonhosted.org/packages/3a/ed/1cdcab6ba3d6ab7feca11fc14f0eeea80755bb53ef4e892079f31b10a25f/propcache-0.5.2-py3-none-any.whl", hash = "sha256:be1ddfcbb376e3de5d2e2db1d58d6d67463e6b4f9f040c000de8e300295465fe", size = 14036, upload-time = "2026-05-08T21:02:10.673Z" }, +] + +[[package]] +name = "psutil" +version = "7.2.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/aa/c6/d1ddf4abb55e93cebc4f2ed8b5d6dbad109ecb8d63748dd2b20ab5e57ebe/psutil-7.2.2.tar.gz", hash = "sha256:0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372", size = 493740, upload-time = "2026-01-28T18:14:54.428Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/51/08/510cbdb69c25a96f4ae523f733cdc963ae654904e8db864c07585ef99875/psutil-7.2.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:2edccc433cbfa046b980b0df0171cd25bcaeb3a68fe9022db0979e7aa74a826b", size = 130595, upload-time = "2026-01-28T18:14:57.293Z" }, + { url = "https://files.pythonhosted.org/packages/d6/f5/97baea3fe7a5a9af7436301f85490905379b1c6f2dd51fe3ecf24b4c5fbf/psutil-7.2.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e78c8603dcd9a04c7364f1a3e670cea95d51ee865e4efb3556a3a63adef958ea", size = 131082, upload-time = "2026-01-28T18:14:59.732Z" }, + { url = "https://files.pythonhosted.org/packages/37/d6/246513fbf9fa174af531f28412297dd05241d97a75911ac8febefa1a53c6/psutil-7.2.2-cp313-cp313t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1a571f2330c966c62aeda00dd24620425d4b0cc86881c89861fbc04549e5dc63", size = 181476, upload-time = "2026-01-28T18:15:01.884Z" }, + { url = "https://files.pythonhosted.org/packages/b8/b5/9182c9af3836cca61696dabe4fd1304e17bc56cb62f17439e1154f225dd3/psutil-7.2.2-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:917e891983ca3c1887b4ef36447b1e0873e70c933afc831c6b6da078ba474312", size = 184062, upload-time = "2026-01-28T18:15:04.436Z" }, + { url = "https://files.pythonhosted.org/packages/16/ba/0756dca669f5a9300d0cbcbfae9a4c30e446dfc7440ffe43ded5724bfd93/psutil-7.2.2-cp313-cp313t-win_amd64.whl", hash = "sha256:ab486563df44c17f5173621c7b198955bd6b613fb87c71c161f827d3fb149a9b", size = 139893, upload-time = "2026-01-28T18:15:06.378Z" }, + { url = "https://files.pythonhosted.org/packages/1c/61/8fa0e26f33623b49949346de05ec1ddaad02ed8ba64af45f40a147dbfa97/psutil-7.2.2-cp313-cp313t-win_arm64.whl", hash = "sha256:ae0aefdd8796a7737eccea863f80f81e468a1e4cf14d926bd9b6f5f2d5f90ca9", size = 135589, upload-time = "2026-01-28T18:15:08.03Z" }, + { url = "https://files.pythonhosted.org/packages/81/69/ef179ab5ca24f32acc1dac0c247fd6a13b501fd5534dbae0e05a1c48b66d/psutil-7.2.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:eed63d3b4d62449571547b60578c5b2c4bcccc5387148db46e0c2313dad0ee00", size = 130664, upload-time = "2026-01-28T18:15:09.469Z" }, + { url = "https://files.pythonhosted.org/packages/7b/64/665248b557a236d3fa9efc378d60d95ef56dd0a490c2cd37dafc7660d4a9/psutil-7.2.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7b6d09433a10592ce39b13d7be5a54fbac1d1228ed29abc880fb23df7cb694c9", size = 131087, upload-time = "2026-01-28T18:15:11.724Z" }, + { url = "https://files.pythonhosted.org/packages/d5/2e/e6782744700d6759ebce3043dcfa661fb61e2fb752b91cdeae9af12c2178/psutil-7.2.2-cp314-cp314t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fa4ecf83bcdf6e6c8f4449aff98eefb5d0604bf88cb883d7da3d8d2d909546a", size = 182383, upload-time = "2026-01-28T18:15:13.445Z" }, + { url = "https://files.pythonhosted.org/packages/57/49/0a41cefd10cb7505cdc04dab3eacf24c0c2cb158a998b8c7b1d27ee2c1f5/psutil-7.2.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e452c464a02e7dc7822a05d25db4cde564444a67e58539a00f929c51eddda0cf", size = 185210, upload-time = "2026-01-28T18:15:16.002Z" }, + { url = "https://files.pythonhosted.org/packages/dd/2c/ff9bfb544f283ba5f83ba725a3c5fec6d6b10b8f27ac1dc641c473dc390d/psutil-7.2.2-cp314-cp314t-win_amd64.whl", hash = "sha256:c7663d4e37f13e884d13994247449e9f8f574bc4655d509c3b95e9ec9e2b9dc1", size = 141228, upload-time = "2026-01-28T18:15:18.385Z" }, + { url = "https://files.pythonhosted.org/packages/f2/fc/f8d9c31db14fcec13748d373e668bc3bed94d9077dbc17fb0eebc073233c/psutil-7.2.2-cp314-cp314t-win_arm64.whl", hash = "sha256:11fe5a4f613759764e79c65cf11ebdf26e33d6dd34336f8a337aa2996d71c841", size = 136284, upload-time = "2026-01-28T18:15:19.912Z" }, + { url = "https://files.pythonhosted.org/packages/e7/36/5ee6e05c9bd427237b11b3937ad82bb8ad2752d72c6969314590dd0c2f6e/psutil-7.2.2-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:ed0cace939114f62738d808fdcecd4c869222507e266e574799e9c0faa17d486", size = 129090, upload-time = "2026-01-28T18:15:22.168Z" }, + { url = "https://files.pythonhosted.org/packages/80/c4/f5af4c1ca8c1eeb2e92ccca14ce8effdeec651d5ab6053c589b074eda6e1/psutil-7.2.2-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:1a7b04c10f32cc88ab39cbf606e117fd74721c831c98a27dc04578deb0c16979", size = 129859, upload-time = "2026-01-28T18:15:23.795Z" }, + { url = "https://files.pythonhosted.org/packages/b5/70/5d8df3b09e25bce090399cf48e452d25c935ab72dad19406c77f4e828045/psutil-7.2.2-cp36-abi3-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:076a2d2f923fd4821644f5ba89f059523da90dc9014e85f8e45a5774ca5bc6f9", size = 155560, upload-time = "2026-01-28T18:15:25.976Z" }, + { url = "https://files.pythonhosted.org/packages/63/65/37648c0c158dc222aba51c089eb3bdfa238e621674dc42d48706e639204f/psutil-7.2.2-cp36-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b0726cecd84f9474419d67252add4ac0cd9811b04d61123054b9fb6f57df6e9e", size = 156997, upload-time = "2026-01-28T18:15:27.794Z" }, + { url = "https://files.pythonhosted.org/packages/8e/13/125093eadae863ce03c6ffdbae9929430d116a246ef69866dad94da3bfbc/psutil-7.2.2-cp36-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:fd04ef36b4a6d599bbdb225dd1d3f51e00105f6d48a28f006da7f9822f2606d8", size = 148972, upload-time = "2026-01-28T18:15:29.342Z" }, + { url = "https://files.pythonhosted.org/packages/04/78/0acd37ca84ce3ddffaa92ef0f571e073faa6d8ff1f0559ab1272188ea2be/psutil-7.2.2-cp36-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b58fabe35e80b264a4e3bb23e6b96f9e45a3df7fb7eed419ac0e5947c61e47cc", size = 148266, upload-time = "2026-01-28T18:15:31.597Z" }, + { url = "https://files.pythonhosted.org/packages/b4/90/e2159492b5426be0c1fef7acba807a03511f97c5f86b3caeda6ad92351a7/psutil-7.2.2-cp37-abi3-win_amd64.whl", hash = "sha256:eb7e81434c8d223ec4a219b5fc1c47d0417b12be7ea866e24fb5ad6e84b3d988", size = 137737, upload-time = "2026-01-28T18:15:33.849Z" }, + { url = "https://files.pythonhosted.org/packages/8c/c7/7bb2e321574b10df20cbde462a94e2b71d05f9bbda251ef27d104668306a/psutil-7.2.2-cp37-abi3-win_arm64.whl", hash = "sha256:8c233660f575a5a89e6d4cb65d9f938126312bca76d8fe087b947b3a1aaac9ee", size = 134617, upload-time = "2026-01-28T18:15:36.514Z" }, +] + +[[package]] +name = "ptyprocess" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/20/e5/16ff212c1e452235a90aeb09066144d0c5a6a8c0834397e03f5224495c4e/ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220", size = 70762, upload-time = "2020-12-28T15:15:30.155Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/22/a6/858897256d0deac81a172289110f31629fc4cee19b6f01283303e18c8db3/ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35", size = 13993, upload-time = "2020-12-28T15:15:28.35Z" }, +] + +[[package]] +name = "pure-eval" +version = "0.2.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cd/05/0a34433a064256a578f1783a10da6df098ceaa4a57bbeaa96a6c0352786b/pure_eval-0.2.3.tar.gz", hash = "sha256:5f4e983f40564c576c7c8635ae88db5956bb2229d7e9237d03b3c0b0190eaf42", size = 19752, upload-time = "2024-07-21T12:58:21.801Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8e/37/efad0257dc6e593a18957422533ff0f87ede7c9c6ea010a2177d738fb82f/pure_eval-0.2.3-py3-none-any.whl", hash = "sha256:1db8e35b67b3d218d818ae653e27f06c3aa420901fa7b081ca98cbedc874e0d0", size = 11842, upload-time = "2024-07-21T12:58:20.04Z" }, +] + +[[package]] +name = "pycparser" +version = "3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29", size = 103492, upload-time = "2026-01-21T14:26:51.89Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/c3/44f3fbbfa403ea2a7c779186dc20772604442dde72947e7d01069cbe98e3/pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992", size = 48172, upload-time = "2026-01-21T14:26:50.693Z" }, +] + +[[package]] +name = "pygments" +version = "2.20.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, +] + +[[package]] +name = "pymdown-extensions" +version = "11.0.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown" }, + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/21/a9/5f0c535ba3b08fe09270c16808e053a968868242ecbd5676d4e3a488bf28/pymdown_extensions-11.0.1.tar.gz", hash = "sha256:dd2905ae6fc5b75582fafb139a1266ffc754705efa902aa50067fa7ff4f94ec0", size = 857113, upload-time = "2026-07-02T17:59:22.955Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d6/54/da572c98c0b77626a91b5d3b89f0231d8bff5125c225420908632f8b342d/pymdown_extensions-11.0.1-py3-none-any.whl", hash = "sha256:db3943a62bab7e03af1364f0c4083e64b91fb097675a4b6cceccfbe9a77e5eb2", size = 269455, upload-time = "2026-07-02T17:59:21.271Z" }, +] + +[[package]] +name = "pytest" +version = "9.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" }, +] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, +] + +[[package]] +name = "pyyaml" +version = "6.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, + { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, + { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, + { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, + { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, + { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, + { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, + { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" }, + { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" }, + { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" }, + { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" }, + { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" }, + { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" }, + { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" }, + { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" }, + { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" }, + { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" }, + { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" }, + { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" }, + { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" }, + { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" }, + { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" }, + { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" }, + { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" }, + { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" }, + { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" }, + { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" }, + { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" }, + { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" }, + { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" }, + { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" }, + { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, +] + +[[package]] +name = "pyyaml-env-tag" +version = "1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/eb/2e/79c822141bfd05a853236b504869ebc6b70159afc570e1d5a20641782eaa/pyyaml_env_tag-1.1.tar.gz", hash = "sha256:2eb38b75a2d21ee0475d6d97ec19c63287a7e140231e4214969d0eac923cd7ff", size = 5737, upload-time = "2025-05-13T15:24:01.64Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/11/432f32f8097b03e3cd5fe57e88efb685d964e2e5178a48ed61e841f7fdce/pyyaml_env_tag-1.1-py3-none-any.whl", hash = "sha256:17109e1a528561e32f026364712fee1264bc2ea6715120891174ed1b980d2e04", size = 4722, upload-time = "2025-05-13T15:23:59.629Z" }, +] + +[[package]] +name = "pyzmq" +version = "27.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cffi", marker = "implementation_name == 'pypy'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/04/0b/3c9baedbdf613ecaa7aa07027780b8867f57b6293b6ee50de316c9f3222b/pyzmq-27.1.0.tar.gz", hash = "sha256:ac0765e3d44455adb6ddbf4417dcce460fc40a05978c08efdf2948072f6db540", size = 281750, upload-time = "2025-09-08T23:10:18.157Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/92/e7/038aab64a946d535901103da16b953c8c9cc9c961dadcbf3609ed6428d23/pyzmq-27.1.0-cp312-abi3-macosx_10_15_universal2.whl", hash = "sha256:452631b640340c928fa343801b0d07eb0c3789a5ffa843f6e1a9cee0ba4eb4fc", size = 1306279, upload-time = "2025-09-08T23:08:03.807Z" }, + { url = "https://files.pythonhosted.org/packages/e8/5e/c3c49fdd0f535ef45eefcc16934648e9e59dace4a37ee88fc53f6cd8e641/pyzmq-27.1.0-cp312-abi3-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:1c179799b118e554b66da67d88ed66cd37a169f1f23b5d9f0a231b4e8d44a113", size = 895645, upload-time = "2025-09-08T23:08:05.301Z" }, + { url = "https://files.pythonhosted.org/packages/f8/e5/b0b2504cb4e903a74dcf1ebae157f9e20ebb6ea76095f6cfffea28c42ecd/pyzmq-27.1.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3837439b7f99e60312f0c926a6ad437b067356dc2bc2ec96eb395fd0fe804233", size = 652574, upload-time = "2025-09-08T23:08:06.828Z" }, + { url = "https://files.pythonhosted.org/packages/f8/9b/c108cdb55560eaf253f0cbdb61b29971e9fb34d9c3499b0e96e4e60ed8a5/pyzmq-27.1.0-cp312-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:43ad9a73e3da1fab5b0e7e13402f0b2fb934ae1c876c51d0afff0e7c052eca31", size = 840995, upload-time = "2025-09-08T23:08:08.396Z" }, + { url = "https://files.pythonhosted.org/packages/c2/bb/b79798ca177b9eb0825b4c9998c6af8cd2a7f15a6a1a4272c1d1a21d382f/pyzmq-27.1.0-cp312-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:0de3028d69d4cdc475bfe47a6128eb38d8bc0e8f4d69646adfbcd840facbac28", size = 1642070, upload-time = "2025-09-08T23:08:09.989Z" }, + { url = "https://files.pythonhosted.org/packages/9c/80/2df2e7977c4ede24c79ae39dcef3899bfc5f34d1ca7a5b24f182c9b7a9ca/pyzmq-27.1.0-cp312-abi3-musllinux_1_2_i686.whl", hash = "sha256:cf44a7763aea9298c0aa7dbf859f87ed7012de8bda0f3977b6fb1d96745df856", size = 2021121, upload-time = "2025-09-08T23:08:11.907Z" }, + { url = "https://files.pythonhosted.org/packages/46/bd/2d45ad24f5f5ae7e8d01525eb76786fa7557136555cac7d929880519e33a/pyzmq-27.1.0-cp312-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:f30f395a9e6fbca195400ce833c731e7b64c3919aa481af4d88c3759e0cb7496", size = 1878550, upload-time = "2025-09-08T23:08:13.513Z" }, + { url = "https://files.pythonhosted.org/packages/e6/2f/104c0a3c778d7c2ab8190e9db4f62f0b6957b53c9d87db77c284b69f33ea/pyzmq-27.1.0-cp312-abi3-win32.whl", hash = "sha256:250e5436a4ba13885494412b3da5d518cd0d3a278a1ae640e113c073a5f88edd", size = 559184, upload-time = "2025-09-08T23:08:15.163Z" }, + { url = "https://files.pythonhosted.org/packages/fc/7f/a21b20d577e4100c6a41795842028235998a643b1ad406a6d4163ea8f53e/pyzmq-27.1.0-cp312-abi3-win_amd64.whl", hash = "sha256:9ce490cf1d2ca2ad84733aa1d69ce6855372cb5ce9223802450c9b2a7cba0ccf", size = 619480, upload-time = "2025-09-08T23:08:17.192Z" }, + { url = "https://files.pythonhosted.org/packages/78/c2/c012beae5f76b72f007a9e91ee9401cb88c51d0f83c6257a03e785c81cc2/pyzmq-27.1.0-cp312-abi3-win_arm64.whl", hash = "sha256:75a2f36223f0d535a0c919e23615fc85a1e23b71f40c7eb43d7b1dedb4d8f15f", size = 552993, upload-time = "2025-09-08T23:08:18.926Z" }, + { url = "https://files.pythonhosted.org/packages/60/cb/84a13459c51da6cec1b7b1dc1a47e6db6da50b77ad7fd9c145842750a011/pyzmq-27.1.0-cp313-cp313-android_24_arm64_v8a.whl", hash = "sha256:93ad4b0855a664229559e45c8d23797ceac03183c7b6f5b4428152a6b06684a5", size = 1122436, upload-time = "2025-09-08T23:08:20.801Z" }, + { url = "https://files.pythonhosted.org/packages/dc/b6/94414759a69a26c3dd674570a81813c46a078767d931a6c70ad29fc585cb/pyzmq-27.1.0-cp313-cp313-android_24_x86_64.whl", hash = "sha256:fbb4f2400bfda24f12f009cba62ad5734148569ff4949b1b6ec3b519444342e6", size = 1156301, upload-time = "2025-09-08T23:08:22.47Z" }, + { url = "https://files.pythonhosted.org/packages/a5/ad/15906493fd40c316377fd8a8f6b1f93104f97a752667763c9b9c1b71d42d/pyzmq-27.1.0-cp313-cp313t-macosx_10_15_universal2.whl", hash = "sha256:e343d067f7b151cfe4eb3bb796a7752c9d369eed007b91231e817071d2c2fec7", size = 1341197, upload-time = "2025-09-08T23:08:24.286Z" }, + { url = "https://files.pythonhosted.org/packages/14/1d/d343f3ce13db53a54cb8946594e567410b2125394dafcc0268d8dda027e0/pyzmq-27.1.0-cp313-cp313t-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:08363b2011dec81c354d694bdecaef4770e0ae96b9afea70b3f47b973655cc05", size = 897275, upload-time = "2025-09-08T23:08:26.063Z" }, + { url = "https://files.pythonhosted.org/packages/69/2d/d83dd6d7ca929a2fc67d2c3005415cdf322af7751d773524809f9e585129/pyzmq-27.1.0-cp313-cp313t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d54530c8c8b5b8ddb3318f481297441af102517602b569146185fa10b63f4fa9", size = 660469, upload-time = "2025-09-08T23:08:27.623Z" }, + { url = "https://files.pythonhosted.org/packages/3e/cd/9822a7af117f4bc0f1952dbe9ef8358eb50a24928efd5edf54210b850259/pyzmq-27.1.0-cp313-cp313t-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6f3afa12c392f0a44a2414056d730eebc33ec0926aae92b5ad5cf26ebb6cc128", size = 847961, upload-time = "2025-09-08T23:08:29.672Z" }, + { url = "https://files.pythonhosted.org/packages/9a/12/f003e824a19ed73be15542f172fd0ec4ad0b60cf37436652c93b9df7c585/pyzmq-27.1.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:c65047adafe573ff023b3187bb93faa583151627bc9c51fc4fb2c561ed689d39", size = 1650282, upload-time = "2025-09-08T23:08:31.349Z" }, + { url = "https://files.pythonhosted.org/packages/d5/4a/e82d788ed58e9a23995cee70dbc20c9aded3d13a92d30d57ec2291f1e8a3/pyzmq-27.1.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:90e6e9441c946a8b0a667356f7078d96411391a3b8f80980315455574177ec97", size = 2024468, upload-time = "2025-09-08T23:08:33.543Z" }, + { url = "https://files.pythonhosted.org/packages/d9/94/2da0a60841f757481e402b34bf4c8bf57fa54a5466b965de791b1e6f747d/pyzmq-27.1.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:add071b2d25f84e8189aaf0882d39a285b42fa3853016ebab234a5e78c7a43db", size = 1885394, upload-time = "2025-09-08T23:08:35.51Z" }, + { url = "https://files.pythonhosted.org/packages/4f/6f/55c10e2e49ad52d080dc24e37adb215e5b0d64990b57598abc2e3f01725b/pyzmq-27.1.0-cp313-cp313t-win32.whl", hash = "sha256:7ccc0700cfdf7bd487bea8d850ec38f204478681ea02a582a8da8171b7f90a1c", size = 574964, upload-time = "2025-09-08T23:08:37.178Z" }, + { url = "https://files.pythonhosted.org/packages/87/4d/2534970ba63dd7c522d8ca80fb92777f362c0f321900667c615e2067cb29/pyzmq-27.1.0-cp313-cp313t-win_amd64.whl", hash = "sha256:8085a9fba668216b9b4323be338ee5437a235fe275b9d1610e422ccc279733e2", size = 641029, upload-time = "2025-09-08T23:08:40.595Z" }, + { url = "https://files.pythonhosted.org/packages/f6/fa/f8aea7a28b0641f31d40dea42d7ef003fded31e184ef47db696bc74cd610/pyzmq-27.1.0-cp313-cp313t-win_arm64.whl", hash = "sha256:6bb54ca21bcfe361e445256c15eedf083f153811c37be87e0514934d6913061e", size = 561541, upload-time = "2025-09-08T23:08:42.668Z" }, + { url = "https://files.pythonhosted.org/packages/87/45/19efbb3000956e82d0331bafca5d9ac19ea2857722fa2caacefb6042f39d/pyzmq-27.1.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:ce980af330231615756acd5154f29813d553ea555485ae712c491cd483df6b7a", size = 1341197, upload-time = "2025-09-08T23:08:44.973Z" }, + { url = "https://files.pythonhosted.org/packages/48/43/d72ccdbf0d73d1343936296665826350cb1e825f92f2db9db3e61c2162a2/pyzmq-27.1.0-cp314-cp314t-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:1779be8c549e54a1c38f805e56d2a2e5c009d26de10921d7d51cfd1c8d4632ea", size = 897175, upload-time = "2025-09-08T23:08:46.601Z" }, + { url = "https://files.pythonhosted.org/packages/2f/2e/a483f73a10b65a9ef0161e817321d39a770b2acf8bcf3004a28d90d14a94/pyzmq-27.1.0-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7200bb0f03345515df50d99d3db206a0a6bee1955fbb8c453c76f5bf0e08fb96", size = 660427, upload-time = "2025-09-08T23:08:48.187Z" }, + { url = "https://files.pythonhosted.org/packages/f5/d2/5f36552c2d3e5685abe60dfa56f91169f7a2d99bbaf67c5271022ab40863/pyzmq-27.1.0-cp314-cp314t-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:01c0e07d558b06a60773744ea6251f769cd79a41a97d11b8bf4ab8f034b0424d", size = 847929, upload-time = "2025-09-08T23:08:49.76Z" }, + { url = "https://files.pythonhosted.org/packages/c4/2a/404b331f2b7bf3198e9945f75c4c521f0c6a3a23b51f7a4a401b94a13833/pyzmq-27.1.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:80d834abee71f65253c91540445d37c4c561e293ba6e741b992f20a105d69146", size = 1650193, upload-time = "2025-09-08T23:08:51.7Z" }, + { url = "https://files.pythonhosted.org/packages/1c/0b/f4107e33f62a5acf60e3ded67ed33d79b4ce18de432625ce2fc5093d6388/pyzmq-27.1.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:544b4e3b7198dde4a62b8ff6685e9802a9a1ebf47e77478a5eb88eca2a82f2fd", size = 2024388, upload-time = "2025-09-08T23:08:53.393Z" }, + { url = "https://files.pythonhosted.org/packages/0d/01/add31fe76512642fd6e40e3a3bd21f4b47e242c8ba33efb6809e37076d9b/pyzmq-27.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cedc4c68178e59a4046f97eca31b148ddcf51e88677de1ef4e78cf06c5376c9a", size = 1885316, upload-time = "2025-09-08T23:08:55.702Z" }, + { url = "https://files.pythonhosted.org/packages/c4/59/a5f38970f9bf07cee96128de79590bb354917914a9be11272cfc7ff26af0/pyzmq-27.1.0-cp314-cp314t-win32.whl", hash = "sha256:1f0b2a577fd770aa6f053211a55d1c47901f4d537389a034c690291485e5fe92", size = 587472, upload-time = "2025-09-08T23:08:58.18Z" }, + { url = "https://files.pythonhosted.org/packages/70/d8/78b1bad170f93fcf5e3536e70e8fadac55030002275c9a29e8f5719185de/pyzmq-27.1.0-cp314-cp314t-win_amd64.whl", hash = "sha256:19c9468ae0437f8074af379e986c5d3d7d7bfe033506af442e8c879732bedbe0", size = 661401, upload-time = "2025-09-08T23:08:59.802Z" }, + { url = "https://files.pythonhosted.org/packages/81/d6/4bfbb40c9a0b42fc53c7cf442f6385db70b40f74a783130c5d0a5aa62228/pyzmq-27.1.0-cp314-cp314t-win_arm64.whl", hash = "sha256:dc5dbf68a7857b59473f7df42650c621d7e8923fb03fa74a526890f4d33cc4d7", size = 575170, upload-time = "2025-09-08T23:09:01.418Z" }, +] + +[[package]] +name = "referencing" +version = "0.37.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "rpds-py" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/22/f5/df4e9027acead3ecc63e50fe1e36aca1523e1719559c499951bb4b53188f/referencing-0.37.0.tar.gz", hash = "sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8", size = 78036, upload-time = "2025-10-13T15:30:48.871Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/58/ca301544e1fa93ed4f80d724bf5b194f6e4b945841c5bfd555878eea9fcb/referencing-0.37.0-py3-none-any.whl", hash = "sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231", size = 26766, upload-time = "2025-10-13T15:30:47.625Z" }, +] + +[[package]] +name = "requests" +version = "2.34.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "charset-normalizer" }, + { name = "idna" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" }, +] + +[[package]] +name = "rpds-py" +version = "2026.6.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/aa/2a/9618a122aeb2a169a28b03889a2995fe297588964333d4a7d67bdf46e147/rpds_py-2026.6.3.tar.gz", hash = "sha256:1cebd1337c242e4ec2293e541f712b2da849b29f48f0c293684b71c0632625d4", size = 64051, upload-time = "2026-06-30T07:17:53.009Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5c/be/2e8974163072e7bab7df1a5acd54c4498e75e35d6d18b864d3a9d5dadc92/rpds_py-2026.6.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a0811d33247c3d6128a3001d763f2aa056bb3425204335400ac54f89eec3a0d0", size = 343691, upload-time = "2026-06-30T07:15:14.96Z" }, + { url = "https://files.pythonhosted.org/packages/a4/73/319dfa745dd668efe89309141ded489126461fcecd2b8f3a3cda185129b6/rpds_py-2026.6.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:538949e262e46caa31ac01bdb3c1e8f642622922cacbabbae6a8445d9dc33eaf", size = 338542, upload-time = "2026-06-30T07:15:16.267Z" }, + { url = "https://files.pythonhosted.org/packages/21/63/4239893be1c4d09b709b1a8f6be4188f0870084ff547f46606b8a75f1b03/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:55927d532399c2c646100ff7feb48eaa940ad70f42cd68e1328f3ded9f81ca24", size = 368180, upload-time = "2026-06-30T07:15:17.62Z" }, + { url = "https://files.pythonhosted.org/packages/1c/ca/9c5de382225234ceb37b1844ebdb140db12b2a278bb9efe2fcd19f6c82ce/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f56f1695bc5c0871cbc33dc0130fcf503aab0c57dcc5a6700a4f49eba4f2652e", size = 375067, upload-time = "2026-06-30T07:15:18.952Z" }, + { url = "https://files.pythonhosted.org/packages/87/dc/863f69d1bf04ade34b7fe0d59b9fdf6f0135fe2d7cbca74f1d665589559d/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:270b293dae9058fc9fcedab50f13cebf46fb8ed1d1d54e0521a9da5d6b211975", size = 490509, upload-time = "2026-06-30T07:15:20.434Z" }, + { url = "https://files.pythonhosted.org/packages/ce/ef/eac16a12048b45ec7c7fa94f2be3438a5f26bf9cc8580b18a1cfd609b7f6/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:127565fead0a10943b282957bd5447804ff3160ad79f2ad2635e6d249e380680", size = 382754, upload-time = "2026-06-30T07:15:21.831Z" }, + { url = "https://files.pythonhosted.org/packages/04/8f/d2f3f532616be4d06c316ef119683e832bd3d41e112bf3a88f4151c95b17/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ecabd69db66de867690f9797f2f8fa27ba501bbc24540cbdbdc649cd15888ba6", size = 366189, upload-time = "2026-06-30T07:15:23.371Z" }, + { url = "https://files.pythonhosted.org/packages/e3/29/41a7b0e98a4b44cd676ab7598419623373eb43b20be68c084935c1a8cf88/rpds_py-2026.6.3-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:58eadac9cd119677b60e1cf8ac4052f35949d71b8a9e5556efccbe82533cf22a", size = 377750, upload-time = "2026-06-30T07:15:24.659Z" }, + { url = "https://files.pythonhosted.org/packages/2e/05/ecda0bec46f9a1565090bcdc941d023f6a25aff85fda28f89f8d19878152/rpds_py-2026.6.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7491ee23305ac3eb59e492b6945881f5cd77a6f731061a3f25b77fd40f9e99a4", size = 395576, upload-time = "2026-06-30T07:15:25.987Z" }, + { url = "https://files.pythonhosted.org/packages/68/a8/6ed52f03ee6cb854ce78785cc9a9a672eb880e83fd7224d471f667d151f1/rpds_py-2026.6.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2c99f7e8ccb3dd6e3e4bfeac657a7b208c9bac8075f4b078c02d7404c34107fa", size = 543807, upload-time = "2026-06-30T07:15:27.356Z" }, + { url = "https://files.pythonhosted.org/packages/8f/d6/156c0d3eea27ba09b92562ba2364ba124c0a061b199e17eac637cd25a5e2/rpds_py-2026.6.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:62698275682bf121181861295c9181e789030a2d516071f5b8f3c23c170cd0fc", size = 611187, upload-time = "2026-06-30T07:15:28.931Z" }, + { url = "https://files.pythonhosted.org/packages/f1/31/774212ed989c62f7f310220089f9b0a3fb8f40f5443d1727abd5d9f52bc9/rpds_py-2026.6.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a214c993455f99a89aaeadc9b21241900037adc9d97203e374d75513c5911822", size = 573030, upload-time = "2026-06-30T07:15:30.553Z" }, + { url = "https://files.pythonhosted.org/packages/c9/50/22f73127a41f1ce4f87fe39aadfb9a126345801c274aa93ae88456249327/rpds_py-2026.6.3-cp312-cp312-win32.whl", hash = "sha256:501f9f04a588d6a09179368c57071301445191767c64e4b52a6aa9871f1ef5ed", size = 202185, upload-time = "2026-06-30T07:15:32.027Z" }, + { url = "https://files.pythonhosted.org/packages/04/3a/f0ee4d4dde9d3b69dedf1b5f74e7a40017046d55052d173e418c6a94f960/rpds_py-2026.6.3-cp312-cp312-win_amd64.whl", hash = "sha256:2c958bf94822e9290a40aaf2a822d4bc5c88099093e3948ad6c571eca9272e5f", size = 220394, upload-time = "2026-06-30T07:15:33.359Z" }, + { url = "https://files.pythonhosted.org/packages/f3/83/3382fe37f809b59f02aac04dbc4e765b480b46ee0227ed516e3bdc4d3dfc/rpds_py-2026.6.3-cp312-cp312-win_arm64.whl", hash = "sha256:22bffe6042b9bcb0822bcd1955ec00e245daf17b4344e4ed8e9551b976b63e96", size = 215753, upload-time = "2026-06-30T07:15:34.778Z" }, + { url = "https://files.pythonhosted.org/packages/a4/9e/b818ee580026ec578138e961027a68820c40afeb1ec8f6819b54fb99e196/rpds_py-2026.6.3-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:3cfe765c1da0072636ca06628261e0ea05688e160d5c8a03e0217c3854037223", size = 343012, upload-time = "2026-06-30T07:15:36.005Z" }, + { url = "https://files.pythonhosted.org/packages/f3/6b/686d9dc4359a8f163cfbbf89ee0b4e586431de22fe8248edb63a8cf50d49/rpds_py-2026.6.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f4d78253f6996be4901669ad25319f842f740eccf4d58e3c7f3dd39e6dde1d8f", size = 338203, upload-time = "2026-06-30T07:15:37.462Z" }, + { url = "https://files.pythonhosted.org/packages/9e/9b/069aa329940f8207615e091f5eedbbd40e1e15eac68a0790fd05ccdf796c/rpds_py-2026.6.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54f45a148e28767bf343d33a684693c70e451c6f4c0e9904709a723fafbdfc1f", size = 367984, upload-time = "2026-06-30T07:15:39.008Z" }, + { url = "https://files.pythonhosted.org/packages/14/db/34c203e4becff3703e4d3bc121842c00b8689197f398161203a880052f4e/rpds_py-2026.6.3-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:842e7b070435622248c7a2c44ae53fa1440e073cc3023bc919fed570884097a7", size = 374815, upload-time = "2026-06-30T07:15:40.253Z" }, + { url = "https://files.pythonhosted.org/packages/ee/7d/8071067d2cc453d916ad836e828c943f575e8a44612537759002a1e07381/rpds_py-2026.6.3-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8020133a74bd81b4572dd8e4be028a6b1ebcd70e6726edc3918008c08bee6ee6", size = 490545, upload-time = "2026-06-30T07:15:41.729Z" }, + { url = "https://files.pythonhosted.org/packages/a3/42/da06c5aa8f0484ff07f270787434204d9f4535e2f8c3b51ed402267e63c3/rpds_py-2026.6.3-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cdc7e35386f3847df728fbcb5e887e2d79c19e2fa1eba9e51b6621d23e3243af", size = 382828, upload-time = "2026-06-30T07:15:43.327Z" }, + { url = "https://files.pythonhosted.org/packages/57/d7/fe978efc2ae50abe48eb7464668ea99f53c010c60aeebb7b35ad27f23661/rpds_py-2026.6.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acac386b453c2516111b50985d60ce46e7fadb5ea71ae7b25f4c946935bf27cf", size = 365678, upload-time = "2026-06-30T07:15:44.992Z" }, + { url = "https://files.pythonhosted.org/packages/69/9d/1d8922e1990b2a6eb532b6ff53d3e73d2b3bbffc84116c75826bee73dfc6/rpds_py-2026.6.3-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:425560c6fa0415f27261727bb20bd097568485e5eb0c121f1949417d1c516885", size = 377811, upload-time = "2026-06-30T07:15:46.523Z" }, + { url = "https://files.pythonhosted.org/packages/b1/3d/198dceafb4fb034a6a47347e1b0735d34e0bd4a50be4e898d408ee66cb14/rpds_py-2026.6.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a550fb4950a06dde3beb4721f5ad4b25bf4513784665b0a8522c792e2bd822a4", size = 395382, upload-time = "2026-06-30T07:15:47.955Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f1/13968e49655d40b6b19d8b9140296bbc6f1d86b3f0f6c346cf9f1adddf4b/rpds_py-2026.6.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4f4bca01b63096f606e095734dd56e74e175f94cfbf24ff3d63281cec61f7bb7", size = 543832, upload-time = "2026-06-30T07:15:49.33Z" }, + { url = "https://files.pythonhosted.org/packages/ac/ab/289bcb1b90bd3e40a2900c561fa0e2087345ecbb094f0b870f2345142b7c/rpds_py-2026.6.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ccffae9a092a00deb7efd545fe5e2c33c33b88e7c054337e9a74c179347d0b7d", size = 611011, upload-time = "2026-06-30T07:15:50.847Z" }, + { url = "https://files.pythonhosted.org/packages/1e/16/5043105e679436ccfbc8e5e0dd2d663ed18a8b8113515fd06a5e5d77c83e/rpds_py-2026.6.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1cf01971c4f2c5553b772a542e4aaf191789cd331bc2cd4ff0e6e65ba49e1e97", size = 572431, upload-time = "2026-06-30T07:15:52.394Z" }, + { url = "https://files.pythonhosted.org/packages/85/ed/adab103321c0a6565d5ae1c2998349bc3ee175b82ccc5ae8fc04cc413075/rpds_py-2026.6.3-cp313-cp313-win32.whl", hash = "sha256:8c3d1e9c15b9d51ca0391e13da1a25a0a4df3c58a37c9dc368e0736cf7f69df0", size = 201710, upload-time = "2026-06-30T07:15:53.894Z" }, + { url = "https://files.pythonhosted.org/packages/7b/ed/a03b09668e74e5dabbf2e211f6468e1820c0552f7b0500082da31841bf7b/rpds_py-2026.6.3-cp313-cp313-win_amd64.whl", hash = "sha256:9250a9a0a6fd4648b3f868da8d91a4c52b5811a62df58e753d50ae4454a36f80", size = 219454, upload-time = "2026-06-30T07:15:55.25Z" }, + { url = "https://files.pythonhosted.org/packages/27/17/b8642c12930b71bc2b25831f6708ccf0f75abcd11883932ec9ce54ba3a78/rpds_py-2026.6.3-cp313-cp313-win_arm64.whl", hash = "sha256:900a67df3fd1660b035a4761c4ce73c382ea6b35f90f9863c36c6fd8bf8b09bb", size = 215063, upload-time = "2026-06-30T07:15:56.573Z" }, + { url = "https://files.pythonhosted.org/packages/b6/36/7fbe9dcdaf857fb3f63c2a2284b62492d95f5e8334e947e5fb6e7f68c9be/rpds_py-2026.6.3-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:931908d9fc855d8f74783377822be318edb6dcb19e47169dc038f9a1bf60b06e", size = 344510, upload-time = "2026-06-30T07:15:57.921Z" }, + { url = "https://files.pythonhosted.org/packages/ba/54/f785cc3d3f60839ca57a5af4927a9f347b07b2799c373fc20f7949f87c7e/rpds_py-2026.6.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:d7469697dce35be237db177d42e2a2ee26e6dcc5fc052078a6fefabd288c6edd", size = 339495, upload-time = "2026-06-30T07:15:59.238Z" }, + { url = "https://files.pythonhosted.org/packages/63/ef/d4cdaf309e6b095b43597103cf8c0b951d6cca2acce68c474f75ec12e0c7/rpds_py-2026.6.3-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bcfbcf66006befb9fd2aeaa9e01feaf881b4dc330a02ba07d2322b1c11be7b5d", size = 369454, upload-time = "2026-06-30T07:16:01.021Z" }, + { url = "https://files.pythonhosted.org/packages/96/4a/9559a68b7ee15db09d7981212e8c2e219d2a1d6d4faa0391d813c3496a36/rpds_py-2026.6.3-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:847927daf4cffbd4e90e42bc890069897101edd015f956cb8721b3473372edda", size = 374583, upload-time = "2026-06-30T07:16:02.287Z" }, + { url = "https://files.pythonhosted.org/packages/ef/75/8964aa7d2c6e8ac43eba8eb6e6b0fdda1f46d39f2fc3e6aa9f2cb17f485d/rpds_py-2026.6.3-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aca6c1ef08a82bfe327cc156da694660f599923e2e6665b6d81c9c2d0ac9ffc8", size = 492919, upload-time = "2026-06-30T07:16:03.723Z" }, + { url = "https://files.pythonhosted.org/packages/8f/97/6908094ac804115e65aedfd90f1b5fee4eebebd3f6c4cfc5419939267565/rpds_py-2026.6.3-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ae50181a047c871561212bb97f7932a2d45fb53e947bd9b57ebad85b529cbc53", size = 383725, upload-time = "2026-06-30T07:16:05.305Z" }, + { url = "https://files.pythonhosted.org/packages/d1/9c/0d1fdc2e7aba23e290d603bc494e97bd205bae262ce33c6b32a69768ed5e/rpds_py-2026.6.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc319e5a1de4b6913aac94bf6a2f9e847371e0a140a43dd4991db1a09bc2d504", size = 367255, upload-time = "2026-06-30T07:16:07.086Z" }, + { url = "https://files.pythonhosted.org/packages/c4/fe/f0209ca4a9ed074bc8acb44dfd0e81c3122e94c9689f5645b7973a866719/rpds_py-2026.6.3-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:e4316bf32babbed84e691e352faf967ce2f0f024174a8643c37c94a1080374fc", size = 379060, upload-time = "2026-06-30T07:16:08.525Z" }, + { url = "https://files.pythonhosted.org/packages/c6/8d/f1cc54c616b9d8897de8738aac148d20afca93f68187475fe194d09a71b9/rpds_py-2026.6.3-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8c6e5a2f750cc71c3e3b11d71661f21d6f9bc6cebc6564b1466417a1ec03ec77", size = 395960, upload-time = "2026-06-30T07:16:09.989Z" }, + { url = "https://files.pythonhosted.org/packages/fb/04/aafff00f73aeca2945f734f1d483c64ab8f472d0864ab02377fd8e89c3b2/rpds_py-2026.6.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:4470ce197d4090875cf6affbf1f853338387428df97c4fb7b7106317b8214698", size = 545356, upload-time = "2026-06-30T07:16:11.816Z" }, + { url = "https://files.pythonhosted.org/packages/fd/cc/e229663b9e4ddac5a4acbe9085dd80a71af2a5d356b8b39d6bff233f24b0/rpds_py-2026.6.3-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:ea964164cc9afa72d4d9b23cc28dafae93693c0a53e0b42acbff15b22c3f9ddd", size = 612319, upload-time = "2026-06-30T07:16:13.586Z" }, + { url = "https://files.pythonhosted.org/packages/e3/7a/8a0e6d3e6cd066af108b71b43122c3fe158dd9eb86acac626593a2582eb1/rpds_py-2026.6.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:639c8929aa0afe81be836b04de888460d6bed38b9c54cfc18da8f6bfabf5af5d", size = 573508, upload-time = "2026-06-30T07:16:15.23Z" }, + { url = "https://files.pythonhosted.org/packages/87/03/2a69ab618a789cf6cf85c86bb844c62d090e700ab1a2aa676b3741b6c516/rpds_py-2026.6.3-cp314-cp314-win32.whl", hash = "sha256:882076c00c0a608b131187055ddc5ae29f2e7eaf870d6168980420d58528a5c8", size = 202504, upload-time = "2026-06-30T07:16:16.893Z" }, + { url = "https://files.pythonhosted.org/packages/85/62/a3892ba945f4e24c78f352e5de3c7620d8479f73f211406a97263d13c7d2/rpds_py-2026.6.3-cp314-cp314-win_amd64.whl", hash = "sha256:0be972be84cfcaf46c8c6edf690ca0f154ac17babf1f6a955a51579b34ad2dc5", size = 220380, upload-time = "2026-06-30T07:16:18.108Z" }, + { url = "https://files.pythonhosted.org/packages/3d/e7/c2bd44dc831931815ad11ebb5f430b5a0a4d3caa9de837107876c30c3432/rpds_py-2026.6.3-cp314-cp314-win_arm64.whl", hash = "sha256:2a9c6f195058cb45335e8cc3802745c603d716eb96bc9625950c1aac71c0c703", size = 215976, upload-time = "2026-06-30T07:16:19.654Z" }, + { url = "https://files.pythonhosted.org/packages/79/9c/fff7b74bce9a091ec9a012a03f9ff5f69364eaf9451060dfc4486da2ffdd/rpds_py-2026.6.3-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:f90938e92afda60266da758ee7d363447f7f0138c9559f9e1811629580582d90", size = 346840, upload-time = "2026-06-30T07:16:21.268Z" }, + { url = "https://files.pythonhosted.org/packages/e9/44/77bcb1168b33704908295533d27f10eb811e9e3e193e8993dc99572211d3/rpds_py-2026.6.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ec829541c45bca16e61c7ae50c20501f213605beb75d1aba91a6ee37fbbb56a4", size = 340282, upload-time = "2026-06-30T07:16:22.875Z" }, + { url = "https://files.pythonhosted.org/packages/87/3c/7a9081c7c9e645b39efe19e4ffbeccd80add246327cd9b888aecffd72317/rpds_py-2026.6.3-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:afd70d95892096cdb26f15a00c45907b17817577aa8d1c76b2dcc2788391f9e9", size = 370403, upload-time = "2026-06-30T07:16:24.415Z" }, + { url = "https://files.pythonhosted.org/packages/f7/69/af47021eb7dad6ff3396cb001c08f0f3c4d06c20253f75be6421a59fe6b7/rpds_py-2026.6.3-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:29dfa0533a5d4c94d4dfa1b694fcb56c9c63aad8330ffdd816fd225d0a7a162f", size = 376055, upload-time = "2026-06-30T07:16:26.111Z" }, + { url = "https://files.pythonhosted.org/packages/81/fc/a3bcf517084396a6dd258c592567a3c011ba4557f2fde23dceaf26e74f2e/rpds_py-2026.6.3-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:af05d726809bff6b141be124d4c7ce998f9c9c7f30edb1f46c07aa103d540b41", size = 494419, upload-time = "2026-06-30T07:16:27.596Z" }, + { url = "https://files.pythonhosted.org/packages/c9/eb/13d529d1788135425c7bf207f8463458ca5d92e43f3f701365b83e9dffc1/rpds_py-2026.6.3-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9826217f048f620d9a712672818bf231442c1b35d96b227a07eabd11b4bb6945", size = 384848, upload-time = "2026-06-30T07:16:29.183Z" }, + { url = "https://files.pythonhosted.org/packages/8e/f4/b7ac49f30013aba8f7b9566b1dd07e81de95e708c1374b7bacc5b9bc5c9c/rpds_py-2026.6.3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:536bceea4fa4acf7e1c61da2b5786304367c816c8895be71b8f537c480b0ea1f", size = 371369, upload-time = "2026-06-30T07:16:30.912Z" }, + { url = "https://files.pythonhosted.org/packages/31/86/6260bafa622f788b07ddec0e52d810305c8b9b0b8c27f58a2ab04bf62b4f/rpds_py-2026.6.3-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:bc0011654b91cc4fb2ae701bec0a0ba1e552c0714247fa7af6c59e0ccfa3a4e1", size = 379673, upload-time = "2026-06-30T07:16:32.486Z" }, + { url = "https://files.pythonhosted.org/packages/19/c3/03f1ee79a047b48daeca157c89a18509cde22b6b951d642b9b0af1be660a/rpds_py-2026.6.3-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:539d75de9e0d536c84ff18dfeb805398e58227001ce09231a26a08b9aed1ee0e", size = 397500, upload-time = "2026-06-30T07:16:34.471Z" }, + { url = "https://files.pythonhosted.org/packages/f0/95/8ed0cd8c377dca12aea498f119fe639fc474d1461545c39d2b5872eb1c0f/rpds_py-2026.6.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:166cf54d9f44fc6ceb53c7860258dde44a81406646de79f8ed3234fca3b6e538", size = 545978, upload-time = "2026-06-30T07:16:36.45Z" }, + { url = "https://files.pythonhosted.org/packages/d3/f2/0eb57f0eaa83f8fc152a7e03de968ab77e1f00732bebc892b190c6eebde7/rpds_py-2026.6.3-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:d34c20167764fbcf927194d532dd7e0c56772f0a5f943fa5ef9e9afbba8fb9db", size = 613350, upload-time = "2026-06-30T07:16:38.213Z" }, + { url = "https://files.pythonhosted.org/packages/5b/de/e0674bdbc3ef7634989b3f854c3f34bc1f587d36e5bfdc5c378d57034619/rpds_py-2026.6.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ea7bb13b7c9a29791f87a0387ba7d3ad3a6d783d827e4d3f27b40a0ff44495e2", size = 576486, upload-time = "2026-06-30T07:16:39.797Z" }, + { url = "https://files.pythonhosted.org/packages/f2/f6/21101359743cd136ada781e8210a85769578422ba460672eea0e29739200/rpds_py-2026.6.3-cp314-cp314t-win32.whl", hash = "sha256:6de4744d05bd1aa1be4ed7ea1189e3979196808008113bbbf899a460966b925e", size = 201068, upload-time = "2026-06-30T07:16:41.316Z" }, + { url = "https://files.pythonhosted.org/packages/a6/b2/9574d4d44f7760c2aa32d92a0a4f41698e33f5b204a0bf5c9758f52c79d5/rpds_py-2026.6.3-cp314-cp314t-win_amd64.whl", hash = "sha256:c7b9a2f8f4d8e90af72571d3d495deebdd7e3c75451f5b41719aee166e940fc2", size = 220600, upload-time = "2026-06-30T07:16:43.091Z" }, + { url = "https://files.pythonhosted.org/packages/08/ae/f23a2697e6ee6340a578b0f136be6483657bef0c6f9497b752bb5c0964bb/rpds_py-2026.6.3-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:e059c5dde6452b44424bd1834557556c226b57781dee1227af23518459722b13", size = 344726, upload-time = "2026-06-30T07:16:44.5Z" }, + { url = "https://files.pythonhosted.org/packages/c3/63/e7b3a1a5358dd32c930a1062d8e15b67fd6e8922e81df9e91706d66ee5c8/rpds_py-2026.6.3-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:2f7c26fbc5acd2522b95d4177fe4710ffd8e9b20529e703ffbf8db4d93903f05", size = 339587, upload-time = "2026-06-30T07:16:46.255Z" }, + { url = "https://files.pythonhosted.org/packages/ec/64/10a85681916ca55fffb91b0a211f84e34297c109243484dd6394660a8a7c/rpds_py-2026.6.3-cp315-cp315-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a3086b538543802f84c843911242db20447de00d8752dd0efc936dbcf02218ba", size = 369585, upload-time = "2026-06-30T07:16:48.101Z" }, + { url = "https://files.pythonhosted.org/packages/76/c2/baf95c7c38823e12ba34407c5f5767a89e5cf2233895e56f608167ae9493/rpds_py-2026.6.3-cp315-cp315-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8f2e5c5ee828d42cb11760761c0af6507927bec42d0ad5458f97c9203b054617", size = 375479, upload-time = "2026-06-30T07:16:49.93Z" }, + { url = "https://files.pythonhosted.org/packages/6a/94/0aad06c72d65101e11d33528d438cda99a39ce0da99466e156158f2541d3/rpds_py-2026.6.3-cp315-cp315-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ed0c1e5d10cdc7135537988c74a0188da68e2f3c30813ba3744ab1e42e0480f9", size = 492418, upload-time = "2026-06-30T07:16:51.641Z" }, + { url = "https://files.pythonhosted.org/packages/b5/17/de3f5a479a1f056535d7489819639d8cd591ea6281d700390b43b1abd745/rpds_py-2026.6.3-cp315-cp315-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8c2642a7603ec0b16ed77da4555db3b4b472341904873788327c0b0d7b95f1bb", size = 384123, upload-time = "2026-06-30T07:16:53.622Z" }, + { url = "https://files.pythonhosted.org/packages/46/7d/bf09bd1b145bb2671c03e1e6d1ab8651858d90d8c7dfeadd85a37a934fd8/rpds_py-2026.6.3-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e4320744c1ffdd95a603def63344bfab2d33edeab301c5007e7de9f9f5b3885", size = 367351, upload-time = "2026-06-30T07:16:55.241Z" }, + { url = "https://files.pythonhosted.org/packages/a3/ea/1bb734f314b8be319149ddee80b18bd41372bdcfbdf88d28131c0cd37719/rpds_py-2026.6.3-cp315-cp315-manylinux_2_31_riscv64.whl", hash = "sha256:a9f4645593036b81bbdb36b9c8e0ea0d1c3fee968c4d59db0344c14087ef143a", size = 378827, upload-time = "2026-06-30T07:16:56.841Z" }, + { url = "https://files.pythonhosted.org/packages/4b/93/d9611e5b25e26df9a3649813ed66193ace9347a7c7fc4ab7cf70e94851c0/rpds_py-2026.6.3-cp315-cp315-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e55d236be29255554da47abe5c577637db7c24a02b8b46f0ca9524c855801868", size = 395966, upload-time = "2026-06-30T07:16:58.557Z" }, + { url = "https://files.pythonhosted.org/packages/c3/cb/99d77e16e5534ae1d90629bbe419ba6ee170833a6a85e3aa1cc41726fbbc/rpds_py-2026.6.3-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:24e9c5386e16669b674a69c156c8eeefcb578f3b3397b713b08e6d60f3c7b187", size = 545680, upload-time = "2026-06-30T07:17:00.164Z" }, + { url = "https://files.pythonhosted.org/packages/59/15/11a29755f790cef7a2f755e8e14f4f0c33f39489e1893a632a2eee59672b/rpds_py-2026.6.3-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:c60924535c75f1566b6eb75b5c31a48a43fef04fa2d0d201acbad8a9969c6107", size = 611853, upload-time = "2026-06-30T07:17:01.962Z" }, + { url = "https://files.pythonhosted.org/packages/68/86/0c27547e21644da938fb530f7e1a8148dd24d02db07e7a5f2567a17ce710/rpds_py-2026.6.3-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:38a2fea2787428f811719ceb9114cb78964a3138838320c29ac39526c79c16ba", size = 573715, upload-time = "2026-06-30T07:17:03.693Z" }, + { url = "https://files.pythonhosted.org/packages/29/71/4d8fcf700931815594bce892255bbd973b94efaf0fc1932b0590df18d886/rpds_py-2026.6.3-cp315-cp315-win32.whl", hash = "sha256:d483fe17f01ad64b7bf7cc38fcefff1ca9fb83f8c2b2542b68f97ffe0611b369", size = 202864, upload-time = "2026-06-30T07:17:05.746Z" }, + { url = "https://files.pythonhosted.org/packages/eb/62/b577562de0edbb55b2be85ce5fd09c33e386b9b13eee09833af4240fd5c4/rpds_py-2026.6.3-cp315-cp315-win_amd64.whl", hash = "sha256:67e3a721ffc5d8d2210d3671872298c4a84e4b8035cfe42ffd7cde35d772b146", size = 220430, upload-time = "2026-06-30T07:17:07.471Z" }, + { url = "https://files.pythonhosted.org/packages/c8/95/d6d0b2509825141eef60669a5739eec88dbc6a48053d6c92993a5704defe/rpds_py-2026.6.3-cp315-cp315-win_arm64.whl", hash = "sha256:6e84adbcf4bf841aed8116a8264b9f50b4cb3e7bd89b516122e616ac56ca269e", size = 215877, upload-time = "2026-06-30T07:17:09.008Z" }, + { url = "https://files.pythonhosted.org/packages/b7/bf/f3ea278f0afd615c1d0f19cb69043a41526e2bb600c2b536eb192218eb27/rpds_py-2026.6.3-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:ae6dd8f10bd17aad820876d24caec9efdafd80a318d16c0a48edb5e136902c6b", size = 346933, upload-time = "2026-06-30T07:17:10.762Z" }, + { url = "https://files.pythonhosted.org/packages/9d/29/9907bdf1c5346763cf10b7f6852aad86652168c259def904cbe0082c5864/rpds_py-2026.6.3-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:bdbd97738551fca3917c1bd7188bec1920bb520104f28e7e1007f9ceb17b7690", size = 340274, upload-time = "2026-06-30T07:17:12.266Z" }, + { url = "https://files.pythonhosted.org/packages/6f/2c/8e03767b5778ef25cebf74a7a91a2c3806f8eced4c92cb7406bbe060756d/rpds_py-2026.6.3-cp315-cp315t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b95977e7211527ab0ba576e286d023389fbeeb32a6b7b771665d333c60e5342", size = 370763, upload-time = "2026-06-30T07:17:14.107Z" }, + { url = "https://files.pythonhosted.org/packages/2e/e1/df2a7e1ba2efd796af26194250b8d42c821b46592311595162af9ef0528d/rpds_py-2026.6.3-cp315-cp315t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d15fde0e6fb0d88a60d221204873743e5d9f0b7d29165e62cd86d0413ad74ba6", size = 376467, upload-time = "2026-06-30T07:17:15.76Z" }, + { url = "https://files.pythonhosted.org/packages/6b/de/8a0814d1946af29cb068fb259aa8622f856df1d0bab58429448726b537f5/rpds_py-2026.6.3-cp315-cp315t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a136d453475ac0fcbda502ef1e6504bd28d6d904700915d278deeab0d00fe140", size = 496689, upload-time = "2026-06-30T07:17:17.308Z" }, + { url = "https://files.pythonhosted.org/packages/df/f3/f19e0c852ba13694f5a79f3b719331051573cb5693feacf8a88ffffc3a71/rpds_py-2026.6.3-cp315-cp315t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f826877d462181e5eb1c26a0026b8d0cab05d99844ecb6d8bf3627a2ca0c0442", size = 385340, upload-time = "2026-06-30T07:17:18.928Z" }, + { url = "https://files.pythonhosted.org/packages/e2/ae/7ec3a9d2d4351f99e37bcb06b6b6f954512646bfdbf9742e1de727865daf/rpds_py-2026.6.3-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:79486287de1730dbaff3dbd124d0ca4d2ef7f9d29bf2544f1f93c09b5bcbbd12", size = 372179, upload-time = "2026-06-30T07:17:20.539Z" }, + { url = "https://files.pythonhosted.org/packages/d3/ac/9cee911dff2aaa9a5a8354f6610bf2e6a616de9197c5fff4f54f82585f1e/rpds_py-2026.6.3-cp315-cp315t-manylinux_2_31_riscv64.whl", hash = "sha256:808345f53cb952433ca2816f1604ff3515608a81784954f38d4452acfe8e61d5", size = 379993, upload-time = "2026-06-30T07:17:22.212Z" }, + { url = "https://files.pythonhosted.org/packages/83/6b/7c2a07ba88d1e9a936612f7a5d067467ed03d971d5a06f7d309dff044a7e/rpds_py-2026.6.3-cp315-cp315t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1967debc37f64f2c4dc90a7f563aec558b471966e12adcac4e1c4240496b6ebf", size = 398909, upload-time = "2026-06-30T07:17:23.66Z" }, + { url = "https://files.pythonhosted.org/packages/97/0b/776ffcb66783637b0031f6d58d6fb55913c8b5abf00aeecd46bf933fb477/rpds_py-2026.6.3-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:f0840b5b17057f7fd918b76183a4b5a0635f43e14eb2ce60dce1d4ee4707ea00", size = 546584, upload-time = "2026-06-30T07:17:25.264Z" }, + { url = "https://files.pythonhosted.org/packages/55/33/ba3bc04d7092bd553c9b2b195624992d2cc4f3de1f380b7b93cbee67bd79/rpds_py-2026.6.3-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:faa679d19a6696fd54259ad321251ad77a13e70e03dd834daa762a44fb6196ef", size = 614357, upload-time = "2026-06-30T07:17:26.888Z" }, + { url = "https://files.pythonhosted.org/packages/8b/71/14edf065f04630b1a8472f7653cad03f6c478bcf95ea0e6aed55451e33ea/rpds_py-2026.6.3-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:23a439f31ccbeff1574e24889128821d1f7917470e830cf6544dced1c662262a", size = 576533, upload-time = "2026-06-30T07:17:28.546Z" }, + { url = "https://files.pythonhosted.org/packages/ba/76/65002b08596c389105720a8c0d22298b8dc25a4baf89b2ce431343c8b1de/rpds_py-2026.6.3-cp315-cp315t-win32.whl", hash = "sha256:913ca42ccad3f8cc6e292b587ae8ae49c8c823e5dce51a736252fc7c7cdfa577", size = 201204, upload-time = "2026-06-30T07:17:30.193Z" }, + { url = "https://files.pythonhosted.org/packages/8c/97/d855d6b3c322d1f27e26f5241c42016b56cf01377ea8ed348285f54652f0/rpds_py-2026.6.3-cp315-cp315t-win_amd64.whl", hash = "sha256:ae3d4fe8c0b9213624fdce7279d70e3b148b682ca20719ebd193a23ebfa47324", size = 220719, upload-time = "2026-06-30T07:17:31.788Z" }, +] + +[[package]] +name = "ruff" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4d/94/1e5e4967626faf12fa56999cd6222dff6992ceb086ad7945756baf70c7a7/ruff-0.16.0.tar.gz", hash = "sha256:e460aafd5495ec89efaa6ced2e4a9a581116451e1c88b9d37ef497e0f8e93982", size = 4790557, upload-time = "2026-07-23T19:11:30.981Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4b/81/1c8818fee7ce1a04cd7d1b3172e0a8f8e4f1dc4feb7fc390e16daa8af323/ruff-0.16.0-py3-none-linux_armv6l.whl", hash = "sha256:e5115729eb08c585e5121978ba5d5b60caeae394ce21b9fb5e6cd33a1c6c9b1e", size = 10754633, upload-time = "2026-07-23T19:10:46.415Z" }, + { url = "https://files.pythonhosted.org/packages/23/df/beaf59c09d68db84304d555f188b276a77132a5d5b0b67a5c762aa143628/ruff-0.16.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3c954b1d580bfa035b41654f7858cc7e71d5fc3ac5b723dd62bd9133830ed522", size = 10969164, upload-time = "2026-07-23T19:10:50.271Z" }, + { url = "https://files.pythonhosted.org/packages/42/ce/741cd197496a1abbf51352710fd15ed995d2a2be87189c1da26a450d6e83/ruff-0.16.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e01c21d10eb1b29f47b7454e1f4056db9a3f0260c646aa88457c610291db9f81", size = 10488846, upload-time = "2026-07-23T19:10:52.639Z" }, + { url = "https://files.pythonhosted.org/packages/52/2a/a2db8e88cade358f5cdcb05674a917751074109315d014eb6352d9a893f7/ruff-0.16.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e364e5ed22ed8dc05082fd78e35308618260907ac2d3c1d637b2e682415b6c9", size = 10889729, upload-time = "2026-07-23T19:10:54.89Z" }, + { url = "https://files.pythonhosted.org/packages/42/65/62a771694ebd63029dc953e27dbad40e1588bd4860ff9fe881018fddaa49/ruff-0.16.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d327b8fc113a1d4421a04f3839d3752057c8dd1ee320223a6f3f52d04ada462a", size = 10568275, upload-time = "2026-07-23T19:10:56.993Z" }, + { url = "https://files.pythonhosted.org/packages/3f/e2/ced249fe8af5f086c5c58cc21cc3356d50f32f7401c5df87050c999620a7/ruff-0.16.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9b50c55e263103586b3dcf5f73d479eb8cb5fdb6098fec59a62891dab653717", size = 11385112, upload-time = "2026-07-23T19:10:59.615Z" }, + { url = "https://files.pythonhosted.org/packages/87/0b/05154977a8fd69eeb6c103271f55403bfd8711f5c0f8ed07489d95a504e7/ruff-0.16.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0ff4a79ce3ec0172f3241943835de1c4cb4e2dcd07f0f8c2d02603dbbbee4b17", size = 12207008, upload-time = "2026-07-23T19:11:02.154Z" }, + { url = "https://files.pythonhosted.org/packages/fb/29/98225831a3a1eab0e02f4acc6ca6559a98611dcc68b6965ff4b7234627c1/ruff-0.16.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e95c448fca1fb2a18372a9440926c5a6ee789639bb975c72e7ae6d0b04218ab4", size = 11650842, upload-time = "2026-07-23T19:11:04.557Z" }, + { url = "https://files.pythonhosted.org/packages/91/66/6bd3cf90500653d55dc0ffc8507aa8300bd49d0214b2e8cb4d3fef2943ba/ruff-0.16.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f11a8d11010301d0a398a2fdef67691feca7294da6aef55e2150e8fa2cd520b", size = 11400718, upload-time = "2026-07-23T19:11:09.233Z" }, + { url = "https://files.pythonhosted.org/packages/8e/a2/a54eb4eae05d66364050a5d3b8a9c5ef88196531b3cbe7109d873f87f819/ruff-0.16.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:48044c678e9cb8698246c99b14aaccfa6601dea7379eb48a6f8f73f7a6d86cd0", size = 11426177, upload-time = "2026-07-23T19:11:11.994Z" }, + { url = "https://files.pythonhosted.org/packages/1a/be/16e3eea4b2a478a496919f5e36f17c4559e54620bd3bbac5d6affa068006/ruff-0.16.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7aa0959bad8eb8bef50340154fc9b58678dae31fa4293afa38b44b6e552c0213", size = 10856126, upload-time = "2026-07-23T19:11:14.221Z" }, + { url = "https://files.pythonhosted.org/packages/a2/84/252eb8b868a16eec7257c14f504f77537e734b2d69c762e639e588e304a3/ruff-0.16.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:28ea2b7df8ebf7f9da6b7d47b230ab48f387c0a29be3b474c4d0740e197bb9af", size = 10571208, upload-time = "2026-07-23T19:11:16.378Z" }, + { url = "https://files.pythonhosted.org/packages/21/09/817a482f542f7570cbb4554b26e896610c7114f539b1d9e2d2145bf6bef6/ruff-0.16.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:33a3dfac8c35f81498dea9181bccc2f4c4bc8f1521a1dd9406e77643e0f0fb09", size = 11063329, upload-time = "2026-07-23T19:11:19.173Z" }, + { url = "https://files.pythonhosted.org/packages/2e/23/9403c180ca1cb9b1f7335f5c3e5305c09d49ea5b345196682a36028bde4a/ruff-0.16.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a5237a0bda500d30d81b8e07a6973a5cbc772864cbf746ae2f4e8a2e01c9f4ed", size = 11489751, upload-time = "2026-07-23T19:11:21.74Z" }, + { url = "https://files.pythonhosted.org/packages/b2/1d/1b2ef7bcde851c78d7f17f1cca13fd6dc695fc4b3d6197941e72cae5b132/ruff-0.16.0-py3-none-win32.whl", hash = "sha256:7fab76fa065c873f41ff744347c6e77bcc3dfec4bcc754dc26b63d23c0f7f5fb", size = 10785885, upload-time = "2026-07-23T19:11:23.947Z" }, + { url = "https://files.pythonhosted.org/packages/b2/a3/d5e4ef7a56be3f928ffb90b94c25ba7d3cb9c7fe0736aeaaedf361770712/ruff-0.16.0-py3-none-win_amd64.whl", hash = "sha256:429c117f022bf481fabd9d551e7a3952b24c65e6ef44337ea09d90bebef14472", size = 11923141, upload-time = "2026-07-23T19:11:26.409Z" }, + { url = "https://files.pythonhosted.org/packages/cb/9a/8415f2657cbe200f41a4531ccededf135505a92d4a012229121f885b26f9/ruff-0.16.0-py3-none-win_arm64.whl", hash = "sha256:14296fedcd2705c77ab8235439278bbb38f285cf7da5528b00b3e330c3d4872d", size = 11273407, upload-time = "2026-07-23T19:11:28.705Z" }, +] + +[[package]] +name = "six" +version = "1.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, +] + +[[package]] +name = "sortedcontainers" +version = "2.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e8/c4/ba2f8066cceb6f23394729afe52f3bf7adec04bf9ed2c820b39e19299111/sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88", size = 30594, upload-time = "2021-05-16T22:03:42.897Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0", size = 29575, upload-time = "2021-05-16T22:03:41.177Z" }, +] + +[[package]] +name = "stack-data" +version = "0.6.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "asttokens" }, + { name = "executing" }, + { name = "pure-eval" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/28/e3/55dcc2cfbc3ca9c29519eb6884dd1415ecb53b0e934862d3559ddcb7e20b/stack_data-0.6.3.tar.gz", hash = "sha256:836a778de4fec4dcd1dcd89ed8abff8a221f58308462e1c4aa2a3cf30148f0b9", size = 44707, upload-time = "2023-09-30T13:58:05.479Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f1/7b/ce1eafaf1a76852e2ec9b22edecf1daa58175c090266e9f6c64afcd81d91/stack_data-0.6.3-py3-none-any.whl", hash = "sha256:d5558e0c25a4cb0853cddad3d77da9891a08cb85dd9f9f91b9f8cd66e511e695", size = 24521, upload-time = "2023-09-30T13:58:03.53Z" }, +] + +[[package]] +name = "starlette" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/eb/e3/7c1dc7381d9f8ab7d854328ebfa884e62cb3f3d8549ddfd37c7814f42afa/starlette-1.3.1.tar.gz", hash = "sha256:05d0213193f2fbaae60e2ecb593b4add4262ad4e46536b54abe36f11a71724e0", size = 2703240, upload-time = "2026-06-12T09:23:11.602Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/bb/2799cc2ede3ed41131f8975621e7213dfc7ef4acbbaadfa440f32500c370/starlette-1.3.1-py3-none-any.whl", hash = "sha256:c7372aae11c3c3f26a42df7bd626cec2f47d03483d261d369516a615a53714c6", size = 73632, upload-time = "2026-06-12T09:23:10.017Z" }, +] + +[[package]] +name = "tornado" +version = "6.5.8" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/10/d3/343e5bb989d6515b1646cf3d40135d73f3d5e45339bded401b56cdac24dd/tornado-6.5.8.tar.gz", hash = "sha256:9452e1b208a8bd771e2cb1f2ff564985b9b214bdebbe622793e1799e0a6bd23f", size = 520493, upload-time = "2026-08-07T02:12:42.971Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f2/d5/007086fd8df5489338e204f65adce33fd4f21a4999dbb2b9cff2f897b5f4/tornado-6.5.8-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:cc6aa787d7cfab7c3d35189dc7a56fbd2399a569624c730c6b55b3d6531d0403", size = 449487, upload-time = "2026-08-07T02:12:28.682Z" }, + { url = "https://files.pythonhosted.org/packages/70/c8/5a24a99495903f594f6a199dd7beead1cbc0a13e2cb9102727bcaaf2a997/tornado-6.5.8-cp39-abi3-macosx_10_9_x86_64.whl", hash = "sha256:9715b5eb79735b2bcd454ce216a9275b7c0470e64ea1bf5742f78b2f72b26eeb", size = 447649, upload-time = "2026-08-07T02:12:30.306Z" }, + { url = "https://files.pythonhosted.org/packages/6e/de/f2e733f386b85962d1b1dc82cd63d169b5b4580062b35397eac9244a41fe/tornado-6.5.8-cp39-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:547d63f450d570c14fe0e8db2cfb14c9bbd1c2503b4a6612586267955aa47b58", size = 450707, upload-time = "2026-08-07T02:12:31.95Z" }, + { url = "https://files.pythonhosted.org/packages/0b/94/20efeee9a01c141e9ac47c397f81679dfda24b32768fc4fff24e76d36c2c/tornado-6.5.8-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7e2360a0ffbe145eca8af0b19cb7203d79b1a98dd4cccdd6b368f6f49c2e3808", size = 451677, upload-time = "2026-08-07T02:12:33.512Z" }, + { url = "https://files.pythonhosted.org/packages/42/ec/a96ccb8ccf0de2b7bc2c5fa1608a4803735018242e90c4882365a9fd418f/tornado-6.5.8-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:5d242290bdf7ab3151bc1065fdd75c0dcc21cbc7b49f22a4c56329c2d6566d22", size = 451510, upload-time = "2026-08-07T02:12:35.346Z" }, + { url = "https://files.pythonhosted.org/packages/29/b5/93185859245ad3f00e62175f29607346788b696369347f0146e0421286bb/tornado-6.5.8-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:7b94ff0e128fe0542f3bd331fb44d06260fc4ac16881545159f34ef08aad4195", size = 450917, upload-time = "2026-08-07T02:12:36.963Z" }, + { url = "https://files.pythonhosted.org/packages/97/cf/fe33cf062834487d34d1559746a4a12521033c22645b6d74d4bca702e018/tornado-6.5.8-cp39-abi3-win32.whl", hash = "sha256:67832909c4779c64942380cb5f044a5c6163d00831472d80e25e115de9917836", size = 451952, upload-time = "2026-08-07T02:12:38.512Z" }, + { url = "https://files.pythonhosted.org/packages/cb/e1/468ad54333e92ccb62627e62cb88e5fc14a2171daa67ed47b1b8542d5b86/tornado-6.5.8-cp39-abi3-win_amd64.whl", hash = "sha256:11881db6b7c168494be2c2d12e65931451bdf7ee718535418ae1d8855dd5a0ee", size = 452391, upload-time = "2026-08-07T02:12:39.971Z" }, + { url = "https://files.pythonhosted.org/packages/ad/3e/cd5e4f06e34cde33b8ef66cf36aa2b5ad46354cc1af7d2136bbe365fee1d/tornado-6.5.8-cp39-abi3-win_arm64.whl", hash = "sha256:68a7468c7e289f8514d7d664101753903217eff1bb6822c6b5994a0b5f5bcb26", size = 451411, upload-time = "2026-08-07T02:12:41.469Z" }, +] + +[[package]] +name = "traitlets" +version = "5.16.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/2c/2e/a7fbfe268c8a3b32546930c0297c101d65a4a14c304ad5790a9f478f0e4e/traitlets-5.16.1.tar.gz", hash = "sha256:ed900c2b631aa3a112811139fa97b8d2c3bad5e989656bba4b7e52c7852c18c1", size = 166137, upload-time = "2026-08-03T08:32:36.848Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ad/66/0d785f0bc5e4315a96c989bb476d0fc07ea4f85132550c7b156ca2035d52/traitlets-5.16.1-py3-none-any.whl", hash = "sha256:f775618166caa0396c8e337099240f2bd3e5e917d203b2e6fbe21a58d3cb1f6b", size = 86211, upload-time = "2026-08-03T08:32:34.48Z" }, +] + +[[package]] +name = "truststore" +version = "0.10.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/53/a3/1585216310e344e8102c22482f6060c7a6ea0322b63e026372e6dcefcfd6/truststore-0.10.4.tar.gz", hash = "sha256:9d91bd436463ad5e4ee4aba766628dd6cd7010cf3e2461756b3303710eebc301", size = 26169, upload-time = "2025-08-12T18:49:02.73Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/19/97/56608b2249fe206a67cd573bc93cd9896e1efb9e98bce9c163bcdc704b88/truststore-0.10.4-py3-none-any.whl", hash = "sha256:adaeaecf1cbb5f4de3b1959b42d41f6fab57b2b1666adb59e89cb0b53361d981", size = 18660, upload-time = "2025-08-12T18:49:01.46Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, +] + +[[package]] +name = "urllib3" +version = "2.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602, upload-time = "2026-05-07T16:13:18.596Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087, upload-time = "2026-05-07T16:13:17.151Z" }, +] + +[[package]] +name = "uvicorn" +version = "0.51.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a2/65/b7c6c443ccc58678c91e1e973bbe2a878591538655d6e1d47f24ba1c51f3/uvicorn-0.51.0.tar.gz", hash = "sha256:f6f4b69b657c312f516dd2d268ab9ae6f254b11e4bac504f37b2ab58b24dd0b0", size = 94412, upload-time = "2026-07-08T10:59:05.962Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/45/ec/dbb7e5a6b91f86bfb9eb7d2988a2730907b6a729875b949c7f022e8b88fa/uvicorn-0.51.0-py3-none-any.whl", hash = "sha256:5d38af6cd620f2ae3849fb44fd4879e0890aa1febe8d47eb355fb45d93fe6a5b", size = 73219, upload-time = "2026-07-08T10:59:04.44Z" }, +] + +[[package]] +name = "watchdog" +version = "6.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/db/7d/7f3d619e951c88ed75c6037b246ddcf2d322812ee8ea189be89511721d54/watchdog-6.0.0.tar.gz", hash = "sha256:9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282", size = 131220, upload-time = "2024-11-01T14:07:13.037Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/39/ea/3930d07dafc9e286ed356a679aa02d777c06e9bfd1164fa7c19c288a5483/watchdog-6.0.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:bdd4e6f14b8b18c334febb9c4425a878a2ac20efd1e0b231978e7b150f92a948", size = 96471, upload-time = "2024-11-01T14:06:37.745Z" }, + { url = "https://files.pythonhosted.org/packages/12/87/48361531f70b1f87928b045df868a9fd4e253d9ae087fa4cf3f7113be363/watchdog-6.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c7c15dda13c4eb00d6fb6fc508b3c0ed88b9d5d374056b239c4ad1611125c860", size = 88449, upload-time = "2024-11-01T14:06:39.748Z" }, + { url = "https://files.pythonhosted.org/packages/5b/7e/8f322f5e600812e6f9a31b75d242631068ca8f4ef0582dd3ae6e72daecc8/watchdog-6.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f10cb2d5902447c7d0da897e2c6768bca89174d0c6e1e30abec5421af97a5b0", size = 89054, upload-time = "2024-11-01T14:06:41.009Z" }, + { url = "https://files.pythonhosted.org/packages/68/98/b0345cabdce2041a01293ba483333582891a3bd5769b08eceb0d406056ef/watchdog-6.0.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:490ab2ef84f11129844c23fb14ecf30ef3d8a6abafd3754a6f75ca1e6654136c", size = 96480, upload-time = "2024-11-01T14:06:42.952Z" }, + { url = "https://files.pythonhosted.org/packages/85/83/cdf13902c626b28eedef7ec4f10745c52aad8a8fe7eb04ed7b1f111ca20e/watchdog-6.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:76aae96b00ae814b181bb25b1b98076d5fc84e8a53cd8885a318b42b6d3a5134", size = 88451, upload-time = "2024-11-01T14:06:45.084Z" }, + { url = "https://files.pythonhosted.org/packages/fe/c4/225c87bae08c8b9ec99030cd48ae9c4eca050a59bf5c2255853e18c87b50/watchdog-6.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a175f755fc2279e0b7312c0035d52e27211a5bc39719dd529625b1930917345b", size = 89057, upload-time = "2024-11-01T14:06:47.324Z" }, + { url = "https://files.pythonhosted.org/packages/a9/c7/ca4bf3e518cb57a686b2feb4f55a1892fd9a3dd13f470fca14e00f80ea36/watchdog-6.0.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:7607498efa04a3542ae3e05e64da8202e58159aa1fa4acddf7678d34a35d4f13", size = 79079, upload-time = "2024-11-01T14:06:59.472Z" }, + { url = "https://files.pythonhosted.org/packages/5c/51/d46dc9332f9a647593c947b4b88e2381c8dfc0942d15b8edc0310fa4abb1/watchdog-6.0.0-py3-none-manylinux2014_armv7l.whl", hash = "sha256:9041567ee8953024c83343288ccc458fd0a2d811d6a0fd68c4c22609e3490379", size = 79078, upload-time = "2024-11-01T14:07:01.431Z" }, + { url = "https://files.pythonhosted.org/packages/d4/57/04edbf5e169cd318d5f07b4766fee38e825d64b6913ca157ca32d1a42267/watchdog-6.0.0-py3-none-manylinux2014_i686.whl", hash = "sha256:82dc3e3143c7e38ec49d61af98d6558288c415eac98486a5c581726e0737c00e", size = 79076, upload-time = "2024-11-01T14:07:02.568Z" }, + { url = "https://files.pythonhosted.org/packages/ab/cc/da8422b300e13cb187d2203f20b9253e91058aaf7db65b74142013478e66/watchdog-6.0.0-py3-none-manylinux2014_ppc64.whl", hash = "sha256:212ac9b8bf1161dc91bd09c048048a95ca3a4c4f5e5d4a7d1b1a7d5752a7f96f", size = 79077, upload-time = "2024-11-01T14:07:03.893Z" }, + { url = "https://files.pythonhosted.org/packages/2c/3b/b8964e04ae1a025c44ba8e4291f86e97fac443bca31de8bd98d3263d2fcf/watchdog-6.0.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:e3df4cbb9a450c6d49318f6d14f4bbc80d763fa587ba46ec86f99f9e6876bb26", size = 79078, upload-time = "2024-11-01T14:07:05.189Z" }, + { url = "https://files.pythonhosted.org/packages/62/ae/a696eb424bedff7407801c257d4b1afda455fe40821a2be430e173660e81/watchdog-6.0.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:2cce7cfc2008eb51feb6aab51251fd79b85d9894e98ba847408f662b3395ca3c", size = 79077, upload-time = "2024-11-01T14:07:06.376Z" }, + { url = "https://files.pythonhosted.org/packages/b5/e8/dbf020b4d98251a9860752a094d09a65e1b436ad181faf929983f697048f/watchdog-6.0.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:20ffe5b202af80ab4266dcd3e91aae72bf2da48c0d33bdb15c66658e685e94e2", size = 79078, upload-time = "2024-11-01T14:07:07.547Z" }, + { url = "https://files.pythonhosted.org/packages/07/f6/d0e5b343768e8bcb4cda79f0f2f55051bf26177ecd5651f84c07567461cf/watchdog-6.0.0-py3-none-win32.whl", hash = "sha256:07df1fdd701c5d4c8e55ef6cf55b8f0120fe1aef7ef39a1c6fc6bc2e606d517a", size = 79065, upload-time = "2024-11-01T14:07:09.525Z" }, + { url = "https://files.pythonhosted.org/packages/db/d9/c495884c6e548fce18a8f40568ff120bc3a4b7b99813081c8ac0c936fa64/watchdog-6.0.0-py3-none-win_amd64.whl", hash = "sha256:cbafb470cf848d93b5d013e2ecb245d4aa1c8fd0504e863ccefa32445359d680", size = 79070, upload-time = "2024-11-01T14:07:10.686Z" }, + { url = "https://files.pythonhosted.org/packages/33/e8/e40370e6d74ddba47f002a32919d91310d6074130fe4e17dabcafc15cbf1/watchdog-6.0.0-py3-none-win_ia64.whl", hash = "sha256:a1914259fa9e1454315171103c6a30961236f508b9b623eae470268bbcc6a22f", size = 79067, upload-time = "2024-11-01T14:07:11.845Z" }, +] + +[[package]] +name = "wcwidth" +version = "0.8.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/34/74/c6428f875774288bec1396f5bfcbc2d925700a4dad61727fd5f2b12f249d/wcwidth-0.8.2.tar.gz", hash = "sha256:91fbef97204b96a3d4d421609b80340b760cf33e26da123ff243d76b1fda8dda", size = 1466253, upload-time = "2026-06-29T18:11:11.601Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/96/42/3e5985a0a7e57de470b320c6d6a1a67c844f6737a587f3d44dd13d1819e7/wcwidth-0.8.2-py3-none-any.whl", hash = "sha256:d63947694a0539a1d51e01eda7caf800c291020e6cdd7e28ad7b14dd33ad4f85", size = 323166, upload-time = "2026-06-29T18:11:09.888Z" }, +] + +[[package]] +name = "yarl" +version = "1.24.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "multidict" }, + { name = "propcache" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/31/33/ebe9e3d1f86c7a0b51094c0a146392045ca1631d2664889539dec8088a33/yarl-1.24.5.tar.gz", hash = "sha256:e81b83143bee16329c23db3c1b2d82b29892fcbcb849186d2f6e98a5abe9a57f", size = 228679, upload-time = "2026-07-20T02:07:45.435Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1b/84/71d051c850b5af41d168c679d9eb67eb7c55283ac4ee131673edf134bc4e/yarl-1.24.5-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:d693396e5aea78db03decd60aec9ece16c9b40ba00a587f089615ff4e718a81d", size = 136035, upload-time = "2026-07-20T02:05:25.489Z" }, + { url = "https://files.pythonhosted.org/packages/03/4d/8ad27f9a1b7e69313cca5d695b925b48efe51208d3490e0844bae97cabc0/yarl-1.24.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3363fcc96e665878946ad7a106b9a13eac0541766a690ef287c0232ac768b6ec", size = 97642, upload-time = "2026-07-20T02:05:27.429Z" }, + { url = "https://files.pythonhosted.org/packages/ea/b4/05b4131c407006cd1e410e9c6539f16a0945724677e5364447313c15ea3e/yarl-1.24.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9d399bdcfb4a0f659b9b3788bbc89babe63d9a6a65aacdf4d4e7065ff2e6316c", size = 97323, upload-time = "2026-07-20T02:05:29.441Z" }, + { url = "https://files.pythonhosted.org/packages/20/16/e618c875c73e0e39611f20a581b3d5e8d59b8857bf001bee3263044c6deb/yarl-1.24.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90333fd89b43c0d08ac85f3f1447593fc2c66de18c3d6378d7125ea118dc7a54", size = 107741, upload-time = "2026-07-20T02:05:31.367Z" }, + { url = "https://files.pythonhosted.org/packages/d9/9a/c4defeaf3ed33fcb346aacf9c6e971a8d4e2bde04a0310e79abb208e7965/yarl-1.24.5-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:665b0a2c463cc9423dd647e0bfd9f4ccc9b50f768c55304d5e9f80b177c1de12", size = 103570, upload-time = "2026-07-20T02:05:33.303Z" }, + { url = "https://files.pythonhosted.org/packages/5f/e7/0e0e0de5865ebd5914537ef486f36c727a59865c3ac0cf5ff1b32aececbf/yarl-1.24.5-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e006d3a974c4ee19512e5f058abedb6eef36a5e553c14812bdeba1758d812e6d", size = 115815, upload-time = "2026-07-20T02:05:35.292Z" }, + { url = "https://files.pythonhosted.org/packages/2b/27/ca56b700cb170aba25a3893b75355b213935657dc5714d2383354a270e62/yarl-1.24.5-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e7d42c531243450ef0d4d9c172e7ed6ef052640f195629065041b5add4e058d1", size = 116025, upload-time = "2026-07-20T02:05:37.503Z" }, + { url = "https://files.pythonhosted.org/packages/d6/d0/d56c859b8222116f5d68459199f48359e0bf121b6f65a69bf329b3602ba0/yarl-1.24.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f08c7513ecef5aad65687bfdf6bc601ae9fccd04a42904501f8f7141abad9eb9", size = 109835, upload-time = "2026-07-20T02:05:39.506Z" }, + { url = "https://files.pythonhosted.org/packages/70/a2/3a35557e4d1a79425040eba202ccaf08bdc8717680fc77e2498a1ad2e0a5/yarl-1.24.5-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6c95b17fe34ed802f17e205112e6e10db92275c34fee290aa9bdc55a9c724027", size = 108884, upload-time = "2026-07-20T02:05:41.584Z" }, + { url = "https://files.pythonhosted.org/packages/e4/35/ef4c26356b7913c68983bac2d72a4212b3347af551cb8d250b99b5ed7b7f/yarl-1.24.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:56b149b22de33b23b0c6077ab9518c6dcb538ad462e1830e68d06591ccf6e38b", size = 107308, upload-time = "2026-07-20T02:05:43.697Z" }, + { url = "https://files.pythonhosted.org/packages/d5/91/ff0dc66c2ccf3e0153ab97ff61eabab4400e6a5264af427ab30cd69f1857/yarl-1.24.5-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:a8fe66b8f300da93798025a785a5b90b42f3810dc2b72283ff84a41aaaebc293", size = 103646, upload-time = "2026-07-20T02:05:45.895Z" }, + { url = "https://files.pythonhosted.org/packages/74/f0/33b9271c7f881766359d58266fa0811d2e5210ed860e28da7dc6d7786344/yarl-1.24.5-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:377fe3732edbaf78ee74efdf2c9f49f6e99f20e7f9d2649fda3eb4badd77d76e", size = 115305, upload-time = "2026-07-20T02:05:47.832Z" }, + { url = "https://files.pythonhosted.org/packages/ef/65/fd79fb1868c4a80db8661091de525bf430f63c3bea1b20e8b6a84fc7d359/yarl-1.24.5-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:e8ffa78582120024f476a611d7befc123cee59e47e8309d470cf667d806e613b", size = 108404, upload-time = "2026-07-20T02:05:49.604Z" }, + { url = "https://files.pythonhosted.org/packages/ff/ba/dbabe6b262f17a816c70cfc09558dbf03ece3ec76684d02f911a3d3a189c/yarl-1.24.5-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:daba5e594f06114e37db186efd2dd916609071e59daca901a0a2e71f02b142ce", size = 115940, upload-time = "2026-07-20T02:05:51.741Z" }, + { url = "https://files.pythonhosted.org/packages/a5/43/fab2d1dad9d340a268cdde63756a123d069723efff6a372d123fa74a9517/yarl-1.24.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:65be18ec59496c13908f02a2472751d9ef840b4f3fb5726f129306bf6a2a7bba", size = 110006, upload-time = "2026-07-20T02:05:53.554Z" }, + { url = "https://files.pythonhosted.org/packages/c4/27/41eb51bbd1b8d89546b83897cfb0164f1e109304fd408dbb151b639eec0f/yarl-1.24.5-cp312-cp312-win_amd64.whl", hash = "sha256:a929d878fec099030c292803b31e5d5540a7b6a31e6a3cc76cb4685fc2a2f51b", size = 97618, upload-time = "2026-07-20T02:05:55.57Z" }, + { url = "https://files.pythonhosted.org/packages/3c/25/b2553764b3d65db711d8f45416351ec4f420847558eb669edcbcaadf5780/yarl-1.24.5-cp312-cp312-win_arm64.whl", hash = "sha256:7ce27823052e2013b597e0c738b13e7e36b8ccb9400df8959417b052ab0fd92c", size = 93018, upload-time = "2026-07-20T02:05:57.554Z" }, + { url = "https://files.pythonhosted.org/packages/e1/63/64ef361967cc983573149dc1515d531db5da8a4c92d22bb833d59e01b313/yarl-1.24.5-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:79af890482fc94648e8cde4c68620378f7fef60932710fa17a66abc039244da2", size = 135075, upload-time = "2026-07-20T02:05:59.671Z" }, + { url = "https://files.pythonhosted.org/packages/bb/89/55920fd853ce43e608adbc3962456f0d649d6bb15250dc2988321da0fe1c/yarl-1.24.5-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:46c2f213e23a04b93a392942d782eb9e413e6ef6bf7c8c53884e599a5c174dcb", size = 97225, upload-time = "2026-07-20T02:06:01.769Z" }, + { url = "https://files.pythonhosted.org/packages/15/f0/7688d3f2cfff7590df2af38ec46d969f4281a4dddb08a9ad2eafbcdddf98/yarl-1.24.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92ab3e11448f2ff7bf53c5a26eff0edc086898ec8b21fb154b85839ce1d88075", size = 96751, upload-time = "2026-07-20T02:06:03.676Z" }, + { url = "https://files.pythonhosted.org/packages/05/1a/a851a0f94aaaf379dd4f901bfc80f634280bec51eb260b47363e2a4cd62e/yarl-1.24.5-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ebb0ec7f17803063d5aeb982f3b1bd2b2f4e4fae6751226cbd6ba1fcfe9e63ff", size = 107960, upload-time = "2026-07-20T02:06:05.699Z" }, + { url = "https://files.pythonhosted.org/packages/6c/a8/faea066c12f9c77ca0de90641f1655f9dd7b412477bf28c76d692f3aecff/yarl-1.24.5-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:82632daed195dcc8ea664e8556dc9bdbd671960fb3776bd92806ce05792c2448", size = 103500, upload-time = "2026-07-20T02:06:07.556Z" }, + { url = "https://files.pythonhosted.org/packages/fb/9c/1e67084c2a6e2f2db0e3be798328cb3be42c0119b621d25461479a224d21/yarl-1.24.5-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:53e549287ef628fecba270045c9701b0c564563a9b0577d24a4ec75b8ab8040f", size = 115780, upload-time = "2026-07-20T02:06:09.599Z" }, + { url = "https://files.pythonhosted.org/packages/58/86/1f94664e147474337e3359f52012cf3d02f825f694317b178bfba1078c62/yarl-1.24.5-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fcd3b77e2f17bbe4ca56ec7bcb07992647d19d0b9c05d84886dcd6f9eb810afd", size = 115308, upload-time = "2026-07-20T02:06:11.352Z" }, + { url = "https://files.pythonhosted.org/packages/0a/43/8e55ae7538ba5f28ccb3c845c6dd4549cf7016d5992e5326512519107cdd/yarl-1.24.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d46b86567dd4e248c6c159fcbcdcce01e0a5c8a7cd2334a0fff759d0fa075b16", size = 110574, upload-time = "2026-07-20T02:06:13.129Z" }, + { url = "https://files.pythonhosted.org/packages/ce/ba/a889ec8765cedcf2ac44dcb02d6a21e4861399b243b263c5f2dde27ee740/yarl-1.24.5-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7f72c74aa99359e27a2ee8d6613fefa28b5f76a983c083074dfc2aaa4ab46213", size = 109914, upload-time = "2026-07-20T02:06:15.243Z" }, + { url = "https://files.pythonhosted.org/packages/9c/c3/e45f821af67b791c2dbbe4a9f4137a1d33f8d386654a05a0c3f47bdfa25d/yarl-1.24.5-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3f45789ce415a7ec0820dc4f82925f9b5f7732070be1dec1f5f23ec381435a24", size = 107712, upload-time = "2026-07-20T02:06:17.443Z" }, + { url = "https://files.pythonhosted.org/packages/02/00/2ab0f42c9857fcb490bfaa6647b14540b53d241ab209f23220b958cc5832/yarl-1.24.5-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:6e73e7fe93f17a7b191f52ec9da9dd8c06a8fe735a1ecbd13b97d1c723bff385", size = 104251, upload-time = "2026-07-20T02:06:19.259Z" }, + { url = "https://files.pythonhosted.org/packages/7a/70/709d9a286e98af2c7fd8e4e6cada658b5c0e30d87dd7e2a63c2fb5767217/yarl-1.24.5-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4a36f9becdd4c5c52a20c3e9484128b070b1dcfc8944c006f3a528295a359a9c", size = 115319, upload-time = "2026-07-20T02:06:21.207Z" }, + { url = "https://files.pythonhosted.org/packages/5c/6c/3eaa515142991fe84cfc483ff986492211f1978f90161ccefdbec919d09b/yarl-1.24.5-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:7bcbe0fcf850eae67b6b01749815a4f7161c560a844c769ad7b48fcd99f791c4", size = 109163, upload-time = "2026-07-20T02:06:23.006Z" }, + { url = "https://files.pythonhosted.org/packages/bb/64/711dafce66c323a3144d470547a71c5384c57623308ac8bb5e4b903ac148/yarl-1.24.5-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:24e861e9630e0daddcb9191fb187f60f034e17a4426f8101279f0c475cd74144", size = 115435, upload-time = "2026-07-20T02:06:24.923Z" }, + { url = "https://files.pythonhosted.org/packages/cf/f3/9b9d0e6d84bea851eb1ba99e4bdc755b86fd813e49ec86dfe42f26befdef/yarl-1.24.5-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9335a099ad87287c37fe5d1a982ff392fa5efe5d14b40a730b1ec1d6a41382b4", size = 110691, upload-time = "2026-07-20T02:06:26.973Z" }, + { url = "https://files.pythonhosted.org/packages/86/e4/62a06b7e87c4246ac76b7c2da136f972eb4a3a1fc94abb07e7022d6fdb0a/yarl-1.24.5-cp313-cp313-win_amd64.whl", hash = "sha256:2dbe06fc16bc91502bca713704022182e5729861ae00277c3a23354b40929740", size = 97454, upload-time = "2026-07-20T02:06:29.163Z" }, + { url = "https://files.pythonhosted.org/packages/9e/c9/5fc8025b318ab10db413b61056bd0d95c557a70e8df4210c7511f866329c/yarl-1.24.5-cp313-cp313-win_arm64.whl", hash = "sha256:6b8536851f9f65e7f00c7a1d49ba7f2be0ffe2c11555367fc9f50d9f842410a1", size = 92813, upload-time = "2026-07-20T02:06:31.113Z" }, + { url = "https://files.pythonhosted.org/packages/a9/08/5f3085fef9564217074db9dd8573de1795bc82cde61a7ad10b6a7234a569/yarl-1.24.5-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:2729fcfc4f6a596fb0c50f32090400aa9367774ac296a00387e65098c0befa76", size = 135680, upload-time = "2026-07-20T02:06:33.273Z" }, + { url = "https://files.pythonhosted.org/packages/98/35/ba9436e579bd48a8801f2021d842d9ab4994c26e4c7dd3a4c1f1bcb57a9e/yarl-1.24.5-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:ff330d3c30db4eb6b01d79e29d2d0b407a7ecad39cfd9ec993ece57396a2ec0d", size = 97395, upload-time = "2026-07-20T02:06:35.259Z" }, + { url = "https://files.pythonhosted.org/packages/18/a9/a07f76f3c44e02b25cc743af5ef93eef27f7013eadca770451b6a6ccb5db/yarl-1.24.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:e42d75862735da90e7fc5a7b23db0c976f737113a54b3c9777a9b665e9cbff75", size = 97223, upload-time = "2026-07-20T02:06:37.216Z" }, + { url = "https://files.pythonhosted.org/packages/77/f7/a9a1d6fa7dd9e388f95b30f6ad3ec4e285f6c8f61f44ce16070c3fcfe414/yarl-1.24.5-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a3732e66413163e72508da9eff9ce9d2846fde51fae45d3605393d3e6cd303e9", size = 108777, upload-time = "2026-07-20T02:06:39.292Z" }, + { url = "https://files.pythonhosted.org/packages/2f/44/e0b86c302471fabd6f02808ecf2ac52b8412b624787849d4bf2cdb466f6f/yarl-1.24.5-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:5b8ee53be440a0cffc991a27be3057e0530122548dbe7c0892df08822fce5ede", size = 103119, upload-time = "2026-07-20T02:06:41.456Z" }, + { url = "https://files.pythonhosted.org/packages/d1/16/9c16d180bf8faaf223225eb50e1245870ff1ae0e302a27153988e65c51fd/yarl-1.24.5-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:af3aefa655adb5869491fa907e652290386800ae99cc50095cba71e2c6aefdca", size = 116471, upload-time = "2026-07-20T02:06:43.696Z" }, + { url = "https://files.pythonhosted.org/packages/d2/8d/b219b9df28a02ce95cfbdd41d2f7caa5669d0ff979c1c9975697145e33c5/yarl-1.24.5-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2120b96872df4a117cde97d270bac96aea7cc52205d305cf4611df694a487027", size = 115974, upload-time = "2026-07-20T02:06:45.874Z" }, + { url = "https://files.pythonhosted.org/packages/9b/e8/f20557aca240d88e69850ad1ee91756821d094bb1310565c04d25c6682a2/yarl-1.24.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:66410eb6345d467151934b49bfa70fb32f5b35a6140baa40ad97d6436abea2e9", size = 110830, upload-time = "2026-07-20T02:06:47.852Z" }, + { url = "https://files.pythonhosted.org/packages/db/18/199b85109a53eeca64ee19c9cca228287e8e4ab0cc1a09b28f530e65cce0/yarl-1.24.5-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4af7b7e1be0a69bee8210735fe6dcfc38879adfac6d62e789d53ba432d1ffa41", size = 110054, upload-time = "2026-07-20T02:06:49.84Z" }, + { url = "https://files.pythonhosted.org/packages/aa/2f/ed28147f8cd7f48c49367c90713b30a555284b6105a6a56f3a05568da795/yarl-1.24.5-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:fa139875ff98ab97da323cfadfaff08900d1ad42f1b5087b0b812a55c5a06373", size = 108312, upload-time = "2026-07-20T02:06:51.835Z" }, + { url = "https://files.pythonhosted.org/packages/c5/c5/55e16ae0a5c227cea8df1c6871ba57d614a34243146c05729caf2a1bd9c5/yarl-1.24.5-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:0055afc45e864b92729ac7600e2d102c17bef060647e74bca75fa84d66b9ff36", size = 103662, upload-time = "2026-07-20T02:06:54.061Z" }, + { url = "https://files.pythonhosted.org/packages/8d/ea/dbd7c2caec459c9a426f18b02688ecbfb58620d0f6a3422d24769fbaf8ab/yarl-1.24.5-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:f0e466ed7511fe9d459a819edbc6c2585c0b6eabde9fa8a8947552468a7a6ef0", size = 116090, upload-time = "2026-07-20T02:06:56.015Z" }, + { url = "https://files.pythonhosted.org/packages/06/84/39ce4ce3059e07fece5fbdbee8c4053406af9aca911ce9fa5f8548aab6af/yarl-1.24.5-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:f141474e85b7e54998ec5180530a7cda99ab29e282fa50e0756d89981a9b43c5", size = 109523, upload-time = "2026-07-20T02:06:57.926Z" }, + { url = "https://files.pythonhosted.org/packages/a9/8b/71ff44137b405c64a7788075669c24010019f57a7464b78c3a6cbee539d9/yarl-1.24.5-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:e2935f8c39e3b03e83519292d78f075189978f3f4adc15a78144c7c8e2a1cba5", size = 116084, upload-time = "2026-07-20T02:06:59.868Z" }, + { url = "https://files.pythonhosted.org/packages/62/c0/423078fdd4042e1862c11f0ffd977a0ffa393783c12bee94685923bc189e/yarl-1.24.5-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:9d1216a7f6f77836617dba35687c5b78a4170afc3c3f18fc788f785ba26565c4", size = 111006, upload-time = "2026-07-20T02:07:01.907Z" }, + { url = "https://files.pythonhosted.org/packages/cf/52/6daa2ee9d95e5c98b8128f8df91eb692eb423ab274b8cf08db52152fad26/yarl-1.24.5-cp314-cp314-win_amd64.whl", hash = "sha256:5ba4f78df2bcc19f764a4b26a8a4f5049c110090ad5825993aacb052bf8003ad", size = 99215, upload-time = "2026-07-20T02:07:03.852Z" }, + { url = "https://files.pythonhosted.org/packages/ec/0e/464a847d7359e0da75dd9fc5c1d1aa35d0159ea31e5f8e66a3c1c29ff3d0/yarl-1.24.5-cp314-cp314-win_arm64.whl", hash = "sha256:9e4e16c73d717c5cf27626c524d0a2e261ad20e46932b2670f64ad5dde23e26f", size = 94566, upload-time = "2026-07-20T02:07:06.074Z" }, + { url = "https://files.pythonhosted.org/packages/e2/55/e03acc4446772660bc335e86e41ef31e4d0d838fd641531a11a5ee33b493/yarl-1.24.5-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:e1ae548a9d901adca07899a4147a7c826bbcc06239d3ce9a59f57886a28a4c88", size = 142533, upload-time = "2026-07-20T02:07:08.284Z" }, + { url = "https://files.pythonhosted.org/packages/ae/71/4acd3a1fc7cf14345cdb302665ecd2097f62c365b4f14ca17d4f37775cf9/yarl-1.24.5-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:ff405d91509d88e8d44129cd87b18d70acd1f0c1aeabd7bc3c46792b1fe2acba", size = 100776, upload-time = "2026-07-20T02:07:10.197Z" }, + { url = "https://files.pythonhosted.org/packages/ff/0b/cfb76b7fe99686db264bff829779a539d923e7564ffd7ef18da6c54c3774/yarl-1.24.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:47e98aab9d8d82ff682e7b0b5dded33bf138a32b817fcf7fa3b27b2d7c412928", size = 100913, upload-time = "2026-07-20T02:07:12.357Z" }, + { url = "https://files.pythonhosted.org/packages/8b/3f/7116e782992abbd4fb6948488aec72078895e929a23078290739e8396fce/yarl-1.24.5-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f0a658a6d3fafee5c6f63c58f3e785c8c43c93fbc02bf9f2b6663f8185e0971f", size = 106507, upload-time = "2026-07-20T02:07:14.173Z" }, + { url = "https://files.pythonhosted.org/packages/33/90/d4d2d73ee78229cc889872eb8e085d8f5c6f51abdb178409fd9b23cf74fd/yarl-1.24.5-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:4377407001ca3c057773f44d8ddd6358fa5f691407c1ba92210bd3cf8d9e4c95", size = 99219, upload-time = "2026-07-20T02:07:16.019Z" }, + { url = "https://files.pythonhosted.org/packages/3e/fa/a6df1a9bccd644eec00abee0dff4277416222cec435330fd1f2858523ec1/yarl-1.24.5-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7c0494a31a1ac5461a226e7947a9c9b78c44e1dc7185164fa7e9651557a5d9bc", size = 111804, upload-time = "2026-07-20T02:07:18.141Z" }, + { url = "https://files.pythonhosted.org/packages/8a/9e/7b2a1f4bcc20e9447156dd2b1c4d01f70d9df0759025ee7d09a84ffae134/yarl-1.24.5-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a7cff474ab7cd149765bb784cf6d78b32e18e20473fb7bda860bce98ab58e9da", size = 110943, upload-time = "2026-07-20T02:07:20.06Z" }, + { url = "https://files.pythonhosted.org/packages/08/ff/22c92affb0f9b623ca753d27d968b5625b868f12c6378d049d55ae247643/yarl-1.24.5-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cbb833ccacdb5519eff9b8b71ee618cc2801c878e77e288775d77c3a2ced858a", size = 108251, upload-time = "2026-07-20T02:07:22.217Z" }, + { url = "https://files.pythonhosted.org/packages/45/44/5769b96298c1e195fb412997b6090af2a84105cf59c17613558a2d011d1f/yarl-1.24.5-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:82f75e05912e84b7a0fe57075d9c59de3cb352b928330f2eb69b2e1f54c3e1f0", size = 106025, upload-time = "2026-07-20T02:07:24.083Z" }, + { url = "https://files.pythonhosted.org/packages/4c/40/009e8e791fd9762c0e1567e69248acb4f49064597e1680874c16dd8bb798/yarl-1.24.5-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:16a2f5010280020e90f5330257e6944bc33e73593b136cc5a241e6c1dc292498", size = 106573, upload-time = "2026-07-20T02:07:26.248Z" }, + { url = "https://files.pythonhosted.org/packages/20/c6/b7480578f8a0a80946f36ad6df547ecec704f9ba69d2de60f8aa6f1c1cbf/yarl-1.24.5-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:ffcd54362564dc1a30fb74d8b8a6e5a6b11ebd5e27266adc3b7427a21a6c9104", size = 100751, upload-time = "2026-07-20T02:07:28.098Z" }, + { url = "https://files.pythonhosted.org/packages/d4/27/4476f3360b91a48c5cf125e91f59a3bd35299d84a431a258d57f5977bb11/yarl-1.24.5-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:0465ec8cedc2349b97a6b595ace64084a50c6e839eca40aa0626f38b8350e331", size = 111643, upload-time = "2026-07-20T02:07:30.88Z" }, + { url = "https://files.pythonhosted.org/packages/4c/4b/5cdd3e5ee944e8af31e52f6cd3d3af5fd7b937e036ccbbba2c9ffebede95/yarl-1.24.5-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:4db9aecb141cb7a5447171b57aa1ed3a8fee06af40b992ffc31206c0b0121550", size = 106312, upload-time = "2026-07-20T02:07:33.06Z" }, + { url = "https://files.pythonhosted.org/packages/18/86/f406b0c2a6f99575de2da671ef47aa06f89a5be83a27a46971c3b86cecdb/yarl-1.24.5-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:f540c013589084679a6c7fac07096b10159737918174f5dfc5e11bf5bca4dfe6", size = 110379, upload-time = "2026-07-20T02:07:35.155Z" }, + { url = "https://files.pythonhosted.org/packages/f0/6c/9f3adfbd3b30b4fa0f7ccb3a83eba2c1152d3fff554d535e640ba0f7ba2b/yarl-1.24.5-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:a61834fb15d81322d872eaafd333838ae7c9cea84067f232656f75965933d047", size = 108497, upload-time = "2026-07-20T02:07:37.35Z" }, + { url = "https://files.pythonhosted.org/packages/dd/37/91eb2e5ca883a529c1b390348a74cd9fc0512171727f547ce70bfe02be5c/yarl-1.24.5-cp314-cp314t-win_amd64.whl", hash = "sha256:5c88e5815a49d289e599f3513aa7fde0bc2092ff188f99c940f007f90f53d104", size = 102450, upload-time = "2026-07-20T02:07:39.578Z" }, + { url = "https://files.pythonhosted.org/packages/bf/f4/ed5c402ac8fde4403ed3366c2716bfddc8a6677ebd59f3d62772cc7fe468/yarl-1.24.5-cp314-cp314t-win_arm64.whl", hash = "sha256:cf139c02f5f23ef6532040a30ff662c00a318c952334f211046b8e60b7f17688", size = 97222, upload-time = "2026-07-20T02:07:41.55Z" }, + { url = "https://files.pythonhosted.org/packages/61/02/962c1cbfc401a30c1d034dc67ff395f64b52302c6d62de556c1fca99acc0/yarl-1.24.5-py3-none-any.whl", hash = "sha256:a33700d13d9b7d84fd10947b09ff69fb9a792e519c8cb9764a3ca70baa6c23a7", size = 58612, upload-time = "2026-07-20T02:07:43.461Z" }, +] + +[[package]] +name = "zarr" +source = { editable = "../../" } +dependencies = [ + { name = "donfig" }, + { name = "google-crc32c" }, + { name = "numcodecs" }, + { name = "numpy" }, + { name = "packaging" }, + { name = "typing-extensions" }, +] + +[package.metadata] +requires-dist = [ + { name = "cast-value-rs", marker = "extra == 'cast-value-rs'" }, + { name = "cupy-cuda12x", marker = "sys_platform != 'darwin' and extra == 'gpu'" }, + { name = "donfig", specifier = ">=0.8" }, + { name = "fsspec", marker = "extra == 'remote'", specifier = ">=2023.10.0" }, + { name = "google-crc32c", specifier = ">=1.5" }, + { name = "numcodecs", specifier = ">=0.14" }, + { name = "numpy", specifier = ">=2" }, + { name = "obstore", marker = "extra == 'remote'", specifier = ">=0.5.1" }, + { name = "packaging", specifier = ">=22.0" }, + { name = "typer", marker = "extra == 'cli'" }, + { name = "typing-extensions", specifier = ">=4.14" }, + { name = "universal-pathlib", marker = "extra == 'optional'" }, +] +provides-extras = ["cast-value-rs", "cli", "gpu", "optional", "remote"] + +[package.metadata.requires-dev] +dev = [ + { name = "astroid", specifier = "==4.1.2" }, + { name = "botocore" }, + { name = "coverage", specifier = "==7.15.2" }, + { name = "fsspec", specifier = ">=2023.10.0" }, + { name = "griffe-inherited-docstrings", specifier = "==1.1.3" }, + { name = "hypothesis", specifier = "==6.164.0" }, + { name = "markdown-exec", extras = ["ansi"], specifier = "==1.12.3" }, + { name = "mike", specifier = "==2.2.0" }, + { name = "mkdocs", specifier = "==1.6.1" }, + { name = "mkdocs-material", extras = ["imaging"], specifier = "==9.7.7" }, + { name = "mkdocs-redirects", specifier = "==1.2.3" }, + { name = "mkdocstrings", specifier = "==1.0.6" }, + { name = "mkdocstrings-python", specifier = "==2.0.5" }, + { name = "moto", extras = ["s3", "server"], specifier = "==5.2.2" }, + { name = "mypy", specifier = "==2.3.0" }, + { name = "numcodecs", extras = ["msgpack"] }, + { name = "numpydoc", specifier = "==1.10.0" }, + { name = "obstore", specifier = ">=0.5.1" }, + { name = "pytest", specifier = "==9.1.1" }, + { name = "pytest-accept", specifier = "==0.3.0" }, + { name = "pytest-asyncio", specifier = "==1.4.0" }, + { name = "pytest-benchmark", specifier = "==5.2.3" }, + { name = "pytest-codspeed", specifier = "==5.0.3" }, + { name = "pytest-cov", specifier = "==7.1.0" }, + { name = "pytest-xdist", specifier = "==3.8.0" }, + { name = "requests", specifier = "==2.34.2" }, + { name = "ruff", specifier = "==0.16.0" }, + { name = "s3fs", specifier = ">=2023.10.0" }, + { name = "tomlkit", specifier = "==0.15.1" }, + { name = "towncrier", specifier = "==25.8.0" }, + { name = "universal-pathlib" }, + { name = "uv", specifier = "==0.12.0" }, +] +docs = [ + { name = "astroid", specifier = "==4.1.2" }, + { name = "griffe-inherited-docstrings", specifier = "==1.1.3" }, + { name = "markdown-exec", extras = ["ansi"], specifier = "==1.12.3" }, + { name = "mike", specifier = "==2.2.0" }, + { name = "mkdocs", specifier = "==1.6.1" }, + { name = "mkdocs-material", extras = ["imaging"], specifier = "==9.7.7" }, + { name = "mkdocs-redirects", specifier = "==1.2.3" }, + { name = "mkdocstrings", specifier = "==1.0.6" }, + { name = "mkdocstrings-python", specifier = "==2.0.5" }, + { name = "numcodecs", extras = ["msgpack"] }, + { name = "pytest", specifier = "==9.1.1" }, + { name = "ruff", specifier = "==0.16.0" }, + { name = "s3fs", specifier = ">=2023.10.0" }, + { name = "towncrier", specifier = "==25.8.0" }, +] +release = [{ name = "towncrier", specifier = "==25.8.0" }] +remote-tests = [ + { name = "botocore" }, + { name = "coverage", specifier = "==7.15.2" }, + { name = "fsspec", specifier = ">=2023.10.0" }, + { name = "hypothesis", specifier = "==6.164.0" }, + { name = "moto", extras = ["s3", "server"], specifier = "==5.2.2" }, + { name = "numpydoc", specifier = "==1.10.0" }, + { name = "obstore", specifier = ">=0.5.1" }, + { name = "pytest", specifier = "==9.1.1" }, + { name = "pytest-accept", specifier = "==0.3.0" }, + { name = "pytest-asyncio", specifier = "==1.4.0" }, + { name = "pytest-benchmark", specifier = "==5.2.3" }, + { name = "pytest-codspeed", specifier = "==5.0.3" }, + { name = "pytest-cov", specifier = "==7.1.0" }, + { name = "pytest-xdist", specifier = "==3.8.0" }, + { name = "requests", specifier = "==2.34.2" }, + { name = "s3fs", specifier = ">=2023.10.0" }, + { name = "tomlkit", specifier = "==0.15.1" }, + { name = "uv", specifier = "==0.12.0" }, +] +test = [ + { name = "coverage", specifier = "==7.15.2" }, + { name = "hypothesis", specifier = "==6.164.0" }, + { name = "numpydoc", specifier = "==1.10.0" }, + { name = "pytest", specifier = "==9.1.1" }, + { name = "pytest-accept", specifier = "==0.3.0" }, + { name = "pytest-asyncio", specifier = "==1.4.0" }, + { name = "pytest-benchmark", specifier = "==5.2.3" }, + { name = "pytest-codspeed", specifier = "==5.0.3" }, + { name = "pytest-cov", specifier = "==7.1.0" }, + { name = "pytest-xdist", specifier = "==3.8.0" }, + { name = "tomlkit", specifier = "==0.15.1" }, + { name = "uv", specifier = "==0.12.0" }, +] + +[[package]] +name = "zarr-http-server" +source = { editable = "." } +dependencies = [ + { name = "starlette" }, + { name = "uvicorn" }, + { name = "zarr" }, +] + +[package.dev-dependencies] +docs = [ + { name = "griffe-inherited-docstrings" }, + { name = "mkdocs" }, + { name = "mkdocs-material" }, + { name = "mkdocstrings" }, + { name = "mkdocstrings-python" }, + { name = "ruff" }, +] +examples = [ + { name = "fsspec", extra = ["http"] }, + { name = "httpx" }, +] +test = [ + { name = "httpx" }, + { name = "httpx2" }, + { name = "hypothesis" }, + { name = "ipykernel" }, + { name = "nbclient" }, + { name = "nbformat" }, + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [ + { name = "starlette", specifier = ">=1.0" }, + { name = "uvicorn", specifier = ">=0.29" }, + { name = "zarr", editable = "../../" }, +] + +[package.metadata.requires-dev] +docs = [ + { name = "griffe-inherited-docstrings", specifier = "==1.1.3" }, + { name = "mkdocs", specifier = "==1.6.1" }, + { name = "mkdocs-material", specifier = "==9.7.7" }, + { name = "mkdocstrings", specifier = "==1.0.6" }, + { name = "mkdocstrings-python", specifier = "==2.0.5" }, + { name = "ruff", specifier = "==0.16.0" }, +] +examples = [ + { name = "fsspec", extras = ["http"] }, + { name = "httpx" }, +] +test = [ + { name = "httpx" }, + { name = "httpx2" }, + { name = "hypothesis" }, + { name = "ipykernel" }, + { name = "nbclient" }, + { name = "nbformat" }, + { name = "pytest" }, +] diff --git a/pyproject.toml b/pyproject.toml index 8b8534cb65..6626f8f0bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -160,9 +160,9 @@ omit = [ version.source = "vcs" # Only consider zarr-python's own `v*` tags when deriving the version. Without # this filter `git describe` matches the most recent tag of any shape, -# including the `zarr_metadata-v*` tags used to release the zarr-metadata -# subpackage — which would make a from-source build report a `0.2.x` version -# instead of `3.x`. +# including the `zarr_metadata-v*` and `zarr_http_server-v*` tags used to +# release the subpackages under `packages/` — which would make a from-source +# build report e.g. a `0.2.x` version instead of `3.x`. version.raw-options = { git_describe_command = "git describe --dirty --tags --long --match v*" } [tool.hatch.build] From 579ffb55f374443c3ec5b4bfb02869ed117fe7a2 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 12 Aug 2026 15:30:42 +0200 Subject: [PATCH 42/61] docs: update readme (#4251) * docs: update readme * Update README.md Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com> * Update README.md Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com> * Update README.md Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com> * Update README.md Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com> --------- Co-authored-by: Max Jones <14077947+maxrjones@users.noreply.github.com> --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7557936b6f..330c1da5ea 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ ## What is it? -Zarr is a Python package providing an implementation of compressed, chunked, N-dimensional arrays, designed for use in parallel computing. See the [documentation](https://zarr.readthedocs.io/en/stable/) for more information. +The `zarr` library is a Python implementation of the [Zarr storage format](https://zarr.dev/). `zarr` delivers compressed, chunked, N-dimensional arrays that work well for parallel computing and object storage. See the [documentation](https://zarr.readthedocs.io/en/stable/) for more information. ## Main Features -- [**Create**](https://zarr.readthedocs.io/en/stable/user-guide/arrays/#creating-an-array) N-dimensional arrays with any NumPy `dtype`. +- [**Create**](https://zarr.readthedocs.io/en/stable/user-guide/arrays/#creating-an-array) N-dimensional arrays with NumPy-compatible `dtype`s. - [**Chunk arrays**](https://zarr.readthedocs.io/en/stable/user-guide/performance/#chunk-optimizations) along any dimension. -- [**Compress**](https://zarr.readthedocs.io/en/stable/user-guide/arrays/#compressors) and/or filter chunks using any NumCodecs codec. +- [**Encode**](https://zarr.readthedocs.io/en/stable/user-guide/arrays/#compressors) chunks using a variety of useful encodings (e.g., compression). - [**Store arrays**](https://zarr.readthedocs.io/en/stable/user-guide/storage/) in memory, on disk, inside a zip file, on S3, etc... - [**Read**](https://zarr.readthedocs.io/en/stable/user-guide/arrays/#reading-and-writing-data) an array [**concurrently**](https://zarr.readthedocs.io/en/stable/user-guide/performance/#parallel-computing-and-synchronization) from multiple threads or processes. - [**Write**](https://zarr.readthedocs.io/en/stable/user-guide/arrays/#reading-and-writing-data) to an array concurrently from multiple threads or processes. @@ -42,3 +42,11 @@ conda install -c conda-forge zarr ``` For more details, including how to install from source, see the [installation documentation](https://zarr.readthedocs.io/en/stable/#installation). + +## Repository sub-packages + +In addition to the primary `zarr` implementation, this repository contains other packages that provide specialized functionality with minimal dependencies: + +- [`zarr-metadata`](https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-metadata): Tools for Zarr metadata. Install with `pip install zarr-metadata`. +- [`zarr-indexing`](https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-indexing): Tools for lazily indexing chunked arrays. Install with `pip install zarr-indexing`. +- [`zarr-http-server`](https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-http-server): An HTTP server implementation targeting Zarr data. Install with `pip install zarr-http-server`. From d9af955f29c05f9c4065e8b190e35d1ec2a25463 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 12 Aug 2026 15:47:24 +0200 Subject: [PATCH 43/61] =?UTF-8?q?feat(zarr-indexing):=20LazyArray=20?= =?UTF-8?q?=E2=80=94=20generic=20lazy=20indexing=20over=20array-API=20arra?= =?UTF-8?q?ys=20(#4222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(zarr-indexing): LazyArray — generic lazy indexing over array-API arrays A generic wrapper for any array-API-like source (numpy, zarr, cupy, ...) adding TensorStore-style lazy indexing with a positional NumPy dialect: eager __getitem__, .lazy/.oindex/.vindex composing transforms without data access, result()/__array__ materializing. Resolution is partition-based: parts() iterates the base array's partitions projected through the view as resolvable sub-LazyArrays (Partition carries global box coordinates, out placement, and completeness); with_parts() re-partitions the same base explicitly; a single lowering engine serves both partitioned and whole-array sources. Partitioning is discovered from the source (read_chunk_sizes, .chunks) or declared, and never surfaced as a chunks vocabulary. Box selections (no index arrays; affine, interval-representable) are first-class: is_box, bounding_box() (exact hull up to stride), and strides() complete the slab-read story; the design-notes page records the box-vs-query taxonomy and the relationship to TensorStore. Dunders: __dask_tokenize__ (deterministic, canonical-ndsel-body-based), __len__, __iter__, 0-d conversions, pickling. Degenerate all-singleton index-array maps now collapse to constant maps in the transform algebra, and NumPy advanced-index placement rules are implemented faithfully. Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-indexing): negative-step slices, per merged ndsel 1.0-draft.2 `arr[::-1]` reverses. One desugaring rule covers both signs, as TensorStore 0.1.84 does and as ndsel PR #2 now specifies: omitted bounds resolve on the side the traversal starts and stops (`hi-1` and `lo-1` going down), the source interval is [start, stop) going up and [stop+1, start+1) going down, an empty interval is legal at any coordinate, an interval running the wrong way is an error rather than a silent empty, and the origin is trunc(start/step) for either sign. The corpus is re-vendored from ndsel 92d6a32 in this same commit, because it is the definition of correct here: `slice.json` gains ten negative-step fixtures, `errors.json` retires `negative_step_unsupported` for three `bounds_out_of_order` fixtures, and the message layer is changed to satisfy them. The retired reason code is documented as such rather than removed. A latent bug that only negative steps could reach: `_reindex_array` built `slice(pos, pos + size*step, step)`, and a downward walk reaching the front of the array computes a negative stop, which NumPy reads as counting from the end — `slice(6, -1, -1)` selects nothing where `slice(6, None, -1)` selects seven elements reversed. Both reindex helpers now go through `_positional_slice`. The stride<0 branches of `_intersect_dimension_map` and `iter_chunk_transforms` were written defensively and had never been reachable. They are now, and they were right: the parts-coverage test gains two reversing views, and the seeded sweep generates downward slices (4,352 of 7,200 chains carry one) across every partitioning. At the wrapper boundary the dialect stays NumPy's, which differs in one place: a reversed *positional* interval like `lazy[2:5:-1]` is empty, not an error, because that is what `x[2:5:-1]` means. Only literal coordinates call it a direction error. Tests: the study's recorded TensorStore corpus lands in `test_tensorstore_parity.py` — fifteen desugarings with their domains, offsets and strides, the three rows that discriminate trunc from floor and ceil, both error families, empty-outside-the-domain, five recorded compositions, and the recorded index-array reversal (a negative step over a gathered axis reverses the array rather than attaching a stride). Assisted-by: ClaudeCode:claude-fable-5 * polish(zarr-indexing): re-review minors — step-zero ValueError, kw-only Partition, strides docs - slice step zero now raises ValueError, matching NumPy in the wrapper's positional dialect (was IndexError) - Partition is keyword-only: box was inserted mid-field-list, so positional construction would silently misbind - strides() documents the empty-box case (bounding_box None, strides still defined) Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): plain technical language throughout Rewrite the package's documentation surfaces — docs/index.md, docs/design-notes.md, docs/ndsel.md, docs/api/index.md, the LazyArray, boundary, and transform docstrings, and the 267 changelog fragment — in plain declarative English. Metaphor, personification, rhetorical framing, and emphasis used for effect are replaced with statements of the same technical content. No technical claim, API name, example, or example output changes. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): American spelling (flavour -> flavor) Assisted-by: ClaudeCode:claude-fable-5 * ci(zarr-indexing): scoped lint ignores for the deliberate blind excepts A new ruff release (the CI job floats via uvx) flags BLE001/S110 at the chunk-discovery tolerance and tokenize-fallback sites. Both catches are intentional contracts: discovery must degrade to no-information on any foreign-object failure, and a token call must never raise. Configured as per-file-ignores rather than noqa comments because the pinned pre-commit ruff strips the comments as unused (RUF100) while the floating CI ruff requires them. Assisted-by: ClaudeCode:claude-fable-5 * ci(zarr-indexing): pin ruff in the lint job and justfile Mirrors the main-branch pin (d-v-b#271) so this PR's workflow runs the same ruff version; bump together with the pyproject pin. Assisted-by: ClaudeCode:claude-fable-5 * docs: add lazy-indexing examples for NumPy and Dask Two runnable examples in the house style: wrapping a NumPy array in LazyArray (attribute forwarding, composing selections, box vs query selections, partitions), and using a LazyArray with Dask (from_array, one task per partition, deterministic tokens). Assisted-by: ClaudeCode:claude-fable-5 * docs: compare dask task graphs with fused transforms in the dask example Adds a timed comparison of chained selections through dask.array against the same selections composed into one transform, and a section on when each is the right tool: dask's graph earns its cost when there is computation across chunks, and is overhead when it only defers indexing. Assisted-by: ClaudeCode:claude-fable-5 * test: run examples against this repository's local packages The example runner rewrote only the `zarr` dependency to the local checkout, so an example depending on an in-repo package resolved it from git main instead — and the lazy-indexing examples failed in CI, since LazyArray is not on main yet. Rewrite every package this repository ships, leaving dependencies an example does not declare alone. Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-indexing): negotiate what indexing a source supports `LazyArray` assumed every wrapped array could do basic slicing and did all fancy work itself, reading a block and post-indexing it with NumPy. That over-reads when the source could gather natively, and it walks a source axis by axis with `take` where one request would do. Each wrapper now carries an `IndexingSupport` level — BASIC, OUTER, OUTER_1VECTOR, VECTORIZED, the taxonomy and member names of xarray's `IndexingSupport` — and every read is split into the largest part of the selection that level can express, asked of the source in one call through `oindex`/`vindex` when it has them, and a residual transform applied to the block that comes back. The split is applied per partition as well as per whole-array read, so a part costs one request. The level is resolved at construction: an explicit `with_indexing_support` wins, then the source's own `__zarr_indexing_support__` (read defensively), then conservative inference — a NumPy array or zarr's `oindex`/`vindex` pair reads as VECTORIZED, everything else as BASIC, the only assumption that is always correct. A multi-array outer request only ever goes to an `oindex` accessor, because a bare `__getitem__` key with two arrays means an outer product to HDF5 and a correlated gather to NumPy. The level decides how much data crosses the boundary, never what `result()` returns. Tests hold that invariant directly: every selection case, at all four levels, against NumPy and zarr sources, partitioned and not; plus test doubles that raise when handed a key their declared level forbids, so exceeding a declaration fails loudly rather than working by accident. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): token the data, not how it is read The token included the partitioning while deliberately excluding the indexing-support level, though both are read strategies that leave the values unchanged. Excluding both means two wrappers that describe the same data token alike, so a consumer caching on tokens reuses one result across partitionings and support levels. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): an empty downward walk selects nothing A slice with a negative step whose start lies before the front of the axis selects nothing, but the positional slice was written as `slice(start, stop, step)` with a negative stop, which NumPy reads as counting from the end: an empty selection of a fancy axis returned the whole axis reversed, and the correlated form raised a broadcast error. Write an empty selection out explicitly. The randomized basic-selection generator drew negative-step starts from `[0, size)` only, so a start before the front of the axis was unreachable and the suite could not see this. It now draws from below `-size` as well, and three cases pin the behavior directly. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): a selection of slices is not a fancy selection An `oindex`/`vindex` step whose entries are all slices carries no coordinates: it narrows the view's own axes and must compose like basic indexing. `_reindex_array_oindex` instead applied each entry positionally to the corresponding axis of the existing index array, without asking whether that axis is one the array varies over or a singleton it merely broadcasts along — the distinction its basic-indexing sibling `_reindex_array` has always made. A slice starting past 0 therefore indexed a size-1 broadcast axis out of range and truncated the whole index array to size 0. A view with no coordinates left resolves to no parts, and `result()` handed back its unwritten `np.empty` buffer: live, on the default path, for any source that advertises chunks. `_reindex_array_oindex` now takes the `ArrayMap` and applies an entry only along its dependency axes (plus the `input_dimension` that breaks the tie for a degenerate length-1 orthogonal selection), preserving a broadcast singleton whatever the slice says. Coordinates never reach a broadcast axis — `_guard_fancy_after_fancy` still rejects genuine fancy-after-fancy with `NotImplementedError`, now under test. Four defects from the same review ride along: - `_array_map_dependency_axes` counted a length-**0** axis as an axis the array varies over, so an empty orthogonal selection classified as correlated and `array_map_dependent_axis` rejected it — a raise on the unpartitioned path where every partitioned path returned the right empty answer. An axis of size 0 carries no dependency any more than a singleton does. - `parts()` raised on a view emptied by a slice over an axis of extent 1. A correlated selection of one point normalizes to an all-singleton index array, so emptying the domain leaves the array at size 1 and the resolver went looking for a chunk. An empty input domain now yields no parts and meets no output domain, matching `result()`. - `sub_transform_to_selections` built `slice(stop + 1, start + 1, stride)` for a negative stride — endpoints swapped, step still negative, so it selected nothing where the reversed axis was meant. Both branches now lower through `_positional_slice`, the same walk an `ArrayMap` axis is reindexed by, which knows a downward walk reaching the front must stop at `None`. - `compose()` evaluated an inner index array over `range(size)` rather than over the outer domain's own range, and addressed it from 0 rather than from the inner domain's origin. Every coordinate resolved to the wrong cell whenever a domain did not start at 0 — which a step-1 slice and a negative-step slice both produce routinely here. - `transform_from_canonical` now rejects a non-integer `index_array` with an `NdselError` carrying `invalid_json`, instead of silently truncating `[0.9, 1.9]` to cells 0 and 1, coercing booleans, or leaking NumPy's own conversion error for strings. The fuzzer missed the first two because `_random_chain` drew at most one fancy step and had no way to spell a step that goes through a fancy accessor while carrying only slices. It now draws such a step separately, and the seeded sweep gained a `parts()` counterpart: `result()` can absorb a defect that the iteration contract cannot, since an empty view assembles correctly from no parts at all. Both sweeps fail on the pre-fix source, as does the new exhaustive stride/extent sweep over the chunk-selection bridge. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): count a domain axis no output map depends on A `vindex` coordinate array with a singleton broadcast axis contributes an axis it does not vary over. A later basic index that consumes the axis it *does* vary over collapses the map to a `ConstantMap` and leaves the broadcast axis in the domain, referenced by nothing. Three places assumed that could not happen: - `sub_transform_to_selections` built `out_selection` with one entry per output map, so a view with such an axis got an index tuple of lower rank than the buffer. `out[out_selection] = value` then placed the part against the leading axes and broadcast the rest — silently wrong data on a partitioned read, and a `parts()` walk that left cells unwritten. - `_restore_domain_axis_order` put an unreferenced axis back as a singleton whatever the domain said. At extent 0 that fabricated a row for a selection whose own `shape` reported it empty. - `_lower_correlated` built its flat gather index from the domain's broadcast shape but added coordinates straight off the stored index array, which is singleton on the axes it does not vary over. The two disagree exactly when a correlated map is constant along a shared broadcast axis. `out_selection` is now built per domain dimension throughout, an unreferenced axis is restored at its own extent, and a correlated map's coordinates are broadcast to the block before being combined. The randomized chain sweep never generated the shape at fault: `_random_vindex` only produced `(length,)` and `(length, 1)` coordinate arrays, neither of which leaves a singleton axis for a later step to strand. It now draws a broadcast rank and places each array's varying axis within it, which reproduces all three failures on the unfixed code. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): a materialized view never hands back the source Five fixes to the wrapper's edges, none of which changes what a selection means. `result()` and `__array__` no longer alias the wrapped array. An unpartitioned read of a basic selection lowers to plain slicing, so it came back as a *view* of the source; NumPy 2 hands whatever `__array__` returns straight to the caller, so `numpy.array(view, copy=True)` aliased it and a write reached through. Under any partitioning the same read allocates, so this also made the answer depend on how the read was divided. The result is now detached whenever it may share memory with the wrapped array, and the `copy=False` refusal no longer justifies itself with a claim the other branch violated. `result()` verifies that the partition walk covered the output before returning it. The buffer is deliberately uninitialized, so any defect in the walk was reported as plausible-looking numbers rather than as an error. The cells each part addresses are counted from the selectors' own shapes — nothing is read — and a walk that does not add up to the view's size raises. Measured on a 16 MiB read: 51 us of accounting against 6.5 ms of read for 64 parts, within noise end to end, and +1.7% at 512 parts. The `BASIC` floor is a promise about the *source*, not about the blocks it returns. The residual is finished with `take`, `reshape` and `transpose`, which were applied to the block unconverted — so a source meeting exactly the documented floor crashed on `oindex[[4, 0, 0], :, :]`. A block that is neither a NumPy array nor an array-API namespace of its own is now coerced, which leaves a device array where it is. `numpy.matrix` is refused at construction: it never reduces rank, so a view's shape and its result disagree on every rank-reducing selection. A `numpy.ma` source keeps its mask through a partitioned read, which allocates a masked buffer. A declaration holding a *foreign* enum member that names one of these four levels — xarray's `IndexingSupport`, whose members these are borrowed from — is honored rather than discarded, since discarding it fell through to inference and answered with a *more* permissive level than the source asked for. `is_complete` is true for a reversing view, which reads every cell of its box back to front; the stride-1 test it failed was about direction, not coverage. `with_parts` accepts `(0,)` and `(0, 0)` for a zero-length axis, which said the same thing as the `()` and uniform spellings it already took, and the positivity error names the working form. Above the token digest limit and without dask, `__dask_tokenize__` returns a value that matches nothing rather than a shape-and-dtype description that two different 4 MiB arrays shared. A cache keyed on it misses instead of lying. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): correct claims a reviewer found false Every statement below was executed before being rewritten, and the replacement was executed too. - "`view + 1`" / "arithmetic materializes through `__array__`" is false. `LazyArray` defines no arithmetic dunders, so `view + 1` raises `TypeError`. What does work is a NumPy *function* — `numpy.add(view, 1)`, `numpy.sum(view)`, `numpy.stack([view, view])` — and an ndarray on the left of the operator. Corrected in the module docstring, `docs/index.md` and the changelog fragment. - "An empty selection returns `None` from both" is false: an empty *box* reports `strides()` and only `bounding_box()` is `None`. The `strides()` docstring already said so; the design notes now agree with it. - "A box touches a contiguous run of parts" is false for a strided box — `[::4]` over 2-wide parts visits every other part. The true property, and the one a partition-walk optimizer would want, is a regularly-spaced run in increasing order, each part at most once. - "TensorStore permits a lower-rank index array" is backwards. Checked against tensorstore 0.1.84: its JSON parser rejects a rank-1 array over a rank-2 domain and accepts full rank with singletons, which is what we emit. *Our* loader is the permissive one. The passage now says both models want full rank, keeps the real rationale (the singletons are what makes the orthogonal/vectorized distinction derivable), and describes our lower-rank acceptance as the compatibility affordance it is. - "Two limits remain" omitted fancy-after-fancy, which is a live `NotImplementedError` reachable from the documented surface, while `index.md` invited chaining fancy steps "anywhere in the chain". Current scope now lists five limits, including the diagonal-view and mixed correlated/orthogonal ones, and both prose pages point at it. - "A single whole-array part stays in the wrapped array's namespace" is only true with *no* partitioning: `result()` branches on whether a partitioning is in force, not on how many boxes it has, so `with_parts((4, 6))` on a 4x6 array returns a plain ndarray. - The changelog stated the support-detection precedence backwards (declaration wins, not inference); `index.md` had a sentence missing its noun; the module docstring's one-line `bounding_box()` summary dropped the stride caveat the three other locations keep; and the package README, the PyPI long description, never mentioned `LazyArray`. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): hold the full-rank invariant inside the engine The index-array rank was checked only from above, so a lower-rank array could exist inside the engine and be read for dependency axes it did not have. Nothing produced one: the tolerance was there for a test asserting compatibility with a body TensorStore itself rejects (verified against 0.1.84 — a rank-1 array over a rank-3 domain is an error in its JSON parser). Require the full input rank in the type, widen a lower-rank array at the JSON boundary where external input arrives, and give the test the shape TensorStore accepts. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): an index array spans the domain it is read over An index array axis must be the domain's extent or a singleton it broadcasts over. Any other size leaves input coordinates with no entry, which read as a smaller selection rather than as the error it is: the truncated array behind one of this review's silent-corruption bugs was a (3, 0) array over a (3, 2) domain, which this rejects at construction. Two fixtures carried the inconsistency they were meant to exercise — an empty array over a domain with room for two coordinates, and a widening case whose array covered three of four positions — and now describe domains their arrays span. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-indexing): a state machine for chained indexing, and the rank-0 part it found Adds `zarr_indexing.testing`, behind a `testing` extra: a Hypothesis state machine that composes indexing steps onto a LazyArray and checks each step's shape, `result()`, and `parts()` assembly against NumPy, plus the selection strategies on their own. A project can point it at its own array by overriding one method. The machine asserts the documented assembly literally — a part's values must arrive at the shape its out_selection addresses — which is how it found the defect it also fixes: intersecting a correlated transform with a part's bounds collapsed the surviving broadcast block into one axis even when the block was already rank 0, so a view narrowed to a single point produced parts of rank 1. A rank-0 block now stays rank 0, and `result()` drops the reshape that was absorbing the mismatch. Merged from the branch that produced it, which predates the coverage guard in `result()`; the guard stays and the reshape it compensated with goes. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): the defects an adversarial review found at the boundaries Six reviewers went at the package, each proving findings by execution. The algebra held: ~85k chained selections against NumPy, ~24k part assemblies with poisoned buffers, 3.8k transform round-trips evaluated as coordinate maps, all clean. Everything below was at a boundary. `result()` and `__array__(copy=True)` could hand back a live view of the source. `_detach` asked whether the *source* was an ndarray, but a duck array that merely stores its data in NumPy returns NumPy views, and those went straight to the caller — while three docstrings promised the opposite unconditionally. It now asks whether the *result* owns its buffer, so memory is released only when sharing is disproved rather than when it cannot be established. The wire format could not reload its own output. `tolist()` renders every empty array as `[]` once the leading axis is the zero-length one, so an ordinary empty selection lost the axis it varied over, and the loader put it back on a different one by prepending singletons. Nested lists cannot express the shape either, so the body carries it. `index_domain_from_json` was a second undefended way into the same objects: a bare `int()` that truncated 3.9, coerced "3" and True, and let a non-string label into a tuple[str, ...]. It goes through the message layer now, as a transform body always did. With it: a rank ceiling, i64 checks on desugared bounds so normalization stays idempotent, ordered index_array_bounds, and typed errors where raw ones leaked. `sub_transform_to_selections` transposed its blocks two ways. A ConstantMap was emitted as a bare integer, which NumPy counts among the *advanced* indices whenever an index array is present, moving the broadcast axis to the front when a slice separates them — while `out_selection` is built positionally. And the correlated branch documented a points-major block but assembled the chunk selection in output order, so a residual slice before the coordinates arrived slice-major. Constants are length-one slices now, named in drop_axes, and the correlated scatter is permuted to the block NumPy actually returns. Nothing caught either one because `LazyArray` resolves a part through its own lowering and never reads `chunk_selection`; one of the two was even asserted as correct in a passing test's comment. Three further failures were one stale field: `_apply_vindex` carried `input_dimension` onto a map the vindex had just made correlated. The value outlived the shape that justified it and was believed later by a scatter that filed positions under the wrong axis — which is why one view's answer depended on how it was partitioned. The dependency is read back off the array now, and `__post_init__` checks the field it was wrong about: ArrayMap was the one map whose `input_dimension` nothing validated. Also: `oindex` over a correlated view applied its index tuple positionally, NumPy's vectorized rule, collapsing two arrays into one axis; `compose()` indexed an inner array's broadcast singletons by the raw coordinate and sized its one-dimensional shortcut by the input rank while gating on the output rank; and neither checked that the outer transform's output lands inside the inner domain, where a negative would have wrapped. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-indexing): generate the selections that were never generated A mutation audit ran 31 mutations and 10 survived. They were not scattered: the invariants check thoroughly what a view *returns* and never what it *claims about itself*, and the strategies could not draw whole classes of selection. The generators now draw them. Orthogonal slices carry a step and may stop early, so a strided or reversed slice reaches `oindex` at all. Coordinate lists and masks can be empty, so a fancy selection that selects nothing exists — the shape that lost its axis on the way through JSON. Vectorized coordinate arrays can be multi-dimensional, so a rank-raising `vindex` is generated. Measured over 4000 draws each, every one of those counts was previously 0. The first run of the widened generators found a live defect: an empty Python list carries no element type and NumPy defaults it to float64, so `oindex[[]]` was refused as a non-integer index array. `json.py` already had that case; the boundary did not. NumPy takes `a[np.ix_([])]`, and so does this now. `Partition.is_complete` gets an invariant. It is what a consumer reads to decide it may take a whole-box read, so a wrongly-`True` one is silent corruption — and three separate mutations to `_covers_whole_part` survived the entire suite, including ones reporting `is_complete` for a part carrying two of its three cells. Asserted one way only: the flag is documented as conservative and only the claim to cover everything has to be earned. Two more state machines. The sorted one-dimensional fancy path needs both ranks to be 1, and the output rank is the *source's*, so the rank-3 default source walled it off entirely — 0 hits from the machine against 105 from the unit tests, in the path where reordering and duplicate coordinates are partitioned. A rank-1 source now reaches it 322 times per run. A source with an extent-1 axis covers the other side of a distinction the code draws from the domain rather than the array. Finally the two remaining mutants, both checked by mutating and confirming the failure: the index-array bound checks are probed one past the boundary rather than comfortably outside it, and `_out_selection_cell_count`'s guard is tested directly, since a partition walk only ever produces the forward in-bounds intervals that never reach it. Assisted-by: ClaudeCode:claude-fable-5 * refactor(zarr-indexing)!: settle the API decisions that get dearer after 1.0 `with_parts` decided what it had been given by inspecting the type of it: a sequence of integers meant uniform boxes, a sequence of sequences meant per-axis sizes, and `None` meant no partitioning at all — which also sent `result()` down an entirely different code path. Three semantics behind one parameter, and no way to ask for one of them and be told when you had spelled it wrong. They are now `with_parts`, `with_parts_per_axis` and `unpartitioned`. A harness that draws from a list of mixed partitionings still needs the dispatch, so it exists once, as `zarr_indexing.testing.repartition`. The sizes those methods take are relative to the array being read, not to the view reading it, and a narrowed view partitions the base extents — which could only be discovered from an error message. `base_shape` says it. `ArrayMap`, `IndexTransform` and `Partition` are `frozen=True`, which reads as a promise that a value can be compared and hashed. Both raised: `==` on the index arrays returned an array and then `ValueError: the truth value of an array is ambiguous`, and `hash()` refused an ndarray outright. So no transform could enter a set or key a cache, and the package had already grown an internal `_is_identity_transform` because of it. An `ArrayMap` was frozen but the array inside it was not, so reaching through a view's transform to `index_array[0] = 9` silently changed what the view returned. It is held through a read-only view now — a view rather than a flag on the caller's array, since constructing a map should not take away the right to write to an array you still own. `IndexDomain.narrow` clamped a slice bound to the domain, in a package whose stated invariant is no clamping and no negative wrapping. `narrow(slice(-3, None))` on `[0, 10)` therefore returned the whole axis — reading as the NumPy spelling of "the last three" and answering with something else — and a stop past the end returned a domain its own parent did not contain. Both raise `BoundsCheckError` now, and a stride raises `ValueError` like every other unimplemented request rather than `IndexError`. `Partition.array` was a view of the array while `LazyArray.array` was the raw source: adjacent types, one name, inverted meanings. The part's is `view`. Smaller: `BoundsCheckError` and `VindexInvalidSelectionError` are exported at the top level, being what exported functions raise; `errors.py` no longer claims `zarr.errors` re-exports them by identity, which is false and would have been believed; `parts()` says it is single-use; and `sub_transform_to_selections` says it is provisional rather than implying the rest of the API's stability. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): correct the claims a reviewer could check, and two dialect gaps `boundary.py` justified applying scalars before the advanced indices by asserting NumPy does the same, citing `a[0, [1, 2], :]`. NumPy groups a scalar *with* the advanced indices for placement, so the two disagree the moment a slice separates them: `a[0, ..., [1, 2]]` is `(2, 3)` where `a[0][..., [1, 2]]` is `(3, 2)`. Scalar-first is this package's documented dialect and stays; the reasoning was wrong, and a wrong reason invites someone to "fix" the correct end later. Two places where the dialect really did diverge, both now matching NumPy. A zero-dimensional integer array is a scalar — `a[np.array(2), :]` drops its axis — but only Python and NumPy integers counted, so a 0-d array was widened into a length-1 index array and kept an axis; that was a third answer, agreeing with neither NumPy nor eager zarr. And a multi-dimensional array in an orthogonal selection is refused where the rule lives, instead of surfacing two layers down as a rank complaint about an `index_array` the caller never wrote. `iter_chunk_transforms` documented two shapes for `out_indices` and returns three: the `dict[int, ndarray]` an orthogonal selection with several index arrays produces was missing, from the function downstream integrators use most. Packaging: the README is the PyPI long description, so the monorepo-only development section moved to CONTRIBUTING.md and the dead relative link to the justfile went with it. The examples pinned `zarr-indexing` to a moving `main` rather than to a release they document. Three of the six docs pins claimed to match the repo root and did not, and the justfile's ruff comment contradicted the package's own pin. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): collapse an empty index array instead of extending the format The previous commit fixed the empty-selection round trip by carrying an `index_array_shape` field, on the reasoning that JSON nested lists cannot express the shape of an array with a leading zero axis — `[]` is the only spelling of every empty shape, and `[[]]` is (1, 0) with nothing for (0, 1). That much is true, but the conclusion was wrong: it invented a field ndsel does not define, so the documents this package wrote stopped being ndsel documents. The reference implementation does not have the problem, because it never emits an empty index array. `t[ts.d[0][[]]]` in TensorStore is `out[0] = 0`, emitted as `{}` — a constant map. An empty index array names no cell, and it can only be empty because an input dimension is, since the full-rank invariant makes every axis either 1 or the domain's extent. Nothing is ever read through it, the emptiness is carried by the domain, and the map is degenerate in exactly the way a size-1 array is — which this format already collapses. So it collapses the same way, and the extension is gone. The loader still recovers the axis from the domain for an empty array arriving from a producer that does emit one, since ndsel does not forbid it; that path just no longer has a first-party caller. Checked against tensorstore 0.1.84: every canonical body from 4000 randomized transforms loads into `ts.IndexTransform`, and every one re-emits itself unchanged. No spec change needed. Assisted-by: ClaudeCode:claude-fable-5 * fix(indexing): address lazy array review findings Assisted-by: Codex:gpt-5 * fix(zarr-indexing): keep an empty masked result masked whichever parts are in force An empty view is now answered without reading the source, and the shortcut reached for the array namespace's own `empty`, which knows nothing about masks. An unpartitioned empty view over a masked source therefore came back a plain array while the same view partitioned came back masked — no cells either way, so no value changed, but the caller's type depended on how the read had been divided, which `result()` promises it never does. A masked source goes through `_output_buffer`, which is the branch that knows. Assisted-by: ClaudeCode:claude-fable-5 * docs(indexing): design chunk projection API Assisted-by: Codex:gpt-5.6 * feat(indexing): add reusable chunk plans Assisted-by: Codex:gpt-5.6 * feat(indexing): project chunks through paired transforms Assisted-by: Codex:gpt-5.6 * refactor(indexing): build lazy parts from projections Assisted-by: Codex:gpt-5.6 * refactor(indexing): expose projection-only chunk planning Assisted-by: Codex:gpt-5.6 * docs(indexing): design visual indexing guide Assisted-by: Codex:gpt-5.6 * docs(indexing): explain coordinate origins Assisted-by: Codex:gpt-5.6 * docs(indexing): motivate negative chunk coordinates Assisted-by: Codex:gpt-5.6 * feat(indexing-docs): add SVG diagram renderer Assisted-by: Codex:gpt-5.6 * fix(indexing-docs): harden diagram rendering Assisted-by: Codex:gpt-5.6 * feat(indexing-docs): add accessible guide diagrams Assisted-by: Codex:gpt-5.6 * fix(indexing-docs): correct guide figure semantics Assisted-by: Codex:gpt-5.6 * fix(indexing-docs): prevent selection label overlap Assisted-by: Codex:gpt-5.6 * fix(indexing-docs): validate arrow label offsets Assisted-by: Codex:gpt-5.6 * test(indexing-docs): add executable guide examples Assisted-by: Codex:gpt-5.6 * docs(indexing): add NumPy-first visual tour Assisted-by: Codex:gpt-5.6 * docs(indexing): explain chunk projections visually Assisted-by: Codex:gpt-5.6 * docs(indexing): add indexing and integration references Assisted-by: Codex:gpt-5.6 * fix(indexing-docs): satisfy strict example typing Assisted-by: Codex:gpt-5.6 * docs(indexing): connect visual guide to reference docs Assisted-by: Codex:gpt-5.6 * fix(indexing-docs): source landing quickstart from example Assisted-by: Codex:gpt-5.6 * ci(indexing): verify executable visual docs Assisted-by: Codex:gpt-5.6 * fix(indexing): address visual guide review Assisted-by: Codex:gpt-5.6 * fix(indexing): improve chunk overlay on phones Assisted-by: Codex:gpt-5.6 * docs(indexing): design system-memory chunk cache example Assisted-by: Codex:gpt-5.6 * docs(indexing): introduce half-open intervals Assisted-by: Codex:gpt-5.6 * test(indexing): narrow diagram label elements Assisted-by: Codex:gpt-5.6 * docs(indexing): demonstrate a system-memory chunk cache Assisted-by: Codex:gpt-5.6 * chore(indexing): stop tracking design specs Assisted-by: Codex:gpt-5.6 * feat(indexing): apply and invert transforms Assisted-by: Codex:gpt-5.6 * fix(indexing): handle scalar and wide transform coordinates Assisted-by: Codex:gpt-5.6 * docs(indexing): explain the chunk-cache lifecycle Assisted-by: Codex:gpt-5.6 * fix(indexing): keep lifecycle diagram readable Assisted-by: Codex:gpt-5.6 * fix(indexing): keep lifecycle caption stationary Assisted-by: Codex:gpt-5.6 * fix(indexing): keep guide diagrams readable Assisted-by: Codex:gpt-5.6 * test(indexing): enforce unique guide figure wrappers Assisted-by: Codex:gpt-5.6 * test(indexing): scan all guide sources for figure duplicates Assisted-by: Codex:gpt-5.6 * docs(indexing): distinguish cache indexing modes Assisted-by: Codex:gpt-5.6 * docs(indexing): scope lazy examples to package Assisted-by: Codex:gpt-5.6 * fix(indexing): expose docs modules to root tests Assisted-by: Codex:gpt-5.6 * docs(indexing): omit text from diagram legends Assisted-by: Codex:gpt-5.6 * docs(indexing): strengthen chunk outlines Assisted-by: Codex:gpt-5.6 * docs(indexing): label unselected chunk cells Assisted-by: Codex:gpt-5.6 * fix(indexing): show coordinates in basic selection Assisted-by: Codex:gpt-5.6 * docs(indexing): clarify coordinate-value mapping Assisted-by: Codex:gpt-5.6 * docs(indexing): simplify half-open intervals Assisted-by: Codex:gpt-5.6 * docs(indexing): explain ordered concatenation Assisted-by: Codex:gpt-5.6 * docs(indexing): consolidate visual guide Assisted-by: Codex:gpt-5.6 * docs(indexing): clarify basic selection figure Assisted-by: Codex:gpt-5.6 * docs(indexing): simplify coordinate introduction Assisted-by: Codex:gpt-5.6 * docs(indexing): explain result axis construction Assisted-by: Codex:gpt-5.6 * docs(indexing): enclose slice result axis Assisted-by: Codex:gpt-5.6 * fix(indexing): clarify result array comparison Assisted-by: Codex:gpt-5.6 * fix(indexing): preserve tutorial result ranks Assisted-by: Codex:gpt-5.6 * docs(indexing): promote chunk cache example Assisted-by: Codex:gpt-5.6 * docs(indexing): render chunk cache source Assisted-by: Codex:gpt-5.6 * fix(indexing): close final correctness gaps Assisted-by: Codex:gpt-5.6 * docs(indexing): replace diagrams with ascii Assisted-by: Codex:gpt-5.6 * chore(indexing): remove svg diagram pipeline Assisted-by: Codex:gpt-5.6 * docs(indexing): simplify guide navigation Assisted-by: Codex:gpt-5.6 * fix(indexing): align selection diagram columns Assisted-by: Codex:gpt-5.6 * feat(indexing): add explicit array readers Assisted-by: Codex:gpt-5.6 * refactor(indexing): resolve lazy arrays through readers Assisted-by: Codex:gpt-5.6 * docs(indexing): exercise readers in chunk cache example Assisted-by: Codex:gpt-5.6 * fix(indexing): preserve cache request event ordering Assisted-by: Codex:gpt-5.6 * refactor(indexing): remove indexing capability taxonomy Assisted-by: Codex:gpt-5.6 * docs(indexing): explain explicit reader execution Assisted-by: Codex:gpt-5.6 * test(indexing): avoid constructor spelling assertion Assisted-by: Codex:gpt-5.6 * fix(indexing): complete reader migration Assisted-by: Codex:gpt-5.6 * fix(indexing): keep reader helpers private Assisted-by: Codex:gpt-5.6 * docs(indexing): finalize reader safety contract Assisted-by: Codex:gpt-5.6 * feat(indexing): add compact chunk grids Assisted-by: Codex:gpt-5.6 * fix(indexing): check affine coordinate arithmetic Assisted-by: Codex:gpt-5.6 * fix(indexing): validate composed constants Assisted-by: Codex:gpt-5.6 * fix(indexing): expose grid size representation Assisted-by: Codex:gpt-5.6 * fix(indexing): validate direct advanced selections Assisted-by: Codex:gpt-5.6 * fix(indexing): handle boolean list masks Assisted-by: Codex:gpt-5.6 * fix(indexing): project sparse affine selections directly Assisted-by: Codex:gpt-5.6 * fix(indexing): normalize chunk planner positions Assisted-by: Codex:gpt-5.6 * fix(indexing): lower reader transforms through bounded slabs Assisted-by: Codex:gpt-5.6 * refactor(indexing): expose global partition read context Assisted-by: Codex:gpt-5.6 * fix(indexing): resolve read context annotations Assisted-by: Codex:gpt-5.6 * feat(indexing): reuse prepared partition plans Assisted-by: Codex:gpt-5.6 * fix(indexing): validate prepared partition coverage Assisted-by: Codex:gpt-5.6 * test(indexing): enforce transform materialization laws Assisted-by: Codex:gpt-5.6 * docs(indexing): clarify chunk projection locality Assisted-by: Codex:gpt-5.6 * fix(indexing): harden transform and partition validation Assisted-by: Codex:gpt-5.6 * docs(indexing): separate examples from snippets Assisted-by: Codex:gpt-5.6 * feat(indexing): support index protocol selectors Assisted-by: Codex:gpt-5.6 * feat(indexing): compose fancy selections without restriction A second oindex/vindex/mask step may now land on any axis of an already-fancy view, including axes an existing index array merely broadcasts along. Array-carrying transforms route through compose() instead of being rewritten in place: the selection is applied to an identity transform over the current domain (same dialect by construction) and chained on, which evaluates the existing index arrays at the new coordinates. The in-place reindex machinery and its fancy-after-fancy guard are deleted. Resolution classifies transforms by structure (the new public index_array_structure): pure per-axis outer products keep the orthogonal resolvers; correlated maps, mixtures, and index arrays sharing an input axis (diagonal gathers) all take the pointwise path, whose intersect and lower stages now broadcast per-map blocks instead of assuming full-block index arrays. Only hand-built affine diagonals (an index array and a slice map bound to the same axis) remain unsupported. This removes the crash where a slice-only vindex step (view.lazy.vindex[...] or vindex[..., scalar]) after a correlated gather misclassified the gather as orthogonal and failed at result(), and fixes a stale input_dimension surviving integer indexing of an empty map's pinned axis. Also, from the same review: result(parts=...) raises ValueError instead of AssertionError when supplied parts do not tile the view; with_parts and with_parts_per_axis raise the documented ValueError for non-iterable input; prepared-part validation uses plain assignment for box parts; and __dask_tokenize__ digests the canonical transform body instead of embedding it, keeping tokens small for large fancy selections. The testing state machine now draws any number of fancy steps per chain. Assisted-by: ClaudeCode:claude-fable-5 * refactor(indexing)!: retire ArrayMap.input_dimension What an index-array map depends on is now read from one place: its full-rank array's shape, whose non-singleton axes are the dependency axes. The retired field pinned the orthogonal axis redundantly and could contradict the array it rode on; every bug found in two adversarial review rounds traced back to its bookkeeping (stale values surviving reindexing, misclassification of correlated maps, dangling axes after integer indexing). The one shape the field disambiguated - a single-coordinate, all-singleton array - is normalized away instead: the selection and composition layers build it as the ConstantMap it equals (output_map.array_map_or_constant), exactly as the JSON serializer has always collapsed it on the wire. A consequence is that a length-1 fancy selection now classifies as a box (is_box, bounding_box, strides), which is the semantically sharper answer. Hand-built all-singleton, empty, or shared-axis ArrayMaps remain valid values and resolve through the pointwise path. Fallout removed with the field: the post-init consistency validation, the basic-indexing renumbering of pinned axes, the JSON loader's global dependency-axis reconstruction, and composition's binding carry-through. The sorted 1-D chunk-planning fast path now applies to either fancy spelling, since the flavors coincide in one dimension. The wire format is unaffected - it never carried the field. BREAKING: ArrayMap.__init__ no longer accepts input_dimension, and the attribute is gone; array_map_dependent_axis now answers from the shape alone. Assisted-by: ClaudeCode:claude-fable-5 * feat(zarr-indexing): a reader for sources that only accept unit-step slices BasicReader reads the minimum by pushing strided and descending selections down as positive-step slices, which assumes the source accepts any step. Integrating a zarrs-backed array showed how common the narrower contract is: FFI bindings and HTTP range endpoints support nothing but slice(start, stop, 1), leaving every such backend to rewrite the same cover-and-restride lowering in its facade. UnitStepReader moves that lowering behind the Reader boundary. The decomposition covers each DimensionMap with the smallest ascending unit-step slab and replays the original stride in the residual — the same move the basic decomposition already makes for direction, extended to magnitude. The residual lowering needed no change: positive strides slice the block, descending ones were always gathered. The cost is explicit in the docstring: a strided selection over-reads its cover by the stride factor, bounded by partitioning the wrapping LazyArray. The existing reader contract cases and the affine-overflow parity test now run across all three built-in readers, through a source that rejects anything but ascending unit-step slices inside its bounds. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): the dense-box re-partition idiom is_box and strides() exist so a consumer can choose a read strategy, but the three lines that act on them were only discoverable by deriving them. The integrations guide now states the policy: a dense box resolves best as one backend slab read — re-partition to the base shape and let the backend dispatch, decode in parallel, and partial-decode shards on its own side — while strided boxes and gathers keep the partitioning, which bounds every cover by one part and makes hull-sized reads of sparse selections structurally impossible. The snippet is executable and pins both regimes by observed reads: the corner gather touches four single cells, never the hull; the dense box is exactly one call. A closing subsection points sources that only accept unit-step slices at unit_step_reader. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-indexing): re-vendor ndsel conformance corpus at 49b9e1db Re-vendor from zarr-developers/ndsel main (49b9e1db1ca93c55f320b025a666367de87a9014, merge of ndsel PR #3). Only transform.json changed vs the previously vendored 92d6a32d: two new fixtures pin empty index_array serialization — normalize carries an empty index_array verbatim rather than rewriting it to a constant map, while a producer SHOULD collapse it to a constant output map, which zarr_indexing.json already does. All other corpus files are byte-identical. Assisted-by: ClaudeCode:claude-fable-5 * ci(zarr-indexing): run the tensorstore parity tests test_ndsel_tensorstore.py skipped everywhere because tensorstore was in no dependency group or workflow. Add a dedicated step to the test job that overlays tensorstore (>=0.1.84, wheels cover the whole 3.12-3.14 matrix) and runs the two parity modules; the main pytest run stays byte-identical to the local canonical invocation. Verified locally against tensorstore 0.1.85 on CPython 3.14: 88 passed, 0 skipped. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-indexing): derive the docs include graph instead of registering it The doc-example tests accreted during the documentation build-out as one-off guardrails: hand-maintained registries of snippet regions, exact heading and navigation strings, substring pins on teaching prose, and tombstones for migrations that already happened. Each new snippet had to be registered by hand, and editing a sentence could fail CI. The registries also missed the one failure they existed to prevent: a page including a region nobody registered was invisible to them. The suite now states two kinds of contract and nothing else. Structural: every '--8<--' include in the rendered markdown — discovered by scanning, so new snippets are covered the day they are written — resolves to exactly one file with a balanced, non-empty region, and every snippet executes, its inline assertions serving as the value check where expected values were previously duplicated into test tables. Behavioral: the pattern matrix, the wrapped-source contract, and the chunk-cache lifecycle keep their tests, because an example cannot assert its own error paths. pymdownx.snippets gains check_paths: true, so the strict docs build now fails on an unresolvable include instead of silently rendering nothing. Verified both directions: a deliberately broken region name fails the scan test (naming page, file, and region) and the docs build. Editorial choices — section order, wording, nav — return to review, where they belong. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): lead every page with the simple idea The guide opened with two meta-paragraphs and an annotated table of contents; the one-sentence mental model — lazy indexing builds a view, planning partitions it, result() materializes it — sat below them. It opens with that sentence now, and says plainly that the first four sections serve anyone indexing arrays while the last two serve integrators, so most readers know they can stop early. Advanced material moves out of the beginner path. Negative-origin domains, grid prepending, and the EdgeDimensionGrid/DimensionGridLike comparison sat in section two, before the reader had met a transform; they now live in the design notes as 'Negative-origin domains and prependable grids', linked from the two places that want them. The paired-projection section introduces the cell domain concretely — a table with one row per selected cell, chunk-local address on one side, result position on the other — before naming it. The landing page gains the missing why: many arrays support only plain slicing, and this package grafts the full NumPy dialect onto them. The pattern reference leads with the selection matrix readers come for and moves the positions-vs-literal-coordinates table after it. The materialization warning becomes a list, and captions that narrated their own code are cut. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): document every public method of the public API Every public class, method, and property reachable from the package root now carries a docstring stating its contract: the coordinate frame it speaks (global source, chunk-grid, or zero-origin chunk-local), whether a chunk length is the declared codec size or the boundary-clipped data extent, what is bounds-checked and what extrapolates, and which inputs raise which errors. Protocol members (DimensionGridLike, DimensionGrid) are written as implementer obligations, since the docstring is the contract a third-party grid must satisfy. Dataclass-generated __init__ methods are left to their class docstrings; adding a docstring there would mean hand-writing the constructor for no behavioral reason. Docstrings only — no code, signature, or existing-docstring changes. Verified: an introspection audit over __all__ reports zero public members without docstrings; the full suite and pyright are unchanged. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): attribute docstrings for every public field The previous pass documented methods and properties; dataclass and TypedDict fields — IndexDomain.exclusive_max and 41 siblings across fifteen classes — carried no per-attribute documentation, only prose in their class docstrings. Each public field now has an attribute docstring stating what the value means, its coordinate frame or units, and the invariant it carries (literal bounds may be negative, edges are declared codec sizes unclipped by extent, derived fields say what they are derived from, wire bounds admit the infinities the engine refuses to lower). Found by an AST audit, since attribute docstrings are invisible to runtime introspection; that audit now reports zero undocumented public fields. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): the input/output-to-request/source dictionary, and each map kind in NumPy terms An IndexTransform is a function between coordinate spaces, and its fields speak function vocabulary (input, output) while every array-minded reader speaks request and source. The confusion this causes is concentrated in one word: 'output' looks like data, but names the output side of the coordinate function — which is where values are read FROM, since data flows against the arrow. The transform section of the guide and the transform API page now state the dictionary outright, in a two-row table, at the moment a reader first meets the fields, along with why the neutral names exist: composition, where an interior transform has neither a request nor a source side. The three output map kinds are now demonstrated executably against their NumPy counterparts: DimensionMap against basic and negative-step slices, ArrayMap against fancy indexing with order and duplicates preserved, and ConstantMap against numpy.broadcast_to — stated as the value-faithful counterpart precisely because no NumPy selection spells a retained constant axis; an integer index drops it, and a repeated fancy index matches the values while degrading the description to a coordinate list. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): flat landing page — motivation, example, links The grid cards misrendered (misaligned card bodies) and earned their keep poorly: two navigation targets dressed as a layout feature. The landing page now follows the shape convention of projects like pydantic — motivation paragraph, install, one quickstart with a sentence stating the lazy/eager boundary, then a single annotated link list. The two cards' start-here targets survive as the visual guide entry, which names both audiences and their entry points in one line each. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): a single-point bounds error never mentions a batch apply() delegates to the vectorized kernel shared with apply_many() — the right direction, since the batch path is the hot one — but the kernel's diagnostic leaked through it: apply((11,)) on a [-10, 10) domain reported 'point at batch position ()', naming a batch the caller never formed, from a private frame the caller never called. The kernel now raises an internal structured signal (dimension, value, bounds, batch position) and each public entry formats it in its own vocabulary, 'from None' so the traceback ends at the API layer: apply says 'coordinate 11 on input dimension 0 is outside the domain [-10, 10)'; apply_many keeps the batch-position form, where that context is exactly right. Message-only change; BoundsCheckError remains the type on both paths. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): annotation syntax in docstring type slots Parameters and Returns entries now state types as annotations — Sequence[int], tuple[int, ...], numpy.typing.NDArray[numpy.intp] — instead of prose like 'sequence of int' or bare 'tuple'. The annotation is the type's one precise spelling, matches the signature beside it, and names the exact shape where prose left it to the description (both boundary functions' bare 'tuple' entries now state their element structure). Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): the chunk cache example is named for what it is The example was born napari_chunk_cache, and the docs spent two bold disclaimers insisting it is a napari-like consumer, not a napari integration — while the nav entry, section headings, and class names had already settled on 'system-memory chunk cache'. A name that needs disclaimers is the wrong name. The directory, script, and docs page are now system_memory_chunk_cache, matching everything else; napari remains where it belongs, in prose, as the motivating access pattern. Path-only rename: no code, region names, or prose claims change. The derived include-graph test and the strict docs build (check_paths) verify every include and link followed the move. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): an empty domain reads as empty through every reader Composing a fancy selection onto an empty-domain view emits an ArrayMap that is legitimately empty along the vanished axis — a shape the package promises resolves like any other. The resolvers broke that promise: _correlated_map_coords tried to reshape the 0-size array to its non-zero singleton block axes and raised ValueError from all three built-in readers on a direct read_into, a sequence the pre-composition engine handled. LazyArray.result() masked it only through its own size-0 short-circuit. _lower now answers an empty domain first — nothing is selected, so no resolver needs to evaluate maps that may be empty along vanished axes — and the correlated path independently returns no coordinates for an empty broadcast block. Found by an adversarial review fuzzing composed selection chains (3 of 400 random chains hit it); the regression test pins the exact public-API reproduction across all three readers. Assisted-by: ClaudeCode:claude-fable-5 * test(zarr-indexing): execute the CLI examples; strict builds guard anchors and nav Two claims from the doc-test restructure were false, and an adversarial review proved both empirically. First, the lazy_indexing_* examples were said to run under the repository-root example runner; that runner globs only the root examples directory, so the two CLI examples ran under no test at all. They now run as subprocesses here, the dask one skipping where dask is absent. Second, the module docstring claimed mkdocs --strict covered the deleted anchor and nav guards; a strict build passed with a deliberately broken cross-page anchor and with a page omitted from nav, because both are INFO-level by default. mkdocs.yml now sets those validations to warn, which strict promotes to errors — verified failing on a broken anchor and passing clean. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): the vindex error's real contract, and neutral map vocabulary VindexInvalidSelectionError's docstring claimed it covered every non-coordinate vindex form; in fact only the wrapper's validation raises it, only for slices — other invalid entries raise plain IndexError, and the engine-level IndexTransform.vindex accepts residual slice dimensions without raising. The docstring now states the actual raise site. The transform-algebra docstrings (transform, output_map, composition, json) also drop 'storage' for neutral input/output vocabulary: a transform's output side is just output coordinates — in a composition chain an interior transform has no storage side at all. The request/source/storage translation stays where it belongs, in the guide's vocabulary table and the endpoint layers (readers, grids) that really do face arrays. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): an executable Examples section on every public object Every public class and function in the package root now carries a numpydoc Examples section in doctest form: 37 new examples, each a small intuition-builder in the shape the IndexTransform walk-through set — the domain is the result's coordinates, the output maps are the rule, and where an object corresponds to a NumPy indexing concept the example demonstrates the equivalence (DimensionMap against a slice, ArrayMap against fancy indexing with duplicates surviving, ConstantMap against numpy.broadcast_to, compose against chained slicing). The error classes demonstrate their actual raise; the wire types round-trip real bodies. The examples are enforced, not decorative — and closing that loop exposed that the package's existing doctests were never collected anywhere: the package pyproject shadows the repository root's pytest configuration, and no invocation named src. The package config now enables --doctest-modules with the root's option flags, testpaths includes src/zarr_indexing, and the justfile recipe and CI workflow collect it explicitly. 1280 tests pass, 45 of them doctests. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): apply and apply_many say what they locate, not their signature 'Map one input coordinate to an output coordinate' restates the type signature in prose — any function maps inputs to outputs. The summaries now speak the class docstring's array-indexing frame: apply maps a coordinate of the domain (a result cell) to the source coordinate its value is read from, by evaluating each output map; apply_many is the batch form. Both gain a doctest locating cells of the [::2] transform, and both state that no data is touched — this is the coordinate arrow, running result to source. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): method summaries never lean on the ambiguous naked input/output 'input' and 'output' are reserved algebra terms in this package, and in a method summary they collide with ordinary function-speak: identity's 'input coordinate i maps to output coordinate i' reads equally as the algebra statement and as a vacuous description of any function — the same trap apply's summary fell into. identity, intersect, and translate now speak the array frame instead: every result cell reads the source at its own address; keep only the cells whose source coordinates fall inside the box; shift the source coordinates every cell reads. Field docstrings and class summaries keep the naked terms where no call is in sight and the technical reading is the only one available. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): drop non-behavior statements that disambiguate nothing 'No data is touched' in apply/apply_many and 'without I/O' on the oindex/vindex accessors stated what the functions do not do without clarifying what they do: nothing about a coordinate lookup, or about an accessor documented to return a new transform, suggests data movement. Removed. The statements that earn their negation stay: the module thesis, the class contract, and __getitem__ — where subscription syntax genuinely suggests an eager read to anyone arriving from zarr. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): a flat sidebar — sections must earn their existence 'Use lazy indexing' held one page: a disclosure triangle and a competing label with no organization gained. 'Practical reference' classified nothing and grouped two pages serving different audiences — the exact split the guide's opening and the landing page's annotated links already route explicitly. Both dissolve into top-level entries. Examples and API Reference keep their sections, being the only real collections at this site's size; the ndsel wire format and design notes gain explicit labels and sit in the for-builders tail before the API. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): the three guide pages are one Guide section Visual guide, indexing patterns, and integration boundaries sat at top level with the same rank as the fifteen-page API Reference — three pages wearing category clothes. They are one collection, and the docs/guide/ directory said so all along: learn it, look it up, apply it at the boundary. Pydantic's sidebar confirms the pattern (its narrative layer is one Concepts section) while cautioning against copying its tab bar and zero-loose-pages norm, which pay off at fifty pages and cost discovery at eight. navigation.indexes makes the Guide entry itself land on the visual guide, so the common click is free; standalone artifacts (landing, ndsel spec, design notes, changelog) keep their top-level standing. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): the pattern matrix models selections as transforms The indexing-pattern reference framed every row through LazyArray, as if the wrapper defined the semantics. It does not: every dialect compiles to an IndexTransform, and the wrapper is a regular array-like API whose only distinction is that operations on .lazy return views. The matrix now speaks the algebra — t[1:5, ::2], t.oindex[rows, columns] on IndexTransform.from_shape((6, 8)) — and the executable snippet compiles each selection through the transform accessors, reads the box/query category structurally off the output maps, and resolves values through the public reader. The wrapper is demoted to a closing note, and the test suite keeps it honest by running the same matrix through LazyArray: the snippet proves the algebra, the test proves the wrapper agrees. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): the pattern matrix hand-builds each idiom's transform Showing t[1:5, ::2] demonstrated only that IndexTransform supports __getitem__ — syntax, not the object. Each idiom is now modeled by hand: domain plus output maps, with the anatomy stated per case (the dropped axis surviving as a ConstantMap, reversal as nothing but a negative stride, emptiness living in the domain, a mask being its nonzero coordinates, and fancy flavor spelled entirely by index-array shape — distinct axes for the outer product, a shared axis for pointwise). The table shows each idiom's maps; the executable matrix checks every model's shape, category, and NumPy values, then proves the selection compiler derives the same transform — after translate_domain_to, since compiled basic selections keep literal domains, a wrinkle the page now names. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): close the guide's thirteen confirmed explanation gaps An adversarial pedagogy review (five reader personas, three skeptics per finding) confirmed thirteen distinct gaps; all are closed. Rendered excerpts no longer reference invisible code: the map-kind examples' resolve helper is now shown and introduced — doubling as the guide's first statement of how a bare transform meets data — and the axis-manipulation excerpts carry their own setup. The sharpest finding, a genuine contradiction, is corrected: the guide claimed an integer index is not a ConstantMap while the pattern matrix models image[2, :] with exactly one; the responsibility now sits where the model puts it — the domain decides axes, the map only fixes a coordinate, and a broadcast is a domain axis no map consumes. The wrapper's partitioning vocabulary is introduced before use: with_parts leaves the composition snippet (it taught nothing there), 'parts' is defined in the chunk-plan section, Partition/.view/.projection/ .out_selection get an introducing sentence before the frame warning, and the integrations page states the chunks-attribute discovery its read counts silently relied on. plan_chunks' argument is described truthfully (one per-dimension grid, four-method contract, dimension_grids_from_chunks as the built-in), oindex is defined at first use, 'cover' and 'bounding hull' are defined where the dense-box policy leans on them, the reads-through-the-chunk-local-side claim now matches the code, the pattern table uses the executable's real variable names, and the guide's footer no longer skips the rest of its own collection. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): the idiom matrix shows both constructor halves Each row of the idiom-to-model matrix now carries the domain beside the output maps — the complete IndexTransform model, not half of it. The redundant result-shape column folds into the domain spelling, with one sentence stating why that is no loss: the domain is the result's coordinates, so its shape is the result shape. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): the idiom matrix shows complete transforms in wire form A table cell reading from_shape((4, 4)) was a receiverless method call — syntax debris, not a model. Each idiom now appears as its complete transform in the ndsel canonical body: explicit domain bounds, one output map per source dimension, nothing to squint at. The wire form also teaches for free — the dropped axis of image[2, :] is visibly the bare {"offset": 2} constant form, emptiness is visibly a zero-width bound, and outer-product versus pointwise is visibly nesting versus flat arrays. The nine bodies cannot rot: a new test pins each JSON block to transform_to_canonical of the corresponding executable model, in order. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): pattern matrix entries pair Python and JSON in tabs Each idiom now shows both spellings of its model in linked content tabs: the Python construction and the ndsel canonical body. content.tabs.link keeps every pair switched together, so a reader can walk the whole matrix in either language. The pinning test grows teeth on both sides: the JSON tab must equal the model's canonical form, and the Python tab must evaluate — in the executable matrix's own namespace — to the model itself, so neither tab can drift from the code. Assisted-by: ClaudeCode:claude-fable-5 * docs: update index * docs(zarr-indexing): state the read-only contract LazyArray never declared The wrapper defines no __setitem__, but nothing said so: the class docstring, the module docstring, the guide, and the landing page were all silent, leaving a real contract to be discovered by TypeError. The class docstring and the guide's materialization warning now state it, together with where writing does belong — a consumer plans the selection with plan_chunks and owns the read-modify-write, because chunk atomicity and concurrent-writer policy are the backend's to decide. The flip side is stated where a source is described: a wrapped array needs shape, dtype, and __getitem__ and nothing more, so a read-only source (an HTTP endpoint, a snapshot, a decoded-chunk cache) wraps as well as a writable one. Naming was considered and rejected. LazyArrayView would mislead, since a NumPy view shares memory and writes through — the opposite of the truth — and LazyReadOnlyArray names a non-capability and implies a writable sibling. Read-only-ness follows from the object being a deferred description of a read; a documented contract closes the gap that a loud, immediate TypeError already made non-silent. Assisted-by: ClaudeCode:claude-fable-5 * docs: clarify intended use * refactor(zarr-indexing)!: the types own their one serialization The canonical converters were free functions in json.py, and the reason given for that — keeping the algebra core ignorant of the wire format — did not survive inspection: importing the package already loads json.py and messages.py through __init__, so nothing was decoupled for anyone. And the usual reason to keep a type ignorant of its serialization is to avoid privileging one of several; this repo admits exactly one, spec- defined and TensorStore-compatible, whose own IndexTransform carries to_json(). So the conversions are methods now: IndexTransform.to_json/from_json, IndexDomain.to_json/from_json, and to_json on each output map kind. output_index_map_from_json stays a function, moved to output_map.py, because the wire form is a tagged union — loading it dispatches rather than belonging to any one kind. The surface shrinks rather than grows. Each conversion had two public spellings (the canonical name plus a historical *_to_json alias); both are gone, leaving one. json.py keeps the wire vocabulary — the TypedDicts and JSON type aliases — and the lowering rules the types share move to a package-private _wire.py, which is what they always were: pyright caught underscore-private helpers being read from three other modules. Assisted-by: ClaudeCode:claude-fable-5 * refactor(zarr-indexing)!: operations belong to their types, algorithms go private Applying the lesson from the serialization move to the rest of the package, and checked against TensorStore, whose split is unusually clear: its public index_space headers are the types, while every transform operation — compose_transforms, inverse_transform, transpose, translate, the slice ops — lives in internal/ and surfaces as a method. Its Python IndexTransform is all methods and no free functions. composition.py was the same defect json.py had: 242 lines, zero types, one public function over a type defined elsewhere, with its own API page as if it were a subsystem. The algorithm is now private in _composition.py and the public spelling is outer.compose(inner). selection_to_transform becomes transform.select(selection, mode), index_array_structure becomes a property, and array_map_dependent_axis becomes ArrayMap.dependent_axis — it described an ArrayMap while living in transform.py. Two smaller repairs fall out. affine.py, never exported and never documented, takes the underscore it had earned. And the dependency-axes helper that three modules read across a private boundary becomes ArrayMap.dependency_axes, which is what it always was: something a map knows about itself. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): release notes point at this PR, and describe the shipped API Three fragments carried fork PR numbers (267, 272, 273), which towncrier renders as links to zarr-developers/zarr-python issues of those numbers — unrelated upstream issues. They are this PR's work and now say so. Their contents had also aged past the code. The LazyArray note described array_map_dependent_axis, compose() and transform_from_canonical, none of which survive; the composition note named index_array_structure as a function. All now name the shipped spelling. The merged ndsel fragment already on main said index_transform_to_json and its siblings 'now produce and consume the canonical body' — true when written, but this PR removes them, and both fragments render in the same unreleased changelog, so it would have introduced and withdrawn one API in a single release. One recategorization: the note covering with_parts becoming three named methods, Partition.array becoming Partition.view, and the new equality and hashing sat under misc, whose towncrier default shows the link and discards the text — user-visible breaking changes, invisible in the changelog. Moved to removals, which also drops a duplicated #4222 link from the misc line. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): the LazyArray note is a release entry, not a manual One fragment had grown to 1844 words — two thirds of all release-note text, rendering as a single bullet. It was the PR's commit log: the feature, then nine paragraphs of defects found and fixed along the way. Those defects belong to the pull request, not the changelog. This package has never released — CHANGELOG.md holds nothing but the towncrier marker — so every one of them was a bug in code no reader could have run, and a first release that recounts them describes a journey nobody took. What remains is what the package offers, split by capability rather than by the order the work happened: LazyArray and its partitioning, source-independent chunk planning, the reader boundary, the testing subpackage, and negative-step slices. Each is scannable, and the detail they used to carry is in the guide and design notes, which they now link. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): a first release describes the package, not its development With no release before this PR merges, the Bugfixes and Deprecations sections were describing work no reader could have experienced: defects in code that never shipped, and the withdrawal of functions nobody could have imported. Both sections are gone. Their surviving content is stated as what the package offers. The algebra's types carry their own operations — composition, selection, application, classification and serialization on IndexTransform, dependency axes on ArrayMap, value semantics on all three — which is a capability, not a migration. base_shape joins the partitioning entry. The remaining entries drop the last of their before-and-after framing: a first release has no 'now', and nothing in it was 'fixed'. Assisted-by: ClaudeCode:claude-fable-5 * fix(zarr-indexing): satisfy lint rules CI enables and the pinned ruff does not CI's ruff runs a broader rule set than the version pinned in .pre-commit-config.yaml, so three violations passed locally and failed there. All three are worth fixing on their own terms rather than suppressing. The BadIndex fixtures return 2.5 from __index__ deliberately — the point is an object that violates the protocol, so the package can be shown rejecting it. PLE0305 reads that as a mistake. `cast("int", 2.5)` keeps the runtime lie the test needs while saying the lie is intentional, and drops the `# type: ignore` it needed for mypy. The stateful test imported `zarr_indexing.testing.stateful as stateful`; `from zarr_indexing.testing import stateful` is the form the rest of the suite uses, and the import block re-sorts around it. Assisted-by: ClaudeCode:claude-fable-5 * test: the root example runner forgets about zarr-indexing again It was taught to substitute a local `zarr-indexing` checkout into a PEP 723 header, but no example at the repository root declares that dependency — the three there are zarr-only — and `set_dep` leaves an undeclared one alone, so the entry never fired. The runner also globs `examples/` only, so it could never have reached the package's own examples in `packages/zarr-indexing/examples/`; the package's suite asserted as much, checking they were absent from the root. Those examples do now run, as subprocesses in the package's own `test_doc_examples.py`, which is where a package's examples belong. This restores `tests/test_examples.py` to what main has: root examples, the one local package they actually use, and no knowledge of `packages/`. Assisted-by: ClaudeCode:claude-fable-5 * docs(zarr-indexing): restore the release notes 0.1.0 users actually need zarr-indexing 0.1.0 is on PyPI, tagged at a994a4fc. Its CHANGELOG.md holds nothing but the towncrier marker — the release was cut without ever building its notes — and I read that emptiness as "never released", then deleted the Bugfixes and Deprecations sections on the grounds that nobody could have experienced them. They could. Comparing the installed 0.1.0 against this branch, ten public names disappear: compose, selection_to_transform, transform_to_canonical, transform_from_canonical, index_transform_to_json, index_transform_from_json, index_domain_to_json, index_domain_from_json, iter_chunk_transforms and sub_transform_to_selections. Every one is an import that breaks on upgrade, and the notes said nothing about any of them. The four removal fragments and the bugfix fragment are restored, and the last two removals — the provisional tuple resolver and selector bridge, which only a feature fragment had mentioned in passing — are named. The fixes that were buried in the LazyArray feature entry move to Bugfixes where they belong, as a list rather than the nine paragraphs they were. The duplicate feature entry I had written to carry the surviving API names goes, its content being what the removal entries already say from the migrating reader's side. Assisted-by: ClaudeCode:claude-fable-5 * build(zarr-indexing): the sdist ships an allowlist, not whatever is lying around hatchling had no sdist configuration, so a source distribution carried everything in the package directory. Building from a working tree with scratch files in it put eight of them in the tarball. A tagged release builds from a fresh CI checkout and so was never actually at risk, but nothing made that a property of the package rather than of the runner. The allowlist is chosen to keep an sdist able to test itself: tests/ carries the vendored ndsel conformance corpus, and test_doc_examples.py executes docs/snippets/*.py and examples/*/*.py, so those directories are part of the suite rather than documentation shipped for its own sake. Verified by unpacking the built sdist into a bare venv and running its tests there — 1058 pass, the rest skipping on optional dependencies. Assisted-by: ClaudeCode:claude-fable-5 * ci(zarr-indexing): the justfile is the single definition of each check The docs job already called `just docs-check`, and zarr-metadata's workflow runs entirely on `just`, but zarr-indexing's test, ruff and pyright jobs spelled their commands out again. Every recipe existed twice, so adding the src/ doctest collection meant editing both places, and forgetting either would have let them drift silently. They drift already. The justfile pinned ruff 0.15.22 while the repo moved to 0.16.0 in #4213 — the divergence behind this branch's lint failure — and its own comment says the two are meant to be bumped together. The pin is now 0.16.0, and because CI reads it from the justfile there is one place to bump next time. The tensorstore parity run gains the recipe it never had, so `just check` finally means what its comment claims: everything CI runs. The test job moves into the package directory to give the recipes their expected working directory, and syncs `--project ../..` so it still resolves against the repo-root environment that provides `zarr`. Verified by running every recipe CI now calls: test (1290 passed), test-tensorstore (88), lint, typecheck, docs-check. Assisted-by: ClaudeCode:claude-fable-5 --- .github/workflows/zarr-indexing.yml | 27 +- packages/zarr-indexing/CONTRIBUTING.md | 27 + packages/zarr-indexing/README.md | 41 +- .../zarr-indexing/changes/3906.feature.md | 2 +- .../zarr-indexing/changes/4222.bugfix.1.md | 39 + packages/zarr-indexing/changes/4222.bugfix.md | 9 + .../zarr-indexing/changes/4222.feature.1.md | 7 + .../zarr-indexing/changes/4222.feature.2.md | 24 + .../zarr-indexing/changes/4222.feature.3.md | 9 + .../zarr-indexing/changes/4222.feature.4.md | 8 + .../zarr-indexing/changes/4222.feature.5.md | 8 + .../zarr-indexing/changes/4222.feature.6.md | 9 + .../zarr-indexing/changes/4222.feature.md | 11 + packages/zarr-indexing/changes/4222.misc.md | 5 + .../zarr-indexing/changes/4222.removal.1.md | 12 + .../zarr-indexing/changes/4222.removal.2.md | 15 + .../zarr-indexing/changes/4222.removal.3.md | 6 + .../zarr-indexing/changes/4222.removal.md | 11 + packages/zarr-indexing/docs/api/boundary.md | 5 + .../zarr-indexing/docs/api/composition.md | 5 - packages/zarr-indexing/docs/api/grid.md | 17 + packages/zarr-indexing/docs/api/index.md | 54 +- packages/zarr-indexing/docs/api/lazy_array.md | 27 + packages/zarr-indexing/docs/api/reader.md | 51 + .../docs/api/testing_stateful.md | 5 + .../docs/api/testing_strategies.md | 5 + packages/zarr-indexing/docs/api/transform.md | 13 + packages/zarr-indexing/docs/design-notes.md | 296 ++ .../docs/examples/lazy_indexing_dask.md | 7 + .../docs/examples/lazy_indexing_numpy.md | 15 + .../examples/system_memory_chunk_cache.md | 11 + packages/zarr-indexing/docs/guide/index.md | 444 +++ .../zarr-indexing/docs/guide/integrations.md | 214 ++ packages/zarr-indexing/docs/guide/patterns.md | 327 ++ packages/zarr-indexing/docs/index.md | 167 +- packages/zarr-indexing/docs/ndsel.md | 61 +- .../docs/snippets/axis_manipulation.py | 29 + .../docs/snippets/canonical_slice.py | 30 + .../docs/snippets/chunk_projection.py | 57 + .../docs/snippets/coordinate_origins.py | 65 + .../docs/snippets/indexing_patterns.py | 210 ++ .../docs/snippets/integrations.py | 167 ++ .../docs/snippets/lazy_composition.py | 14 + .../docs/snippets/output_maps.py | 67 + .../examples/lazy_indexing_dask/README.md | 55 + .../lazy_indexing_dask/lazy_indexing_dask.py | 181 ++ .../examples/lazy_indexing_numpy/README.md | 38 + .../lazy_indexing_numpy.py | 133 + .../system_memory_chunk_cache/README.md | 46 + .../system_memory_chunk_cache.py | 432 +++ packages/zarr-indexing/justfile | 21 +- packages/zarr-indexing/mkdocs.yml | 46 +- packages/zarr-indexing/pyproject.toml | 61 +- .../src/zarr_indexing/__init__.py | 96 +- .../src/zarr_indexing/_affine.py | 77 + .../src/zarr_indexing/_composition.py | 242 ++ .../src/zarr_indexing/_selector.py | 41 + .../zarr-indexing/src/zarr_indexing/_wire.py | 119 + .../src/zarr_indexing/boundary.py | 374 +++ .../src/zarr_indexing/chunk_resolution.py | 539 +++- .../src/zarr_indexing/composition.py | 133 - .../zarr-indexing/src/zarr_indexing/domain.py | 154 +- .../zarr-indexing/src/zarr_indexing/errors.py | 60 +- .../zarr-indexing/src/zarr_indexing/grid.py | 827 +++++- .../zarr-indexing/src/zarr_indexing/json.py | 361 +-- .../src/zarr_indexing/lazy_array.py | 1365 +++++++++ .../src/zarr_indexing/messages.py | 134 +- .../src/zarr_indexing/output_map.py | 372 ++- .../zarr-indexing/src/zarr_indexing/reader.py | 585 ++++ .../src/zarr_indexing/testing/__init__.py | 57 + .../src/zarr_indexing/testing/stateful.py | 380 +++ .../src/zarr_indexing/testing/strategies.py | 207 ++ .../src/zarr_indexing/transform.py | 1328 ++++++--- .../tests/conformance/PROVENANCE.md | 25 +- .../tests/conformance/errors.json | 4 +- .../tests/conformance/slice.json | 95 + .../tests/conformance/transform.json | 37 + .../tests/test_chunk_resolution.py | 961 +++--- .../zarr-indexing/tests/test_composition.py | 338 ++- .../zarr-indexing/tests/test_doc_examples.py | 488 +++ packages/zarr-indexing/tests/test_domain.py | 30 +- packages/zarr-indexing/tests/test_json.py | 368 ++- .../zarr-indexing/tests/test_lazy_array.py | 2618 +++++++++++++++++ .../tests/test_lazy_array_stateful.py | 114 + packages/zarr-indexing/tests/test_messages.py | 42 + .../tests/test_ndsel_tensorstore.py | 7 +- .../zarr-indexing/tests/test_output_map.py | 43 + packages/zarr-indexing/tests/test_reader.py | 514 ++++ .../tests/test_tensorstore_parity.py | 172 ++ .../zarr-indexing/tests/test_transform.py | 666 ++++- packages/zarr-indexing/uv.lock | 769 +++++ 91 files changed, 16604 insertions(+), 1784 deletions(-) create mode 100644 packages/zarr-indexing/CONTRIBUTING.md create mode 100644 packages/zarr-indexing/changes/4222.bugfix.1.md create mode 100644 packages/zarr-indexing/changes/4222.bugfix.md create mode 100644 packages/zarr-indexing/changes/4222.feature.1.md create mode 100644 packages/zarr-indexing/changes/4222.feature.2.md create mode 100644 packages/zarr-indexing/changes/4222.feature.3.md create mode 100644 packages/zarr-indexing/changes/4222.feature.4.md create mode 100644 packages/zarr-indexing/changes/4222.feature.5.md create mode 100644 packages/zarr-indexing/changes/4222.feature.6.md create mode 100644 packages/zarr-indexing/changes/4222.feature.md create mode 100644 packages/zarr-indexing/changes/4222.misc.md create mode 100644 packages/zarr-indexing/changes/4222.removal.1.md create mode 100644 packages/zarr-indexing/changes/4222.removal.2.md create mode 100644 packages/zarr-indexing/changes/4222.removal.3.md create mode 100644 packages/zarr-indexing/changes/4222.removal.md create mode 100644 packages/zarr-indexing/docs/api/boundary.md delete mode 100644 packages/zarr-indexing/docs/api/composition.md create mode 100644 packages/zarr-indexing/docs/api/lazy_array.md create mode 100644 packages/zarr-indexing/docs/api/reader.md create mode 100644 packages/zarr-indexing/docs/api/testing_stateful.md create mode 100644 packages/zarr-indexing/docs/api/testing_strategies.md create mode 100644 packages/zarr-indexing/docs/design-notes.md create mode 100644 packages/zarr-indexing/docs/examples/lazy_indexing_dask.md create mode 100644 packages/zarr-indexing/docs/examples/lazy_indexing_numpy.md create mode 100644 packages/zarr-indexing/docs/examples/system_memory_chunk_cache.md create mode 100644 packages/zarr-indexing/docs/guide/index.md create mode 100644 packages/zarr-indexing/docs/guide/integrations.md create mode 100644 packages/zarr-indexing/docs/guide/patterns.md create mode 100644 packages/zarr-indexing/docs/snippets/axis_manipulation.py create mode 100644 packages/zarr-indexing/docs/snippets/canonical_slice.py create mode 100644 packages/zarr-indexing/docs/snippets/chunk_projection.py create mode 100644 packages/zarr-indexing/docs/snippets/coordinate_origins.py create mode 100644 packages/zarr-indexing/docs/snippets/indexing_patterns.py create mode 100644 packages/zarr-indexing/docs/snippets/integrations.py create mode 100644 packages/zarr-indexing/docs/snippets/lazy_composition.py create mode 100644 packages/zarr-indexing/docs/snippets/output_maps.py create mode 100644 packages/zarr-indexing/examples/lazy_indexing_dask/README.md create mode 100644 packages/zarr-indexing/examples/lazy_indexing_dask/lazy_indexing_dask.py create mode 100644 packages/zarr-indexing/examples/lazy_indexing_numpy/README.md create mode 100644 packages/zarr-indexing/examples/lazy_indexing_numpy/lazy_indexing_numpy.py create mode 100644 packages/zarr-indexing/examples/system_memory_chunk_cache/README.md create mode 100644 packages/zarr-indexing/examples/system_memory_chunk_cache/system_memory_chunk_cache.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/_affine.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/_composition.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/_selector.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/_wire.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/boundary.py delete mode 100644 packages/zarr-indexing/src/zarr_indexing/composition.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/lazy_array.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/reader.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/testing/__init__.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/testing/stateful.py create mode 100644 packages/zarr-indexing/src/zarr_indexing/testing/strategies.py create mode 100644 packages/zarr-indexing/tests/test_doc_examples.py create mode 100644 packages/zarr-indexing/tests/test_lazy_array.py create mode 100644 packages/zarr-indexing/tests/test_lazy_array_stateful.py create mode 100644 packages/zarr-indexing/tests/test_reader.py create mode 100644 packages/zarr-indexing/uv.lock diff --git a/.github/workflows/zarr-indexing.yml b/.github/workflows/zarr-indexing.yml index afaa9e6db7..61776df913 100644 --- a/.github/workflows/zarr-indexing.yml +++ b/.github/workflows/zarr-indexing.yml @@ -26,6 +26,7 @@ jobs: defaults: run: shell: bash + working-directory: packages/zarr-indexing strategy: fail-fast: false matrix: @@ -38,16 +39,22 @@ jobs: uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 with: enable-cache: true + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 - name: Set up Python ${{ matrix.python-version }} run: uv python install ${{ matrix.python-version }} # The transform tests exercise chunk resolution against zarr's ChunkGrid, - # so they run from the repo root against the root environment (which - # provides `zarr`) with this package as an editable overlay rather than in - # package isolation. + # so they run against the repo-root environment (which provides `zarr`) + # with this package as an editable overlay rather than in package + # isolation. The recipes carry that invocation; this step only fixes the + # interpreter the matrix asked for. - name: Sync test dependency group - run: uv sync --group test --python ${{ matrix.python-version }} + run: uv sync --project ../.. --group test --python ${{ matrix.python-version }} - name: Run pytest - run: uv run --no-sync --group test --with-editable ./packages/zarr-indexing python -m pytest packages/zarr-indexing/tests + # Suites and invocation live in packages/zarr-indexing/justfile. + run: just test + - name: Run pytest (tensorstore parity) + run: just test-tensorstore ruff: name: ruff @@ -62,8 +69,11 @@ jobs: persist-credentials: false - name: Install uv uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 - name: Run ruff - run: uvx ruff check . + # The ruff version pin lives in packages/zarr-indexing/justfile. + run: just lint pyright: name: pyright @@ -84,8 +94,11 @@ jobs: run: uv python install 3.12 - name: Sync test dependency group run: uv sync --group test --python 3.12 + - name: Install just + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 - name: Run pyright - run: uv run --group test --with pyright pyright src + # The pyright invocation lives in packages/zarr-indexing/justfile. + run: just typecheck docs: name: docs diff --git a/packages/zarr-indexing/CONTRIBUTING.md b/packages/zarr-indexing/CONTRIBUTING.md new file mode 100644 index 0000000000..632e24929f --- /dev/null +++ b/packages/zarr-indexing/CONTRIBUTING.md @@ -0,0 +1,27 @@ +# Contributing to zarr-indexing + +Package-scoped development commands live in the [`justfile`](./justfile) +(requires [just](https://github.com/casey/just)): + +``` +just test # run the test suite (extra args go to pytest) +just lint # ruff, same invocation as CI +just typecheck # pyright, same invocation as CI +just docs-check # strict build of the docs site +just check # all of the above +just docs-serve # serve the docs site locally +``` + +Run them from this directory, or from anywhere in the repository as +`just packages/zarr-indexing/`. + +The test recipe runs against the workspace-root environment, because the +chunk-resolution tests exercise this package against `zarr`'s chunk grids and +`zarr` is deliberately not a dependency of this package. + +## License + +MIT + +The package lives at `packages/zarr-indexing` inside the +[zarr-python](https://github.com/zarr-developers/zarr-python) repository. diff --git a/packages/zarr-indexing/README.md b/packages/zarr-indexing/README.md index ccdfe595a5..7e2cec10dd 100644 --- a/packages/zarr-indexing/README.md +++ b/packages/zarr-indexing/README.md @@ -11,8 +11,20 @@ I/O until you explicitly read or write. Key types: +- `LazyArray` — wraps a system-memory/basic-indexing source and adds a `.lazy` + accessor: `LazyArray.from_numpy(numpy_array).lazy[10:50, ::2].lazy.oindex[[3, 1, 1], :]` + composes a transform and returns a new view without reading data, and + `result()` materializes it into owned system memory. `LazyArray(source)` uses + the conservative basic reader; `from_numpy` explicitly selects NumPy's + optimized reader. Device arrays require an explicit custom reader responsible + for transferring values into the supplied system-memory output buffer. +- `Reader` — the explicit backend execution boundary: transforms say which + values belong in the result, while readers say how a backend obtains them - `IndexDomain` — a rectangular region of integer coordinates - `IndexTransform` — maps input coordinates to storage coordinates +- `ChunkPlan` and `ChunkProjection` — lazily partition a selection over a + caller-selected grid and pair each chunk-local transform with its placement in + the request, without binding a storage backend or scheduler - `ConstantMap`, `DimensionMap`, `ArrayMap` — the three ways a single output dimension can depend on the input - `compose` — chain two transforms into one @@ -27,27 +39,14 @@ repository and consumed by `zarr` to resolve array indexing operations. pip install zarr-indexing ``` -## Developing +## Examples -Package-scoped development commands live in the [`justfile`](./justfile) -(requires [just](https://github.com/casey/just)): +- [Lazy indexing a NumPy array](examples/lazy_indexing_numpy/README.md) +- [Lazy indexing with Dask](examples/lazy_indexing_dask/README.md) -``` -just test # run the test suite (extra args go to pytest) -just lint # ruff, same invocation as CI -just typecheck # pyright, same invocation as CI -just docs-check # strict build of the docs site -just check # all of the above -just docs-serve # serve the docs site locally -``` - -Run them from this directory, or from anywhere in the repository as -`just packages/zarr-indexing/`. - -The test recipe runs against the workspace-root environment, because the -chunk-resolution tests exercise this package against `zarr`'s chunk grids and -`zarr` is deliberately not a dependency of this package. - -## License +## Contributing -MIT +Development commands, the test suite and the docs build are described in +[CONTRIBUTING.md](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/CONTRIBUTING.md) +in the repository. Issues and pull requests go to +[zarr-developers/zarr-python](https://github.com/zarr-developers/zarr-python). diff --git a/packages/zarr-indexing/changes/3906.feature.md b/packages/zarr-indexing/changes/3906.feature.md index fa51b4438e..4a4b754bd8 100644 --- a/packages/zarr-indexing/changes/3906.feature.md +++ b/packages/zarr-indexing/changes/3906.feature.md @@ -1 +1 @@ -Reworked the JSON layer to conform to the [ndsel](https://github.com/zarr-developers/ndsel) draft wire format, which adapts TensorStore's `IndexTransform`. A new `zarr_indexing.messages` module (`parse_ndsel`, `normalize_ndsel`, `NdselError`) is a pure JSON-to-JSON layer that accepts all five message kinds (`point`/`box`/`slice`/`points`/`transform`) and normalizes them to the canonical transform body, enforcing the full ndsel error taxonomy. The package is checked against the vendored, language-agnostic ndsel conformance corpus. `index_transform_to_json`/`index_transform_from_json` (and the domain variants) now produce and consume the canonical body. On serialization, orthogonal (`oindex`) `index_array` maps no longer emit `input_dimension` alongside `index_array` (a combination both ndsel and TensorStore reject), and degenerate all-singleton index arrays collapse to constant maps; the in-memory `input_dimension` is reconstructed from the array's dependency axes on load. +Reworked the JSON layer to conform to the [ndsel](https://github.com/zarr-developers/ndsel) draft wire format, which adapts TensorStore's `IndexTransform`. A new `zarr_indexing.messages` module (`parse_ndsel`, `normalize_ndsel`, `NdselError`) is a pure JSON-to-JSON layer that accepts all five message kinds (`point`/`box`/`slice`/`points`/`transform`) and normalizes them to the canonical transform body, enforcing the full ndsel error taxonomy. The package is checked against the vendored, language-agnostic ndsel conformance corpus. Serialization produces and consumes the canonical body (`IndexTransform.to_json`/`from_json`, and the `IndexDomain` pair). On serialization, orthogonal (`oindex`) `index_array` maps no longer emit `input_dimension` alongside `index_array` (a combination both ndsel and TensorStore reject), and degenerate all-singleton index arrays collapse to constant maps; the in-memory `input_dimension` is reconstructed from the array's dependency axes on load. diff --git a/packages/zarr-indexing/changes/4222.bugfix.1.md b/packages/zarr-indexing/changes/4222.bugfix.1.md new file mode 100644 index 0000000000..8cff5be6e4 --- /dev/null +++ b/packages/zarr-indexing/changes/4222.bugfix.1.md @@ -0,0 +1,39 @@ +Correctness fixes to indexing and resolution, all reachable from 0.1.0: + +- An integer index applied to an axis a previous `oindex`/`vindex` step had + already indexed left an all-singleton `ArrayMap` still naming the axis the + integer removed, which after renumbering aliased a different one. Such a map + now collapses to a `ConstantMap` at composition time. +- A `vindex` selection whose coordinate arrays are not on the leading axes + (`vindex[..., i, j]`, `vindex[..., mask]`) laid out its result incorrectly and + raised a shape mismatch on a partitioned read. Gathered dimensions now follow + NumPy's placement rule, and the per-part gather is realigned to the scatter. +- An `oindex`/`vindex` step whose entries are all slices, applied to a view with + a fancy-indexed axis, applied those slices positionally to every axis of the + existing index array — including broadcast singletons — truncating it to size + 0, so `result()` returned an unwritten buffer. Reindexing is now + dependency-aware. +- `parts()` raised on a view emptied by a slice over an axis of extent 1; an + empty domain now yields no parts, matching `result()`. +- Negative-stride chunk projection swapped the endpoints while keeping the step + negative, selecting nothing where the reversed axis was meant. Composition + evaluated an inner index array over `range(size)` rather than the outer + domain's own range, resolving every coordinate wrongly whenever that domain + did not start at 0 — which both step-1 and negative-step slices produce. +- A domain dimension no output map depends on, left behind when a later basic + index consumes the axis a `vindex` array varied over, was miscounted in three + places: the partition walk's out-selection rank, the lowering engine's axis + restoration, and the correlated gather's broadcast. +- The parts of a correlated view narrowed to a single point came back rank 1 + where the view was rank 0, so the documented + `out[part.out_selection] = part.view.result()` assembly raised `ValueError`. +- `result()` could return memory shared with the wrapped array: an unpartitioned + read of a basic selection lowered to plain slicing and handed back a view of + the source, and `numpy.array(view, copy=True)` inherited the alias. It now + always allocates, and verifies the parts covered the output before returning. +- `IndexTransform.from_json` rejects a non-integer `index_array` with an + `NdselError` carrying `invalid_json`, rather than truncating a float array, + coercing booleans, or leaking NumPy's conversion error for strings. +- `result(parts=...)` raises `ValueError` rather than `AssertionError` when the + supplied parts do not tile the view, and `with_parts` / `with_parts_per_axis` + raise the documented `ValueError` for non-iterable input. diff --git a/packages/zarr-indexing/changes/4222.bugfix.md b/packages/zarr-indexing/changes/4222.bugfix.md new file mode 100644 index 0000000000..0717e1e384 --- /dev/null +++ b/packages/zarr-indexing/changes/4222.bugfix.md @@ -0,0 +1,9 @@ +An adversarial review of the whole package found, and this fixes, several +defects at its boundaries: `result()` and `__array__(copy=True)` could hand back +a live view of a source that merely stored its data in NumPy; the wire format +emitted a document nothing could load for a selection that selects nothing, and +its domain loader validated nothing; chunk-selection lowering described a +transposed block in two separate cases; a map derived from a vectorized +selection carried a stale `input_dimension`, which made one view's answer depend +on how it was partitioned; and `oindex` over a correlated view applied NumPy's +vectorized rule instead of the outer product. diff --git a/packages/zarr-indexing/changes/4222.feature.1.md b/packages/zarr-indexing/changes/4222.feature.1.md new file mode 100644 index 0000000000..bc62baf357 --- /dev/null +++ b/packages/zarr-indexing/changes/4222.feature.1.md @@ -0,0 +1,7 @@ +Added `UnitStepReader` / `unit_step_reader`: a backend adapter for sources +whose basic indexing accepts only ascending step-1 slices (FFI bindings, HTTP +range endpoints). Every key it presents is `slice(start, stop, 1)` per axis; +strides, reversals, and gathers are applied to the in-memory block by the +residual lowering. The integrations guide documents the companion dense-box +re-partition idiom — resolving a unit-stride rectangular view as one backend +slab read while keeping partitioned reads for strided and fancy selections. diff --git a/packages/zarr-indexing/changes/4222.feature.2.md b/packages/zarr-indexing/changes/4222.feature.2.md new file mode 100644 index 0000000000..722f56db99 --- /dev/null +++ b/packages/zarr-indexing/changes/4222.feature.2.md @@ -0,0 +1,24 @@ +Added `LazyArray`, which grafts the full NumPy indexing dialect onto any source +exposing `shape`, `dtype`, and basic integer/slice `__getitem__` — a chunked +store, an FFI binding, an HTTP endpoint. `view.lazy[...]`, `.lazy.oindex[...]` +and `.lazy.vindex[...]` each compose an `IndexTransform` and return a new view +without reading anything; `result()` materializes. Selections use positional +NumPy semantics (negatives wrap, scalars drop their axis, coordinate arrays keep +order and duplicates), which the new `zarr_indexing.boundary` module translates +into the algebra's literal coordinates. The wrapper describes reads only, and +behaves as a duck array: eager `__getitem__` and `__array__` make it a +`dask.array.from_array` source. + +A read is divided along a **partitioning** — discovered from the wrapped array, +or chosen with `with_parts` / `with_parts_per_axis` / `unpartitioned`. +`parts()` yields one `Partition` per box, pairing a resolvable sub-view with +where its cells belong in the result; `result()` is the assembly of that walk, +and re-partitioning never changes what it returns. `base_shape` says which shape a partitioning is expressed in. `is_box`, `bounding_box()` +and `strides()` report whether a selection is rectangular, so a consumer can +dispatch a slab read against a gather. + +See the [guide](https://zarr-indexing.readthedocs.io/en/latest/guide/) for the +model and the +[design notes](https://zarr-indexing.readthedocs.io/en/latest/design-notes/) +for the box/query distinction, the relationship to TensorStore, and current +scope limits. diff --git a/packages/zarr-indexing/changes/4222.feature.3.md b/packages/zarr-indexing/changes/4222.feature.3.md new file mode 100644 index 0000000000..ef0e1512c2 --- /dev/null +++ b/packages/zarr-indexing/changes/4222.feature.3.md @@ -0,0 +1,9 @@ +Added source-independent chunk planning. `plan_chunks(transform, grids)` returns +a lazy, reusable `ChunkPlan` whose `ChunkProjection`s each pair a chunk-local +transform with a transform back to the request, over one shared cell domain, so +a consumer can read a chunk and place its values without re-deriving either. The +same representation covers basic, orthogonal and vectorized indexing, and +carries global chunk bounds plus conservative full/partial/unknown coverage. +I/O, buffering and scheduling stay with the consumer. `zarr_indexing.grid` gained +`EdgeDimensionGrid` and `dimension_grids_from_chunks` for building the per-axis +grids it takes. diff --git a/packages/zarr-indexing/changes/4222.feature.4.md b/packages/zarr-indexing/changes/4222.feature.4.md new file mode 100644 index 0000000000..623d381083 --- /dev/null +++ b/packages/zarr-indexing/changes/4222.feature.4.md @@ -0,0 +1,8 @@ +`LazyArray` has an explicit reader boundary: an `IndexTransform` decides which +values belong in a result, and a `Reader` decides how one backend obtains them, +preserving the transform exactly. `LazyArray(source)` is conservative and assumes +only basic indexing; `LazyArray.from_numpy(array)` selects the optimized NumPy +reader; `with_reader` selects any other. Readers do not define indexing +semantics, partitioning, scheduling, or result ownership. Both built-in readers +lower through NumPy system memory, so a device array needs a custom reader that +transfers into the supplied output buffer. diff --git a/packages/zarr-indexing/changes/4222.feature.5.md b/packages/zarr-indexing/changes/4222.feature.5.md new file mode 100644 index 0000000000..859667775f --- /dev/null +++ b/packages/zarr-indexing/changes/4222.feature.5.md @@ -0,0 +1,8 @@ +Added the `zarr_indexing.testing` subpackage, behind a `testing` extra +(`pip install zarr-indexing[testing]`), carrying the Hypothesis machinery this +package tests itself with. `ChainedIndexingStateMachine` composes basic, +orthogonal and vectorized selections onto a `LazyArray` wrapping an array you +supply, then checks every view's shape, `result()`, and assembled `parts()` +against NumPy; `zarr_indexing.testing.strategies` exports the selection +strategies alone, for a project with its own harness. Nothing outside the +subpackage imports Hypothesis. diff --git a/packages/zarr-indexing/changes/4222.feature.6.md b/packages/zarr-indexing/changes/4222.feature.6.md new file mode 100644 index 0000000000..8c65f947e6 --- /dev/null +++ b/packages/zarr-indexing/changes/4222.feature.6.md @@ -0,0 +1,9 @@ +Negative-step slices are supported, following merged ndsel 1.0-draft.2 and +TensorStore 0.1.84: `arr[::-1]`, `arr[5:1:-2]`, and reversal composed over an +already-strided or already-gathered view. One desugaring rule covers both signs — +omitted bounds resolve on the side the traversal starts and stops, and the origin +is `trunc(start / step)` — while a reversed interval is an error rather than a +silently empty selection. A reversing slice normally yields a negative domain +origin, since the result stays anchored to the source coordinate frame; +`LazyArray` re-bases every view to origin 0, so its positional dialect is +unaffected. diff --git a/packages/zarr-indexing/changes/4222.feature.md b/packages/zarr-indexing/changes/4222.feature.md new file mode 100644 index 0000000000..c02ab54edb --- /dev/null +++ b/packages/zarr-indexing/changes/4222.feature.md @@ -0,0 +1,11 @@ +Fancy selections compose without restriction, on both `LazyArray` and +`IndexTransform`: a second `oindex`/`vindex`/mask step may land on any axis of +an already-fancy view, including axes an existing index array merely broadcasts +along. Array-carrying transforms are chained through `compose`, and resolution +handles the resulting mixed, correlated and diagonal index-array structures on +one shared pointwise path, classified by `IndexTransform.index_array_structure`. +Only hand-built affine diagonals — an index array and a slice map bound to the +same axis — remain unsupported. + +`__dask_tokenize__` digests a view's canonical transform body rather than +embedding it, so tokens stay small for large fancy selections. diff --git a/packages/zarr-indexing/changes/4222.misc.md b/packages/zarr-indexing/changes/4222.misc.md new file mode 100644 index 0000000000..1bd73e1c80 --- /dev/null +++ b/packages/zarr-indexing/changes/4222.misc.md @@ -0,0 +1,5 @@ +Restructured the documentation-contract tests: the snippet include graph is +now discovered by scanning the rendered markdown instead of hand-maintained +registries, prose and navigation assertions moved out of CI, and +`pymdownx.snippets` now sets `check_paths: true` so an unresolvable include +fails `mkdocs build --strict` instead of silently rendering nothing. diff --git a/packages/zarr-indexing/changes/4222.removal.1.md b/packages/zarr-indexing/changes/4222.removal.1.md new file mode 100644 index 0000000000..33ff9cb423 --- /dev/null +++ b/packages/zarr-indexing/changes/4222.removal.1.md @@ -0,0 +1,12 @@ +The canonical JSON converters are now methods on the types that own the +serialization: `IndexTransform.to_json()` / `IndexTransform.from_json()`, +`IndexDomain.to_json()` / `IndexDomain.from_json()`, and `to_json()` on each +output map kind. `output_index_map_from_json` remains a function, in +`zarr_indexing.output_map`, because the wire form is a tagged union and +loading it dispatches rather than belonging to any one kind. + +The free functions they replace — `transform_to_canonical`, +`transform_from_canonical`, `index_domain_to_json`, `index_domain_from_json`, +`output_index_map_to_json`, and the historical aliases +`index_transform_to_json` / `index_transform_from_json` — are removed. There +had been two spellings of each conversion; there is now one. diff --git a/packages/zarr-indexing/changes/4222.removal.2.md b/packages/zarr-indexing/changes/4222.removal.2.md new file mode 100644 index 0000000000..d3321ea81c --- /dev/null +++ b/packages/zarr-indexing/changes/4222.removal.2.md @@ -0,0 +1,15 @@ +Operations moved onto the types that own them, following the arrangement +TensorStore uses (public headers are the types; every transform operation +lives in `internal/` and surfaces as a method): + +- `compose(outer, inner)` is now `outer.compose(inner)`, and the algorithm + moved to the private `zarr_indexing._composition`. +- `selection_to_transform(selection, transform, mode)` is now + `transform.select(selection, mode)`. +- `index_array_structure(transform)` is now the `transform.index_array_structure` + property. +- `array_map_dependent_axis(m)` is now the `ArrayMap.dependent_axis` property, + alongside a new `ArrayMap.dependency_axes` giving every axis a map varies over. + +`zarr_indexing.affine` is now the private `zarr_indexing._affine`; it was +never exported or documented. diff --git a/packages/zarr-indexing/changes/4222.removal.3.md b/packages/zarr-indexing/changes/4222.removal.3.md new file mode 100644 index 0000000000..d5210f4c8d --- /dev/null +++ b/packages/zarr-indexing/changes/4222.removal.3.md @@ -0,0 +1,6 @@ +`with_parts` is now three named methods — `with_parts`, `with_parts_per_axis` +and `unpartitioned` — instead of one parameter whose meaning was decided by the +type of what it was given. `Partition.array` is `Partition.view`, no longer the +inverse of `LazyArray.array`. `ArrayMap`, `IndexTransform` and `Partition` can +be compared and hashed, which `frozen=True` had implied and neither could do. +`LazyArray.base_shape` says which shape a partitioning is expressed in. diff --git a/packages/zarr-indexing/changes/4222.removal.md b/packages/zarr-indexing/changes/4222.removal.md new file mode 100644 index 0000000000..5782c9ab4d --- /dev/null +++ b/packages/zarr-indexing/changes/4222.removal.md @@ -0,0 +1,11 @@ +`ArrayMap` no longer has an `input_dimension` field: what a map depends on is +read from its full-rank index array's shape (its non-singleton axes), the +single source of truth. A selection narrowed to a single coordinate is now +built as the `ConstantMap` it equals (`array_map_or_constant`), so a length-1 +fancy selection classifies as a box; hand-built all-singleton or shared-axis +`ArrayMap`s resolve through the pointwise path. The wire format is unaffected — +it never carried the field. + +The provisional tuple resolver and selector bridge are gone with it: +`iter_chunk_transforms` and `sub_transform_to_selections` are removed, their +role taken by `plan_chunks` and the paired projections it returns. diff --git a/packages/zarr-indexing/docs/api/boundary.md b/packages/zarr-indexing/docs/api/boundary.md new file mode 100644 index 0000000000..4f9fa99531 --- /dev/null +++ b/packages/zarr-indexing/docs/api/boundary.md @@ -0,0 +1,5 @@ +--- +title: boundary +--- + +::: zarr_indexing.boundary diff --git a/packages/zarr-indexing/docs/api/composition.md b/packages/zarr-indexing/docs/api/composition.md deleted file mode 100644 index 59affe016c..0000000000 --- a/packages/zarr-indexing/docs/api/composition.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: composition ---- - -::: zarr_indexing.composition diff --git a/packages/zarr-indexing/docs/api/grid.md b/packages/zarr-indexing/docs/api/grid.md index c4c9cadb4f..b7c376eb85 100644 --- a/packages/zarr-indexing/docs/api/grid.md +++ b/packages/zarr-indexing/docs/api/grid.md @@ -2,4 +2,21 @@ title: grid --- +`zarr_indexing.grid` owns compact chunk-grid metadata so indexing plans can be +constructed without importing Zarr. `FixedDimension(size, extent)` represents +regular chunks in constant memory, including a clipped final data region; +`VaryingDimension(edges, extent)` represents explicit rectilinear chunk edges. +`ChunkGrid(dimensions=...)` combines these dimensions and returns `ChunkSpec` +objects whose `shape` is the valid data size and whose `codec_shape` preserves +the full codec-buffer size at a regular-grid boundary. + +`dimension_grids_from_chunks` returns these compact dimensions: integer chunk +shapes become `FixedDimension` instances and explicit per-axis edge sequences +become `VaryingDimension` instances. `DimensionGridLike` remains the narrow +protocol used by the chunk planner, while `EdgeDimensionGrid` is kept for +explicit edge-based and coordinate-origin examples. + +Zarr's array implementation can later import these compact grid types from +`zarr_indexing`; this package intentionally has no import dependency on Zarr. + ::: zarr_indexing.grid diff --git a/packages/zarr-indexing/docs/api/index.md b/packages/zarr-indexing/docs/api/index.md index b9a58b70fa..674c701a0f 100644 --- a/packages/zarr-indexing/docs/api/index.md +++ b/packages/zarr-indexing/docs/api/index.md @@ -4,6 +4,19 @@ title: API reference # API reference +Choose the guide stopping point that matches your job before following module +links: + +- **Use lazy indexing:** finish + [Lazy views compose](../guide/index.md#lazy-views-compose), + then open [`zarr_indexing.lazy_array`](lazy_array.md) for `LazyArray`. +- **Integrate a chunked source:** finish + [One cell domain, two projections](../guide/index.md#one-cell-domain-two-projections), + then open [`zarr_indexing.chunk_resolution`](chunk_resolution.md) for + `plan_chunks`. Start with + [Coordinates are addresses](../guide/index.md#coordinates-are-addresses) if + literal coordinates are unfamiliar. + The modules are layered: the transform algebra at the bottom, chunk resolution and the wire format built on top of it. @@ -17,18 +30,33 @@ and the wire format built on top of it. - [`zarr_indexing.transform`](transform.md) — `IndexTransform`, which pairs a domain with output maps, plus the indexing (`[...]`, `.oindex`, `.vindex`), `intersect`, and `translate` operations, and `selection_to_transform` -- [`zarr_indexing.composition`](composition.md) — `compose`, which chains two transforms into one **Chunk resolution** - [`zarr_indexing.chunk_resolution`](chunk_resolution.md) — - `iter_chunk_transforms` (transform + chunk grid → per-chunk transforms) and - `sub_transform_to_selections` (the bridge back to the selection tuples the - current codec pipeline expects) + `plan_chunks`, which lazily projects a request through a caller-selected grid, + plus the reusable `ChunkPlan` and paired-transform `ChunkProjection` values - [`zarr_indexing.grid`](grid.md) — `DimensionGridLike`, the Protocol describing the narrow chunk-grid surface chunk resolution consumes, so that - nothing here imports `zarr` + nothing here imports `zarr`, plus `EdgeDimensionGrid` and + `dimension_grids_from_chunks`, a concrete per-axis grid for callers with no + zarr grid to hand + +**Lazy arrays** + +- [`zarr_indexing.lazy_array`](lazy_array.md) — `LazyArray`, a wrapper for + system-memory/basic-indexing sources that adds a `.lazy` accessor for + TensorStore-style deferred indexing, plus `Partition` and `parts()` / + `with_parts()`, which determine the boxes a read is broken into. Device + sources require an explicit custom reader that transfers into the supplied + system-memory output +- [`zarr_indexing.reader`](reader.md) — `Reader`, the backend execution boundary + that obtains the values described by a complete transform; `basic_reader` + serves conservative duck arrays and `numpy_reader` is selected explicitly by + `LazyArray.from_numpy` +- [`zarr_indexing.boundary`](boundary.md) — the translation between NumPy's + positional dialect and the transform algebra's literal coordinates **The ndsel wire format** (see [the guide](../ndsel.md)) @@ -39,9 +67,21 @@ and the wire format built on top of it. **Errors** -- [`zarr_indexing.errors`](errors.md) — the canonical index-error types, which - `zarr.errors` re-exports by identity +- [`zarr_indexing.errors`](errors.md) — the index-error types this package + raises, also exported at the top level. `zarr.errors` defines classes of the + same names, which are different objects; both subclass `IndexError` + +**Test support** (needs the `testing` extra) + +- [`zarr_indexing.testing.stateful`](testing_stateful.md) — + `ChainedIndexingStateMachine`, a Hypothesis state machine that composes + indexing steps onto a `LazyArray` wrapping your array and checks every step + against NumPy, plus `apply_selection`, the NumPy model it checks against +- [`zarr_indexing.testing.strategies`](testing_strategies.md) — the selection + strategies the machine draws from, for a project that has its own harness Every name listed in `zarr_indexing.__all__` is re-exported at the top level, so `from zarr_indexing import IndexTransform` and `from zarr_indexing.transform import IndexTransform` are equivalent. +`zarr_indexing.testing` is deliberately not among them: it imports +`hypothesis`, which the rest of the package does not. diff --git a/packages/zarr-indexing/docs/api/lazy_array.md b/packages/zarr-indexing/docs/api/lazy_array.md new file mode 100644 index 0000000000..f855511d46 --- /dev/null +++ b/packages/zarr-indexing/docs/api/lazy_array.md @@ -0,0 +1,27 @@ +--- +title: lazy_array +--- + +`LazyArray.lazy[...]` is metadata-only: every derived view keeps the same +reader and composes its transform without reading data. `result()` allocates +owned system memory, then calls that reader once for each projected part. +Rectangular parts write directly into their final slices; advanced placement +may first use an owned dense temporary. `LazyArray(source)` assumes only basic +indexing, while `LazyArray.from_numpy(array)` explicitly selects NumPy's +optimized reader. + +The built-in readers lower through NumPy system memory and support sources +whose basic reads can be converted there. They do not implicitly transfer +device arrays; a device source needs an explicit custom reader that transfers +into the supplied system-memory output. Derived views and parts share their +reader and part views may be materialized concurrently, so stateful readers +must synchronize their own mutable state. + +Every public `Partition.view.transform` directly maps that view's zero-origin +coordinates into its raw `Partition.view.array`, including for non-first +partitions. `Partition.projection.chunk_transform` intentionally stays local to +the selected chunk. During materialization the reader receives both frames in +one `ReadContext`: the public global transform in `context.transform` and the +same local plan in `context.projection`. + +::: zarr_indexing.lazy_array diff --git a/packages/zarr-indexing/docs/api/reader.md b/packages/zarr-indexing/docs/api/reader.md new file mode 100644 index 0000000000..39129c4d47 --- /dev/null +++ b/packages/zarr-indexing/docs/api/reader.md @@ -0,0 +1,51 @@ +--- +title: Readers +--- + +# Readers + +An `IndexTransform` defines which source value belongs at every result +position. A `Reader` defines how a particular backend obtains those values. +Readers do not define indexing semantics, partitioning, scheduling, or result +ownership. + +`Reader.read_into(source, context, out)` receives a `ReadContext` whose +`transform` maps zero-origin output-buffer coordinates to global coordinates in +`source`, with `context.transform.domain.shape == out.shape`. Its optional +`projection` is the existing plan for a partitioned read. The projection's +`chunk_transform` remains chunk-local, its `cell_transform` describes result +placement, and its `chunk_domain` describes the grid cell. The global read +transform and the projection's chunk transform deliberately use different +coordinate frames. + +An implementation must fill every cell of `out` in place, preserve the global +transform's exact values, order, and dtype, and return `None`. It must neither +replace nor retain `out`, which may be a strided writable view. Backend +exceptions propagate unchanged. Derived part views share their reader and may +be resolved concurrently, so a stateful reader owns its own synchronization. + +Reader wrappers compose by intercepting this one operation and forwarding the +same source, context, and output buffer to an inner reader: + +```python +class RecordingReader: + def __init__(self, inner): + self.inner = inner + self.calls = [] + + def read_into(self, source, context, out, /): + self.calls.append((source, context, out)) + self.inner.read_into(source, context, out) + + +inner = RecordingReader(numpy_reader) +outer = RecordingReader(inner) +view = LazyArray.from_numpy(array).with_reader(outer) +values = view.result() +``` + +Both wrappers observe the same three objects, in outer-to-inner order. This +delegation pattern supports policies such as logging and caching without +library-defined wrapper primitives. + +::: zarr_indexing.reader diff --git a/packages/zarr-indexing/docs/api/testing_stateful.md b/packages/zarr-indexing/docs/api/testing_stateful.md new file mode 100644 index 0000000000..0aeb57df29 --- /dev/null +++ b/packages/zarr-indexing/docs/api/testing_stateful.md @@ -0,0 +1,5 @@ +--- +title: testing.stateful +--- + +::: zarr_indexing.testing.stateful diff --git a/packages/zarr-indexing/docs/api/testing_strategies.md b/packages/zarr-indexing/docs/api/testing_strategies.md new file mode 100644 index 0000000000..1dd7d59457 --- /dev/null +++ b/packages/zarr-indexing/docs/api/testing_strategies.md @@ -0,0 +1,5 @@ +--- +title: testing.strategies +--- + +::: zarr_indexing.testing.strategies diff --git a/packages/zarr-indexing/docs/api/transform.md b/packages/zarr-indexing/docs/api/transform.md index bd754f5ec5..8e67a162c1 100644 --- a/packages/zarr-indexing/docs/api/transform.md +++ b/packages/zarr-indexing/docs/api/transform.md @@ -2,4 +2,17 @@ title: transform --- +An `IndexTransform` is a function between coordinate spaces, and its field +names follow the function, not the data: + +| the API says | in array terms | +| --- | --- | +| input space (`domain`, `input_rank`) | request coordinates — the result being built | +| output space (`output`, one map per dimension) | source coordinates — where values are read | + +`output` is not data: it is the rule, per source dimension, for producing +coordinates. Values flow source → request, against the arrow. The +[guide](../guide/index.md#a-transform-points-from-the-request-to-the-source) +demonstrates each output map form against its NumPy counterpart. + ::: zarr_indexing.transform diff --git a/packages/zarr-indexing/docs/design-notes.md b/packages/zarr-indexing/docs/design-notes.md new file mode 100644 index 0000000000..78b352d376 --- /dev/null +++ b/packages/zarr-indexing/docs/design-notes.md @@ -0,0 +1,296 @@ +--- +title: Design notes +--- + +# Design notes + +This page records advanced rationale that the API does not state directly: how +this library relates to TensorStore, why rectangular selections are a category +rather than a fast path, and what is deliberately not implemented yet. The +visual guide owns the mechanics of +[literal coordinates](guide/index.md#coordinates-are-addresses), +[view composition](guide/index.md#lazy-views-compose), +[chunk plans](guide/index.md#a-request-becomes-a-chunk-plan), and +[their paired projections](guide/index.md#one-cell-domain-two-projections). + +## Relationship to TensorStore + +The core is [TensorStore's](https://google.github.io/tensorstore/index_space.html) +index-transform model, reimplemented in Python against NumPy. The visual guide +introduces the shared model in +[Coordinates are addresses](guide/index.md#coordinates-are-addresses) and +[Lazy views compose](guide/index.md#lazy-views-compose); the comparison here is +about the deliberately matching semantics: + +- **The model.** Both use an `IndexTransform` made of an input domain and one + output index map per storage dimension, in constant, affine, and index-array + forms. +- **Slice semantics.** Slice bounds are literal domain coordinates: no + clamping, no negative wrapping, non-empty intervals must be contained in the + domain, and a strided slice's domain origin is `trunc(start/step)` rounded + toward zero. Every one of those rules was executed against tensorstore 0.1.84 + and is pinned in `tests/test_tensorstore_parity.py`. +- **The wire format.** A canonical [ndsel](ndsel.md) transform body is, + field-for-field, a TensorStore `IndexTransform` minus the `kind` + discriminator, and `tests/test_ndsel_tensorstore.py` loads our bodies into + `tensorstore.IndexTransform(json=...)` and round-trips them back through our + engine layer. + +The representations differ in one place: index arrays. Both models want an index +array at the transform's full input rank, with singleton axes for the dimensions +a map does not vary over. TensorStore enforces it — its JSON parser rejects a +rank-1 array over a rank-2 domain outright, with `Index array for output +dimension 0 has rank 1 but must have rank 2` (checked against tensorstore +0.1.84) — while our loader is the more permissive of the two and also accepts a +lower-rank array that broadcasts against the input domain. That is a +compatibility affordance, not a difference in the model: ndsel leaves index-array +rank to [the engine layer](ndsel.md#lowering-to-a-transform), and everything the +algebra builds itself is at full rank. + +The reason full rank matters here is that we *derive* meaning from those +singletons rather than merely tolerating them: an array full-sized on one axis +and singleton elsewhere is orthogonal, and one varying over several shared axes +is vectorized, so the distinction is readable off the shape — and the shape is +the *only* place it lives. An earlier `ArrayMap.input_dimension` field pinned +the orthogonal axis redundantly and was retired: the one shape it disambiguated +(a single-coordinate array, all axes singleton) is now normalized away at +construction, collapsed to the `ConstantMap` it equals, exactly as +[the serializer](api/json.md) has always collapsed it on the wire. + +Four deliberate differences: + +| | TensorStore | `zarr-indexing` | +| --- | --- | --- | +| Dialect | One strict dialect everywhere: literal coordinates, no negative wrapping | The algebra keeps that dialect; each public boundary picks its own. [`LazyArray`](api/lazy_array.md) speaks positional NumPy, `zarr.Array.lazy` speaks literal. [`zarr_indexing.boundary`](api/boundary.md) is the translation | +| Scheduling | An internal C++ scheduler owns concurrency and chunk ordering | [`parts()`](api/lazy_array.md) exposes the partition structure so the caller's own scheduler — dask, a thread pool, a task queue — drives it | +| Wire format | Implementation-defined JSON, specified by what the implementation accepts | [ndsel](ndsel.md) is spec-first, with a vendored language-agnostic conformance corpus every implementation runs | +| Backends | A driver ecosystem (zarr, N5, neuroglancer, GCS, …) built into the library | No drivers. The default reader needs `shape`, `dtype`, basic integer/slice indexing, and selected slabs convertible to NumPy system memory; other backends use explicit custom readers. A device reader owns transfer into the supplied system-memory output | + +The mechanics of a +[chunk plan](guide/index.md#a-request-becomes-a-chunk-plan) and its +[paired projections](guide/index.md#one-cell-domain-two-projections) belong to +the visual guide. +The relevant comparison is that both libraries use the paired-transform +boundary rather than a read key plus scatter indices, so slices, outer products, +and correlated gathers remain ordinary transforms that a consumer can lower to +its own execution vocabulary. + +The ownership boundary differs. `plan_chunks` retains only the logical request +and caller-supplied grid; it does not own reads, writes, buffers, locks, or +scheduling. Zarr can therefore plan reads against an inner codec-chunk grid and +writes against an atomic shard grid; napari or dask can turn the same +projections into tasks without putting a dask dependency in this package. +`coverage` is relative to that selected grid: `full` proves a blind replacement +safe, `partial` proves it is not, and `unknown` conservatively covers fancy +selections whose duplicates would require additional work to classify. + +The comparison also runs the other way. TensorStore is a mature, heavily +optimized C++ system whose performance this library cannot approach: resolution +here is Python-level bookkeeping over NumPy, and the per-part overhead is +significant. This library is small and depends on nothing beyond NumPy, so the +algebra can be adopted by a Python project that wants the model without the C++ +runtime. + +## Bounding-box selections vs query selections + +Every selection this library can express falls into exactly one of two +categories. The boundary between them is structural, not a heuristic: + +**A box** is a transform whose output maps are all `ConstantMap` or +`DimensionMap` — no `ArrayMap`. Such a map is affine and monotone: storage +coordinate `offset + stride * i` for `i` running over an interval. The whole +selection is therefore described by `O(ndim)` integers — an interval and a +stride per dimension — composition and intersection are interval arithmetic, +and the coordinates it touches form a regular lattice. Basic indexing produces +one, and composing basic indexing with basic indexing keeps one. + +**A query** is a transform with at least one `ArrayMap` — an explicit lookup +table of coordinates. It costs `O(n)` to store, it has no locality (the +coordinates may repeat, reverse, or scatter arbitrarily), and intersecting it +with a region means scanning it. `oindex`, `vindex`, and boolean masks all +produce one, and once an axis is a query, subsequent basic indexing cannot make +it a box again. A second query composes onto any axis of an existing one — +including the axes it merely broadcasts along — by evaluating the existing +lookup tables at the new coordinates. + +Those coordinate arrays are ordered sequences, never mathematical sets. Their +order and duplicate entries are part of the indexing semantics and must survive +planning and materialization. + +[ndsel](ndsel.md) encodes the same split in its message kinds: `point`, `box`, +and `slice` desugar to constant and affine output maps and are always boxes; +`points` desugars to `index_array` maps, and a `transform` body is a box +exactly when none of its output maps carries an `index_array`. A consumer can +therefore classify a selection off the wire without materializing anything: + +```python +from zarr_indexing import IndexTransform + +IndexTransform.from_shape((100, 80))[10:50, ::4].to_json()["output"] +# [{'offset': 0, 'stride': 1, 'input_dimension': 0}, +# {'offset': 0, 'stride': 4, 'input_dimension': 1}] + +import numpy as np +gather = IndexTransform.from_shape((100, 80)).oindex[np.array([90, 3, 3]), slice(None)] +gather.to_json()["output"][0] +# {'offset': 0, 'stride': 1, 'index_array': [[90], [3], [3]], +# 'index_array_bounds': ['-inf', '+inf']} +``` + +The distinction matters to consumers of a selection. A box can be tiled into +rectangular dask chunks or passed to a viewer or tile server that only accepts +rectangles; a query cannot, and has to be resolved into a gather. A box can also +be served as a single strided slab read, but the read has to be strided: reading +its bounding box and discarding the rest transfers proportionally more data as +soon as any stride exceeds 1. The two also behave differently under +partitioning: a box touches a regularly-spaced run of parts, in increasing +order, each at most once — a stride larger than a part's extent skips parts +outright, so the run is not contiguous — while a query can touch any subset of +them, in any order, more than once. + +[`LazyArray`](api/lazy_array.md) exposes the category directly: + +```python +import numpy as np +import zarr + +from zarr_indexing import LazyArray + +arr = zarr.create_array({}, shape=(100, 80), chunks=(30, 40), dtype="int32") +arr[:] = np.arange(8000).reshape(100, 80) +lazy = LazyArray(arr) + +slab = lazy.lazy[10:50, ::4] +slab.is_box # True +slab.bounding_box() # ((10, 50), (0, 77)) +slab.strides() # (1, 4) +slab.shape # (40, 20) + +gather = lazy.lazy.oindex[[90, 3, 3], :] +gather.is_box # False +gather.bounding_box() # ((3, 91), (0, 80)) +gather.strides() # None +gather.shape # (3, 80) +``` + +`bounding_box()` is defined for both: it is the hull, the smallest interval per +storage dimension containing every coordinate the selection reaches. +`strides()` is defined only for a box and gives the step per dimension. +Together the two describe a box selection completely. + +Both are needed, because a box is dense in its hull only when every stride is +1. The slab above spans a 40x77 hull over the 40x20 cells it selects, so a +consumer that issued one rectangular read of the hull and discarded the rest +would transfer 3.85x the data. A query's hull is looser still and carries no +stride at all: 88 rows of hull over three selected rows. An empty *box* touches +no coordinate to report an interval around, so `bounding_box()` is `None` while +`strides()` still answers — the step is a property of the selection's shape, not +of the region it reaches. Only a query returns `None` from both. + +There is deliberately no separate `BoxView` type today. A statically-typed +rectangular-only view is a plausible next step, but it should be introduced by +a consumer that needs the guarantee in its signatures rather than +speculatively; `is_box` is the runtime check until then. + +## Negative-origin domains and prependable grids + +Literal coordinates let a domain grow at its lower end without changing the +identity of anything already present. Prepending three cells extends `[0, 6)` +to `[-3, 6)`: the new cells receive addresses `-3`, `-2`, and `-1`, while the +old cells keep addresses `0` through `5`. Coordinate `0` does not become +coordinate `3`. + +The adjacent intervals `[-3, 0)`, `[0, 3)`, and `[3, 6)` follow the half-open +adjacency rule: each stopping boundary is included exactly once as the next +interval's starting boundary. + +```text +before [0, 6): + + | 0 1 2 | 3 4 5 | +chunk coordinate | 0 | 1 | + +after [-3, 6): + +| -3 -2 -1 | 0 1 2 | 3 4 5 | +| -1 | 0 | 1 | chunk coordinate +``` + +The same holds for chunk grids. `EdgeDimensionGrid` is the convenient +concrete grid for a zero-origin array: its chunk offsets are prefix sums +starting at zero. `DimensionGridLike` is the more general protocol consumed +by chunk planning, so it admits grids with negative chunk and cell +coordinates, including this prependable example: + +```python +--8<-- "snippets/coordinate_origins.py:prepend-grid" +``` + +Here the literal cell domain `[-3, 0)` belongs to chunk `-1`. Both public +projection transforms share the same synthetic input cell domain `[0, 3)`. +Evaluating its three points shows the two distinct outputs: +`chunk_transform` produces zero-origin chunk-local coordinates `0, 1, 2`, +while `cell_transform` produces the literal request coordinates `-3, -2, -1`. +The shared input domain is not itself the chunk-local coordinate frame. + +## Related work + +TensorStore is the prior art for the transform algebra, as described above. At +the execution boundary, this package instead gives each backend a `ReadContext` +through a `Reader`. Its global transform answers **which values?**; the reader +answers **how does this backend obtain them?** A partition view's transform +directly addresses the raw source in global coordinates. Its optional +projection retains the paired planning transforms, of which only +`chunk_transform` addresses zero-origin chunk-local coordinates. The reader +must preserve the global transform exactly, but it does not participate in +indexing semantics, partitioning, scheduling, or result ownership. + +Earlier versions used a capability taxonomy modeled on historical indexing +dialects. That model required deciding which fragment of a request a backend +could accept and finishing the rest elsewhere. A reader lowers the complete +transform and can compose through delegation instead. This resembles +[zarrita.js store extensions](https://zarrita.dev/packages/zarrita.html), where +storage-specific behavior is an explicit extension point rather than an +inferred array capability. The implementation remains independently authored: +no code is shared with TensorStore, xarray, or zarrita.js. + +## Current scope + +Negative steps are supported as of ndsel 1.0-draft.2: `a[::-1]` reverses, one +desugaring rule covers both signs, and a reversed interval is an error rather +than a silently empty selection. One consequence: a negative step normally +produces a negative domain origin. Reversing a length-20 zero-origin axis gives +the domain `[-19, 1)`, because the result stays anchored to the source +coordinate frame and a reversing map traverses that frame backwards. `LazyArray` +re-bases every view to origin 0, so the positional dialect never exposes it; a +caller working with `IndexTransform` directly will see it, and re-bases +explicitly with `translate_domain_to` for NumPy-shaped coordinates. + +Fancy selections compose without restriction: a second `oindex`/`vindex`/mask +step may land on any axis of an already-fancy view, including axes an existing +index array merely broadcasts along, so +`lazy.oindex[[2, 0], :].lazy.oindex[:, [1, 3]]` selects the outer product it +spells. An array-carrying transform is composed — the new selection is applied +to an identity transform over the current domain and chained on with `compose`, +which evaluates the existing lookup tables at the new coordinates — rather than +rewritten in place. Resolution classifies the result by structure +(`index_array_structure`): pure per-axis outer products keep the orthogonal +resolvers, and everything else — correlated maps, mixtures, index arrays +sharing an input axis (a diagonal gather, reachable only by hand-building a +transform) — takes the pointwise path that collapses the joint block. + +Three limits remain, all intentional and all expected to be lifted: + +- **Affine diagonals.** A hand-built transform in which an *index array* and a + *slice map* bind the same input dimension, or two slice maps share one, is + rejected at resolution with `NotImplementedError`. No selection dialect + produces one; supporting them means lowering the slice maps into the joint + block too. *Planned.* +- **Finite explicit bounds only.** `IndexDomain` has no implicit or unbounded + dimensions; the message layer will normalize a body with `"-inf"`/`"+inf"` + bounds, but the engine layer refuses to lower one into a transform. + TensorStore supports both. *Planned.* +- **Labels are carried, not propagated.** `IndexDomain` holds optional + dimension labels and the wire format round-trips them, but indexing + operations build new domains without them, so a label does not survive a + slice. *Planned.* diff --git a/packages/zarr-indexing/docs/examples/lazy_indexing_dask.md b/packages/zarr-indexing/docs/examples/lazy_indexing_dask.md new file mode 100644 index 0000000000..5c722fe355 --- /dev/null +++ b/packages/zarr-indexing/docs/examples/lazy_indexing_dask.md @@ -0,0 +1,7 @@ +--8<-- "lazy_indexing_dask/README.md" + +## Source Code + +```python +--8<-- "lazy_indexing_dask/lazy_indexing_dask.py" +``` diff --git a/packages/zarr-indexing/docs/examples/lazy_indexing_numpy.md b/packages/zarr-indexing/docs/examples/lazy_indexing_numpy.md new file mode 100644 index 0000000000..8a09ce4d01 --- /dev/null +++ b/packages/zarr-indexing/docs/examples/lazy_indexing_numpy.md @@ -0,0 +1,15 @@ +--8<-- "lazy_indexing_numpy/README.md" + +`LazyArray(source)` uses the conservative built-in reader: `source` must expose +`shape`, `dtype`, and basic integer/slice indexing, and every selected slab must +be convertible to NumPy system memory. Coordinate arrays passed through +`oindex` or `vindex` are ordered and duplicate-preserving; they are not sets. +When a view is partitioned, each `Partition.view.transform` addresses the raw +source globally while `Partition.projection.chunk_transform` stays +zero-origin and chunk-local. + +## Source Code + +```python +--8<-- "lazy_indexing_numpy/lazy_indexing_numpy.py" +``` diff --git a/packages/zarr-indexing/docs/examples/system_memory_chunk_cache.md b/packages/zarr-indexing/docs/examples/system_memory_chunk_cache.md new file mode 100644 index 0000000000..e4d92ba2b6 --- /dev/null +++ b/packages/zarr-indexing/docs/examples/system_memory_chunk_cache.md @@ -0,0 +1,11 @@ +--8<-- "system_memory_chunk_cache/README.md" + +`LazyArray` owns the indexing-derived result shape and assembly, while the +example's `SystemMemoryChunkReader` owns synchronous system-memory cache state +and chunk reads for each materialized part. + +## Source Code + +```python +--8<-- "system_memory_chunk_cache/system_memory_chunk_cache.py" +``` diff --git a/packages/zarr-indexing/docs/guide/index.md b/packages/zarr-indexing/docs/guide/index.md new file mode 100644 index 0000000000..780cfd7e56 --- /dev/null +++ b/packages/zarr-indexing/docs/guide/index.md @@ -0,0 +1,444 @@ +# Visual guide + +The whole model in one sentence: indexing through `LazyArray.lazy` builds a +view, chunk planning partitions its coordinates, and `result()` materializes +the view. This page follows one familiar NumPy selection, `source[2:5]`, +through those stages. + +The first four sections are for anyone indexing arrays: coordinates, +transforms, composition, and result axes. **If you are using lazy indexing +rather than building a storage backend, you can stop after section four.** +The last two sections are for integrators: they turn a request into a chunk +plan and pair each chunk read with its place in the result. + +Throughout, one division of labor holds: the transform answers **which +values?** and is independent of the backend; the reader answers **how do I +obtain them?** and must preserve the transform exactly. + +## An index selects coordinates {#an-index-selects-coordinates} + +Begin with an ordinary NumPy array. `source` contains the values 10 through 15. +The selection `source[2:5]` takes source coordinates 2, 3, and 4, containing +the values 12, 13, and 14. + +```text +source coordinate | 0 1 2 3 4 5 +source value | 10 11 12 13 14 15 +selection | [12 13 14] + source[2:5] + +result coordinate | 0 1 2 +source coordinate | 2 3 4 +result value | 12 13 14 +``` + +The result defines its own coordinates: `0`, `1`, and `2`. The aligned rows +make the correspondence explicit: those result coordinates receive values +`12`, `13`, and `14` from source coordinates `2`, `3`, and `4`. + +The wrapper below gives the same familiar selection a lazy spelling. Indexing +through `.lazy` creates `view`; the last line asks for its values and checks the +observable NumPy result. + +```python +--8<-- "snippets/canonical_slice.py:canonical-slice" +``` + +The important first step is simply that an index describes which source values +fill a result in a particular order. The next section gives the numbers on both +sides of that description a precise meaning. + +## Coordinates are addresses {#coordinates-are-addresses} + +### How to read a half-open interval + +`[0, 1)` is a **half-open interval**: start at 0, inclusive, and stop at 1, exclusive. +The `[` includes the lower boundary, while the `)` excludes the upper boundary. +For integer coordinates, `[0, 1)` therefore enumerates the ordered sequence +`[0]`. + +Half-openness lets adjacent slices and chunks meet without a gap or overlap. +Concatenation is ordered: the first interval is followed by the second. When +the first interval's exclusive stop matches the second interval's inclusive +start, the shared boundary coordinate appears exactly once. + +- `[0, 1) -> [0]` — Start at 0 and stop before 1, so the sequence contains only 0. +- `[1, 3) -> [1, 2]` — Start at 1 and stop before 3, so the sequence contains 1 and 2. +- `concat([0, 1), [1, 3)) = [0, 3)` — Append the second interval after the + first. Their matching exclusive/inclusive boundary produces one continuous + interval without a gap or duplicated coordinate. + +Explicit coordinates, including coordinate arrays, are always ordered +sequences rather than mathematical sets. Their order is semantic, and repeated +coordinates remain repeated in the result. + +In the transform algebra, **coordinates are just integers**. A negative +coordinate is a real address in a domain, with the same status as zero or a +positive coordinate; it is not automatically shorthand for counting backward +from an array's end. + +```text +domain [-2, 3) + +coordinate | -2 -1 0 1 2 +status | address address address address address +``` + +`IndexDomain` makes those bounds explicit. In the example below, narrowing the +domain at `-1` selects the literal address `-1`; the wrapper at the end treats +`-1` the way NumPy does — as the last position. + +```python +--8<-- "snippets/coordinate_origins.py:coordinate-origin" +``` + +Why carry literal coordinates at all? They let independently described +regions keep stable addresses — a domain can even grow at its lower end +without renumbering what is already there. The [design +notes](../design-notes.md#negative-origin-domains-and-prependable-grids) work +through that prepending example; nothing else in this guide depends on it. + +The literal model and NumPy's positional model are both useful, but they answer +different questions: + +| Surface | Meaning of an integer index | Meaning of `-1` | +| --- | --- | --- | +| `IndexDomain` and `IndexTransform` | A literal coordinate in the current domain | The actual address `-1`, if the domain contains it | +| `LazyArray.lazy` | A NumPy-style position in the current view | The last position, normalized before it reaches the transform algebra | + +`LazyArray` uses positions because it is an array-like wrapper: each derived +view starts at position zero and negative indices wrap exactly as they do in +NumPy. The lower-level domain and transform types keep literal coordinates. + +### A transform points from the request to the source + +An `IndexTransform` records how every coordinate in a request finds its source +coordinate. For the slice from the first section, request coordinate `i` maps +to source coordinate `i + 2`. This direction is deliberate: request to source, +not source to request. + +```text +request coordinate | 0 1 2 + | | | | + i + 2 | v v v +source coordinate | 2 3 4 +source value | 12 13 14 +``` + +A transform speaks function vocabulary while this guide speaks array +vocabulary. The two line up like this: + +| the API says | this guide says | +| --- | --- | +| input space (`domain`, `input_rank`) | request coordinates — the result being built | +| output space (`output`, one map per dimension) | source coordinates — where values are read | + +`output` names the output side of the coordinate *function*, not the data: +values flow source → request, against the arrow. The neutral names exist +because transforms compose — in a chain, an interior transform's output space +is just the next transform's input space, neither a request nor a source. + +### The three map kinds, in NumPy terms + +Every output dimension is produced by one of three map forms. Each has a +NumPy counterpart, shown executably below. The examples share one helper — +and it doubles as the answer to how a bare transform meets data at all: a +reader materializes it into a buffer. + +```python +--8<-- "snippets/output_maps.py:resolve-helper" +``` + +`DimensionMap` is an arithmetic rule — the slice above is one, mapping +request `i` to source coordinate `i + 2`: + +```python +--8<-- "snippets/output_maps.py:dimension-map" +``` + +`ArrayMap` stores explicit source coordinates for irregular or fancy +indexing; order and repeats survive into the result: + +```python +--8<-- "snippets/output_maps.py:array-map" +``` + +`ConstantMap` fixes one source coordinate for every request cell. Whether an +axis appears in the result is decided by the **domain**, never by the map: +`image[2, :]` compiles to a `ConstantMap(2)` with no corresponding domain +axis (the axis is dropped), while pairing a constant map with a length-`n` +domain axis that no map consumes yields `n` cells all reading one +coordinate — a broadcast, the one arrangement with no NumPy index +counterpart: + +```python +--8<-- "snippets/output_maps.py:constant-map" +``` + +Together, the request domain and these per-source-dimension maps are the +complete reusable description of an index. + +## Lazy views compose {#lazy-views-compose} + +A lazy view can be indexed again. Each step changes the request-to-source +description, but it does not read an intermediate array. The chain is reduced +to one direct transform from the newest request to the original source. + +```text +source[2:5][::-1][1:] + +new request | intermediate view | original source +------------+-------------------+---------------- + 0 | 1 | 3 + 1 | 2 | 2 + +direct map: request i -> source (3 - i) +``` + +The executable example first selects `source[2:5]`, then reverses that view +and trims its first element: + +```python +--8<-- "snippets/lazy_composition.py:lazy-composition" +``` + +Immediately after `composed` is created—and before the final `result()` call—its +metadata is ready to inspect: + +| Available without reading | Value in this example | +| --- | --- | +| `composed.shape` | `(2,)` | +| `composed.transform` | One transform mapping request `i` to source `3 - i` | + +Neither property needs source values. Composition works only on the coordinate +description; the assertion's call to `result()` is the first operation in the +example that materializes the selected data. + +!!! warning "Stop here: the materialization boundary" + Indexing through `.lazy[...]` never reads. These do: + + - `result()` + - eager indexing of the wrapper: `view[...]` + - `numpy.asarray(view)`, or passing the view to any NumPy function + (`numpy.add(view, 1)` converts, and therefore materializes, the view) + + Python arithmetic such as `view + 1` raises `TypeError` instead: this + wrapper defers indexing, not a general compute graph. + + Nor does it write. There is no `__setitem__`, so `view[...] = values` + raises `TypeError` too, and a wrapped source needs no `__setitem__` of + its own. A consumer that writes plans the selection with `plan_chunks` + and performs its own read-modify-write, keeping chunk atomicity and + concurrent-writer policy on the backend's side of the boundary. + +## An index defines a result array {#an-index-defines-a-result-array} + +An index chooses source points and also defines how those points are arranged in +the result. In the 3-by-4 image below, `image[1, :]` and `image[1:2, :]` choose +the same four source points: values `4`, `5`, `6`, and `7`. + +```text +same selected source cells + +source coordinate | (1, 0) (1, 1) (1, 2) (1, 3) +value | 4 5 6 7 + +image[1, :] + +result coordinate | 0 1 2 3 +value | 4 5 6 7 +shape | (4,); source axis 0 is omitted + +image[1:2, :] + +result coordinate | (0, 0) (0, 1) (0, 2) (0, 3) +value | 4 5 6 7 +shape | (1, 4); source axis 0 is retained with length 1 +``` + +The integer in `image[1, :]` fixes source axis 0. No result coordinate varies +along that axis, so it is omitted and the result shape is `(4,)`. The slice in +`image[1:2, :]` preserves source axis 0 as a length-one result axis, so the +result shape is `(1, 4)`. + +```python +--8<-- "snippets/axis_manipulation.py:axis-shape-comparison" +``` + +`None` inserts a new length-one axis without selecting different source points. +Here it produces the shape `(4, 1)`: + +```python +--8<-- "snippets/axis_manipulation.py:axis-insertion" +``` + +## A request becomes a chunk plan {#a-request-becomes-a-chunk-plan} + +Continue with the 3-by-4 image and `image[1, :]` introduced above. Giving the +image a 2-by-2 chunk shape does not change the four selected values or their +order. It changes only how the work is divided: columns 0 and 1 come from chunk +`(0, 0)`, while columns 2 and 3 come from chunk `(0, 1)`. + +```text + column + 0 1 | 2 3 + ----------+---------- +row 0 0 1 | 2 3 +row 1 [4] [5]| [6] [7] <- image[1, :] + ----------+---------- +row 2 8 9 | 10 11 + + left part right part +chunk_coords (0, 0) (0, 1) +global chunk_domain [0,2) x [0,2) [0,2) x [2,4) +selected global cells (1,0), (1,1) (1,2), (1,3) +chunk-local cells (1,0), (1,1) (1,0), (1,1) +request coordinates 0, 1 2, 3 +``` + +Every planned chunk keeps three coordinate frames distinct: + +- `chunk_coords` identifies a cell in the chunk grid. Chunk coordinates are + literal integers, so a grid that grows at its lower end can hold a chunk + whose coordinate really is `-1` — not an alias for the final chunk (see the + [design notes](../design-notes.md#negative-origin-domains-and-prependable-grids)). +- `chunk_domain` gives that chunk's bounds in **global source coordinates**. + Here the two domains are `[0, 2) × [0, 2)` and `[0, 2) × [2, 4)`. +- Chunk-local positions start from zero inside each chunk. Global column 2 is + therefore local column 0 in chunk `(0, 1)`. This zero-origin local frame is + separate from both the global `chunk_domain` and the possibly negative + chunk coordinate. + +`plan_chunks` needs only a transform and the chunk layout: one grid object +per source dimension. A per-dimension grid answers four questions — which +chunk contains a source index, where a chunk starts, how long it is, and +the vectorized form of the first (`index_to_chunk`, `chunk_offset`, +`chunk_size`, `indices_to_chunks`). The library builds these from chunk +sizes via `dimension_grids_from_chunks`; the executable example hand-rolls +one instead, to show that the whole contract is those four answers. It +plans the canonical request over 2-by-2 chunks, and iterates the same plan +again to show that planning is reusable. (The two transforms it inspects on +each projection are the next section's subject.) + +```python +--8<-- "snippets/chunk_projection.py:chunk-projection" +``` + +The plan describes work but does not perform it. It contains no array source, +storage backend, codec pipeline, buffer, or scheduler. A Zarr reader, a task +queue, or a viewport can consume the same logical plan and decide independently +how and when to fetch its two chunks. + +On the wrapper, this partitioning is called **parts**: `with_parts(shape)` +gives a `LazyArray` a grid of uniform boxes to divide its reads along +(re-partitioning is a pure setter — it changes how a read is divided, never +what `result()` returns), and a wrapped array advertising its own `chunks` +is partitioned that way automatically. + +A zero-length source axis has no chunks. `LazyArray` accepts a positive uniform +part shape for that axis, or explicit per-axis spellings `()`, `(0,)`, and +`(0, 0)`; each produces no parts and the same empty result. Zero-sized parts +remain invalid on a nonempty axis. + +## One cell domain, two projections {#one-cell-domain-two-projections} + +A chunk read has to answer two questions at once: which cells belong to this +chunk, and where does each of those cells belong in the requested result? + +Think of a projection as a small table with one row per selected cell. For +each row, `chunk_transform` gives the cell's zero-origin address inside the +chunk, and `cell_transform` gives the position in the requested result that +receives its value. The row numbers of that table are the shared **cell +domain** — a synthetic input space both transforms accept, which is why one +input point can be evaluated on both sides. + +```text +left chunk (0, 0) + +shared cell coordinate | 0 1 +cell_transform | v v +request coordinate | 0 1 + +shared cell coordinate | 0 1 +chunk_transform | v v +chunk-local coordinate | (1, 0) (1, 1) + +right chunk (0, 1) + +shared cell coordinate | 0 1 +request coordinate | 2 3 +chunk-local coordinate | (1, 0) (1, 1) +``` + +The directions are exact: **shared synthetic input cell domain → request via +`cell_transform`**, and **shared cell domain → chunk-local via +`chunk_transform`**. Neither arrow starts at the request or maps one output +space into the other. + +On the wrapper, `view.parts()` returns one `Partition` per planned chunk; +each bundles a sub-view of the request (`.view`), that chunk's projection +(`.projection`), and the NumPy selection placing its values in the result +(`.out_selection`). + +Within one `Partition`, the frames divide: `Partition.view.transform` is a +different, global transform — it maps the part view directly into the raw +wrapped source — while only `Partition.projection.chunk_transform` uses +zero-origin chunk-local coordinates. Readers receive both so the global +source address and the local planning frame cannot be confused. + +| Projection field | What its output coordinates mean | +| --- | --- | +| `cell_transform` | Literal coordinates in the original request; its output rank is the request rank | +| `chunk_transform` | Zero-origin coordinates in the selected chunk's local frame; its output rank is the source rank | + +The cell domain enumerates corresponding cells; it is not itself either +output coordinate space. The canonical row selection has a one-dimensional +request and a two-dimensional source, so its paired projections have request +rank one and source rank two. + +### Order and duplicates need the request-side projection + +Orthogonal indexing (`.lazy.oindex`) applies each axis's indexer +independently, like `numpy.ix_` — an outer product; the +[pattern reference](patterns.md) develops the dialects. It can visit source +cells in an order that does not match chunk order, and it can visit one +source cell more than once. In the request below, row 4 comes first and +row 1 appears twice. + +```text +request position | 0 1 2 +source row | 4 1 1 +result row | row 4 row 1 row 1 +``` + +A source bounding box cannot reconstruct this result. The box spanning rows 1 +through 4 also includes unrequested rows 2 and 3, and its increasing coordinate +order does not record that row 4 comes first. Narrowing the read to just rows 1 +and 4 still does not record the second use of row 1. For the same reason, a +chunk-local selector alone says which cells to read inside a chunk but cannot +say which request positions receive them, especially when the chunks are +processed in a different order. + +The executable example assembles the 3-by-4 request from a 6-by-8 source with +3-by-4 chunks. Each `Partition` resolves its own sub-view — the global +transform addressing the raw source — and `out_selection` places those +values at their request-side positions; the paired projection stays +available on `part.projection` for consumers that read chunks directly. +The assertion checks the reordered, duplicated result against direct NumPy +indexing. + +```python +--8<-- "snippets/chunk_projection.py:advanced-projection" +``` + +The paired representation preserves information that a bounding box or local +selector discards: exact request order, duplicate destinations, and the +correspondence between every request position and its chunk-local source cell. + +--- + + diff --git a/packages/zarr-indexing/docs/guide/integrations.md b/packages/zarr-indexing/docs/guide/integrations.md new file mode 100644 index 0000000000..03661ed43c --- /dev/null +++ b/packages/zarr-indexing/docs/guide/integrations.md @@ -0,0 +1,214 @@ +# Integration boundaries + +This package supplies indexing plans. It does **not** supply scheduling, +caching, codecs, or async orchestration. A consumer decides when projections +run, how decoded chunks are obtained, and where completed values are retained. +An `IndexTransform` says which source values belong in a result; a `Reader` +lowers that complete transform for one backend. The reader does not choose +indexing semantics or result ownership. + +## Zarr chunk dispatch + +A Zarr-oriented reader can consume each public `ChunkProjection` and use its +`chunk_coords` to obtain one decoded chunk from its own storage and codec +layers. This tiny source keeps four in-memory chunks keyed by their global +chunk coordinates and records the exact reads. For each projection, the +consumer enumerates the shared synthetic input cell domain, evaluates +`chunk_transform` to read zero-origin chunk-local coordinates, and evaluates +`cell_transform` to place each value at its literal request coordinate. + +```python +--8<-- "snippets/integrations.py:zarr-consumer" +``` + +The two reads are exactly `(0, 0)` and `(0, 1)`; untouched chunks `(1, 0)` and +`(1, 1)` are never read. The assembled request is `[4, 5, 6, 7]`. The +example intentionally begins with already decoded in-memory chunks: storage +keys, codecs, scheduling, caching, and asynchronous orchestration remain the +consumer's policy rather than responsibilities of the plan. + +## One slab read or many part reads + +A backend with its own native subset read — a Rust or C zarr implementation, +a database, an HTTP range endpoint — resolves a **dense box** (`is_box` with +every stride 1) best as a single read: hand it the whole selection and let it +dispatch to chunks, decode in parallel, and partial-decode shards on its own +side of the boundary. Splitting that read along this library's partitioning +only adds round-trips. Every **other** selection — a strided box, an `oindex` +or `vindex` gather — is where the partitioning earns its keep. The **cover** +of a read is the smallest step-1 slab enclosing every coordinate it needs; +partitioned, each part's cover is bounded by that part's box, so a sparse +selection can never force one read of its whole bounding hull (the smallest +rectangle containing every selected coordinate — a thousand rows for the two +of `oindex[[0, 999]]`). + +The composed view carries enough to make that call at materialization time, +and re-partitioning is a pure setter, so the policy is three lines: + +```python +--8<-- "snippets/integrations.py:dense-box-repartition" +``` + +The corner gather reads four single cells instead of the 10-by-10 hull, and +the dense box becomes exactly one backend call. Both regimes go through +`result()`; only the partitioning in force differs. + +### Sources that accept only unit-step slices + +The default `basic_reader` pushes strided and descending selections down as +positive-step slices, which reads the minimum but assumes the source accepts +any step. Many backends do not: FFI bindings and range requests often +support nothing but `slice(start, stop, 1)`. Select +[`unit_step_reader`][zarr_indexing.reader.UnitStepReader] for such a source +and every key it receives is an ascending unit-step slice per axis, with +strides, reversals, and gathers applied to the in-memory block instead: + +```python +view = LazyArray(source).with_reader(unit_step_reader) +``` + +A strided selection then over-reads its cover by the stride factor, which the +partitioning above bounds by one part. + +## napari-like consumer + +This is a **napari-like consumer**, not a napari integration. It models the +boundary a viewport could use without importing or claiming support for +napari. `RecordingArray` exposes a chunked, basic-indexing source — and its +`chunks` attribute is why the reads below split along `(2, 2)` boxes: +`LazyArray` discovers a partitioning from the wrapped array at construction +(`read_chunk_sizes`, then `chunks`), with `with_parts` as the explicit +override. Composing the +visible slice records no reads. Only `result()` materializes it, with the exact +source selectors `1:2, 0:2` and `1:2, 2:4`; neither selector crosses into an +untouched neighboring chunk. + +```python +--8<-- "snippets/integrations.py:viewport-consumer" +``` + +The viewport owns its interaction loop and any cancellation, caching, or +background execution. `LazyArray` contributes the composable selection and +the partition plan, then resolves only when the consumer asks for the result. + +### A system-memory chunk cache + +Napari accepts NumPy-like array objects and can defer materialization until an +image region is displayed. The indexing plan still deliberately owns no cache +or scheduler. A viewport adapter can place that policy around the plan, as the +executable reference below demonstrates. + +This remains a **napari-like consumer, not a napari integration**. It models +only decoded chunks resident in system memory, synchronously. + +For setup instructions and the complete executable, see the +[system-memory chunk cache example](../examples/system_memory_chunk_cache.md). + +```text + read succeeds +NEW -> QUEUED -> LOADING -------------> READY -> EVICTED + ^ | + | | read fails + | v + +--------- FAILED + retry + +EVICTED -> QUEUED + reload +``` + +The example keeps the lifecycle records and transitions explicit: + +```python +--8<-- "system_memory_chunk_cache/system_memory_chunk_cache.py:chunk-cache-types" +``` + +Its source represents already decoded chunks and records each read: + +```python +--8<-- "system_memory_chunk_cache/system_memory_chunk_cache.py:chunk-cache-source" +``` + +`LazyArray` converts a cache selection into transforms and partitions, then +allocates and assembles the result. The facade constructs exactly one tuple +from `view.parts()`: it derives the chunk coordinates to pin from that tuple, +then passes the same owned parts to `view.result(parts=parts)`. Planning is +therefore performed once for the request rather than repeated during +materialization. Neither pinning nor the result call rebuilds the plan; both +reuse those prepared `Partition` objects. + +`SystemMemoryChunkReader` receives one `ReadContext` for each materialized +part. Its global `context.transform` directly addresses the raw source, while +`context.projection.chunk_transform` addresses the already identified chunk +locally. The reader consumes that supplied projection directly; it never calls +the chunk planner. `LazyArray` retains responsibility for the projection's +result placement and final assembly. The reader owns only cache state and +source reads, while `SystemMemoryChunkCache` remains the thin NumPy-style facade +that prepares and pins the one plan: + +Its indexing dialects remain explicit: `cache[key]` accepts basic indexing +(integers, slices, ellipsis, and new axes), while `cache.oindex[key]` combines +per-axis index arrays as an outer product. Array keys are not silently treated +as orthogonal by plain square brackets; callers choose that behavior through +the named accessor. + +```python +--8<-- "system_memory_chunk_cache/system_memory_chunk_cache.py:chunk-cache-wrapper" +``` + +### Follow one viewport through the cache + +```python +--8<-- "system_memory_chunk_cache/system_memory_chunk_cache.py:chunk-cache-worked-example" +``` + +The worked example uses a 6-by-8 image, 3-by-4 chunks, and capacity for two +decoded chunks. Every read delta follows directly from the viewport request: + +| Step | Viewport | New reads | Resident afterward | Why | +| --- | --- | --- | --- | --- | +| 1 | `image[1:5, 2]` | `(0, 0)`, `(1, 0)` | `(0, 0)`, `(1, 0)` | Both projected chunks are loaded and assembled as `[10, 18, 26, 34]`. | +| 2 | `image[3:5, 2]` | None | `(0, 0)`, `(1, 0)` | The ready buffer for `(1, 0)` is reused and becomes most recently used. | +| 3 | `image[0:2, 5]` | `(0, 1)` | `(0, 1)`, `(1, 0)` | Placement returns `[5, 13]`, then LRU pressure evicts `(0, 0)`. | +| 4 | `image[1:5, 2]` | `(0, 0)` | `(0, 0)`, `(1, 0)` | The evicted chunk is reloaded while the required ready chunk is retained. | +| 5 | `image[3:5, 4:6]` | `(1, 1)` fails; no repeated read; `(1, 1)` succeeds after retry | `(0, 0)`, `(1, 1)` | Failure is retained until explicit retry; the repaired source then returns `[[28, 29], [36, 37]]`. | + +Chunks required by an active request are pinned through assembly, so a request +may temporarily span more chunks than the steady-state capacity. Capacity is +counted in decoded chunks—not records or bytes—and eviction occurs only after +all requested values have been placed. Because pinning and materialization use +the same prepared tuple, those lifecycle decisions cannot drift from the parts +that are actually read, and the cache never has to infer or reconstruct a +projection. + +The event log makes the failure boundary equally explicit: + +| Chunk | Transition | Reason | +| --- | --- | --- | +| `(1, 1)` | `NEW -> QUEUED` | requested | +| `(1, 1)` | `QUEUED -> LOADING` | queue drained | +| `(1, 1)` | `LOADING -> FAILED` | source read failed | +| `(1, 1)` | `FAILED -> QUEUED` | explicit retry | +| `(1, 1)` | `QUEUED -> LOADING` | queue drained | +| `(1, 1)` | `LOADING -> READY` | source read completed | + +A repeated request while the record is `FAILED` creates no event and performs +no source read. The retained failure forces the caller to choose when retry is +appropriate. A real viewport adapter could drain the queue in workers and +invalidate its canvas when chunks become ready without changing the selection +or projection semantics shown here. + +[Napari's image-layer documentation](https://napari.org/dev/howtos/layers/image.html) +describes its NumPy-like array boundary. Neuroglancer's +[`ChunkState`](https://github.com/google/neuroglancer/blob/master/src/chunk_manager/base.ts) +is conceptual prior art for making residency explicit. This example is a +smaller, independently authored, synchronous teaching model; it does not copy +that implementation or reproduce its full worker/GPU lifecycle. + +--- + + diff --git a/packages/zarr-indexing/docs/guide/patterns.md b/packages/zarr-indexing/docs/guide/patterns.md new file mode 100644 index 0000000000..9c3501da8a --- /dev/null +++ b/packages/zarr-indexing/docs/guide/patterns.md @@ -0,0 +1,327 @@ +# Indexing pattern reference + +Every NumPy indexing idiom is modeled by an `IndexTransform`: a domain (the +result's coordinates) and one output map per source dimension. This page +builds that model **by hand for each idiom**, so the anatomy is explicit — +which map kind an idiom needs, where the offset and stride go, and how an +index array's shape spells outer-product versus pointwise. Each model is +then proven equal to what the selection compiler derives, and its values +are checked against NumPy. + +## The idiom-to-model matrix + +Each idiom over a 6-by-8 `image`, shown two ways: the Python construction, +and the same transform in **wire form** — the [ndsel](../ndsel.md) +canonical body `to_json` produces. Both spell the whole +object: a domain whose extent is the result shape, then one output map per +source dimension. The index-array variables (`rows`, `columns`, +`mask_rows, mask_columns = np.nonzero(mask)`, and friends) are defined in +the executable matrix at the end of the page. + +**`image[1:5, ::2]`** — box. The offset picks where cell 0 reads; the +stride skips: + +=== "Python" + + ```python + IndexTransform( + domain=IndexDomain.from_shape((4, 4)), + output=( + DimensionMap(input_dimension=0, offset=1), + DimensionMap(input_dimension=1, stride=2), + ), + ) + ``` + +=== "JSON" + + ```json + { + "input_rank": 2, + "input_inclusive_min": [0, 0], + "input_exclusive_max": [4, 4], + "input_labels": ["", ""], + "output": [ + {"offset": 1, "stride": 1, "input_dimension": 0}, + {"offset": 0, "stride": 2, "input_dimension": 1} + ] + } + ``` + +**`image[2, :]`** — box. A rank-1 domain with two output maps: the dropped +axis survives as the wire's constant form, a bare `{"offset": 2}`: + +=== "Python" + + ```python + IndexTransform( + domain=IndexDomain.from_shape((8,)), + output=(ConstantMap(2), DimensionMap(input_dimension=0)), + ) + ``` + +=== "JSON" + + ```json + { + "input_rank": 1, + "input_inclusive_min": [0], + "input_exclusive_max": [8], + "input_labels": [""], + "output": [ + {"offset": 2}, + {"offset": 0, "stride": 1, "input_dimension": 0} + ] + } + ``` + +**`image[::-2, :]`** — box. Reversal is nothing but a negative stride, and +the offset is where cell 0 reads (row 5): + +=== "Python" + + ```python + IndexTransform( + domain=IndexDomain.from_shape((3, 8)), + output=( + DimensionMap(input_dimension=0, offset=5, stride=-2), + DimensionMap(input_dimension=1), + ), + ) + ``` + +=== "JSON" + + ```json + { + "input_rank": 2, + "input_inclusive_min": [0, 0], + "input_exclusive_max": [3, 8], + "input_labels": ["", ""], + "output": [ + {"offset": 5, "stride": -2, "input_dimension": 0}, + {"offset": 0, "stride": 1, "input_dimension": 1} + ] + } + ``` + +**`image[2:2, :]`** — box. Emptiness lives in the domain +(`input_exclusive_max[0]` equals the minimum); the maps are ordinary: + +=== "Python" + + ```python + IndexTransform( + domain=IndexDomain.from_shape((0, 8)), + output=( + DimensionMap(input_dimension=0, offset=2), + DimensionMap(input_dimension=1), + ), + ) + ``` + +=== "JSON" + + ```json + { + "input_rank": 2, + "input_inclusive_min": [0, 0], + "input_exclusive_max": [0, 8], + "input_labels": ["", ""], + "output": [ + {"offset": 2, "stride": 1, "input_dimension": 0}, + {"offset": 0, "stride": 1, "input_dimension": 1} + ] + } + ``` + +**`image[mask]`** — query. A mask is its nonzero coordinates: two +correlated index arrays over one flat axis, entry `i` of each pairing into +one cell: + +=== "Python" + + ```python + IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(ArrayMap(mask_rows), ArrayMap(mask_columns)), + ) + ``` + +=== "JSON" + + ```json + { + "input_rank": 1, + "input_inclusive_min": [0], + "input_exclusive_max": [10], + "input_labels": [""], + "output": [ + {"offset": 0, "stride": 1, "index_array": [0, 0, 1, 1, 2, 3, 3, 4, 5, 5], "index_array_bounds": ["-inf", "+inf"]}, + {"offset": 0, "stride": 1, "index_array": [0, 5, 2, 7, 4, 1, 6, 3, 0, 5], "index_array_bounds": ["-inf", "+inf"]} + ] + } + ``` + +**`image[np.ix_(rows, columns)]`** — query. The outer product is spelled by +nesting: `[[4], [1], [1]]` varies down the first axis, `[[2, 5]]` across +the second, each singleton along the other: + +=== "Python" + + ```python + IndexTransform( + domain=IndexDomain.from_shape((3, 2)), + output=(ArrayMap(rows.reshape(3, 1)), ArrayMap(columns.reshape(1, 2))), + ) + ``` + +=== "JSON" + + ```json + { + "input_rank": 2, + "input_inclusive_min": [0, 0], + "input_exclusive_max": [3, 2], + "input_labels": ["", ""], + "output": [ + {"offset": 0, "stride": 1, "index_array": [[4], [1], [1]], "index_array_bounds": ["-inf", "+inf"]}, + {"offset": 0, "stride": 1, "index_array": [[2, 5]], "index_array_bounds": ["-inf", "+inf"]} + ] + } + ``` + +**`image[vector_rows, vector_columns]`** — query. Pointwise: two flat +arrays over one shared axis: + +=== "Python" + + ```python + IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(vector_rows), ArrayMap(vector_columns)), + ) + ``` + +=== "JSON" + + ```json + { + "input_rank": 1, + "input_inclusive_min": [0], + "input_exclusive_max": [3], + "input_labels": [""], + "output": [ + {"offset": 0, "stride": 1, "index_array": [4, 1, 1], "index_array_bounds": ["-inf", "+inf"]}, + {"offset": 0, "stride": 1, "index_array": [2, 5, 2], "index_array_bounds": ["-inf", "+inf"]} + ] + } + ``` + +**`image[broadcast_rows, broadcast_columns]`** — query. NumPy broadcasting, +materialized: each map carries the full `(2, 3)` block: + +=== "Python" + + ```python + IndexTransform( + domain=IndexDomain.from_shape((2, 3)), + output=( + ArrayMap(np.broadcast_to(broadcast_rows, (2, 3))), + ArrayMap(np.broadcast_to(broadcast_columns, (2, 3))), + ), + ) + ``` + +=== "JSON" + + ```json + { + "input_rank": 2, + "input_inclusive_min": [0, 0], + "input_exclusive_max": [2, 3], + "input_labels": ["", ""], + "output": [ + {"offset": 0, "stride": 1, "index_array": [[0, 0, 0], [3, 3, 3]], "index_array_bounds": ["-inf", "+inf"]}, + {"offset": 0, "stride": 1, "index_array": [[1, 4, 6], [1, 4, 6]], "index_array_bounds": ["-inf", "+inf"]} + ] + } + ``` + +**`image[rows, 2:6]`** — query. One lookup table (order and repeats kept) +beside one ordinary affine map — one index array makes the whole selection +a query: + +=== "Python" + + ```python + IndexTransform( + domain=IndexDomain.from_shape((3, 4)), + output=( + ArrayMap(rows.reshape(3, 1)), + DimensionMap(input_dimension=1, offset=2), + ), + ) + ``` + +=== "JSON" + + ```json + { + "input_rank": 2, + "input_inclusive_min": [0, 0], + "input_exclusive_max": [3, 4], + "input_labels": ["", ""], + "output": [ + {"offset": 0, "stride": 1, "index_array": [[4], [1], [1]], "index_array_bounds": ["-inf", "+inf"]}, + {"offset": 2, "stride": 1, "input_dimension": 1} + ] + } + ``` + +Two structural rules do all the work: + +- **Category**: `ConstantMap` and `DimensionMap` entries keep a selection a + box at any composition depth; one `ArrayMap` makes it a query permanently. + See the [design notes](../design-notes.md#bounding-box-selections-vs-query-selections) + for why consumers dispatch on this. +- **Fancy flavor is spelled by shape**: index arrays varying over distinct + axes (singleton elsewhere) form an outer product; arrays sharing their + non-singleton axes pair pointwise. + +## The executable matrix + +Each case hand-builds the model, checks shape, category, and NumPy values +(resolved through the public reader), then proves the selection compiler +derives the same transform. One wrinkle the last assert documents: compiled +*basic* selections keep literal domains (`t[1:5, ...]` starts at +coordinate 1 — see [Positions vs literal coordinates](#positions-vs-literal-coordinates)), +so they equal the zero-origin models after `translate_domain_to`: + +```python +--8<-- "snippets/indexing_patterns.py:indexing-patterns" +``` + +`LazyArray` adds nothing to these semantics: it is a regular array-like API +whose `.lazy`, `.lazy.oindex`, and `.lazy.vindex` accessors compile the same +dialects to the same transforms — the only difference is the return type, a +view instead of an array. The test suite holds the wrapper to this matrix. + +## Positions vs literal coordinates + +| Surface | Meaning of an integer index | Meaning of `-1` | +| --- | --- | --- | +| `IndexDomain` and `IndexTransform` | A literal coordinate in the current domain | The address `-1`, when the domain contains it | +| `LazyArray.lazy` | A NumPy-style position in the current view | The last position, normalized before transform composition | + +The wrapper's three indexing modes all use positions in the current view. Each +derived view begins at position zero, while the transform algebra underneath +retains literal coordinates. The +[Coordinates are addresses](index.md#coordinates-are-addresses) section develops +that distinction with non-zero and negative-origin domains. + +--- + + diff --git a/packages/zarr-indexing/docs/index.md b/packages/zarr-indexing/docs/index.md index d123cbd32b..1dd151d8ca 100644 --- a/packages/zarr-indexing/docs/index.md +++ b/packages/zarr-indexing/docs/index.md @@ -1,150 +1,53 @@ # zarr-indexing -Composable, lazy coordinate transforms for Zarr array indexing. +This library is for modelling and transforming NumPy-style array indexing expressions. It separates +the *declaration* of an array indexing expression from the result of that expression. -`zarr-indexing` is developed in the -[zarr-python repository](https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-indexing) -and released independently of `zarr` itself. Install it with: - -``` -pip install zarr-indexing -``` - -## What this is - -An indexing operation — a slice, an integer, a fancy index array — is a -*mapping* from the coordinates a user asks for to the coordinates that live in -storage. This library makes that mapping a first-class value: an -[`IndexTransform`](api/transform.md). Transforms compose, so a view of a view -of an array is still a single transform, and nothing is read until someone -asks for data. - -Three pieces do the work: - -- **The transform algebra** ([`zarr_indexing.transform`](api/transform.md), - [`zarr_indexing.domain`](api/domain.md), - [`zarr_indexing.output_map`](api/output_map.md), - [`zarr_indexing.composition`](api/composition.md)): an `IndexTransform` - pairs an input [`IndexDomain`](api/domain.md) — a rectangular region of - integer coordinates, which unlike NumPy may have a non-zero origin — with - one output map per storage dimension. `ConstantMap`, `DimensionMap`, and - `ArrayMap` are three representations of the same thing, a set of integer - coordinates, traded off against each other for efficiency. -- **Chunk resolution** ([`zarr_indexing.chunk_resolution`](api/chunk_resolution.md)): - given a transform and a chunk grid, which chunks does this selection touch, - which coordinates does it touch *inside* each chunk, and where do the values - land in the output buffer? The resolver is dependency-aware: correlated - (`vindex`) array maps are enumerated jointly rather than as a cartesian - product, and orthogonal (`oindex`) array maps contribute only the chunks - their index arrays actually land in, so resolution scales with the number of - selected coordinates instead of with the size of the grid. -- **A wire format** ([`zarr_indexing.messages`](api/messages.md), - [`zarr_indexing.json`](api/json.md)): selections serialize to and from - [ndsel](https://github.com/zarr-developers/ndsel), a JSON representation of - NumPy-style n-dimensional selections. See [the ndsel wire format](ndsel.md). +Developed for use in [`zarr`](https://zarr.readthedocs.io). -The package depends only on NumPy and the standard library. In particular it -does not import `zarr`: the chunk-grid surface chunk resolution needs is -described by the [`DimensionGridLike`](api/grid.md) Protocol, which zarr's -per-dimension grids satisfy structurally. +Inspired by [TensorStore](https://google.github.io/tensorstore/), which pioneered +the approach used here. -## Relationship to TensorStore -The model is [TensorStore's](https://google.github.io/tensorstore/index_space.html) -index transform, reimplemented in Python against NumPy: index domains with -explicit origins, output index maps of constant / single-input-dimension / -index-array flavour, and composition as the single operation that stacks -views. Names and semantics follow TensorStore where they overlap — notably, -negative indices are literal coordinates, not Python-style offsets from the -end, and it is the caller's job to normalize them. +## Install -The differences are the ones NumPy compatibility forces. `ArrayMap` records -the input dimension an *orthogonal* (`oindex`) index array varies over, which -TensorStore's format has no field for; the -[serializer collapses or reconstructs that field](api/json.md) so the wire -format stays TensorStore-loadable. Chunk resolution and the `oindex`/`vindex` -helpers exist to serve NumPy-shaped selection semantics, which TensorStore -does not have to model. - -## Quickstart - -Indexing a transform produces a new transform. No I/O happens, and no -coordinates are materialized: - -```python -from zarr_indexing import IndexTransform - -transform = IndexTransform.from_shape((100, 100)) +`zarr-indexing` is developed in the +[zarr-python repository](https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-indexing) +and released independently of `zarr` itself: -view = transform[10:50, 5] -view.domain # IndexDomain(inclusive_min=(10,), exclusive_max=(50,)) -view.selection_repr # '{ [10, 50), 5 }' ``` - -The domain describes what the *user* sees (here a single dimension, 40 long, -with origin 10); the output maps describe what *storage* sees (a stride-1 -`DimensionMap` and the `ConstantMap` for the dropped dimension). - -Fancy indexing works the same way, in both flavours, and still materializes -nothing but the index arrays themselves: - -```python -import numpy as np - -transform.oindex[np.array([3, 1, 90]), 0:4] # '{ {3, 1, 90}, [0, 4) }', shape (3, 4) -transform.vindex[np.array([0, 40, 99]), np.array([1, 2, 3])] # shape (3,) +pip install zarr-indexing ``` -Transforms built independently stack with -[`compose`](api/composition.md), which is what `transform[...]` uses -internally when you index an already-indexed view: - -```python -from zarr_indexing import compose - -inner = IndexTransform.from_shape((100,))[::2] # storage 0, 2, 4, ... over domain [0, 50) -outer = IndexTransform.from_shape((50,))[10:20] - -compose(outer, inner).selection_repr # '{ [20, 40) step 2 }' -``` +## Quickstart -Resolution against a chunk grid is where a transform finally meets storage. -Chunk resolution asks the grid only for the per-dimension index-to-chunk -mapping described by [`DimensionGridLike`](api/grid.md), so any object with -those four methods will do: +Wrap an array, compose a lazy view through `.lazy`, and call `result()` when +you want its values: ```python -from dataclasses import dataclass - -from zarr_indexing import iter_chunk_transforms - - -@dataclass(frozen=True) -class RegularDimensionGrid: - chunk: int - - def index_to_chunk(self, idx): return idx // self.chunk - def chunk_offset(self, chunk_ix): return chunk_ix * self.chunk - def chunk_size(self, chunk_ix): return self.chunk - def indices_to_chunks(self, indices): return indices // self.chunk - - -grids = [RegularDimensionGrid(32), RegularDimensionGrid(32)] - -for chunk_coords, sub_transform, out_indices in iter_chunk_transforms(view, grids): - print(chunk_coords, sub_transform.selection_repr) -# (0, 0) { [10, 32), 5 } -# (1, 0) { [0, 18), 5 } +--8<-- "snippets/canonical_slice.py:landing-quickstart" ``` -Each yielded `sub_transform` is the original transform restricted to one chunk -and translated into chunk-local coordinates — exactly what a codec pipeline -needs to decode that chunk and scatter the result. `out_indices` carries the -output scatter indices for array selections, and is `None` for basic indexing. - -## Reference - -- [The ndsel wire format](ndsel.md) +Nothing is read until the `result()` call, however many selections are +composed. [Lazy views compose](guide/index.md#lazy-views-compose) shows how +the chain stays one description, and where the materialization boundary is. + +## Learn more + +- [Visual guide](guide/index.md) — one selection followed from coordinates to + chunk plan. Using lazy indexing, start at + [An index selects coordinates](guide/index.md#an-index-selects-coordinates); + integrating a chunked backend, start at + [A request becomes a chunk plan](guide/index.md#a-request-becomes-a-chunk-plan). +- [Indexing pattern reference](guide/patterns.md) — every selection form with + its NumPy-verified result. +- [Integration boundaries](guide/integrations.md) — what a reader, writer, or + scheduler owns, and what the plan owns. +- [Lazy indexing a NumPy array](examples/lazy_indexing_numpy.md) and + [with Dask](examples/lazy_indexing_dask.md) — runnable examples. +- [The ndsel wire format](ndsel.md) — the JSON form of a selection. +- [Design notes](design-notes.md) — TensorStore lineage, box vs query, and + deliberate limits. - [API reference](api/index.md) - [Changelog](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/CHANGELOG.md) -- [License (MIT)](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/LICENSE.txt) + · [License (MIT)](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/LICENSE.txt) diff --git a/packages/zarr-indexing/docs/ndsel.md b/packages/zarr-indexing/docs/ndsel.md index 74f394b758..94971d49bf 100644 --- a/packages/zarr-indexing/docs/ndsel.md +++ b/packages/zarr-indexing/docs/ndsel.md @@ -6,8 +6,11 @@ title: The ndsel wire format [ndsel](https://github.com/zarr-developers/ndsel) is a draft JSON representation of NumPy-style n-dimensional selections, adapted from -TensorStore's `IndexTransform` model. `zarr-indexing` implements it in two -layers, and the split between them is the thing worth understanding: +TensorStore's `IndexTransform` model. This page documents the wire format, not +the coordinate model: [Coordinates are addresses](guide/index.md#coordinates-are-addresses) +introduces literal coordinates, and +[Lazy views compose](guide/index.md#lazy-views-compose) shows how views combine +before a transform is serialized. `zarr-indexing` implements ndsel in two layers: | Layer | Module | Depends on | Job | | --- | --- | --- | --- | @@ -15,16 +18,16 @@ layers, and the split between them is the thing worth understanding: | Engine | [`zarr_indexing.json`](api/json.md) | NumPy | Lowers a *canonical* body into an in-memory [`IndexTransform`](api/transform.md), and back. | Constraints that only make sense for a real array — finite bounds, index -arrays as `ndarray`s — live in the engine layer and nowhere else. That is why -`messages` can happily normalize a message with `"-inf"` bounds that -`json.transform_from_canonical` will refuse to lower. +arrays as `ndarray`s — live in the engine layer and nowhere else. As a result, +`messages` normalizes a message with `"-inf"` bounds that +`IndexTransform.from_json` refuses to lower. ## Two entry points [`parse_ndsel`](api/messages.md#zarr_indexing.messages.parse_ndsel) -structurally validates a message of any kind and returns it **unchanged** — -use it when you want to keep a message in its compact shorthand form but -confirm it is well formed. +structurally validates a message of any kind and returns it unchanged. Use it +to confirm that a message is well formed while keeping it in its compact +shorthand form. [`normalize_ndsel`](api/messages.md#zarr_indexing.messages.normalize_ndsel) desugars a message into the single deterministic **canonical transform body** @@ -78,19 +81,19 @@ normalization intact. The engine layer converts between canonical bodies and `IndexTransform`s: ```python -from zarr_indexing import transform_from_canonical, transform_to_canonical +from zarr_indexing import IndexTransform -t = transform_from_canonical(canonical) -transform_to_canonical(t) == canonical +t = IndexTransform.from_json(canonical) +t.to_json() == canonical ``` -`index_transform_to_json` / `index_transform_from_json` (and the -`index_domain_*` variants) are these same converters under their historical -names. +`IndexDomain` carries the same pair for a bare domain body, and each output +map kind has a `to_json`; `output_index_map_from_json` dispatches the wire's +tagged union back to the right kind. Two engine constraints apply here and only here. A canonical body carrying a `"-inf"` or `"+inf"` bound cannot be lowered — an `IndexDomain` addresses a -finite array — so `transform_from_canonical` raises. And implicit bounds lower +finite array — so `IndexTransform.from_json` raises. And implicit bounds lower *by value*: the `[n]`-bracket flag is a message-layer concern, and the engine keeps only the integer. @@ -109,18 +112,18 @@ varies over. The serializer bridges that gap in both directions: solely owns a single non-singleton axis is orthogonal; arrays that share non-singleton axes, or vary over several, are correlated (`vindex`), and get `input_dimension = None`. A single 1-D array over a rank-1 domain is - inherently ambiguous between the two flavours and reconstructs as + inherently ambiguous between the two flavors and reconstructs as orthogonal, which is behaviorally identical in that case. -There is one deliberate exception, worth calling out because it is the one -place a round trip changes representation rather than preserving it. An -all-singleton `index_array` — size 1 — selects the same coordinate no matter -what the input is, so it is **collapsed to a `constant` map** on serialize: +There is one deliberate exception, and it is the only place a round trip changes +representation rather than preserving it. An all-singleton `index_array` — size +1 — selects the same coordinate regardless of the input, so it is collapsed to +a `constant` map on serialize: ```python -from zarr_indexing import IndexTransform, transform_to_canonical +from zarr_indexing import IndexTransform -transform_to_canonical(IndexTransform.from_shape((100, 100)).oindex[[5], 0:2]) +IndexTransform.from_shape((100, 100)).oindex[[5], 0:2].to_json() # {'input_rank': 2, # 'input_inclusive_min': [0, 0], # 'input_exclusive_max': [1, 2], @@ -129,10 +132,10 @@ transform_to_canonical(IndexTransform.from_shape((100, 100)).oindex[[5], 0:2]) # {'offset': 0, 'stride': 1, 'input_dimension': 1}]} ``` -The size-1 input dimension stays in the domain, unconsumed by any output map — -still a valid transform, and still the right output shape. A length-1 `oindex` -selection therefore round-trips *behaviorally* (an `ArrayMap` comes back as a -`ConstantMap`) rather than by object identity. +The size-1 input dimension stays in the domain, unconsumed by any output map. +The transform is still valid and the output shape is unchanged. A length-1 +`oindex` selection therefore round-trips behaviorally (an `ArrayMap` comes back +as a `ConstantMap`) rather than by object identity. ## Conformance @@ -151,6 +154,6 @@ Do not edit the vendored files; to pick up spec changes, re-vendor from a newer ndsel commit and update the recorded SHA. A second, optional test (`tests/test_ndsel_tensorstore.py`, skipped unless -`tensorstore` is installed) closes the loop against a real TensorStore by -loading canonical bodies into `tensorstore.IndexTransform` and re-loading -TensorStore's own `to_json()` output back through the engine layer. +`tensorstore` is installed) checks against TensorStore itself by loading +canonical bodies into `tensorstore.IndexTransform` and re-loading TensorStore's +own `to_json()` output back through the engine layer. diff --git a/packages/zarr-indexing/docs/snippets/axis_manipulation.py b/packages/zarr-indexing/docs/snippets/axis_manipulation.py new file mode 100644 index 0000000000..1d1369fd87 --- /dev/null +++ b/packages/zarr-indexing/docs/snippets/axis_manipulation.py @@ -0,0 +1,29 @@ +"""Indexing defines result axes as well as selected source points.""" + +import numpy as np + +from zarr_indexing import LazyArray + +# --8<-- [start:axis-shape-comparison] +image = np.arange(12).reshape(3, 4) +lazy = LazyArray.from_numpy(image) + +integer_view = lazy.lazy[1, :] +slice_view = lazy.lazy[1:2, :] + +INTEGER_RESULT = integer_view.result() +SLICE_RESULT = slice_view.result() + +assert INTEGER_RESULT.tolist() == [4, 5, 6, 7] +assert INTEGER_RESULT.shape == (4,) +assert SLICE_RESULT.tolist() == [[4, 5, 6, 7]] +assert SLICE_RESULT.shape == (1, 4) +# --8<-- [end:axis-shape-comparison] + +# --8<-- [start:axis-insertion] +inserted_view = lazy.lazy[1, :, None] +INSERTED_RESULT = inserted_view.result() + +assert INSERTED_RESULT.tolist() == [[4], [5], [6], [7]] +assert INSERTED_RESULT.shape == (4, 1) +# --8<-- [end:axis-insertion] diff --git a/packages/zarr-indexing/docs/snippets/canonical_slice.py b/packages/zarr-indexing/docs/snippets/canonical_slice.py new file mode 100644 index 0000000000..fc4417f641 --- /dev/null +++ b/packages/zarr-indexing/docs/snippets/canonical_slice.py @@ -0,0 +1,30 @@ +"""The canonical basic-selection example used throughout the guide.""" + +import numpy as np + +from zarr_indexing import LazyArray + + +# --8<-- [start:landing-quickstart] +import numpy as np + +from zarr_indexing import LazyArray + +source = np.array([10, 11, 12, 13, 14, 15]) +view = LazyArray.from_numpy(source).lazy[2:5] + +view.result() +# array([12, 13, 14]) +# --8<-- [end:landing-quickstart] + +LANDING_QUICKSTART_RESULT = view.result() +assert LANDING_QUICKSTART_RESULT.tolist() == [12, 13, 14] + + +# --8<-- [start:canonical-slice] +source = np.array([10, 11, 12, 13, 14, 15]) +lazy = LazyArray.from_numpy(source) +view = lazy.lazy[2:5] + +assert view.result().tolist() == [12, 13, 14] +# --8<-- [end:canonical-slice] diff --git a/packages/zarr-indexing/docs/snippets/chunk_projection.py b/packages/zarr-indexing/docs/snippets/chunk_projection.py new file mode 100644 index 0000000000..5c56aafbbd --- /dev/null +++ b/packages/zarr-indexing/docs/snippets/chunk_projection.py @@ -0,0 +1,57 @@ +"""Use public chunk projections without choosing a storage backend.""" + +import numpy as np +from numpy.typing import NDArray +from typing import cast + +from zarr_indexing import DimensionGridLike, IndexTransform, LazyArray, plan_chunks + + +# --8<-- [start:chunk-projection] +class RegularGrid: + """A small parameterized implementation of the public grid protocol.""" + + def __init__(self, size: int) -> None: + self.size = size + + def index_to_chunk(self, index: int) -> int: + return index // self.size + + def chunk_offset(self, chunk: int) -> int: + return chunk * self.size + + def chunk_size(self, chunk: int) -> int: + return self.size + + def indices_to_chunks(self, indices: NDArray[np.intp]) -> NDArray[np.intp]: + return np.floor_divide(indices, self.size).astype(np.intp) + + +transform = IndexTransform.from_shape((3, 4))[1, 0:4] +grids = cast( + tuple[DimensionGridLike, DimensionGridLike], + (RegularGrid(2), RegularGrid(2)), +) +plan = plan_chunks(transform, grids) +PROJECTIONS = tuple(plan) +assert tuple(projection.chunk_coords for projection in plan) == ((0, 0), (0, 1)) + +PAIRED_DOMAINS = tuple( + (projection.chunk_transform.domain, projection.cell_transform.domain) + for projection in PROJECTIONS +) +assert all(chunk_domain == cell_domain for chunk_domain, cell_domain in PAIRED_DOMAINS) +# --8<-- [end:chunk-projection] + + +# --8<-- [start:advanced-projection] +image = np.arange(48).reshape(6, 8) +advanced = LazyArray.from_numpy(image).with_parts((3, 4)).lazy.oindex[[4, 1, 1], 2:6] + +ADVANCED_EXPECTED = image[[4, 1, 1]][:, 2:6] +ADVANCED_RESULT = np.empty_like(ADVANCED_EXPECTED) +for part in advanced.parts(): + ADVANCED_RESULT[part.out_selection] = part.view.result() + +np.testing.assert_array_equal(ADVANCED_RESULT, ADVANCED_EXPECTED) +# --8<-- [end:advanced-projection] diff --git a/packages/zarr-indexing/docs/snippets/coordinate_origins.py b/packages/zarr-indexing/docs/snippets/coordinate_origins.py new file mode 100644 index 0000000000..724312e5e8 --- /dev/null +++ b/packages/zarr-indexing/docs/snippets/coordinate_origins.py @@ -0,0 +1,65 @@ +"""Literal coordinate domains and a grid that supports prepending.""" + +import numpy as np +from numpy.typing import NDArray +from typing import cast + +from zarr_indexing import ( + DimensionGridLike, + IndexDomain, + IndexTransform, + LazyArray, + plan_chunks, +) + + +# --8<-- [start:coordinate-origin] +domain = IndexDomain(inclusive_min=(-2,), exclusive_max=(3,)) +assert domain.contains((-1,)) +assert domain.narrow(-1).inclusive_min == (-1,) + +values = np.array([10, 20, 30, 40, 50]) +assert LazyArray.from_numpy(values).lazy[-1:].result().tolist() == [50] +# --8<-- [end:coordinate-origin] + + +# --8<-- [start:prepend-grid] +class PrependableGrid: + """A regular grid whose coordinates may extend below zero.""" + + def index_to_chunk(self, index: int) -> int: + return index // 3 + + def chunk_offset(self, chunk: int) -> int: + return chunk * 3 + + def chunk_size(self, chunk: int) -> int: + return 3 + + def indices_to_chunks(self, indices: NDArray[np.intp]) -> NDArray[np.intp]: + return np.floor_divide(indices, 3).astype(np.intp) + + +projection, = plan_chunks( + IndexTransform.identity(IndexDomain((-3,), (0,))), + cast(tuple[DimensionGridLike], (PrependableGrid(),)), +) +assert projection.chunk_coords == (-1,) +assert projection.chunk_domain == IndexDomain((-3,), (0,)) +assert projection.chunk_transform.domain == IndexDomain((0,), (3,)) + + +assert projection.chunk_transform.domain == projection.cell_transform.domain +PREPEND_SHARED_CELL_COORDS = ((0,), (1,), (2,)) +prepend_shared_cell_points = np.asarray(PREPEND_SHARED_CELL_COORDS, dtype=np.intp) +PREPEND_CHUNK_LOCAL_COORDS = tuple( + tuple(point) + for point in projection.chunk_transform.apply_many(prepend_shared_cell_points).tolist() +) +PREPEND_REQUEST_COORDS = tuple( + tuple(point) + for point in projection.cell_transform.apply_many(prepend_shared_cell_points).tolist() +) +assert PREPEND_CHUNK_LOCAL_COORDS == ((0,), (1,), (2,)) +assert PREPEND_REQUEST_COORDS == ((-3,), (-2,), (-1,)) +# --8<-- [end:prepend-grid] diff --git a/packages/zarr-indexing/docs/snippets/indexing_patterns.py b/packages/zarr-indexing/docs/snippets/indexing_patterns.py new file mode 100644 index 0000000000..86ec75e4bc --- /dev/null +++ b/packages/zarr-indexing/docs/snippets/indexing_patterns.py @@ -0,0 +1,210 @@ +"""Every indexing idiom hand-built as an IndexTransform, proven against the compiler.""" + +from typing import Any, Literal, TypedDict + +import numpy as np + +from zarr_indexing import ( + ArrayMap, + ConstantMap, + DimensionMap, + IndexDomain, + IndexTransform, + ReadContext, + numpy_reader, +) + + +# --8<-- [start:indexing-patterns] +class PatternCase(TypedDict): + """One indexing idiom: its hand-built transform model and its NumPy result.""" + + name: str + mode: Literal["basic", "oindex", "vindex"] + selection: Any + transform: IndexTransform + expected: Any + shape: tuple[int, ...] + category: Literal["box", "query"] + + +image = np.arange(48).reshape(6, 8) +rows = np.array([4, 1, 1], dtype=np.intp) +columns = np.array([2, 5], dtype=np.intp) +mask = image % 5 == 0 +mask_rows, mask_columns = np.nonzero(mask) +vector_rows = np.array([4, 1, 1], dtype=np.intp) +vector_columns = np.array([2, 5, 2], dtype=np.intp) +broadcast_rows = np.array([[0], [3]], dtype=np.intp) +broadcast_columns = np.array([[1, 4, 6]], dtype=np.intp) + +PATTERN_CASES: tuple[PatternCase, ...] = ( + { + # image[1:5, ::2] — an offset picks where cell 0 reads; a stride skips. + "name": "basic-slice", + "mode": "basic", + "selection": (slice(1, 5), slice(None, None, 2)), + "transform": IndexTransform( + domain=IndexDomain.from_shape((4, 4)), + output=( + DimensionMap(input_dimension=0, offset=1), + DimensionMap(input_dimension=1, stride=2), + ), + ), + "expected": image[1:5, ::2], + "shape": (4, 4), + "category": "box", + }, + { + # image[2, :] — the dropped axis survives as a ConstantMap: the result + # is rank 1, but there is still one output map per source dimension. + "name": "integer-axis-removal", + "mode": "basic", + "selection": (2, slice(None)), + "transform": IndexTransform( + domain=IndexDomain.from_shape((8,)), + output=(ConstantMap(2), DimensionMap(input_dimension=0)), + ), + "expected": image[2, :], + "shape": (8,), + "category": "box", + }, + { + # image[::-2, :] — reversal is only a negative stride; the offset is + # where result cell 0 reads (the last selected row, 5). + "name": "negative-stride", + "mode": "basic", + "selection": (slice(None, None, -2), slice(None)), + "transform": IndexTransform( + domain=IndexDomain.from_shape((3, 8)), + output=( + DimensionMap(input_dimension=0, offset=5, stride=-2), + DimensionMap(input_dimension=1), + ), + ), + "expected": image[::-2, :], + "shape": (3, 8), + "category": "box", + }, + { + # image[2:2, :] — emptiness lives in the domain; the maps are ordinary. + "name": "empty-selection", + "mode": "basic", + "selection": (slice(2, 2), slice(None)), + "transform": IndexTransform( + domain=IndexDomain.from_shape((0, 8)), + output=( + DimensionMap(input_dimension=0, offset=2), + DimensionMap(input_dimension=1), + ), + ), + "expected": image[2:2, :], + "shape": (0, 8), + "category": "box", + }, + { + # image[mask] — a mask is its nonzero coordinates: two correlated + # ArrayMaps over one flat result axis, row i paired with column i. + "name": "boolean-mask", + "mode": "vindex", + "selection": mask, + "transform": IndexTransform( + domain=IndexDomain.from_shape((10,)), + output=(ArrayMap(mask_rows), ArrayMap(mask_columns)), + ), + "expected": image[mask], + "shape": (10,), + "category": "query", + }, + { + # image[np.ix_(rows, columns)] — the outer product is spelled by shape: + # each array varies over its own distinct axis, singleton on the other. + "name": "orthogonal", + "mode": "oindex", + "selection": (rows, columns), + "transform": IndexTransform( + domain=IndexDomain.from_shape((3, 2)), + output=(ArrayMap(rows.reshape(3, 1)), ArrayMap(columns.reshape(1, 2))), + ), + "expected": image[np.ix_(rows, columns)], + "shape": (3, 2), + "category": "query", + }, + { + # image[vector_rows, vector_columns] — pointwise: both arrays share + # the same axis, so entry i of each pairs into one coordinate. + "name": "vectorized", + "mode": "vindex", + "selection": (vector_rows, vector_columns), + "transform": IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(vector_rows), ArrayMap(vector_columns)), + ), + "expected": image[vector_rows, vector_columns], + "shape": (3,), + "category": "query", + }, + { + # image[broadcast_rows, broadcast_columns] — NumPy broadcasting, + # materialized: each map carries the full (2, 3) broadcast block. + "name": "broadcasting", + "mode": "vindex", + "selection": (broadcast_rows, broadcast_columns), + "transform": IndexTransform( + domain=IndexDomain.from_shape((2, 3)), + output=( + ArrayMap(np.broadcast_to(broadcast_rows, (2, 3))), + ArrayMap(np.broadcast_to(broadcast_columns, (2, 3))), + ), + ), + "expected": image[broadcast_rows, broadcast_columns], + "shape": (2, 3), + "category": "query", + }, + { + # image[rows, 2:6] — one lookup-table axis (repeats and order kept) + # beside one ordinary affine axis: one ArrayMap makes the whole + # selection a query. + "name": "repeated-out-of-order", + "mode": "oindex", + "selection": (rows, slice(2, 6)), + "transform": IndexTransform( + domain=IndexDomain.from_shape((3, 4)), + output=( + ArrayMap(rows.reshape(3, 1)), + DimensionMap(input_dimension=1, offset=2), + ), + ), + "expected": image[rows, 2:6], + "shape": (3, 4), + "category": "query", + }, +) + +base = IndexTransform.from_shape(image.shape) + + +def resolve(transform: IndexTransform) -> np.ndarray[Any, Any]: + """Materialize a transform against `image` through the public reader.""" + out = np.empty(transform.domain.shape, dtype=image.dtype) + numpy_reader.read_into(image, ReadContext(transform), out) + return out + + +for case in PATTERN_CASES: + transform = case["transform"] + + # The model is the idiom: shape, values, and category all follow from it. + assert transform.domain.shape == case["shape"] + np.testing.assert_array_equal(resolve(transform), case["expected"]) + is_query = any(isinstance(m, ArrayMap) for m in transform.output) + assert ("query" if is_query else "box") == case["category"] + + # The selection compiler derives the same transform. Compiled basic + # selections keep literal domains (t[1:5, ...] starts at 1, not 0); + # re-zeroing exposes the equality with the NumPy-shaped model. + compiled = base[case["selection"]] if case["mode"] == "basic" else ( + getattr(base, case["mode"])[case["selection"]] + ) + assert compiled.translate_domain_to((0,) * compiled.input_rank) == transform +# --8<-- [end:indexing-patterns] diff --git a/packages/zarr-indexing/docs/snippets/integrations.py b/packages/zarr-indexing/docs/snippets/integrations.py new file mode 100644 index 0000000000..5699c0d319 --- /dev/null +++ b/packages/zarr-indexing/docs/snippets/integrations.py @@ -0,0 +1,167 @@ +"""Boundaries for chunked-source and viewport consumers.""" + +from typing import Any + +import numpy as np + +from zarr_indexing import IndexDomain, LazyArray + + +# --8<-- [start:zarr-consumer] +class RecordingChunkSource: + """A decoded-chunk source keyed by public chunk coordinates.""" + + def __init__(self, chunks: dict[tuple[int, ...], np.ndarray[Any, Any]]) -> None: + self.chunks = chunks + self.reads: list[tuple[int, ...]] = [] + + def read(self, chunk_coords: tuple[int, ...]) -> np.ndarray[Any, Any]: + self.reads.append(chunk_coords) + return self.chunks[chunk_coords] + + +def _domain_points(domain: IndexDomain) -> np.ndarray[Any, np.dtype[np.intp]]: + """Enumerate a rectangular domain with a trailing coordinate axis.""" + if domain.ndim == 0: + return np.empty((1, 0), dtype=np.intp) + points = np.moveaxis(np.indices(domain.shape, dtype=np.intp), 0, -1).reshape( + -1, domain.ndim + ) + points += np.asarray(domain.inclusive_min, dtype=np.intp) + return points + + +def _gather_and_scatter( + destination: np.ndarray[Any, Any], + source: np.ndarray[Any, Any], + source_points: np.ndarray[Any, np.dtype[np.intp]], + destination_points: np.ndarray[Any, np.dtype[np.intp]], +) -> np.ndarray[Any, Any]: + """Gather and scatter a flattened point batch, including rank zero.""" + values = np.asarray(source[tuple(source_points.T)]).reshape(-1) + if destination_points.shape[-1] == 0: + destination[()] = values.reshape(destination.shape)[()] + else: + destination[tuple(destination_points.T)] = values + return values + + +zarr_image = np.arange(12).reshape(3, 4) +zarr_chunks = { + (chunk_row, chunk_column): zarr_image[ + chunk_row * 2 : (chunk_row + 1) * 2, + chunk_column * 2 : (chunk_column + 1) * 2, + ] + for chunk_row in range(2) + for chunk_column in range(2) +} +zarr_source = RecordingChunkSource(zarr_chunks) +zarr_view = LazyArray.from_numpy(zarr_image).with_parts((2, 2)).lazy[1, 0:4] +ZARR_RESULT = np.empty(zarr_view.shape, dtype=zarr_image.dtype) +shared_domains: list[tuple[IndexDomain, IndexDomain]] = [] +chunk_local_coords: list[tuple[tuple[int, ...], ...]] = [] +request_coords: list[tuple[tuple[int, ...], ...]] = [] +read_values: list[tuple[int, ...]] = [] + +for part in zarr_view.parts(): + projection = part.projection + assert projection.chunk_transform.domain == projection.cell_transform.domain + shared_domains.append( + (projection.chunk_transform.domain, projection.cell_transform.domain) + ) + domain = projection.chunk_transform.domain + cell_points = _domain_points(domain) + local_points_array = projection.chunk_transform.apply_many(cell_points) + result_points_array = projection.cell_transform.apply_many(cell_points) + chunk = zarr_source.read(projection.chunk_coords) + values_array = _gather_and_scatter( + ZARR_RESULT, chunk, local_points_array, result_points_array + ) + local_points = tuple(tuple(point) for point in local_points_array.tolist()) + result_points = tuple(tuple(point) for point in result_points_array.tolist()) + values = tuple(int(value) for value in values_array) + chunk_local_coords.append(local_points) + request_coords.append(result_points) + read_values.append(values) + +ZARR_SOURCE_KEYS = tuple(zarr_source.chunks) +ZARR_SOURCE_READS = tuple(zarr_source.reads) +ZARR_DISPATCHED_CHUNKS = ZARR_SOURCE_READS +ZARR_SHARED_DOMAINS = tuple(shared_domains) +ZARR_CHUNK_LOCAL_COORDS = tuple(chunk_local_coords) +ZARR_REQUEST_COORDS = tuple(request_coords) +ZARR_READ_VALUES = tuple(read_values) +assert ZARR_SOURCE_KEYS == ((0, 0), (0, 1), (1, 0), (1, 1)) +assert ZARR_SOURCE_READS == ((0, 0), (0, 1)) +assert ZARR_CHUNK_LOCAL_COORDS == (((1, 0), (1, 1)), ((1, 0), (1, 1))) +assert ZARR_REQUEST_COORDS == (((0,), (1,)), ((2,), (3,))) +assert ZARR_READ_VALUES == ((4, 5), (6, 7)) +assert ZARR_RESULT.tolist() == [4, 5, 6, 7] +# --8<-- [end:zarr-consumer] + + +# --8<-- [start:viewport-consumer] +class RecordingArray: + """An array-like source that records the basic reads it receives.""" + + def __init__(self, data: np.ndarray[Any, Any], chunks: tuple[int, ...]) -> None: + self._data = data + self.chunks = chunks + self.keys: list[tuple[slice, ...]] = [] + + @property + def shape(self) -> tuple[int, ...]: + return self._data.shape + + @property + def dtype(self) -> np.dtype[Any]: + return self._data.dtype + + def __getitem__(self, key: tuple[slice, ...]) -> np.ndarray[Any, Any]: + self.keys.append(key) + return self._data[key] + + +viewport_source = RecordingArray(np.arange(12).reshape(3, 4), chunks=(2, 2)) +viewport = LazyArray(viewport_source).lazy[1, 0:4] +VIEWPORT_READS_BEFORE_RESULT = tuple(viewport_source.keys) +assert VIEWPORT_READS_BEFORE_RESULT == () +assert viewport.result().tolist() == [4, 5, 6, 7] + +VIEWPORT_SOURCE_KEYS = tuple(viewport_source.keys) +VIEWPORT_SOURCE_CHUNKS = tuple( + (key[0].start // 2, key[1].start // 2) for key in VIEWPORT_SOURCE_KEYS +) +assert VIEWPORT_SOURCE_KEYS == ( + (slice(1, 2, 1), slice(0, 2, 1)), + (slice(1, 2, 1), slice(2, 4, 1)), +) +assert VIEWPORT_SOURCE_CHUNKS == ((0, 0), (0, 1)) +# --8<-- [end:viewport-consumer] + + +# --8<-- [start:dense-box-repartition] +def materialize(view: LazyArray) -> Any: + """Read a dense box as one slab; resolve everything else per part.""" + strides = view.strides() + if view.is_box and strides is not None and all(s == 1 for s in strides): + view = view.with_parts(view.base_shape) + return view.result() + + +slab_source = RecordingArray(np.arange(100).reshape(10, 10), chunks=(4, 4)) +slab = LazyArray(slab_source) + +dense = slab.lazy[2:9, 1:8] # a dense box: every stride 1 +assert materialize(dense).shape == (7, 7) +assert len(slab_source.keys) == 1 # one slab read; the source dispatches + +slab_source.keys.clear() +gather = slab.lazy.oindex[[0, 9], [0, 9]] # a query: keep the chunk parts +assert materialize(gather).tolist() == [[0, 9], [90, 99]] +assert len(slab_source.keys) == 4 # four covers, each inside one chunk +assert all( + (key[0].stop - key[0].start) * (key[1].stop - key[1].start) == 1 + for key in slab_source.keys +) +# --8<-- [end:dense-box-repartition] diff --git a/packages/zarr-indexing/docs/snippets/lazy_composition.py b/packages/zarr-indexing/docs/snippets/lazy_composition.py new file mode 100644 index 0000000000..a4d9884b2b --- /dev/null +++ b/packages/zarr-indexing/docs/snippets/lazy_composition.py @@ -0,0 +1,14 @@ +"""Composing views keeps indexing lazy until the final result call.""" + +import numpy as np + +from zarr_indexing import LazyArray + + +# --8<-- [start:lazy-composition] +source = np.array([10, 11, 12, 13, 14, 15]) +view = LazyArray.from_numpy(source).lazy[2:5] +composed = view.lazy[::-1].lazy[1:] + +assert composed.result().tolist() == source[2:5][::-1][1:].tolist() +# --8<-- [end:lazy-composition] diff --git a/packages/zarr-indexing/docs/snippets/output_maps.py b/packages/zarr-indexing/docs/snippets/output_maps.py new file mode 100644 index 0000000000..a78fc73b50 --- /dev/null +++ b/packages/zarr-indexing/docs/snippets/output_maps.py @@ -0,0 +1,67 @@ +"""The three output map kinds, each demonstrated against its NumPy counterpart.""" + +from typing import Any + +import numpy as np + +from zarr_indexing import ( + ArrayMap, + ConstantMap, + DimensionMap, + IndexDomain, + IndexTransform, + ReadContext, + numpy_reader, +) + +# --8<-- [start:resolve-helper] +source = np.array([10, 11, 12, 13, 14, 15]) + + +def resolve(transform: IndexTransform, values: np.ndarray[Any, Any]) -> np.ndarray[Any, Any]: + """Materialize `transform` against `values` through the public reader.""" + out = np.empty(transform.domain.shape, dtype=values.dtype) + numpy_reader.read_into(values, ReadContext(transform), out) + return out +# --8<-- [end:resolve-helper] + + +# --8<-- [start:dimension-map] +# DimensionMap is an affine rule: request i reads source offset + stride * i. +# Its NumPy counterpart is a basic slice. +sliced = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(DimensionMap(input_dimension=0, offset=2, stride=1),), +) +assert resolve(sliced, source).tolist() == source[2:5].tolist() + +# A negative stride walks the source backward, like a negative-step slice. +reversed_view = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(DimensionMap(input_dimension=0, offset=4, stride=-2),), +) +assert resolve(reversed_view, source).tolist() == source[4::-2].tolist() +# --8<-- [end:dimension-map] + +# --8<-- [start:array-map] +# ArrayMap is an explicit list of source coordinates; order and duplicates +# are semantic. Its NumPy counterpart is fancy indexing. +gather = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(ArrayMap(index_array=np.array([4, 1, 1])),), +) +assert resolve(gather, source).tolist() == source[[4, 1, 1]].tolist() +# --8<-- [end:array-map] + +# --8<-- [start:constant-map] +# ConstantMap reads one source coordinate for every request cell. No NumPy +# selection spells this operation: source[0] drops the axis, and a repeated +# fancy index source[[0, 0, 0, 0]] matches the values but degrades the +# description to a coordinate list. The value-faithful counterpart is a +# broadcast. +repeat = IndexTransform( + domain=IndexDomain.from_shape((4,)), + output=(ConstantMap(offset=0),), +) +assert resolve(repeat, source).tolist() == np.broadcast_to(source[0:1], (4,)).tolist() +# --8<-- [end:constant-map] diff --git a/packages/zarr-indexing/examples/lazy_indexing_dask/README.md b/packages/zarr-indexing/examples/lazy_indexing_dask/README.md new file mode 100644 index 0000000000..c9edb903ef --- /dev/null +++ b/packages/zarr-indexing/examples/lazy_indexing_dask/README.md @@ -0,0 +1,55 @@ +# Lazy Indexing with Dask + +This example demonstrates how to use `zarr_indexing.LazyArray` with Dask, both as +an array Dask can wrap and as a source of independent tasks, and compares the two +ways of deferring an indexing operation. + +The example shows how to: + +- Pass a `LazyArray` — over a Zarr array or over a view of one — to + `dask.array.from_array` +- Build one Dask task per partition from `parts()`, compute them in parallel, and + place each result with the partition's `out_selection` +- Read `is_complete` to tell which partitions cover a stored chunk completely +- Rely on `__dask_tokenize__`, so that equal selections produce equal tokens and + Dask can cache and deduplicate the work +- Measure what a task graph costs for indexing-only work, against composing the + same selections into one transform + +A `LazyArray` exposes no `chunks` attribute, so `dask.array.from_array` chooses +its own block size unless one is given. The partitioning that `parts()` reports +is discovered from the wrapped array and is independent of Dask's blocks. + +## Choosing Between Them + +If Dask is doing arithmetic across chunks, reductions, rechunking, or distributed +execution, it is the right tool, and its task graph is what makes that work. + +If Dask is used *only* to defer indexing — take a view now, read it later, with +no computation in between — then the graph is overhead. Dask slices the chunk +grid on every indexing operation and records another layer, so composing +selections costs time proportional to both the depth of the chain and the number +of chunks in the array, and reading walks what was accumulated. `LazyArray` +composes each selection into the single transform it already holds, so composing +is independent of the depth of the chain, and reading enumerates only the +partitions the selection touches. The last test in this example prints both, and +the gap widens with the number of chunks and the number of selections. + +## Running the Example + +The script declares its dependencies inline +([PEP 723](https://peps.python.org/pep-0723/)), so the easiest way to run it is +with [uv](https://docs.astral.sh/uv/), which installs them automatically: + +```bash +cd packages/zarr-indexing +uv run --with-editable . examples/lazy_indexing_dask/lazy_indexing_dask.py +``` + +Alternatively, run it with plain Python, in which case you must first install +`zarr`, `zarr-indexing`, `dask[array]`, `numpy`, and `pytest` yourself: + +```bash +cd packages/zarr-indexing +python examples/lazy_indexing_dask/lazy_indexing_dask.py +``` diff --git a/packages/zarr-indexing/examples/lazy_indexing_dask/lazy_indexing_dask.py b/packages/zarr-indexing/examples/lazy_indexing_dask/lazy_indexing_dask.py new file mode 100644 index 0000000000..d6ed43f322 --- /dev/null +++ b/packages/zarr-indexing/examples/lazy_indexing_dask/lazy_indexing_dask.py @@ -0,0 +1,181 @@ +# /// script +# requires-python = ">=3.12" +# dependencies = [ +# "zarr @ git+https://github.com/zarr-developers/zarr-python.git@main", +# "zarr-indexing>=0.1", +# "dask[array]==2025.3.0", +# "numpy==2.4.3", +# "pytest==9.0.2" +# ] +# /// +# + +""" +Demonstrate using zarr_indexing.LazyArray with Dask +""" + +import sys +import time + +import dask +import dask.array as da +import numpy as np +import pytest +import zarr +from dask.base import tokenize + +from zarr_indexing import LazyArray + + +@pytest.fixture +def source() -> zarr.Array: + """A chunked Zarr array to wrap.""" + array = zarr.create_array(store={}, shape=(40, 30), chunks=(10, 10), dtype="i4") + array[:] = np.arange(40 * 30).reshape(40, 30) + return array + + +def test_from_array(source: zarr.Array) -> None: + """Hand a LazyArray to `dask.array.from_array`.""" + lazy = LazyArray(source) + + # `from_array` needs `shape`, `dtype`, and `__getitem__`, which the wrapper + # provides. Each Dask block reads its own region through the wrapper. + array = da.from_array(lazy, chunks=(10, 10)) + print(array) + assert np.array_equal(array.compute(scheduler="threads"), source[:]) + + # A view works the same way, and its shape is the shape of the selection. + view = LazyArray(source).lazy[5:35, 3:27] + array = da.from_array(view, chunks=(10, 10)) + assert array.shape == (30, 24) + assert np.array_equal(array.compute(scheduler="threads"), source[5:35, 3:27]) + + +def test_parts_as_tasks(source: zarr.Array) -> None: + """Build one task per partition and compute them in parallel.""" + view = LazyArray(source).lazy[5:35, 3:27] + + # The partitioning is discovered from the wrapped array's chunks, so each + # partition of the view lies within one stored chunk. + parts = list(view.parts()) + print(f"{len(parts)} parts for a {view.shape} view of a {source.shape} array") + + # A partition carries a sub-view to resolve and where its result belongs, so + # the reads are independent and the placement needs no coordination. + @dask.delayed + def read(part: object) -> np.ndarray: + return part.view.result() + + blocks = dask.compute(*[read(part) for part in parts], scheduler="threads") + + result = np.empty(view.shape, dtype=view.dtype) + for part, block in zip(parts, blocks, strict=True): + result[part.out_selection] = block + assert np.array_equal(result, source[5:35, 3:27]) + + # `is_complete` reports whether a partition covers its whole partition of + # the base array, which a writer uses to choose between overwriting a chunk + # and reading it first. + complete = [part.box for part in parts if part.is_complete] + print(f"{len(complete)} of {len(parts)} parts cover their chunk completely") + + +def test_tokenize(source: zarr.Array) -> None: + """Deterministic tokens let Dask cache and deduplicate work.""" + lazy = LazyArray(source) + + # Two wrappers over the same array and the same selection are the same task + # to Dask, whether or not they are the same Python object. + assert tokenize(lazy) == tokenize(LazyArray(source)) + assert tokenize(lazy.lazy[0:10]) == tokenize(LazyArray(source).lazy[0:10]) + + # Different selections are different tasks. + assert tokenize(lazy.lazy[0:10]) != tokenize(lazy.lazy[10:20]) + + # Selections that describe the same region are the same task, however they + # were composed. + assert tokenize(lazy.lazy[0:20].lazy[5:10]) == tokenize(lazy.lazy[5:10]) + + +def test_indexing_only_workload() -> None: + """Compare an accumulating task graph with a fused transform. + + Dask records each indexing operation as another graph layer, and slices the + chunk grid to build it, so composing selections costs time proportional to + the number of selections and the number of chunks. `LazyArray` composes each + selection into the single transform it already holds, so the cost of + composing does not grow with the depth of the chain, and reading resolves + that one transform rather than walking a graph. + + Timings are printed rather than asserted, since they depend on the machine. + """ + data = np.zeros((2000, 4), dtype="i4") # 2000 chunks, one row each + + def dask_chain(depth: int) -> da.Array: + array = da.from_array(data, chunks=(1, 4)) + for _ in range(depth): + array = array[1:] + return array + + def lazy_chain(depth: int) -> LazyArray: + view = LazyArray.from_numpy(data) + for _ in range(depth): + view = view.lazy[1:] + return view + + # Read once through each path first, so the timings below exclude the cost + # of importing and initializing the machinery. + dask_chain(1)[:2].compute(scheduler="synchronous") + lazy_chain(1).lazy[:2].result() + + header = ( + f"{'selections':>10} {'dask compose':>13} {'dask read':>10} {'layers':>7}" + f" {'LazyArray compose':>18} {'LazyArray read':>15}" + ) + print(header) + for depth in (1, 5, 20): + start = time.perf_counter() + chained = dask_chain(depth) + dask_compose = time.perf_counter() - start + + start = time.perf_counter() + from_dask = chained[:2].compute(scheduler="synchronous") + dask_read = time.perf_counter() - start + + start = time.perf_counter() + view = lazy_chain(depth) + lazy_compose = time.perf_counter() - start + + start = time.perf_counter() + from_lazy = view.lazy[:2].result() + lazy_read = time.perf_counter() - start + + # Both paths describe the same selection, so they read the same data. + assert np.array_equal(from_dask, from_lazy) + + layers = len(chained.__dask_graph__().layers) + print( + f"{depth:>10} {dask_compose * 1e3:>12.2f}ms {dask_read * 1e3:>9.2f}ms {layers:>7}" + f" {lazy_compose * 1e3:>17.3f}ms {lazy_read * 1e3:>14.3f}ms" + ) + + +if __name__ == "__main__": + # Run the example with printed output, and a dummy pytest configuration file specified. + # Without the dummy configuration file, at test time pytest will attempt to use the + # configuration file in the project root, which will error because Zarr is using some + # plugins that are not installed in this example. + sys.exit( + pytest.main( + [ + "-s", + __file__, + f"-c {__file__}", + # Suppress: "PytestAssertRewriteWarning: Module already imported so + # cannot be rewritten; zarr" + "-W", + "ignore::pytest.PytestAssertRewriteWarning", + ] + ) + ) diff --git a/packages/zarr-indexing/examples/lazy_indexing_numpy/README.md b/packages/zarr-indexing/examples/lazy_indexing_numpy/README.md new file mode 100644 index 0000000000..e76e065047 --- /dev/null +++ b/packages/zarr-indexing/examples/lazy_indexing_numpy/README.md @@ -0,0 +1,38 @@ +# Lazy Indexing a NumPy Array + +This example demonstrates how to wrap an array in `zarr_indexing.LazyArray` and +index it without reading data. + +The example shows how to: + +- Wrap a NumPy array and read the forwarded `shape`, `dtype`, and `ndim` +- Compose selections through `.lazy[...]`, `.lazy.oindex[...]`, and + `.lazy.vindex[...]`, and materialize the composed view once with `result()` +- Tell a box selection (slices and integers, described by an interval and a step + per dimension) from a query selection (points gathered through an index array) + using `is_box`, `bounding_box()`, and `strides()` +- Declare a partitioning with `with_parts()`, iterate it with `parts()`, and + assemble a result from the partitions + +`LazyArray` wraps any object exposing `shape`, `dtype`, and `__getitem__`, so the +same API applies to a Zarr array, and the partitioning is then discovered from +the array's chunks. The Dask example covers that case. + +## Running the Example + +The script declares its dependencies inline +([PEP 723](https://peps.python.org/pep-0723/)), so the easiest way to run it is +with [uv](https://docs.astral.sh/uv/), which installs them automatically: + +```bash +cd packages/zarr-indexing +uv run --with-editable . examples/lazy_indexing_numpy/lazy_indexing_numpy.py +``` + +Alternatively, run it with plain Python, in which case you must first install +`zarr-indexing`, `numpy`, and `pytest` yourself: + +```bash +cd packages/zarr-indexing +python examples/lazy_indexing_numpy/lazy_indexing_numpy.py +``` diff --git a/packages/zarr-indexing/examples/lazy_indexing_numpy/lazy_indexing_numpy.py b/packages/zarr-indexing/examples/lazy_indexing_numpy/lazy_indexing_numpy.py new file mode 100644 index 0000000000..ae29a7fc51 --- /dev/null +++ b/packages/zarr-indexing/examples/lazy_indexing_numpy/lazy_indexing_numpy.py @@ -0,0 +1,133 @@ +# /// script +# requires-python = ">=3.12" +# dependencies = [ +# "zarr-indexing>=0.1", +# "numpy==2.4.3", +# "pytest==9.0.2" +# ] +# /// +# + +""" +Demonstrate lazy indexing over a plain NumPy array with zarr_indexing.LazyArray +""" + +import sys + +import numpy as np +import pytest + +from zarr_indexing import LazyArray + + +def test_wrap_and_compose() -> None: + """Wrap an array, compose selections without reading, then materialize once.""" + data = np.arange(12 * 8).reshape(12, 8) + lazy = LazyArray.from_numpy(data) + + # The wrapper forwards the attributes an array consumer expects. + assert lazy.shape == (12, 8) + assert lazy.dtype == data.dtype + assert lazy.ndim == 2 + + # `.lazy[...]` returns another LazyArray. No element of `data` is read. + view = lazy.lazy[2:10, ::2] + print(view) + assert view.shape == (8, 4) + + # Selections compose. Each step narrows the view; still nothing is read. + smaller = view.lazy[1:5, 1:3] + + # `result()` performs the read. NumPy is the reference for the whole chain. + assert np.array_equal(smaller.result(), data[2:10, ::2][1:5, 1:3]) + + # Selections use positional NumPy semantics: indices count from zero within + # the current view, and negative indices count from the end. + assert np.array_equal(lazy.lazy[-1].result(), data[-1]) + assert np.array_equal(lazy.lazy[::-1].result(), data[::-1]) + + # Orthogonal and vectorized indexing are available under the same accessor. + rows = np.array([9, 1, 4]) + assert np.array_equal(lazy.lazy.oindex[rows, :].result(), data[rows, :]) + cols = np.array([0, 3, 7]) + assert np.array_equal(lazy.lazy.vindex[rows, cols].result(), data[rows, cols]) + + # A LazyArray is also an ordinary duck array: __getitem__ reads immediately, + # and np.asarray materializes the view. + assert np.array_equal(lazy[2:4, 0], data[2:4, 0]) + assert np.array_equal(np.asarray(view), data[2:10, ::2]) + + +def test_box_and_query_selections() -> None: + """Distinguish selections that describe a region from selections that gather points.""" + data = np.arange(12 * 8).reshape(12, 8) + lazy = LazyArray.from_numpy(data) + + # A box selection is built from slices and integers alone. It is described + # completely by an interval and a step per dimension, so a consumer can + # serve it as one strided read. + box = lazy.lazy[2:10, ::2] + print(f"box: is_box={box.is_box} bounding_box={box.bounding_box()} strides={box.strides()}") + assert box.is_box + assert box.bounding_box() == ((2, 10), (0, 7)) + assert box.strides() == (1, 2) + + # A query selection gathers points through an index array. Its coordinates + # are a lookup table, so `strides()` is undefined and `bounding_box()` is + # the hull of the points rather than an exact description. + query = lazy.lazy.oindex[np.array([9, 1, 4]), :] + print(f"query: is_box={query.is_box} bounding_box={query.bounding_box()}") + assert not query.is_box + assert query.strides() is None + assert query.bounding_box() == ((1, 10), (0, 8)) + + # Composing a box onto a query keeps it a query. + assert not query.lazy[0:2, 0:2].is_box + + +def test_parts() -> None: + """Iterate the partitions a view covers, and assemble the result from them.""" + data = np.arange(12 * 8).reshape(12, 8) + + # A plain NumPy array declares no partitioning, so `with_parts` states one. + # Partitioning changes the granularity of reads, never the result. + lazy = LazyArray.from_numpy(data).with_parts((4, 4)) + view = lazy.lazy[2:10, ::2] + + parts = list(view.parts()) + print(f"{len(parts)} parts") + for part in parts[:2]: + print(f" base_coords={part.base_coords} box={part.box} complete={part.is_complete}") + + # Each part carries a sub-view of its own, where that sub-view lands in the + # result, and whether it covers its partition completely. Resolving the + # parts and placing them is what `result()` does. + assembled = np.empty(view.shape, dtype=view.dtype) + for part in parts: + assembled[part.out_selection] = part.view.result() + assert np.array_equal(assembled, view.result()) + + # The partitioning is a read strategy, so a different one gives the same data. + assert np.array_equal( + LazyArray.from_numpy(data).with_parts((5, 3)).lazy[2:10, ::2].result(), assembled + ) + + +if __name__ == "__main__": + # Run the example with printed output, and a dummy pytest configuration file specified. + # Without the dummy configuration file, at test time pytest will attempt to use the + # configuration file in the project root, which will error because Zarr is using some + # plugins that are not installed in this example. + sys.exit( + pytest.main( + [ + "-s", + __file__, + f"-c {__file__}", + # Suppress: "PytestAssertRewriteWarning: Module already imported so + # cannot be rewritten; zarr" + "-W", + "ignore::pytest.PytestAssertRewriteWarning", + ] + ) + ) diff --git a/packages/zarr-indexing/examples/system_memory_chunk_cache/README.md b/packages/zarr-indexing/examples/system_memory_chunk_cache/README.md new file mode 100644 index 0000000000..d6271f9401 --- /dev/null +++ b/packages/zarr-indexing/examples/system_memory_chunk_cache/README.md @@ -0,0 +1,46 @@ +# System-memory chunk cache + +This executable reference architecture demonstrates a small, synchronous +system-memory chunk cache for a NumPy-like image consumer. It is inspired by +Neuroglancer's explicit chunk lifecycle: + +```text +NEW -> QUEUED -> LOADING -> READY + | + v + FAILED + +READY -> EVICTED +FAILED -> QUEUED (explicit retry) +``` + +`RecordingChunkSource` owns decoded source-chunk reads and records them for the +example. `LazyArray` converts NumPy-style indexing into transforms and +partitions, then assembles the final result. `SystemMemoryChunkReader` +intercepts each materialized part and owns the lifecycle records, queue +draining, resident ready buffers, LRU eviction, retained load failures, and +explicit retry. The reader owns cache state and source reads, but not result +shape or assembly. + +Each request calls `view.parts()` once and keeps the resulting tuple. The cache +pins the tuple's chunk coordinates, then materializes with +`view.result(parts=parts)`, so scheduling and assembly reuse one plan. Every +reader call consumes the exact projection attached to its `ReadContext`; the +reader does not invoke the chunk planner again. + +The requests demonstrate lazy selections, paired chunk projections, overlapping +viewport requests that reuse resident chunks, eviction under capacity pressure, +a retained failure that does not retry implicitly, and an explicit retry after +the source is repaired. The integration guide contains the detailed request +table. + +This is synchronous system-memory reference architecture, not a +production-ready cache, scheduler, renderer, or complete napari integration. +Its types are intentionally not exported by `zarr_indexing`. + +## Running the example + +```bash +cd packages/zarr-indexing +uv run --with-editable . examples/system_memory_chunk_cache/system_memory_chunk_cache.py +``` diff --git a/packages/zarr-indexing/examples/system_memory_chunk_cache/system_memory_chunk_cache.py b/packages/zarr-indexing/examples/system_memory_chunk_cache/system_memory_chunk_cache.py new file mode 100644 index 0000000000..1645d89b2c --- /dev/null +++ b/packages/zarr-indexing/examples/system_memory_chunk_cache/system_memory_chunk_cache.py @@ -0,0 +1,432 @@ +# /// script +# requires-python = ">=3.12" +# dependencies = [ +# "zarr-indexing>=0.1", +# "numpy==2.4.3", +# ] +# /// +# +from __future__ import annotations + +from contextlib import contextmanager +from dataclasses import dataclass +from enum import StrEnum +from typing import TYPE_CHECKING, Any + +import numpy as np + +from zarr_indexing import ( + IndexDomain, + LazyArray, + ReadContext, +) + +if TYPE_CHECKING: + from collections.abc import Callable, Iterator + + +type ChunkCoords = tuple[int, ...] + + +# --8<-- [start:chunk-cache-types] +class ChunkState(StrEnum): + NEW = "new" + QUEUED = "queued" + LOADING = "loading" + READY = "ready" + FAILED = "failed" + EVICTED = "evicted" + + +@dataclass(slots=True) +class ChunkRecord: + state: ChunkState = ChunkState.NEW + buffer: np.ndarray[Any, Any] | None = None + error: Exception | None = None + last_access: int = -1 + + +@dataclass(frozen=True, slots=True) +class ChunkEvent: + chunk_coords: ChunkCoords + previous: ChunkState + current: ChunkState + reason: str + + +class ChunkLoadError(RuntimeError): + pass + + +# --8<-- [end:chunk-cache-types] + + +# --8<-- [start:chunk-cache-source] +class RecordingChunkSource: + def __init__(self, data: np.ndarray[Any, Any], chunks: tuple[int, ...]) -> None: + self._data = data + self.chunks = chunks + self.reads: list[ChunkCoords] = [] + self.failures: set[ChunkCoords] = set() + + @property + def shape(self) -> tuple[int, ...]: + return self._data.shape + + @property + def dtype(self) -> np.dtype[Any]: + return self._data.dtype + + def __getitem__(self, key: Any) -> np.ndarray[Any, Any]: + raise AssertionError("the cache must read complete chunks through read_chunk") + + def read_chunk(self, chunk_coords: ChunkCoords) -> np.ndarray[Any, Any]: + self.reads.append(chunk_coords) + if chunk_coords in self.failures: + raise OSError(f"source read failed for chunk {chunk_coords}") + key = tuple( + slice(coord * size, min((coord + 1) * size, extent)) + for coord, size, extent in zip(chunk_coords, self.chunks, self.shape, strict=True) + ) + return self._data[key].copy() + + +def _domain_points(domain: IndexDomain) -> np.ndarray[Any, np.dtype[np.intp]]: + """Enumerate a rectangular domain with a trailing coordinate axis.""" + if domain.ndim == 0: + return np.empty((1, 0), dtype=np.intp) + points = np.moveaxis(np.indices(domain.shape, dtype=np.intp), 0, -1).reshape(-1, domain.ndim) + points += np.asarray(domain.inclusive_min, dtype=np.intp) + return points + + +def _gather_and_scatter( + destination: np.ndarray[Any, Any], + source: np.ndarray[Any, Any], + source_points: np.ndarray[Any, np.dtype[np.intp]], + destination_points: np.ndarray[Any, np.dtype[np.intp]], +) -> np.ndarray[Any, Any]: + """Gather and scatter a flattened point batch, including rank zero.""" + values = np.asarray(source[tuple(source_points.T)]).reshape(-1) + if destination_points.shape[-1] == 0: + destination[()] = values.reshape(destination.shape)[()] + else: + destination[tuple(destination_points.T)] = values + return values + + +# --8<-- [end:chunk-cache-source] + + +# --8<-- [start:chunk-cache-wrapper] +LEGAL_TRANSITIONS: dict[ChunkState, frozenset[ChunkState]] = { + ChunkState.NEW: frozenset({ChunkState.QUEUED}), + ChunkState.QUEUED: frozenset({ChunkState.LOADING}), + ChunkState.LOADING: frozenset({ChunkState.READY, ChunkState.FAILED}), + ChunkState.READY: frozenset({ChunkState.EVICTED}), + ChunkState.FAILED: frozenset({ChunkState.QUEUED}), + ChunkState.EVICTED: frozenset({ChunkState.QUEUED}), +} + + +class _OrthogonalIndexer: + """Expose outer-product indexing without changing ``cache[key]`` semantics.""" + + def __init__(self, getitem: Callable[[Any], np.ndarray[Any, Any]]) -> None: + self._getitem = getitem + + def __getitem__(self, key: Any) -> np.ndarray[Any, Any]: + return self._getitem(key) + + +class SystemMemoryChunkReader: + def __init__(self, *, capacity: int) -> None: + self.capacity = capacity + self._records: dict[ChunkCoords, ChunkRecord] = {} + self._queue: list[ChunkCoords] = [] + self._clock = 0 + self._requests = 0 + self.events: list[ChunkEvent] = [] + self.projection_uses: list[tuple[str, str]] = [] + + def state(self, chunk_coords: ChunkCoords) -> ChunkState: + return self._record(chunk_coords).state + + def resident(self) -> tuple[ChunkCoords, ...]: + return tuple( + sorted( + coords + for coords, record in self._records.items() + if record.state is ChunkState.READY + ) + ) + + def _record(self, chunk_coords: ChunkCoords) -> ChunkRecord: + return self._records.setdefault(chunk_coords, ChunkRecord()) + + def _transition(self, chunk_coords: ChunkCoords, current: ChunkState, reason: str) -> None: + record = self._record(chunk_coords) + if current not in LEGAL_TRANSITIONS[record.state]: + raise ValueError(f"illegal chunk transition {record.state} -> {current}") + previous = record.state + record.state = current + self.events.append(ChunkEvent(chunk_coords, previous, current, reason)) + + def retry(self, chunk_coords: ChunkCoords) -> None: + record = self._record(chunk_coords) + if record.state is not ChunkState.FAILED: + raise ValueError(f"retry requires failed chunk {chunk_coords}, got {record.state}") + record.error = None + self._transition(chunk_coords, ChunkState.QUEUED, "explicit retry") + self._queue.append(chunk_coords) + + @contextmanager + def request(self, required: tuple[ChunkCoords, ...]) -> Iterator[None]: + """Prepare every part and defer eviction until one request completes.""" + self._prepare(required) + self._requests += 1 + try: + yield + except Exception: + self._requests -= 1 + raise + else: + self._requests -= 1 + if self._requests == 0: + self._evict(pinned=frozenset()) + + def _touch(self, record: ChunkRecord) -> None: + self._clock += 1 + record.last_access = self._clock + + def _queue_once(self, chunk_coords: ChunkCoords) -> None: + record = self._record(chunk_coords) + if record.state in {ChunkState.QUEUED, ChunkState.LOADING, ChunkState.READY}: + return + if record.state is ChunkState.FAILED: + raise ValueError(f"failed chunk {chunk_coords} requires explicit retry") + self._transition(chunk_coords, ChunkState.QUEUED, "requested") + self._queue.append(chunk_coords) + + def _prepare(self, required: tuple[ChunkCoords, ...]) -> None: + for chunk_coords in required: + record = self._record(chunk_coords) + if record.state is ChunkState.FAILED: + assert record.error is not None + raise ChunkLoadError( + f"chunk {chunk_coords} is failed; call retry first" + ) from record.error + + for chunk_coords in required: + record = self._record(chunk_coords) + if record.state is ChunkState.READY: + self._touch(record) + else: + self._queue_once(chunk_coords) + + def _ensure_ready( + self, + source: RecordingChunkSource, + required: tuple[ChunkCoords, ...], + ) -> None: + if self._requests == 0: + self._prepare(required) + self._drain(source, frozenset(required)) + + def _drain(self, source: RecordingChunkSource, required: frozenset[ChunkCoords]) -> None: + pending = self._queue + self._queue = [] + for index, chunk_coords in enumerate(pending): + if chunk_coords not in required: + self._queue.append(chunk_coords) + continue + record = self._record(chunk_coords) + self._transition(chunk_coords, ChunkState.LOADING, "queue drained") + try: + record.buffer = source.read_chunk(chunk_coords) + except OSError as error: + record.buffer = None + record.error = error + self._transition(chunk_coords, ChunkState.FAILED, "source read failed") + self._queue.extend(pending[index + 1 :]) + raise ChunkLoadError(f"could not load chunk {chunk_coords}") from error + record.error = None + self._transition(chunk_coords, ChunkState.READY, "source read completed") + self._touch(record) + + def _evict(self, *, pinned: frozenset[ChunkCoords]) -> None: + while len(self.resident()) > self.capacity: + candidates = ( + (record.last_access, chunk_coords) + for chunk_coords, record in self._records.items() + if record.state is ChunkState.READY and chunk_coords not in pinned + ) + _, chunk_coords = min(candidates) + record = self._record(chunk_coords) + record.buffer = None + self._transition(chunk_coords, ChunkState.EVICTED, "LRU capacity") + + def read_into( + self, + source: RecordingChunkSource, + context: ReadContext, + out: np.ndarray[Any, Any], + /, + ) -> None: + projection = context.projection + if projection is None: + raise ValueError("SystemMemoryChunkReader requires context.projection") + required = (projection.chunk_coords,) + self._ensure_ready(source, required) + record = self._record(projection.chunk_coords) + assert record.buffer is not None + cell_points = _domain_points(projection.chunk_transform.domain) + chunk_points = projection.chunk_transform.apply_many(cell_points) + destination_points = _domain_points(context.transform.domain) + _gather_and_scatter(out, record.buffer, chunk_points, destination_points) + self.projection_uses.append(("chunk_transform", "context.transform")) + if self._requests == 0: + self._evict(pinned=frozenset()) + + +class SystemMemoryChunkCache: + def __init__(self, source: RecordingChunkSource, *, capacity: int) -> None: + self.source = source + self.reader = SystemMemoryChunkReader(capacity=capacity) + self._lazy = LazyArray(source).with_reader(self.reader) + + @property + def shape(self) -> tuple[int, ...]: + return self.source.shape + + @property + def dtype(self) -> np.dtype[Any]: + return self.source.dtype + + @property + def oindex(self) -> _OrthogonalIndexer: + return _OrthogonalIndexer(lambda key: self._read(key, orthogonal=True)) + + @property + def events(self) -> list[ChunkEvent]: + return self.reader.events + + @property + def projection_uses(self) -> tuple[tuple[str, str], ...]: + return tuple(self.reader.projection_uses) + + def state(self, chunk_coords: ChunkCoords) -> ChunkState: + return self.reader.state(chunk_coords) + + def resident(self) -> tuple[ChunkCoords, ...]: + return self.reader.resident() + + def retry(self, chunk_coords: ChunkCoords) -> None: + self.reader.retry(chunk_coords) + + def __getitem__(self, key: Any) -> np.ndarray[Any, Any]: + return self._read(key, orthogonal=False) + + def _read(self, key: Any, *, orthogonal: bool) -> np.ndarray[Any, Any]: + self.reader.projection_uses.clear() + lazy = self._lazy.lazy + view = lazy.oindex[key] if orthogonal else lazy[key] + # One prepared tuple is the request plan: pin from it, then hand the + # same owned parts back to LazyArray for assembly without replanning. + parts = tuple(view.parts()) + required = tuple(dict.fromkeys(part.base_coords for part in parts)) + with self.reader.request(required): + return np.asarray(view.result(parts=parts)) + + +# --8<-- [end:chunk-cache-wrapper] + + +# --8<-- [start:chunk-cache-worked-example] +image = np.arange(48).reshape(6, 8) +source = RecordingChunkSource(image, chunks=(3, 4)) +cache = SystemMemoryChunkCache(source, capacity=2) + +READS_BEFORE_SELECTION = tuple(source.reads) +INITIAL_RESULT = cache[1:5, 2] +INITIAL_READS = tuple(source.reads) + +before_overlap = len(source.reads) +OVERLAP_RESULT = cache[3:5, 2] +OVERLAP_NEW_READS = tuple(source.reads[before_overlap:]) + +before_eviction = len(source.reads) +EVICTION_RESULT = cache[0:2, 5] +EVICTION_NEW_READS = tuple(source.reads[before_eviction:]) +AFTER_EVICTION_RESIDENT = cache.resident() + +before_reload = len(source.reads) +RELOAD_RESULT = cache[1:5, 2] +RELOAD_NEW_READS = tuple(source.reads[before_reload:]) +AFTER_RELOAD_RESIDENT = cache.resident() + +source.failures.add((1, 1)) +failed_once = False +try: + cache[3:5, 4:6] +except ChunkLoadError: + failed_once = True +assert failed_once +FAILED_READ_COUNT = source.reads.count((1, 1)) +failed_twice = False +try: + cache[3:5, 4:6] +except ChunkLoadError: + failed_twice = True +assert failed_twice +FAILED_REPEAT_READ_COUNT = source.reads.count((1, 1)) +FAILURE_READ_COUNTS = (FAILED_READ_COUNT, FAILED_REPEAT_READ_COUNT) + +source.failures.remove((1, 1)) +cache.retry((1, 1)) +before_retry = len(source.reads) +RETRY_RESULT = cache[3:5, 4:6] +RETRY_NEW_READS = tuple(source.reads[before_retry:]) +RETRY_STATE = cache.state((1, 1)).value +WORKED_EVENTS = tuple(cache.events) +FAILED_TRANSITIONS = tuple( + event.current.value for event in WORKED_EVENTS if event.chunk_coords == (1, 1) +) +FAILED_EVENT_ROWS = tuple( + (event.previous.value, event.current.value, event.reason) + for event in WORKED_EVENTS + if event.chunk_coords == (1, 1) +) +# --8<-- [end:chunk-cache-worked-example] + +assert READS_BEFORE_SELECTION == () +assert INITIAL_RESULT.tolist() == [10, 18, 26, 34] +assert INITIAL_READS == ((0, 0), (1, 0)) +assert OVERLAP_RESULT.tolist() == [26, 34] +assert OVERLAP_NEW_READS == () +assert EVICTION_RESULT.tolist() == [5, 13] +assert EVICTION_NEW_READS == ((0, 1),) +assert AFTER_EVICTION_RESIDENT == ((0, 1), (1, 0)) +assert RELOAD_RESULT.tolist() == [10, 18, 26, 34] +assert RELOAD_NEW_READS == ((0, 0),) +assert AFTER_RELOAD_RESIDENT == ((0, 0), (1, 0)) +assert FAILURE_READ_COUNTS == (1, 1) +assert RETRY_RESULT.tolist() == [[28, 29], [36, 37]] +assert RETRY_NEW_READS == ((1, 1),) +assert RETRY_STATE == "ready" +assert FAILED_TRANSITIONS == ( + "queued", + "loading", + "failed", + "queued", + "loading", + "ready", +) +assert FAILED_EVENT_ROWS == ( + ("new", "queued", "requested"), + ("queued", "loading", "queue drained"), + ("loading", "failed", "source read failed"), + ("failed", "queued", "explicit retry"), + ("queued", "loading", "queue drained"), + ("loading", "ready", "source read completed"), +) diff --git a/packages/zarr-indexing/justfile b/packages/zarr-indexing/justfile index 20e1b2b837..1b7164f647 100644 --- a/packages/zarr-indexing/justfile +++ b/packages/zarr-indexing/justfile @@ -13,18 +13,27 @@ default: # invocation CI uses. # Run the test suite; extra args are passed to pytest test *args: - uv run --project ../.. --group test --with-editable . python -m pytest tests {{ args }} + uv run --project ../.. --group test --with-editable . python -m pytest tests src/zarr_indexing {{ args }} -# Lint with the same invocation CI uses +# TensorStore is the oracle for the parity suites, which skip without it. It +# ships binary wheels only, so it rides in as a run-time overlay rather than +# joining a dependency group; if a future Python lacks a tensorstore wheel, +# gate the CI job that calls this on the matrix version. +# Run the tensorstore parity suites; extra args are passed to pytest +test-tensorstore *args: + uv run --project ../.. --group test --with-editable . --with 'tensorstore>=0.1.84' python -m pytest tests/test_ndsel_tensorstore.py tests/test_tensorstore_parity.py {{ args }} + +# Lint with the same invocation CI uses. Ruff is pinned to the repo-wide +# version (see pyproject.toml [dependency-groups] docs); bump together. lint: - uvx ruff check . + uvx ruff@0.16.0 check . -# Type-check the package sources +# Type-check the package sources, documentation Python, and their contract tests typecheck: - uv run --group test --with pyright pyright src + uv run --group test --with pyright pyright # Run everything CI runs for this package -check: lint typecheck test docs-check +check: lint typecheck test test-tensorstore docs-check # Preview the changelog that the next release would generate changelog-draft: diff --git a/packages/zarr-indexing/mkdocs.yml b/packages/zarr-indexing/mkdocs.yml index 43a5ea5b4c..d97e63b150 100644 --- a/packages/zarr-indexing/mkdocs.yml +++ b/packages/zarr-indexing/mkdocs.yml @@ -10,21 +10,52 @@ site_author: Davis Bennett site_url: !ENV [READTHEDOCS_CANONICAL_URL, 'https://zarr-indexing.readthedocs.io/'] docs_dir: docs use_directory_urls: true +exclude_docs: | + snippets/*.py +# --strict promotes warnings to errors, but broken link anchors and pages +# missing from nav are only INFO by default — a strict build passed with +# both breakages. Warn so strict actually fails on them. +validation: + links: + anchors: warn + nav: + omitted_files: warn + +# Top-level rank is consistent: collections (Guide, Examples, API Reference) +# and standalone artifacts (landing, ndsel spec, design notes, changelog). +# Guide mirrors the docs/guide/ directory — its three pages are one +# collection (learn / look up / integrate), pydantic's Concepts pattern at +# small scale; navigation.indexes makes the Guide entry itself land on the +# visual guide. No tabs: at eight content pages, hiding sections costs more +# than it organizes. nav: - index.md - - ndsel.md + - Guide: + - guide/index.md + - Indexing patterns: guide/patterns.md + - Integration boundaries: guide/integrations.md + - Examples: + - Lazy indexing a NumPy array: examples/lazy_indexing_numpy.md + - Lazy indexing with Dask: examples/lazy_indexing_dask.md + - System-memory chunk cache: examples/system_memory_chunk_cache.md + - The ndsel wire format: ndsel.md + - Design notes: design-notes.md - API Reference: - api/index.md - ' zarr_indexing.transform': api/transform.md - ' zarr_indexing.domain': api/domain.md - ' zarr_indexing.output_map': api/output_map.md - - ' zarr_indexing.composition': api/composition.md - ' zarr_indexing.chunk_resolution': api/chunk_resolution.md - ' zarr_indexing.grid': api/grid.md + - ' zarr_indexing.lazy_array': api/lazy_array.md + - ' zarr_indexing.reader': api/reader.md + - ' zarr_indexing.boundary': api/boundary.md - ' zarr_indexing.json': api/json.md - ' zarr_indexing.messages': api/messages.md - ' zarr_indexing.errors': api/errors.md + - ' zarr_indexing.testing.stateful': api/testing_stateful.md + - ' zarr_indexing.testing.strategies': api/testing_strategies.md - Changelog: https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-indexing/CHANGELOG.md # This site is a Read the Docs subproject of zarr-python; give readers a way # back to the parent docs, which list every companion package. @@ -61,6 +92,7 @@ theme: features: - content.code.annotate - content.code.copy + - content.tabs.link - navigation.indexes - navigation.instant - navigation.tracking @@ -111,3 +143,13 @@ markdown_extensions: line_spans: __span pygments_lang_class: true - pymdownx.inlinehilite + # Content tabs (Python/JSON pairs in the pattern matrix); content.tabs.link + # in the theme features keeps every pair switched together. + - pymdownx.tabbed: + alternate_style: true + - pymdownx.snippets: + base_path: [docs, examples] + # Fail the build on an unresolvable include or missing region instead + # of silently rendering nothing. tests/test_doc_examples.py mirrors + # base_path when it verifies the include graph. + check_paths: true diff --git a/packages/zarr-indexing/pyproject.toml b/packages/zarr-indexing/pyproject.toml index 21ba4ef7e7..60f69a1dbb 100644 --- a/packages/zarr-indexing/pyproject.toml +++ b/packages/zarr-indexing/pyproject.toml @@ -34,6 +34,12 @@ dependencies = [ "numpy>=2", ] +[project.optional-dependencies] +# `zarr_indexing.testing` — a Hypothesis state machine and selection strategies +# for projects checking their own array against this package. Nothing else in +# the package imports hypothesis. +testing = ["hypothesis>=6.160.0"] + [project.urls] Homepage = "https://github.com/zarr-developers/zarr-python" Source = "https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-indexing" @@ -47,17 +53,20 @@ Documentation = "https://zarr-indexing.readthedocs.io/" # test suite, which already has zarr installed. `zarr` is intentionally NOT # listed here to avoid a workspace dependency cycle; run these tests from the # repo root (`uv run pytest packages/zarr-indexing/tests`), not in isolation. -test = ["pytest"] +# `hypothesis` arrives via the `testing` extra, which is what +# `zarr_indexing.testing` needs; the repo-root `test` group pins the exact +# version CI runs against. Bump the two together. +test = ["pytest", "hypothesis>=6.160.0"] docs = [ # Pins match the zarr-python docs environment in the repo-root # pyproject.toml so the two sites render with the same toolchain. - "mkdocs-material==9.7.6", + "mkdocs-material==9.7.7", "mkdocs==1.6.1", - "mkdocstrings==1.0.4", + "mkdocstrings==1.0.6", "mkdocstrings-python==2.0.5", "griffe-inherited-docstrings==1.1.3", # mkdocstrings uses ruff to format rendered signatures - "ruff==0.15.20", + "ruff==0.15.22", ] [tool.hatch.version] @@ -71,21 +80,59 @@ raw-options = { root = "../..", git_describe_command = "git describe --dirty --t [tool.hatch.build.targets.wheel] packages = ["src/zarr_indexing"] +# An allowlist, so nothing that merely happens to sit in the package directory +# — a scratch script, a stray notebook — can ride along in a release. The list +# keeps an sdist self-testing: `tests/` carries the vendored ndsel conformance +# corpus, and `tests/test_doc_examples.py` executes `docs/snippets/*.py` and +# `examples/*/*.py`, so those are part of the suite rather than decoration. +# `pyproject.toml`, `README.md` and `LICENSE.txt` are added by hatchling itself. +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", + "/docs", + "/examples", + "/mkdocs.yml", + "/justfile", + "/CHANGELOG.md", + "/CONTRIBUTING.md", +] + [tool.ruff] extend = "../../pyproject.toml" target-version = "py312" +[tool.ruff.lint.per-file-ignores] +# Chunk discovery and __dask_tokenize__ deliberately catch Exception: a +# foreign source's attributes may fail arbitrarily and discovery must degrade +# to "no information"; a token call must never raise. Configured here (not as +# noqa comments) because the pinned pre-commit ruff and the floating CI ruff +# disagree on whether these rules fire, and RUF100 strips the comments. +"src/zarr_indexing/lazy_array.py" = ["BLE001", "S110"] + [tool.pytest.ini_options] minversion = "7" -testpaths = ["tests"] +# src is collected for its doctests: every public object's Examples section +# executes under --doctest-modules, so the documented examples cannot rot. +testpaths = ["tests", "src/zarr_indexing"] +pythonpath = ["."] xfail_strict = true -addopts = ["-ra", "--strict-config", "--strict-markers"] +addopts = ["-ra", "--strict-config", "--strict-markers", "--doctest-modules"] +doctest_optionflags = [ + "NORMALIZE_WHITESPACE", + "ELLIPSIS", + "IGNORE_EXCEPTION_DETAIL", +] filterwarnings = [ "error", ] [tool.pyright] -include = ["src"] +include = [ + "src", + "docs/snippets", + "tests/test_doc_examples.py", +] enableExperimentalFeatures = true typeCheckingMode = "strict" pythonVersion = "3.12" diff --git a/packages/zarr-indexing/src/zarr_indexing/__init__.py b/packages/zarr-indexing/src/zarr_indexing/__init__.py index effe38ca88..9acfd28a21 100644 --- a/packages/zarr-indexing/src/zarr_indexing/__init__.py +++ b/packages/zarr-indexing/src/zarr_indexing/__init__.py @@ -11,64 +11,106 @@ - `IndexTransform` — maps input coordinates to storage coordinates - `ConstantMap`, `DimensionMap`, `ArrayMap` — the three ways a single output dimension can depend on the input (see `output_map.py`) -- `compose` — chain two transforms into one +- `IndexTransform.compose` — chain two transforms into one -The chunk-resolution helpers (`iter_chunk_transforms`, -`sub_transform_to_selections`) and `selection_to_transform` are also exported -here: they form the surface the zarr integration layer (array indexing) depends -on. The `*Like` grid Protocols describe the chunk-grid surface chunk resolution +`LazyArray` wraps a system-memory/basic-indexing source and gives it deferred +indexing through `.lazy[...]`, yielding its reads as `Partition`s. Other +backends use an explicit `Reader` adapter. + +`plan_chunks` projects a transform through a caller-selected chunk grid without +coupling the result to a storage backend or scheduler. `selection_to_transform` +is also exported for consumers starting with a NumPy-style selection. The +`DimensionGridLike` Protocol describes the narrow grid surface chunk resolution consumes without importing zarr. """ from importlib.metadata import version from zarr_indexing.chunk_resolution import ( - iter_chunk_transforms, - sub_transform_to_selections, + ChunkCoverage, + ChunkPlan, + ChunkProjection, + plan_chunks, ) -from zarr_indexing.composition import compose from zarr_indexing.domain import IndexDomain -from zarr_indexing.grid import DimensionGridLike +from zarr_indexing.errors import BoundsCheckError, VindexInvalidSelectionError +from zarr_indexing.grid import ( + ChunkGrid, + ChunkSpec, + DimensionGrid, + DimensionGridLike, + EdgeDimensionGrid, + FixedDimension, + VaryingDimension, + dimension_grids_from_chunks, +) from zarr_indexing.json import ( IndexDomainJSON, IndexTransformJSON, OutputIndexMapJSON, - index_domain_from_json, - index_domain_to_json, - index_transform_from_json, - index_transform_to_json, - transform_from_canonical, - transform_to_canonical, ) +from zarr_indexing.lazy_array import LazyArray, Partition from zarr_indexing.messages import NdselError, normalize_ndsel, parse_ndsel -from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap, OutputIndexMap -from zarr_indexing.transform import IndexTransform, selection_to_transform +from zarr_indexing.output_map import ( + ArrayMap, + ConstantMap, + DimensionMap, + OutputIndexMap, + output_index_map_from_json, +) +from zarr_indexing.reader import ( + BasicReader, + NumPyReader, + ReadContext, + Reader, + UnitStepReader, + basic_reader, + numpy_reader, + unit_step_reader, +) +from zarr_indexing.transform import ( + IndexTransform, +) __version__ = version("zarr-indexing") __all__ = [ "ArrayMap", + "BasicReader", + "BoundsCheckError", + "ChunkCoverage", + "ChunkGrid", + "ChunkPlan", + "ChunkProjection", + "ChunkSpec", "ConstantMap", + "DimensionGrid", "DimensionGridLike", "DimensionMap", + "EdgeDimensionGrid", + "FixedDimension", "IndexDomain", "IndexDomainJSON", "IndexTransform", "IndexTransformJSON", + "LazyArray", "NdselError", + "NumPyReader", "OutputIndexMap", "OutputIndexMapJSON", + "Partition", + "ReadContext", + "Reader", + "UnitStepReader", + "VaryingDimension", + "VindexInvalidSelectionError", "__version__", - "compose", - "index_domain_from_json", - "index_domain_to_json", - "index_transform_from_json", - "index_transform_to_json", - "iter_chunk_transforms", + "basic_reader", + "dimension_grids_from_chunks", "normalize_ndsel", + "numpy_reader", + "output_index_map_from_json", "parse_ndsel", - "selection_to_transform", - "sub_transform_to_selections", - "transform_from_canonical", - "transform_to_canonical", + "plan_chunks", + "unit_step_reader", ] diff --git a/packages/zarr-indexing/src/zarr_indexing/_affine.py b/packages/zarr-indexing/src/zarr_indexing/_affine.py new file mode 100644 index 0000000000..d1846ffe2d --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/_affine.py @@ -0,0 +1,77 @@ +"""Checked affine coordinate arithmetic.""" + +from __future__ import annotations + +from typing import Any, overload + +import numpy as np +import numpy.typing as npt + +_INTP_INFO = np.iinfo(np.intp) + + +def _fits_intp(value: int) -> bool: + return _INTP_INFO.min <= value <= _INTP_INFO.max + + +@overload +def checked_affine(offset: int, stride: int, coordinates: int) -> int: ... + + +@overload +def checked_affine( + offset: int, + stride: int, + coordinates: npt.NDArray[np.integer[Any]], +) -> npt.NDArray[np.intp]: ... + + +def checked_affine( + offset: int, + stride: int, + coordinates: int | npt.NDArray[np.integer[Any]], +) -> int | npt.NDArray[np.intp]: + """Evaluate ``offset + stride * coordinates`` without integer overflow. + + Bounds are established with Python integers before coordinates are cast or + NumPy performs fixed-width arithmetic. The common representable case then + uses an ``np.intp`` fast path whose multiplication and addition were proven + safe; cancellation cases use exact object arithmetic. + """ + offset = int(offset) + stride = int(stride) + if not isinstance(coordinates, np.ndarray): + mapped = offset + stride * int(coordinates) + if not _fits_intp(mapped): + raise OverflowError(f"output coordinate {mapped} is outside np.intp range") + return mapped + + if coordinates.size == 0: + return np.empty(coordinates.shape, dtype=np.intp) + + coordinate_min = int(np.min(coordinates)) + coordinate_max = int(np.max(coordinates)) + product_at_min = stride * coordinate_min + product_at_max = stride * coordinate_max + mapped_at_min = offset + product_at_min + mapped_at_max = offset + product_at_max + mapped_min = min(mapped_at_min, mapped_at_max) + mapped_max = max(mapped_at_min, mapped_at_max) + if not _fits_intp(mapped_min) or not _fits_intp(mapped_max): + invalid = mapped_min if not _fits_intp(mapped_min) else mapped_max + raise OverflowError(f"output coordinate {invalid} is outside np.intp range") + + safe_fixed_width = ( + _fits_intp(coordinate_min) + and _fits_intp(coordinate_max) + and _fits_intp(offset) + and _fits_intp(stride) + and _fits_intp(product_at_min) + and _fits_intp(product_at_max) + ) + if safe_fixed_width: + intp_coordinates = coordinates.astype(np.intp, copy=False) + return np.asarray(offset + stride * intp_coordinates, dtype=np.intp) + + exact = offset + stride * coordinates.astype(object) + return np.asarray(exact, dtype=np.intp) diff --git a/packages/zarr-indexing/src/zarr_indexing/_composition.py b/packages/zarr-indexing/src/zarr_indexing/_composition.py new file mode 100644 index 0000000000..f90ea26fa7 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/_composition.py @@ -0,0 +1,242 @@ +"""Composition — chaining two transforms into one. + +`compose(outer, inner)` is the operation that makes views stack. `outer` maps +user coordinates to intermediate coordinates, `inner` maps those intermediate +coordinates to output coordinates, and the result maps user coordinates +straight through — so a view of a view of an array is still a single +`IndexTransform`, and indexing never accumulates layers to walk at read time. + +Composition works one output map at a time, and each case reduces to +substituting the outer map into the inner one: + +- A `ConstantMap` inner map ignores its input, so it survives unchanged. +- A `DimensionMap` inner map is affine, so composing it with an outer + `ConstantMap` or `DimensionMap` folds into new `offset`/`stride` values; + composing it with an outer `ArrayMap` leaves the index array alone and + rescales around it. +- An `ArrayMap` inner map must be *evaluated* at the coordinates the outer + transform produces, which is the only case that touches array data. +""" + +from __future__ import annotations + +from typing import Any + +import numpy as np + +from zarr_indexing._affine import checked_affine +from zarr_indexing.errors import BoundsCheckError +from zarr_indexing.output_map import ( + ArrayMap, + ConstantMap, + DimensionMap, + OutputIndexMap, + array_map_or_constant, +) +from zarr_indexing.transform import IndexTransform + + +def compose(outer: IndexTransform, inner: IndexTransform) -> IndexTransform: + """Compose two IndexTransforms. + + `outer` maps user coords (rank m) to intermediate coords (rank n). + `inner` maps intermediate coords (rank n) to output coords (rank p). + The result maps user coords (rank m) to output coords (rank p). + + Precondition: `outer.output_rank == inner.domain.ndim`. + + Examples + -------- + Chained indexing — `source[2:5]`, then `[::-1]` on the result — collapses + to a single transform (a reversed axis keeps literal coordinates, so the + composed domain is `[-4, -1)`): + + >>> inner = IndexTransform.from_shape((10,))[2:5] + >>> outer = IndexTransform.identity(inner.domain)[::-1] + >>> chained = compose(outer, inner) + >>> chained == inner[::-1] + True + >>> [chained.apply((i,)) for i in (-4, -3, -2)] + [(4,), (3,), (2,)] + >>> np.arange(10)[2:5][::-1].tolist() + [4, 3, 2] + """ + if outer.output_rank != inner.domain.ndim: + raise ValueError( + f"outer output rank ({outer.output_rank}) must match inner input rank " + f"({inner.domain.ndim})" + ) + + _validate_outer_outputs(outer, inner) + + result_output = [ + _compose_single(outer, inner_map, inner.domain.inclusive_min) for inner_map in inner.output + ] + + return IndexTransform(domain=outer.domain, output=tuple(result_output)) + + +def _validate_outer_outputs(outer: IndexTransform, inner: IndexTransform) -> None: + """Prove that every intermediate coordinate is in the inner domain. + + An empty outer domain has no points, so containment is vacuously true. For + a nonempty domain, each map form has an exact, constant-space range proof: + constants are singletons, dimension maps are affine intervals, and array + maps need only their extrema. + """ + if any(extent == 0 for extent in outer.domain.shape): + return + + for axis, (outer_map, inner_lo, inner_hi) in enumerate( + zip( + outer.output, + inner.domain.inclusive_min, + inner.domain.exclusive_max, + strict=True, + ) + ): + output_lo, output_hi = _output_bounds(outer, outer_map) + if output_lo < inner_lo or output_hi >= inner_hi: + raise BoundsCheckError( + f"outer output dimension {axis} produces coordinates " + f"[{output_lo}, {output_hi}] outside the inner input domain " + f"[{inner_lo}, {inner_hi})" + ) + + +def _output_bounds(outer: IndexTransform, output_map: OutputIndexMap) -> tuple[int, int]: + """Return the exact inclusive bounds of one output map on a nonempty domain.""" + if isinstance(output_map, ConstantMap): + return output_map.offset, output_map.offset + + if isinstance(output_map, DimensionMap): + input_lo = outer.domain.inclusive_min[output_map.input_dimension] + input_hi = outer.domain.exclusive_max[output_map.input_dimension] + first = output_map.offset + output_map.stride * input_lo + last = output_map.offset + output_map.stride * (input_hi - 1) + return min(first, last), max(first, last) + + index_lo = int(output_map.index_array.min()) + index_hi = int(output_map.index_array.max()) + first = output_map.offset + output_map.stride * index_lo + last = output_map.offset + output_map.stride * index_hi + return min(first, last), max(first, last) + + +def _compose_single( + outer: IndexTransform, inner_map: OutputIndexMap, inner_origin: tuple[int, ...] +) -> OutputIndexMap: + """Compose a single inner output map with the full outer transform.""" + if isinstance(inner_map, ConstantMap): + return ConstantMap(offset=inner_map.offset) + + if isinstance(inner_map, DimensionMap): + return _compose_dimension(outer, inner_map) + + # inner_map: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + return _compose_array(outer, inner_map, inner_origin) + + +def _compose_dimension(outer: IndexTransform, inner_map: DimensionMap) -> OutputIndexMap: + """Compose when inner is a DimensionMap. + + storage = offset_i + stride_i * intermediate[dim_i] + where intermediate[dim_i] = outer.output[dim_i](user_input) + """ + dim_i = inner_map.input_dimension + offset_i = inner_map.offset + stride_i = inner_map.stride + outer_map = outer.output[dim_i] + + if isinstance(outer_map, ConstantMap): + return ConstantMap(offset=checked_affine(offset_i, stride_i, outer_map.offset)) + + if isinstance(outer_map, DimensionMap): + return DimensionMap( + input_dimension=outer_map.input_dimension, + offset=offset_i + stride_i * outer_map.offset, + stride=stride_i * outer_map.stride, + ) + + # outer_map: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + # Affine post-composition leaves the index array (and hence its full + # input rank and dependency axes) untouched. + return ArrayMap( + index_array=outer_map.index_array, + offset=offset_i + stride_i * outer_map.offset, + stride=stride_i * outer_map.stride, + ) + + +def _dimension_positions( + outer: IndexTransform, outer_map: DimensionMap, inner_origin: int +) -> np.ndarray[Any, np.dtype[np.intp]]: + """Build exact positional indices for an affine outer map.""" + dimension = outer_map.input_dimension + extent = outer.domain.shape[dimension] + start = checked_affine( + outer_map.offset - inner_origin, + outer_map.stride, + outer.domain.inclusive_min[dimension], + ) + shape = (1,) * dimension + (extent,) + (1,) * (outer.input_rank - dimension - 1) + if extent == 0: + return np.empty(shape, dtype=np.intp) + if extent == 1: + return np.full(shape, start, dtype=np.intp) + steps = np.arange(extent, dtype=np.intp) + return checked_affine(start, outer_map.stride, steps).reshape(shape) + + +def _array_positions(outer_map: ArrayMap, inner_origin: int) -> np.ndarray[Any, np.dtype[np.intp]]: + """Build exact positional indices without fixed-width affine overflow.""" + return checked_affine(outer_map.offset - inner_origin, outer_map.stride, outer_map.index_array) + + +def _positions_for_axis( + outer: IndexTransform, outer_map: OutputIndexMap, inner_origin: int +) -> int | np.ndarray[Any, np.dtype[np.intp]]: + """Convert one intermediate coordinate map to inner-array positions.""" + if isinstance(outer_map, ConstantMap): + return outer_map.offset - inner_origin + if isinstance(outer_map, DimensionMap): + return _dimension_positions(outer, outer_map, inner_origin) + return _array_positions(outer_map, inner_origin) + + +def _compose_array( + outer: IndexTransform, inner_map: ArrayMap, inner_origin: tuple[int, ...] +) -> OutputIndexMap: + """Compose when inner is an ArrayMap. + + storage = offset_i + stride_i * arr_i[intermediate] + We need to evaluate arr_i at the intermediate coordinates produced by outer. + + Both domains carry their own origin, and neither is necessarily 0 — a step-1 + slice keeps its literal bounds and a negative step produces a negative + origin, so non-zero origins are the ordinary case here rather than the exotic + one. The intermediate coordinates are read over the *outer* domain's own + range, and the inner array is addressed positionally from the *inner* + domain's origin. + """ + arr_i = inner_map.index_array + if any(extent == 0 for extent in outer.domain.shape): + # The empty map is singleton on every non-empty axis: it varies over no + # axis at all, and the emptiness lives in the domain emitted alongside. + empty_shape = tuple(0 if extent == 0 else 1 for extent in outer.domain.shape) + return ArrayMap( + index_array=np.empty(empty_shape, dtype=arr_i.dtype), + offset=inner_map.offset, + stride=inner_map.stride, + ) + + positions = tuple( + 0 if size == 1 else _positions_for_axis(outer, outer_map, origin) + for outer_map, origin, size in zip(outer.output, inner_origin, arr_i.shape, strict=True) + ) + # A gather narrowed to one coordinate — scalar or all-singleton — is the + # ConstantMap it equals; `array_map_or_constant` normalizes both. + gathered = np.asarray(arr_i[positions]) + if gathered.ndim == 0: + return ConstantMap(offset=checked_affine(inner_map.offset, inner_map.stride, int(gathered))) + return array_map_or_constant(gathered, offset=inner_map.offset, stride=inner_map.stride) diff --git a/packages/zarr-indexing/src/zarr_indexing/_selector.py b/packages/zarr-indexing/src/zarr_indexing/_selector.py new file mode 100644 index 0000000000..3a632ec886 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/_selector.py @@ -0,0 +1,41 @@ +"""Internal scalar-selector coercion shared by indexing dialects.""" + +from __future__ import annotations + +import operator +from typing import Any, SupportsIndex, cast + +import numpy as np + + +def is_bool_scalar(value: Any) -> bool: + """Return whether ``value`` is a Python or NumPy boolean scalar.""" + return isinstance(value, (bool, np.bool_)) + + +def as_scalar_index(value: Any) -> int | None: + """Return a non-boolean scalar selector as an exact Python integer. + + Selector coercion follows Python's ``__index__`` protocol, rather than + accepting only the concrete integer classes we happen to know about. In + particular, ``operator.index`` rejects lossy ``__int__``-only objects and + validates that ``__index__`` really returned an integer. + """ + if is_bool_scalar(value): + return None + # ndarray defines ``__index__`` for its scalar-integer case, but the + # attribute also makes non-scalar and non-integer arrays look like + # ``SupportsIndex`` at runtime. Those are array selectors, not malformed + # scalar selectors, and must continue through array dtype validation. + if isinstance(value, np.ndarray): + array = cast("np.ndarray[Any, np.dtype[Any]]", value) + if array.ndim != 0 or array.dtype.kind not in "iu": + return None + if not isinstance(value, SupportsIndex): + return None + return operator.index(cast(SupportsIndex, value)) + + +def require_index(value: Any) -> int: + """Coerce a required slice component through ``__index__``.""" + return operator.index(value) diff --git a/packages/zarr-indexing/src/zarr_indexing/_wire.py b/packages/zarr-indexing/src/zarr_indexing/_wire.py new file mode 100644 index 0000000000..c3e6fd82b6 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/_wire.py @@ -0,0 +1,119 @@ +"""Shared lowering rules between the canonical ndsel wire form and the engine. + +Package-private: the types that serialize themselves (`IndexDomain`, +`IndexTransform`, the output map kinds) all need these, so they cannot live in +any one of them, and they are not API. The three engine constraints named in +[`zarr_indexing.json`][zarr_indexing.json] — finite bounds, implicit bounds +lowering by value, integer `index_array` content — are enforced here. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +import numpy as np + +from zarr_indexing.messages import NdselError + +if TYPE_CHECKING: + from zarr_indexing.domain import IndexDomain + from zarr_indexing.json import BoundJSON + + +def lower_bound(bound: BoundJSON, where: str) -> int: + """Lower a canonical bound to a finite integer, rejecting infinities. + + Reached only with a bound the message layer has already validated as an + `index-value`, so the one thing left to rule out is a sentinel: an + `IndexDomain` addresses a finite array. + """ + value = bound[0] if isinstance(bound, list) else bound + if value == "-inf" or value == "+inf": + raise NdselError( + "invalid_json", + f"{where} is infinite ({value!r}); an IndexDomain addresses a finite " + f"array and cannot lower an infinite bound", + ) + return int(value) + + +def lower_index_array(raw: Any, where: str) -> np.ndarray[Any, np.dtype[np.intp]]: + """Lower a canonical `index_array` to `intp`, rejecting non-integer content. + + The message layer carries `index_array` verbatim — the spec defers its shape + and type to the engine — so this is where the content is checked. An index + array names output coordinates, and nothing but an integer names one: converting + `[0.9, 1.9]` would silently read cells 0 and 1, and `[true, false]` cells 1 + and 0. Strings raise here rather than leaking NumPy's own conversion error. + """ + if not isinstance(raw, list): + # A bare integer would become a rank-0 array and then be widened into a + # length-1 map, so a document that names no cells would select one. + raise NdselError( + "invalid_json", + f"{where} must be an array of integers, got {raw!r}", + ) + try: + arr = np.asarray(raw) + except (TypeError, ValueError) as exc: + raise NdselError("invalid_json", f"{where} is not an array: {exc}") from exc + if arr.size == 0 and arr.dtype.kind == "f": + # An empty JSON list carries no element type and NumPy defaults it to + # float64. An empty selection is legal, so take it as an empty index array. + return np.zeros(arr.shape, dtype=np.intp) + if arr.dtype.kind not in "iu": + raise NdselError( + "invalid_json", + f"{where} must hold integers, got an array of {arr.dtype.name}; an " + f"index array names output coordinates, which floats, booleans and " + f"strings do not", + ) + return np.asarray(arr, dtype=np.intp) + + +def lower_labels(labels: list[str]) -> tuple[str, ...] | None: + """All-empty labels collapse to `None` so a label-free domain round-trips.""" + return None if all(label == "" for label in labels) else tuple(labels) + + +def emit_labels(labels: tuple[str, ...] | None, rank: int) -> list[str]: + """Emit canonical labels: `[""]*rank` when the domain is unlabeled.""" + return [""] * rank if labels is None else list(labels) + + +def full_rank_index_array( + arr: np.ndarray[Any, np.dtype[np.intp]], + domain: IndexDomain, + where: str, +) -> np.ndarray[Any, np.dtype[np.intp]]: + """Give an incoming `index_array` the input rank the engine requires. + + ndsel leaves index-array rank unvalidated, so a conformant producer may send + an array of lower rank that broadcasts against the domain. A non-empty one + is aligned to the *trailing* input dimensions, which is how NumPy broadcasts + and how a producer omitting leading singletons means it to be read. + + An empty array is a different matter: `[]` is the only spelling of every + empty shape once the leading axis is the zero-length one, so the axis it + varies over cannot be read off it. It is recovered from the domain, which + can only be empty on the axis in question — and rejected when the domain + leaves that ambiguous. This package never emits such a document (an empty + map is degenerate and collapses to a constant, as TensorStore's does), so + this path exists for external producers alone. + """ + if arr.size == 0 and arr.ndim != domain.ndim: + empty_axes = [k for k, extent in enumerate(domain.shape) if extent == 0] + if len(empty_axes) != 1: + raise NdselError( + "invalid_json", + f"{where}.index_array is empty, but the input domain has " + f"{len(empty_axes)} zero-length dimensions, so the axis it varies " + f"over cannot be recovered", + ) + shape = [1] * domain.ndim + shape[empty_axes[0]] = 0 + return arr.reshape(tuple(shape)) + + if arr.ndim < domain.ndim: + return arr.reshape((1,) * (domain.ndim - arr.ndim) + arr.shape) + return arr diff --git a/packages/zarr-indexing/src/zarr_indexing/boundary.py b/packages/zarr-indexing/src/zarr_indexing/boundary.py new file mode 100644 index 0000000000..e7f1b1c4bd --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/boundary.py @@ -0,0 +1,374 @@ +"""The positional (NumPy) selection dialect, lowered onto the transform algebra. + +The transform algebra uses **literal domain coordinates**: an index is a point +in the view's own coordinate system, which after `view = arr[10:50]` runs from +10 to 49, and a negative index is a negative coordinate rather than an offset +from the end (TensorStore's convention — see `zarr_indexing.transform`). + +NumPy uses **positions**: index 0 always means the first element of the object +being indexed, and `-1` means the last. This module translates between the two. +It validates a selection against the view's shape with NumPy semantics, then +shifts every coordinate by the domain's origin so the transform layer sees +literal coordinates. + +Note +---- +`zarr.Array` currently carries its own copy of this normalization, tuned to a +different boundary contract (`Array.lazy[...]` deliberately exposes the literal +dialect, so a view's coordinates keep their meaning across composition). This +module is the generic, zarr-free version used by `LazyArray`; consolidating +zarr's copy onto it is left to a follow-up. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Literal + +import numpy as np + +from zarr_indexing._selector import as_scalar_index, is_bool_scalar, require_index + +if TYPE_CHECKING: + from zarr_indexing.domain import IndexDomain + +SelectionMode = Literal["basic", "orthogonal", "vectorized"] + + +def _as_index_array(sel: Any) -> np.ndarray[Any, np.dtype[Any]] | None: + """Return `sel` as an ndarray if it is array-like, else None.""" + if isinstance(sel, np.ndarray): + return sel + if isinstance(sel, (list, tuple)): + arr = np.asarray(sel) + if arr.size == 0 and arr.dtype.kind == "f": + # An empty Python list carries no element type and NumPy defaults it + # to float64. Selecting nothing is legal — NumPy takes `a[np.ix_([])]` + # — so read it as the empty integer selection it spells, rather than + # rejecting it for a dtype it never had a chance to have. + return np.zeros(arr.shape, dtype=np.intp) + if arr.dtype.kind in "biu": + return arr + raise IndexError( + f"arrays used as indices must be of integer or boolean type; got dtype {arr.dtype}" + ) + return None + + +def _axes_consumed(sel: Any, mode: SelectionMode) -> int: + """How many axes of the view a single selection entry consumes.""" + if sel is None: + return 0 + arr = _as_index_array(sel) + # A multidimensional boolean mask consumes one axis per mask dimension. + # Orthogonal indexing is per-axis by construction, so a mask there is 1-D + # and consumes exactly one axis. + if mode == "vectorized" and arr is not None and arr.dtype == np.bool_: + return arr.ndim + return 1 + + +def _normalize_int(value: int, size: int, axis: int) -> int: + """Bounds-check a positional integer index, wrapping negatives NumPy-style.""" + idx = value + if idx < 0: + idx += size + if idx < 0 or idx >= size: + raise IndexError(f"index {value} is out of bounds for axis {axis} with size {size}") + return idx + + +def _normalize_slice(sel: slice, size: int, axis: int) -> tuple[int, int, int]: + """Resolve a positional slice to `(start, stop, step)`, either direction. + + `slice.indices` already applies NumPy's rules — negative bounds count from + the end, out-of-range bounds clamp, and a reversed slice runs downward with + `stop` one *below* the last selected position. The one thing it does not do + is canonicalize an empty result: it can hand back a stop on the far side of + the start (`5:2` going up, `2:5` going down), which the transform layer + reads as a direction error rather than an empty selection. Collapsing it to + `stop == start` keeps NumPy's "empty, not an error" answer. + """ + start_bound = None if sel.start is None else require_index(sel.start) + stop_bound = None if sel.stop is None else require_index(sel.stop) + step = 1 if sel.step is None else require_index(sel.step) + if step == 0: + raise ValueError(f"slice step cannot be zero (axis {axis})") # ValueError: NumPy parity + start, stop, step = slice(start_bound, stop_bound, step).indices(size) + stop = max(stop, start) if step > 0 else min(stop, start) + return start, stop, step + + +def _normalize_int_array( + arr: np.ndarray[Any, np.dtype[Any]], size: int, axis: int +) -> np.ndarray[Any, np.dtype[np.intp]]: + """Bounds-check a positional integer index array, wrapping negatives.""" + if arr.dtype.kind not in "iu": + raise IndexError( + f"arrays used as indices must be of integer or boolean type; got dtype {arr.dtype}" + ) + # Cast before wrapping: an unsigned array cannot represent the intermediate + # negative values, and `intp` covers every index NumPy can address. + out = arr.astype(np.intp, copy=True) + if out.size > 0: + negative = out < 0 + if bool(negative.any()): + out = np.where(negative, out + size, out) + lo, hi = int(out.min()), int(out.max()) + if lo < 0 or hi >= size: + bad = lo if lo < 0 else hi + raise IndexError(f"index {bad} is out of bounds for axis {axis} with size {size}") + return out + + +def _expanded_axis_walk(entries: tuple[Any, ...], ndim: int, mode: SelectionMode) -> list[int]: + """The starting axis each entry addresses, with an ellipsis expanded. + + The returned list has one entry per element of `entries`; the value for an + `Ellipsis` (or a `newaxis`) is the axis it starts at, which is also the axis + the following entry resumes from once the skipped axes are accounted for. + """ + for sel in entries: + if is_bool_scalar(sel): + raise IndexError( + "boolean scalars are not valid indices; use a boolean array " + "matching the shape of the axes it selects" + ) + if sum(1 for sel in entries if sel is Ellipsis) > 1: + raise IndexError("an index can only have a single ellipsis ('...')") + consumed = sum(_axes_consumed(sel, mode) for sel in entries if sel is not Ellipsis) + if consumed > ndim: + raise IndexError( + f"too many indices for array: array has {ndim} dimensions, but {consumed} were indexed" + ) + + axes: list[int] = [] + axis = 0 + for sel in entries: + axes.append(axis) + axis += (ndim - consumed) if sel is Ellipsis else _axes_consumed(sel, mode) + return axes + + +def validate_advanced_selection( + selection: Any, + domain: IndexDomain, + mode: Literal["orthogonal", "vectorized"], +) -> None: + """Validate advanced-index selector dtypes and boolean mask extents. + + This is the validation shared by positional callers such as `LazyArray` + and direct `IndexTransform.oindex` / `.vindex` callers. It deliberately + does not normalize coordinates: direct transforms use literal coordinates, + whereas positional callers shift and wrap them separately. + """ + entries: tuple[Any, ...] = selection if isinstance(selection, tuple) else (selection,) + axes = _expanded_axis_walk(entries, domain.ndim, mode) + + for sel, axis in zip(entries, axes, strict=True): + arr = _as_index_array(sel) + if arr is None: + continue + if arr.dtype == np.bool_: + n_axes = _axes_consumed(sel, mode) + expected = domain.shape[axis : axis + n_axes] + if arr.shape != tuple(expected): + extent = ( + f"dimension {expected[0]}" + if len(expected) == 1 + else f"dimensions {tuple(expected)}" + ) + raise IndexError( + f"boolean index has shape {arr.shape} but {extent} has shape {tuple(expected)}" + ) + elif arr.dtype.kind not in "iu": + raise IndexError( + f"arrays used as indices must be of integer or boolean type; got dtype {arr.dtype}" + ) + + +def split_scalar_axes( + selection: Any, + domain: IndexDomain, + mode: SelectionMode, +) -> tuple[tuple[Any, ...] | None, Any]: + """Peel scalar integer indices out of a fancy selection. + + A scalar integer drops its axis, and neither the orthogonal nor the + vectorized path of the transform algebra models that — both widen a scalar + into a length-1 index array, which keeps the axis — so the scalars are split + off here and applied as a separate basic step first. + + Applying them *first* is this package's rule, not NumPy's. NumPy groups a + scalar with the advanced indices for the purpose of placing the broadcast + result, so the two disagree when a scalar and an index array are separated: + `a[0, ..., [1, 2]]` has shape `(2, 3)` for a `(2, 3, 4)` array, where + `a[0][..., [1, 2]]` has shape `(3, 2)`. The earlier claim here that they + always agree rested on `a[0, [1, 2], :]`, where the indices are adjacent and + they happen to. Scalar-first is the documented dialect (see the `lazy_array` + module docstring) — the divergence is deliberate, and this note exists so + that the correct end is not "fixed" later. + + Parameters + ---------- + selection + A positional orthogonal or vectorized selection. + domain + The domain of the view being indexed. + mode + `"orthogonal"` or `"vectorized"`; controls how many axes each entry + covers, which decides where the scalars sit. + + Returns + ------- + tuple[tuple[Any, ...] | None, Any] + `(basic_selection, remaining_selection)`. `basic_selection` is a + full-rank basic selection in **literal** domain coordinates that drops + the scalar axes, or `None` when the selection has no scalar entries (in + which case `remaining_selection` is `selection` unchanged). + + Raises + ------ + IndexError + If a boolean scalar is used as an index, an index is out of bounds, or + too many indices are supplied. + """ + entries = selection if isinstance(selection, tuple) else (selection,) + axes = _expanded_axis_walk(entries, domain.ndim, mode) + + scalar_axes: dict[int, int] = {} + remaining: list[Any] = [] + for sel, axis in zip(entries, axes, strict=True): + scalar = as_scalar_index(sel) + if scalar is not None: + scalar_axes[axis] = _normalize_int(scalar, domain.shape[axis], axis) + else: + remaining.append(sel) + + if len(scalar_axes) == 0: + return None, selection + + basic: list[Any] = [] + for axis in range(domain.ndim): + lo = domain.inclusive_min[axis] + if axis in scalar_axes: + basic.append(lo + scalar_axes[axis]) + else: + basic.append(slice(lo, domain.exclusive_max[axis])) + return tuple(basic), tuple(remaining) + + +def normalize_positional_selection( + selection: Any, + domain: IndexDomain, + mode: SelectionMode, +) -> Any: + """Translate a positional (NumPy-dialect) selection into literal coordinates. + + Positions are zero-based offsets into the current view; negatives wrap + from the end. The returned selection addresses the same cells in the + literal coordinate system `domain` uses, ready for + `zarr_indexing.transform.selection_to_transform`. + + Parameters + ---------- + selection + A NumPy-style selection: integers, slices, `Ellipsis`, integer arrays or + lists, or boolean arrays. + domain + The domain of the view being indexed. Its shape defines the positional + bounds and its origin the coordinate shift. + mode + Which selection dialect the entries follow: `"basic"` (integers and + slices), `"orthogonal"` (per-axis arrays, outer product), or + `"vectorized"` (correlated coordinate arrays or a single mask). + + Returns + ------- + tuple[Any, ...] + The selection with every coordinate expressed in literal domain + coordinates. + + Raises + ------ + IndexError + If a boolean scalar is used as an index, a boolean mask does not match + the shape of the axes it covers, an index is out of bounds, or too many + indices are supplied. + """ + entries = selection if isinstance(selection, tuple) else (selection,) + shape = domain.shape + origin = domain.inclusive_min + ndim = domain.ndim + + if mode in ("orthogonal", "vectorized"): + validate_advanced_selection(selection, domain, mode) + else: + for sel in entries: + if is_bool_scalar(sel): + raise IndexError( + "boolean scalars are not valid indices; use a boolean array " + "matching the shape of the axes it selects" + ) + + n_ellipsis = sum(1 for sel in entries if sel is Ellipsis) + if n_ellipsis > 1: + raise IndexError("an index can only have a single ellipsis ('...')") + consumed = sum(_axes_consumed(sel, mode) for sel in entries if sel is not Ellipsis) + if consumed > ndim: + raise IndexError( + f"too many indices for array: array has {ndim} dimensions, but {consumed} were indexed" + ) + + result: list[Any] = [] + axis = 0 + for sel in entries: + if sel is Ellipsis: + # Passed through rather than expanded: every mode of + # `selection_to_transform` expands an ellipsis (and pads short + # selections) to whole-axis slices itself, and `vectorized` mode + # rejects an explicit slice, so expanding here would turn a legal + # partial coordinate selection into an error. + result.append(Ellipsis) + axis += ndim - consumed + continue + if sel is None: + # newaxis: no axis of the view is consumed, and there is no + # coordinate to shift. The transform layer decides whether the mode + # accepts it. + result.append(None) + continue + + arr = _as_index_array(sel) + if arr is not None and arr.dtype == np.bool_: + n_axes = _axes_consumed(sel, mode) + expected = shape[axis : axis + n_axes] + if arr.shape != tuple(expected): + raise IndexError( + f"boolean index has shape {arr.shape} but the axes it " + f"covers have shape {tuple(expected)}" + ) + for offset, positions in enumerate(np.nonzero(arr)): + result.append(positions.astype(np.intp) + origin[axis + offset]) + axis += n_axes + continue + + if axis >= ndim: + raise IndexError( + f"too many indices for array: array has {ndim} dimensions, " + f"but {consumed} were indexed" + ) + size = shape[axis] + if arr is not None: + result.append(_normalize_int_array(arr, size, axis) + origin[axis]) + elif isinstance(sel, slice): + start, stop, step = _normalize_slice(sel, size, axis) + result.append(slice(start + origin[axis], stop + origin[axis], step)) + elif (scalar := as_scalar_index(sel)) is not None: + result.append(_normalize_int(scalar, size, axis) + origin[axis]) + else: + raise IndexError(f"unsupported selection type: {type(sel)!r}") + axis += 1 + + # Axes the selection did not mention are left to `selection_to_transform`, + # which pads them with whole-axis slices in every mode. + return tuple(result) diff --git a/packages/zarr-indexing/src/zarr_indexing/chunk_resolution.py b/packages/zarr-indexing/src/zarr_indexing/chunk_resolution.py index 7aea86ad02..af148685a0 100644 --- a/packages/zarr-indexing/src/zarr_indexing/chunk_resolution.py +++ b/packages/zarr-indexing/src/zarr_indexing/chunk_resolution.py @@ -18,80 +18,222 @@ 3. **Translate** — shift the restricted transform to chunk-local coordinates via `transform.translate(-chunk_origin)`. -4. **Yield** — produce `(chunk_coords, local_transform, surviving_indices)` - triples that the codec pipeline consumes. +4. **Project** — pair the chunk-local storage transform with a transform back + to the request's cells. Both use the same compact, zero-origin domain. Sorted one-dimensional correlated array maps can be partitioned directly because every touched chunk owns a contiguous slice of the index array. That case bypasses candidate enumeration and repeated intersection. -`sub_transform_to_selections` bridges from the transform representation -back to the raw `(chunk_selection, out_selection, drop_axes)` tuples that -the current codec pipeline expects. This bridge will go away when the codec -pipeline accepts transforms natively. +The public result is a lazy, reusable `ChunkPlan`. Each `ChunkProjection` is +source-independent: it identifies the chunk and expresses both sides of the +gather without assuming NumPy selectors, a codec pipeline, or an execution +scheduler. """ from __future__ import annotations -from typing import TYPE_CHECKING, Any +from dataclasses import dataclass +from typing import TYPE_CHECKING, Any, Literal import numpy as np +from zarr_indexing._affine import checked_affine from zarr_indexing.domain import IndexDomain from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap -from zarr_indexing.transform import IndexTransform +from zarr_indexing.transform import ( + IndexTransform, +) if TYPE_CHECKING: from collections.abc import Iterator, Sequence from zarr_indexing.grid import DimensionGridLike -OutIndices = ( +_OutIndices = ( dict[int, np.ndarray[Any, np.dtype[np.intp]]] | np.ndarray[Any, np.dtype[np.intp]] | None ) -ChunkTransformResult = tuple[ +_ChunkTransformResult = tuple[ tuple[int, ...], IndexTransform, - OutIndices, + _OutIndices, ] +type ChunkCoverage = Literal["full", "partial", "unknown"] + + +def _data_size(dim_grid: DimensionGridLike, chunk_ix: int) -> int: + """Return a chunk's data extent, falling back for narrow-protocol grids.""" + data_size = getattr(dim_grid, "data_size", None) + if data_size is None: + return dim_grid.chunk_size(chunk_ix) + return int(data_size(chunk_ix)) + + +@dataclass(frozen=True, slots=True) +class ChunkProjection: + """One source-independent projection of a request through a chunk. + + Both transforms share a synthetic input domain. ``chunk_transform`` maps + that domain to chunk-local storage coordinates; ``cell_transform`` maps it + to the original request domain. + + Attributes + ---------- + chunk_coords + Coordinates of the selected cell in the caller's grid. + chunk_domain + Bounds of that grid cell in global storage coordinates. + chunk_transform + Mapping from the shared synthetic domain to chunk-local storage. + cell_transform + Mapping from the shared synthetic domain to request coordinates. + coverage + Whether the request is proven to cover the whole grid cell exactly + once. Fancy selections are conservatively ``"unknown"``. + + Examples + -------- + Row 1 of a `(3, 4)` array with `(2, 2)` chunks touches only part of the + first chunk, whose domain spans rows `[0, 2)` and columns `[0, 2)`: + + >>> from zarr_indexing import IndexTransform + >>> from zarr_indexing.grid import dimension_grids_from_chunks + >>> grids = dimension_grids_from_chunks((2, 2), shape=(3, 4)) + >>> plan = plan_chunks(IndexTransform.from_shape((3, 4))[1, :], grids) + >>> first = next(iter(plan)) + >>> first.chunk_coords + (0, 0) + >>> first.chunk_domain.shape + (2, 2) + >>> first.coverage + 'partial' + """ + + chunk_coords: tuple[int, ...] + chunk_domain: IndexDomain + chunk_transform: IndexTransform + cell_transform: IndexTransform + coverage: ChunkCoverage + + def __post_init__(self) -> None: + if self.chunk_transform.domain != self.cell_transform.domain: + raise ValueError( + "chunk_transform and cell_transform must share an input domain; " + f"got {self.chunk_transform.domain!r} and {self.cell_transform.domain!r}" + ) + + +@dataclass(frozen=True, slots=True) +class ChunkPlan: + """A reusable, lazy partition of an index transform over a chunk grid. + + Construct plans with `plan_chunks`; iterating either the plan or + `projections()` performs a fresh chunk walk. + + Examples + -------- + Row 1 of a `(3, 4)` array with `(2, 2)` chunks crosses two chunks, and + the plan can be walked again after it is exhausted: + + >>> from zarr_indexing import IndexTransform + >>> from zarr_indexing.grid import dimension_grids_from_chunks + >>> grids = dimension_grids_from_chunks((2, 2), shape=(3, 4)) + >>> plan = plan_chunks(IndexTransform.from_shape((3, 4))[1, :], grids) + >>> [p.chunk_coords for p in plan] + [(0, 0), (0, 1)] + >>> [p.chunk_coords for p in plan.projections()] + [(0, 0), (0, 1)] + """ + + transform: IndexTransform + """The composed request this plan partitions.""" + + dimension_grids: tuple[DimensionGridLike, ...] + """One grid per storage dimension, defining the chunk layout the plan walks.""" -def _one_dimensional_correlated_array_map( + def projections(self) -> Iterator[ChunkProjection]: + """Return a fresh iterator over the chunks touched by this plan.""" + return _iter_chunk_projections(self.transform, self.dimension_grids) + + def __iter__(self) -> Iterator[ChunkProjection]: + """Equivalent to `projections()`: each iteration performs a fresh chunk walk.""" + return self.projections() + + +def plan_chunks( + transform: IndexTransform, + dimension_grids: Sequence[DimensionGridLike], +) -> ChunkPlan: + """Plan a transform against a caller-selected chunk grid. + + Parameters + ---------- + transform + Mapping from the request domain to storage coordinates. + dimension_grids + One storage grid per transform output dimension. + + Returns + ------- + ChunkPlan + A reusable plan whose projections are computed lazily. + + Examples + -------- + Row 1 of a `(3, 4)` array with `(2, 2)` chunks touches the two chunks in + the top grid row, each contributing a `(2, 2)` chunk domain: + + >>> from zarr_indexing import IndexTransform + >>> from zarr_indexing.grid import dimension_grids_from_chunks + >>> grids = dimension_grids_from_chunks((2, 2), shape=(3, 4)) + >>> plan = plan_chunks(IndexTransform.from_shape((3, 4))[1, :], grids) + >>> [p.chunk_coords for p in plan] + [(0, 0), (0, 1)] + >>> [p.chunk_domain.shape for p in plan] + [(2, 2), (2, 2)] + """ + grids = tuple(dimension_grids) + if len(grids) != transform.output_rank: + raise ValueError( + "dimension_grids must have one entry per transform output dimension; " + f"got {len(grids)} grids for output rank {transform.output_rank}" + ) + return ChunkPlan(transform=transform, dimension_grids=grids) + + +def _one_dimensional_array_map( transform: IndexTransform, ) -> tuple[ArrayMap, np.ndarray[Any, np.dtype[np.intp]]] | None: - """Return a nonempty correlated 1-D ArrayMap and its storage coordinates. + """Return a nonempty 1-D single-ArrayMap transform's map and storage coords. A one-dimensional array selection has no cross-dimensional correlation to - preserve. The computed storage coordinates are also reused by general - resolution when they are unsorted. + preserve — the orthogonal and vectorized flavors coincide there — so the + sorted fast path applies to either spelling. The computed storage + coordinates are also reused by general resolution when they are unsorted. """ if transform.input_rank != 1 or transform.output_rank != 1: return None m = transform.output[0] - if ( - not isinstance(m, ArrayMap) - or m.input_dimension is not None - or m.index_array.ndim != 1 - or m.index_array.size == 0 - ): + if not isinstance(m, ArrayMap) or m.index_array.ndim != 1 or m.index_array.size == 0: return None - return m, m.offset + m.stride * m.index_array + return m, checked_affine(m.offset, m.stride, m.index_array) def _iter_sorted_1d_array_map( m: ArrayMap, storage: np.ndarray[Any, np.dtype[np.intp]], dim_grid: DimensionGridLike, -) -> Iterator[ChunkTransformResult]: +) -> Iterator[_ChunkTransformResult]: """Resolve a sorted 1-D ArrayMap one touched chunk at a time.""" start = 0 while start < storage.size: chunk = dim_grid.index_to_chunk(int(storage[start])) chunk_start = dim_grid.chunk_offset(chunk) - chunk_stop = chunk_start + dim_grid.chunk_size(chunk) + chunk_stop = chunk_start + _data_size(dim_grid, chunk) stop = int(np.searchsorted(storage, chunk_stop, side="left")) restricted = IndexTransform( @@ -101,7 +243,6 @@ def _iter_sorted_1d_array_map( index_array=m.index_array[start:stop], offset=m.offset, stride=m.stride, - input_dimension=m.input_dimension, ), ), ) @@ -112,23 +253,24 @@ def _iter_sorted_1d_array_map( start = stop -def iter_chunk_transforms( +def _iter_chunk_transform_results( transform: IndexTransform, dim_grids: Sequence[DimensionGridLike], -) -> Iterator[ChunkTransformResult]: - """Resolve a composed IndexTransform against per-dimension chunk grids. +) -> Iterator[_ChunkTransformResult]: + """Resolve a transform into private intersection bookkeeping. - `dim_grids` holds one `DimensionGridLike` per output (storage) dimension — - for zarr this is the chunk grid's per-dimension sequence. Yields - `(chunk_coords, sub_transform, out_indices)` triples: - - - `chunk_coords`: which chunk to access. - - `sub_transform`: maps output buffer coords to chunk-local coords. - - `out_indices`: for vectorized/array indexing, the output scatter - indices (integer array). `None` for basic/slice indexing. + The survivor arrays are an implementation detail immediately converted to + a public `cell_transform` by `_iter_chunk_projections`. """ - array_map_1d = _one_dimensional_correlated_array_map(transform) + if any(size == 0 for size in transform.domain.shape): + # An empty view touches no chunk. Checked on the domain rather than on + # the index arrays: an axis of genuine extent 1 is stored as a broadcast + # singleton, so a slice that empties the domain does not shrink the + # array, and the emptiness shows only here. + return + + array_map_1d = _one_dimensional_array_map(transform) if array_map_1d is not None: sorted_map, storage = array_map_1d if storage[0] <= storage[-1] and bool(np.all(storage[1:] >= storage[:-1])): @@ -163,6 +305,7 @@ def iter_chunk_transforms( # combinations no point touches — quadratic in the number of selected # points for a diagonal selection — while the joint distinct set is # bounded by the point count (see zarr-python gh-4174). + structure = transform.index_array_structure correlated_dims: list[int] = [] correlated_chunk_ids: list[np.ndarray[Any, np.dtype[np.intp]]] = [] slot_dims: list[tuple[int, ...]] = [] @@ -171,7 +314,8 @@ def iter_chunk_transforms( dg = dim_grids[out_dim] if isinstance(m, ConstantMap): # Single chunk - c = dg.index_to_chunk(m.offset) + coordinate = checked_affine(m.offset, 0, 0) + c = dg.index_to_chunk(coordinate) slot_dims.append((out_dim,)) slot_candidates.append(((c,),)) elif isinstance(m, DimensionMap): @@ -180,34 +324,51 @@ def iter_chunk_transforms( dim_hi = transform.domain.exclusive_max[d] if dim_lo >= dim_hi: return # empty domain + first_storage = checked_affine(m.offset, m.stride, dim_lo) if m.stride > 0: - s_min = m.offset + m.stride * dim_lo - s_max = m.offset + m.stride * (dim_hi - 1) + s_min = first_storage + s_max = checked_affine(m.offset, m.stride, dim_hi - 1) + elif m.stride < 0: + s_min = checked_affine(m.offset, m.stride, dim_hi - 1) + s_max = first_storage else: - s_min = m.offset + m.stride * (dim_hi - 1) - s_max = m.offset + m.stride * dim_lo + s_min = s_max = first_storage first = dg.index_to_chunk(s_min) last = dg.index_to_chunk(s_max) slot_dims.append((out_dim,)) - slot_candidates.append([(c,) for c in range(first, last + 1)]) + point_count = dim_hi - dim_lo + chunk_count = last - first + 1 + if point_count < chunk_count: + steps = np.arange(point_count, dtype=np.intp) + storage = checked_affine(first_storage, m.stride, steps) + chunk_ids = dg.indices_to_chunks(storage) + slot_candidates.append([(int(c),) for c in np.unique(chunk_ids)]) + else: + slot_candidates.append([(c,) for c in range(first, last + 1)]) else: # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap). # Storage coordinates were already computed for a correlated 1-D map. storage = ( - array_map_1d[1] if array_map_1d is not None else m.offset + m.stride * m.index_array + array_map_1d[1] + if array_map_1d is not None + else checked_affine(m.offset, m.stride, m.index_array) ) if storage.size == 0: # Empty fancy selection: no coordinates, so no chunks are touched. return # Keep the index-array shape: correlated maps broadcast against each # other below, and raveling first would lose the singleton axes. - chunk_ids = dg.indices_to_chunks(storage.astype(np.intp)) - if m.input_dimension is None: - correlated_dims.append(out_dim) - correlated_chunk_ids.append(chunk_ids) - else: + chunk_ids = dg.indices_to_chunks(storage) + if structure == "orthogonal": slot_dims.append((out_dim,)) slot_candidates.append([(int(c),) for c in np.unique(chunk_ids)]) + else: + # Every index array of a general transform joins one joint + # slot: their chunk ids broadcast over the shared block, so the + # distinct tuples enumerate only combinations some point + # actually touches. + correlated_dims.append(out_dim) + correlated_chunk_ids.append(chunk_ids) if len(correlated_dims) == 1: slot_dims.append((correlated_dims[0],)) @@ -238,7 +399,7 @@ def iter_chunk_transforms( for out_dim, c in enumerate(chunk_coords): dg = dim_grids[out_dim] c_start = dg.chunk_offset(c) - c_size = dg.chunk_size(c) + c_size = _data_size(dg, c) chunk_min.append(c_start) chunk_max.append(c_start + c_size) chunk_shift.append(-c_start) @@ -261,120 +422,174 @@ def iter_chunk_transforms( yield (chunk_coords, local, surviving) -def sub_transform_to_selections( - sub_transform: IndexTransform, - out_indices: OutIndices = None, -) -> tuple[ - tuple[int | slice | np.ndarray[tuple[int, ...], np.dtype[np.intp]], ...], - tuple[slice | np.ndarray[tuple[int, ...], np.dtype[np.intp]], ...], - tuple[int, ...], -]: - """Convert a chunk-local sub-transform to raw selections for the codec pipeline. - - Parameters - ---------- - sub_transform - A chunk-local IndexTransform (output maps already translated to - chunk-local coordinates). - out_indices - For vectorized indexing: the output scatter indices for this chunk. - None for orthogonal/basic indexing. +def _covers_whole_chunk(transform: IndexTransform, chunk_shape: tuple[int, ...]) -> bool: + """Whether an affine chunk-local transform bijects onto every chunk cell.""" + domain = transform.domain + used_nontrivial_inputs: set[int] = set() + for out_dim, m in enumerate(transform.output): + extent = chunk_shape[out_dim] + if isinstance(m, ConstantMap): + if extent != 1 or m.offset != 0: + return False + elif isinstance(m, DimensionMap): + if abs(m.stride) != 1: + return False + lo = domain.inclusive_min[m.input_dimension] + hi = domain.exclusive_max[m.input_dimension] + if hi <= lo: + if extent != 0: + return False + continue + first = m.offset + m.stride * lo + last = m.offset + m.stride * (hi - 1) + if min(first, last) != 0 or max(first, last) != extent - 1: + return False + if extent > 1: + if m.input_dimension in used_nontrivial_inputs: + return False + used_nontrivial_inputs.add(m.input_dimension) + else: + return False + nontrivial_inputs = {dimension for dimension, extent in enumerate(domain.shape) if extent > 1} + return used_nontrivial_inputs == nontrivial_inputs + + +def _orthogonal_cell_transform( + original: IndexTransform, + restricted: IndexTransform, + survivors: dict[int, np.ndarray[Any, np.dtype[np.intp]]] | np.ndarray[Any, np.dtype[np.intp]], +) -> IndexTransform: + """Map a compacted orthogonal intersection back to request coordinates.""" + by_input_dimension: dict[int, np.ndarray[Any, np.dtype[np.intp]]] = {} + if isinstance(survivors, dict): + survivor_items = survivors.items() + else: + array_output_dimensions = [ + output_dimension + for output_dimension, output_map in enumerate(original.output) + if isinstance(output_map, ArrayMap) + ] + if len(array_output_dimensions) != 1: + raise ValueError( + "one survivor array requires exactly one orthogonal ArrayMap; " + f"found output dimensions {array_output_dimensions}" + ) + survivor_items = ((array_output_dimensions[0], survivors),) - Returns - ------- - tuple - `(chunk_selection, out_selection, drop_axes)` - """ - inclusive_min = sub_transform.domain.inclusive_min - exclusive_max = sub_transform.domain.exclusive_max - - # Orthogonal outer product: >= 2 ArrayMaps each bound to a distinct input - # dimension. out_indices is a per-output-dim dict of surviving positions. The - # codec applies chunk_array[chunk_sel] / out[out_sel] with NumPy semantics, so - # build np.ix_-style selections (mirroring the legacy OrthogonalIndexer): one - # 1-D selector per dimension, expanded to an open mesh. ConstantMap dims are - # size-1 in chunk space and squeezed out via drop_axes. - if isinstance(out_indices, dict): - chunk_arrays: list[np.ndarray[Any, np.dtype[np.intp]]] = [] - out_arrays: list[np.ndarray[Any, np.dtype[np.intp]]] = [] - drop_axes: list[int] = [] - for out_dim, m in enumerate(sub_transform.output): - if isinstance(m, ConstantMap): - chunk_arrays.append(np.array([m.offset], dtype=np.intp)) - drop_axes.append(out_dim) - elif isinstance(m, DimensionMap): - rng = np.arange(inclusive_min[m.input_dimension], exclusive_max[m.input_dimension]) - chunk_arrays.append((m.offset + m.stride * rng).astype(np.intp)) - out_arrays.append(rng.astype(np.intp)) - else: # ArrayMap - idx = m.index_array.ravel() - chunk_arrays.append((m.offset + m.stride * idx).astype(np.intp)) - out_arrays.append(out_indices[out_dim]) - return np.ix_(*chunk_arrays), np.ix_(*out_arrays), tuple(drop_axes) - - # Correlated (vindex) sub-transforms carry ArrayMaps with `input_dimension` - # None. They scatter through a single flat index (`out_indices`) into the - # row-major-flattened output buffer; the chunk selection reads a - # (points, residual-slice) block via the raveled coordinate arrays and any - # residual DimensionMap slices. - correlated = any( - isinstance(m, ArrayMap) and m.input_dimension is None for m in sub_transform.output + for output_dimension, positions in survivor_items: + output_map = original.output[output_dimension] + if not isinstance(output_map, ArrayMap): + raise TypeError( + f"survivors for output dimension {output_dimension} do not describe an ArrayMap" + ) + input_dimension = output_map.dependent_axis + if input_dimension is None: + raise ValueError( + f"output dimension {output_dimension} has no orthogonal input dimension" + ) + by_input_dimension[input_dimension] = np.asarray(positions, dtype=np.intp) + + output: list[ConstantMap | DimensionMap | ArrayMap] = [] + rank = original.input_rank + for input_dimension in range(rank): + positions = by_input_dimension.get(input_dimension) + if positions is None: + output.append(DimensionMap(input_dimension=input_dimension)) + continue + shape = (1,) * input_dimension + (positions.size,) + (1,) * (rank - input_dimension - 1) + output.append( + ArrayMap( + index_array=positions.reshape(shape), + offset=original.domain.inclusive_min[input_dimension], + ) + ) + return IndexTransform(domain=restricted.domain, output=tuple(output)) + + +def _correlated_cell_transform( + original: IndexTransform, + restricted: IndexTransform, + survivors: np.ndarray[Any, np.dtype[np.intp]], +) -> IndexTransform: + """Map compacted correlated points back through the request's row-major domain.""" + positions = np.asarray(survivors, dtype=np.intp) + # Correlated broadcast axes already contribute positional survivor offsets; + # residual affine axes still contribute literal coordinates. Remove only + # the latter origins before unraveling the fully positional flat offsets. + literal_axes = { + output_map.input_dimension + for output_map in original.output + if isinstance(output_map, DimensionMap) + } + origin_offset = 0 + flat_stride = 1 + for input_dimension in range(original.input_rank - 1, -1, -1): + if input_dimension in literal_axes: + origin_offset += original.domain.inclusive_min[input_dimension] * flat_stride + extent = original.domain.shape[input_dimension] + flat_stride *= extent + coordinates = np.unravel_index( + checked_affine(-origin_offset, 1, positions), original.domain.shape ) - if correlated: - chunk_sel: list[int | slice | np.ndarray[tuple[int, ...], np.dtype[np.intp]]] = [] - for m in sub_transform.output: - if isinstance(m, ConstantMap): - chunk_sel.append(m.offset) - elif isinstance(m, DimensionMap): - d = m.input_dimension - start = m.offset + m.stride * inclusive_min[d] - stop = m.offset + m.stride * exclusive_max[d] - if m.stride < 0: - start, stop = stop + 1, start + 1 - chunk_sel.append(slice(start, stop, m.stride)) - else: # ArrayMap - idx = m.index_array.reshape(-1) - chunk_sel.append((m.offset + m.stride * idx).astype(np.intp)) - # Chunk resolution always supplies the flat scatter index for a - # correlated transform. Absent one (a bare sub-transform), fall back to an - # identity scatter over the whole flattened output buffer. - # `out_indices` is narrowed to a flat scatter array or None here (the - # per-dimension dict is an orthogonal outer product, handled above). - out_scatter: slice | np.ndarray[Any, np.dtype[np.intp]] - if out_indices is None: - n = 1 - for s in sub_transform.domain.shape: - n *= s - out_scatter = slice(0, n) - else: - out_scatter = out_indices - return tuple(chunk_sel), (out_scatter,), () + output = tuple( + ArrayMap( + index_array=np.asarray(coordinate, dtype=np.intp), + offset=origin, + ) + for coordinate, origin in zip(coordinates, original.domain.inclusive_min, strict=True) + ) + return IndexTransform(domain=restricted.domain, output=output) - chunk_sel = [] # annotated in the correlated branch above (same function scope) - out_sel: list[slice | np.ndarray[tuple[int, ...], np.dtype[np.intp]]] = [] - # Single-pass build for the basic / single-orthogonal-array cases. - # ConstantMap dims are dropped (no out_sel entry). - for m in sub_transform.output: - if isinstance(m, ConstantMap): - chunk_sel.append(m.offset) - elif isinstance(m, DimensionMap): - d = m.input_dimension - dim_lo = inclusive_min[d] - dim_hi = exclusive_max[d] - start = m.offset + m.stride * dim_lo - stop = m.offset + m.stride * dim_hi - if m.stride < 0: - start, stop = stop + 1, start + 1 - chunk_sel.append(slice(start, stop, m.stride)) - out_sel.append(slice(dim_lo, dim_hi)) - else: # ArrayMap (orthogonal: full-rank, raveled to its 1-D fancy coords) - idx = m.index_array.reshape(-1) - if m.offset == 0 and m.stride == 1: - chunk_sel.append(idx) - else: - chunk_sel.append((m.offset + m.stride * idx).astype(np.intp)) - # Orthogonal ArrayMap: out_indices holds the surviving positions. - out_sel.append(out_indices if out_indices is not None else slice(0, idx.size)) +def _cell_transform( + original: IndexTransform, + restricted: IndexTransform, + survivors: _OutIndices, +) -> IndexTransform: + """Convert private survivor bookkeeping into a direction-neutral transform.""" + if survivors is None: + return IndexTransform.identity(restricted.domain) + if original.index_array_structure == "general": + if isinstance(survivors, dict): + raise ValueError("general intersections require one shared survivor array") + return _correlated_cell_transform(original, restricted, survivors) + return _orthogonal_cell_transform(original, restricted, survivors) + - return tuple(chunk_sel), tuple(out_sel), () +def _iter_chunk_projections( + transform: IndexTransform, + dim_grids: Sequence[DimensionGridLike], +) -> Iterator[ChunkProjection]: + """Convert private intersection results into public paired projections.""" + for chunk_coords, chunk_transform, survivors in _iter_chunk_transform_results( + transform, dim_grids + ): + chunk_min = tuple( + grid.chunk_offset(coord) for grid, coord in zip(dim_grids, chunk_coords, strict=True) + ) + chunk_shape = tuple( + _data_size(grid, coord) for grid, coord in zip(dim_grids, chunk_coords, strict=True) + ) + chunk_domain = IndexDomain( + inclusive_min=chunk_min, + exclusive_max=tuple( + origin + extent for origin, extent in zip(chunk_min, chunk_shape, strict=True) + ), + ) + cell_transform = _cell_transform(transform, chunk_transform, survivors) + synthetic_origin = (0,) * chunk_transform.input_rank + chunk_transform = chunk_transform.translate_domain_to(synthetic_origin) + cell_transform = cell_transform.translate_domain_to(synthetic_origin) + if survivors is not None or any(isinstance(m, ArrayMap) for m in chunk_transform.output): + coverage: ChunkCoverage = "unknown" + elif _covers_whole_chunk(chunk_transform, chunk_shape): + coverage = "full" + else: + coverage = "partial" + yield ChunkProjection( + chunk_coords=chunk_coords, + chunk_domain=chunk_domain, + chunk_transform=chunk_transform, + cell_transform=cell_transform, + coverage=coverage, + ) diff --git a/packages/zarr-indexing/src/zarr_indexing/composition.py b/packages/zarr-indexing/src/zarr_indexing/composition.py deleted file mode 100644 index f5cc82599c..0000000000 --- a/packages/zarr-indexing/src/zarr_indexing/composition.py +++ /dev/null @@ -1,133 +0,0 @@ -"""Composition — chaining two transforms into one. - -`compose(outer, inner)` is the operation that makes views stack. `outer` maps -user coordinates to intermediate coordinates, `inner` maps those intermediate -coordinates to storage, and the result maps user coordinates straight to -storage — so a view of a view of an array is still a single -`IndexTransform`, and indexing never accumulates layers to walk at read time. - -Composition works one output map at a time, and each case reduces to -substituting the outer map into the inner one: - -- A `ConstantMap` inner map ignores its input, so it survives unchanged. -- A `DimensionMap` inner map is affine, so composing it with an outer - `ConstantMap` or `DimensionMap` folds into new `offset`/`stride` values; - composing it with an outer `ArrayMap` leaves the index array alone and - rescales around it. -- An `ArrayMap` inner map must be *evaluated* at the coordinates the outer - transform produces, which is the only case that touches array data. -""" - -from __future__ import annotations - -import numpy as np - -from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap, OutputIndexMap -from zarr_indexing.transform import IndexTransform - - -def compose(outer: IndexTransform, inner: IndexTransform) -> IndexTransform: - """Compose two IndexTransforms. - - `outer` maps user coords (rank m) to intermediate coords (rank n). - `inner` maps intermediate coords (rank n) to storage coords (rank p). - The result maps user coords (rank m) to storage coords (rank p). - - Precondition: `outer.output_rank == inner.domain.ndim`. - """ - if outer.output_rank != inner.domain.ndim: - raise ValueError( - f"outer output rank ({outer.output_rank}) must match inner input rank " - f"({inner.domain.ndim})" - ) - - result_output = [_compose_single(outer, inner_map) for inner_map in inner.output] - - return IndexTransform(domain=outer.domain, output=tuple(result_output)) - - -def _compose_single(outer: IndexTransform, inner_map: OutputIndexMap) -> OutputIndexMap: - """Compose a single inner output map with the full outer transform.""" - if isinstance(inner_map, ConstantMap): - return ConstantMap(offset=inner_map.offset) - - if isinstance(inner_map, DimensionMap): - return _compose_dimension(outer, inner_map) - - # inner_map: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) - return _compose_array(outer, inner_map) - - -def _compose_dimension(outer: IndexTransform, inner_map: DimensionMap) -> OutputIndexMap: - """Compose when inner is a DimensionMap. - - storage = offset_i + stride_i * intermediate[dim_i] - where intermediate[dim_i] = outer.output[dim_i](user_input) - """ - dim_i = inner_map.input_dimension - offset_i = inner_map.offset - stride_i = inner_map.stride - outer_map = outer.output[dim_i] - - if isinstance(outer_map, ConstantMap): - return ConstantMap(offset=offset_i + stride_i * outer_map.offset) - - if isinstance(outer_map, DimensionMap): - return DimensionMap( - input_dimension=outer_map.input_dimension, - offset=offset_i + stride_i * outer_map.offset, - stride=stride_i * outer_map.stride, - ) - - # outer_map: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) - # Affine post-composition leaves the index array (and hence its full - # input rank and dependency axes) untouched; carry the orthogonal - # binding through unchanged. - return ArrayMap( - index_array=outer_map.index_array, - offset=offset_i + stride_i * outer_map.offset, - stride=stride_i * outer_map.stride, - input_dimension=outer_map.input_dimension, - ) - - -def _compose_array(outer: IndexTransform, inner_map: ArrayMap) -> OutputIndexMap: - """Compose when inner is an ArrayMap. - - storage = offset_i + stride_i * arr_i[intermediate] - We need to evaluate arr_i at the intermediate coordinates produced by outer. - """ - arr_i = inner_map.index_array - offset_i = inner_map.offset - stride_i = inner_map.stride - - # Check if all outer outputs are constant - all_constant = all(isinstance(m, ConstantMap) for m in outer.output) - - if all_constant: - # Evaluate arr_i at the single constant point - idx = tuple(m.offset for m in outer.output if isinstance(m, ConstantMap)) - value = int(arr_i[idx]) - return ConstantMap(offset=offset_i + stride_i * value) - - # For 1D inner array with a single outer output (simple case) - if arr_i.ndim == 1 and len(outer.output) == 1: - outer_map = outer.output[0] - - if isinstance(outer_map, DimensionMap): - dim_size = outer.domain.shape[outer_map.input_dimension] - user_indices = np.arange(dim_size, dtype=np.intp) - intermediate_vals = outer_map.offset + outer_map.stride * user_indices - new_arr = arr_i[intermediate_vals] - return ArrayMap(index_array=new_arr, offset=offset_i, stride=stride_i) - - if isinstance(outer_map, ArrayMap): - intermediate_vals = outer_map.offset + outer_map.stride * outer_map.index_array - new_arr = arr_i[intermediate_vals] - return ArrayMap(index_array=new_arr, offset=offset_i, stride=stride_i) - - # General multi-dim case: not yet implemented - raise NotImplementedError( - "Composing a multi-dimensional inner array map with non-constant outer maps " - "is not yet supported." - ) diff --git a/packages/zarr-indexing/src/zarr_indexing/domain.py b/packages/zarr-indexing/src/zarr_indexing/domain.py index f20d5bf7bd..a353b81254 100644 --- a/packages/zarr-indexing/src/zarr_indexing/domain.py +++ b/packages/zarr-indexing/src/zarr_indexing/domain.py @@ -14,7 +14,12 @@ from __future__ import annotations from dataclasses import dataclass, field -from typing import Any +from typing import TYPE_CHECKING, Any + +from zarr_indexing.errors import BoundsCheckError + +if TYPE_CHECKING: + from zarr_indexing.json import IndexDomainJSON @dataclass(frozen=True, slots=True) @@ -23,11 +28,32 @@ class IndexDomain: The valid coordinates are the integers in `[inclusive_min[d], exclusive_max[d])` for each dimension `d`. + + Examples + -------- + >>> domain = IndexDomain(inclusive_min=(2, 5), exclusive_max=(10, 20)) + >>> domain.shape + (8, 15) + + Unlike a NumPy shape, a domain keeps literal coordinates: narrowing to + `[5, 10)` gives a region whose valid coordinates are 5 through 9, not + re-zeroed: + + >>> view = IndexDomain.from_shape((10,)).narrow(slice(5, 10)) + >>> view.origin, view.shape + ((5,), (5,)) + >>> view.contains((5,)), view.contains((0,)) + (True, False) """ inclusive_min: tuple[int, ...] + """The lower corner: each dimension's smallest literal coordinate. May be negative.""" + exclusive_max: tuple[int, ...] + """Each dimension's upper bound, excluded: valid coordinates end at `exclusive_max - 1`.""" + labels: tuple[str, ...] | None = None + """Optional per-dimension names; carried through the wire format, never consulted by indexing.""" # Lazily-memoized shape. Excluded from init/repr/eq/hash: it is derived # state, not part of the domain's identity. The domain is frozen, so the # value is computed at most once (see `shape`). `None` is the unset @@ -62,14 +88,17 @@ def from_shape(cls, shape: tuple[int, ...]) -> IndexDomain: @property def ndim(self) -> int: + """Number of dimensions.""" return len(self.inclusive_min) @property def origin(self) -> tuple[int, ...]: + """The lower corner of the domain — an alias for `inclusive_min`, and may be negative.""" return self.inclusive_min @property def shape(self) -> tuple[int, ...]: + """Per-dimension extents: `exclusive_max - inclusive_min` for each dimension.""" cached = self._shape if cached is None: cached = tuple( @@ -79,6 +108,12 @@ def shape(self) -> tuple[int, ...]: return cached def contains(self, index: tuple[int, ...]) -> bool: + """Whether the literal coordinate `index` lies inside this domain. + + Coordinates are literal, not NumPy-style offsets: a negative value is + the coordinate itself, valid only if the domain's bounds include it. + A tuple of the wrong length is simply not contained (returns `False`). + """ if len(index) != self.ndim: return False return all( @@ -87,6 +122,11 @@ def contains(self, index: tuple[int, ...]) -> bool: ) def contains_domain(self, other: IndexDomain) -> bool: + """Whether every coordinate of `other` lies inside this domain. + + An empty `other` within this domain's bounds is contained. A rank + mismatch returns `False` rather than raising. + """ if other.ndim != self.ndim: return False return all( @@ -101,6 +141,13 @@ def contains_domain(self, other: IndexDomain) -> bool: ) def intersect(self, other: IndexDomain) -> IndexDomain | None: + """Return the overlap of this domain with `other`, or `None` if they are disjoint. + + Raises + ------ + ValueError + If the two domains have different ranks. + """ if other.ndim != self.ndim: raise ValueError( f"Cannot intersect domains with different ranks: {self.ndim} vs {other.ndim}" @@ -116,6 +163,15 @@ def intersect(self, other: IndexDomain) -> IndexDomain | None: return IndexDomain(inclusive_min=new_min, exclusive_max=new_max) def translate(self, offset: tuple[int, ...]) -> IndexDomain: + """Return this domain shifted by `offset` per dimension; the shape is unchanged. + + Offsets may be negative, and the result may have a negative origin. + + Raises + ------ + ValueError + If `offset` does not have one entry per dimension. + """ if len(offset) != self.ndim: raise ValueError( f"Offset must have same length as domain dimensions. " @@ -127,8 +183,22 @@ def translate(self, offset: tuple[int, ...]) -> IndexDomain: def narrow(self, selection: Any) -> IndexDomain: """Apply a basic selection and return a narrowed domain. - Indices are absolute coordinates. Integer indices produce length-1 extent. - Strided slices are not supported — use IndexTransform for strides. + + Indices are absolute coordinates, not NumPy-style offsets: `-3` names + the coordinate `-3`, and is out of bounds unless the domain contains it. + Integer indices produce a length-1 extent. Strided slices are not + supported — use `IndexTransform` for strides. + + Raises + ------ + BoundsCheckError + If a bound lies outside this domain. A slice bound used to be + clamped instead, so `narrow(slice(-3, None))` on `[0, 10)` quietly + returned the whole axis — reading as the NumPy spelling of "the last + three" and answering with something else — and `narrow(slice(20, + 30))` returned a domain its own parent did not contain. The rest of + the algebra states no clamping and no negative wrapping as an + invariant and enforces it; this is the one place that did not. """ normalized = _normalize_selection(selection, self.ndim) new_inclusive_min: list[int] = [] @@ -138,7 +208,7 @@ def narrow(self, selection: Any) -> IndexDomain: ): if isinstance(sel, int): if sel < dim_lo or sel >= dim_hi: - raise IndexError( + raise BoundsCheckError( f"index {sel} is out of bounds for dimension {dim_idx} " f"with domain [{dim_lo}, {dim_hi})" ) @@ -147,22 +217,88 @@ def narrow(self, selection: Any) -> IndexDomain: else: start, stop, step = sel.start, sel.stop, sel.step if step is not None and step != 1: - raise IndexError( + raise ValueError( "IndexDomain.narrow only supports step=1 slices. " f"Got step={step}. Use IndexTransform for strided access." ) abs_start = dim_lo if start is None else start abs_stop = dim_hi if stop is None else stop - abs_start = max(abs_start, dim_lo) - abs_stop = min(abs_stop, dim_hi) - abs_stop = max(abs_stop, abs_start) + for bound, name in ((abs_start, "start"), (abs_stop, "stop")): + if bound < dim_lo or bound > dim_hi: + raise BoundsCheckError( + f"slice {name} {bound} is out of bounds for dimension " + f"{dim_idx} with domain [{dim_lo}, {dim_hi}); indices " + f"here are absolute coordinates, so they are neither " + f"clamped to the domain nor counted from its end" + ) + # An empty interval is legal; a reversed one is the same request + # spelled backwards, and reads as empty rather than as an error. new_inclusive_min.append(abs_start) - new_exclusive_max.append(abs_stop) + new_exclusive_max.append(max(abs_stop, abs_start)) return IndexDomain( inclusive_min=tuple(new_inclusive_min), exclusive_max=tuple(new_exclusive_max), ) + # -- serialization ------------------------------------------------------ + + def to_json(self) -> IndexDomainJSON: + """Convert to the canonical ndsel JSON representation. + + Examples + -------- + >>> IndexDomain(inclusive_min=(0,), exclusive_max=(3,)).to_json() + {'input_inclusive_min': [0], 'input_exclusive_max': [3], 'input_labels': ['']} + """ + from zarr_indexing._wire import emit_labels + + return { + "input_inclusive_min": list(self.inclusive_min), + "input_exclusive_max": list(self.exclusive_max), + "input_labels": emit_labels(self.labels, self.ndim), + } + + @classmethod + def from_json(cls, data: IndexDomainJSON) -> IndexDomain: + """Construct from the canonical ndsel JSON representation. + + The document is validated by the message layer first, exactly as a + transform body is. Reading the keys directly would be a second, + undefended way into the same objects: `int(value)` alone accepts + `3.9`, `"3"` and `True`, and each of those builds a domain that is + not the document's. + + Examples + -------- + >>> domain = IndexDomain.from_json( + ... {"input_inclusive_min": [1], "input_exclusive_max": [4], "input_labels": [""]} + ... ) + >>> (domain.inclusive_min, domain.exclusive_max, domain.shape) + ((1,), (4,), (3,)) + >>> IndexDomain.from_json(domain.to_json()) == domain + True + """ + from zarr_indexing._wire import lower_bound, lower_labels + from zarr_indexing.messages import NdselError, normalize_ndsel + + # The annotation says what a well-formed caller passes; this is a parser + # of documents that arrive from elsewhere, so the shape is checked + # rather than assumed. + if not isinstance(data, dict): # pyright: ignore[reportUnnecessaryIsInstance] + raise NdselError("invalid_json", f"an index domain must be a JSON object, got {data!r}") + body = normalize_ndsel({**data, "kind": "transform"}) + return cls( + inclusive_min=tuple( + lower_bound(b, f"input_inclusive_min[{i}]") + for i, b in enumerate(body["input_inclusive_min"]) + ), + exclusive_max=tuple( + lower_bound(b, f"input_exclusive_max[{i}]") + for i, b in enumerate(body["input_exclusive_max"]) + ), + labels=lower_labels(body["input_labels"]), + ) + def _normalize_selection(selection: Any, ndim: int) -> tuple[int | slice, ...]: """Normalize a basic selection to a tuple of ints/slices with length ndim.""" diff --git a/packages/zarr-indexing/src/zarr_indexing/errors.py b/packages/zarr-indexing/src/zarr_indexing/errors.py index fa2f6fc5d3..efd3b1ecd6 100644 --- a/packages/zarr-indexing/src/zarr_indexing/errors.py +++ b/packages/zarr-indexing/src/zarr_indexing/errors.py @@ -1,10 +1,12 @@ """Canonical index-error types raised by the transform algebra. -These are the authoritative class definitions. `zarr.errors` re-exports the -same objects (`from zarr_indexing.errors import ...`) so that, e.g., -`zarr.errors.BoundsCheckError is zarr_indexing.errors.BoundsCheckError`. -Both subclass the built-in `IndexError`, so existing `except IndexError` (or -`except zarr.errors.BoundsCheckError`) catch sites keep working unchanged. +Both subclass the built-in `IndexError`, so an `except IndexError` catch site +keeps working unchanged whichever library raised. + +`zarr.errors` defines classes of the same names, and they are *not* these +objects: `zarr.errors.BoundsCheckError is BoundsCheckError` is false. Catching +zarr's around a call into this package therefore catches nothing but their +shared `IndexError` base. Import these from here. """ from __future__ import annotations @@ -15,7 +17,51 @@ ] -class VindexInvalidSelectionError(IndexError): ... +class VindexInvalidSelectionError(IndexError): + """A wrapper `vindex` selection contained a slice. + + Raised by `LazyArray`'s selection validation: the wrapper's vectorized + dialect accepts coordinate selections (integer arrays, with scalars and + an ellipsis) or a single boolean mask, and rejects slices with this + error. Other invalid entries raise plain `IndexError`, and the + engine-level `IndexTransform.vindex` is wider — it accepts residual + slice dimensions without raising. + + Examples + -------- + Raised by the wrapper, not the engine — a slice inside `vindex`: + + >>> import numpy as np + >>> from zarr_indexing import LazyArray + >>> view = LazyArray.from_numpy(np.arange(12).reshape(3, 4)) + >>> view.lazy.vindex[np.array([0, 2]), :] + Traceback (most recent call last): + ... + zarr_indexing.errors.VindexInvalidSelectionError: ... + """ + + +class BoundsCheckError(IndexError): + """A selection addressed coordinates outside the domain being indexed. + + Raised for out-of-domain integer indices, slice bounds, index-array + values, and points passed to `IndexTransform.apply`. Coordinates in this + algebra are literal: they are never clamped, and a negative value below + the domain's `inclusive_min` is out of bounds rather than counted from + the end. + + Examples + -------- + >>> from zarr_indexing import IndexTransform + >>> IndexTransform.from_shape((8,)).apply((9,)) + Traceback (most recent call last): + ... + zarr_indexing.errors.BoundsCheckError: ... + A negative index is a literal coordinate, not "from the end": -class BoundsCheckError(IndexError): ... + >>> IndexTransform.from_shape((8,))[-1] + Traceback (most recent call last): + ... + zarr_indexing.errors.BoundsCheckError: ... + """ diff --git a/packages/zarr-indexing/src/zarr_indexing/grid.py b/packages/zarr-indexing/src/zarr_indexing/grid.py index de1dae2dfc..20ad3f95c2 100644 --- a/packages/zarr-indexing/src/zarr_indexing/grid.py +++ b/packages/zarr-indexing/src/zarr_indexing/grid.py @@ -1,25 +1,826 @@ -"""Structural typing for the chunk-grid surface used by chunk resolution. +"""Compact chunk grids and the narrow planner protocol. -`chunk_resolution` needs only a narrow slice of a chunk grid: the per-dimension -mapping between storage indices and chunk coordinates, passed as one -`DimensionGridLike` per storage dimension. Rather than import zarr's concrete -grid types, we type against this Protocol; zarr's per-dimension grids satisfy -it structurally, so no zarr import is needed here. +``DimensionGridLike`` describes only the per-axis operations required by +``plan_chunks``. The concrete compact grids below also retain enough metadata +to describe chunk data regions and codec buffer regions without importing +Zarr's array implementation. """ from __future__ import annotations -from typing import TYPE_CHECKING, Protocol +import bisect +import itertools +import operator +from dataclasses import dataclass, field +from functools import reduce +from typing import TYPE_CHECKING, Any, Protocol, cast, runtime_checkable + +import numpy as np if TYPE_CHECKING: - import numpy as np + from collections.abc import Iterable, Iterator, Sequence + import numpy.typing as npt class DimensionGridLike(Protocol): - """The per-dimension chunk-mapping surface consumed by chunk resolution.""" + """The per-dimension chunk-mapping surface consumed by chunk resolution. + + Examples + -------- + `EdgeDimensionGrid` provides this surface. Chunk sizes `(2, 3)` tile + source coordinates `[0, 5)`, so index 4 lands in the second chunk: + + >>> grid = EdgeDimensionGrid([2, 3]) + >>> grid.index_to_chunk(4) + 1 + >>> grid.chunk_offset(1), grid.chunk_size(1) + (2, 3) + """ + + def index_to_chunk(self, idx: int) -> int: + """Map a global source index to the index of the chunk that contains it. + + Implementers must raise `IndexError` when `idx` lies outside `[0, extent)`. + """ + ... + + def chunk_offset(self, chunk_ix: int) -> int: + """The global source coordinate at which chunk `chunk_ix` begins.""" + ... + + def chunk_size(self, chunk_ix: int) -> int: + """The declared length of chunk `chunk_ix`, i.e. its codec buffer size along this axis.""" + ... + + def indices_to_chunks(self, indices: npt.NDArray[np.intp]) -> npt.NDArray[np.intp]: + """Vectorized `index_to_chunk`: map global source indices to chunk indices. + + Implementers must raise `IndexError` if any index lies outside `[0, extent)`. + """ + ... + + +def _bounded_indices(indices: npt.NDArray[np.intp], extent: int) -> npt.NDArray[np.intp]: + """Normalize a vector lookup and enforce the scalar grid bounds.""" + arr = np.asarray(indices, dtype=np.intp) + if arr.size > 0 and (int(arr.min()) < 0 or int(arr.max()) >= extent): + raise IndexError( + f"indices must lie in [0, {extent}); got [{int(arr.min())}, {int(arr.max())}]" + ) + return arr + + +@dataclass(frozen=True) +class FixedDimension: + """Uniform chunk size with a boundary chunk clipped to the axis extent. + + Examples + -------- + Chunks of size 3 on an axis of extent 10 give 4 chunks. The last chunk + still declares a codec buffer of 3 but holds only 1 valid element: + + >>> dim = FixedDimension(size=3, extent=10) + >>> dim.nchunks + 4 + >>> dim.index_to_chunk(7) + 2 + >>> dim.chunk_size(3), dim.data_size(3) + (3, 1) + """ + + size: int + """The declared chunk length along this axis; every chunk's codec buffer size.""" + + extent: int + """The axis length in global source coordinates.""" + + nchunks: int = field(init=False, repr=False) + """Derived: the number of chunks holding data within `extent`.""" + + ngridcells: int = field(init=False, repr=False) + """Derived: the number of declared grid cells; equals `nchunks` for a fixed dimension.""" + + def __post_init__(self) -> None: + if self.size < 0: + raise ValueError(f"FixedDimension size must be >= 0, got {self.size}") + if self.extent < 0: + raise ValueError(f"FixedDimension extent must be >= 0, got {self.extent}") + if self.size == 0 and self.extent > 0: + raise ValueError( + "FixedDimension size must be > 0 when extent is nonzero; " + f"got size {self.size} and extent {self.extent}" + ) + nchunks = 0 if self.size == 0 else (self.extent + self.size - 1) // self.size + object.__setattr__(self, "nchunks", nchunks) + object.__setattr__(self, "ngridcells", nchunks) + + def index_to_chunk(self, idx: int) -> int: + """Map a global source index to its chunk index (`idx // size`). + + Raises `IndexError` when `idx` lies outside `[0, extent)`. + """ + if idx < 0 or idx >= self.extent: + raise IndexError(f"index {idx} is out of bounds for extent {self.extent}") + return 0 if self.size == 0 else idx // self.size + + def chunk_offset(self, chunk_ix: int) -> int: + """The global source coordinate where chunk `chunk_ix` begins (`chunk_ix * size`). + + Not bounds-checked: chunk indices past the last chunk extrapolate linearly. + """ + return chunk_ix * self.size + + def chunk_size(self, chunk_ix: int) -> int: + """The declared chunk length, `size` for every chunk. + + The boundary chunk is not clipped here; use `data_size` for the valid data length. + """ + return self.size + + def data_size(self, chunk_ix: int) -> int: + """The number of valid data elements in chunk `chunk_ix`, clipped to `extent`. + + Interior chunks report `size`; the boundary chunk reports the remainder, and chunk + indices at or past `nchunks` report 0. + """ + if self.size == 0: + return 0 + return max(0, min(self.size, self.extent - chunk_ix * self.size)) + + def indices_to_chunks(self, indices: npt.NDArray[np.intp]) -> npt.NDArray[np.intp]: + """Vectorized `index_to_chunk` over an array of global source indices. + + Raises `IndexError` if any index lies outside `[0, extent)`. + """ + arr = _bounded_indices(indices, self.extent) + if self.size == 0: + return np.zeros_like(arr) + return arr // self.size + + def with_extent(self, new_extent: int) -> FixedDimension: + """Return a copy with the same chunk size and the axis extent set to `new_extent`.""" + return FixedDimension(size=self.size, extent=new_extent) + + def resize(self, new_extent: int) -> FixedDimension: + """Return a copy resized to `new_extent`; the fixed chunk size covers any new extent.""" + return FixedDimension(size=self.size, extent=new_extent) + + @property + def size_repr(self) -> str: + """The chunk size rendered as a scalar for `ChunkGrid.__repr__`.""" + return str(self.size) + + +@dataclass(frozen=True, init=False) +class VaryingDimension: + """Explicit chunk edge lengths, with trailing data clipped to ``extent``. + + Examples + -------- + Edges `(2, 3, 5)` clipped to extent 9: the last chunk declares 5 but + holds only 4 valid elements, and index 4 lands in the second chunk: + + >>> dim = VaryingDimension(edges=(2, 3, 5), extent=9) + >>> dim.nchunks + 3 + >>> dim.index_to_chunk(4) + 1 + >>> dim.chunk_offset(2) + 5 + >>> dim.chunk_size(2), dim.data_size(2) + (5, 4) + """ + + edges: tuple[int, ...] + """The declared per-chunk edge lengths, in order; codec buffer sizes, unclipped.""" + + cumulative: tuple[int, ...] + """Prefix sums of `edges`; derived, and what index lookups binary-search.""" + + extent: int + """The axis length in global source coordinates; at most the sum of `edges`.""" + nchunks: int = field(init=False, repr=False) + """Derived: the number of chunks holding data within `extent`.""" + + ngridcells: int = field(init=False, repr=False) + """Derived: the number of declared edges; exceeds `nchunks` when trailing cells are empty.""" + + def __init__(self, edges: Sequence[int], extent: int) -> None: + edges_tuple = tuple(edges) + if not edges_tuple: + raise ValueError("VaryingDimension edges must not be empty") + if any(edge <= 0 for edge in edges_tuple): + raise ValueError(f"All edge lengths must be > 0, got {edges_tuple}") + cumulative = tuple(itertools.accumulate(edges_tuple)) + if extent < 0: + raise ValueError(f"VaryingDimension extent must be >= 0, got {extent}") + if extent > cumulative[-1]: + raise ValueError( + f"VaryingDimension extent {extent} exceeds sum of edges {cumulative[-1]}" + ) + object.__setattr__(self, "edges", edges_tuple) + object.__setattr__(self, "cumulative", cumulative) + object.__setattr__(self, "extent", extent) + nchunks = 0 if extent == 0 else bisect.bisect_left(cumulative, extent) + 1 + object.__setattr__(self, "nchunks", nchunks) + object.__setattr__(self, "ngridcells", len(edges_tuple)) + + def index_to_chunk(self, idx: int) -> int: + """Map a global source index to the chunk whose edge interval contains it. + + Raises `IndexError` when `idx` lies outside `[0, extent)`. + """ + if idx < 0 or idx >= self.extent: + raise IndexError(f"index {idx} is out of bounds for extent {self.extent}") + return bisect.bisect_right(self.cumulative, idx) + + def chunk_offset(self, chunk_ix: int) -> int: + """The global source coordinate where chunk `chunk_ix` begins (sum of prior edges).""" + return self.cumulative[chunk_ix - 1] if chunk_ix > 0 else 0 + + def chunk_size(self, chunk_ix: int) -> int: + """The declared edge length of chunk `chunk_ix`. + + Trailing chunks are not clipped to `extent` here; use `data_size` for that. + """ + return self.edges[chunk_ix] + + def data_size(self, chunk_ix: int) -> int: + """The number of valid data elements in chunk `chunk_ix`, clipped to `extent`. + + Grid cells that lie entirely at or past `extent` report 0. + """ + offset = self.chunk_offset(chunk_ix) + return max(0, min(self.edges[chunk_ix], self.extent - offset)) + + def indices_to_chunks(self, indices: npt.NDArray[np.intp]) -> npt.NDArray[np.intp]: + """Vectorized `index_to_chunk` over an array of global source indices. + + Raises `IndexError` if any index lies outside `[0, extent)`. + """ + arr = _bounded_indices(indices, self.extent) + return np.searchsorted(self.cumulative, arr, side="right") + + def with_extent(self, new_extent: int) -> VaryingDimension: + """Return a copy with the same edges re-clipped to `new_extent`. + + The existing edges must already cover the new extent; raises `ValueError` when + `new_extent` exceeds the sum of edges. Use `resize` to grow past the edges. + """ + if self.cumulative[-1] < new_extent: + raise ValueError( + f"VaryingDimension edge sum {self.cumulative[-1]} is less than new extent " + f"{new_extent}" + ) + return VaryingDimension(self.edges, extent=new_extent) + + def resize(self, new_extent: int) -> VaryingDimension: + """Return a copy resized to `new_extent`. + + Shrinking (or growing within the existing edges) keeps the edges and re-clips them; + growing past the sum of edges appends one new trailing edge covering the remainder. + """ + if new_extent == self.extent: + return self + if new_extent > self.cumulative[-1]: + return VaryingDimension((*self.edges, new_extent - self.cumulative[-1]), new_extent) + return VaryingDimension(self.edges, extent=new_extent) + + @property + def size_repr(self) -> str: + """The edge lengths rendered as a tuple for `ChunkGrid.__repr__`.""" + return repr(self.edges) + + +@runtime_checkable +class DimensionGrid(Protocol): + """Structural interface shared by the compact dimension grids. + + Examples + -------- + `FixedDimension` satisfies the protocol structurally: + + >>> dim = FixedDimension(size=2, extent=5) + >>> isinstance(dim, DimensionGrid) + True + >>> dim.nchunks, dim.extent + (3, 5) + >>> dim.with_extent(4).nchunks + 2 + """ + + @property + def nchunks(self) -> int: + """The number of chunks holding data within `extent`.""" + ... + + @property + def ngridcells(self) -> int: + """The number of declared grid cells; may exceed `nchunks` when trailing cells are empty.""" + ... + + @property + def extent(self) -> int: + """The axis length in global source coordinates.""" + ... + + def index_to_chunk(self, idx: int) -> int: + """Map a global source index to the chunk index that contains it. + + Implementers must raise `IndexError` when `idx` lies outside `[0, extent)`. + """ + ... + + def chunk_offset(self, chunk_ix: int) -> int: + """The global source coordinate at which chunk `chunk_ix` begins.""" + ... + + def chunk_size(self, chunk_ix: int) -> int: + """The declared (codec buffer) length of chunk `chunk_ix`, never clipped to `extent`.""" + ... + + def data_size(self, chunk_ix: int) -> int: + """The valid data length of chunk `chunk_ix`, clipped to `extent` at the boundary.""" + ... + + def indices_to_chunks(self, indices: npt.NDArray[np.intp]) -> npt.NDArray[np.intp]: + """Vectorized `index_to_chunk`; must raise `IndexError` for indices outside `[0, extent)`.""" + ... + + def with_extent(self, new_extent: int) -> DimensionGrid: + """Return a grid with the existing chunk layout re-clipped to `new_extent`. + + Implementers must not invent new grid cells: raise `ValueError` when the declared + layout cannot cover `new_extent`. + """ + ... + + def resize(self, new_extent: int) -> DimensionGrid: + """Return a grid covering `new_extent`, extending the chunk layout when it must grow.""" + ... + + @property + def size_repr(self) -> str: + """A compact rendering of the chunk sizes, used by `ChunkGrid.__repr__`.""" + ... + + +@dataclass(frozen=True) +class ChunkSpec: + """A chunk's valid data region and its full codec buffer shape. + + Examples + -------- + The last chunk of a size-10 axis chunked by 3 holds one valid element + (`slices`), while its codec buffer still spans 3: + + >>> spec = ChunkGrid.from_sizes((10,), (3,))[3] + >>> spec.slices + (slice(9, 10, 1),) + >>> spec.shape, spec.codec_shape + ((1,), (3,)) + >>> spec.is_boundary + True + """ + + slices: tuple[slice, ...] + """Per-dimension bounds of the valid data region, in global source coordinates.""" + + codec_shape: tuple[int, ...] + """The declared (codec buffer) chunk shape, unclipped by the array extent.""" + + @property + def shape(self) -> tuple[int, ...]: + """The shape of the valid data region described by `slices`. + + Smaller than `codec_shape` on boundary chunks, where the array extent clips the chunk. + """ + return tuple(chunk_slice.stop - chunk_slice.start for chunk_slice in self.slices) + + @property + def is_boundary(self) -> bool: + """Whether the valid data region is smaller than the full codec buffer on any axis.""" + return self.shape != self.codec_shape + + +@dataclass(frozen=True) +class ChunkGrid: + """A concrete regular or rectilinear arrangement of chunks for one array. + + Examples + -------- + A `(3, 4)` array with `(2, 2)` chunks has a `(2, 2)` grid whose bottom + row of chunks is clipped to one valid row of data: + + >>> grid = ChunkGrid.from_sizes((3, 4), (2, 2)) + >>> grid.grid_shape + (2, 2) + >>> grid.chunk_sizes + ((2, 1), (2, 2)) + >>> spec = grid[1, 0] + >>> spec.shape, spec.codec_shape, spec.is_boundary + ((1, 2), (2, 2), True) + """ + + dimensions: tuple[DimensionGrid, ...] + """One per-axis grid, each mapping that axis's source indices to chunks.""" + + _is_regular: bool = field(init=False, repr=False) + + def __post_init__(self) -> None: + object.__setattr__( + self, + "_is_regular", + all(isinstance(dimension, FixedDimension) for dimension in self.dimensions), + ) + + def __repr__(self) -> str: + sizes = ", ".join(dimension.size_repr for dimension in self.dimensions) + shape = tuple(dimension.extent for dimension in self.dimensions) + return f"ChunkGrid(chunk_sizes=({sizes}), array_shape={shape})" + + @classmethod + def from_sizes( + cls, array_shape: Sequence[int], chunk_sizes: Sequence[int | Sequence[int]] + ) -> ChunkGrid: + """Build a grid from an array shape and one chunk-size spec per dimension. + + An `int` entry gives a fixed chunk size along that axis; a sequence of ints gives + explicit per-chunk edge lengths. A uniform sequence consistent with the axis extent + collapses to a fixed dimension, so the result may report `is_regular`. + + Parameters + ---------- + array_shape : Sequence[int] + The array extent along each dimension, in global source coordinates. + chunk_sizes : Sequence[int | Sequence[int]] + Per-dimension chunk layout: a single size or explicit edge lengths. + """ + extents = _shape_tuple(array_shape) + if len(extents) != len(chunk_sizes): + raise ValueError( + f"array_shape has {len(extents)} dimensions but chunk_sizes has " + f"{len(chunk_sizes)} dimensions" + ) + dimensions: list[DimensionGrid] = [] + for dimension_spec, extent in zip(chunk_sizes, extents, strict=True): + if isinstance(dimension_spec, int): + dimensions.append(FixedDimension(size=dimension_spec, extent=extent)) + else: + edges = tuple(dimension_spec) + if not edges: + raise ValueError("Each dimension must have at least one chunk") + if ( + edges[0] > 0 + and all(edge == edges[0] for edge in edges) + and (extent == sum(edges) or len(edges) == (extent + edges[0] - 1) // edges[0]) + ): + dimensions.append(FixedDimension(size=edges[0], extent=extent)) + else: + dimensions.append(VaryingDimension(edges, extent=extent)) + return cls(dimensions=tuple(dimensions)) + + @property + def ndim(self) -> int: + """The number of dimensions.""" + return len(self.dimensions) + + @property + def is_regular(self) -> bool: + """Whether every dimension uses a single fixed chunk size. + + False when any axis carries explicit (rectilinear) per-chunk edge lengths. + """ + return self._is_regular + + @property + def grid_shape(self) -> tuple[int, ...]: + """The number of data-bearing chunks along each dimension.""" + return tuple(dimension.nchunks for dimension in self.dimensions) + + @property + def chunk_shape(self) -> tuple[int, ...]: + """The uniform declared chunk shape of a regular grid. + + Raises `ValueError` for rectilinear grids, which have no single chunk shape; + use `grid[coords]` for per-chunk sizes instead. + """ + if not self.is_regular: + raise ValueError( + "chunk_shape is only available for regular chunk grids. " + "Use grid[coords] for per-chunk sizes." + ) + return tuple( + dimension.size for dimension in self.dimensions if isinstance(dimension, FixedDimension) + ) + + @property + def chunk_sizes(self) -> tuple[tuple[int, ...], ...]: + """Per-dimension tuples of each chunk's valid data length. + + Boundary chunks report their clipped extent, not the declared codec size. + """ + return tuple( + tuple(dimension.data_size(index) for index in range(dimension.nchunks)) + for dimension in self.dimensions + ) + + def __getitem__(self, coords: int | tuple[int, ...]) -> ChunkSpec | None: + """Look up the `ChunkSpec` at the given chunk coordinates (grid cells, not indices). + + Returns `None` when any coordinate falls outside the grid; raises `ValueError` + when the number of coordinates does not match `ndim`. The spec's slices are in + global source coordinates. + """ + if isinstance(coords, int): + coords = (coords,) + if len(coords) != self.ndim: + raise ValueError( + f"Expected {self.ndim} coordinate(s) for a {self.ndim}-d chunk grid, " + f"got {len(coords)}." + ) + slices: list[slice] = [] + codec_shape: list[int] = [] + for dimension, index in zip(self.dimensions, coords, strict=True): + if index < 0 or index >= dimension.nchunks: + return None + offset = dimension.chunk_offset(index) + slices.append(slice(offset, offset + dimension.data_size(index), 1)) + codec_shape.append(dimension.chunk_size(index)) + return ChunkSpec(tuple(slices), tuple(codec_shape)) + + def __iter__(self) -> Iterator[ChunkSpec]: + """Yield a `ChunkSpec` for every data-bearing chunk in row-major (C) order.""" + for coords in itertools.product( + *(range(dimension.nchunks) for dimension in self.dimensions) + ): + spec = self[coords] + if spec is not None: + yield spec + + def all_chunk_coords( + self, + *, + origin: Sequence[int] | None = None, + selection_shape: Sequence[int] | None = None, + ) -> Iterator[tuple[int, ...]]: + """Iterate chunk coordinates over a rectangular grid region in row-major (C) order. + + `origin` defaults to the grid origin and `selection_shape` to the rest of the grid. + The region is not bounds-checked: an oversized region yields coordinates outside + the grid, which `__getitem__` resolves to `None`. + """ + origin_parsed = (0,) * self.ndim if origin is None else tuple(origin) + selection_shape_parsed = ( + tuple( + grid_size - coordinate + for coordinate, grid_size in zip(origin_parsed, self.grid_shape, strict=True) + ) + if selection_shape is None + else tuple(selection_shape) + ) + return itertools.product( + *( + range(coordinate, coordinate + size) + for coordinate, size in zip(origin_parsed, selection_shape_parsed, strict=True) + ) + ) + + def iter_chunk_regions( + self, + *, + origin: Sequence[int] | None = None, + selection_shape: Sequence[int] | None = None, + ) -> Iterator[tuple[slice, ...]]: + """Yield each chunk's valid-data slices, in global source coordinates. + + Covers the same region as `all_chunk_coords`, silently skipping coordinates + that fall outside the grid. + """ + for coords in self.all_chunk_coords(origin=origin, selection_shape=selection_shape): + spec = self[coords] + if spec is not None: + yield spec.slices + + def get_nchunks(self) -> int: + """The total number of data-bearing chunks: the product of `grid_shape` (1 if 0-d).""" + return reduce(operator.mul, (dimension.nchunks for dimension in self.dimensions), 1) + + def update_shape(self, new_shape: tuple[int, ...]) -> ChunkGrid: + """Return a grid resized to `new_shape` by resizing each dimension. + + Fixed axes keep their chunk size; rectilinear axes gain one trailing edge when + grown past their declared edges. Raises `ValueError` when `new_shape` does not + have `ndim` entries. + """ + if len(new_shape) != self.ndim: + raise ValueError( + f"new_shape has {len(new_shape)} dimensions but chunk grid has {self.ndim} dimensions" + ) + return ChunkGrid( + dimensions=tuple( + dimension.resize(new_extent) + for dimension, new_extent in zip(self.dimensions, new_shape, strict=True) + ) + ) + + +class EdgeDimensionGrid: + """An explicitly edge-based grid for coordinate-origin examples and planners. + + Examples + -------- + Chunk sizes `(2, 3)` tile source coordinates `[0, 5)`; lookups outside + that range raise: + + >>> grid = EdgeDimensionGrid([2, 3]) + >>> grid.num_chunks, grid.extent + (2, 5) + >>> grid.index_to_chunk(2) + 1 + >>> grid.index_to_chunk(5) + Traceback (most recent call last): + ... + IndexError: index 5 is out of bounds for an axis of extent 5 + """ + + __slots__ = ("_offsets", "sizes") + + sizes: tuple[int, ...] + """The length of each chunk along the axis, in order; every entry is positive.""" + + def __init__(self, sizes: Sequence[int]) -> None: + """Build a one-axis grid from explicit per-chunk sizes. + + Every size must be positive; raises `ValueError` otherwise. A zero-length axis + is spelled as an empty sequence (no chunks), not as a zero size. + + Parameters + ---------- + sizes : Sequence[int] + The length of each chunk along the axis, in order. + """ + normalized = tuple(int(size) for size in sizes) + for index, size in enumerate(normalized): + if size <= 0: + raise ValueError( + f"chunk sizes must be positive; got {size} at position {index} of {normalized}. " + "A zero-length axis is spelled as no chunks at all: EdgeDimensionGrid(())" + ) + self.sizes = normalized + offsets: np.ndarray[Any, np.dtype[np.intp]] = np.zeros(len(normalized) + 1, dtype=np.intp) + if normalized: + np.cumsum(np.asarray(normalized, dtype=np.intp), out=offsets[1:]) + self._offsets = offsets + + @property + def num_chunks(self) -> int: + """The number of chunks along the axis.""" + return len(self.sizes) + + @property + def extent(self) -> int: + """The axis length in global source coordinates: the sum of all chunk sizes.""" + return int(self._offsets[-1]) + + def __repr__(self) -> str: + return f"EdgeDimensionGrid(sizes={self.sizes})" + + def __eq__(self, other: object) -> bool: + if not isinstance(other, EdgeDimensionGrid): + return NotImplemented + return self.sizes == other.sizes + + def __hash__(self) -> int: + return hash((type(self).__name__, self.sizes)) + + def index_to_chunk(self, idx: int) -> int: + """Map a global source index to the chunk whose interval contains it. + + Raises `IndexError` when `idx` lies outside `[0, extent)`. + """ + if idx < 0 or idx >= self.extent: + raise IndexError(f"index {idx} is out of bounds for an axis of extent {self.extent}") + return int(np.searchsorted(self._offsets, idx, side="right")) - 1 + + def chunk_offset(self, chunk_ix: int) -> int: + """The global source coordinate where chunk `chunk_ix` begins. + + Raises `IndexError` when `chunk_ix` lies outside `[0, num_chunks)`. + """ + if chunk_ix < 0 or chunk_ix >= len(self.sizes): + raise IndexError( + f"chunk index {chunk_ix} is out of bounds for {len(self.sizes)} chunks" + ) + return int(self._offsets[chunk_ix]) + + def chunk_size(self, chunk_ix: int) -> int: + """The length of chunk `chunk_ix`; every chunk holds data, so no boundary clipping applies. + + Raises `IndexError` when `chunk_ix` lies outside `[0, num_chunks)`. + """ + if chunk_ix < 0 or chunk_ix >= len(self.sizes): + raise IndexError( + f"chunk index {chunk_ix} is out of bounds for {len(self.sizes)} chunks" + ) + return self.sizes[chunk_ix] + + def indices_to_chunks(self, indices: npt.NDArray[np.intp]) -> npt.NDArray[np.intp]: + """Vectorized `index_to_chunk` over an array of global source indices. + + Raises `IndexError` if any index lies outside `[0, extent)`. + """ + arr = _bounded_indices(indices, self.extent) + return (np.searchsorted(self._offsets, arr, side="right") - 1).astype(np.intp) + + +def _shape_tuple(shape: Sequence[int]) -> tuple[int, ...]: + result = tuple(int(size) for size in shape) + if any(size < 0 for size in result): + raise ValueError(f"shape entries must be non-negative; got {result}") + return result + + +def _entry_kind(entry: Any) -> str: + if isinstance(entry, (int, np.integer)) and not isinstance(entry, bool): + return "int" + if isinstance(entry, (str, bytes)): + return "neither" + try: + iter(cast("Iterable[Any]", entry)) + except TypeError: + return "neither" + return "sequence" + + +def dimension_grids_from_chunks( + chunks: Sequence[int] | Sequence[Sequence[int]], shape: Sequence[int] +) -> tuple[DimensionGrid, ...]: + """Build compact dimensions from regular sizes or explicit per-axis edges. + + Examples + -------- + One integer per dimension builds fixed grids, ready for `plan_chunks`: + + >>> from zarr_indexing import IndexTransform, plan_chunks + >>> grids = dimension_grids_from_chunks((2, 2), shape=(3, 4)) + >>> [type(grid).__name__ for grid in grids] + ['FixedDimension', 'FixedDimension'] + >>> plan = plan_chunks(IndexTransform.from_shape((3, 4))[1, :], grids) + >>> [p.chunk_coords for p in plan] + [(0, 0), (0, 1)] + """ + shape_t = _shape_tuple(shape) + entries: tuple[Any, ...] = tuple(chunks) + if len(entries) != len(shape_t): + raise ValueError( + f"chunks must have one entry per dimension; got {len(entries)} entries for shape {shape_t}" + ) + + conventions = ( + "chunks must be either a uniform chunk shape (one integer per dimension) " + "or per-axis chunk sizes (one sequence of integers per dimension)" + ) + kinds = [_entry_kind(entry) for entry in entries] + neither = [(axis, entries[axis]) for axis, kind in enumerate(kinds) if kind == "neither"] + if neither: + described = ", ".join(f"{entry!r} at dimension {axis}" for axis, entry in neither) + verb = "is" if len(neither) == 1 else "are" + raise ValueError(f"{conventions}; {described} {verb} neither") + + integer_count = sum(kind == "int" for kind in kinds) + if entries and integer_count == len(entries): + dimensions: list[DimensionGrid] = [] + for entry, extent in zip(entries, shape_t, strict=True): + size = int(entry) + if size <= 0: + raise ValueError(f"chunk shape entries must be positive; got {size}") + dimensions.append(FixedDimension(size=size, extent=extent)) + return tuple(dimensions) + if integer_count: + raise ValueError(f"{conventions}, not a mixture; got {entries!r}") - def index_to_chunk(self, idx: int) -> int: ... - def chunk_offset(self, chunk_ix: int) -> int: ... - def chunk_size(self, chunk_ix: int) -> int: ... - def indices_to_chunks(self, indices: npt.NDArray[np.intp]) -> npt.NDArray[np.intp]: ... + dimensions = [] + for axis, (entry, extent) in enumerate(zip(entries, shape_t, strict=True)): + elements: tuple[Any, ...] = tuple(cast("Iterable[Any]", entry)) + if any( + not isinstance(element, (int, np.integer)) or isinstance(element, bool) + for element in elements + ): + raise ValueError( + f"per-axis chunk sizes must be integers; dimension {axis} has {entry!r}" + ) + edges = tuple(int(element) for element in elements) + total = sum(edges) + if total != extent: + raise ValueError( + f"per-axis chunk sizes for dimension {axis} sum to {total}, but the array extent is {extent}" + ) + if extent == 0 and all(edge == 0 for edge in edges): + dimensions.append(FixedDimension(size=0, extent=0)) + continue + if any(edge <= 0 for edge in edges): + raise ValueError(f"chunk sizes must be positive; got {edges}") + dimensions.append(VaryingDimension(edges=edges, extent=extent)) + return tuple(dimensions) diff --git a/packages/zarr-indexing/src/zarr_indexing/json.py b/packages/zarr-indexing/src/zarr_indexing/json.py index c95696f309..8bf42c74a5 100644 --- a/packages/zarr-indexing/src/zarr_indexing/json.py +++ b/packages/zarr-indexing/src/zarr_indexing/json.py @@ -1,70 +1,61 @@ -"""Lowering between canonical ndsel bodies and in-memory `IndexTransform`s. +"""The canonical ndsel wire vocabulary, and the rules for lowering it. This is the **engine layer**. Where `messages.py` is pure JSON→JSON and imposes -no array constraints, this module converts a *canonical* ndsel transform body -(spec section 4.3, as produced by `zarr_indexing.messages.normalize_ndsel`) -into the numpy-backed `IndexTransform` the chunk engine runs on, and back. +no array constraints, this module holds the JSON shapes a canonical ndsel body +takes (spec section 4.3, as produced by `zarr_indexing.messages.normalize_ndsel`) +together with the lowering rules that turn one into the numpy-backed engine +representation. -Two engine constraints live **here and only here**: +The conversions themselves are **methods on the types**, since each type owns +its one serialization: `IndexTransform.to_json` / `from_json`, +`IndexDomain.to_json` / `from_json`, and `to_json` on each output map kind, +with `output_index_map_from_json` in `zarr_indexing.output_map` dispatching the +wire's tagged union back to the right kind. This module is what they share. + +Three engine constraints live **here and only here**: - **Finite bounds.** An `IndexDomain` addresses a finite array, so a canonical body carrying a `"-inf"`/`"+inf"` bound cannot be lowered; `from_json` raises. - **Implicit bounds lower by value.** The `[n]`-bracket implicit/explicit flag is a message-layer concern; the engine keeps only the integer value. +- **Integer `index_array` content.** The message layer carries `index_array` + verbatim (the spec defers its shape and type), so lowering is where a float, + boolean or string array is rejected — as an `NdselError`, rather than + truncating `[0.9, 1.9]` to cells 0 and 1 or leaking a raw NumPy error. ## The `index_array` wire format (and the degenerate-collapse it documents) ndsel and TensorStore both **reject** an output map that carries *both* -`input_dimension` and `index_array`. The in-memory `ArrayMap`, however, records -an `input_dimension` to pin the axis an orthogonal (`oindex`) array varies over. -This module bridges the gap: - -- **On serialize** (`transform_to_canonical`): - 1. An all-singleton `index_array` (size 1) selects a single coordinate - regardless of input, so it is **collapsed to a `constant` map** - `{offset: offset + stride*value}`. The size-1 input dimension stays in the - domain, unconsumed — a valid transform. This makes a length-1 `oindex` - selection round-trip *behaviorally* (an `ArrayMap` becomes a `ConstantMap`) - rather than by object identity. - 2. Non-degenerate `index_array` maps are emitted **without** `input_dimension`. - -- **On load** (`transform_from_canonical`): the in-memory `input_dimension` is - reconstructed from the full-rank array's dependency axes (its non-singleton - axes, see `transform._array_map_dependency_axes`). An array that solely owns a - single non-singleton axis is orthogonal (`input_dimension = that axis`); arrays - that share non-singleton axes, or vary over several, are correlated (`vindex`, - `input_dimension = None`). A single 1-D array over a rank-1 domain is - inherently ambiguous between the two flavours; it reconstructs as orthogonal, - which is behaviorally identical for the single-array case. - -`index_transform_to_json` / `index_transform_from_json` (and the `*_domain_*` -variants) are these canonical converters under their historical names. +`input_dimension` and `index_array`; `input_dimension` belongs to affine +(`single_input_dimension`) maps. The in-memory `ArrayMap` matches: what a map +depends on is read from its full-rank array's shape (its non-singleton axes), +so there is nothing to reconstruct on load. On serialize (`to_json`): + +1. An all-singleton `index_array` (size 1) selects a single coordinate + regardless of input, so it is **collapsed to a `constant` map** + `{offset: offset + stride*value}`. The size-1 input dimension stays in the + domain, unconsumed — a valid transform. The selection layer already builds + such maps as `ConstantMap` (`output_map.array_map_or_constant`); this covers + hand-built transforms. +2. An **empty** `index_array` (size 0) collapses the same way, to + `{offset: 0}`. It names no cell, and it can only be empty because an input + dimension is — the full-rank invariant makes every axis either 1 or the + domain's extent — so nothing is ever read through it and the emptiness is + carried by the domain, which is emitted separately. TensorStore does the + same: `t[ts.d[0][[]]]` is `out[0] = 0`, emitted as `{}`. Emitting the array + instead would produce a document neither implementation could load, because + `ndarray.tolist()` renders every empty array as `[]` once the leading axis + is the zero-length one, and nested lists cannot spell the shape back — + `[[]]` is `(1, 0)` and nothing spells `(0, 1)`. +3. Non-degenerate `index_array` maps are emitted with their array and bounds + only. + """ from __future__ import annotations -from collections import Counter from typing import Any, Required, TypedDict -import numpy as np - -from zarr_indexing.domain import IndexDomain -from zarr_indexing.messages import normalize_ndsel -from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap, OutputIndexMap -from zarr_indexing.transform import ( - IndexTransform, - _array_map_dependency_axes, # pyright: ignore[reportPrivateUsage] -) - -# `_array_map_dependency_axes` is a leading-underscore helper in `transform.py`, -# but it is deliberately shared with this module (the engine-level JSON <-> -# `IndexTransform` lowering below needs the same dependency-axis logic that -# `transform.py`'s own array-reindexing helpers use). It is not part of the -# package's public API; pyright's `reportPrivateUsage` flags the cross-module -# import anyway. See `chunk_resolution.py`'s `_dimensions` suppression for the -# analogous rationale — whether to promote either symbol out of "private" is -# an open pre-publish API decision, not resolved here. - # --------------------------------------------------------------------------- # TypedDict definitions (canonical JSON shapes) # --------------------------------------------------------------------------- @@ -81,11 +72,28 @@ class IndexDomainJSON(TypedDict, total=False): - """Canonical JSON representation of an IndexDomain.""" + """Canonical JSON representation of an IndexDomain. + + Examples + -------- + >>> doc: IndexDomainJSON = { + ... "input_inclusive_min": [0], + ... "input_exclusive_max": [4], + ... "input_labels": ["x"], + ... } + >>> from zarr_indexing import IndexDomain + >>> IndexDomain.from_json(doc).shape + (4,) + """ input_inclusive_min: Required[list[BoundJSON]] + """Per-dimension lower bounds; `"-inf"` is legal on the wire but cannot be lowered.""" + input_exclusive_max: Required[list[BoundJSON]] + """Per-dimension exclusive upper bounds; `"+inf"` is legal on the wire but cannot be lowered.""" + input_labels: Required[list[str]] + """Per-dimension names; the empty string marks an unlabeled dimension.""" class OutputIndexMapJSON(TypedDict, total=False): @@ -97,229 +105,62 @@ class OutputIndexMapJSON(TypedDict, total=False): - `{"offset": 0, "stride": 1, "input_dimension": 0}` — single_input_dimension - `{"offset": 0, "stride": 1, "index_array": [...], "index_array_bounds": ["-inf", "+inf"]}` — index_array + + Examples + -------- + >>> from zarr_indexing import output_index_map_from_json + >>> constant: OutputIndexMapJSON = {"offset": 5} + >>> output_index_map_from_json(constant) + ConstantMap(offset=5) + >>> affine: OutputIndexMapJSON = {"offset": 0, "stride": 2, "input_dimension": 1} + >>> output_index_map_from_json(affine) + DimensionMap(input_dimension=1, offset=0, stride=2) """ offset: int + """Constant term; alone it is the whole constant form.""" + stride: int + """Multiplier applied to the input coordinate or to each `index_array` value.""" + input_dimension: int + """The input dimension the single_input_dimension form reads.""" + index_array: NestedIntList + """Nested lists of output coordinates, one nesting level per input dimension.""" + index_array_bounds: list[IndexValueJSON] + """Bounds the `index_array` values are promised to lie in; `["-inf", "+inf"]` if unconstrained.""" class IndexTransformJSON(TypedDict, total=False): - """Canonical JSON representation of an IndexTransform (spec section 4.3).""" - - input_rank: Required[int] - input_inclusive_min: Required[list[BoundJSON]] - input_exclusive_max: Required[list[BoundJSON]] - input_labels: Required[list[str]] - output: Required[list[OutputIndexMapJSON]] - - -# --------------------------------------------------------------------------- -# Bound / label lowering (engine constraints) -# --------------------------------------------------------------------------- - - -def _lower_bound(bound: BoundJSON, where: str) -> int: - """Lower a canonical bound to a finite integer, rejecting infinities.""" - value = bound[0] if isinstance(bound, list) else bound - if value == "-inf" or value == "+inf": - raise ValueError( - f"{where} is infinite ({value!r}); an IndexDomain addresses a finite " - f"array and cannot lower an infinite bound" - ) - return int(value) - - -def _lower_labels(labels: list[str]) -> tuple[str, ...] | None: - """All-empty labels collapse to `None` so a label-free domain round-trips.""" - return None if all(label == "" for label in labels) else tuple(labels) - - -def _emit_labels(labels: tuple[str, ...] | None, rank: int) -> list[str]: - """Emit canonical labels: `[""]*rank` when the domain is unlabeled.""" - return [""] * rank if labels is None else list(labels) - - -# --------------------------------------------------------------------------- -# IndexDomain serialization -# --------------------------------------------------------------------------- - - -def index_domain_to_json(domain: IndexDomain) -> IndexDomainJSON: - """Convert an IndexDomain to its canonical JSON representation.""" - return { - "input_inclusive_min": list(domain.inclusive_min), - "input_exclusive_max": list(domain.exclusive_max), - "input_labels": _emit_labels(domain.labels, domain.ndim), - } - - -def index_domain_from_json(data: IndexDomainJSON) -> IndexDomain: - """Construct an IndexDomain from its canonical JSON representation.""" - inclusive_min = tuple( - _lower_bound(b, f"input_inclusive_min[{i}]") - for i, b in enumerate(data["input_inclusive_min"]) - ) - exclusive_max = tuple( - _lower_bound(b, f"input_exclusive_max[{i}]") - for i, b in enumerate(data["input_exclusive_max"]) - ) - labels = _lower_labels(list(data["input_labels"])) - return IndexDomain(inclusive_min=inclusive_min, exclusive_max=exclusive_max, labels=labels) - - -# --------------------------------------------------------------------------- -# OutputIndexMap serialization -# --------------------------------------------------------------------------- - - -def output_index_map_to_json(m: OutputIndexMap) -> OutputIndexMapJSON: - """Convert an output index map to its canonical JSON representation. - - A degenerate all-singleton `ArrayMap` collapses to a `constant` map; a - non-degenerate one is emitted without `input_dimension` (see the module - docstring on the wire format). + """Canonical JSON representation of an IndexTransform (spec section 4.3). + + Examples + -------- + >>> doc: IndexTransformJSON = { + ... "input_rank": 1, + ... "input_inclusive_min": [0], + ... "input_exclusive_max": [2], + ... "input_labels": [""], + ... "output": [{"offset": 1, "stride": 2, "input_dimension": 0}], + ... } + >>> from zarr_indexing import IndexTransform + >>> IndexTransform.from_json(doc).domain.shape + (2,) """ - if isinstance(m, ConstantMap): - return {"offset": m.offset} - - if isinstance(m, DimensionMap): - return {"offset": m.offset, "stride": m.stride, "input_dimension": m.input_dimension} - - # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) - if m.index_array.size == 1: - value = int(m.index_array.reshape(-1)[0]) - return {"offset": m.offset + m.stride * value} - return { - "offset": m.offset, - "stride": m.stride, - "index_array": m.index_array.tolist(), - "index_array_bounds": ["-inf", "+inf"], - } - - -def output_index_map_from_json(data: OutputIndexMapJSON) -> OutputIndexMap: - """Construct an output index map from its canonical JSON representation. - - An `index_array` map's `input_dimension` is reconstructed from the array's - dependency axes in isolation (single non-singleton axis → orthogonal). The - transform-level loader classifies globally; use it when several maps may - share axes. - """ - if "index_array" in data: - arr = np.asarray(data["index_array"], dtype=np.intp) - return ArrayMap( - index_array=arr, - offset=data.get("offset", 0), - stride=data.get("stride", 1), - input_dimension=_solo_dependency_axis(arr), - ) - - if "input_dimension" in data: - return DimensionMap( - input_dimension=data["input_dimension"], - offset=data.get("offset", 0), - stride=data.get("stride", 1), - ) - - return ConstantMap(offset=data.get("offset", 0)) - - -def _solo_dependency_axis(arr: np.ndarray[Any, Any]) -> int | None: - """The single axis a lone `index_array` varies over, or `None` if not exactly one.""" - dep = _array_map_dependency_axes(arr) - return dep[0] if len(dep) == 1 else None + input_rank: Required[int] + """The number of input dimensions; the bounds and labels lists match it in length.""" -# --------------------------------------------------------------------------- -# IndexTransform serialization -# --------------------------------------------------------------------------- + input_inclusive_min: Required[list[BoundJSON]] + """Per-dimension lower bounds; `"-inf"` is legal on the wire but cannot be lowered.""" + input_exclusive_max: Required[list[BoundJSON]] + """Per-dimension exclusive upper bounds; `"+inf"` is legal on the wire but cannot be lowered.""" -def transform_to_canonical(transform: IndexTransform) -> IndexTransformJSON: - """Convert an IndexTransform to its canonical ndsel transform body. + input_labels: Required[list[str]] + """Per-dimension names; the empty string marks an unlabeled dimension.""" - The result is fully explicit (spec section 4.3): `input_rank`, fully written - bounds and labels, and an explicit `output` with `offset`/`stride` present - on every affine and array map. - """ - return { - "input_rank": transform.domain.ndim, - "input_inclusive_min": list(transform.domain.inclusive_min), - "input_exclusive_max": list(transform.domain.exclusive_max), - "input_labels": _emit_labels(transform.domain.labels, transform.domain.ndim), - "output": [output_index_map_to_json(m) for m in transform.output], - } - - -def transform_from_canonical(data: IndexTransformJSON) -> IndexTransform: - """Construct an IndexTransform from a canonical (or canonicalizable) body. - - The body is first run through the message layer (`normalize_ndsel`) so that - omitted fields — identity `output`, default bounds/labels — are filled and - validated, then lowered to the engine representation. `index_array` maps' - `input_dimension` values are reconstructed by global dependency-axis - ownership (see the module docstring). - """ - body = normalize_ndsel({"kind": "transform", **data}) - - inclusive_min = tuple( - _lower_bound(b, f"input_inclusive_min[{i}]") - for i, b in enumerate(body["input_inclusive_min"]) - ) - exclusive_max = tuple( - _lower_bound(b, f"input_exclusive_max[{i}]") - for i, b in enumerate(body["input_exclusive_max"]) - ) - domain = IndexDomain( - inclusive_min=inclusive_min, - exclusive_max=exclusive_max, - labels=_lower_labels(body["input_labels"]), - ) - - output_raw: list[dict[str, Any]] = body["output"] - - # Classify index_array maps globally: an axis owned by exactly one array map - # (and the map's sole non-singleton axis) marks that map orthogonal; shared - # or multiple non-singleton axes mark the maps correlated (vindex). - array_axes: dict[int, tuple[int, ...]] = {} - axis_owners: Counter[int] = Counter() - for i, om in enumerate(output_raw): - if "index_array" in om: - arr = np.asarray(om["index_array"], dtype=np.intp) - dep = _array_map_dependency_axes(arr) - array_axes[i] = dep - axis_owners.update(dep) - - output: list[OutputIndexMap] = [] - for i, om in enumerate(output_raw): - if "index_array" in om: - dep = array_axes[i] - input_dim = dep[0] if len(dep) == 1 and axis_owners[dep[0]] == 1 else None - output.append( - ArrayMap( - index_array=np.asarray(om["index_array"], dtype=np.intp), - offset=om.get("offset", 0), - stride=om.get("stride", 1), - input_dimension=input_dim, - ) - ) - elif "input_dimension" in om: - output.append( - DimensionMap( - input_dimension=om["input_dimension"], - offset=om.get("offset", 0), - stride=om.get("stride", 1), - ) - ) - else: - output.append(ConstantMap(offset=om.get("offset", 0))) - - return IndexTransform(domain=domain, output=tuple(output)) - - -# Historical names, now pointing at the canonical converters. -index_transform_to_json = transform_to_canonical -index_transform_from_json = transform_from_canonical + output: Required[list[OutputIndexMapJSON]] + """One output map per output dimension.""" diff --git a/packages/zarr-indexing/src/zarr_indexing/lazy_array.py b/packages/zarr-indexing/src/zarr_indexing/lazy_array.py new file mode 100644 index 0000000000..950a97b25e --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/lazy_array.py @@ -0,0 +1,1365 @@ +"""`LazyArray` — TensorStore-style lazy indexing over array-like sources. + +`LazyArray` wraps a source with `shape`, `dtype`, and basic integer/slice +`__getitem__`, whose reads can be lowered through NumPy system memory. It adds +a `.lazy` accessor whose indexing operations build up an +[`IndexTransform`](transform.md) instead of reading data: + +```python +view = LazyArray(source).lazy[10:50, ::2].lazy.oindex[[3, 1, 1], :] +view.shape # known without touching the data +values = view.result() +``` + +Nothing is read until `result()` (or `__array__`, or an eager `__getitem__`). +Every `.lazy` operation is metadata-only. Composition does not accumulate +layers: a view of a view is still a single transform and retains its reader. + +Parts +----- +A `LazyArray` carries a **partitioning** of the array it wraps: a grid of boxes +that a read is broken into. `parts()` walks those boxes as they fall through the +view, yielding a [`Partition`](#zarr_indexing.lazy_array.Partition) per box. Its +paired projection describes the chunk-local read and where its cells land in the +request; `view` carries that partition's transform. `result()` allocates one +fresh output buffer, then reads each partition once through the selected reader +into the final buffer or an owned temporary for fancy placement. + +The part view's transform directly addresses its raw wrapped array. The paired +projection deliberately retains the chunk-local frame; both travel together in +the `ReadContext` passed to the reader. + +The partitioning is discovered from the wrapped array at construction — first +`read_chunk_sizes` (zarr's clipped per-axis sizes, sharding-aware), then +`chunks`, read as per-axis sizes if its entries are sequences and as a uniform +box shape if they are integers. Those attribute names belong to the wrapped +array; this API refers only to parts. An array that advertises neither gets a +single whole-array part, and resolving it reads the whole view through its +selected reader in one pass. + +`with_parts` replaces the partitioning without touching the data or the view: + +```python +view.with_parts((64, 64)) # uniform boxes, tail clipped +view.with_parts_per_axis(((3, 3, 1),)) # explicit per-axis sizes +view.unpartitioned() # one whole-array part; resolve in one shot +``` + +Repartitioning changes how the read is divided, not what `result()` returns. +Parts that do not align with the source's own boxes are permitted and can be +useful (to bound peak memory, or to batch small reads); they cost extra I/O but +do not affect correctness. + +Readers +------- +Every wrapper carries a reader that owns the backend-specific request. The +transform answers **which values?** and is independent of the backend; the +reader answers **how does this backend obtain them?** and must preserve the +complete transform exactly. Readers do not define indexing semantics, +partitioning, scheduling, or result ownership. The conservative +`LazyArray(source)` uses `basic_reader`, which needs only basic slicing. +`LazyArray.from_numpy(array)` explicitly opts into `numpy_reader` for direct +NumPy indexing. `with_reader()` replaces the reader without reading or changing +the view metadata. The reader object is shared by all derived views and their +parts. Consumers may materialize part views concurrently; `LazyArray` does not +serialize calls, so a stateful reader must synchronize its own mutable state. + +Both built-in readers lower through NumPy system memory. They do not implicitly +transfer device arrays. A device source requires an explicit custom reader that +performs any needed transfer into the supplied system-memory output buffer. + +Boxes and queries +----------------- +A selection is either **rectangular** — an interval and a stride per dimension, +which is what basic indexing composes to at any depth — or a **query**, an +explicit list of coordinates, which is what `oindex`, `vindex`, and masks +produce and which subsequent basic indexing cannot undo. `is_box` reports the +category and `bounding_box()` reports the storage region touched: the exact +interval per dimension for a box, a hull for a query. A box is only *dense* in +that interval when every entry of `strides()` is 1. The distinction is +structural rather than an optimization; [the design +notes](../design-notes.md) describe why it matters to consumers of a selection. + +The positional dialect +---------------------- +Selections on `LazyArray` are **positional, NumPy-style**: index 0 is the first +element of the current view, `-1` is the last, boolean masks must match the +view's shape, and every index is bounds-checked against the view. + +This differs deliberately from `zarr.Array.lazy[...]`, which exposes the +**literal** TensorStore dialect: a zarr view keeps the coordinate system of the +array it came from, so after `v = arr.lazy[10:50]` the first element of `v` is +`v[10]` and a negative index is out of bounds rather than counted from the end. +That dialect suits zarr, where a view's coordinates stay comparable with the +parent array's. `LazyArray` is a duck array and has to behave like the array it +wraps to be usable as a NumPy drop-in or as a dask source, so it re-zeroes its +coordinates on every view and uses positions. `zarr_indexing.boundary` performs +the translation between the two. + +Two more NumPy rules the dialect keeps, in every mode: + +- A scalar integer drops its axis. Any non-boolean object implementing Python's + `SupportsIndex` protocol is accepted as one, including in slice bounds and + steps; an `__int__` method alone is deliberately not enough. A scalar is a + basic index wherever it appears, applied before any advanced index rather + than broadcast against one. So + `lazy.oindex[0]` has the shape of `x[0]`, `lazy.oindex[0, [1, 2], :]` means + `x[0][numpy.ix_([1, 2], ...)]`, and `lazy.oindex[0, 1, 2]` and + `lazy.vindex[0, 1, 2]` are both zero-rank. Use a length-1 list to keep an + axis. +- Advanced indices are placed as NumPy places them. For a `vindex` selection + that leaves some axes unindexed, the gathered dimensions sit where the + coordinate arrays sat when those arrays are adjacent, and lead when a slice + separates them — so `lazy.vindex[..., i, j]` has shape + `(x.shape[0], *broadcast)`, matching `x[..., i, j]`. + +Materializing on fallback +------------------------- +`LazyArray` implements `__array__` but deliberately implements neither +`__array_ufunc__` nor `__array_function__`. A NumPy *function* given a view +therefore materializes the whole thing through +`__array__` and works on the resulting array: `numpy.sum(view)`, +`numpy.add(view, 1)` and `numpy.stack([view, view])` all do, and so does +`numpy.ones(view.shape) + view`, where the ndarray on the left dispatches. + +Python's arithmetic *operators* do not: `view + 1` raises `TypeError`, because +the wrapper defines no arithmetic dunders and an `int` has nothing to dispatch +to. Both facts follow from the same intent — laziness here applies to indexing, +not to building a deferred compute graph — and a `LazyArray` is not a drop-in +for arithmetic on a large array either way. Use `.lazy[...]` to narrow the view +first, or pass the wrapper to `dask.array.from_array` so that dask owns the +compute graph. + +Ownership +--------- +`result()` always allocates fresh system memory before reading through the +selected reader. A `numpy.ma` source keeps its mask by receiving a masked +output buffer; other source-specific array types do not survive materializing. +""" + +from __future__ import annotations + +import hashlib +import json +import math +import operator +import uuid +from collections.abc import Sequence +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, Any, Protocol, cast + +import numpy as np + +from zarr_indexing.boundary import ( + SelectionMode, + normalize_positional_selection, + split_scalar_axes, +) +from zarr_indexing.chunk_resolution import ( + ChunkProjection, + plan_chunks, +) +from zarr_indexing.grid import DimensionGrid, FixedDimension, dimension_grids_from_chunks +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap +from zarr_indexing.reader import ( + ReadContext, + Reader, + basic_reader, + numpy_reader, +) +from zarr_indexing.transform import ( + IndexTransform, +) + +if TYPE_CHECKING: + from collections.abc import Callable, Iterator + + SelectFn = Callable[[Any, SelectionMode], "LazyArray"] + +__all__ = ["LazyArray", "Partition"] + +# Above this many bytes, the no-dask token fallback describes an array +# structurally instead of digesting its contents. See `_wrapped_token`. +_TOKEN_DIGEST_LIMIT = 1 << 20 + + +def _invoke_reader( + reader: Reader, + source: Any, + context: ReadContext, + out: np.ndarray[Any, Any], +) -> None: + """Invoke a reader and enforce its in-place return contract.""" + returned = reader.read_into(source, context, out) + if returned is not None: + raise TypeError(f"reader.read_into must return None, got {type(returned).__name__}") + + +def _is_correlated(transform: IndexTransform) -> bool: + """True when the transform gathers a list of points rather than an outer product.""" + return transform.index_array_structure == "general" + + +class ArrayLike(Protocol): + """The surface `LazyArray` needs from the array it wraps.""" + + @property + def shape(self) -> tuple[int, ...]: ... + @property + def dtype(self) -> Any: ... + def __getitem__(self, key: Any) -> Any: ... + + +# NumPy's dtype-specialized ``__getitem__`` overloads do not structurally match +# the deliberately broad protocol above under strict type checking. Accept an +# ndarray explicitly so users do not have to erase its type with ``cast(Any, …)``. +_WrappedArray = ArrayLike | np.ndarray[Any, Any] + + +# --------------------------------------------------------------------------- # +# Partition discovery +# --------------------------------------------------------------------------- # + + +def _read_source_attribute(array: Any, name: str) -> Any: + """Read a partition-describing attribute, treating any failure as "absent". + + Discovery inspects an object we did not write. A missing attribute is the + common case, but zarr raises an `AttributeError` subclass from + `read_chunk_sizes` on a lazy view, and other backends compute the attribute + lazily and may fail for their own reasons. Any failure here means "this + array does not advertise a partitioning", never a hard error. + """ + try: + return getattr(array, name, None) + # Guarded properties (e.g. zarr's LazyViewError) and broken foreign + # attributes may raise anything; discovery must degrade to None. + except Exception: + return None + + +def _discover_parts(array: Any, shape: tuple[int, ...]) -> tuple[DimensionGrid, ...] | None: + """Resolve the partitioning advertised by `array`, or None for one whole part. + + Discovery parses external input: an attribute that does not describe a + partitioning of `shape` means "this object does not advertise one I + understand", and the array is treated as unpartitioned rather than rejected. + A partitioning is an I/O strategy, so reading the whole array is always a + correct fallback. `with_parts` is a public API and validates strictly. + """ + declared = _read_source_attribute(array, "read_chunk_sizes") + if declared is None: + declared = _read_source_attribute(array, "chunks") + if declared is None: + return None + try: + return dimension_grids_from_chunks(declared, shape) + except (ValueError, TypeError): + return None + + +def _whole_array_grids(shape: tuple[int, ...]) -> tuple[DimensionGrid, ...]: + """A partitioning with a single part covering the whole array.""" + return tuple(FixedDimension(size=extent, extent=extent) for extent in shape) + + +# --------------------------------------------------------------------------- # +# The lowering engine +# --------------------------------------------------------------------------- # + + +def _is_identity_transform(transform: IndexTransform, shape: tuple[int, ...]) -> bool: + """True when `transform` maps every coordinate of `shape` to itself. + + Structural rather than an `==` against `IndexTransform.from_shape`: an + `ArrayMap` holds an ndarray, so equality on two transforms that both carry + one would try to take the truth value of an array. + """ + domain = transform.domain + if domain.inclusive_min != (0,) * len(shape) or domain.exclusive_max != shape: + return False + if len(transform.output) != len(shape): + return False + return all( + isinstance(m, DimensionMap) and m.input_dimension == i and m.offset == 0 and m.stride == 1 + for i, m in enumerate(transform.output) + ) + + +# --------------------------------------------------------------------------- # +# Partitions +# --------------------------------------------------------------------------- # + + +@dataclass(frozen=True, slots=True, eq=False) +class _PartOwner: + """Opaque identity shared only by one view and the parts it prepared.""" + + +def _partition_out_selection( + cell_transform: IndexTransform, +) -> tuple[Any, ...]: + """Lower ``cell_transform`` to NumPy selectors on the request buffer.""" + domain = cell_transform.domain + if _is_correlated(cell_transform): + correlated_selectors: list[np.ndarray[Any, np.dtype[np.intp]]] = [] + for output_map in cell_transform.output: + if isinstance(output_map, ConstantMap): + coordinates = np.full(domain.shape, output_map.offset, dtype=np.intp) + elif isinstance(output_map, DimensionMap): + input_dimension = output_map.input_dimension + axis = np.arange( + domain.inclusive_min[input_dimension], + domain.exclusive_max[input_dimension], + dtype=np.intp, + ) + shape = ( + (1,) * input_dimension + + (axis.size,) + + ((1,) * (domain.ndim - input_dimension - 1)) + ) + coordinates = np.broadcast_to(axis.reshape(shape), domain.shape) + coordinates = output_map.offset + output_map.stride * coordinates + else: + coordinates = output_map.offset + output_map.stride * np.broadcast_to( + output_map.index_array, domain.shape + ) + correlated_selectors.append(np.asarray(coordinates, dtype=np.intp)) + return tuple(correlated_selectors) + + selectors: list[int | slice | np.ndarray[Any, np.dtype[np.intp]]] = [] + n_array_maps = sum(isinstance(output_map, ArrayMap) for output_map in cell_transform.output) + for output_map in cell_transform.output: + if isinstance(output_map, ConstantMap): + selectors.append(output_map.offset) + elif isinstance(output_map, DimensionMap): + input_dimension = output_map.input_dimension + lo = domain.inclusive_min[input_dimension] + hi = domain.exclusive_max[input_dimension] + selectors.append( + slice( + output_map.offset + output_map.stride * lo, + output_map.offset + output_map.stride * hi, + output_map.stride, + ) + ) + else: + selectors.append( + (output_map.offset + output_map.stride * output_map.index_array.ravel()).astype( + np.intp + ) + ) + if n_array_maps > 1: + axes = [ + np.asarray([selector], dtype=np.intp) + if isinstance(selector, int) + else ( + np.arange(selector.start, selector.stop, selector.step, dtype=np.intp) + if isinstance(selector, slice) + else selector + ) + for selector in selectors + ] + return np.ix_(*axes) + return tuple(selectors) + + +def _out_selection_cell_count(selection: tuple[Any, ...], out_shape: tuple[int, ...]) -> int: + """How many cells of an array of shape `out_shape` a `Partition.out_selection` writes. + + Counted from the selectors' own shapes, so nothing is read and no index + array is materialized. The selectors are slices and integer arrays: the + slices contribute their lengths, and the arrays broadcast against each other + exactly as NumPy's advanced indexing broadcasts them, whether they arrive as + an open mesh (`numpy.ix_`) or as parallel coordinates (`unravel_index`). + """ + total = 1 + array_shapes: list[tuple[int, ...]] = [] + if len(selection) != len(out_shape): + raise AssertionError( + f"a partition addressed {len(selection)} of the view's {len(out_shape)} " + "dimensions; this is a bug in zarr-indexing's partition walk" + ) + for selector, extent in zip(selection, out_shape, strict=True): + if isinstance(selector, slice): + start: Any = selector.start + stop: Any = selector.stop + step: Any = selector.step + if step is None and start is not None and stop is not None and 0 <= start <= stop: + # The shape a partition walk actually produces: a concrete, + # forward, in-bounds interval. Sized directly, so the common + # path allocates neither a tuple nor a range. + total *= int(stop) - int(start) + else: + total *= len(range(*selector.indices(extent))) + else: + array_shapes.append(tuple(int(s) for s in np.shape(selector))) + if len(array_shapes) > 0: + total *= math.prod(np.broadcast_shapes(*array_shapes)) + return total + + +@dataclass(frozen=True, kw_only=True) +class Partition: + """One box of a `LazyArray`'s partitioning, as it falls through the view. + + Yielded by [`LazyArray.parts`][zarr_indexing.lazy_array.LazyArray.parts]. + The parts of a view tile it exactly and disjointly: assembling every + `view.result()` at its `out_selection` reproduces the whole view's + `result()`, and each part can be resolved independently and concurrently. + Derived parts retain the same reader object; a shared stateful reader owns + synchronization for concurrent calls. + + A consumer that needs the plan before materialization can prepare it once + and reuse the same immutable parts for both scheduling and assembly: + + ```python + parts = tuple(view.parts()) + schedule(part.base_coords for part in parts) + values = view.result(parts=parts) + ``` + + Prepared parts are owned by the exact view that created them and must tile + it completely. Passing parts from another view, even an equivalent one, is + rejected without reading; omitting a part is likewise rejected rather than + returning a partly initialized result. + + Attributes + ---------- + projection + The source-independent description of this part. Its paired + `chunk_transform` and `cell_transform` share one compact synthetic + domain, mapping each selected cell to chunk-local storage and request + coordinates respectively. This is the authoritative placement model; + `base_coords` and `is_complete` are conveniences derived from it. + base_coords + Which box of the base partitioning this is, one coordinate per dimension + of the wrapped array. + box + The box itself, in the global storage coordinates of the wrapped + array: one `[inclusive_min, exclusive_max)` interval per dimension. It + describes the whole partition cell, while `view.bounding_box()` is the + global hull of only the selected values in that cell. For a nested or + repartitioned view this box may be narrower than + `projection.chunk_domain`. + view + A `LazyArray` covering exactly the cells of the view that live in this + box. Its transform directly addresses its raw wrapped `array`; only the + projection's `chunk_transform` is chunk-local. Resolving the view reads + the box once through its selected reader. Named `view` rather than + `array` because `LazyArray.array` is the opposite thing — the raw + wrapped source — and the two sat next to each other meaning inverses. + out_selection + Where `view.result()` belongs in an array of the whole view's shape — a + NumPy index tuple with one entry per dimension of the view, usable + directly as `out[part.out_selection] = ...`. + is_complete + Whether the view covers the whole box. Useful to a writer deciding + between a blind overwrite and a read-modify-write. Fancy projections + report `False` because their coverage is deliberately `unknown` until + duplicate-aware proof is added. + + Examples + -------- + Assembling every part's result at its `out_selection` reproduces the view: + + >>> import numpy as np + >>> source = np.arange(12).reshape(3, 4) + >>> view = LazyArray.from_numpy(source).with_parts((2, 2)) + >>> out = np.empty(view.shape, dtype=view.dtype) + >>> for part in view.parts(): + ... out[part.out_selection] = part.view.result() + >>> bool((out == source).all()) + True + """ + + projection: ChunkProjection + box: tuple[tuple[int, int], ...] + view: LazyArray + out_selection: tuple[Any, ...] + _owner: _PartOwner | None = field(default=None, repr=False, compare=False) + + @property + def base_coords(self) -> tuple[int, ...]: + """Coordinates of this partition in the selected base grid.""" + return self.projection.chunk_coords + + @property + def is_complete(self) -> bool: + """Whether the projection proves it covers the entire selected cell.""" + return self.projection.coverage == "full" + + +def _validate_prepared_parts(parts: Sequence[Partition], out_shape: tuple[int, ...]) -> None: + """Require `parts` to address every output cell exactly once. + + Prepared parts are caller-supplied input, so a plan that does not tile the + view is a `ValueError`, not an assertion about this library's own walk. + """ + coverage = np.zeros(out_shape, dtype=np.bool_) + addressed = 0 + try: + for part in parts: + # Name a rank mismatch explicitly instead of letting NumPy treat + # omitted selectors as implicit full slices. + addressed += _out_selection_cell_count(part.out_selection, out_shape) + if all(isinstance(selector, slice) for selector in part.out_selection): + # The common box part: plain assignment, no pointwise walk. + coverage[part.out_selection] = True + else: + # `logical_or.at` applies duplicate advanced coordinates one by + # one instead of buffering them as ordinary advanced indexing + # would. + np.logical_or.at(coverage, part.out_selection, True) + except (AssertionError, IndexError, TypeError, ValueError) as error: + raise ValueError("prepared parts do not tile the view exactly") from error + if addressed != math.prod(out_shape) or not np.all(coverage): + raise ValueError("prepared parts do not tile the view exactly") + + +# --------------------------------------------------------------------------- # +# Tokenization +# --------------------------------------------------------------------------- # + + +def _wrapped_token(array: Any) -> Any: + """A token for the wrapped array. + + In order of preference: the array's own `__dask_tokenize__`; + `dask.base.tokenize` when dask is importable (imported lazily — this package + never requires it); otherwise a local fallback that digests the contents of + a small array. + + The two environments do not agree, and neither is a translation of the + other: a token taken with dask installed is meaningless to a process without + it, and the reverse. A token is an identifier within one process, not a + portable name. + + Above `_TOKEN_DIGEST_LIMIT` the local fallback has nothing left to identify + the contents with — reading them is exactly what a token call must not do — + so it declines to claim equality at all and returns a value that matches + nothing, including itself. A cache keyed on it misses; the alternative, a + structural description, is a cache that hands one array's result to a + different array of the same shape and dtype. + """ + hook = getattr(array, "__dask_tokenize__", None) + if hook is not None: + try: + return hook() + # A token must never raise; fall through to the structural fallback. + except Exception: # pragma: no cover - a hook that refuses to run + pass + try: + # dask is an optional peer, never a dependency of this package, so it is + # imported here and its absence is ordinary. + from dask.base import tokenize # pyright: ignore[reportMissingImports] + except ImportError: + pass + else: + return tokenize(array) + + shape = tuple(int(s) for s in getattr(array, "shape", ())) + dtype = getattr(array, "dtype", None) + structural = (type(array).__qualname__, shape, str(dtype)) + # A token nothing can equal, for when the contents cannot be identified. It + # is the shape and dtype that would otherwise be mistaken for an identity, + # so they are kept alongside it for a reader looking at a graph. + unidentified = (*structural, "unidentified", uuid.uuid4().hex) + + # Decide whether to digest the contents from the *declared* size. Measuring + # it by converting first would read the whole array — a multi-gigabyte store + # pulled into memory by a token call, which is the opposite of the point. + itemsize = getattr(dtype, "itemsize", None) + if not isinstance(itemsize, int) or itemsize * math.prod(shape) > _TOKEN_DIGEST_LIMIT: + return unidentified + try: + contents = np.ascontiguousarray(array) + # A token must never raise; an unreadable source is simply unidentified. + except Exception: + return unidentified + return (*structural, hashlib.sha256(contents.tobytes()).hexdigest()) + + +# --------------------------------------------------------------------------- # +# The wrapper +# --------------------------------------------------------------------------- # + + +class LazyArray: + """A lazily-indexable view over a system-memory/basic-indexing source. + + Wrapping neither copies nor reads the wrapped array at construction time. + Indexing through `.lazy` composes an `IndexTransform` and returns another + `LazyArray`; `result()` materializes. + + Selections use the **positional NumPy dialect** and reads are broken up + along a **partitioning** discovered from the wrapped array. Every derived + view retains its reader; that reader receives the complete projected + transform once per part. See the module docstring, which also covers how the + dialect differs from `zarr.Array.lazy` and why every non-indexing NumPy + operation materializes the view. + + This wrapper describes **reads**. It defines no `__setitem__`, so + assigning into a view raises `TypeError`. Writing belongs to the + consumer: plan the selection with + [`plan_chunks`][zarr_indexing.chunk_resolution.plan_chunks] and own the + read-modify-write, since chunk atomicity and concurrent-writer policy are + the backend's to decide, not an indexing plan's. + + Parameters + ---------- + array + The array to wrap. It must expose `shape`, `dtype`, and `__getitem__` + with basic (integer/slice) indexing; `__setitem__` is not required, so + a read-only source wraps as well as a writable one. Its partitioning, + if it advertises one, is discovered here; use `with_parts` to choose + a different one. + This conservative constructor selects `basic_reader`; use `from_numpy` + for a NumPy array or `with_reader` to select another backend adapter. + + Examples + -------- + >>> import numpy as np + >>> source = np.arange(12).reshape(3, 4) + >>> view = LazyArray.from_numpy(source).with_parts((2, 2)).lazy[1:, ::2] + >>> view.shape + (2, 2) + >>> view.result() + array([[ 4, 6], + [ 8, 10]]) + """ + + __slots__ = ("_array", "_part_owner", "_parts", "_reader", "_transform", "_window") + + def __init__(self, array: _WrappedArray) -> None: + """Wrap `array` without reading it; parameters are documented on the class. + + The only validation here is the `numpy.matrix` rejection (`TypeError`). + """ + if isinstance(array, np.matrix): + # `np.matrix` keeps every result two-dimensional, so `m[1]` has shape + # `(1, n)` where every other array-like gives `(n,)`. A view's shape + # comes from the transform, which follows NumPy's rule, so the two + # disagree on every rank-reducing selection. Refused at the door + # rather than resolved into a shape the view did not promise. + raise TypeError( + "numpy.matrix cannot be wrapped: it never reduces rank, so a " + "view's shape and its result would disagree. Convert it first, " + "with numpy.asarray(m)." + ) + shape = tuple(int(s) for s in array.shape) + self._array = array + self._window: tuple[slice, ...] | None = None + self._transform = IndexTransform.from_shape(shape) + self._parts = _discover_parts(array, shape) + self._reader = basic_reader + self._part_owner = _PartOwner() + + @classmethod + def from_numpy(cls, array: np.ndarray[Any, Any]) -> LazyArray: + """Wrap a NumPy array with its explicitly selected optimized reader.""" + if not isinstance(cast(object, array), np.ndarray): + raise TypeError( + f"LazyArray.from_numpy requires a numpy.ndarray, got {type(array).__name__}" + ) + return cls(array).with_reader(numpy_reader) + + @classmethod + def _derive( + cls, + array: _WrappedArray, + transform: IndexTransform, + parts: tuple[DimensionGrid, ...] | None, + window: tuple[slice, ...] | None, + reader: Reader, + ) -> LazyArray: + """Build a wrapper sharing `array` but carrying a new transform or partitioning.""" + view = cls.__new__(cls) + view._array = array + # Views re-zero their coordinate system: the positional dialect means a + # view's first element is at position 0 whatever it was sliced from. + view._transform = transform.translate_domain_to((0,) * transform.input_rank) + view._parts = parts + view._window = window + view._reader = reader + view._part_owner = _PartOwner() + return view + + @property + def _base_shape(self) -> tuple[int, ...]: + """The shape of what this wrapper treats as its base array.""" + if self._window is None: + return tuple(int(s) for s in self._array.shape) + return tuple(s.stop - s.start for s in self._window) + + # -- array-like surface ------------------------------------------------- + + @property + def array(self) -> _WrappedArray: + """The wrapped array.""" + return self._array + + @property + def base_shape(self) -> tuple[int, ...]: + """The shape the partitioning is expressed in — not this view's shape. + + `with_parts` and `with_parts_per_axis` describe boxes of the array being + read, not of the view reading it, so a narrowed view still partitions + the extents named here. For a part's own `array`, this is the part's + box, which is why the same call means different sizes there. Without + somewhere to read it, the frame in force could only be inferred from an + error message. + """ + return self._base_shape + + @property + def transform(self) -> IndexTransform: + """The composed transform from this view's coordinates to storage.""" + return self._transform + + @property + def shape(self) -> tuple[int, ...]: + """The shape of this view — the transform's input domain, not the source's.""" + return self._transform.domain.shape + + @property + def ndim(self) -> int: + """Number of dimensions of this view — the transform's input rank.""" + return self._transform.input_rank + + @property + def size(self) -> int: + """Total number of elements in this view (the product of `shape`).""" + return math.prod(self.shape) + + @property + def dtype(self) -> Any: + """The wrapped array's dtype; views never change it.""" + return self._array.dtype + + @property + def reader(self) -> Reader: + """The backend adapter used when this view materializes.""" + return self._reader + + def with_reader(self, reader: Reader) -> LazyArray: + """Return the same metadata view resolved through `reader`.""" + if not callable(getattr(reader, "read_into", None)): + raise TypeError(f"reader.read_into must be callable, got {type(reader).__name__}") + return LazyArray._derive( + self._array, + self._transform, + self._parts, + self._window, + reader, + ) + + # -- shape of the selection --------------------------------------------- + + @property + def is_box(self) -> bool: + """Whether this view selects a rectangular region rather than a point list. + + True exactly when the composed transform's output maps are all + `ConstantMap` or `DimensionMap` — no `ArrayMap`. Such a selection is + affine and monotone along every axis, so it is described completely by + an interval and a stride per dimension: + [`bounding_box`][zarr_indexing.lazy_array.LazyArray.bounding_box] + together with + [`strides`][zarr_indexing.lazy_array.LazyArray.strides]. Basic indexing, + at any depth of composition, stays a box; one `oindex`, `vindex`, or + mask anywhere in the chain makes the selection a query permanently. + + A box is dense — every cell of its bounding box selected — only when + every stride is 1. A strided box covers its hull sparsely: + `lazy[10:50, ::4]` selects 40x20 cells out of a 40x77 hull, so a + consumer that reads the whole hull and discards the rest transfers 3.85x + the data it needs. Check `strides` before treating a box as a single + slab read. + + The distinction lets a consumer decide between a slab read and a + gather; see [the design notes](../design-notes.md) for why it is a + category rather than an optimization. + + Examples + -------- + >>> import numpy as np + >>> array = LazyArray.from_numpy(np.arange(12).reshape(3, 4)) + >>> (array.lazy[1:, ::2].is_box, array.lazy.oindex[[2, 0], :].is_box) + (True, False) + """ + return not any(isinstance(m, ArrayMap) for m in self._transform.output) + + def bounding_box(self) -> tuple[tuple[int, int], ...] | None: + """The storage region this view touches, one interval per storage dimension. + + Defined for any selection, box or not, as the hull: the smallest + `[inclusive_min, exclusive_max)` interval per dimension of the array + this view reads from that contains every coordinate the selection + reaches. + + The hull is dense — every cell in it selected — only for a box whose + every stride is 1. A strided box selects a sublattice of its hull (pair + this with [`strides`][zarr_indexing.lazy_array.LazyArray.strides] to + describe it fully), and a query's hull is a superset that can be + arbitrarily loose: `oindex[[0, 999]]` has a 1000-wide hull over two + rows. + + Returns + ------- + tuple of (int, int), or None + One interval per storage dimension, or `None` when the view is + empty (`size == 0`) and so touches no coordinate at all, leaving no + interval to report. + + Notes + ----- + The coordinates directly address the raw `array` this view exposes. + Consequently, partition views report source-global hulls; + [`Partition.box`][zarr_indexing.lazy_array.Partition] separately gives + the whole global partition cell rather than only the selected hull. + + Examples + -------- + >>> import numpy as np + >>> array = LazyArray.from_numpy(np.arange(12).reshape(3, 4)) + >>> array.lazy[1:, ::2].bounding_box() + ((1, 3), (0, 3)) + >>> array.lazy.oindex[[2, 0], :].bounding_box() + ((0, 3), (0, 4)) + >>> array.lazy[1:1].bounding_box() is None + True + """ + if self.size == 0: + return None + domain = self._transform.domain + bounds: list[tuple[int, int]] = [] + for m in self._transform.output: + if isinstance(m, ConstantMap): + bounds.append((m.offset, m.offset + 1)) + elif isinstance(m, DimensionMap): + d = m.input_dimension + first = m.offset + m.stride * domain.inclusive_min[d] + last = m.offset + m.stride * (domain.exclusive_max[d] - 1) + bounds.append((min(first, last), max(first, last) + 1)) + else: + coords = m.offset + m.stride * m.index_array + bounds.append((int(coords.min()), int(coords.max()) + 1)) + return tuple(bounds) + + def strides(self) -> tuple[int, ...] | None: + """The step between selected coordinates, one per storage dimension. + + Together with `bounding_box()`, this fully describes a box selection: + `bounding_box()` gives the interval per dimension, `strides()` gives the + step per dimension. A stride of 1 means every cell of the hull along + that dimension is selected; `k` means every `k`-th. Dimensions fixed by + an integer index report 1 — they span a single coordinate. + + Returns + ------- + tuple of int, or None + One positive stride per storage dimension, or `None` when + [`is_box`][zarr_indexing.lazy_array.LazyArray.is_box] is false: a + query's coordinates are a lookup table and have no step. An empty + box still reports its strides even though + [`bounding_box`][zarr_indexing.lazy_array.LazyArray.bounding_box] + returns `None`, because the step is a property of the selection's + shape, not of the (empty) region it touches. + + Notes + ----- + Magnitudes only. A reversing view (`lazy[::-1]`) selects the same set of + coordinates as the equivalent forward view, so it reports the same + bounding box and the same strides. The traversal direction is recorded + in the transform, not in this description of the region touched. A + consumer that needs the order reads the transform, or reverses the block + it gets back. + + Examples + -------- + >>> import numpy as np + >>> array = LazyArray.from_numpy(np.arange(24).reshape(4, 6)) + >>> (array.lazy[1:, ::2].bounding_box(), array.lazy[1:, ::2].strides()) + (((1, 4), (0, 5)), (1, 2)) + >>> array.lazy[2, ::3].strides() + (1, 3) + >>> array.lazy.oindex[[2, 0], :].strides() is None + True + """ + if not self.is_box: + return None + return tuple( + 1 if isinstance(m, ConstantMap) else abs(m.stride) for m in self._transform.output + ) + + # -- partitioning ------------------------------------------------------- + + def with_parts(self, parts: Sequence[int]) -> LazyArray: + """Return the same view, read in uniform boxes of shape `parts`. + + One integer per dimension of `base_shape`, with the trailing box in each + dimension clipped to the extent. The transform, the wrapped array, and + therefore `result()` are all unchanged; only the boxes the read is + broken into differ. Nothing is copied and nothing is read. + + For per-axis sizes see + [`with_parts_per_axis`][zarr_indexing.lazy_array.LazyArray.with_parts_per_axis], + and to read in one pass see + [`unpartitioned`][zarr_indexing.lazy_array.LazyArray.unpartitioned]. + The three were one parameter whose meaning was decided by inspecting the + type of what it was given, which left no way to ask for one of them and + be told when you had spelled it wrong. + + Parameters + ---------- + parts + The box shape, one integer per dimension of `base_shape`. + + Returns + ------- + LazyArray + The same view with a new partitioning. + + Raises + ------ + ValueError + If `parts` has the wrong length or contains a non-positive extent. + Uniform part sizes must remain positive even for a zero-length + axis; use `with_parts_per_axis` for the accepted explicit zero-axis + spellings. + + Examples + -------- + >>> import numpy as np + >>> view = LazyArray.from_numpy(np.arange(12).reshape(3, 4)) + >>> [part.base_coords for part in view.with_parts((2, 3)).parts()] + [(0, 0), (0, 1), (1, 0), (1, 1)] + """ + entries = self._part_entries(parts, "with_parts") + if any(isinstance(entry, Sequence) for entry in entries): + raise ValueError( + "with_parts takes one integer per dimension; for per-axis box " + "sizes use with_parts_per_axis" + ) + return self._with_grids(dimension_grids_from_chunks(entries, self._base_shape)) + + def with_parts_per_axis(self, sizes: Sequence[Sequence[int]]) -> LazyArray: + """Return the same view, read in boxes of explicitly listed sizes. + + The dask convention: one sequence of box extents per dimension of + `base_shape`, each summing to that dimension's extent. Use it when the + boxes are not uniform — a partitioning discovered from a store, or one + whose last box differs by more than clipping. + + Parameters + ---------- + sizes + One sequence of box extents per dimension of `base_shape`. + + Returns + ------- + LazyArray + The same view with a new partitioning. + + Raises + ------ + ValueError + If `sizes` has the wrong length, contains a negative extent, uses a + zero extent on a nonempty axis, or declares sizes that do not sum + to `base_shape`. On a zero-length axis, `()`, `(0,)`, and repeated + zeros all describe no chunks. + + Examples + -------- + >>> import numpy as np + >>> view = LazyArray.from_numpy(np.arange(12).reshape(3, 4)) + >>> [part.box for part in view.with_parts_per_axis(((1, 2), (4,))).parts()] + [((0, 1), (0, 4)), ((1, 3), (0, 4))] + """ + entries = self._part_entries(sizes, "with_parts_per_axis") + return self._with_grids(dimension_grids_from_chunks(entries, self._base_shape)) + + @staticmethod + def _part_entries(parts: Sequence[Any], method: str) -> tuple[Any, ...]: + """Materialize a partitioning argument, naming a non-iterable a ValueError. + + Both partitioning methods document ValueError for malformed input; a + bare integer would otherwise surface as a TypeError from iteration. + """ + try: + return tuple(parts) + except TypeError as error: + raise ValueError( + f"{method} takes one entry per dimension of base_shape; got {parts!r}" + ) from error + + def unpartitioned(self) -> LazyArray: + """Return the same view, read in one pass. + + `result()` still allocates its owned output buffer first, then calls the + reader once with the whole projected transform. `parts()` still yields a + single part covering everything. + + Returns + ------- + LazyArray + The same view with no partitioning. + """ + return self._with_grids(None) + + def _with_grids(self, grids: tuple[DimensionGrid, ...] | None) -> LazyArray: + return LazyArray._derive(self._array, self._transform, grids, self._window, self._reader) + + def parts(self) -> Iterator[Partition]: + """Iterate the base partitioning, projected through this view. + + Single-use: this is a generator, so it is consumed by the first walk and + a second `for` over the same object yields nothing. Call `parts()` again + for a fresh walk, or keep a `list` of it if you need to revisit. + + Yields one [`Partition`][zarr_indexing.lazy_array.Partition] per box the + view actually touches. The parts tile the view exactly and disjointly, + and each carries a `LazyArray` that can be resolved on its own: in + another thread, in another order, or not at all. Those views share this + view's reader, and `LazyArray` does not serialize calls, so a stateful + reader must synchronize its own mutable state. + + A wrapper with no partitioning (see `with_parts`) yields a single part + covering the whole array. + + Yields + ------ + Partition + One per touched box, in the resolver's own order. + + Examples + -------- + >>> import numpy as np + >>> view = LazyArray.from_numpy(np.arange(12).reshape(3, 4)).with_parts((2, 2)) + >>> part = next(view.lazy[:, 1:].parts()) + >>> (part.base_coords, part.view.shape, part.is_complete) + ((0, 0), (2, 1), False) + """ + base_shape = self._base_shape + grids = self._parts if self._parts is not None else _whole_array_grids(base_shape) + rank = len(base_shape) + + if self._window is None: + plan_transform = self._transform + else: + plan_transform = self._transform.translate(tuple(-item.start for item in self._window)) + + for projection in plan_chunks(plan_transform, grids): + base_coords = projection.chunk_coords + local = projection.chunk_transform + origin = tuple(grid.chunk_offset(c) for grid, c in zip(grids, base_coords, strict=True)) + extent = tuple(grid.data_size(c) for grid, c in zip(grids, base_coords, strict=True)) + if origin == (0,) * rank and extent == base_shape: + # The part is the whole base: lowering directly against the + # source beats materializing a block that is the source. + window = self._window + elif self._window is None: + window = tuple(slice(o, o + e) for o, e in zip(origin, extent, strict=True)) + else: + window = tuple( + slice(w.start + o, w.start + o + e) + for w, o, e in zip(self._window, origin, extent, strict=True) + ) + # The global box, computed from the origin directly rather than from + # `window`: a part covering the whole base carries no window (so + # nothing is pre-materialized) but still sits somewhere concrete. + if self._window is None: + global_origin = origin + else: + global_origin = tuple( + w.start + o for w, o in zip(self._window, origin, strict=True) + ) + yield Partition( + projection=projection, + box=tuple((o, o + e) for o, e in zip(global_origin, extent, strict=True)), + view=LazyArray._derive( + self._array, + local.translate(global_origin), + None, + window, + self._reader, + ), + out_selection=_partition_out_selection(projection.cell_transform), + _owner=self._part_owner, + ) + + # -- indexing ----------------------------------------------------------- + + @property + def lazy(self) -> _LazyIndexer: + """Lazy indexing: `lazy[...]`, `lazy.oindex[...]`, `lazy.vindex[...]`. + + Each returns a new `LazyArray` view; no data is read. + """ + return _LazyIndexer(self._select) + + def _select(self, selection: Any, mode: SelectionMode) -> LazyArray: + transform = self._transform + if mode != "basic": + # NumPy applies scalar integers as basic indices before the advanced + # ones, dropping their axes. Split them into their own step. + scalar_selection, selection = split_scalar_axes(selection, transform.domain, mode) + if scalar_selection is not None: + transform = transform.select(scalar_selection, "basic") + transform = transform.translate_domain_to((0,) * transform.input_rank) + literal = normalize_positional_selection(selection, transform.domain, mode) + if mode == "basic": + # IndexTransform's basic path includes NumPy's `None`/newaxis. + # `selection_to_transform` intentionally exposes a narrower basic + # selection contract and rejects it. + composed = transform[literal] + else: + composed = transform.select(literal, mode) + return LazyArray._derive(self._array, composed, self._parts, self._window, self._reader) + + def __getitem__(self, selection: Any) -> Any: + """Read a basic selection eagerly, like `numpy.ndarray.__getitem__`. + + Reads here are eager, not lazy, so that a `LazyArray` works as a duck + array for consumers (dask's `from_array`, `numpy.asarray`) that expect + indexing to produce data. Use `.lazy[...]` for the lazy form. + """ + return self._select(selection, "basic").result() + + def result(self, *, parts: Sequence[Partition] | None = None) -> Any: + """Materialize this view. + + Every result starts as a fresh system-memory buffer. Each touched + partition is read through the selected reader directly into its + rectangular destination, or into an owned dense temporary before fancy + placement. Empty views allocate without reading the source. + + Parameters + ---------- + parts + A reusable sequence previously returned by this exact view's + `parts()` method. Supplying it reuses that partition plan instead + of constructing another one. The parts must tile the view exactly. + + Returns + ------- + numpy.ndarray + An array of shape `self.shape`, identical whatever partitioning is + in force, always in fresh system memory. A view with a zero-rank + domain returns a zero-dimensional array, not a scalar. + + Raises + ------ + ValueError + If supplied parts were prepared by another view, or do not tile + this view exactly. The output buffer is uninitialized where nothing + was written, so a bad plan is reported rather than returned. + AssertionError + If this library's own partition walk fails to cover the view — a + bug in zarr-indexing, never a consequence of the caller's input. + """ + prepared_parts = None if parts is None else tuple(parts) + if prepared_parts is not None and any( + # Module-private provenance deliberately crosses the two public + # wrapper types without becoming part of either public surface. + part._owner is not self._part_owner # pyright: ignore[reportPrivateUsage] + for part in prepared_parts + ): + raise ValueError("prepared parts do not belong to this view") + + out_shape = self.shape + if prepared_parts is not None: + _validate_prepared_parts(prepared_parts, out_shape) + out = self._output_buffer(out_shape) + size = math.prod(out_shape) + if size == 0: + return out + + if prepared_parts is None and self._parts is None: + _invoke_reader(self._reader, self._array, ReadContext(self._transform), out) + return out + + written = 0 + selected_parts = self.parts() if prepared_parts is None else prepared_parts + for part in selected_parts: + # Counted before the scatter, so a part addressing the wrong + # number of axes is named rather than reported as a broadcast + # failure against the buffer. + written += _out_selection_cell_count(part.out_selection, out_shape) + direct = all(isinstance(selector, slice) for selector in part.out_selection) + if direct: + destination = out if len(part.out_selection) == 0 else out[part.out_selection] + else: + destination = part.view._output_buffer(part.view.shape) + _invoke_reader( + self._reader, + self._array, + ReadContext(part.view.transform, part.projection), + destination, + ) + if not direct: + out[part.out_selection] = destination + if written != size: + # The buffer is uninitialized where no part wrote, so a partition + # walk that does not tile the view exactly would otherwise hand + # back process memory dressed as data. The parts are disjoint by + # contract, so counting the cells each addresses is enough: + # a gap undercounts and an overlap overcounts. + if prepared_parts is not None: + raise ValueError( + "prepared parts do not tile the view exactly: " + f"they addressed {written} of the view's {size} cells" + ) + raise AssertionError( + f"the partition walk addressed {written} of the view's {size} " + "cells; this is a bug in zarr-indexing's partition walk" + ) + return out + + def _output_buffer(self, out_shape: tuple[int, ...]) -> Any: + """The buffer `result()` scatters parts into. + + Deliberately uninitialized: every cell is written by exactly one part, + and `result()` verifies that before returning. A masked source gets a + masked buffer so that reader writes preserve the mask; other source- + specific array types do not survive materializing. + """ + dtype = np.dtype(self.dtype) + if isinstance(self._array, np.ma.MaskedArray): + return np.ma.masked_all(out_shape, dtype=dtype) + return np.empty(out_shape, dtype=dtype) + + # -- protocols ---------------------------------------------------------- + + def __array__(self, dtype: Any = None, copy: bool | None = None) -> Any: + """Materialize the view as a NumPy array. + + The result never shares memory with the wrapped array, whatever `copy` + asks for: `result()` already allocates, so `copy=True` gets an array the + caller owns and `copy=None` gets the same one rather than a second + allocation. `copy=False` is refused, because materializing means reading + — the values do not exist as a NumPy array until this call makes them. + """ + if copy is False: + raise ValueError( + "a LazyArray cannot be converted to a NumPy array without a " + "copy: a view is a description of a read, and the values only " + "exist once the read is made" + ) + return np.asarray(self.result(), dtype=dtype) + + def __dask_tokenize__(self) -> Any: + """A deterministic token: the wrapped array and the view. + + Two wrappers produce equal tokens when they wrap the same data and + address the same cells. The view contributes a digest of its canonical + ndsel body, so transforms that differ only in representation produce + the same token, and a fancy selection with a large index array does not + embed that array's JSON in the token. See `_wrapped_token` for the + determinism scope of the wrapped array's contribution; dask is imported + lazily and is never a requirement of this package. + + The partitioning and reader are deliberately absent. Both decide how + the data is read — in which boxes, and through which request strategy — + and neither changes the values that come back, so two wrappers differing + only in those describe the same data. A token identifies data, so they + token alike and a consumer that caches on tokens reuses one result for + both. + """ + canonical = json.dumps(self._transform.to_json(), sort_keys=True) + return ( + type(self).__qualname__, + _wrapped_token(self._array), + hashlib.sha256(canonical.encode()).hexdigest(), + ) + + def __len__(self) -> int: + """The length of the first axis, as for a NumPy array; `TypeError` on a 0-d view.""" + if self.ndim == 0: + raise TypeError("len() of unsized object") + return self.shape[0] + + def __iter__(self) -> Iterator[Any]: + """Iterate eagerly over the first axis, like a NumPy array. + + The rank check happens in `__iter__` itself rather than in the + generator, so `iter(view)` on a zero-rank view raises immediately as + NumPy's does, instead of waiting for the first `next`. + """ + if self.ndim == 0: + raise TypeError("iteration over a 0-d array") + return (self[position] for position in range(self.shape[0])) + + # NumPy's own conversions decide what a size-1 (or wrong-sized) view means, + # including which exception it raises, so these delegate rather than + # reimplement. Each materializes the view first. + def __bool__(self) -> bool: + return bool(self.result()) + + def __int__(self) -> int: + return int(self.result()) + + def __float__(self) -> float: + return float(self.result()) + + def __index__(self) -> int: + return operator.index(self.result()) + + def __repr__(self) -> str: + wrapped = type(self._array).__name__ + described = [f"{wrapped} shape={self.shape} dtype={self.dtype}"] + if not _is_identity_transform(self._transform, self._base_shape): + described.append(f"view={self._transform.selection_repr}") + return f"" + + +class _LazyIndexer: + """The `.lazy` accessor: builds views instead of reading data. + + Holds the owning view's bound `_select` rather than the view itself, so the + accessor classes never reach into another object's internals. + """ + + __slots__ = ("_select",) + + def __init__(self, select: SelectFn) -> None: + self._select = select + + def __getitem__(self, selection: Any) -> LazyArray: + """Basic (integer / slice / ellipsis) indexing, lazily.""" + return self._select(selection, "basic") + + @property + def oindex(self) -> _LazyOIndex: + """Orthogonal (outer-product) indexing, lazily.""" + return _LazyOIndex(self._select) + + @property + def vindex(self) -> _LazyVIndex: + """Vectorized (coordinate / mask) indexing, lazily.""" + return _LazyVIndex(self._select) + + +class _LazyOIndex: + """`lazy.oindex[...]` — one selection per axis, combined as an outer product.""" + + __slots__ = ("_select",) + + def __init__(self, select: SelectFn) -> None: + self._select = select + + def __getitem__(self, selection: Any) -> LazyArray: + return self._select(selection, "orthogonal") + + +class _LazyVIndex: + """`lazy.vindex[...]` — correlated coordinate arrays, or a single mask.""" + + __slots__ = ("_select",) + + def __init__(self, select: SelectFn) -> None: + self._select = select + + def __getitem__(self, selection: Any) -> LazyArray: + return self._select(selection, "vectorized") diff --git a/packages/zarr-indexing/src/zarr_indexing/messages.py b/packages/zarr-indexing/src/zarr_indexing/messages.py index d5761d1a38..df0e0c87eb 100644 --- a/packages/zarr-indexing/src/zarr_indexing/messages.py +++ b/packages/zarr-indexing/src/zarr_indexing/messages.py @@ -54,6 +54,9 @@ "output_map_conflict", "rank_mismatch", "step_zero", + # Retired in 1.0-draft.2, when negative `step` became specified. Kept in + # the set so a message carrying the code is still recognized, but no + # condition in this implementation emits it. "negative_step_unsupported", } ) @@ -65,9 +68,23 @@ class NdselError(ValueError): Carries the spec `reason` code (one of `REASON_CODES`) so callers and the conformance harness can assert on it directly, plus a human-readable `detail`. + + Examples + -------- + >>> try: + ... normalize_ndsel({"kind": "bogus"}) + ... except NdselError as error: + ... (error.reason, str(error)) + ('unknown_kind', "unknown_kind: unknown kind 'bogus'") """ def __init__(self, reason: str, detail: str = "") -> None: + """Store `reason` and `detail` and compose the message as `"reason: detail"`. + + `reason` is a spec reason code (one of `REASON_CODES`); `detail` is + optional human-readable context, and when empty the message is the + bare `reason`. + """ self.reason = reason self.detail = detail super().__init__(f"{reason}: {detail}" if detail else reason) @@ -88,9 +105,21 @@ def __init__(self, reason: str, detail: str = "") -> None: _TRANSFORM_UPPER = ("input_exclusive_max", "input_inclusive_max", "input_shape") _OUTPUT_MAP_FIELDS = frozenset( - {"offset", "stride", "input_dimension", "index_array", "index_array_bounds"} + { + "offset", + "stride", + "input_dimension", + "index_array", + "index_array_bounds", + } ) +# An upper bound on `input_rank`, because normalization allocates proportionally +# to it — an identity `output`, a bound per dimension, a label per dimension — +# from a document that carries no data behind the number. Matches the rank +# TensorStore accepts, which is well above any real array. +_MAX_RANK = 32 + # --------------------------------------------------------------------------- # Leaf value validators @@ -259,28 +288,50 @@ def _resolve_upper_bound( implicit = _bound_is_implicit(raw) value = _bound_value(raw) if kind_of == "inclusive": - new = _inclusive_to_exclusive(value) + new = _inclusive_to_exclusive(value, f"{upper_field}[{k}]") else: # shape - new = _shape_to_exclusive(_bound_value(inclusive_min[k]), value) + new = _shape_to_exclusive(_bound_value(inclusive_min[k]), value, f"{upper_field}[{k}]") result.append(_rewrap(new, implicit=implicit)) return result -def _inclusive_to_exclusive(value: int | str) -> int | str: +def _checked_i64(value: int, where: str) -> int: + """An arithmetic result that must still be a 64-bit signed integer. + + Normalization is idempotent (spec section 4.3): whatever it emits must pass + the same validation on the way back in. Desugaring adds — `inclusive_max + 1`, + `inclusive_min + shape` — so a bound at the top of the range would otherwise + be emitted one past it and rejected by the next call on our own output. + """ + if value < _I64_MIN or value > _I64_MAX: + raise NdselError( + "invalid_json", + f"{where} is {value}, which is outside the 64-bit signed range; the " + f"normalized form cannot represent it", + ) + return value + + +def _inclusive_to_exclusive(value: int | str, where: str) -> int | str: if value == "+inf" or value == "-inf": return value assert isinstance(value, int) - return value + 1 + return _checked_i64(value + 1, f"{where} converted to an exclusive bound") -def _shape_to_exclusive(min_value: int | str, shape_value: int | str) -> int | str: +def _shape_to_exclusive(min_value: int | str, shape_value: int | str, where: str) -> int | str: + if shape_value == "-inf": + raise NdselError( + "invalid_json", + f"{where} is '-inf'; a shape counts cells and cannot be negatively infinite", + ) if shape_value == "+inf" or min_value == "+inf": return "+inf" if min_value == "-inf": return "-inf" assert isinstance(min_value, int) assert isinstance(shape_value, int) - return min_value + shape_value + return _checked_i64(min_value + shape_value, f"{where} added to its inclusive_min") def _validate_domain(inclusive_min: list[Any], exclusive_max: list[Any], *, prefix: str) -> None: @@ -408,17 +459,27 @@ def _normalize_slice(obj: dict[str, Any]) -> dict[str, Any]: for k, s in enumerate(step): if s == 0: raise NdselError("step_zero", f"step[{k}] is zero") - if s < 0: - raise NdselError("negative_step_unsupported", f"step[{k}] is negative ({s})") inclusive_min: list[Any] = [] exclusive_max: list[Any] = [] output: list[dict[str, Any]] = [] for k in range(n): a, b, s = start[k], stop[k], step[k] - m = max(0, -(-(b - a) // s)) # ceil((b - a) / s) - o = _trunc_div(a, s) # trunc(a / s), toward zero - offset = a - s * o # lattice phase, in (-s, s) + # One rule for both signs (spec 5.3): the traversal runs from `a` + # toward `b`, so the source interval's length is `b - a` going up and + # `a - b` going down. + length = (b - a) if s > 0 else (a - b) + if length < 0: + # A reversed interval is a mistake about the direction of travel, + # not an empty selection. `b == a` is the way to select nothing. + raise NdselError( + "bounds_out_of_order", + f"start[{k}]={a} and stop[{k}]={b} with step {s} run the wrong " + "way; an empty selection is spelled stop == start", + ) + m = -(-length // abs(s)) # ceil(length / |s|) + o = _trunc_div(a, s) # trunc(a / s), toward zero, both signs + offset = a - s * o # lattice phase, |offset| < |s| inclusive_min.append(o) exclusive_max.append(o + m) output.append({"offset": offset, "stride": s, "input_dimension": k}) @@ -499,12 +560,13 @@ def _normalize_output_map(raw: Any, where: str) -> dict[str, Any]: else ["-inf", "+inf"] ) # index_array is carried verbatim (spec section 7 defers shape validation). - return { + normalized: dict[str, Any] = { "offset": offset, "stride": stride, "index_array": raw["index_array"], "index_array_bounds": bounds, } + return normalized if has_input_dim: input_dim = _check_int(raw["input_dimension"], f"{where}.input_dimension") @@ -528,10 +590,14 @@ def _check_index_array_bounds(value: Any, where: str) -> list[int | str]: "invalid_json", f"{where}.index_array_bounds must be a two-element array, got {value!r}", ) - return [ - _check_index_value(value[0], f"{where}.index_array_bounds[0]"), - _check_index_value(value[1], f"{where}.index_array_bounds[1]"), - ] + lo = _check_index_value(value[0], f"{where}.index_array_bounds[0]") + hi = _check_index_value(value[1], f"{where}.index_array_bounds[1]") + if _ext_key(lo) > _ext_key(hi): + raise NdselError( + "bounds_out_of_order", + f"{where}.index_array_bounds: lower bound {lo!r} > upper bound {hi!r}", + ) + return [lo, hi] def _normalize_transform(obj: dict[str, Any]) -> dict[str, Any]: @@ -554,6 +620,14 @@ def _normalize_transform(obj: dict[str, Any]) -> dict[str, Any]: declared_rank = _check_int(obj["input_rank"], "input_rank") if declared_rank < 0: raise NdselError("invalid_json", f"input_rank must be >= 0, got {declared_rank}") + if declared_rank > _MAX_RANK: + # Normalization fills a bound, a label and an identity output map per + # dimension, so an unbacked rank is a request to allocate from a + # document that carries nothing. + raise NdselError( + "invalid_json", + f"input_rank must be <= {_MAX_RANK}, got {declared_rank}", + ) inclusive_min_raw = ( _check_bound_list(obj["input_inclusive_min"], "input_inclusive_min") @@ -590,6 +664,16 @@ def _normalize_transform(obj: dict[str, Any]) -> dict[str, Any]: if not isinstance(obj["output"], list): raise NdselError("invalid_json", f"output must be an array, got {obj['output']!r}") output = [_normalize_output_map(m, f"output[{i}]") for i, m in enumerate(obj["output"])] + for i, m in enumerate(output): + # An `input_dimension` names one of *this* transform's input + # dimensions, so the rank is what bounds it. Checked here rather than + # in `_normalize_output_map`, which sees one map and not the rank. + if "input_dimension" in m and m["input_dimension"] >= rank: + raise NdselError( + "rank_mismatch", + f"output[{i}].input_dimension is {m['input_dimension']}, " + f"outside the valid range [0, {rank}) for input_rank {rank}", + ) else: output = _identity_output(rank) @@ -635,6 +719,14 @@ def normalize_ndsel(obj: Any) -> dict[str, Any]: Accepts any of the five message kinds and returns the bare canonical `IndexTransform` body of spec section 4.3 — no `kind` field. Raises `NdselError` (carrying a reason code) for any invalid input. + + Examples + -------- + >>> body = normalize_ndsel({"kind": "box", "shape": [2, 3]}) + >>> (body["input_rank"], body["input_inclusive_min"], body["input_exclusive_max"]) + (2, [0, 0], [2, 3]) + >>> body["output"][0] + {'offset': 0, 'stride': 1, 'input_dimension': 0} """ message = _require_object(obj) kind = _message_kind(message) @@ -649,6 +741,14 @@ def parse_ndsel(obj: Any) -> dict[str, Any]: JSON types, upper-bound exclusivity, domain ordering, step signs) and raises `NdselError` otherwise, but does not desugar it. Useful for validating a message you intend to keep in its compact shorthand form. + + Examples + -------- + >>> message = {"kind": "point", "coords": [3, 4]} + >>> parse_ndsel(message) is message + True + >>> normalize_ndsel(message)["output"] + [{'offset': 3}, {'offset': 4}] """ message = _require_object(obj) _message_kind(message) diff --git a/packages/zarr-indexing/src/zarr_indexing/output_map.py b/packages/zarr-indexing/src/zarr_indexing/output_map.py index 581229bd22..3ee7250efa 100644 --- a/packages/zarr-indexing/src/zarr_indexing/output_map.py +++ b/packages/zarr-indexing/src/zarr_indexing/output_map.py @@ -1,21 +1,24 @@ -"""Output index maps — three representations of a set of integer coordinates. +"""Output index maps — three ordered mappings to integer coordinates. -An output index map describes, for one dimension of storage, which coordinates -an array access will touch. Conceptually it is a **set of integers**. Three -representations cover the cases that arise in practice: +An output index map describes how input cells address one dimension of +the output space. Its coordinates form an **ordered, duplicate-preserving sequence** +aligned with the input domain, never a mathematical set. Three representations +cover the cases that arise in practice: -- `ConstantMap(offset=5)` — a singleton set: `{5}` +- `ConstantMap(offset=5)` — every request cell maps to coordinate `5` - `DimensionMap(input_dimension=0, offset=3, stride=2)` over input `[0, 5)` - — an arithmetic progression: `{3, 5, 7, 9, 11}` -- `ArrayMap(index_array=[1, 5, 9])` — an explicit enumeration: `{1, 5, 9}` + — the ordered arithmetic progression `[3, 5, 7, 9, 11]` +- `ArrayMap(index_array=[5, 1, 1])` — the explicit sequence `[5, 1, 1]`, + preserving both order and the repeated coordinate -Every output map supports two set-theoretic operations (defined on -`IndexTransform`, which provides the input domain context these maps lack): +Every output map participates in two operations defined on `IndexTransform`, +which provides the input-domain context these maps lack: -- **intersect** — restrict to coordinates within a range (e.g., a chunk). - `{3, 5, 7, 9, 11} ∩ [4, 8) = {5, 7}` +- **intersect** — retain mapped cells whose coordinates lie within a range + (e.g., a chunk), without changing their order or multiplicity. + Restricting `[3, 5, 5, 9]` to `[4, 8)` produces `[5, 5]`. - **translate** — shift every coordinate by a constant (e.g., make chunk-local). - `{5, 7} - 4 = {1, 3}` + Translating `[5, 5, 7]` by `-4` produces `[1, 1, 3]`. These two operations are the foundation of chunk resolution: for each chunk, intersect the map with the chunk's range, then translate to chunk-local @@ -35,71 +38,366 @@ from __future__ import annotations from dataclasses import dataclass -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any + +import numpy as np + +from zarr_indexing._affine import checked_affine if TYPE_CHECKING: - import numpy as np import numpy.typing as npt + from zarr_indexing.json import OutputIndexMapJSON + + +def _array_map_dependency_axes(index_array: np.ndarray[Any, Any]) -> tuple[int, ...]: + """Return the input axes on which a normalized index array varies. + + Normalized `ArrayMap` index arrays carry the full input rank of their + enclosing transform: an axis the array varies over has its full size, while + an axis the array is independent of is a singleton (size 1). The dependency + axes are therefore exactly the axes of size 2 or more. An orthogonal + (`oindex`) array depends on a single axis; a vectorized (`vindex`) array + depends on all of the (shared) broadcast axes. + + A size-**0** axis carries no dependency either: the array has no values to + vary, so an empty selection stays the flavor it was made as rather than + reading as correlated with every other axis. + """ + return tuple(axis for axis, size in enumerate(index_array.shape) if size > 1) + @dataclass(frozen=True, slots=True) class ConstantMap: - """A singleton set: one storage coordinate. + """A constant output-coordinate mapping. + + Every input cell maps to `offset`. Arises from integer indexing (e.g., + `arr[5]` fixes one dimension to coordinate 5). + + Examples + -------- + Every input cell maps to the same output coordinate — the NumPy analogy + is a broadcast (`np.broadcast_to(5, (3,))`), not an index: - Represents `{offset}`. Arises from integer indexing (e.g., `arr[5]` - fixes one dimension to coordinate 5). + >>> from zarr_indexing.domain import IndexDomain + >>> from zarr_indexing.transform import IndexTransform + >>> domain = IndexDomain.from_shape((3,)) + >>> t = IndexTransform(domain=domain, output=(ConstantMap(offset=5),)) + >>> t.apply((0,)), t.apply((1,)), t.apply((2,)) + ((5,), (5,), (5,)) """ offset: int = 0 + """The fixed output coordinate every input cell maps to.""" + + def to_json(self) -> OutputIndexMapJSON: + """Convert to the canonical wire form: the bare `constant` map. + + Examples + -------- + >>> ConstantMap(5).to_json() + {'offset': 5} + """ + return {"offset": self.offset} @dataclass(frozen=True, slots=True) class DimensionMap: - """An arithmetic progression of storage coordinates. + """An ordered affine mapping to output coordinates. + + Maps each input coordinate `i` to `offset + stride * i`, where the input + range comes from the enclosing `IndexTransform`'s domain. Arises from slice + indexing (e.g., `arr[2:10:3]` gives offset=2, stride=3). - Represents `{offset + stride * i : i in input_range}`, where the input - range comes from the enclosing `IndexTransform`'s domain. Arises from - slice indexing (e.g., `arr[2:10:3]` gives offset=2, stride=3). + Examples + -------- + The slice `arr[2:11:3]` reads coordinates `2, 5, 8` — the rule + `offset + stride * i` with `offset=2`, `stride=3`: + + >>> m = DimensionMap(input_dimension=0, offset=2, stride=3) + >>> [m.offset + m.stride * i for i in range(3)] + [2, 5, 8] + >>> np.arange(11)[2:11:3].tolist() + [2, 5, 8] """ input_dimension: int + """The input (domain) dimension whose coordinate this map reads.""" + offset: int = 0 + """The output coordinate that input coordinate `0` maps to.""" + stride: int = 1 + """The output-coordinate step per unit input step; negative walks backward, zero repeats `offset`.""" + + def to_json(self) -> OutputIndexMapJSON: + """Convert to the canonical wire form: the `single_input_dimension` map. + + Examples + -------- + >>> DimensionMap(input_dimension=1, offset=0, stride=2).to_json() + {'offset': 0, 'stride': 2, 'input_dimension': 1} + """ + return { + "offset": self.offset, + "stride": self.stride, + "input_dimension": self.input_dimension, + } @dataclass(frozen=True, slots=True) class ArrayMap: - """An explicit enumeration of storage coordinates. + """An explicit ordered, duplicate-preserving coordinate mapping. - Represents `{offset + stride * index_array[i] : i in input_range}`. - Arises from fancy indexing (e.g., `arr[[1, 5, 9]]` or boolean masks). + Maps each input position `i` to `offset + stride * index_array[i]`. + Index-array order and repeated entries are semantic and remain present in + the result. Arises from fancy indexing (e.g., `arr[[5, 1, 1]]` or boolean + masks). Freshly constructed maps are normalized to the **full input rank** of their enclosing transform: `index_array` has the enclosing domain's rank, sized fully on the axes it varies over and singleton (size 1) elsewhere. The - dependency axes are therefore derivable from the shape (see - `transform._array_map_dependency_axes`), which distinguishes the two flavours - of multi-array fancy indexing: + shape is the single source of truth for what the map depends on — its + **dependency axes** are exactly its non-singleton axes (see + `_array_map_dependency_axes`) — and it distinguishes the two + flavors of multi-array fancy indexing: - **orthogonal** (`oindex`): each array varies along a single, *distinct* axis (all others singleton); the result is their outer product. - **vectorized** (`vindex`): the arrays are correlated and share the same non-singleton (broadcast) axes; the result is a pointwise scatter. - `input_dimension` records the single axis an orthogonal array varies over - (`None` for vectorized), binding it the way `DimensionMap` is bound. It is - usually redundant with the shape-derived classifier, but stays authoritative - for the shapes the classifier cannot distinguish: a length-1 orthogonal - selection normalizes to an all-singleton array (no non-singleton axis), and - length-1 vectorized arrays are equally degenerate. `None` therefore marks a - map as correlated, and an integer pins the dependency axis of a degenerate - orthogonal map (see `transform._array_map_dependent_axis`). + A map holding exactly one coordinate carries no shape to read a dependency + from, and none is needed: it is the `ConstantMap` it equals, and the + selection layer builds that instead (see `array_map_or_constant`). A + hand-built all-singleton `ArrayMap` is still a valid value; resolution + classifies it with the correlated maps and reads it pointwise. + + Examples + -------- + The fancy selection `arr[[5, 1, 1]]` reads coordinate 5, then 1, then 1 + — order and the duplicate preserved, exactly as NumPy fancy indexing: + + >>> m = ArrayMap(index_array=np.array([5, 1, 1])) + >>> [m.offset + m.stride * c for c in m.index_array.tolist()] + [5, 1, 1] + >>> np.arange(10)[[5, 1, 1]].tolist() + [5, 1, 1] """ - index_array: npt.NDArray[np.intp] + index_array: npt.NDArray[np.integer[Any]] + """Explicit coordinates at the enclosing transform's full input rank; order and + duplicates are semantic. Its non-singleton axes are the map's dependency axes.""" + offset: int = 0 + """Constant term of the affine adjustment: the output coordinate is `offset + stride * index_array[i]`.""" + stride: int = 1 - input_dimension: int | None = None + """Multiplier applied to each `index_array` value before `offset` is added.""" + + def __post_init__(self) -> None: + """Own the index array and expose it read-only. + + A map is frozen, but the array inside it was not: reaching through a + view's transform to `index_array[0] = 9` silently changed what the view + returned, in a package whose whole contract is that a view is a + description of a read and resolving it twice answers alike. Owning the + array also prevents the caller from changing the contents behind the + read-only view, which would invalidate this value object's hash. + """ + # Immutable bytes are the ultimate owner so callers cannot re-enable + # the WRITEABLE flag, as they can on a read-only array that owns its + # allocation. `asarray` also accepts the NumPy scalars that reach here + # after indexing an array down to one element. + array = np.asarray(self.index_array) + if not np.issubdtype(array.dtype, np.integer): + raise TypeError(f"index_array must have an integer dtype, got {array.dtype}") + normalized = checked_affine(0, 1, array) + frozen = np.frombuffer(normalized.tobytes(), dtype=np.intp).reshape(normalized.shape) + object.__setattr__(self, "index_array", frozen) + + def __reduce__(self) -> tuple[object, tuple[object, int, int]]: + """Reconstruct through `__init__`, preserving the ownership invariant.""" + return ( + type(self), + (self.index_array, self.offset, self.stride), + ) + + def __eq__(self, other: object) -> bool: + """Value equality, comparing index arrays element-wise. + + The generated `__eq__` compares them with `==`, whose result for two + arrays is an array — so asking whether two maps are equal raised + `ValueError: the truth value of an array ... is ambiguous`. `frozen=True` + reads as a promise that a value can be compared and hashed, and this is + what makes good on it. + """ + if not isinstance(other, ArrayMap): + return NotImplemented + return ( + self.offset == other.offset + and self.stride == other.stride + and self.index_array.shape == other.index_array.shape + and bool(np.array_equal(self.index_array, other.index_array)) + ) + + def __hash__(self) -> int: + """Hashed by the array's contents, so equal maps hash alike. + + The generated `__hash__` hashed the ndarray itself, which is unhashable; + a map could therefore not go in a set, or key a cache. + """ + return hash( + ( + self.offset, + self.stride, + self.index_array.shape, + self.index_array.tobytes(), + ) + ) + + @property + def dependency_axes(self) -> tuple[int, ...]: + """Every input axis this map varies over: its non-singleton axes. + + One axis means orthogonal, several mean correlated, and none means + the map is degenerate — the shape is the single source of truth for + all three. + + Examples + -------- + >>> ArrayMap(index_array=np.array([[4, 0, 2]])).dependency_axes + (1,) + >>> ArrayMap(index_array=np.array([[1, 2], [3, 4]])).dependency_axes + (0, 1) + """ + return _array_map_dependency_axes(self.index_array) + + @property + def dependent_axis(self) -> int | None: + """Return the single input axis an orthogonal `ArrayMap` varies over. + + This is the array's one non-singleton axis, read from the shape — the + single source of truth for what a map depends on. The selection layer + collapses a single-coordinate map to a `ConstantMap` + (`array_map_or_constant`), so a non-empty map built by this package always + has at least one dependency axis. + + Returns + ------- + int or None + The axis the map varies over, or `None` when it varies over no input + axis at all — an empty map, or a hand-built all-singleton one. `None` + is a valid result, not an error; such maps resolve through the + pointwise (general) path. + + Raises + ------ + ValueError + If the map varies over more than one axis, which makes it correlated + rather than orthogonal. + + Examples + -------- + An `oindex` selection on axis 1 of a rank-2 transform stores its + coordinates full-sized on axis 1 and singleton on axis 0, so the + dependency axis is read straight off the shape: + + >>> m = ArrayMap(index_array=np.array([[4, 0, 2]])) + >>> m.index_array.shape + (1, 3) + >>> m.dependent_axis + 1 + """ + dep = self.dependency_axes + if len(dep) == 1: + return dep[0] + if len(dep) == 0: + return None + raise ValueError( + f"orthogonal ArrayMap must vary over exactly one axis; got dependency axes {dep}" + ) + + def to_json(self) -> OutputIndexMapJSON: + """Convert to the canonical wire form, collapsing a degenerate map. + + A map holding exactly one coordinate, or none at all, is emitted as a + `constant` map — see the module note on the wire format in + [`zarr_indexing.json`][zarr_indexing.json]. Both are degenerate: the + first selects one coordinate whatever the input, and the second names + no cell and can only be empty because an input dimension is, so the + emptiness travels in the domain instead. + + Examples + -------- + >>> ArrayMap(np.array([[4], [1], [1]])).to_json()["index_array"] + [[4], [1], [1]] + >>> ArrayMap(np.array([7])).to_json() # degenerate: one coordinate + {'offset': 7} + """ + if self.index_array.size == 1: + value = int(self.index_array.reshape(-1)[0]) + return {"offset": self.offset + self.stride * value} + if self.index_array.size == 0: + return {"offset": 0} + return { + "offset": self.offset, + "stride": self.stride, + "index_array": self.index_array.tolist(), + "index_array_bounds": ["-inf", "+inf"], + } + + +def output_index_map_from_json(data: OutputIndexMapJSON) -> OutputIndexMap: + """Construct the output map a canonical wire form names. + + The wire form is a tagged union — `index_array`, then `input_dimension`, + else constant — so loading it dispatches to the right kind here rather + than on any one of them. + + Examples + -------- + >>> output_index_map_from_json({"offset": 5}) + ConstantMap(offset=5) + >>> output_index_map_from_json({"offset": 0, "stride": 2, "input_dimension": 1}) + DimensionMap(input_dimension=1, offset=0, stride=2) + """ + from zarr_indexing._wire import lower_index_array + + if "index_array" in data: + return ArrayMap( + index_array=lower_index_array(data["index_array"], "index_array"), + offset=data.get("offset", 0), + stride=data.get("stride", 1), + ) + if "input_dimension" in data: + return DimensionMap( + input_dimension=data["input_dimension"], + offset=data.get("offset", 0), + stride=data.get("stride", 1), + ) + return ConstantMap(offset=data.get("offset", 0)) + + +def array_map_or_constant( + index_array: npt.NDArray[np.integer[Any]], + offset: int = 0, + stride: int = 1, +) -> ArrayMap | ConstantMap: + """An `ArrayMap`, collapsed to the `ConstantMap` it equals when it can be. + + An index array holding exactly one coordinate maps every input cell to the + same place; representing it as a lookup table would leave a map whose shape + names no dependency axis, the one form the shape-derived classifier cannot + read. The selection and composition layers build their array maps through + this helper so that a non-empty `ArrayMap` always varies over at least one + axis. An empty array stays an `ArrayMap`: it maps no cell at all, and the + emptiness lives in the domain that accompanies it. + """ + arr = np.asarray(index_array) + if arr.size == 1: + return ConstantMap(offset=checked_affine(offset, stride, int(arr.reshape(-1)[0]))) + return ArrayMap(index_array=arr, offset=offset, stride=stride) OutputIndexMap = ConstantMap | DimensionMap | ArrayMap diff --git a/packages/zarr-indexing/src/zarr_indexing/reader.py b/packages/zarr-indexing/src/zarr_indexing/reader.py new file mode 100644 index 0000000000..8d47d51d21 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/reader.py @@ -0,0 +1,585 @@ +"""Backend reader protocol and built-in system-memory implementations.""" + +from __future__ import annotations + +import math +from dataclasses import dataclass +from typing import TYPE_CHECKING, Any, Final, Protocol + +if TYPE_CHECKING: + from collections.abc import Callable + +import numpy as np + +from zarr_indexing._affine import checked_affine +from zarr_indexing.chunk_resolution import ChunkProjection # noqa: TC001 (runtime annotation) +from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap, OutputIndexMap +from zarr_indexing.transform import ( + IndexTransform, +) + +__all__ = [ + "BasicReader", + "NumPyReader", + "ReadContext", + "Reader", + "UnitStepReader", + "basic_reader", + "numpy_reader", + "unit_step_reader", +] + + +@dataclass(frozen=True, slots=True) +class ReadContext: + """A source-global transform and optional projection for a partitioned read. + + Examples + -------- + >>> transform = IndexTransform.from_shape((6,))[1:5:2] + >>> context = ReadContext(transform) + >>> context.transform.domain.shape + (2,) + >>> context.projection is None + True + """ + + transform: IndexTransform + """Maps zero-origin output-buffer coordinates to global coordinates in the source.""" + + projection: ChunkProjection | None = None + """The partition plan when this read is one part of a partitioned view, else `None`.""" + + +class Reader(Protocol): + """Backend adapter that fills supplied system-memory result buffers. + + A reader may be shared by every view and part derived from one + [`LazyArray`][zarr_indexing.lazy_array.LazyArray]. Part reads may run + concurrently, so a stateful implementation must synchronize its own + mutable state. `LazyArray` deliberately adds no serialization. + + Examples + -------- + The protocol is not `runtime_checkable`; an object satisfies it by + exposing a conforming `read_into`, as `basic_reader` does: + + >>> transform = IndexTransform.from_shape((6,))[1:5:2] + >>> source = np.arange(6) + >>> out = np.empty(transform.domain.shape, dtype=source.dtype) + >>> basic_reader.read_into(source, ReadContext(transform), out) + >>> out.tolist() + [1, 3] + """ + + def read_into( + self, + source: Any, + context: ReadContext, + out: np.ndarray[Any, Any], + /, + ) -> None: + """Fill `out` with the exact source values selected by `context`. + + `context.transform` maps zero-origin coordinates in the output buffer + to global coordinates in `source`, and its domain shape equals + `out.shape`. `context.projection`, when present, is the corresponding + partition plan: its `chunk_transform` is chunk-local, its + `cell_transform` describes result placement, and its `chunk_domain` + describes the grid cell. Fill every cell in place, preserving the + transform's exact values, order, and dtype, then return `None`. Do not + replace or retain `out`; it may be a strided writable view rather than + an owning array. + + Backend exceptions propagate unchanged. Because callers may resolve + parts concurrently through the same reader object, stateful readers + are responsible for synchronizing their own state. + """ + ... + + +class BasicReader: + """Reader for system-memory sources exposing basic integer/slice indexing. + + Each transform is decomposed into the smallest enclosing positive-slice + slab and a residual transform. The slab is read once with basic indexing, + so fancy or negative-step selections may over-read, and the residual is + then lowered through NumPy system-memory operations into the supplied + buffer. + + Slice results must permit conversion to NumPy system memory. Device arrays + that reject implicit conversion require a custom reader responsible for + transferring values into the supplied system-memory output buffer. + + Examples + -------- + >>> transform = IndexTransform.from_shape((6,))[1:5:2] + >>> source = np.arange(6) + >>> out = np.empty(transform.domain.shape, dtype=source.dtype) + >>> BasicReader().read_into(source, ReadContext(transform), out) + >>> out.tolist() == source[1:5:2].tolist() + True + """ + + __slots__ = () + + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> None: + """Read one transform through a positive-slice slab and residual lowering.""" + transform = context.transform + key, residual = _decompose_basic(transform) + block = np.asanyarray(source[key]) + out[...] = _lower(block, residual) + + +class NumPyReader: + """Reader optimized for NumPy system-memory arrays. + + This is the reader selected by + [`LazyArray.from_numpy`][zarr_indexing.lazy_array.LazyArray.from_numpy]. It + applies the complete transform with NumPy operations and is applicable to + `numpy.ndarray` sources, including `numpy.ma.MaskedArray`. + + Examples + -------- + >>> transform = IndexTransform.from_shape((3, 4))[::2, 1:3] + >>> source = np.arange(12).reshape(3, 4) + >>> out = np.empty(transform.domain.shape, dtype=source.dtype) + >>> NumPyReader().read_into(source, ReadContext(transform), out) + >>> out.tolist() + [[1, 2], [9, 10]] + """ + + __slots__ = () + + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> None: + """Read one transform through a narrowed slab into `out`.""" + transform = context.transform + key, residual = _decompose_basic(transform) + block = np.asanyarray(source[key]) + out[...] = _lower(block, residual) + + +class UnitStepReader: + """Reader for sources whose basic indexing accepts only step-1 slices. + + Each transform is decomposed into the smallest enclosing ascending + unit-step slab and a residual transform, so the source only ever receives + `slice(start, stop, 1)` on every axis — the one form an API without + general strided reads (an FFI binding, an HTTP range endpoint) supports. + `BasicReader` instead pushes strided and reversed slices down, which + reads less but asks more of the source. + + The residual lowering applies strides, reversals, and gathers to the + in-memory block, so a strided selection over-reads its cover by the + stride factor. Partitioning the wrapping + [`LazyArray`][zarr_indexing.lazy_array.LazyArray] (`with_parts`) bounds + each cover by a part. + + Slice results must permit conversion to NumPy system memory, exactly as + for `BasicReader`. + + Examples + -------- + The source below is only ever asked for step-1 slices — here the cover + `slice(1, 4, 1)` — and the stride is replayed against the block: + + >>> transform = IndexTransform.from_shape((6,))[1:5:2] + >>> source = np.arange(6) + >>> out = np.empty(transform.domain.shape, dtype=source.dtype) + >>> UnitStepReader().read_into(source, ReadContext(transform), out) + >>> out.tolist() + [1, 3] + """ + + __slots__ = () + + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> None: + """Read one transform through an ascending unit-step slab into `out`.""" + transform = context.transform + key, residual = _decompose_unit_step(transform) + block = np.asanyarray(source[key]) + out[...] = _lower(block, residual) + + +basic_reader: Final = BasicReader() +numpy_reader: Final = NumPyReader() +unit_step_reader: Final = UnitStepReader() + + +def _take(array: Any, indices: np.ndarray[Any, np.dtype[np.intp]], axis: int) -> Any: + return np.take(array, indices, axis=axis) + + +def _reshape(array: Any, shape: tuple[int, ...]) -> Any: + return np.reshape(array, shape) + + +def _transpose(array: Any, permutation: tuple[int, ...]) -> Any: + return np.transpose(array, permutation) + + +def _expand_dims(array: Any, axis: int) -> Any: + return np.expand_dims(array, axis) + + +def _dimension_map_coords( + m: DimensionMap, transform: IndexTransform +) -> np.ndarray[Any, np.dtype[np.intp]]: + """The storage coordinates a DimensionMap enumerates, in view order.""" + d = m.input_dimension + lo = transform.domain.inclusive_min[d] + hi = transform.domain.exclusive_max[d] + extent = hi - lo + if extent == 0: + return np.empty((0,), dtype=np.intp) + first = checked_affine(m.offset, m.stride, lo) + return checked_affine(first, m.stride, np.arange(extent, dtype=np.intp)) + + +def _array_map_coords(m: ArrayMap) -> np.ndarray[Any, np.dtype[np.intp]]: + """The storage coordinates an ArrayMap enumerates, flattened.""" + return checked_affine(m.offset, m.stride, m.index_array).reshape(-1) + + +def _correlated_map_coords( + m: ArrayMap, broadcast_axes: list[int], broadcast_shape: tuple[int, ...], input_rank: int +) -> np.ndarray[Any, np.dtype[np.intp]]: + """One storage coordinate per point of the correlated block, flattened. + + A correlated `ArrayMap`'s index array carries the transform's full input + rank, with a singleton on every axis it does not vary over — including + broadcast axes it shares with the *other* correlated maps but is itself + constant along. Flattening it directly would then yield fewer coordinates + than there are points, so it is reduced to the broadcast block and + broadcast up to it explicitly. + """ + coords = checked_affine(m.offset, m.stride, m.index_array) + if math.prod(broadcast_shape) == 0: + # A zero-extent broadcast axis makes the correlated block empty — for + # example an ArrayMap composed over an empty domain, which the package + # promises resolves like any other. The per-axis reshape below cannot + # express that block (a 0-size array does not reshape to the non-zero + # singleton axes), and there is no coordinate to produce anyway. + return np.empty(0, dtype=np.intp) + if coords.ndim == input_rank: + # Drop the axes bound by a slice, which the map is singleton along. + # Removing size-1 axes by reshape preserves element order wherever they + # sit, so no transpose is needed. + coords = coords.reshape(tuple(coords.shape[axis] for axis in broadcast_axes)) + return np.ascontiguousarray(np.broadcast_to(coords, broadcast_shape)).reshape(-1) + + +def _restore_domain_axis_order( + result: Any, axis_input_dims: list[int], domain_shape: tuple[int, ...] +) -> Any: + """Permute `result`'s axes into input-domain order, restoring dropped axes. + + `axis_input_dims[k]` is the input (domain) dimension that axis `k` of + `result` corresponds to. Axes are permuted so that they appear in increasing + domain-dimension order, and any domain dimension no output map depends on is + reinserted at **its own extent**. + + An unreferenced dimension is not always a singleton. A `vindex` coordinate + array with a broadcast axis it does not vary over leaves that axis in the + domain; a later basic index that consumes the axis the array *does* vary + over collapses the map to a `ConstantMap` and leaves the broadcast axis + behind, with whatever extent the basic index gave it — including 0. Every + position along such an axis holds the same values, so it is restored by + repeating the block, and an extent of 0 restores an empty result rather than + fabricating a row. + + This is also where NumPy's advanced-index placement rules are absorbed: + whatever order the gather produced, the lowered result always comes back in + the view's own axis order. + """ + if len(set(axis_input_dims)) != len(axis_input_dims): + raise NotImplementedError( + "resolving a transform whose output maps share an input dimension " + "(a diagonal view) is not supported" + ) + order = sorted(range(len(axis_input_dims)), key=lambda k: axis_input_dims[k]) + if order != list(range(len(order))): + result = _transpose(result, tuple(order)) + covered = set(axis_input_dims) + for dim, extent in enumerate(domain_shape): + if dim in covered: + continue + result = _expand_dims(result, dim) + if extent != 1: + result = _take(result, np.zeros(extent, dtype=np.intp), axis=dim) + return result + + +def _lower(array: Any, transform: IndexTransform) -> Any: + """Lower a transform to one pass of array operations over `array`. + + Every read, partitioned or not, goes through this function. The result is + always in the transform's own domain axis order and of exactly its domain + shape. + """ + if math.prod(transform.domain.shape) == 0: + # An empty domain selects nothing, and its maps may legitimately be + # empty along the vanished axes (an ArrayMap composed over an empty + # domain, which the package promises resolves like any other). The + # resolvers below cannot evaluate such maps — and have no reason to. + return np.empty(transform.domain.shape, dtype=np.asanyarray(array).dtype) + if transform.index_array_structure == "general": + result = _lower_general(array, transform) + else: + result = _lower_orthogonal(array, transform) + if isinstance(result, np.generic): + # Basic indexing every axis of a NumPy array yields a scalar; `result()` + # documents a zero-dimensional array. + return np.asarray(result) + return result + + +def _lower_orthogonal(array: Any, transform: IndexTransform) -> Any: + """Basic slicing plus one `take` per fancy-indexed axis (an outer product). + + Orthogonal `ArrayMap`s vary over distinct input axes, so gathering them one + axis at a time is exact — a `take` along one storage axis leaves every other + axis's coordinates untouched. + """ + outputs = transform.output + gathered: dict[int, np.ndarray[Any, np.dtype[np.intp]]] = {} + for out_dim, m in enumerate(outputs): + if isinstance(m, ArrayMap): + gathered[out_dim] = _array_map_coords(m) + elif isinstance(m, DimensionMap) and m.stride <= 0: + # Reversing and repeating maps have no positive-step slice; gather them. + gathered[out_dim] = _dimension_map_coords(m, transform) + + result = array + for out_dim, coords in gathered.items(): + result = _take(result, coords, axis=out_dim) + + selection: list[Any] = [] + axis_input_dims: list[int] = [] + for out_dim, m in enumerate(outputs): + if isinstance(m, ConstantMap): + selection.append(m.offset) + continue + if out_dim in gathered: + selection.append(slice(None)) + else: + assert isinstance(m, DimensionMap) + d = m.input_dimension + lo = transform.domain.inclusive_min[d] + hi = transform.domain.exclusive_max[d] + selection.append(slice(m.offset + m.stride * lo, m.offset + m.stride * hi, m.stride)) + if isinstance(m, ArrayMap): + axis = m.dependent_axis + if axis is None: + raise NotImplementedError( + "resolving an orthogonal ArrayMap that varies over no input " + "dimension is not supported; such a map should have been " + "collapsed to a ConstantMap" + ) + axis_input_dims.append(axis) + else: + axis_input_dims.append(m.input_dimension) + result = result[tuple(selection)] + return _restore_domain_axis_order(result, axis_input_dims, transform.domain.shape) + + +def _lower_general(array: Any, transform: IndexTransform) -> Any: + """Flatten the index-array axes, gather the points once, reshape back. + + The general path for every index-array structure the orthogonal resolver + cannot take: correlated (`vindex`) maps, maps sharing an input axis (a + diagonal gather), and mixtures of correlated and orthogonal maps. All + index arrays are treated as lookup tables over the joint block of + non-slice axes: the corresponding storage axes are moved to the front and + flattened, the per-point coordinates are converted to offsets into that + flat axis with row-major strides, and a single `take` collects them. + """ + outputs = transform.output + correlated_dims = [d for d, m in enumerate(outputs) if isinstance(m, ArrayMap)] + + slice_input_dims = {m.input_dimension for m in outputs if isinstance(m, DimensionMap)} + broadcast_axes = [d for d in range(transform.input_rank) if d not in slice_input_dims] + broadcast_shape = tuple(transform.domain.shape[d] for d in broadcast_axes) + + for d in correlated_dims: + arr_map = outputs[d] + assert isinstance(arr_map, ArrayMap) + # The axes the array varies over (its non-singleton axes; see + # transform._array_map_dependency_axes) must all live in the block. + dependency = (axis for axis, size in enumerate(arr_map.index_array.shape) if size > 1) + if any(a not in broadcast_axes for a in dependency): + # Reachable only by hand-building a transform: no selection binds + # the same input axis to both a slice map and an index array. + raise NotImplementedError( + "resolving a transform whose index array varies over an input " + "dimension also bound by a slice map is not supported" + ) + + # Gather any reversing or repeating slice axis first, then take the basic-slice + # cut. The correlated axes keep their full extent: their coordinates are absolute. + gathered: dict[int, np.ndarray[Any, np.dtype[np.intp]]] = { + d: _dimension_map_coords(m, transform) + for d, m in enumerate(outputs) + if isinstance(m, DimensionMap) and m.stride <= 0 + } + result = array + for out_dim, coords in gathered.items(): + result = _take(result, coords, axis=out_dim) + + selection: list[Any] = [] + residual_axis_dims: list[int] = [] + correlated_positions: list[int] = [] + residual_positions: list[int] = [] + axis = 0 + for out_dim, m in enumerate(outputs): + if isinstance(m, ConstantMap): + selection.append(m.offset) + continue + if out_dim in correlated_dims: + selection.append(slice(None)) + correlated_positions.append(axis) + elif out_dim in gathered: + selection.append(slice(None)) + residual_positions.append(axis) + assert isinstance(m, DimensionMap) + residual_axis_dims.append(m.input_dimension) + else: + assert isinstance(m, DimensionMap) + d = m.input_dimension + lo = transform.domain.inclusive_min[d] + hi = transform.domain.exclusive_max[d] + selection.append(slice(m.offset + m.stride * lo, m.offset + m.stride * hi, m.stride)) + residual_positions.append(axis) + residual_axis_dims.append(d) + axis += 1 + result = result[tuple(selection)] + + # Correlated axes to the front, in output order, so the flattening strides + # below match the order the coordinates are combined in. + perm = tuple(correlated_positions) + tuple(residual_positions) + if perm != tuple(range(len(perm))): + result = _transpose(result, perm) + + n_corr = len(correlated_dims) + corr_sizes = tuple(int(s) for s in result.shape[:n_corr]) + tail_shape = tuple(int(s) for s in result.shape[n_corr:]) + result = _reshape(result, (math.prod(corr_sizes), *tail_shape)) + + flat_index = np.zeros(math.prod(broadcast_shape), dtype=np.intp) + stride = 1 + for position in range(n_corr - 1, -1, -1): + m = outputs[correlated_dims[position]] + assert isinstance(m, ArrayMap) + flat_index = flat_index + ( + _correlated_map_coords(m, broadcast_axes, broadcast_shape, transform.input_rank) + * stride + ) + stride *= corr_sizes[position] + + result = _take(result, flat_index, axis=0) + result = _reshape(result, broadcast_shape + tail_shape) + return _restore_domain_axis_order( + result, list(broadcast_axes) + residual_axis_dims, transform.domain.shape + ) + + +def _push_slice_for_dimension_map( + m: DimensionMap, transform: IndexTransform +) -> tuple[slice, DimensionMap]: + """The positive-step slice covering a `DimensionMap`, and its block-local map. + + A negative step is read forwards and reversed by the residual: a source is + only ever asked for a slice that walks upwards, which is the one form every + array-like agrees on. + """ + d = m.input_dimension + lo = transform.domain.inclusive_min[d] + hi = max(transform.domain.exclusive_max[d], lo) + if hi == lo: + return slice(0, 0, 1), DimensionMap(input_dimension=d, offset=-lo, stride=1) + first = checked_affine(m.offset, m.stride, lo) + last = checked_affine(m.offset, m.stride, hi - 1) + if m.stride > 0: + return ( + slice(first, last + 1, m.stride), + DimensionMap(input_dimension=d, offset=-lo, stride=1), + ) + if m.stride == 0: + return ( + slice(first, first + 1, 1), + DimensionMap(input_dimension=d, offset=0, stride=0), + ) + # Descending: the block holds the same coordinates in ascending order, so + # the residual walks it backwards from the last block position. + return ( + slice(last, first + 1, -m.stride), + DimensionMap(input_dimension=d, offset=hi - 1, stride=-1), + ) + + +def _push_unit_slice_for_dimension_map( + m: DimensionMap, transform: IndexTransform +) -> tuple[slice, DimensionMap]: + """The unit-step slice covering a `DimensionMap`, and its block-local map. + + Strides and reversals stay in the residual: the source is only ever asked + for a contiguous ascending slice, and the original stride is replayed + against the in-memory block. The cover therefore over-reads a strided + selection by its stride factor, which is the price of a source that + accepts nothing but `slice(start, stop, 1)`. + """ + d = m.input_dimension + lo = transform.domain.inclusive_min[d] + hi = max(transform.domain.exclusive_max[d], lo) + if hi == lo: + return slice(0, 0, 1), DimensionMap(input_dimension=d, offset=-lo, stride=1) + first = checked_affine(m.offset, m.stride, lo) + if m.stride == 0: + return ( + slice(first, first + 1, 1), + DimensionMap(input_dimension=d, offset=0, stride=0), + ) + last = checked_affine(m.offset, m.stride, hi - 1) + origin = min(first, last) + return ( + slice(origin, max(first, last) + 1, 1), + DimensionMap(input_dimension=d, offset=m.offset - origin, stride=m.stride), + ) + + +def _decompose_basic(transform: IndexTransform) -> tuple[tuple[slice, ...], IndexTransform]: + return _decompose(transform, _push_slice_for_dimension_map) + + +def _decompose_unit_step(transform: IndexTransform) -> tuple[tuple[slice, ...], IndexTransform]: + return _decompose(transform, _push_unit_slice_for_dimension_map) + + +def _decompose( + transform: IndexTransform, + push_dimension_map: Callable[[DimensionMap, IndexTransform], tuple[slice, DimensionMap]], +) -> tuple[tuple[slice, ...], IndexTransform]: + key: list[slice] = [] + residual: list[OutputIndexMap] = [] + for output_map in transform.output: + if isinstance(output_map, ConstantMap): + coordinate = checked_affine(output_map.offset, 0, 0) + key.append(slice(coordinate, coordinate + 1, 1)) + residual.append(ConstantMap(offset=0)) + elif isinstance(output_map, DimensionMap): + pushed, local = push_dimension_map(output_map, transform) + key.append(pushed) + residual.append(local) + else: + coordinates = checked_affine( + output_map.offset, output_map.stride, output_map.index_array + ) + if coordinates.size == 0: + key.append(slice(0, 0, 1)) + local_index = coordinates + else: + origin = int(coordinates.min()) + key.append(slice(origin, int(coordinates.max()) + 1, 1)) + local_index = checked_affine(-origin, 1, coordinates) + residual.append(ArrayMap(index_array=local_index)) + return tuple(key), IndexTransform(domain=transform.domain, output=tuple(residual)) diff --git a/packages/zarr-indexing/src/zarr_indexing/testing/__init__.py b/packages/zarr-indexing/src/zarr_indexing/testing/__init__.py new file mode 100644 index 0000000000..e98d051900 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/testing/__init__.py @@ -0,0 +1,57 @@ +"""Test support for projects whose arrays are read through `LazyArray`. + +A Hypothesis state machine that composes indexing steps onto a `LazyArray` +wrapping your array and checks every step against NumPy +([`stateful`][zarr_indexing.testing.stateful]), and the selection strategies it +draws from, exported on their own for a project that has its own harness +([`strategies`][zarr_indexing.testing.strategies]). + +```python +from zarr_indexing.testing import ChainedIndexingStateMachine, state_machine_test + +class MyArrayIndexing(ChainedIndexingStateMachine): + def make_source(self, data): + array = my_format.create(shape=data.shape, dtype=data.dtype) + array[:] = data + return array + +TestMyArrayIndexing = state_machine_test(MyArrayIndexing) +``` + +This subpackage needs `hypothesis`, which the rest of `zarr_indexing` does not: +install it with the `testing` extra (`pip install zarr-indexing[testing]`). +""" + +from zarr_indexing.testing.stateful import ( + DEFAULT_DATA, + DEFAULT_PARTITIONINGS, + DEFAULT_SETTINGS, + ChainedIndexingStateMachine, + apply_selection, + outer_selection, + repartition, + state_machine_test, +) +from zarr_indexing.testing.strategies import ( + basic_selections, + masks, + orthogonal_selections, + slice_selections, + vectorized_selections, +) + +__all__ = [ + "DEFAULT_DATA", + "DEFAULT_PARTITIONINGS", + "DEFAULT_SETTINGS", + "ChainedIndexingStateMachine", + "apply_selection", + "basic_selections", + "masks", + "orthogonal_selections", + "outer_selection", + "repartition", + "slice_selections", + "state_machine_test", + "vectorized_selections", +] diff --git a/packages/zarr-indexing/src/zarr_indexing/testing/stateful.py b/packages/zarr-indexing/src/zarr_indexing/testing/stateful.py new file mode 100644 index 0000000000..4458d7922a --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/testing/stateful.py @@ -0,0 +1,380 @@ +"""A stateful property test for indexing an array through `LazyArray`. + +`ChainedIndexingStateMachine` composes indexing steps onto a `LazyArray` +wrapping *your* array — `lazy[...]`, `lazy.oindex[...]`, `lazy.vindex[...]`, +each step applied to the view the last one produced — while applying the same +steps to a NumPy array holding the same values. After every step the view must +still agree with that model three ways: its shape, its `result()`, and the +assembly of its `parts()`. + +Point it at an array by subclassing and overriding `make_source`: + +```python +from zarr_indexing.testing import ChainedIndexingStateMachine, state_machine_test + +class MyArrayIndexing(ChainedIndexingStateMachine): + def make_source(self, data): + array = my_format.create(shape=data.shape, dtype=data.dtype) + array[:] = data + return array + +TestMyArrayIndexing = state_machine_test(MyArrayIndexing) +``` + +`data`, `partitionings`, and `readers` are class attributes; override any of +them to widen or narrow what is drawn. The base class needs no `make_source` at +all — left alone it wraps the NumPy array itself, which is a useful smoke test +of this package but says nothing about yours. + +What it is checking +------------------- +The parts invariant is the one with teeth. +[`Partition`][zarr_indexing.lazy_array.Partition] documents +`out[part.out_selection] = part.view.result()` as the assembly procedure, so +this checks that literally: a part's values must arrive at exactly the shape its +`out_selection` addresses — not merely a shape that broadcasts into it — land +there, and cover the view once. Checking through `result()` alone would prove +only that `result()` is self-consistent. + +The `choose_reader` rule draws a reader and applies it to the view, so the +execution strategy becomes part of the chain. Every reader listed by a subclass +must preserve the NumPy model for its source. The universal `basic_reader` is +always exercised, even when a subclass lists only specialized readers; with no +declared readers it is the sole strategy drawn. + +Requires the `testing` extra (`pip install zarr-indexing[testing]`). +""" + +from __future__ import annotations + +import math +from collections.abc import Sequence +from typing import TYPE_CHECKING, Any, ClassVar + +import numpy as np +from hypothesis import HealthCheck, settings +from hypothesis import strategies as st +from hypothesis.stateful import RuleBasedStateMachine, initialize, invariant, precondition, rule + +from zarr_indexing.lazy_array import LazyArray +from zarr_indexing.reader import Reader, basic_reader +from zarr_indexing.testing.strategies import ( + basic_selections, + orthogonal_selections, + slice_selections, + vectorized_selections, +) + +if TYPE_CHECKING: + from zarr_indexing.boundary import SelectionMode + +__all__ = [ + "DEFAULT_DATA", + "DEFAULT_PARTITIONINGS", + "DEFAULT_SETTINGS", + "ChainedIndexingStateMachine", + "apply_selection", + "outer_selection", + "repartition", + "state_machine_test", +] + +DEFAULT_DATA = np.arange(7 * 5 * 4, dtype=np.int64).reshape(7, 5, 4) +"""The values the source holds by default: distinct, so a misplaced cell shows.""" + +DEFAULT_PARTITIONINGS: tuple[Any, ...] = ( + None, + (2, 2, 2), + (7, 5, 4), + (3, 2, 3), + ((3, 3, 1), (2, 2, 1), (3, 1)), + (4, 3, 3), +) +"""Partitionings to read under: a single whole-array part, uniform boxes of +several shapes (some of which do not divide the extent), and explicit per-axis +sizes. Boxes that straddle whatever the source declares are deliberate — they +cost extra I/O but must not change an answer.""" + +DEFAULT_SETTINGS = settings( + max_examples=250, + stateful_step_count=10, + deadline=None, + suppress_health_check=[ + HealthCheck.data_too_large, + HealthCheck.filter_too_much, + HealthCheck.too_slow, + ], +) +"""Enough examples to find a defect reachable only through a narrow chain, at a +few seconds per run when there is nothing to find. Every step is followed by +checks that each materialize the whole view, so the budget buys examples rather +than long chains — a chain runs out of axes to index within a few steps anyway. + +`filter_too_much` is suppressed because a chain that reaches a rank-0 view +leaves only `repartition` enabled, so a run that opens there is discarded.""" + + +# --------------------------------------------------------------------------- # +# The NumPy model +# --------------------------------------------------------------------------- # + + +def outer_selection(array: Any, selection: Sequence[Any]) -> Any: + """Apply an orthogonal selection to a NumPy array: the outer product of its axes. + + NumPy has no operator for this, so the model is built from `numpy.ix_`. + Scalar integers are basic indices — NumPy applies them first and drops the + axis — so they are peeled off before the outer product is formed. + """ + + def is_scalar(sel: Any) -> bool: + return isinstance(sel, (int, np.integer)) and not isinstance(sel, bool) + + scalars = tuple(sel if is_scalar(sel) else slice(None) for sel in selection) + reduced = array[scalars] + axes = [ + np.arange(size)[sel] + for size, sel in zip(reduced.shape, [s for s in selection if not is_scalar(s)], strict=True) + ] + if len(axes) == 0: + return reduced + return reduced[np.ix_(*axes)] + + +def apply_selection(array: Any, selection: tuple[Any, ...], mode: SelectionMode) -> Any: + """Apply a selection to a NumPy array in the given mode — the model a view is checked against. + + NumPy's own semantics *are* basic and vectorized indexing, so only the + orthogonal mode needs building (see `outer_selection`). + """ + if mode == "orthogonal": + return outer_selection(array, selection) + return array[selection] + + +def state_machine_test( + machine: type[RuleBasedStateMachine], *, config: settings = DEFAULT_SETTINGS +) -> Any: + """The pytest-collectable `TestCase` for a machine, with settings applied. + + Hypothesis builds a fresh `TestCase` per state-machine class, so settings + set on a base class do not reach a subclass's; this applies them where they + land. Assign the result to a module-level name beginning with `Test`. + """ + case = machine.TestCase + case.settings = config + return case + + +def repartition(view: LazyArray, parts: Any) -> LazyArray: + """Apply one of `partitionings` to a view. + + The three partitioning spellings are three named methods, so a list holding + a mix of them needs a dispatch somewhere. Choosing among them is what a test + harness drawing from that list is doing, so it lives here rather than being + pushed back into the public API as a type-inspecting parameter. + """ + if parts is None: + return view.unpartitioned() + if any(isinstance(entry, Sequence) for entry in parts): + return view.with_parts_per_axis(parts) + return view.with_parts(parts) + + +# --------------------------------------------------------------------------- # +# The machine +# --------------------------------------------------------------------------- # + +_SOURCE = "_zarr_indexing_cached_source" + + +class ChainedIndexingStateMachine(RuleBasedStateMachine): + """Indexing steps composed onto one `LazyArray`, against NumPy as the model. + + Subclass and override `make_source` to point it at your own array. See the + module docstring for the shape of that subclass and for what the invariants + check. + + Attributes + ---------- + data + The values the source holds, and the model every step is checked + against. Any shape and dtype NumPy supports; every axis must be + non-empty. + partitionings + Drawn once per run, before any indexing: `with_parts` is a pure setter + that carries through composition untouched and is read only when a view + resolves, so choosing it up front reaches the same states choosing it + mid-chain does, and spends the whole step budget on indexing. + readers + Execution strategies `choose_reader` may draw. Every listed reader must + preserve the model for the source. `basic_reader` is always included; + `None` means the reader already carried by the constructed view. + """ + + data: ClassVar[Any] = DEFAULT_DATA + partitionings: ClassVar[Sequence[Any]] = DEFAULT_PARTITIONINGS + readers: ClassVar[Sequence[Reader] | None] = None + + def make_source(self, data: Any) -> Any: + """Build the array under test, holding `data`. + + Called once per machine class and cached, not once per example: an + example is cheap and a source may not be. The machine only ever reads, + so the same object serves every run — but it must therefore not be + mutated by anything else while the test runs. + + The default returns `data` itself, so an unsubclassed machine exercises + this package against NumPy. + """ + return data + + def __init__(self) -> None: + super().__init__() + cls = type(self) + self.model: Any = np.asarray(cls.data) + source = cls.__dict__.get(_SOURCE) + if source is None: + source = self.make_source(self.model) + setattr(cls, _SOURCE, source) + self.view = LazyArray(source) + self.reader_choices = _reader_set(self.view, cls.readers) + self.chain: list[tuple[str, Any]] = [] + + def _indexable(self) -> bool: + """Whether there is anything left to index. + + A rank-0 or empty view takes no further step — NumPy would reject one + too — so the chain ends there, and the invariants keep checking. + """ + return self.model.ndim > 0 and self.model.size > 0 + + def _step(self, mode: SelectionMode, selection: tuple[Any, ...]) -> None: + self.chain.append((mode, selection)) + self.model = apply_selection(self.model, selection, mode) + if mode == "basic": + self.view = self.view.lazy[selection] + elif mode == "orthogonal": + self.view = self.view.lazy.oindex[selection] + else: + self.view = self.view.lazy.vindex[selection] + + # -- rules -------------------------------------------------------------- + + @initialize(data=st.data()) + def choose_partitioning(self, data: st.DataObject) -> None: + """Fix how the read is broken up, before any indexing.""" + parts = data.draw(st.sampled_from(list(type(self).partitionings))) + self.view = repartition(self.view, parts) + self.chain.append(("parts", parts)) + + @precondition(lambda self: self._indexable()) + @rule(data=st.data()) + def basic(self, data: st.DataObject) -> None: + self._step("basic", data.draw(basic_selections(self.model.shape))) + + @precondition(lambda self: self._indexable()) + @rule(data=st.data()) + def orthogonal(self, data: st.DataObject) -> None: + self._step("orthogonal", data.draw(orthogonal_selections(self.model.shape))) + + @precondition(lambda self: self._indexable()) + @rule(data=st.data()) + def vectorized(self, data: st.DataObject) -> None: + self._step("vectorized", data.draw(vectorized_selections(self.model.shape))) + + @precondition(lambda self: self._indexable()) + @rule(data=st.data()) + def slices_only(self, data: st.DataObject) -> None: + """An `oindex` step carrying only slices is not a fancy selection. + + It narrows the view's own axes and composes like basic indexing. Drawn + as its own rule so that narrowing an existing index array by slices — + a distinct code path from narrowing it with coordinates — stays + exercised at full weight. + """ + self._step("orthogonal", data.draw(slice_selections(self.model.shape))) + + @rule(data=st.data()) + def choose_reader(self, data: st.DataObject) -> None: + """Read the rest of the chain through another conforming strategy.""" + reader = data.draw(st.sampled_from(list(self.reader_choices))) + self.view = self.view.with_reader(reader) + self.chain.append(("reader", type(reader).__qualname__)) + + @precondition(lambda self: not self._indexable()) + @rule(data=st.data()) + def repartition(self, data: st.DataObject) -> None: + """Re-box a chain that has run out of axes to index. + + Something must stay enabled once the view is rank-0 or empty, or + Hypothesis has no move to make and abandons the run. Re-boxing is the + useful thing to do there: it changes nothing the invariants may see, and + a rank-0 view read through every partitioning is exactly the state a + collapsed correlated selection reaches. + """ + parts = data.draw(st.sampled_from(list(type(self).partitionings))) + self.view = repartition(self.view, parts) + self.chain.append(("parts", parts)) + + # -- invariants --------------------------------------------------------- + + @invariant() + def the_view_has_the_models_shape(self) -> None: + assert self.view.shape == self.model.shape, self.chain + + @invariant() + def result_matches_the_model(self) -> None: + np.testing.assert_array_equal( + np.asarray(self.view.result()), self.model, err_msg=str(self.chain) + ) + + @invariant() + def parts_tile_the_view(self) -> None: + """The documented assembly, run literally. + + Every part's values arrive at exactly the shape its `out_selection` + addresses — not merely a shape that broadcasts into it — and together + the parts cover the view once. + """ + assembled = np.zeros(self.view.shape, dtype=self.view.dtype) + hits = np.zeros(self.view.shape, dtype=np.int64) + for part in self.view.parts(): + value = np.asarray(part.view.result()) + assert value.shape == assembled[part.out_selection].shape, ( + f"part {part.base_coords} carries {value.shape} for an out_selection " + f"addressing {assembled[part.out_selection].shape}: {self.chain}" + ) + # `is_complete` is what a consumer reads to decide it may take a + # whole-box read and skip assembling anything, so a wrongly-`True` + # one is the silent-corruption case. Asserted one way only: the flag + # is documented as conservative, free to say `False` about a part it + # does cover (a strided walk over a one-cell box, a fancy axis that + # happens to enumerate everything), and only the claim to cover + # everything has to be earned. Both quantities are already in hand + # here, and nothing else in the suite compares them. + if part.is_complete: + box_cells = math.prod(stop - start for start, stop in part.box) + assert value.size == box_cells, ( + f"part {part.base_coords} reports is_complete but carries " + f"{value.size} of its box's {box_cells} cells: {self.chain}" + ) + assembled[part.out_selection] = value + np.add.at(hits, part.out_selection, 1) + + np.testing.assert_array_equal(assembled, self.model, err_msg=str(self.chain)) + np.testing.assert_array_equal( + hits, np.ones(self.view.shape, dtype=np.int64), err_msg=str(self.chain) + ) + + +def _reader_set(view: LazyArray, declared: Sequence[Reader] | None) -> tuple[Reader, ...]: + """The readers `choose_reader` draws from, `basic_reader` always among them.""" + readers = list(declared) if declared is not None else [view.reader] + if all(reader is not basic_reader for reader in readers): + readers.insert(0, basic_reader) + unique: list[Reader] = [] + for reader in readers: + if all(reader is not existing for existing in unique): + unique.append(reader) + return tuple(unique) diff --git a/packages/zarr-indexing/src/zarr_indexing/testing/strategies.py b/packages/zarr-indexing/src/zarr_indexing/testing/strategies.py new file mode 100644 index 0000000000..63a3d351a9 --- /dev/null +++ b/packages/zarr-indexing/src/zarr_indexing/testing/strategies.py @@ -0,0 +1,207 @@ +"""Hypothesis strategies for the selections `LazyArray` accepts. + +Each strategy takes the shape of the array being indexed and generates one +selection for it — an index tuple with one entry per axis, in the spelling its +mode expects. They are the generators behind +[`ChainedIndexingStateMachine`][zarr_indexing.testing.stateful.ChainedIndexingStateMachine] +and are exported on their own for a project that has its own test harness and +wants only the hard part. + +```python +from hypothesis import given, strategies as st +from zarr_indexing.testing.strategies import basic_selections + +@given(selection=basic_selections((7, 5, 4))) +def test_my_array_slices_like_numpy(selection): + assert_array_equal(my_array[selection], reference[selection]) +``` + +Every axis of `shape` must be non-empty: a selection over an axis of extent 0 +has no coordinates to draw. Filter or narrow the shape before calling. + +Requires the `testing` extra (`pip install zarr-indexing[testing]`). +""" + +from __future__ import annotations + +import operator +from typing import TYPE_CHECKING, Any + +import numpy as np +from hypothesis import strategies as st + +if TYPE_CHECKING: + from collections.abc import Callable + +__all__ = [ + "basic_selections", + "empty_masks", + "masks", + "orthogonal_selections", + "slice_selections", + "vectorized_selections", +] + + +def _entries(shape: tuple[int, ...], entry: Callable[[int], st.SearchStrategy[Any]]) -> Any: + """One `entry` strategy per axis, as an index tuple.""" + return st.tuples(*[entry(size) for size in shape]) + + +def _basic_entry(size: int) -> st.SearchStrategy[Any]: + steps = st.integers(1, 3) + return st.one_of( + # A scalar integer drops its axis, in every mode, exactly as NumPy does. + st.integers(-size, size - 1), + st.builds(slice, st.integers(0, size), st.integers(0, size), steps), + # Downward. The start is drawn from below `-size` as well, where the walk + # begins off the front and selects nothing — a case that reads as an + # ordinary negative index but is empty — and a stop that falls off the + # front is spelled `None`. + st.builds( + slice, + st.integers(-2 * size - 1, size - 1), + st.none() | st.integers(0, size), + steps.map(operator.neg), + ), + st.just(slice(None)), + ) + + +def _orthogonal_entry(size: int) -> st.SearchStrategy[Any]: + """One axis of an `oindex` selection. + + The slices carry a step and are free to stop early. Drawing them as + `slice(start, size)` alone meant no strided or reversed slice ever reached + `oindex`, and no orthogonal selection ever stopped short of the axis end. + + An empty coordinate list is drawn too. It selects nothing, which is legal + and is exactly the shape that lost its axis on the way through JSON — but + with `min_size=1` no fancy selection was ever empty. + """ + coordinate = st.integers(-size, size - 1) + return st.one_of( + coordinate, + st.lists(coordinate, min_size=1, max_size=4), + st.just([]), + masks((size,)), + empty_masks((size,)), + st.builds( + slice, + st.integers(0, size - 1), + st.integers(0, size) | st.none(), + st.integers(1, 3) | st.integers(-3, -1), + ), + ) + + +def _slice_entry(size: int) -> st.SearchStrategy[slice]: + return st.one_of( + st.builds(slice, st.integers(0, size - 1), st.just(size), st.integers(1, 2)), + st.just(slice(None, None, -1)), + st.just(slice(None)), + ) + + +@st.composite +def masks(draw: st.DrawFn, shape: tuple[int, ...]) -> np.ndarray[Any, np.dtype[np.bool_]]: + """Boolean masks over `shape`, each selecting at least one cell. + + An all-False mask is legal but is a separate concern — it empties the view, + and a chain of selections is more interesting when every step leaves + something to index — so one cell is always forced True. + """ + size = int(np.prod(shape)) + flags = np.array(draw(st.lists(st.booleans(), min_size=size, max_size=size))) + flags[draw(st.integers(0, size - 1))] = True + return flags.reshape(shape) + + +def empty_masks(shape: tuple[int, ...]) -> st.SearchStrategy[np.ndarray[Any, np.dtype[np.bool_]]]: + """The all-False mask over `shape` — a fancy selection that empties the view. + + Split out from `masks`, which forces a cell True so a chain has something + left to index at the next step. Drawn on its own because an empty fancy + selection is a shape the code paths treat separately, and nothing generated + one. + """ + return st.just(np.zeros(shape, dtype=np.bool_)) + + +def basic_selections(shape: tuple[int, ...]) -> st.SearchStrategy[tuple[Any, ...]]: + """Basic selections: one scalar integer or slice per axis. + + Slices run in both directions, including the two empty spellings — a + forward slice whose stop precedes its start, and a backward one whose start + is off the front of the axis. + """ + return _entries(shape, _basic_entry) + + +def orthogonal_selections(shape: tuple[int, ...]) -> st.SearchStrategy[tuple[Any, ...]]: + """Orthogonal (`oindex`) selections: an outer product of per-axis choices. + + Each axis draws a scalar, a coordinate list (unsorted, with duplicates), a + boolean mask, or a slice. + """ + return _entries(shape, _orthogonal_entry) + + +def slice_selections(shape: tuple[int, ...]) -> st.SearchStrategy[tuple[Any, ...]]: + """Selections of slices alone, for the `oindex` spelling that carries no coordinates. + + Such a step is not a fancy selection — it narrows the view's own axes and + composes like basic indexing — so it is legal after a fancy step, where + genuine coordinates are not. The starts reach past the origin, which is what + distinguishes a step that walks an existing index array's dependency axes + from one that walks its broadcast singletons. + """ + return _entries(shape, _slice_entry) + + +@st.composite +def vectorized_selections(draw: st.DrawFn, shape: tuple[int, ...]) -> tuple[Any, ...]: + """Vectorized (`vindex`) selections over a leading or trailing block of axes. + + `vindex` is coordinate-only — it rejects a slice outright — so a partial + selection names its axes by position: a leading block, or a trailing one + reached through an ellipsis. Either a single boolean mask spanning the whole + covered block, or one entry per axis, each a coordinate array or a scalar + (a scalar being a basic index NumPy applies before the coordinates). + """ + ndim = len(shape) + trailing = draw(st.booleans()) + count = draw(st.integers(1, ndim)) + axes = range(ndim - count, ndim) if trailing else range(count) + sizes = [shape[axis] for axis in axes] + + entries: list[Any] + if draw(st.booleans()): + entries = [draw(masks(tuple(sizes)))] + else: + # The coordinate arrays share one shape, which is what makes the + # selection correlated. That shape is not always one-dimensional: a + # vectorized read of a (2, 3) block of points is an ordinary thing to + # ask for and produces a result of that rank. Drawing only 1-D arrays + # meant no rank-raising vindex was ever generated — and a length of 0 + # covers the empty case the same way `_orthogonal_entry` does. + coordinate_shape = draw( + st.one_of( + st.integers(0, 4).map(lambda length: (length,)), + st.tuples(st.integers(1, 2), st.integers(1, 3)), + ) + ) + entries = [ + draw( + st.one_of( + st.integers(-size, size - 1), + st.lists( + st.integers(-size, size - 1), + min_size=int(np.prod(coordinate_shape)), + max_size=int(np.prod(coordinate_shape)), + ).map(lambda values: np.array(values, dtype=np.intp).reshape(coordinate_shape)), + ) + ) + for size in sizes + ] + return (Ellipsis, *entries) if trailing else tuple(entries) diff --git a/packages/zarr-indexing/src/zarr_indexing/transform.py b/packages/zarr-indexing/src/zarr_indexing/transform.py index e1a3898b1d..a8a5963a26 100644 --- a/packages/zarr-indexing/src/zarr_indexing/transform.py +++ b/packages/zarr-indexing/src/zarr_indexing/transform.py @@ -1,8 +1,8 @@ """Index transforms — composable, lazy coordinate mappings. An `IndexTransform` pairs an **input domain** (the coordinates a user sees) -with a tuple of **output maps** (the storage coordinates those inputs map to). -One output map per storage dimension. See `output_map.py` for the three +with a tuple of **output maps** (the output coordinates those inputs map to). +One output map per output dimension. See `output_map.py` for the three output map types. Key operations: @@ -11,52 +11,108 @@ produces a new transform with a narrower input domain and adjusted output maps. No I/O occurs. This is how lazy slicing works. -- **intersect(output_domain)** — restrict to storage coordinates within a +- **intersect(output_domain)** — restrict to output coordinates within a region. This is chunk resolution: "which of my coordinates fall in this chunk?" - **translate(shift)** — shift all output coordinates. This makes coordinates chunk-local: "express my coordinates relative to the chunk origin." -- **compose(outer, inner)** — chain two transforms. See `composition.py`. +- **`transform.compose(inner)`** — chain two transforms into one. The transform is the atomic unit that connects user-facing indexing to -chunk-level I/O. Every `Array` holds a transform (identity by default). -`Array.lazy[...]` composes a new transform lazily. Reading resolves the -transform against the chunk grid via intersect + translate. +chunk-level I/O. A wrapper holds one — `LazyArray` starts from the identity — +and `.lazy[...]` composes a new transform lazily rather than reading. Reading +resolves the transform against the chunk grid via intersect + translate. """ from __future__ import annotations -import math from dataclasses import dataclass -from typing import Any, Literal, cast +from typing import TYPE_CHECKING, Any, Literal, cast import numpy as np +from zarr_indexing._affine import checked_affine +from zarr_indexing._selector import as_scalar_index, require_index +from zarr_indexing.boundary import validate_advanced_selection from zarr_indexing.domain import IndexDomain from zarr_indexing.errors import BoundsCheckError, VindexInvalidSelectionError -from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap, OutputIndexMap +from zarr_indexing.output_map import ( + ArrayMap, + ConstantMap, + DimensionMap, + OutputIndexMap, + array_map_or_constant, +) + +if TYPE_CHECKING: + from collections.abc import Sequence + + import numpy.typing as npt + + from zarr_indexing.json import IndexTransformJSON + + +@dataclass(frozen=True, slots=True) +class _PointOutOfBounds(Exception): + """Internal signal from the shared point kernel: one coordinate left the domain. + + Never escapes this module. `apply` and `apply_many` format it as the + public `BoundsCheckError`, each in its own vocabulary — the kernel knows + batches, but a single-point caller must never hear about them. + """ + + dimension: int + value: int + lower: int + upper: int + batch_position: tuple[int, ...] @dataclass(frozen=True, slots=True) class IndexTransform: - """A composable mapping from input coordinates to storage coordinates. + """A composable mapping from input coordinates to output coordinates. An `IndexTransform` has: - `domain`: an `IndexDomain` describing the valid input coordinates - (the user-facing shape, possibly with non-zero origin). - - `output`: a tuple of output maps (one per storage dimension), each - describing which storage coordinates the inputs touch. - - For a freshly opened array, the transform is the identity: input - coordinate `i` maps to storage coordinate `i`. Indexing operations - compose new transforms without I/O. + (the result's coordinate range, possibly with non-zero origin). + - `output`: a tuple of output maps (one per output dimension), each + describing which output coordinates the inputs touch. + + In array-indexing terms: `domain` describes the coordinates of the result + array an indexing operation produces, and `output` is the rule relating + each result coordinate to a coordinate in the source. Note the direction — + the transform's input side is the result, its output side addresses the + source; the coordinate mapping runs opposite to the data flow. + + Indexing an existing transform composes a new one without I/O. + + Examples + -------- + The operation "every other element of a 100-element array, starting at + index 0" — `array[::2]` — is a 50-cell domain whose cell `i` reads + output coordinate `2 * i`: + + >>> domain = IndexDomain.from_shape((50,)) + >>> output = (DimensionMap(input_dimension=0, offset=0, stride=2),) + >>> transform = IndexTransform(domain=domain, output=output) + >>> transform.apply((0,)), transform.apply((1,)), transform.apply((49,)) + ((0,), (2,), (98,)) + + The selection compiler derives the identical transform from the source's + shape and the slice: + + >>> transform == IndexTransform.from_shape((100,))[::2] + True """ domain: IndexDomain + """The input domain: the request coordinates this transform accepts.""" + output: tuple[OutputIndexMap, ...] + """One output map per output dimension, each producing that dimension's coordinate.""" def __post_init__(self) -> None: for i, m in enumerate(self.output): @@ -66,37 +122,332 @@ def __post_init__(self) -> None: f"output[{i}].input_dimension = {m.input_dimension} " f"is out of range for input rank {self.domain.ndim}" ) - elif isinstance(m, ArrayMap) and m.index_array.ndim > self.domain.ndim: - # ArrayMap index arrays produced by indexing and chunk resolution - # are normalized to the full input rank (an axis the array varies - # over is full-sized, every other axis a singleton). A rank - # *exceeding* the domain is always a bug. A rank *below* it is - # tolerated: TensorStore-format JSON (external input) may supply a - # lower-rank index array that broadcasts against the input domain, - # and `_array_map_dependency_axes` treats any missing leading axes - # as singleton dependencies. - raise ValueError( - f"output[{i}].index_array has {m.index_array.ndim} dims " - f"but input domain has {self.domain.ndim} dims" - ) + elif isinstance(m, ArrayMap): + # An index array carries the transform's full input rank: the axis + # a map varies over is full-sized, every other axis a singleton. + # The rank is what makes the dependency axes readable from the + # shape, so a mismatch is a bug rather than a spelling. External + # JSON may use a lower-rank array that broadcasts against the + # domain; `from_json` widens those on the way in, + # so the invariant holds for every transform that exists. + if m.index_array.ndim != self.domain.ndim: + raise ValueError( + f"output[{i}].index_array has {m.index_array.ndim} dims " + f"but input domain has {self.domain.ndim} dims" + ) + # Every axis is either the domain's extent or a singleton it + # broadcasts over. Any other size addresses input coordinates the + # array has no entry for, which reads as a smaller selection + # rather than as the error it is. + bad = [ + (axis, size, extent) + for axis, (size, extent) in enumerate( + zip(m.index_array.shape, self.domain.shape, strict=True) + ) + if size not in (1, extent) + ] + if len(bad) > 0: + axis, size, extent = bad[0] + raise ValueError( + f"output[{i}].index_array has {size} entries on axis {axis}, " + f"which is neither 1 nor the domain's extent of {extent} " + f"(index_array shape {m.index_array.shape}, " + f"domain shape {self.domain.shape})" + ) + + def __eq__(self, other: object) -> bool: + """Value equality. `ArrayMap` compares its index array element-wise, so + a transform holding one can be compared at all — the generated `__eq__` + raised `ValueError: the truth value of an array ... is ambiguous`.""" + if not isinstance(other, IndexTransform): + return NotImplemented + return self.domain == other.domain and self.output == other.output + + def __hash__(self) -> int: + """Hashed by value, so a transform can key a cache or enter a set.""" + return hash((self.domain, self.output)) @property def input_rank(self) -> int: + """Number of input dimensions — the rank of `domain`.""" return self.domain.ndim @property def output_rank(self) -> int: + """Number of output dimensions — one per output map.""" return len(self.output) @classmethod def identity(cls, domain: IndexDomain) -> IndexTransform: + """The identity transform over `domain`: every result cell reads the source at its own address.""" output = tuple(DimensionMap(input_dimension=i) for i in range(domain.ndim)) return cls(domain=domain, output=output) @classmethod def from_shape(cls, shape: tuple[int, ...]) -> IndexTransform: + """The identity transform over a zero-origin domain of the given `shape`.""" return cls.identity(IndexDomain.from_shape(shape)) + def apply(self, point: Sequence[int]) -> tuple[int, ...]: + """Map one coordinate of `domain` to the source coordinate that fills it. + + In array-indexing terms: `point` names a cell of the result array, and + the returned tuple — each `output` map evaluated at `point` — names the + source-array cell its value is read from: the coordinate arrow, + running result to source. + + Parameters + ---------- + point : Sequence[int] + One literal coordinate for each input dimension. + + Returns + ------- + tuple[int, ...] + One coordinate for each output map. + + Raises + ------ + ValueError + If ``point`` does not have exactly one coordinate per input + dimension. + TypeError + If the coordinates do not have an integer dtype. + BoundsCheckError + If a coordinate lies outside the input domain. + OverflowError + If a mapped output coordinate cannot be represented by + ``np.intp``. + + Examples + -------- + The `[::2]` transform reads result cell `i` from source coordinate + `2 * i`, so cell 3 of the result holds `source[6]`: + + >>> transform = IndexTransform.from_shape((100,))[::2] + >>> transform.apply((3,)) + (6,) + """ + coordinates = np.asarray(point) + expected_shape = (self.input_rank,) + if coordinates.shape != expected_shape: + raise ValueError(f"point must have shape {expected_shape}, got {coordinates.shape}") + # An empty Python sequence has no elements from which NumPy can infer + # an integer dtype, but it is the unique point in a rank-zero domain. + if self.input_rank == 0 and isinstance(point, (list, tuple)): + coordinates = coordinates.astype(np.intp) + try: + result = self._apply_points(coordinates) + except _PointOutOfBounds as error: + raise BoundsCheckError( + f"coordinate {error.value} on input dimension {error.dimension} " + f"is outside the domain [{error.lower}, {error.upper})" + ) from None + return tuple(int(value) for value in result) + + def apply_many(self, points: npt.ArrayLike) -> npt.NDArray[np.intp]: + """Map a batch of `domain` coordinates to the source coordinates that fill them. + + The vectorized form of `apply`: each row of `points` names a result + cell, and the corresponding output row names the source-array cell + its value is read from. + + Parameters + ---------- + points : numpy.typing.ArrayLike + Integer coordinates with shape ``batch_shape + (input_rank,)``. + + Returns + ------- + numpy.typing.NDArray[numpy.intp] + An owned array with shape ``batch_shape + (output_rank,)``. + + Raises + ------ + ValueError + If ``points`` has no trailing coordinate axis or that axis does + not contain exactly one coordinate per input dimension. + TypeError + If the coordinates do not have an integer dtype. + BoundsCheckError + If a coordinate lies outside the input domain. + OverflowError + If a mapped output coordinate cannot be represented by + ``np.intp``. + + Examples + -------- + Three result cells of the `[::2]` transform, located in one call: + + >>> transform = IndexTransform.from_shape((100,))[::2] + >>> transform.apply_many(np.array([[0], [1], [49]])).tolist() + [[0], [2], [98]] + """ + coordinates = np.asarray(points) + if coordinates.ndim == 0 or coordinates.shape[-1] != self.input_rank: + raise ValueError( + "points must have a trailing coordinate axis of size " + f"{self.input_rank}, got shape {coordinates.shape}" + ) + try: + return self._apply_points(coordinates) + except _PointOutOfBounds as error: + raise BoundsCheckError( + f"point at batch position {error.batch_position} has input dimension " + f"{error.dimension} coordinate {error.value} outside " + f"[{error.lower}, {error.upper})" + ) from None + + def _apply_points(self, points: np.ndarray[Any, Any]) -> npt.NDArray[np.intp]: + """Vectorized implementation shared by ``apply`` and ``apply_many``. + + Out-of-domain coordinates raise the internal `_PointOutOfBounds` + signal; each public entry point formats it in its own vocabulary — + `apply` never mentions a batch, `apply_many` names the batch position.""" + if not np.issubdtype(points.dtype, np.integer): + raise TypeError(f"points must have an integer dtype, got {points.dtype}") + + invalid = np.zeros(points.shape, dtype=np.bool_) + for dimension, (lower, upper) in enumerate( + zip(self.domain.inclusive_min, self.domain.exclusive_max, strict=True) + ): + invalid[..., dimension] = (points[..., dimension] < lower) | ( + points[..., dimension] >= upper + ) + invalid_positions = np.argwhere(invalid) + if invalid_positions.size > 0: + first = invalid_positions[0] + dimension = int(first[-1]) + batch_position = tuple(int(position) for position in first[:-1]) + point_index = tuple(int(position) for position in first) + value = int(points[point_index]) + lower = self.domain.inclusive_min[dimension] + upper = self.domain.exclusive_max[dimension] + raise _PointOutOfBounds(dimension, value, lower, upper, batch_position) + + batch_shape = points.shape[:-1] + result = np.empty(batch_shape + (self.output_rank,), dtype=np.intp) + for output_dimension, output_map in enumerate(self.output): + if isinstance(output_map, ConstantMap): + if result[..., output_dimension].size == 0: + continue + result[..., output_dimension] = checked_affine(output_map.offset, 0, 0) + elif isinstance(output_map, DimensionMap): + result[..., output_dimension] = checked_affine( + output_map.offset, + output_map.stride, + points[..., output_map.input_dimension], + ) + else: + index = tuple( + np.zeros(batch_shape, dtype=np.intp) + if output_map.index_array.shape[axis] == 1 + else _positions_from_origin(points[..., axis], self.domain.inclusive_min[axis]) + for axis in range(self.input_rank) + ) + result[..., output_dimension] = checked_affine( + output_map.offset, + output_map.stride, + np.asarray(output_map.index_array[index]), + ) + return result + + def inverted(self) -> IndexTransform: + """Return the restricted, exactly representable inverse transform. + + Inversion is defined for square transforms containing only constants + and unique unit-stride dimension maps. Any input dimension not named by + a dimension map must have singleton extent, so its coordinate can be + recovered as a constant. + + Returns + ------- + IndexTransform + A new transform mapping output coordinates back to input + coordinates. + + Raises + ------ + ValueError + If this transform does not have a representable inverse, including + when input labels cannot be transferred to unlabeled output + dimensions. + """ + if self.domain.labels is not None: + raise ValueError( + "cannot invert transform: input labels cannot be represented " + "because output dimensions do not carry labels" + ) + if self.input_rank != self.output_rank: + raise ValueError( + "cannot invert transform: input rank must equal output rank, got " + f"{self.input_rank} and {self.output_rank}" + ) + + referenced: set[int] = set() + for output_dimension, output_map in enumerate(self.output): + if isinstance(output_map, ArrayMap): + raise ValueError( # noqa: TRY004 - valid map, invalid inverse + f"cannot invert transform: output[{output_dimension}] is an ArrayMap" + ) + if isinstance(output_map, DimensionMap): + if output_map.stride not in (-1, 1): + raise ValueError( + "cannot invert transform: DimensionMap stride must be +1 or -1, " + f"got {output_map.stride} for output[{output_dimension}]" + ) + if output_map.input_dimension in referenced: + raise ValueError( + "cannot invert transform: input dimension " + f"{output_map.input_dimension} is referenced more than once" + ) + referenced.add(output_map.input_dimension) + + for input_dimension, extent in enumerate(self.domain.shape): + if input_dimension not in referenced and extent != 1: + raise ValueError( + "cannot invert transform: unreferenced input dimension " + f"{input_dimension} has extent {extent}, not 1" + ) + + inverse_min: list[int] = [] + inverse_max: list[int] = [] + inverse_output: dict[int, OutputIndexMap] = {} + for output_dimension, output_map in enumerate(self.output): + if isinstance(output_map, ConstantMap): + inverse_min.append(output_map.offset) + inverse_max.append(output_map.offset + 1) + continue + + assert isinstance(output_map, DimensionMap) + input_dimension = output_map.input_dimension + lower = self.domain.inclusive_min[input_dimension] + upper = self.domain.exclusive_max[input_dimension] + if output_map.stride == 1: + inverse_min.append(output_map.offset + lower) + inverse_max.append(output_map.offset + upper) + inverse_output[input_dimension] = DimensionMap( + output_dimension, + offset=-output_map.offset, + ) + else: + inverse_min.append(output_map.offset - upper + 1) + inverse_max.append(output_map.offset - lower + 1) + inverse_output[input_dimension] = DimensionMap( + output_dimension, + offset=output_map.offset, + stride=-1, + ) + + for input_dimension, lower in enumerate(self.domain.inclusive_min): + if input_dimension not in referenced: + inverse_output[input_dimension] = ConstantMap(lower) + + return IndexTransform( + domain=IndexDomain(tuple(inverse_min), tuple(inverse_max)), + output=tuple(inverse_output[dimension] for dimension in range(self.input_rank)), + ) + @property def selection_repr(self) -> str: """Compact domain string, e.g. `'{ [2, 8), [0, 10) }'`. @@ -155,7 +506,10 @@ def intersect( ] | None ): - """Restrict this transform to storage coordinates within output_domain. + """Keep only the cells whose source coordinates fall inside `output_domain`. + + Chunk resolution is the canonical caller: intersecting a request with + one chunk's box keeps the cells that chunk can serve. Returns `(restricted_transform, out_indices)` or None if empty. @@ -167,7 +521,13 @@ def intersect( return _intersect(self, output_domain) def translate(self, shift: tuple[int, ...]) -> IndexTransform: - """Shift all output coordinates by `shift`.""" + """Shift the source coordinates every cell reads by `shift`, per dimension. + + The domain is untouched: the result keeps its cells, and each one + reads from a shifted source address — for example, making a chunk's + global addresses chunk-local by translating by the chunk's negated + origin. + """ if len(shift) != self.output_rank: raise ValueError(f"shift must have length {self.output_rank}, got {len(shift)}") new_output: list[OutputIndexMap] = [] @@ -189,12 +549,18 @@ def translate(self, shift: tuple[int, ...]) -> IndexTransform: index_array=m.index_array, offset=m.offset + s, stride=m.stride, - input_dimension=m.input_dimension, ) ) return IndexTransform(domain=self.domain, output=tuple(new_output)) def __getitem__(self, selection: Any) -> IndexTransform: + """Compose a basic selection (int, slice, ellipsis, newaxis) into a new transform. + + No I/O occurs. Integers and slice bounds are literal domain coordinates + (TensorStore convention): negative values are not counted from the end, + and out-of-domain values raise `BoundsCheckError`. Integer indices drop + their input dimension; `None` inserts a size-1 dimension. + """ return _apply_basic_indexing(self, selection) def translate_domain_by(self, shift: tuple[int, ...]) -> IndexTransform: @@ -239,12 +605,255 @@ def translate_domain_to(self, origins: tuple[int, ...]) -> IndexTransform: @property def oindex(self) -> _OIndexHelper: + """Accessor for the orthogonal (outer-product) indexing dialect. + + `transform.oindex[sel]` applies each index array independently per + dimension and returns a new transform. + """ return _OIndexHelper(self) @property def vindex(self) -> _VIndexHelper: + """Accessor for the vectorized (coordinate/mask) indexing dialect. + + `transform.vindex[sel]` broadcasts all index arrays together, NumPy + fancy-indexing style, and returns a new transform. + """ return _VIndexHelper(self) + @property + def index_array_structure(self) -> Literal["none", "orthogonal", "general"]: + """Classify how a transform's index arrays relate to its input axes. + + Returns + ------- + `"none"` when no output map is an `ArrayMap`; `"orthogonal"` when every + `ArrayMap` varies over exactly one input axis, each its own (an outer + product, one independent gather per axis); `"general"` otherwise — + correlated (`vindex`) maps sharing their non-singleton axes, maps produced + by composing fancy steps, maps sharing an input axis (a diagonal gather), + and empty or hand-built all-singleton maps whose shape names no axis. The + orthogonal resolvers narrow one axis at a time and are only sound for + `"orthogonal"`; everything else takes the pointwise path that collapses + the joint block. Everything is read off the index arrays' shapes. + + Examples + -------- + >>> t = IndexTransform.from_shape((4, 5)) + >>> t.index_array_structure + 'none' + + `oindex` arrays each vary over their own axis (an outer product): + + >>> t.oindex[[0, 2], [1, 3]].index_array_structure + 'orthogonal' + + `vindex` arrays are correlated — they share the broadcast axis: + + >>> t.vindex[np.array([0, 2]), np.array([1, 3])].index_array_structure + 'general' + """ + seen: set[int] = set() + has_array = False + for m in self.output: + if not isinstance(m, ArrayMap): + continue + has_array = True + dep = m.dependency_axes + if len(dep) != 1 or dep[0] in seen: + return "general" + seen.add(dep[0]) + return "orthogonal" if has_array else "none" + + def select( + self, + selection: Any, + mode: Literal["basic", "orthogonal", "vectorized"] = "basic", + ) -> IndexTransform: + """Convert a user selection into a composed IndexTransform. + + Negative indices are treated as literal coordinates (TensorStore convention). + The caller (Array layer) is responsible for converting numpy-style negative + indices before calling this function. + + Examples + -------- + The `mode` picks the dialect; the result is the composed self the + corresponding accessor builds: + + >>> t = IndexTransform.from_shape((10,)) + >>> t.select(slice(2, 8)) == t[2:8] + True + >>> s = t.select(([9, 0, 0],), mode="orthogonal") + >>> s.apply((0,)), s.apply((1,)), s.apply((2,)) + ((9,), (0,), (0,)) + """ + if mode == "basic": + _validate_basic_selection(selection) + return self[selection] + elif mode == "orthogonal": + _validate_array_selection(selection, self.domain.shape, mode) + return self.oindex[selection] + elif mode == "vectorized": + _validate_array_selection(selection, self.domain.shape, mode) + return self.vindex[selection] + else: + raise ValueError(f"Unknown mode: {mode!r}") + + def compose(self, inner: IndexTransform) -> IndexTransform: + """Chain `inner` onto this transform, yielding one direct transform. + + This transform maps its own input coordinates to `inner`'s input + coordinates, and `inner` maps those onward; the result maps this + transform's input coordinates straight to `inner`'s output + coordinates. Composition is what keeps a view of a view a single + description rather than a stack of layers, and it is exact: index + arrays are evaluated at the new coordinates rather than accumulated. + + The precondition is that this transform's output rank equals `inner`'s + input rank; a mismatch, or coordinates leaving `inner`'s domain, raises. + + Examples + -------- + Chained indexing — `source[2:5]`, then `[::-1]` on the result — + collapses to one transform (a reversed axis keeps literal coordinates, + so the composed domain is `[-4, -1)`): + + >>> inner = IndexTransform.from_shape((10,))[2:5] + >>> outer = IndexTransform.identity(inner.domain)[::-1] + >>> chained = outer.compose(inner) + >>> chained == inner[::-1] + True + >>> [chained.apply((i,)) for i in (-4, -3, -2)] + [(4,), (3,), (2,)] + """ + from zarr_indexing._composition import compose + + return compose(self, inner) + + # -- serialization ------------------------------------------------------ + + def to_json(self) -> IndexTransformJSON: + """Convert to the canonical ndsel transform body (spec section 4.3). + + The result is fully explicit: `input_rank`, fully written bounds and + labels, and an `output` carrying `offset`/`stride` on every affine and + array map. It is field-for-field a TensorStore `IndexTransform` minus + the `kind` discriminator, so it loads directly into + `tensorstore.IndexTransform(json=...)`. + + Examples + -------- + >>> body = IndexTransform.from_shape((6,))[1:5:2].to_json() + >>> (body["input_inclusive_min"], body["input_exclusive_max"]) + ([0], [2]) + >>> body["output"] + [{'offset': 1, 'stride': 2, 'input_dimension': 0}] + """ + from zarr_indexing._wire import emit_labels + + return { + "input_rank": self.domain.ndim, + "input_inclusive_min": list(self.domain.inclusive_min), + "input_exclusive_max": list(self.domain.exclusive_max), + "input_labels": emit_labels(self.domain.labels, self.domain.ndim), + "output": [m.to_json() for m in self.output], + } + + @classmethod + def from_json(cls, data: IndexTransformJSON) -> IndexTransform: + """Construct from a canonical (or canonicalizable) ndsel transform body. + + The body is first run through the message layer (`normalize_ndsel`) so + that omitted fields — identity `output`, default bounds and labels — + are filled and validated, then lowered to the engine representation. + Lower-rank `index_array`s are widened to the full input rank on the way + in. + + Examples + -------- + >>> body = IndexTransform.from_shape((6,))[1:5:2].to_json() + >>> transform = IndexTransform.from_json(body) + >>> transform.domain.shape + (2,) + >>> transform.to_json() == body # the round trip is exact + True + """ + from zarr_indexing._wire import ( + full_rank_index_array, + lower_bound, + lower_index_array, + lower_labels, + ) + from zarr_indexing.messages import NdselError, normalize_ndsel + + if not isinstance(data, dict): # pyright: ignore[reportUnnecessaryIsInstance] + raise NdselError( + "invalid_json", f"a transform body must be a JSON object, got {data!r}" + ) + kind = data.get("kind", "transform") + if kind != "transform": + # Spelled before normalization so a body carrying its own `kind` + # cannot reinterpret the document as some other message and return + # a selection this constructor never promised. + raise NdselError("invalid_json", f"a transform body cannot carry kind {kind!r}") + body = normalize_ndsel({**data, "kind": "transform"}) + + domain = IndexDomain( + inclusive_min=tuple( + lower_bound(b, f"input_inclusive_min[{i}]") + for i, b in enumerate(body["input_inclusive_min"]) + ), + exclusive_max=tuple( + lower_bound(b, f"input_exclusive_max[{i}]") + for i, b in enumerate(body["input_exclusive_max"]) + ), + labels=lower_labels(body["input_labels"]), + ) + + output: list[OutputIndexMap] = [] + for i, om in enumerate(body["output"]): + if "index_array" in om: + where = f"output[{i}]" + arr = lower_index_array(om["index_array"], f"{where}.index_array") + # ndsel leaves index-array rank unvalidated, so an external + # producer may send an array of lower rank that broadcasts + # against the domain. Widen it here, on the way in, so every + # transform that exists holds the full-rank invariant the + # engine reads dependency axes from. + output.append( + ArrayMap( + index_array=full_rank_index_array(arr, domain, where), + offset=om.get("offset", 0), + stride=om.get("stride", 1), + ) + ) + elif "input_dimension" in om: + output.append( + DimensionMap( + input_dimension=om["input_dimension"], + offset=om.get("offset", 0), + stride=om.get("stride", 1), + ) + ) + else: + output.append(ConstantMap(offset=om.get("offset", 0))) + + try: + return cls(domain=domain, output=tuple(output)) + except ValueError as exc: + # The engine's invariants are the last gate a document passes, and + # they speak in the engine's vocabulary. A document that fails them + # is invalid input, so it leaves here as one — with the engine's + # account of what was wrong kept, since it names the offending + # output map and axis. + raise NdselError("rank_mismatch", str(exc)) from exc + + +def _positions_from_origin(coordinates: np.ndarray[Any, Any], origin: int) -> npt.NDArray[np.intp]: + """Convert literal coordinates to positional indices without wrapping.""" + return checked_affine(-int(origin), 1, coordinates) + def _intersect( transform: IndexTransform, output_domain: IndexDomain @@ -257,22 +866,22 @@ def _intersect( ): """Intersect a transform with an output domain (e.g., a chunk's bounds). - For each output dimension, restrict to storage coordinates within + For each output dimension, restrict to output coordinates within `[output_domain.inclusive_min[d], output_domain.exclusive_max[d])`. - Two flavours of fancy indexing require different treatment, distinguished by - the ArrayMaps' dependency axes (see `_array_map_dependency_axes`): + Two flavors of fancy indexing require different treatment, distinguished by + the ArrayMaps' dependency axes (see `ArrayMap.dependency_axes`): - **orthogonal** (`oindex`): each ArrayMap varies over a single, distinct input axis, forming an outer product. Every output dimension is intersected independently and the input domain narrowed per axis. - **correlated** (`vindex`): the ArrayMaps share their (broadcast) dependency axes and scatter through a single flat index. A point survives only if ALL - its storage coordinates fall within the output domain; residual slice + its output coordinates fall within the output domain; residual slice dimensions are intersected independently, as in the orthogonal case. - A `None` `input_dimension` marks a correlated map, so any such map routes the - whole transform through the correlated intersection. + The routing is `index_array_structure`: only a pure per-axis outer product + takes the orthogonal path. Returns `None` if the intersection is empty. """ @@ -282,33 +891,36 @@ def _intersect( f"transform output rank ({transform.output_rank})" ) - correlated_dims = [ - i - for i, m in enumerate(transform.output) - if isinstance(m, ArrayMap) and m.input_dimension is None - ] - if len(correlated_dims) > 0: - return _intersect_correlated(transform, output_domain, correlated_dims) + if any(size == 0 for size in transform.domain.shape): + # An empty input domain addresses no coordinates at all, so it meets no + # output domain. Deciding it here keeps the per-flavor intersections from + # having to reconcile an empty domain with an index array that is *not* + # empty: a genuine extent-1 axis is stored as a broadcast singleton, so + # emptying its domain leaves the array at size 1. + return None + + if transform.index_array_structure == "general": + return _intersect_general(transform, output_domain) return _intersect_orthogonal(transform, output_domain) def _intersect_dimension_map( m: DimensionMap, input_lo: int, input_hi: int, lo: int, hi: int ) -> tuple[int, int] | None: - """Narrow a DimensionMap's input range to storage coordinates in `[lo, hi)`. + """Narrow a DimensionMap's input range to output coordinates in `[lo, hi)`. `input_lo`/`input_hi` are the current (possibly already narrowed) input range for the map's axis. Returns the new `(input_lo, input_hi)` or `None` - if no input produces an in-bounds storage coordinate. + if no input produces an in-bounds output coordinate. """ if input_lo >= input_hi: return None if m.stride > 0: - new_input_lo = max(input_lo, math.ceil((lo - m.offset) / m.stride)) - new_input_hi = min(input_hi, math.ceil((hi - m.offset) / m.stride)) + new_input_lo = max(input_lo, _ceil_div(lo - m.offset, m.stride)) + new_input_hi = min(input_hi, _ceil_div(hi - m.offset, m.stride)) elif m.stride < 0: - new_input_lo = max(input_lo, math.ceil((hi - 1 - m.offset) / m.stride)) - new_input_hi = min(input_hi, math.ceil((lo - 1 - m.offset) / m.stride)) + new_input_lo = max(input_lo, _ceil_div(hi - 1 - m.offset, m.stride)) + new_input_hi = min(input_hi, _ceil_div(lo - 1 - m.offset, m.stride)) else: if lo <= m.offset < hi: new_input_lo, new_input_hi = input_lo, input_hi @@ -319,6 +931,11 @@ def _intersect_dimension_map( return new_input_lo, new_input_hi +def _ceil_div(numerator: int, denominator: int) -> int: + """Return ``ceil(numerator / denominator)`` using exact integer arithmetic.""" + return -((-numerator) // denominator) + + def _intersect_orthogonal( transform: IndexTransform, output_domain: IndexDomain ) -> ( @@ -359,12 +976,18 @@ def _intersect_orthogonal( else: # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) - # Orthogonal: the array varies over a single axis (its dependency - # axis, or `input_dimension` for a degenerate length-1 array). Filter - # along that axis and keep the array at full input rank so the - # singleton axes it broadcasts over are preserved. - d = _array_map_dependent_axis(m) - storage = m.offset + m.stride * m.index_array + # Orthogonal: the array varies over a single axis. Filter along that + # axis and keep the array at full input rank so the singleton axes + # it broadcasts over are preserved. + axis = m.dependent_axis + if axis is None: + raise ValueError( + f"output[{out_dim}] is an ArrayMap that varies over no input " + "dimension; a map with no dependency axis should have been " + "collapsed to a ConstantMap" + ) + d = axis + storage = checked_affine(m.offset, m.stride, m.index_array) mask = (storage >= lo) & (storage < hi) # The array is singleton on every axis but `d`, so its mask reduces # to a 1-D vector along `d`. @@ -377,7 +1000,6 @@ def _intersect_orthogonal( index_array=np.asarray(filtered, dtype=np.intp), offset=m.offset, stride=m.stride, - input_dimension=m.input_dimension, ) ) new_max[d] = new_min[d] + int(survivors.size) @@ -404,56 +1026,71 @@ def _intersect_orthogonal( return (result, out_indices) -def _intersect_correlated( +def _intersect_general( transform: IndexTransform, output_domain: IndexDomain, - correlated_dims: list[int], ) -> tuple[IndexTransform, np.ndarray[Any, np.dtype[np.intp]]] | None: - """Intersect a correlated (vindex) transform with an output domain. + """Intersect a transform with any index-array structure, pointwise. - The correlated ArrayMaps share their broadcast (dependency) axes; a broadcast - point survives only if ALL its storage coordinates fall within the output + Every `ArrayMap` — correlated, orthogonal, or several sharing an axis — is + treated as a lookup table over the joint block of non-slice axes: a block + point survives only if ALL its output coordinates fall within the output domain. Residual DimensionMap dimensions are intersected independently (as in the orthogonal case) and preserved, so a partial vindex — e.g. two coordinate arrays over a 3-D array, leaving one slice dimension — resolves correctly. + Treating an orthogonal map this way forfeits its per-axis independence (the + block enumerates the outer product), which is why the pure-orthogonal case + keeps its own resolver. The surviving broadcast axes collapse to a single axis; the returned `out_indices` is the flat scatter index into the (row-major flattened) output buffer, of shape `(surviving_points,) + (residual slice sizes)`. + + A rank-0 broadcast block — every coordinate array a scalar, as after + `vindex[...]` narrowed to a single point — has no axis to collapse and stays + rank 0: the block either survives whole or the intersection is empty. The + result keeps only the residual slice axes and `out_indices` loses its leading + points axis, so the sub-transform's rank still matches the view's. """ - corr_maps = [cast("ArrayMap", transform.output[i]) for i in correlated_dims] - - # Mixing correlated and orthogonal ArrayMaps in one transform is not produced - # by any single selection and is not supported here. - orthogonal_array_dims = [ - i - for i, m in enumerate(transform.output) - if isinstance(m, ArrayMap) and m.input_dimension is not None - ] - if len(orthogonal_array_dims) > 0: - raise NotImplementedError( - "intersecting a transform with both correlated and orthogonal " - "ArrayMaps is not supported" - ) + correlated_dims = [i for i, m in enumerate(transform.output) if isinstance(m, ArrayMap)] + + # The broadcast axes are exactly the input axes no `DimensionMap` binds: a + # correlated transform's input domain is its residual slice axes plus the + # collapsed broadcast block. Deriving them by complement rather than from the + # index array's non-singleton axes keeps this correct when a broadcast axis + # is itself size 1, and when NumPy's placement rule puts the broadcast block + # somewhere other than the front (see `_broadcast_insertion_point`). + bound_axes = {m.input_dimension for m in transform.output if isinstance(m, DimensionMap)} + broadcast_axes = tuple(a for a in range(transform.input_rank) if a not in bound_axes) + broadcast_shape = tuple(transform.domain.shape[a] for a in broadcast_axes) - # The broadcast (dependency) axes are shared by every correlated map; they are - # the leading axes of the domain, followed by the residual slice axes. - broadcast_axes = _array_map_dependency_axes(corr_maps[0].index_array) - broadcast_shape = tuple(corr_maps[0].index_array.shape[a] for a in broadcast_axes) + for out_dim in correlated_dims: + arr_map = cast("ArrayMap", transform.output[out_dim]) + if any(a not in broadcast_axes for a in arr_map.dependency_axes): + # Reachable only by hand-building a transform: no selection binds + # the same input axis to both a slice map and an index array. + raise NotImplementedError( + "intersecting a transform whose index array varies over an " + "input dimension also bound by a slice map is not supported" + ) # Joint bounds mask over the broadcast block. combined: np.ndarray[Any, np.dtype[np.bool_]] | None = None for out_dim in correlated_dims: cm = cast("ArrayMap", transform.output[out_dim]) - storage = cm.offset + cm.stride * cm.index_array + storage = checked_affine(cm.offset, cm.stride, cm.index_array) lo = output_domain.inclusive_min[out_dim] hi = output_domain.exclusive_max[out_dim] mask = (storage >= lo) & (storage < hi) combined = mask if combined is None else (combined & mask) assert combined is not None - # The correlated maps are singleton on every non-broadcast axis, so the mask - # collapses (C-order) to the broadcast block. - combined_bcast = combined.reshape(broadcast_shape) + # Index arrays are singleton on every non-broadcast axis, so the mask + # collapses (C-order) to the broadcast block. A map may also be singleton + # along a block axis it does not vary over (an orthogonal member, or a + # leftover broadcast axis), so the collapsed mask is broadcast up to the + # full block rather than reshaped. + combined_block = combined.reshape(tuple(combined.shape[a] for a in broadcast_axes)) + combined_bcast = np.broadcast_to(combined_block, broadcast_shape) surviving = np.nonzero(combined_bcast.reshape(-1))[0].astype(np.intp) if surviving.size == 0: return None @@ -481,24 +1118,32 @@ def _intersect_correlated( n_points = int(surviving.size) n_slice = len(slice_dims) - corr_values = { - out_dim: cast("ArrayMap", transform.output[out_dim]) - .index_array.reshape(broadcast_shape) - .reshape(-1)[surviving] - for out_dim in correlated_dims - } - - # New domain: the collapsed broadcast axis, then one axis per residual slice. - new_min = [0] - new_max = [n_points] + corr_values: dict[int, np.ndarray[Any, np.dtype[np.intp]]] = {} + for out_dim in correlated_dims: + arr = cast("ArrayMap", transform.output[out_dim]).index_array + block = arr.reshape(tuple(arr.shape[a] for a in broadcast_axes)) + corr_values[out_dim] = np.asarray( + np.ascontiguousarray(np.broadcast_to(block, broadcast_shape)).reshape(-1)[surviving], + dtype=np.intp, + ) + + # A rank-0 broadcast block contributes no axis: the leading `(n_points,)` of + # the domain, of every index array, and of `out_indices` is present only when + # there was a block to collapse. + points_shape = (n_points,) if len(broadcast_shape) > 0 else () + + # New domain: the collapsed broadcast axis if there is one, then one axis per + # residual slice. + new_min = [0] * len(points_shape) + new_max = list(points_shape) new_input_dim_of = {} - for new_axis, (d, nlo, nhi, _full, _m) in enumerate(slice_dims, start=1): + for new_axis, (d, nlo, nhi, _full, _m) in enumerate(slice_dims, start=len(points_shape)): new_min.append(nlo) new_max.append(nhi) new_input_dim_of[d] = new_axis new_domain = IndexDomain(inclusive_min=tuple(new_min), exclusive_max=tuple(new_max)) - corr_shape = (n_points,) + (1,) * n_slice + corr_shape = points_shape + (1,) * n_slice new_output: list[OutputIndexMap] = [] for out_dim, m in enumerate(transform.output): if out_dim in correlated_dims: @@ -523,23 +1168,36 @@ def _intersect_correlated( ) result = IndexTransform(domain=new_domain, output=tuple(new_output)) - # Flat scatter index into the row-major output buffer of shape - # (broadcast points, residual slice sizes...): flat = point * prod(slice) + - # (row-major offset within the slice block). - prod_slice = 1 - for _d, _lo, _hi, full, _m in slice_dims: - prod_slice *= full - out_indices: np.ndarray[Any, np.dtype[np.intp]] = (surviving * prod_slice).reshape( - (n_points,) + (1,) * n_slice + # Flat scatter index into the caller's row-major output buffer, whose shape + # is the *input* domain's shape. The buffer is addressed positionally, so + # this assumes a zero-origin domain — the resolvers normalize with + # `translate_domain_to` before resolving. + # + # Each surviving point is a flat index into the broadcast block; unravel it + # to per-axis coordinates so the buffer stride of each broadcast axis is + # applied at its real position, wherever NumPy's placement rule put it. + domain_shape = transform.domain.shape + buffer_strides = [1] * len(domain_shape) + for axis in range(len(domain_shape) - 2, -1, -1): + buffer_strides[axis] = buffer_strides[axis + 1] * domain_shape[axis + 1] + + point_offsets = np.zeros(n_points, dtype=np.intp) + if len(broadcast_shape) > 0: + for axis, coords_along_axis in zip( + broadcast_axes, np.unravel_index(surviving, broadcast_shape), strict=True + ): + point_offsets = point_offsets + coords_along_axis.astype(np.intp) * buffer_strides[axis] + + n_lead = len(points_shape) + out_indices: np.ndarray[Any, np.dtype[np.intp]] = point_offsets.reshape( + points_shape + (1,) * n_slice ) - running = 1 - for j in range(n_slice - 1, -1, -1): - _d, nlo, nhi, full, _m = slice_dims[j] - coords = np.arange(nlo, nhi, dtype=np.intp) * running - shape = [1] * (1 + n_slice) - shape[1 + j] = coords.size + for j in range(n_slice): + d, nlo, nhi, _full, _m = slice_dims[j] + coords = np.arange(nlo, nhi, dtype=np.intp) * buffer_strides[d] + shape = [1] * (n_lead + n_slice) + shape[n_lead + j] = coords.size out_indices = out_indices + coords.reshape(shape) - running *= full return (result, out_indices.astype(np.intp)) @@ -569,8 +1227,8 @@ def _normalize_basic_selection(selection: Any, ndim: int) -> tuple[int | slice | ellipsis_seen = True num_missing = ndim - n_real result.extend([slice(None)] * num_missing) - elif isinstance(sel, (int, np.integer)): - result.append(int(sel)) + elif (scalar := as_scalar_index(sel)) is not None: + result.append(scalar) elif isinstance(sel, slice) or sel is None: result.append(sel) else: @@ -583,6 +1241,24 @@ def _normalize_basic_selection(selection: Any, ndim: int) -> tuple[int | slice | return tuple(result) +def _positional_slice(pos: int, size: int, step: int) -> slice: + """A NumPy slice selecting `size` elements from `pos`, walking by `step`. + + The stop is `pos + size*step`, except in two cases. An empty selection is + written out explicitly, because the arithmetic form can be a negative stop + that NumPy would read as counting from the end. And a downward walk + reaching the start of the array must stop at `None`, for the same reason: + `slice(6, -1, -1)` selects nothing where `slice(6, None, -1)` selects the + first seven elements in reverse. + """ + if size <= 0: + return slice(0, 0, 1) + stop = pos + size * step + if step < 0 and stop < 0: + return slice(pos, None, step) + return slice(pos, stop, step) + + def _reindex_array( m: ArrayMap, normalized: tuple[int | slice | None, ...], @@ -592,16 +1268,12 @@ def _reindex_array( The array's axes correspond to the transform's input dimensions (0-indexed over the domain shape). Each axis is either a **dependency axis** — the array - genuinely varies with that input dimension — or a **singleton** axis it + varies with that input dimension — or a **singleton** axis it broadcasts over. Integer indexing, slicing, or newaxis is applied to the array only along its dependency axes; a selection on a singleton axis does not touch the array's values (it just narrows or drops that broadcast axis). """ - dependent = set(_array_map_dependency_axes(m.index_array)) - if m.input_dimension is not None: - # Degenerate length-1 orthogonal selection: the recorded axis is a - # dependency even though its size (1) makes it look singleton. - dependent.add(m.input_dimension) + dependent = set(m.dependency_axes) arr = m.index_array # Build a numpy indexing tuple: one entry per old input dimension @@ -633,7 +1305,7 @@ def _reindex_array( # indexed positionally, so shift by the domain origin. start, step, _origin, size = _resolve_slice_ts(sel, old_dim, lo, hi) pos = start - lo - idx.append(slice(pos, pos + size * step, step)) + idx.append(_positional_slice(pos, size, step)) else: # Broadcast axis: preserve the singleton (it still broadcasts # over the narrowed domain), regardless of the slice bounds. @@ -649,62 +1321,29 @@ def _reindex_array( return np.asarray(result, dtype=np.intp) -_FANCY_AFTER_FANCY_MSG = ( - "applying a fancy (orthogonal/vectorized) selection to a view that already " - "has a fancy-indexed axis is not supported (fancy-after-fancy composition): " - "the new coordinates would index a broadcast axis of the existing selection. " - "Materialize the view first with `.result()` and index the array, or reorder " - "the selections so the fancy step is applied last." -) - - -def _guard_fancy_after_fancy(m: ArrayMap, fancy_dims: set[int] | list[int]) -> None: - """Reject a fancy step that lands on a broadcast axis of an existing ArrayMap. - - A new orthogonal/vectorized selection can only be absorbed into an existing - ArrayMap along the axes that map genuinely varies over (its dependency axes, - plus the recorded `input_dimension` for a degenerate length-1 orthogonal - selection). A fancy index targeting any other axis — a singleton axis the map - merely broadcasts over — cannot be reindexed and used to leak a raw NumPy - `IndexError` at resolve time. Raise a clear `NotImplementedError` instead. +def _compose_selection( + transform: IndexTransform, + selection: Any, + mode: Literal["orthogonal", "vectorized"], +) -> IndexTransform: + """Apply an advanced selection to an array-carrying transform by composition. + + The selection is applied to an identity transform over the current domain — + the same code path a fresh transform takes, so the dialect (placement, + bounds, domains) is identical by construction — and the result is chained + onto `transform` with `compose`, which evaluates the existing index arrays + at the new coordinates. This is how a second fancy step lands on *any* axis + of an already-fancy view: axes an existing array varies over, axes it merely + broadcasts along, or a mixture. """ - dependent = set(_array_map_dependency_axes(m.index_array)) - if m.input_dimension is not None: - dependent.add(m.input_dimension) - for d in fancy_dims: - if d < m.index_array.ndim and d not in dependent: - raise NotImplementedError(_FANCY_AFTER_FANCY_MSG) - - -def _reindex_array_oindex( - arr: np.ndarray[Any, np.dtype[np.intp]], - normalized: tuple[Any, ...] | list[Any], - domain: IndexDomain, -) -> np.ndarray[Any, np.dtype[np.intp]]: - """Apply oindex/vindex selection to an existing ArrayMap's index_array. + # Deferred import: `composition` imports this module at import time. - Each old input dimension gets either an array (fancy index that axis) - or a slice applied to the corresponding array axis. - """ - idx: list[Any] = [] - for old_dim, sel in enumerate(normalized): - if old_dim >= arr.ndim: - break - lo = domain.inclusive_min[old_dim] - if isinstance(sel, np.ndarray): - # Values are literal domain coordinates; the stored array is - # indexed positionally, so shift by the domain origin. - idx.append(sel - lo) - elif isinstance(sel, slice): - hi = domain.exclusive_max[old_dim] - start, step, _origin, size = _resolve_slice_ts(sel, old_dim, lo, hi) - pos = start - lo - idx.append(slice(pos, pos + size * step, step)) - else: - idx.append(slice(None)) - - result = arr[tuple(idx)] if idx else arr - return np.asarray(result, dtype=np.intp) + identity = IndexTransform.identity(transform.domain) + if mode == "orthogonal": + outer = _apply_oindex(identity, selection) + else: + outer = _apply_vindex(identity, selection) + return outer.compose(transform) def _apply_basic_indexing(transform: IndexTransform, selection: Any) -> IndexTransform: @@ -791,55 +1430,18 @@ def _apply_basic_indexing(transform: IndexTransform, selection: Any) -> IndexTra else: raise RuntimeError(f"unexpected: dimension {d} not handled") else: - # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) + # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap). + # A result narrowed to a single coordinate collapses to the + # ConstantMap it equals — whether an integer consumed the dependency + # axis or a slice narrowed it to one entry — so a non-empty ArrayMap + # always varies over at least one axis. Nothing here renumbers: the + # array's axes are the new domain's axes by construction. new_arr = _reindex_array(m, normalized, transform.domain) - array_input_dim: int | None = None - if m.input_dimension is not None: - array_input_dim = old_to_new_dim.get(m.input_dimension, m.input_dimension) - new_output.append( - ArrayMap( - index_array=new_arr, - offset=m.offset, - stride=m.stride, - input_dimension=array_input_dim, - ) - ) + new_output.append(array_map_or_constant(new_arr, offset=m.offset, stride=m.stride)) return IndexTransform(domain=new_domain, output=tuple(new_output)) -def _array_map_dependency_axes(index_array: np.ndarray[Any, Any]) -> tuple[int, ...]: - """Return the input axes on which a normalized index array varies. - - Normalized `ArrayMap` index arrays carry the full input rank of their - enclosing transform: an axis the array varies over has its full size, while - an axis the array is independent of is a singleton (size 1). The dependency - axes are therefore exactly the non-singleton axes. An orthogonal (`oindex`) - array depends on a single axis; a vectorized (`vindex`) array depends on all - of the (shared) broadcast axes. - """ - return tuple(axis for axis, size in enumerate(index_array.shape) if size != 1) - - -def _array_map_dependent_axis(m: ArrayMap) -> int: - """Return the single input axis an orthogonal `ArrayMap` varies over. - - Normally this is the array's one non-singleton axis. A degenerate length-1 - orthogonal selection normalizes to an all-singleton shape (its dependency - axes are empty and indistinguishable by shape from a scalar), so - `input_dimension` breaks the tie — it records the axis the map binds. - """ - dep = _array_map_dependency_axes(m.index_array) - if len(dep) == 1: - return dep[0] - if m.input_dimension is not None: - return m.input_dimension - raise ValueError( - f"orthogonal ArrayMap must vary over exactly one axis; got dependency " - f"axes {dep} with input_dimension={m.input_dimension}" - ) - - def _reshape_to_axis( values: np.ndarray[Any, np.dtype[np.intp]], axis: int, ndim: int ) -> np.ndarray[Any, np.dtype[np.intp]]: @@ -889,11 +1491,16 @@ def _normalize_oindex_selection( result.append(sel.astype(np.intp)) elif isinstance(sel, slice): result.append(sel) - elif isinstance(sel, (int, np.integer)): + elif (scalar := as_scalar_index(sel)) is not None: # Convert integer scalars to 1-element arrays for orthogonal indexing - result.append(np.array([int(sel)], dtype=np.intp)) + result.append(np.array([scalar], dtype=np.intp)) elif isinstance(sel, (list, tuple)): - result.append(np.asarray(sel, dtype=np.intp)) + array = np.asarray(sel) + if array.dtype == np.bool_: + (indices,) = np.nonzero(array) + result.append(indices.astype(np.intp)) + else: + result.append(np.asarray(sel, dtype=np.intp)) else: result.append(sel) @@ -908,7 +1515,15 @@ def _apply_oindex(transform: IndexTransform, selection: Any) -> IndexTransform: """Apply orthogonal indexing to an IndexTransform. Each index array is applied independently per dimension (outer product). + + A transform that already carries index arrays takes the composition path + (`_compose_selection`) instead of being rewritten in place, so the new + selection may land on any axis — including axes an existing array merely + broadcasts along. """ + validate_advanced_selection(selection, transform.domain, "orthogonal") + if any(isinstance(m, ArrayMap) for m in transform.output): + return _compose_selection(transform, selection, "orthogonal") normalized = _normalize_oindex_selection(selection, transform.domain.ndim) new_inclusive_min: list[int] = [] @@ -957,22 +1572,13 @@ def _apply_oindex(transform: IndexTransform, selection: Any) -> IndexTransform: d = m.input_dimension if d in dim_array: new_axis = old_to_new_dim[d] - # Normalize to full input rank: the selection varies along its own - # new axis and is singleton on every other axis. The dependency - # axis is then derivable from the shape (a single non-singleton - # axis marks the selection orthogonal / outer-product rather than - # vectorized). `input_dimension` is kept populated as a - # compatibility shim for consumers not yet migrated to the - # shape-derived classifier. + # Normalize to full input rank: the selection varies along its + # own new axis and is singleton on every other axis, so the + # dependency axis is readable from the shape. A single-entry + # selection holds one coordinate and collapses to the + # ConstantMap it equals; its length-1 axis stays in the domain. full_arr = _reshape_to_axis(dim_array[d], new_axis, new_dim_idx) - new_output.append( - ArrayMap( - index_array=full_arr, - offset=m.offset, - stride=m.stride, - input_dimension=new_axis, - ) - ) + new_output.append(array_map_or_constant(full_arr, offset=m.offset, stride=m.stride)) elif d in dim_slice_params: start, step, origin = dim_slice_params[d] new_offset = m.offset + m.stride * (start - step * origin) @@ -986,19 +1592,10 @@ def _apply_oindex(transform: IndexTransform, selection: Any) -> IndexTransform: else: raise RuntimeError(f"unexpected: dimension {d} not handled") else: - # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) - _guard_fancy_after_fancy(m, list(dim_array.keys())) - new_arr = _reindex_array_oindex(m.index_array, normalized, transform.domain) - array_input_dim: int | None = None - if m.input_dimension is not None: - array_input_dim = old_to_new_dim.get(m.input_dimension, m.input_dimension) - new_output.append( - ArrayMap( - index_array=new_arr, - offset=m.offset, - stride=m.stride, - input_dimension=array_input_dim, - ) + # m: ArrayMap — unreachable: array-carrying transforms took the + # composition path at the top of this function. + raise AssertionError( # noqa: TRY004 - unreachable, not a dispatch + "unreachable: ArrayMap transforms are composed" ) return IndexTransform(domain=new_domain, output=tuple(new_output)) @@ -1014,25 +1611,62 @@ def __getitem__(self, selection: Any) -> IndexTransform: return _apply_vindex(self._transform, selection) +def _broadcast_insertion_point(array_dims: Sequence[int], slice_dims: Sequence[int]) -> int: + """Where the broadcast dimensions land, as a count of leading slice dimensions. + + NumPy's advanced-indexing placement rule: when the advanced indices are all + next to each other in the index tuple, the broadcast dimensions are inserted + at the spot they occupied; when a slice separates them, they lead. So + `a[:, i, j]` has shape `(len(a), *broadcast)` while `a[i, :, j]` has shape + `(*broadcast, a.shape[1])`. + + Returns the number of slice dimensions that precede the broadcast block; `0` + means the broadcast dimensions lead. + """ + if len(array_dims) == 0: + return 0 + first, last = array_dims[0], array_dims[-1] + separated = any(first < d < last for d in slice_dims) + if separated: + return 0 + return sum(1 for d in slice_dims if d < first) + + +def _as_boolean_index_array(selection: Any) -> np.ndarray[Any, np.dtype[np.bool_]] | None: + """Return an array-like boolean index as an ndarray, else None.""" + if not isinstance(selection, (np.ndarray, list, tuple)): + return None + array = np.asarray(selection) + if array.dtype != np.bool_: + return None + return array + + +def _selection_axis_count(selection: Any) -> int: + """Return how many input axes one vectorized selection entry consumes.""" + boolean_array = _as_boolean_index_array(selection) + return boolean_array.ndim if boolean_array is not None else 1 + + def _apply_vindex(transform: IndexTransform, selection: Any) -> IndexTransform: """Apply vectorized indexing to an IndexTransform. All array indices are broadcast together. Broadcast dimensions are prepended, followed by non-array (slice) dimensions. + + A transform that already carries index arrays takes the composition path + (`_compose_selection`) instead of being rewritten in place; see + `_apply_oindex`. """ + validate_advanced_selection(selection, transform.domain, "vectorized") + if any(isinstance(m, ArrayMap) for m in transform.output): + return _compose_selection(transform, selection, "vectorized") if not isinstance(selection, tuple): selection = (selection,) - # Expand ellipsis and count consumed dimensions - # Boolean arrays with ndim > 1 consume ndim dims - n_consumed = 0 - for s in selection: - if s is Ellipsis: - continue - if isinstance(s, np.ndarray) and s.dtype == np.bool_ and s.ndim > 1: - n_consumed += s.ndim - else: - n_consumed += 1 + # Expand ellipsis and count consumed dimensions. Boolean masks consume one + # input axis per mask dimension, whether spelled as an ndarray or a list. + n_consumed = sum(_selection_axis_count(s) for s in selection if s is not Ellipsis) ndim = transform.domain.ndim expanded: list[Any] = [] @@ -1043,12 +1677,7 @@ def _apply_vindex(transform: IndexTransform, selection: Any) -> IndexTransform: else: expanded.append(sel) # Count dimensions already consumed by expanded entries - n_expanded_dims = 0 - for sel in expanded: - if isinstance(sel, np.ndarray) and sel.dtype == np.bool_ and sel.ndim > 1: - n_expanded_dims += sel.ndim - else: - n_expanded_dims += 1 + n_expanded_dims = sum(_selection_axis_count(sel) for sel in expanded) while n_expanded_dims < ndim: expanded.append(slice(None)) n_expanded_dims += 1 @@ -1056,15 +1685,16 @@ def _apply_vindex(transform: IndexTransform, selection: Any) -> IndexTransform: # Convert booleans, lists, ints to integer arrays processed: list[np.ndarray[Any, np.dtype[np.intp]] | slice] = [] for sel in expanded: - if isinstance(sel, np.ndarray) and sel.dtype == np.bool_: - indices_tuple = np.nonzero(sel) + boolean_array = _as_boolean_index_array(sel) + if boolean_array is not None: + indices_tuple = np.nonzero(boolean_array) processed.extend(indices.astype(np.intp) for indices in indices_tuple) elif isinstance(sel, np.ndarray): processed.append(sel.astype(np.intp)) elif isinstance(sel, (list, tuple)): processed.append(np.asarray(sel, dtype=np.intp)) - elif isinstance(sel, (int, np.integer)): - processed.append(np.array([int(sel)], dtype=np.intp)) + elif (scalar := as_scalar_index(sel)) is not None: + processed.append(np.array([scalar], dtype=np.intp)) else: processed.append(sel) @@ -1092,27 +1722,30 @@ def _apply_vindex(transform: IndexTransform, selection: Any) -> IndexTransform: broadcast_arrays = [] broadcast_shape = () - # Build new domain: broadcast dims first, then slice dims - new_inclusive_min: list[int] = [] - new_exclusive_max: list[int] = [] - - # Broadcast dimensions - for s in broadcast_shape: - new_inclusive_min.append(0) - new_exclusive_max.append(s) - # Slice dimensions (preserved-domain literal semantics, like basic indexing) slice_dim_params: dict[int, tuple[int, int, int]] = {} + slice_bounds: list[tuple[int, int]] = [] for old_dim in slice_dims: sel = processed[old_dim] assert isinstance(sel, slice) lo = transform.domain.inclusive_min[old_dim] hi = transform.domain.exclusive_max[old_dim] start, step, origin, size = _resolve_slice_ts(sel, old_dim, lo, hi) - new_inclusive_min.append(origin) - new_exclusive_max.append(origin + size) + slice_bounds.append((origin, origin + size)) slice_dim_params[old_dim] = (start, step, origin) + n_before = _broadcast_insertion_point(array_dims, slice_dims) + + # Build the new domain with NumPy's placement rule: the broadcast + # (correlated) dimensions sit where the advanced indices sat when those are + # adjacent, and lead when a slice separates them. + new_inclusive_min = [lo for lo, _ in slice_bounds[:n_before]] + new_exclusive_max = [hi for _, hi in slice_bounds[:n_before]] + new_inclusive_min.extend([0] * len(broadcast_shape)) + new_exclusive_max.extend(broadcast_shape) + new_inclusive_min.extend(lo for lo, _ in slice_bounds[n_before:]) + new_exclusive_max.extend(hi for _, hi in slice_bounds[n_before:]) + new_domain = IndexDomain( inclusive_min=tuple(new_inclusive_min), exclusive_max=tuple(new_exclusive_max), @@ -1139,36 +1772,27 @@ def _apply_vindex(transform: IndexTransform, selection: Any) -> IndexTransform: # dependency axes derived from the shape coincide — the signature # of a pointwise scatter rather than an outer product. broadcast_arr = array_dim_to_broadcast[d] - full_arr = broadcast_arr.reshape(broadcast_shape + (1,) * len(slice_dims)) - new_output.append( - ArrayMap( - index_array=full_arr, - offset=m.offset, - stride=m.stride, - ) + full_arr = broadcast_arr.reshape( + (1,) * n_before + broadcast_shape + (1,) * (len(slice_dims) - n_before) ) + new_output.append(array_map_or_constant(full_arr, offset=m.offset, stride=m.stride)) else: # Slice dim: new coord `origin + k` maps to old `start + k*step` start, step, origin = slice_dim_params[d] new_offset = m.offset + m.stride * (start - step * origin) new_stride = m.stride * step - new_input_dim = n_broadcast_dims + slice_dims.index(d) + position = slice_dims.index(d) + new_input_dim = position if position < n_before else position + n_broadcast_dims new_output.append( DimensionMap( input_dimension=new_input_dim, offset=new_offset, stride=new_stride ) ) else: - # m: ArrayMap (OutputIndexMap = ConstantMap | DimensionMap | ArrayMap) - _guard_fancy_after_fancy(m, array_dims) - new_arr = _reindex_array_oindex(m.index_array, processed, transform.domain) - new_output.append( - ArrayMap( - index_array=new_arr, - offset=m.offset, - stride=m.stride, - input_dimension=m.input_dimension, - ) + # m: ArrayMap — unreachable: array-carrying transforms took the + # composition path at the top of this function. + raise AssertionError( # noqa: TRY004 - unreachable, not a dispatch + "unreachable: ArrayMap transforms are composed" ) return IndexTransform(domain=new_domain, output=tuple(new_output)) @@ -1194,39 +1818,58 @@ def _resolve_slice_ts(sel: slice, dim: int, lo: int, hi: int) -> tuple[int, int, """Resolve a slice against domain `[lo, hi)` with TensorStore semantics. Slice bounds are **literal domain coordinates** — never from-the-end, never - clamped. Rules (each verified against tensorstore 0.1.84): - - - defaults: `start = lo`, `stop = hi`; + clamped. One rule covers both signs of the step (each part verified against + tensorstore 0.1.84, and matching ndsel 1.0-draft.2 section 5.3): + + - defaults follow the direction of travel: `start = lo`, `stop = hi` going + up; `start = hi - 1`, `stop = lo - 1` going down; + - the traversal runs from `start` toward `stop`, which is excluded, so the + source interval is `[start, stop)` going up and `[stop + 1, start + 1)` + going down; - a non-empty interval must be contained in the domain (no clamping — a NumPy-style out-of-range or negative bound is an error, not a shorter or wrapped result); - - an **empty** interval (`start == stop`) is valid anywhere; - - reversed bounds (`start > stop` with positive step) are an error, not - an empty result; - - the result's domain origin is `trunc(start/step)` (rounded toward - zero) and coordinate `origin + k` maps to input `start + k*step`. + - an empty interval is valid anywhere, for either sign; + - an interval running the wrong way (`stop` on the far side of `start` from + the direction of travel) is an error, not an empty result; + - the result's domain origin is `trunc(start/step)` — toward zero, for both + signs — and coordinate `origin + k` maps to input `start + k*step`. + + A negative step normally produces a negative origin: reversing a + zero-origin axis of length 20 gives the domain `[-19, 1)`. The coordinate + frame stays anchored to the source; a caller that needs non-negative + coordinates re-bases explicitly with `translate_domain_to`. Returns `(start, step, origin, size)` in domain coordinates. """ - step = 1 if sel.step is None else sel.step - if step <= 0: - # Negative steps are valid in TensorStore but not yet supported here; - # step 0 is invalid everywhere. - raise IndexError("slice step must be positive") - start = lo if sel.start is None else sel.start - stop = hi if sel.stop is None else sel.stop - if stop < start: + start_bound = None if sel.start is None else require_index(sel.start) + stop_bound = None if sel.stop is None else require_index(sel.stop) + step = 1 if sel.step is None else require_index(sel.step) + if step == 0: + raise IndexError("slice step must not be zero") + if step > 0: + start = lo if start_bound is None else start_bound + stop = hi if stop_bound is None else stop_bound + interval_lo, interval_hi = start, stop + else: + start = hi - 1 if start_bound is None else start_bound + stop = lo - 1 if stop_bound is None else stop_bound + interval_lo, interval_hi = stop + 1, start + 1 + length = interval_hi - interval_lo + if length < 0: raise IndexError( - f"slice interval [{start}, {stop}) with step {step} does not specify " - f"a valid interval for dimension {dim} (start > stop)" + f"slice from {start} to {stop} with step {step} does not specify a " + f"valid interval for dimension {dim}: the derived interval " + f"[{interval_lo}, {interval_hi}) runs the wrong way. An empty " + "selection is spelled stop == start." ) - size = -(-(stop - start) // step) # ceil((stop - start) / step) - if size > 0 and (start < lo or stop > hi): + if length > 0 and (interval_lo < lo or interval_hi > hi): hint = _LITERAL_HINT if (start < 0 or stop < 0) and lo >= 0 else "" raise BoundsCheckError( - f"slice interval [{start}, {stop}) is not contained within domain " - f"[{lo}, {hi}) for dimension {dim}{hint}" + f"slice interval [{interval_lo}, {interval_hi}) is not contained " + f"within domain [{lo}, {hi}) for dimension {dim}{hint}" ) + size = -(-length // abs(step)) # ceil(length / |step|) origin = _trunc_div(start, step) return start, step, origin, size @@ -1268,9 +1911,20 @@ def _validate_array_selection(selection: Any, shape: tuple[int, ...], mode: str) f"(single Boolean array) are supported; got {selection!r}" ) continue - if sel is Ellipsis or isinstance(sel, (int, np.integer)): + if sel is Ellipsis or as_scalar_index(sel) is not None: continue if isinstance(sel, (list, np.ndarray)): + if mode == "orthogonal": + array = np.asarray(sel) + # An orthogonal selection is per-axis, so an integer array names + # coordinates along one axis and can only be one-dimensional. + # Left to the engine, this surfaced much later as a rank + # complaint about an `index_array` the caller never wrote. + if array.dtype.kind in "iu" and array.ndim > 1: + raise IndexError( + f"integer arrays in an orthogonal selection must be " + f"1-dimensional only; got one with {array.ndim} dimensions" + ) continue raise IndexError(f"unsupported selection type for {mode} indexing: {type(sel)!r}") @@ -1282,30 +1936,6 @@ def _validate_basic_selection(selection: Any) -> None: """ items = selection if isinstance(selection, tuple) else (selection,) for s in items: - if s is Ellipsis or isinstance(s, (int, np.integer, slice)): + if s is Ellipsis or isinstance(s, slice) or as_scalar_index(s) is not None: continue raise IndexError(f"unsupported selection type for basic indexing: {type(s)!r}") - - -def selection_to_transform( - selection: Any, - transform: IndexTransform, - mode: Literal["basic", "orthogonal", "vectorized"], -) -> IndexTransform: - """Convert a user selection into a composed IndexTransform. - - Negative indices are treated as literal coordinates (TensorStore convention). - The caller (Array layer) is responsible for converting numpy-style negative - indices before calling this function. - """ - if mode == "basic": - _validate_basic_selection(selection) - return transform[selection] - elif mode == "orthogonal": - _validate_array_selection(selection, transform.domain.shape, mode) - return transform.oindex[selection] - elif mode == "vectorized": - _validate_array_selection(selection, transform.domain.shape, mode) - return transform.vindex[selection] - else: - raise ValueError(f"Unknown mode: {mode!r}") diff --git a/packages/zarr-indexing/tests/conformance/PROVENANCE.md b/packages/zarr-indexing/tests/conformance/PROVENANCE.md index 0a6faef60b..749a2810e7 100644 --- a/packages/zarr-indexing/tests/conformance/PROVENANCE.md +++ b/packages/zarr-indexing/tests/conformance/PROVENANCE.md @@ -5,9 +5,10 @@ The JSON fixtures in this directory (`point.json`, `box.json`, `slice.json`, unmodified**, from the ndsel reference repository. - **Source:** -- **Branch:** `main` (merge of d-v-b/ndsel#1, `fix/slice-origin-trunc`) -- **Commit:** `c59bc556c` (fixtures byte-identical to the previously vendored - `c132b4c1caa3205830ce35a42502363171f650a7`) +- **Branch:** `main` (merge of d-v-b/ndsel#3, empty `index_array` serialization) +- **Commit:** `49b9e1db1ca93c55f320b025a666367de87a9014` (previously vendored: + `92d6a32df0cd1ac47d548f14f42909a95997cf19`, before that `c59bc556c`, itself + byte-identical to `c132b4c1caa3205830ce35a42502363171f650a7`) - **Path in source:** `conformance/` **Do not edit these files.** They are vendored as-is so that @@ -18,3 +19,21 @@ corpus, re-vendor from a newer ndsel commit and update the commit SHA above. ndsel PR #1 (merged) corrected the `slice` desugaring origin from `floor(a/s)` to `trunc(a/s)` (rounding toward zero), which matches `zarr_indexing`' existing `_trunc_div` semantics. + +ndsel PR #2 (merged) specified negative `step`, which changed two fixtures: + +- `slice.json` gained the negative-step cases (full reverse, `|s| > 1` + non-divisible, negative-coordinate intervals, empty-at-any-coordinate). +- `errors.json` retired `error/negative-step` — the reason code + `negative_step_unsupported` is retired with it — and replaced it with three + `bounds_out_of_order` fixtures pinning that a reversed interval is an error + for either sign of the step, rather than being clamped to empty. + +Re-vendoring those two files and teaching `zarr_indexing.messages` the new +desugaring are one change: the corpus is the definition of correct here, so it +lands in the same commit as the code that satisfies it. + +ndsel PR #3 (merged) specified empty `index_array` serialization, adding two +fixtures to `transform.json`: `normalize` carries an empty `index_array` +verbatim (it is not rewritten to a constant map), while a producer SHOULD +collapse it to a constant output map — which `zarr_indexing.json` already does. diff --git a/packages/zarr-indexing/tests/conformance/errors.json b/packages/zarr-indexing/tests/conformance/errors.json index e5e08bab3c..072acd0af5 100644 --- a/packages/zarr-indexing/tests/conformance/errors.json +++ b/packages/zarr-indexing/tests/conformance/errors.json @@ -1,6 +1,8 @@ [ { "name": "error/step-zero", "input": { "kind": "slice", "start": [0], "stop": [4], "step": [0] }, "error": "step_zero" }, - { "name": "error/negative-step", "input": { "kind": "slice", "start": [9], "stop": [0], "step": [-2] }, "error": "negative_step_unsupported" }, + { "name": "error/slice-reversed-interval-unit-step", "input": { "kind": "slice", "start": [9], "stop": [0] }, "error": "bounds_out_of_order" }, + { "name": "error/slice-reversed-interval-positive-step", "input": { "kind": "slice", "start": [9], "stop": [0], "step": [2] }, "error": "bounds_out_of_order" }, + { "name": "error/slice-reversed-interval-negative-step", "input": { "kind": "slice", "start": [5], "stop": [6], "step": [-1] }, "error": "bounds_out_of_order" }, { "name": "error/multiple-upper-bounds", "input": { "kind": "box", "shape": [3], "exclusive_max": [3] }, "error": "multiple_upper_bounds" }, { "name": "error/rank-mismatch", "input": { "kind": "slice", "start": [0, 0], "stop": [4] }, "error": "rank_mismatch" }, { "name": "error/unknown-kind", "input": { "kind": "bogus" }, "error": "unknown_kind" }, diff --git a/packages/zarr-indexing/tests/conformance/slice.json b/packages/zarr-indexing/tests/conformance/slice.json index 2f1a0694ce..959ebc6247 100644 --- a/packages/zarr-indexing/tests/conformance/slice.json +++ b/packages/zarr-indexing/tests/conformance/slice.json @@ -57,5 +57,100 @@ "input_labels": [""], "output": [ { "offset": -2, "stride": 3, "input_dimension": 0 } ] } + }, + { + "name": "slice/negative-step-full-reverse", + "input": { "kind": "slice", "start": [19], "stop": [-1], "step": [-1] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [-19], "input_exclusive_max": [1], + "input_labels": [""], + "output": [ { "offset": 0, "stride": -1, "input_dimension": 0 } ] + } + }, + { + "name": "slice/negative-step-divisible-span", + "input": { "kind": "slice", "start": [15], "stop": [5], "step": [-2] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [-7], "input_exclusive_max": [-2], + "input_labels": [""], + "output": [ { "offset": 1, "stride": -2, "input_dimension": 0 } ] + } + }, + { + "name": "slice/negative-step-nondivisible-span", + "input": { "kind": "slice", "start": [15], "stop": [5], "step": [-4] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [-3], "input_exclusive_max": [0], + "input_labels": [""], + "output": [ { "offset": 3, "stride": -4, "input_dimension": 0 } ] + } + }, + { + "name": "slice/negative-step-down-to-zero", + "input": { "kind": "slice", "start": [9], "stop": [0], "step": [-2] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [-4], "input_exclusive_max": [1], + "input_labels": [""], + "output": [ { "offset": 1, "stride": -2, "input_dimension": 0 } ] + } + }, + { + "name": "slice/negative-step-negative-interval", + "input": { "kind": "slice", "start": [-1], "stop": [-6], "step": [-2] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [0], "input_exclusive_max": [3], + "input_labels": [""], + "output": [ { "offset": -1, "stride": -2, "input_dimension": 0 } ] + } + }, + { + "name": "slice/negative-step-negative-interval-step3", + "input": { "kind": "slice", "start": [-2], "stop": [-9], "step": [-3] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [0], "input_exclusive_max": [3], + "input_labels": [""], + "output": [ { "offset": -2, "stride": -3, "input_dimension": 0 } ] + } + }, + { + "name": "slice/negative-step-single-point", + "input": { "kind": "slice", "start": [5], "stop": [4], "step": [-3] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [-1], "input_exclusive_max": [0], + "input_labels": [""], + "output": [ { "offset": 2, "stride": -3, "input_dimension": 0 } ] + } + }, + { + "name": "slice/negative-step-empty", + "input": { "kind": "slice", "start": [5], "stop": [5], "step": [-1] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [-5], "input_exclusive_max": [-5], + "input_labels": [""], + "output": [ { "offset": 0, "stride": -1, "input_dimension": 0 } ] + } + }, + { + "name": "slice/negative-step-keeps-labels", + "input": { "kind": "slice", "start": [19], "stop": [-1], "step": [-1], "labels": ["x"] }, + "normalized": { + "input_rank": 1, "input_inclusive_min": [-19], "input_exclusive_max": [1], + "input_labels": ["x"], + "output": [ { "offset": 0, "stride": -1, "input_dimension": 0 } ] + } + }, + { + "name": "slice/2d-mixed-sign-step", + "input": { "kind": "slice", "start": [19, 0], "stop": [-1, 10], "step": [-1, 2] }, + "normalized": { + "input_rank": 2, + "input_inclusive_min": [-19, 0], + "input_exclusive_max": [1, 5], + "input_labels": ["", ""], + "output": [ + { "offset": 0, "stride": -1, "input_dimension": 0 }, + { "offset": 0, "stride": 2, "input_dimension": 1 } + ] + } } ] diff --git a/packages/zarr-indexing/tests/conformance/transform.json b/packages/zarr-indexing/tests/conformance/transform.json index f26157aaab..3d12fe3352 100644 --- a/packages/zarr-indexing/tests/conformance/transform.json +++ b/packages/zarr-indexing/tests/conformance/transform.json @@ -53,5 +53,42 @@ { "offset": 0, "stride": 1, "index_array": [1, 2, 3], "index_array_bounds": ["-inf", "+inf"] } ] } + }, + { + "name": "transform/empty-index-array-carried-verbatim", + "input": { + "kind": "transform", + "input_inclusive_min": [0, 0], + "input_exclusive_max": [0, 3], + "output": [{ "index_array": [] }, { "input_dimension": 1 }] + }, + "normalized": { + "input_rank": 2, "input_inclusive_min": [0, 0], "input_exclusive_max": [0, 3], + "input_labels": ["", ""], + "output": [ + { "offset": 0, "stride": 1, "index_array": [], "index_array_bounds": ["-inf", "+inf"] }, + { "offset": 0, "stride": 1, "input_dimension": 1 } + ] + } + }, + { + "name": "transform/empty-index-array-is-idempotent", + "input": { + "input_rank": 2, "input_inclusive_min": [0, 0], "input_exclusive_max": [0, 3], + "input_labels": ["", ""], + "kind": "transform", + "output": [ + { "offset": 0, "stride": 1, "index_array": [], "index_array_bounds": ["-inf", "+inf"] }, + { "offset": 0, "stride": 1, "input_dimension": 1 } + ] + }, + "normalized": { + "input_rank": 2, "input_inclusive_min": [0, 0], "input_exclusive_max": [0, 3], + "input_labels": ["", ""], + "output": [ + { "offset": 0, "stride": 1, "index_array": [], "index_array_bounds": ["-inf", "+inf"] }, + { "offset": 0, "stride": 1, "input_dimension": 1 } + ] + } } ] diff --git a/packages/zarr-indexing/tests/test_chunk_resolution.py b/packages/zarr-indexing/tests/test_chunk_resolution.py index 0738384e2b..fbd779f463 100644 --- a/packages/zarr-indexing/tests/test_chunk_resolution.py +++ b/packages/zarr-indexing/tests/test_chunk_resolution.py @@ -1,521 +1,598 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from typing import Any import numpy as np -from zarr.core.chunk_grids import ChunkGrid, FixedDimension, VaryingDimension - -from zarr_indexing import chunk_resolution -from zarr_indexing.chunk_resolution import iter_chunk_transforms, sub_transform_to_selections +import pytest +from hypothesis import assume, given +from hypothesis import strategies as st + +import zarr_indexing +from zarr_indexing import ( + ChunkGrid, + ChunkPlan, + ChunkProjection, + FixedDimension, + VaryingDimension, + chunk_resolution, + plan_chunks, +) from zarr_indexing.domain import IndexDomain +from zarr_indexing.grid import dimension_grids_from_chunks from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap from zarr_indexing.transform import IndexTransform -if TYPE_CHECKING: - import pytest - - -class TestChunkResolutionIdentity: - def test_single_chunk(self) -> None: - """Array fits in one chunk.""" - t = IndexTransform.from_shape((10,)) - grid = ChunkGrid(dimensions=(FixedDimension(size=10, extent=10),)) - results = list(iter_chunk_transforms(t, grid._dimensions)) - assert len(results) == 1 - coords, sub_t, _ = results[0] - assert coords == (0,) - assert sub_t.domain.shape == (10,) - - def test_multiple_chunks_1d(self) -> None: - """1D array spanning 3 chunks.""" - t = IndexTransform.from_shape((30,)) - grid = ChunkGrid(dimensions=(FixedDimension(size=10, extent=30),)) - results = list(iter_chunk_transforms(t, grid._dimensions)) - assert len(results) == 3 - coords_list = [r[0] for r in results] - assert (0,) in coords_list - assert (1,) in coords_list - assert (2,) in coords_list - - def test_multiple_chunks_2d(self) -> None: - """2D array spanning 2x3 chunks.""" - t = IndexTransform.from_shape((20, 30)) - grid = ChunkGrid( - dimensions=( - FixedDimension(size=10, extent=20), - FixedDimension(size=10, extent=30), + +def _storage_of(transform: IndexTransform, point: tuple[int, ...]) -> tuple[int, ...]: + """Evaluate the three map forms at one point, independently of planning.""" + result: list[int] = [] + for output_map in transform.output: + if isinstance(output_map, ConstantMap): + result.append(output_map.offset) + elif isinstance(output_map, DimensionMap): + result.append(output_map.offset + output_map.stride * point[output_map.input_dimension]) + else: + index = tuple( + 0 + if output_map.index_array.shape[axis] == 1 + else point[axis] - transform.domain.inclusive_min[axis] + for axis in range(output_map.index_array.ndim) ) - ) - results = list(iter_chunk_transforms(t, grid._dimensions)) - assert len(results) == 6 - coords_list = [r[0] for r in results] - assert (0, 0) in coords_list - assert (1, 2) in coords_list - - -class TestChunkResolutionSliced: - def test_slice_within_chunk(self) -> None: - """Slice that falls within a single chunk.""" - # Chunk resolution consumes zero-origin transforms: the I/O layer - # normalizes preserved (user-facing) domains via translate_domain_to - # before resolving, so mirror that contract here. - t = IndexTransform.from_shape((100,))[5:8].translate_domain_to((0,)) - grid = ChunkGrid(dimensions=(FixedDimension(size=10, extent=100),)) - results = list(iter_chunk_transforms(t, grid._dimensions)) - assert len(results) == 1 - coords, sub_t, _ = results[0] - assert coords == (0,) - assert isinstance(sub_t.output[0], DimensionMap) - assert sub_t.output[0].offset == 5 - - def test_slice_across_chunks(self) -> None: - """Slice that spans two chunks.""" - t = IndexTransform.from_shape((100,))[8:15] - grid = ChunkGrid(dimensions=(FixedDimension(size=10, extent=100),)) - results = list(iter_chunk_transforms(t, grid._dimensions)) - assert len(results) == 2 - coords_list = [r[0] for r in results] - assert (0,) in coords_list - assert (1,) in coords_list - - -class TestChunkResolutionConstant: - def test_integer_index(self) -> None: - """Integer index produces constant map — single chunk per constant dim.""" - t = IndexTransform.from_shape((100, 100))[25, :] - grid = ChunkGrid( - dimensions=( - FixedDimension(size=10, extent=100), - FixedDimension(size=10, extent=100), + result.append( + output_map.offset + output_map.stride * int(output_map.index_array[index]) ) + return tuple(result) + + +def _points(domain: IndexDomain) -> list[tuple[int, ...]]: + """Enumerate a small finite domain in its own coordinates.""" + return [ + tuple( + coordinate + origin + for coordinate, origin in zip(position, domain.inclusive_min, strict=True) ) - results = list(iter_chunk_transforms(t, grid._dimensions)) - assert len(results) == 10 - for coords, _, _ in results: - assert coords[0] == 2 - - -class TestChunkResolutionArray: - def test_array_index(self) -> None: - """Array index map — chunks determined by array values.""" - idx = np.array([5, 15, 25], dtype=np.intp) - t = IndexTransform( - domain=IndexDomain.from_shape((3,)), - output=(ArrayMap(index_array=idx),), + for position in np.ndindex(*domain.shape) + ] + + +def _count_intersect_calls(monkeypatch: pytest.MonkeyPatch) -> dict[str, int]: + """Count real intersections to protect touched-only candidate enumeration.""" + calls = {"n": 0} + original = IndexTransform.intersect + + def counting(self: IndexTransform, output_domain: IndexDomain) -> object: + calls["n"] += 1 + return original(self, output_domain) + + monkeypatch.setattr(IndexTransform, "intersect", counting) + return calls + + +def test_basic_plan_is_reiterable_and_projects_both_spaces() -> None: + """A plan can be revisited without losing either side of each projection.""" + transform = IndexTransform.from_shape((6,))[1:6] + grids = dimension_grids_from_chunks((3,), (6,)) + + plan = plan_chunks(transform, grids) + first = list(plan) + second = list(plan.projections()) + + assert isinstance(plan, ChunkPlan) + assert all(isinstance(projection, ChunkProjection) for projection in first) + assert [projection.chunk_coords for projection in first] == [(0,), (1,)] + assert [projection.chunk_domain for projection in first] == [ + IndexDomain((0,), (3,)), + IndexDomain((3,), (6,)), + ] + assert [projection.coverage for projection in first] == ["partial", "full"] + assert first == second + assert all( + projection.chunk_transform.domain == projection.cell_transform.domain + for projection in first + ) + assert all(projection.chunk_transform.domain.origin == (0,) for projection in first) + + +def test_projection_requires_one_shared_synthetic_domain() -> None: + """Paired transforms with different cell domains are rejected as incoherent.""" + with pytest.raises(ValueError, match="must share an input domain"): + ChunkProjection( + chunk_coords=(0,), + chunk_domain=IndexDomain.from_shape((3,)), + chunk_transform=IndexTransform.identity(IndexDomain.from_shape((2,))), + cell_transform=IndexTransform.identity(IndexDomain.from_shape((1,))), + coverage="partial", + ) + + +def test_projection_plan_is_the_only_public_chunk_resolution_surface() -> None: + """The greenfield API does not retain tuple or NumPy-selector bridges.""" + assert {"ChunkCoverage", "ChunkPlan", "ChunkProjection", "plan_chunks"} <= set( + zarr_indexing.__all__ + ) + assert "iter_chunk_transforms" not in zarr_indexing.__all__ + assert "sub_transform_to_selections" not in zarr_indexing.__all__ + + +def test_plan_rejects_grid_rank_different_from_transform_output_rank() -> None: + """A missing storage grid dimension is rejected before iteration.""" + transform = IndexTransform.from_shape((2, 3)) + + with pytest.raises(ValueError, match="1 grids for output rank 2"): + plan_chunks(transform, dimension_grids_from_chunks((2,), (2,))) + + +@pytest.mark.parametrize( + ("transform", "expected"), + [ + (IndexTransform.from_shape((5,)), ["full", "full"]), + (IndexTransform.from_shape((5,))[::-1], ["full", "full"]), + (IndexTransform.from_shape((5,))[::2], ["partial", "partial"]), + (IndexTransform.from_shape((5,))[2], ["partial"]), + ( + IndexTransform.from_shape((5,)).oindex[np.array([0, 1, 2, 3, 4])], + ["unknown", "unknown"], + ), + ], + ids=["clipped-edge", "reverse", "strided", "scalar", "fancy-is-conservative"], +) +def test_coverage_classification(transform: IndexTransform, expected: list[str]) -> None: + """Coverage is exact for affine requests and conservative for gathers.""" + grids = dimension_grids_from_chunks((3,), (5,)) + + assert [projection.coverage for projection in plan_chunks(transform, grids)] == expected + + +def test_repeated_input_dependency_is_not_full_coverage() -> None: + transform = IndexTransform( + domain=IndexDomain.from_shape((2,)), + output=(DimensionMap(input_dimension=0), DimensionMap(input_dimension=0)), + ) + grids = dimension_grids_from_chunks((2, 2), (2, 2)) + + assert [projection.coverage for projection in plan_chunks(transform, grids)] == ["partial"] + + +def test_unused_input_axis_is_not_full_coverage() -> None: + transform = IndexTransform( + domain=IndexDomain.from_shape((2, 2)), + output=(DimensionMap(input_dimension=0),), + ) + grids = dimension_grids_from_chunks((2,), (2,)) + + assert [projection.coverage for projection in plan_chunks(transform, grids)] == ["partial"] + + +@pytest.mark.parametrize( + ("transform", "grids"), + [ + ( + IndexTransform.from_shape((2, 3)), + dimension_grids_from_chunks((2, 3), (2, 3)), + ), + ( + IndexTransform( + domain=IndexDomain.from_shape((2, 3)), + output=(DimensionMap(input_dimension=1), DimensionMap(input_dimension=0)), + ), + dimension_grids_from_chunks((3, 2), (3, 2)), + ), + ( + IndexTransform.from_shape((2, 3))[::-1, ::-1], + dimension_grids_from_chunks((2, 3), (2, 3)), + ), + ( + IndexTransform( + domain=IndexDomain((4, 7), (6, 10)), + output=( + DimensionMap(input_dimension=0, offset=-4), + DimensionMap(input_dimension=1, offset=-7), + ), + ), + dimension_grids_from_chunks((2, 3), (2, 3)), + ), + ], + ids=["identity", "axis-permutation", "reversal", "translated-unit-affine"], +) +def test_bijective_unit_affine_transforms_retain_full_coverage( + transform: IndexTransform, grids: tuple[Any, ...] +) -> None: + assert [projection.coverage for projection in plan_chunks(transform, grids)] == ["full"] + + +def test_rank_zero_transform_has_full_coverage() -> None: + transform = IndexTransform.identity(IndexDomain((), ())) + + assert [projection.coverage for projection in plan_chunks(transform, ())] == ["full"] + + +@pytest.mark.parametrize( + ("transform", "grids", "expected_coords"), + [ + ( + IndexTransform.from_shape((30,)), + dimension_grids_from_chunks((10,), (30,)), + [(0,), (1,), (2,)], + ), + ( + IndexTransform.from_shape((20, 30)), + dimension_grids_from_chunks((10, 10), (20, 30)), + [(i, j) for i in range(2) for j in range(3)], + ), + ( + IndexTransform.from_shape((100, 100))[25, :], + dimension_grids_from_chunks((10, 10), (100, 100)), + [(2, j) for j in range(10)], + ), + ( + IndexTransform.from_shape((100,))[8:15], + dimension_grids_from_chunks((10,), (100,)), + [(0,), (1,)], + ), + ], + ids=["one-dimensional", "two-dimensional", "constant-map", "slice"], +) +def test_affine_plans_touch_the_expected_chunks( + transform: IndexTransform, + grids: tuple[Any, ...], + expected_coords: list[tuple[int, ...]], +) -> None: + """Identity, constant, and sliced transforms enumerate literal grid cells.""" + assert [projection.chunk_coords for projection in plan_chunks(transform, grids)] == ( + expected_coords + ) + + +@pytest.mark.parametrize( + ("transform", "grids"), + [ + ( + IndexTransform.from_shape((6,)).oindex[np.array([4, 0, 4, 2])], + dimension_grids_from_chunks((3,), (6,)), + ), + ( + IndexTransform.from_shape((4, 5)).oindex[np.array([3, 0]), np.array([4, 1, 1])], + dimension_grids_from_chunks(((1, 3), (2, 3)), (4, 5)), + ), + ( + IndexTransform.from_shape((2, 4, 5)).vindex[ + ..., np.array([3, 0, 3]), np.array([4, 1, 1]) + ], + dimension_grids_from_chunks((1, 2, 3), (2, 4, 5)), + ), + ], + ids=["repeated-oindex", "irregular-oindex", "vindex-with-residual"], +) +def test_projection_invariants_for_fancy_selections( + transform: IndexTransform, grids: tuple[Any, ...] +) -> None: + """Both transforms agree pointwise and cell ranges tile request space once.""" + plan = plan_chunks(transform, grids) + request_points: list[tuple[int, ...]] = [] + + for projection in plan: + assert projection.coverage == "unknown" + assert projection.chunk_transform.domain == projection.cell_transform.domain + for cell_point in _points(projection.cell_transform.domain): + request_point = _storage_of(projection.cell_transform, cell_point) + chunk_point = _storage_of(projection.chunk_transform, cell_point) + storage_point = _storage_of(plan.transform, request_point) + chunk_origin = projection.chunk_domain.inclusive_min + assert chunk_point == tuple( + value - origin for value, origin in zip(storage_point, chunk_origin, strict=True) + ) + assert all( + 0 <= value < extent + for value, extent in zip(chunk_point, projection.chunk_domain.shape, strict=True) + ) + request_points.append(request_point) + + assert sorted(request_points) == sorted(_points(transform.domain)) + + +@pytest.mark.parametrize( + "grid", + [ + pytest.param(FixedDimension(size=2, extent=4), id="fixed"), + pytest.param(VaryingDimension(edges=(1, 3), extent=4), id="varying"), + ], +) +def test_orthogonal_array_map_plan_rejects_coordinate_below_grid(grid: Any) -> None: + transform = IndexTransform( + domain=IndexDomain.from_shape((2,)), + output=(ArrayMap(np.array([-1, 1], dtype=np.intp)),), + ) + + # The sorted 1-D fast path reports the first offending coordinate. + with pytest.raises(IndexError, match=r"index -1 is out of bounds"): + list(plan_chunks(transform, (grid,))) + + +@pytest.mark.parametrize( + "grid", + [ + pytest.param(FixedDimension(size=2, extent=4), id="fixed"), + pytest.param(VaryingDimension(edges=(1, 3), extent=4), id="varying"), + ], +) +def test_orthogonal_array_map_plan_rejects_coordinate_above_grid(grid: Any) -> None: + transform = IndexTransform( + domain=IndexDomain.from_shape((2,)), + output=(ArrayMap(np.array([1, 4], dtype=np.intp)),), + ) + + # The sorted 1-D fast path reports the first offending coordinate. + with pytest.raises(IndexError, match=r"index 4 is out of bounds"): + list(plan_chunks(transform, (grid,))) + + +def test_nonempty_identity_plan_rejects_zero_size_fixed_dimension() -> None: + transform = IndexTransform.from_shape((4,)) + + with pytest.raises(ValueError, match="size must be > 0 when extent is nonzero"): + list(plan_chunks(transform, (FixedDimension(size=0, extent=4),))) + + +@given( + origin=st.integers(min_value=-4, max_value=4), + extent=st.integers(min_value=0, max_value=8), + stride=st.integers(min_value=-3, max_value=3), +) +def test_affine_projection_pairs_reconstruct_independent_source_coordinates( + origin: int, extent: int, stride: int +) -> None: + """Bounded literal-domain examples preserve every request/storage pair.""" + anchor = extent - 1 if stride < 0 else 0 + offset = anchor - stride * origin + expected_pairs = [ + ((coordinate,), (source_coordinate,)) + for coordinate in range(origin, origin + extent) + if 0 <= (source_coordinate := offset + stride * coordinate) < extent + ] + assume(expected_pairs) + + unrestricted = IndexTransform( + domain=IndexDomain((origin,), (origin + extent,)), + output=(DimensionMap(input_dimension=0, offset=offset, stride=stride),), + ) + intersection = unrestricted.intersect(IndexDomain.from_shape((extent,))) + assume(intersection is not None) + transform, _ = intersection + grids = dimension_grids_from_chunks((min(3, extent),), (extent,)) + + reconstructed_pairs = [ + ( + _storage_of(projection.cell_transform, cell_coordinate), + tuple( + local_coordinate + chunk_origin + for local_coordinate, chunk_origin in zip( + _storage_of(projection.chunk_transform, cell_coordinate), + projection.chunk_domain.inclusive_min, + strict=True, + ) + ), ) - grid = ChunkGrid(dimensions=(FixedDimension(size=10, extent=30),)) - results = list(iter_chunk_transforms(t, grid._dimensions)) - coords_list = [r[0] for r in results] - assert (0,) in coords_list - assert (1,) in coords_list - assert (2,) in coords_list + for projection in plan_chunks(transform, grids) + for cell_coordinate in _points(projection.cell_transform.domain) + ] + + assert sorted(reconstructed_pairs) == sorted(expected_pairs) + + +def test_correlated_projection_preserves_nonzero_request_coordinates() -> None: + base = IndexTransform.identity(IndexDomain((2, 5), (4, 8))) + transform = base.vindex[np.array([2, 3], dtype=np.intp), :] + grids = dimension_grids_from_chunks((2, 4), (4, 8)) + + points = [ + transform.apply(projection.cell_transform.apply(cell)) + for projection in plan_chunks(transform, grids) + for cell in _points(projection.cell_transform.domain) + ] + + assert sorted(points) == [(2, 5), (2, 6), (2, 7), (3, 5), (3, 6), (3, 7)] + + +def test_correlated_projection_preserves_translated_advanced_axis_coordinates() -> None: + transform = ( + IndexTransform.from_shape((4,)) + .vindex[np.array([0, 3], dtype=np.intp)] + .translate_domain_by((5,)) + ) + grids = dimension_grids_from_chunks((2,), (4,)) + + request_points = [ + projection.cell_transform.apply(cell) + for projection in plan_chunks(transform, grids) + for cell in _points(projection.cell_transform.domain) + ] + + assert sorted(request_points) == [(5,), (6,)] + + +def test_empty_request_has_no_projections() -> None: + """An empty fancy selection does not fabricate a touched chunk.""" + transform = IndexTransform.from_shape((10,)).oindex[np.array([], dtype=np.intp)] + grids = dimension_grids_from_chunks((3,), (10,)) + + assert list(plan_chunks(transform, grids)) == [] -class TestChunkResolutionSorted1D: - def test_matches_general_resolution_for_randomized_sorted_selections( +class TestSortedOneDimensionalPlan: + def test_matches_general_resolution_for_randomized_selections( self, monkeypatch: pytest.MonkeyPatch ) -> None: - """Direct partitioning matches the original resolver across varied inputs.""" + """The direct sorted path has the same paired transforms as intersection.""" rng = np.random.default_rng(0) grids = ( ChunkGrid(dimensions=(FixedDimension(size=7, extent=30),)), ChunkGrid(dimensions=(VaryingDimension(edges=(3, 4, 8, 5, 10), extent=30),)), ) - for grid in grids: for _ in range(50): - idx = np.sort(rng.integers(0, 30, size=int(rng.integers(1, 80)))).astype(np.intp) - transform = IndexTransform.from_shape((30,)).vindex[idx] - direct = list(iter_chunk_transforms(transform, grid._dimensions)) - + indices = np.sort(rng.integers(0, 30, size=int(rng.integers(1, 80)))).astype( + np.intp + ) + transform = IndexTransform.from_shape((30,)).vindex[indices] + direct = list(plan_chunks(transform, grid.dimensions)) with monkeypatch.context() as context: context.setattr( chunk_resolution, - "_one_dimensional_correlated_array_map", + "_one_dimensional_array_map", lambda _transform: None, ) - general = list(iter_chunk_transforms(transform, grid._dimensions)) + general = list(plan_chunks(transform, grid.dimensions)) + assert direct == general - assert [result[0] for result in direct] == [result[0] for result in general] - for direct_result, general_result in zip(direct, general, strict=True): - _, direct_t, direct_out = direct_result - _, general_t, general_out = general_result - assert direct_t.domain == general_t.domain - - direct_chunk_sel, direct_out_sel, direct_drop = sub_transform_to_selections( - direct_t, direct_out - ) - general_chunk_sel, general_out_sel, general_drop = sub_transform_to_selections( - general_t, general_out - ) - assert direct_drop == general_drop - np.testing.assert_array_equal(direct_chunk_sel[0], general_chunk_sel[0]) - np.testing.assert_array_equal(direct_out_sel[0], general_out_sel[0]) - - def test_sorted_vindex_partitions_chunks_without_intersection( - self, monkeypatch: pytest.MonkeyPatch - ) -> None: - """Sorted vectorized coordinates are sliced directly per touched chunk.""" - idx = np.array([0, 3, 4, 4, 9, 11], dtype=np.intp) - t = IndexTransform.from_shape((12,)).vindex[idx] + def test_sorted_coordinates_bypass_intersection(self, monkeypatch: pytest.MonkeyPatch) -> None: + """Sorted coordinates partition directly at touched chunk boundaries.""" + transform = IndexTransform.from_shape((12,)).vindex[ + np.array([0, 3, 4, 4, 9, 11], dtype=np.intp) + ] grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=12),)) - calls = _count_intersect_calls(monkeypatch) - results = list(iter_chunk_transforms(t, grid._dimensions)) - assert [result[0] for result in results] == [(0,), (1,), (2,)] + projections = list(plan_chunks(transform, grid.dimensions)) + + assert [projection.chunk_coords for projection in projections] == [(0,), (1,), (2,)] assert calls["n"] == 0 + assert [ + [ + _storage_of(projection.cell_transform, point)[0] + for point in _points(projection.cell_transform.domain) + ] + for projection in projections + ] == [[0, 1], [2, 3], [4, 5]] + + def test_unsorted_coordinates_use_intersection(self, monkeypatch: pytest.MonkeyPatch) -> None: + """Unsorted coordinates retain the general intersection path.""" + transform = IndexTransform.from_shape((12,)).vindex[np.array([9, 0, 4], dtype=np.intp)] + grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=12),)) + calls = _count_intersect_calls(monkeypatch) - expected_chunk_indices = ([0, 3], [0, 0], [1, 3]) - expected_out_indices = ([0, 1], [2, 3], [4, 5]) - for result, expected_chunk, expected_out in zip( - results, expected_chunk_indices, expected_out_indices, strict=True - ): - _, sub_t, out_indices = result - chunk_sel, out_sel, drop_axes = sub_transform_to_selections(sub_t, out_indices) - np.testing.assert_array_equal(chunk_sel[0], expected_chunk) - np.testing.assert_array_equal(out_sel[0], expected_out) - assert drop_axes == () - - def test_sorted_array_map_preserves_offset_and_stride(self) -> None: - """Storage partitioning retains the ArrayMap's offset and stride.""" - t = IndexTransform( - domain=IndexDomain.from_shape((3,)), - output=( - ArrayMap( - index_array=np.array([0, 1, 2], dtype=np.intp), - offset=1, - stride=3, - ), - ), - ) - grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=8),)) - - results = list(iter_chunk_transforms(t, grid._dimensions)) - - assert [result[0] for result in results] == [(0,), (1,)] - expected_chunk_indices = ([1], [0, 3]) - expected_out_indices = ([0], [1, 2]) - for result, expected_chunk, expected_out in zip( - results, expected_chunk_indices, expected_out_indices, strict=True - ): - _, sub_t, out_indices = result - chunk_sel, out_sel, _ = sub_transform_to_selections(sub_t, out_indices) - np.testing.assert_array_equal(chunk_sel[0], expected_chunk) - np.testing.assert_array_equal(out_sel[0], expected_out) - - def test_sorted_vindex_with_varying_chunks(self) -> None: - """Touched-boundary searches also support a non-uniform 1-D grid.""" - idx = np.array([0, 1, 2, 3, 5, 9], dtype=np.intp) - t = IndexTransform.from_shape((10,)).vindex[idx] - grid = ChunkGrid(dimensions=(VaryingDimension(edges=(2, 3, 5), extent=10),)) - - results = list(iter_chunk_transforms(t, grid._dimensions)) - - assert [result[0] for result in results] == [(0,), (1,), (2,)] - expected_chunk_indices = ([0, 1], [0, 1], [0, 4]) - for result, expected_chunk in zip(results, expected_chunk_indices, strict=True): - _, sub_t, out_indices = result - chunk_sel, _, _ = sub_transform_to_selections(sub_t, out_indices) - np.testing.assert_array_equal(chunk_sel[0], expected_chunk) - - def test_sorted_vindex_with_zero_sized_dimension_uses_general_resolution( - self, monkeypatch: pytest.MonkeyPatch - ) -> None: - """A zero-sized grid cannot be partitioned by touched boundaries.""" - t = IndexTransform.from_shape((10,)).vindex[np.array([1], dtype=np.intp)] - grid = ChunkGrid(dimensions=(FixedDimension(size=0, extent=10),)) + projections = list(plan_chunks(transform, grid.dimensions)) - calls = _count_intersect_calls(monkeypatch) - results = list(iter_chunk_transforms(t, grid._dimensions)) + assert [projection.chunk_coords for projection in projections] == [(0,), (1,), (2,)] + assert calls["n"] == 3 - assert results == [] - assert calls["n"] == 1 - def test_unsorted_vindex_uses_general_resolution(self, monkeypatch: pytest.MonkeyPatch) -> None: - """Unsorted coordinates continue through the general intersection logic.""" - t = IndexTransform.from_shape((12,)).vindex[np.array([9, 0, 4], dtype=np.intp)] - grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=12),)) +class CountingUnitGrid: + """A real unit grid that counts every planner-grid operation.""" - calls = _count_intersect_calls(monkeypatch) - results = list(iter_chunk_transforms(t, grid._dimensions)) + def __init__(self, extent: int) -> None: + self._grid = FixedDimension(size=1, extent=extent) + self.calls = 0 - assert [result[0] for result in results] == [(0,), (1,), (2,)] - assert calls["n"] == 3 + def index_to_chunk(self, idx: int) -> int: + self.calls += 1 + return self._grid.index_to_chunk(idx) - def test_sorted_oindex_uses_general_resolution(self, monkeypatch: pytest.MonkeyPatch) -> None: - """Orthogonal ArrayMaps retain their existing domain-aware resolution.""" - t = IndexTransform.from_shape((12,)).oindex[np.array([0, 4, 9], dtype=np.intp)] - grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=12),)) + def chunk_offset(self, chunk_ix: int) -> int: + self.calls += 1 + return self._grid.chunk_offset(chunk_ix) - calls = _count_intersect_calls(monkeypatch) - results = list(iter_chunk_transforms(t, grid._dimensions)) + def chunk_size(self, chunk_ix: int) -> int: + self.calls += 1 + return self._grid.chunk_size(chunk_ix) - assert [result[0] for result in results] == [(0,), (1,), (2,)] - assert calls["n"] == 3 + def indices_to_chunks( + self, indices: np.ndarray[Any, np.dtype[np.intp]] + ) -> np.ndarray[Any, np.dtype[np.intp]]: + self.calls += 1 + return self._grid.indices_to_chunks(indices) -def _count_intersect_calls(monkeypatch: pytest.MonkeyPatch) -> dict[str, int]: - """Wrap `IndexTransform.intersect` with a call counter. +def test_sparse_affine_plan_does_not_visit_intervening_chunks() -> None: + grid = CountingUnitGrid(extent=100_001) + transform = IndexTransform.from_shape((100_001,))[::100_000] - Returns a mutable dict whose `"n"` entry is the number of times - `intersect` is invoked. Used to assert that candidate-chunk enumeration is - proportional to the *touched* chunks, not the dense bounding box between the - min and max touched chunk. - """ - calls = {"n": 0} - original = IndexTransform.intersect + assert [projection.chunk_coords for projection in plan_chunks(transform, (grid,))] == [ + (0,), + (100_000,), + ] + assert grid.calls <= 12 - def counting(self: IndexTransform, output_domain: IndexDomain) -> object: - calls["n"] += 1 - return original(self, output_domain) - monkeypatch.setattr(IndexTransform, "intersect", counting) - return calls +def test_sparse_affine_plan_handles_large_origin_cancellation() -> None: + origin = int(np.iinfo(np.intp).max) + transform = IndexTransform( + domain=IndexDomain((origin,), (origin + 2,)), + output=(DimensionMap(input_dimension=0, offset=-2 * origin, stride=2),), + ) + grids = dimension_grids_from_chunks((1,), (3,)) + assert [projection.chunk_coords for projection in plan_chunks(transform, grids)] == [ + (0,), + (2,), + ] -class TestChunkResolutionTouchedOnly: - """`iter_chunk_transforms` must enumerate only the chunks a fancy selection - actually touches — never the dense `range(min_chunk, max_chunk + 1)` bounding - box. These guard against a regression to bounding-box enumeration, whose cost - scales with grid size rather than with the number of selected coordinates. - """ - def test_1d_sparse_vindex_enumerates_only_touched_chunks( +class TestTouchedOnlyCandidateEnumeration: + def test_sparse_one_dimensional_selection_skips_the_dense_span( self, monkeypatch: pytest.MonkeyPatch ) -> None: - """Two far-apart coordinates on a 1000-chunk grid touch exactly 2 chunks. - - A dense bounding-box enumeration would intersect ~1000 candidate chunks; - touched-only enumeration intersects exactly 2. - """ - # 4000 elements, chunk size 4 -> 1000 chunks. coords 1 and 3997 land in - # chunk 0 and chunk 999 respectively (998 empty chunks between them). + """Two sorted points on a 1000-cell grid require no intersections.""" + transform = IndexTransform.from_shape((4000,)).vindex[np.array([1, 3997], dtype=np.intp)] grid = ChunkGrid(dimensions=(FixedDimension(size=4, extent=4000),)) - t = IndexTransform.from_shape((4000,)).vindex[np.array([1, 3997], dtype=np.intp)] - calls = _count_intersect_calls(monkeypatch) - results = list(iter_chunk_transforms(t, grid._dimensions)) - coords = sorted(r[0] for r in results) - assert coords == [(0,), (999,)] - # Sorted 1-D coordinates are partitioned directly, without intersecting - # either the touched chunks or the 998 empty chunks between them. + projections = list(plan_chunks(transform, grid.dimensions)) + + assert [projection.chunk_coords for projection in projections] == [(0,), (999,)] assert calls["n"] == 0 - def test_2d_orthogonal_enumerates_only_touched_chunks( - self, monkeypatch: pytest.MonkeyPatch + @pytest.mark.parametrize( + ("mode", "expected_coords", "expected_calls"), + [ + ("orthogonal", [(0, 0), (0, 999), (999, 0), (999, 999)], 4), + ("correlated", [(0, 0), (999, 999)], 2), + ], + ) + def test_sparse_two_dimensional_selection_uses_only_touched_combinations( + self, + monkeypatch: pytest.MonkeyPatch, + mode: str, + expected_coords: list[tuple[int, int]], + expected_calls: int, ) -> None: - """Orthogonal outer product of two 2-coordinate arrays touches 2x2 chunks. - - Per-dimension distinct touched chunks: {0, 999} on each axis. The outer - product is 2*2 = 4 candidate chunks (all survive), versus ~1e6 for a - dense 1000x1000 bounding box. - """ - grid = ChunkGrid( - dimensions=( - FixedDimension(size=4, extent=4000), - FixedDimension(size=4, extent=4000), - ) + """Orthogonal points use their outer product; correlated points remain paired.""" + base = IndexTransform.from_shape((4000, 4000)) + first = np.array([1, 3997], dtype=np.intp) + second = np.array([2, 3998], dtype=np.intp) + transform = ( + base.oindex[first, second] if mode == "orthogonal" else base.vindex[first, second] ) - t = IndexTransform.from_shape((4000, 4000)).oindex[ - np.array([1, 3997], dtype=np.intp), np.array([2, 3998], dtype=np.intp) - ] - - calls = _count_intersect_calls(monkeypatch) - results = list(iter_chunk_transforms(t, grid._dimensions)) - - coords = sorted(r[0] for r in results) - assert coords == [(0, 0), (0, 999), (999, 0), (999, 999)] - assert calls["n"] == 4 - - def test_2d_correlated_vindex_enumerates_joint_touched_chunks( - self, monkeypatch: pytest.MonkeyPatch - ) -> None: - """Two correlated (vindex) coordinate arrays scatter to 2 diagonal chunks. - - The two points (1, 2) and (3997, 3998) touch chunks (0, 0) and - (999, 999). Correlated coordinate arrays are grouped *jointly*, so - enumeration intersects exactly the 2 touched chunks — never the 2x2 - cartesian product of per-dimension distinct chunks, and never the dense - 1e6 grid. - """ grid = ChunkGrid( dimensions=( FixedDimension(size=4, extent=4000), FixedDimension(size=4, extent=4000), ) ) - t = IndexTransform.from_shape((4000, 4000)).vindex[ - np.array([1, 3997], dtype=np.intp), np.array([2, 3998], dtype=np.intp) - ] - calls = _count_intersect_calls(monkeypatch) - results = list(iter_chunk_transforms(t, grid._dimensions)) - coords = sorted(r[0] for r in results) - assert coords == [(0, 0), (999, 999)] - assert calls["n"] == 2 + projections = list(plan_chunks(transform, grid.dimensions)) - def test_2d_correlated_vindex_diagonal_is_linear_in_points( + assert sorted(projection.chunk_coords for projection in projections) == expected_coords + assert calls["n"] == expected_calls + + def test_correlated_diagonal_scales_with_points_not_their_product( self, monkeypatch: pytest.MonkeyPatch ) -> None: - """A diagonal of P correlated points touches P chunks with O(P) intersections. - - Enumerating the cartesian product of per-dimension distinct chunk sets - would cost P**2 intersections (2500 here) — quadratic in the number of - selected points for the scattered selections of zarr-python gh-4174. - Joint grouping keeps resolution work proportional to the touched chunks. - """ - p = 50 + """Fifty diagonal points require fifty, rather than 2500, intersections.""" + n_points = 50 + coordinates = np.arange(n_points, dtype=np.intp) * 8 + transform = IndexTransform.from_shape((4000, 4000)).vindex[coordinates, coordinates] grid = ChunkGrid( dimensions=( FixedDimension(size=4, extent=4000), FixedDimension(size=4, extent=4000), ) ) - # point i lands in chunk (2i, 2i): all per-dimension chunks distinct - coords_1d = np.arange(p, dtype=np.intp) * 8 - t = IndexTransform.from_shape((4000, 4000)).vindex[coords_1d, coords_1d] - calls = _count_intersect_calls(monkeypatch) - results = list(iter_chunk_transforms(t, grid._dimensions)) - assert sorted(r[0] for r in results) == [(2 * i, 2 * i) for i in range(p)] - assert calls["n"] == p + projections = list(plan_chunks(transform, grid.dimensions)) - -class TestSubTransformToSelections: - def test_constant_map(self) -> None: - """ConstantMap produces int selection + drop axis.""" - t = IndexTransform( - domain=IndexDomain.from_shape((10,)), - output=(ConstantMap(offset=5),), - ) - chunk_sel, out_sel, drop_axes = sub_transform_to_selections(t) - assert chunk_sel == (5,) - assert out_sel == () - assert drop_axes == () - - def test_dimension_map_stride_1(self) -> None: - """DimensionMap with stride=1 produces contiguous slice.""" - t = IndexTransform( - domain=IndexDomain.from_shape((10,)), - output=(DimensionMap(input_dimension=0, offset=3, stride=1),), - ) - chunk_sel, out_sel, drop_axes = sub_transform_to_selections(t) - assert chunk_sel == (slice(3, 13, 1),) - assert out_sel == (slice(0, 10),) - assert drop_axes == () - - def test_dimension_map_strided(self) -> None: - """DimensionMap with stride>1 produces strided slice.""" - t = IndexTransform( - domain=IndexDomain.from_shape((5,)), - output=(DimensionMap(input_dimension=0, offset=2, stride=3),), - ) - chunk_sel, out_sel, drop_axes = sub_transform_to_selections(t) - assert chunk_sel == (slice(2, 17, 3),) - assert out_sel == (slice(0, 5),) - assert drop_axes == () - - def test_array_map(self) -> None: - """ArrayMap produces integer array selection.""" - arr = np.array([1, 5, 9], dtype=np.intp) - t = IndexTransform( - domain=IndexDomain.from_shape((3,)), - output=(ArrayMap(index_array=arr, offset=0, stride=1),), - ) - chunk_sel, out_sel, drop_axes = sub_transform_to_selections(t) - assert isinstance(chunk_sel[0], np.ndarray) - np.testing.assert_array_equal(chunk_sel[0], arr) - # Without chunk_mask, out_sel falls back to domain-based slices - assert out_sel == (slice(0, 3),) - assert drop_axes == () - - def test_array_map_with_offset_stride(self) -> None: - """ArrayMap with offset and stride computes storage coords.""" - arr = np.array([0, 1, 2], dtype=np.intp) - t = IndexTransform( - domain=IndexDomain.from_shape((3,)), - output=(ArrayMap(index_array=arr, offset=10, stride=5),), - ) - chunk_sel, _out_sel, drop_axes = sub_transform_to_selections(t) - assert isinstance(chunk_sel[0], np.ndarray) - np.testing.assert_array_equal(chunk_sel[0], np.array([10, 15, 20])) - assert drop_axes == () - - def test_mixed_maps_2d(self) -> None: - """Mix of ConstantMap and DimensionMap.""" - t = IndexTransform( - domain=IndexDomain.from_shape((10,)), - output=( - ConstantMap(offset=5), - DimensionMap(input_dimension=0, offset=0, stride=1), - ), - ) - chunk_sel, _out_sel, drop_axes = sub_transform_to_selections(t) - assert chunk_sel[0] == 5 - assert chunk_sel[1] == slice(0, 10, 1) - # drop_axes is empty — integer in chunk_sel naturally drops the dim via numpy - assert drop_axes == () - - -class TestChunkResolutionArrayMapFlavours: - """Chunk resolution must yield outer-product (np.ix_) selectors for - orthogonal ArrayMaps and shared flat-scatter selectors for correlated ones, - and must return early for empty fancy selections.""" - - def test_empty_array_selection_yields_nothing(self) -> None: - """An empty ArrayMap selection produces no chunk transforms (no crash).""" - t = IndexTransform( - domain=IndexDomain.from_shape((0,)), - output=(ArrayMap(index_array=np.array([], dtype=np.intp)),), - ) - grid = ChunkGrid(dimensions=(FixedDimension(size=3, extent=10),)) - assert list(iter_chunk_transforms(t, grid._dimensions)) == [] - - def test_orthogonal_outer_product_selectors(self) -> None: - """Two independent arrays produce np.ix_-style (mesh) chunk/out selectors.""" - t = IndexTransform.from_shape((10, 10)).oindex[np.array([1, 3]), np.array([2, 4, 6])] - grid = ChunkGrid( - dimensions=(FixedDimension(size=10, extent=10), FixedDimension(size=10, extent=10)) - ) - results = list(iter_chunk_transforms(t, grid._dimensions)) - assert len(results) == 1 - _coords, sub_t, out_indices = results[0] - chunk_sel, out_sel, drop_axes = sub_transform_to_selections(sub_t, out_indices) - # np.ix_ produces one 2-D open-mesh selector per axis, for both sides. - assert len(chunk_sel) == 2 - assert len(out_sel) == 2 - assert isinstance(chunk_sel[0], np.ndarray) - assert isinstance(chunk_sel[1], np.ndarray) - assert chunk_sel[0].shape == (2, 1) - assert chunk_sel[1].shape == (1, 3) - assert drop_axes == () - - def test_correlated_scatter_with_residual_slice(self) -> None: - """Correlated arrays + a residual slice dim scatter through a single flat - index whose shape matches the (points, slice) block read from the chunk.""" - t = IndexTransform.from_shape((4, 3, 5)).vindex[np.array([1, 3]), np.array([2, 0])] - grid = ChunkGrid( - dimensions=( - FixedDimension(size=4, extent=4), - FixedDimension(size=3, extent=3), - FixedDimension(size=5, extent=5), - ) - ) - # One chunk holds everything: both points survive, slice dim spans [0,5). - results = list(iter_chunk_transforms(t, grid._dimensions)) - assert len(results) == 1 - _coords, sub_t, out_indices = results[0] - chunk_sel, out_sel, _drop = sub_transform_to_selections(sub_t, out_indices) - # Chunk side: flat coordinate arrays for the two correlated dims plus a - # slice for the residual dim. - assert len(chunk_sel) == 3 - np.testing.assert_array_equal(np.asarray(chunk_sel[0]), [1, 3]) - np.testing.assert_array_equal(np.asarray(chunk_sel[1]), [2, 0]) - assert chunk_sel[2] == slice(0, 5, 1) - # Output side: a single flat scatter index of shape (points, slice) = (2, 5). - assert len(out_sel) == 1 - assert np.asarray(out_sel[0]).shape == (2, 5) + assert sorted(projection.chunk_coords for projection in projections) == [ + (2 * index, 2 * index) for index in range(n_points) + ] + assert calls["n"] == n_points diff --git a/packages/zarr-indexing/tests/test_composition.py b/packages/zarr-indexing/tests/test_composition.py index dd92f59b80..0cb6155344 100644 --- a/packages/zarr-indexing/tests/test_composition.py +++ b/packages/zarr-indexing/tests/test_composition.py @@ -3,8 +3,8 @@ import numpy as np import pytest -from zarr_indexing.composition import compose from zarr_indexing.domain import IndexDomain +from zarr_indexing.errors import BoundsCheckError from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap from zarr_indexing.transform import IndexTransform @@ -18,7 +18,7 @@ def test_constant_inner_any_outer(self) -> None: domain=IndexDomain.from_shape((5,)), output=(ConstantMap(offset=42),), ) - result = compose(outer, inner) + result = outer.compose(inner) assert isinstance(result.output[0], ConstantMap) assert result.output[0].offset == 42 @@ -35,27 +35,40 @@ def test_dimension_inner_constant_outer(self) -> None: domain=IndexDomain.from_shape((10,)), output=(DimensionMap(input_dimension=0, offset=10, stride=3),), ) - result = compose(outer, inner) + result = outer.compose(inner) assert isinstance(result.output[0], ConstantMap) assert result.output[0].offset == 25 + def test_dimension_inner_constant_outer_rejects_affine_overflow(self) -> None: + outer = IndexTransform( + domain=IndexDomain.from_shape((1,)), + output=(ConstantMap(offset=2**62),), + ) + inner = IndexTransform( + domain=IndexDomain((2**62,), (2**62 + 1,)), + output=(DimensionMap(input_dimension=0, stride=4),), + ) + + with pytest.raises(OverflowError, match="outside np.intp"): + outer.compose(inner) + def test_dimension_inner_dimension_outer(self) -> None: outer = IndexTransform( - domain=IndexDomain.from_shape((10,)), + domain=IndexDomain.from_shape((3,)), output=(DimensionMap(input_dimension=0, offset=5, stride=2),), ) inner = IndexTransform( domain=IndexDomain.from_shape((10,)), output=(DimensionMap(input_dimension=0, offset=10, stride=3),), ) - result = compose(outer, inner) + result = outer.compose(inner) assert isinstance(result.output[0], DimensionMap) assert result.output[0].offset == 25 assert result.output[0].stride == 6 assert result.output[0].input_dimension == 0 def test_dimension_inner_array_outer(self) -> None: - arr = np.array([0, 2, 4], dtype=np.intp) + arr = np.array([0, 1, 2], dtype=np.intp) outer = IndexTransform( domain=IndexDomain.from_shape((3,)), output=(ArrayMap(index_array=arr, offset=5, stride=2),), @@ -64,7 +77,7 @@ def test_dimension_inner_array_outer(self) -> None: domain=IndexDomain.from_shape((10,)), output=(DimensionMap(input_dimension=0, offset=10, stride=3),), ) - result = compose(outer, inner) + result = outer.compose(inner) assert isinstance(result.output[0], ArrayMap) assert result.output[0].offset == 25 assert result.output[0].stride == 6 @@ -84,10 +97,23 @@ def test_array_inner_constant_outer(self) -> None: domain=IndexDomain.from_shape((3,)), output=(ArrayMap(index_array=inner_arr, offset=0, stride=1),), ) - result = compose(outer, inner) + result = outer.compose(inner) assert isinstance(result.output[0], ConstantMap) assert result.output[0].offset == 20 + def test_array_inner_constant_outer_rejects_affine_overflow(self) -> None: + outer = IndexTransform( + domain=IndexDomain.from_shape((1,)), + output=(ConstantMap(offset=0),), + ) + inner = IndexTransform( + domain=IndexDomain.from_shape((1,)), + output=(ArrayMap(np.array([2**62], dtype=np.intp), stride=4),), + ) + + with pytest.raises(OverflowError, match="outside np.intp"): + outer.compose(inner) + def test_array_inner_array_outer(self) -> None: outer_arr = np.array([0, 2, 1], dtype=np.intp) inner_arr = np.array([10, 20, 30], dtype=np.intp) @@ -99,17 +125,104 @@ def test_array_inner_array_outer(self) -> None: domain=IndexDomain.from_shape((3,)), output=(ArrayMap(index_array=inner_arr, offset=0, stride=1),), ) - result = compose(outer, inner) + result = outer.compose(inner) assert isinstance(result.output[0], ArrayMap) expected = np.array([10, 30, 20], dtype=np.intp) np.testing.assert_array_equal(result.output[0].index_array, expected) +def _storage_of(transform: IndexTransform, point: tuple[int, ...]) -> tuple[int, ...]: + """The storage coordinates a transform assigns to one input point. + + The point is given in the transform's own domain coordinates; an index array + carries the full input rank, singleton on the axes it does not vary over, and + is addressed positionally from the domain origin. + """ + coords: list[int] = [] + for m in transform.output: + if isinstance(m, ConstantMap): + coords.append(m.offset) + elif isinstance(m, DimensionMap): + coords.append(m.offset + m.stride * point[m.input_dimension]) + else: + origin = transform.domain.inclusive_min + idx = tuple( + 0 if m.index_array.shape[axis] == 1 else point[axis] - origin[axis] + for axis in range(m.index_array.ndim) + ) + coords.append(m.offset + m.stride * int(m.index_array[idx])) + return tuple(coords) + + +def _assert_composes_pointwise(outer: IndexTransform, inner: IndexTransform) -> None: + """`outer.compose(inner)` must agree with running the two in sequence.""" + composed = outer.compose(inner) + assert composed.domain == outer.domain + lo = outer.domain.inclusive_min + hi = outer.domain.exclusive_max + for coord in np.ndindex(*outer.domain.shape): + point = tuple(int(c) + int(o) for c, o in zip(coord, lo, strict=True)) + assert all(point[d] < hi[d] for d in range(len(hi))) + intermediate = _storage_of(outer, point) + assert _storage_of(composed, point) == _storage_of(inner, intermediate) + + +class TestComposeOverANonZeroOriginDomain: + """The outer domain need not start at 0 — a step-1 slice preserves its + literal bounds and a negative step produces a negative origin — so the inner + map has to be evaluated over the outer domain's real range.""" + + def test_array_inner_sliced_outer(self) -> None: + inner = IndexTransform.from_shape((10,)).oindex[np.array([3, 1, 4, 1, 5])] + outer = IndexTransform.identity(IndexDomain.from_shape((5,)))[1:4] + assert outer.domain.inclusive_min == (1,) + result = outer.compose(inner) + assert isinstance(result.output[0], ArrayMap) + np.testing.assert_array_equal( + result.output[0].index_array, np.array([1, 4, 1], dtype=np.intp) + ) + _assert_composes_pointwise(outer, inner) + + def test_array_inner_reversed_outer(self) -> None: + inner = IndexTransform.from_shape((10,)).oindex[np.array([3, 1, 4, 1, 5])] + outer = IndexTransform.identity(IndexDomain.from_shape((5,)))[::-1] + assert outer.domain.inclusive_min == (-4,) + result = outer.compose(inner) + assert isinstance(result.output[0], ArrayMap) + np.testing.assert_array_equal( + result.output[0].index_array, np.array([5, 1, 4, 1, 3], dtype=np.intp) + ) + _assert_composes_pointwise(outer, inner) + + def test_array_inner_strided_outer(self) -> None: + inner = IndexTransform.from_shape((10,)).oindex[np.array([3, 1, 4, 1, 5, 9])] + outer = IndexTransform.identity(IndexDomain.from_shape((6,)))[1::2] + _assert_composes_pointwise(outer, inner) + + def test_array_inner_translated_outer(self) -> None: + inner = IndexTransform.from_shape((10,)).oindex[np.array([3, 1, 4, 1, 5])] + outer = IndexTransform.identity(IndexDomain.from_shape((5,))).translate_domain_to((-2,)) + _assert_composes_pointwise(outer, inner) + + def test_array_inner_array_outer_over_a_shifted_domain(self) -> None: + inner = IndexTransform.from_shape((10,)).oindex[np.array([3, 1, 4, 1, 5])] + outer = IndexTransform.from_shape((5,)).oindex[np.array([4, 0, 2])] + _assert_composes_pointwise(outer, inner) + + def test_array_inner_constant_outer_over_a_shifted_domain(self) -> None: + inner = IndexTransform.from_shape((10,)).oindex[np.array([3, 1, 4, 1, 5])] + outer = IndexTransform( + domain=IndexDomain.from_shape((4,)), + output=(ConstantMap(offset=3),), + ) + _assert_composes_pointwise(outer, inner) + + class TestComposeMultiDim: def test_2d_identity_compose(self) -> None: a = IndexTransform.from_shape((10, 20)) b = IndexTransform.from_shape((10, 20)) - result = compose(a, b) + result = a.compose(b) assert result.domain.shape == (10, 20) for i in range(2): m = result.output[i] @@ -133,7 +246,7 @@ def test_mixed_map_types(self) -> None: DimensionMap(input_dimension=1, offset=0, stride=1), ), ) - result = compose(outer, inner) + result = outer.compose(inner) assert isinstance(result.output[0], ConstantMap) assert result.output[0].offset == 17 assert isinstance(result.output[1], DimensionMap) @@ -145,7 +258,149 @@ def test_rank_mismatch_raises(self) -> None: outer = IndexTransform.from_shape((10,)) inner = IndexTransform.from_shape((10, 20)) with pytest.raises(ValueError, match="rank"): - compose(outer, inner) + outer.compose(inner) + + +class TestComposeInnerDomainValidation: + @pytest.mark.parametrize( + ("outer_map", "inner_lower"), + [ + (ConstantMap(offset=10), 10), + (ConstantMap(offset=14), 10), + (DimensionMap(input_dimension=0, offset=10, stride=1), 10), + (DimensionMap(input_dimension=0, offset=14, stride=-1), 10), + (DimensionMap(input_dimension=0, offset=10**100, stride=1), 10**100), + ], + ids=["lower-bound", "upper-bound", "forward", "reverse", "arbitrary-integer"], + ) + def test_valid_constant_and_affine_boundaries( + self, outer_map: ConstantMap | DimensionMap, inner_lower: int + ) -> None: + outer = IndexTransform( + domain=IndexDomain.from_shape((5,)), + output=(outer_map,), + ) + inner = IndexTransform( + domain=IndexDomain((inner_lower,), (inner_lower + 5,)), + output=(DimensionMap(input_dimension=0),), + ) + + result = outer.compose(inner) + + assert result.domain == outer.domain + _assert_composes_pointwise(outer, inner) + + def test_rejects_constant_outer_coordinate_outside_inner_domain(self) -> None: + outer = IndexTransform( + domain=IndexDomain.from_shape((1,)), + output=(ConstantMap(offset=2),), + ) + inner = IndexTransform.identity(IndexDomain((0,), (2,))) + + with pytest.raises(BoundsCheckError, match="outside.*inner.*domain"): + outer.compose(inner) + + def test_rejects_affine_outer_range_crossing_inner_domain(self) -> None: + outer = IndexTransform( + domain=IndexDomain((10**100,), (10**100 + 3,)), + output=(DimensionMap(input_dimension=0),), + ) + inner = IndexTransform.identity(IndexDomain((10**100,), (10**100 + 2,))) + + with pytest.raises(BoundsCheckError, match="outside.*inner.*domain"): + outer.compose(inner) + + def test_empty_outer_domain_does_not_evaluate_nonexistent_points(self) -> None: + outer = IndexTransform( + domain=IndexDomain.from_shape((0,)), + output=(ConstantMap(offset=99),), + ) + inner = IndexTransform.identity(IndexDomain((0,), (2,))) + + result = outer.compose(inner) + + assert result.domain.shape == (0,) + assert result.output == (ConstantMap(offset=99),) + + +class TestComposeMultidimensionalArrayInner: + def test_identity_gathers_a_two_dimensional_array_map(self) -> None: + inner = IndexTransform( + domain=IndexDomain.from_shape((2, 3)), + output=( + ArrayMap( + index_array=np.array([[11, 13, 17], [19, 23, 29]], dtype=np.intp), + offset=5, + stride=2, + ), + ), + ) + outer = IndexTransform.identity(inner.domain) + + result = outer.compose(inner) + + assert result == inner + _assert_composes_pointwise(outer, inner) + + def test_mixed_affine_and_constant_outputs_gather_with_metadata(self) -> None: + inner = IndexTransform( + domain=IndexDomain((4, 8), (7, 10)), + output=( + ArrayMap( + index_array=np.array([[2, 3], [5, 7], [11, 13]], dtype=np.intp), + offset=-3, + stride=4, + ), + ), + ) + outer = IndexTransform( + domain=IndexDomain((-2,), (0,)), + output=( + DimensionMap(input_dimension=0, offset=7, stride=1), + ConstantMap(offset=9), + ), + ) + + result = outer.compose(inner) + + assert result.domain == outer.domain + assert len(result.output) == 1 + array_map = result.output[0] + assert isinstance(array_map, ArrayMap) + assert array_map.index_array.shape == (2,) + assert array_map.offset == -3 + assert array_map.stride == 4 + np.testing.assert_array_equal(array_map.index_array, np.array([7, 13], dtype=np.intp)) + _assert_composes_pointwise(outer, inner) + + def test_out_of_bounds_affine_output_is_rejected_before_gather(self) -> None: + outer = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=( + DimensionMap(input_dimension=0, offset=1, stride=1), + ConstantMap(offset=0), + ), + ) + inner = IndexTransform( + domain=IndexDomain.from_shape((3, 2)), + output=(ArrayMap(np.arange(6, dtype=np.intp).reshape(3, 2)),), + ) + + with pytest.raises(BoundsCheckError, match="outside.*inner.*domain"): + outer.compose(inner) + + def test_rank_zero_array_map_composition(self) -> None: + domain = IndexDomain((), ()) + outer = IndexTransform.identity(domain) + inner = IndexTransform( + domain=domain, + output=(ArrayMap(np.array(7, dtype=np.intp), offset=2, stride=3),), + ) + + result = outer.compose(inner) + + assert result.domain == domain + assert result.output == (ConstantMap(offset=23),) class TestComposeChain: @@ -156,11 +411,64 @@ def test_three_transforms(self) -> None: output=(DimensionMap(input_dimension=0, offset=10, stride=1),), ) c = IndexTransform( - domain=IndexDomain.from_shape((100,)), + domain=IndexDomain.from_shape((110,)), output=(DimensionMap(input_dimension=0, offset=5, stride=2),), ) - bc = compose(b, c) - abc = compose(a, bc) + bc = b.compose(c) + abc = a.compose(bc) assert isinstance(abc.output[0], DimensionMap) assert abc.output[0].offset == 25 assert abc.output[0].stride == 2 + + +def test_composing_an_inner_array_with_a_broadcast_axis_wider_than_one_cell() -> None: + """A non-dependency axis is a singleton that broadcasts, so its coordinate is 0. + + Indexing it by the raw intermediate coordinate walked off the end of an axis + the array only has one entry for. + """ + outer = IndexTransform( + domain=IndexDomain(inclusive_min=(-2,), exclusive_max=(0,)), + output=(ConstantMap(offset=1), ConstantMap(offset=0)), + ) + inner = IndexTransform( + domain=IndexDomain(inclusive_min=(0, 0), exclusive_max=(2, 1)), + output=(ArrayMap(index_array=np.array([[13]], dtype=np.intp), offset=-2, stride=2),), + ) + composed = outer.compose(inner) + assert composed.output[0] == ConstantMap(offset=24) + + +def test_composing_a_one_dimensional_inner_array_under_a_higher_rank_outer() -> None: + """The shortcut gated on the output rank but sized by the input rank. + + A rank-2 outer therefore built a rank-1 array for a rank-2 domain, which the + engine's own invariant then rejected. + """ + outer = IndexTransform( + domain=IndexDomain.from_shape((2, 3)), + output=(DimensionMap(input_dimension=0, offset=1, stride=1),), + ) + inner = IndexTransform( + domain=IndexDomain.from_shape((4,)), + output=(ArrayMap(index_array=np.array([7, 3, 5, 1], dtype=np.intp)),), + ) + composed = outer.compose(inner) + array_map = composed.output[0] + assert isinstance(array_map, ArrayMap) + assert array_map.index_array.shape == (2, 1) + np.testing.assert_array_equal(array_map.index_array, np.array([[3], [5]])) + + +def test_composing_out_of_the_inner_domain_is_refused() -> None: + """An intermediate outside the inner domain wrapped NumPy-style and read a cell.""" + outer = IndexTransform( + domain=IndexDomain.from_shape((1,)), + output=(ConstantMap(offset=-3),), + ) + inner = IndexTransform( + domain=IndexDomain.from_shape((2,)), + output=(ArrayMap(index_array=np.array([7, 3], dtype=np.intp)),), + ) + with pytest.raises(BoundsCheckError, match="outside.*inner.*domain"): + outer.compose(inner) diff --git a/packages/zarr-indexing/tests/test_doc_examples.py b/packages/zarr-indexing/tests/test_doc_examples.py new file mode 100644 index 0000000000..240bd48531 --- /dev/null +++ b/packages/zarr-indexing/tests/test_doc_examples.py @@ -0,0 +1,488 @@ +"""Executable documentation contracts. + +Two kinds of test live here, and nothing else: + +1. **Structural.** Every snippet include in the rendered docs resolves to a + real file and a balanced, non-empty region — discovered by scanning the + markdown, never hand-registered — and every example file executes. The + examples carry their own inline assertions, so executing one *is* the + value check; expected values are stated once, in the example, beside the + prose that narrates them. +2. **Behavioral.** Documented classes are exercised where the example cannot + assert the behavior itself: error paths, cache lifecycle invariants, and + contracts stated in prose about types the docs define. + +Editorial choices — section order, exact wording, teaching progression — are +deliberately not pinned here; they belong to review. Structural breakage +belongs to `mkdocs build --strict`, whose configuration makes it actually +fail on the relevant classes: `check_paths: true` for unresolvable includes, +and `validation` set to warn (strict turns warnings into errors) for broken +link anchors and nav-omitted pages. +""" + +from __future__ import annotations + +import re +import runpy +import subprocess +import sys +from pathlib import Path +from typing import Any + +import numpy as np +import pytest + +import zarr_indexing +import zarr_indexing.lazy_array as lazy_array_module +from zarr_indexing import IndexTransform, LazyArray, ReadContext + +DOCS = Path(__file__).parents[1] / "docs" +PACKAGE_ROOT = DOCS.parent +STANDALONE_EXAMPLES = PACKAGE_ROOT / "examples" +DOC_SNIPPETS_DIR = DOCS / "snippets" +CACHE_EXAMPLE = STANDALONE_EXAMPLES / "system_memory_chunk_cache" / "system_memory_chunk_cache.py" + +# Mirrors `pymdownx.snippets: base_path` in mkdocs.yml. If that list changes, +# change this one in the same commit. +SNIPPET_BASE_PATHS = (DOCS, STANDALONE_EXAMPLES) + +_INCLUDE = re.compile(r'--8<--\s+"(?P[^":\n]+?)(?::(?P[^"\n]+))?"') + + +def _markdown_includes() -> tuple[tuple[str, str, str | None], ...]: + """Every snippet include in the rendered docs: (page, target, region).""" + return tuple( + (str(page.relative_to(DOCS)), match["target"], match["region"]) + for page in sorted(DOCS.rglob("*.md")) + for match in _INCLUDE.finditer(page.read_text()) + ) + + +INCLUDES = _markdown_includes() +# In-process executables: every snippet, plus the one standalone example that +# is importable as a module. The lazy_indexing_* examples are CLI scripts +# (they parse argv and call sys.exit), so they run as subprocesses below — +# no other test in the repository executes them. +EXECUTABLES = (*sorted(DOC_SNIPPETS_DIR.glob("*.py")), CACHE_EXAMPLE) +CLI_EXAMPLES = tuple( + script for script in sorted(STANDALONE_EXAMPLES.glob("*/*.py")) if script not in EXECUTABLES +) + +PATTERN_NAMESPACE: dict[str, Any] = runpy.run_path(str(DOC_SNIPPETS_DIR / "indexing_patterns.py")) +PATTERN_CASES: tuple[dict[str, Any], ...] = PATTERN_NAMESPACE["PATTERN_CASES"] +CACHE_NAMESPACE: dict[str, Any] = runpy.run_path(str(CACHE_EXAMPLE)) + +# The documented pattern matrix must keep covering every selection family. +REQUIRED_PATTERNS = { + "basic-slice", + "integer-axis-removal", + "negative-stride", + "empty-selection", + "boolean-mask", + "orthogonal", + "vectorized", + "broadcasting", + "repeated-out-of-order", +} + + +# --------------------------------------------------------------------------- # +# Structural: the include graph and the executable examples +# --------------------------------------------------------------------------- # + + +def test_docs_reference_snippets_at_all() -> None: + """An empty scan means the include regex rotted, not that the docs did.""" + assert len(INCLUDES) >= 10 + assert any(region for _, _, region in INCLUDES) + + +@pytest.mark.parametrize( + ("page", "target", "region"), + INCLUDES, + ids=[ + f"{page}->{target}" + (f":{region}" if region else "") for page, target, region in INCLUDES + ], +) +def test_markdown_include_resolves(page: str, target: str, region: str | None) -> None: + """Each include names exactly one real file; each region is balanced and non-empty.""" + resolved = [base / target for base in SNIPPET_BASE_PATHS if (base / target).is_file()] + assert len(resolved) == 1, f"{page} includes {target!r}: resolved to {resolved or 'nothing'}" + if region is None: + return + source = resolved[0].read_text() + starts = re.findall(rf"^\s*# --8<-- \[start:{re.escape(region)}\]$", source, re.MULTILINE) + ends = re.findall(rf"^\s*# --8<-- \[end:{re.escape(region)}\]$", source, re.MULTILINE) + assert len(starts) == 1, f"{target}:{region} needs exactly one start marker, has {len(starts)}" + assert len(ends) == 1, f"{target}:{region} needs exactly one end marker, has {len(ends)}" + body = source.split(starts[0], maxsplit=1)[1].split(ends[0], maxsplit=1)[0] + assert body.strip(), f"{target}:{region} is empty" + + +def test_snippet_directories_hold_only_their_kind() -> None: + """Rendered pages are markdown; executable snippets are Python.""" + assert all(p.suffix == ".md" for p in (DOCS / "examples").iterdir() if p.is_file()) + assert all(p.suffix == ".py" for p in DOC_SNIPPETS_DIR.iterdir() if p.is_file()) + + +@pytest.mark.parametrize("example", EXECUTABLES, ids=lambda path: path.stem) +def test_documentation_example_executes(example: Path) -> None: + """Examples are executable contracts; their inline asserts are the values check.""" + runpy.run_path(str(example), run_name="__main__") + + +@pytest.mark.parametrize("script", CLI_EXAMPLES, ids=lambda path: path.stem) +def test_cli_example_runs_as_a_subprocess(script: Path) -> None: + """The CLI examples exit 0 when run the way their READMEs instruct.""" + if "dask" in script.stem: + pytest.importorskip("dask.array") + completed = subprocess.run( + [sys.executable, str(script)], + capture_output=True, + text=True, + cwd=script.parent, + check=False, + ) + assert completed.returncode == 0, completed.stderr[-2000:] + + +@pytest.mark.parametrize( + "example_dir", + sorted(p for p in STANDALONE_EXAMPLES.iterdir() if p.is_dir()), + ids=lambda path: path.name, +) +def test_standalone_example_is_a_documented_script(example_dir: Path) -> None: + """Each standalone example ships a README and a same-named runnable script.""" + script = example_dir / f"{example_dir.name}.py" + assert script.is_file() + assert (example_dir / "README.md").is_file() + assert (DOCS / "examples" / f"{example_dir.name}.md").is_file() + assert script.read_text().startswith("# /// script\n"), "examples stay PEP 723 runnable" + + +# --------------------------------------------------------------------------- # +# Behavioral: the documented pattern matrix +# --------------------------------------------------------------------------- # + + +def test_indexing_pattern_matrix_is_complete() -> None: + assert {case["name"] for case in PATTERN_CASES} == REQUIRED_PATTERNS + + +def test_pattern_page_tabs_are_the_models() -> None: + """Both tabs of every matrix entry are the executable model, in order. + + The JSON tab must be the model's canonical wire form; the Python tab + must evaluate (in the executable matrix's namespace) to the model + itself. Either tab drifting from the snippet fails here. + """ + import json + import textwrap + + page = (DOCS / "guide" / "patterns.md").read_text() + + json_blocks = re.findall(r"```json\n(.*?)```", page, re.DOTALL) + assert len(json_blocks) == len(PATTERN_CASES) + for block, case in zip(json_blocks, PATTERN_CASES, strict=True): + assert json.loads(block) == case["transform"].to_json(), case["name"] + + python_blocks = [ + textwrap.dedent(block) + for block in re.findall(r"```python\n(.*?)```", page, re.DOTALL) + if "--8<--" not in block + ] + assert len(python_blocks) == len(PATTERN_CASES) + for block, case in zip(python_blocks, PATTERN_CASES, strict=True): + constructed = eval(block, dict(PATTERN_NAMESPACE)) + assert constructed == case["transform"], case["name"] + + +@pytest.mark.parametrize("case", PATTERN_CASES, ids=lambda case: case["name"]) +def test_indexing_pattern_matrix_matches_numpy(case: dict[str, Any]) -> None: + """The wrapper agrees with the matrix the snippet proves at the transform level.""" + image = PATTERN_NAMESPACE["image"] + lazy = LazyArray.from_numpy(image) + accessor = { + "basic": lazy.lazy, + "oindex": lazy.lazy.oindex, + "vindex": lazy.lazy.vindex, + }[case["mode"]] + view = accessor[case["selection"]] + result = view.result() + + np.testing.assert_array_equal(result, case["expected"]) + assert result.shape == case["shape"] + assert ("box" if view.is_box else "query") == case["category"] + + +# --------------------------------------------------------------------------- # +# Behavioral: contracts the guide states about wrapped sources and parts +# --------------------------------------------------------------------------- # + + +def test_default_source_contract_converts_basic_selected_slabs_to_system_memory() -> None: + """A source may return Python slabs as long as NumPy can convert each selected slab.""" + + class ListSlabSource: + def __init__(self) -> None: + self.data = np.arange(20).reshape(4, 5) + self.keys: list[tuple[Any, ...]] = [] + + @property + def shape(self) -> tuple[int, ...]: + return self.data.shape + + @property + def dtype(self) -> np.dtype[Any]: + return self.data.dtype + + def __getitem__(self, key: tuple[Any, ...]) -> object: + assert all(isinstance(item, (int, slice)) for item in key) + self.keys.append(key) + return self.data[key].tolist() + + source = ListSlabSource() + result = LazyArray(source).with_parts((2, 3)).lazy.oindex[[3, 1, 1], 1:5:2].result() + + np.testing.assert_array_equal(result, np.array([[16, 18], [6, 8], [6, 8]])) + assert len(source.keys) > 0 + assert all(all(isinstance(item, (int, slice)) for item in key) for key in source.keys) + + +def test_coordinate_array_example_preserves_order_and_duplicates() -> None: + """Coordinate arrays are ordered sequences, not mathematical sets.""" + view = LazyArray.from_numpy(np.arange(6)).with_parts((2,)).lazy.oindex[[4, 1, 1, 3]] + + np.testing.assert_array_equal(view.result(), np.array([4, 1, 1, 3])) + assembled = np.empty(view.shape, dtype=view.dtype) + for part in view.parts(): + assembled[part.out_selection] = part.view.result() + np.testing.assert_array_equal(assembled, np.array([4, 1, 1, 3])) + + +def test_documented_partition_transform_is_global_and_projection_is_chunk_local() -> None: + source = np.arange(8) + part = tuple(LazyArray.from_numpy(source).with_parts((4,)).parts())[1] + + assert part.view.transform.apply((0,)) == (4,) + assert part.view.array[part.view.transform.apply((0,))] == 4 + assert part.projection.chunk_transform.apply((0,)) == (0,) + + +@pytest.mark.parametrize( + ("mode", "parts"), + [ + ("per-axis", ((0,), (3,))), + ("per-axis", ((), (3,))), + ("uniform", (1, 1)), + ("per-axis", ((0, 0), (3,))), + ], + ids=["single-zero", "empty-sequence", "positive-uniform", "repeated-zero"], +) +def test_documented_zero_length_axis_partition_spellings_execute(mode: str, parts: Any) -> None: + data = np.zeros((0, 3)) + base = LazyArray.from_numpy(data) + view = base.with_parts(parts) if mode == "uniform" else base.with_parts_per_axis(parts) + + assert view.result().shape == (0, 3) + assert tuple(view.parts()) == () + + +def test_projection_example_exposes_paired_directions() -> None: + """Both transforms of every projection keep their documented output ranks.""" + namespace = runpy.run_path(str(DOC_SNIPPETS_DIR / "chunk_projection.py")) + np.testing.assert_array_equal(namespace["ADVANCED_RESULT"], namespace["ADVANCED_EXPECTED"]) + assert all(p.chunk_transform.output_rank == 2 for p in namespace["PROJECTIONS"]) + assert all(p.cell_transform.output_rank == 1 for p in namespace["PROJECTIONS"]) + + +@pytest.mark.parametrize( + "example", + [DOC_SNIPPETS_DIR / "integrations.py", CACHE_EXAMPLE], + ids=lambda path: path.stem, +) +def test_projection_examples_assemble_rank_zero_domains(example: Path) -> None: + """The examples' shared assembly helpers handle a zero-rank cell domain.""" + namespace = runpy.run_path(str(example)) + domain = zarr_indexing.IndexDomain((), ()) + cell_points = namespace["_domain_points"](domain) + destination = np.empty((), dtype=np.intp) + + values = namespace["_gather_and_scatter"]( + destination, + np.array(7, dtype=np.intp), + cell_points, + cell_points, + ) + + assert cell_points.shape == (1, 0) + assert values.shape == (1,) + assert destination[()] == 7 + + +# --------------------------------------------------------------------------- # +# Behavioral: the documented chunk cache (error paths the example cannot show) +# --------------------------------------------------------------------------- # + + +def make_documented_cache() -> tuple[Any, Any]: + source_type = CACHE_NAMESPACE["RecordingChunkSource"] + cache_type = CACHE_NAMESPACE["SystemMemoryChunkCache"] + source = source_type(np.arange(48).reshape(6, 8), chunks=(3, 4)) + return source, cache_type(source, capacity=2) + + +def test_system_memory_cache_assembles_and_deduplicates_public_projections() -> None: + source, cache = make_documented_cache() + + np.testing.assert_array_equal(cache.oindex[[1, 1], 2], np.array([10, 10])) + assert tuple(source.reads) == ((0, 0),) + assert cache.projection_uses == (("chunk_transform", "context.transform"),) + + +def test_chunk_cache_queues_all_parts_before_loading( + monkeypatch: pytest.MonkeyPatch, +) -> None: + source, cache = make_documented_cache() + planning_count = 0 + original_plan_chunks = lazy_array_module.plan_chunks + + def counted_plan_chunks(*args: Any, **kwargs: Any) -> Any: + nonlocal planning_count + planning_count += 1 + return original_plan_chunks(*args, **kwargs) + + with monkeypatch.context() as request_patch: + request_patch.setattr(lazy_array_module, "plan_chunks", counted_plan_chunks) + result = cache[1:5, 2] + + np.testing.assert_array_equal(result, np.array([10, 18, 26, 34])) + assert planning_count == 1 + assert source.reads == [(0, 0), (1, 0)] + + assert [ + (event.chunk_coords, event.previous.value, event.current.value) for event in cache.events + ] == [ + ((0, 0), "new", "queued"), + ((1, 0), "new", "queued"), + ((0, 0), "queued", "loading"), + ((0, 0), "loading", "ready"), + ((1, 0), "queued", "loading"), + ((1, 0), "loading", "ready"), + ] + + +def test_chunk_cache_reader_resolves_a_transform_from_cached_chunks() -> None: + """The reader boundary consumes the prepared projections of real parts.""" + source_type = CACHE_NAMESPACE["RecordingChunkSource"] + reader_type = CACHE_NAMESPACE["SystemMemoryChunkReader"] + source = source_type(np.arange(48).reshape(6, 8), chunks=(3, 4)) + reader = reader_type(capacity=2) + view = LazyArray(source).with_reader(reader).lazy[1:5, 2] + parts = tuple(view.parts()) + out = np.empty(view.shape, dtype=source.dtype) + for part in parts: + destination = out[part.out_selection] + assert ( + reader.read_into( + source, + ReadContext(part.view.transform, part.projection), + destination, + ) + is None + ) + + np.testing.assert_array_equal(out, np.array([10, 18, 26, 34])) + assert source.reads == [(0, 0), (1, 0)] + assert reader.projection_uses == [ + ("chunk_transform", "context.transform"), + ("chunk_transform", "context.transform"), + ] + + +def test_chunk_cache_reader_requires_a_prepared_projection() -> None: + source_type = CACHE_NAMESPACE["RecordingChunkSource"] + reader_type = CACHE_NAMESPACE["SystemMemoryChunkReader"] + source = source_type(np.arange(48).reshape(6, 8), chunks=(3, 4)) + transform = IndexTransform.from_shape(source.shape)[1:3, 2].translate_domain_to((0,)) + out = np.empty(transform.domain.shape, dtype=source.dtype) + + with pytest.raises(ValueError, match="requires context.projection"): + reader_type(capacity=2).read_into(source, ReadContext(transform), out) + + +def test_system_memory_cache_separates_basic_and_orthogonal_indexing() -> None: + source_type = CACHE_NAMESPACE["RecordingChunkSource"] + cache_type = CACHE_NAMESPACE["SystemMemoryChunkCache"] + data = np.arange(48).reshape(6, 8) + cache = cache_type(source_type(data, chunks=(3, 4)), capacity=4) + row = np.array([0, 2]) + column = np.array([1, 3]) + + np.testing.assert_array_equal(cache[0:3, 1:4], data[0:3, 1:4]) + np.testing.assert_array_equal( + cache.oindex[row, column], + data[np.ix_(row, column)], + ) + + +def test_system_memory_cache_does_not_treat_array_keys_as_orthogonal() -> None: + source, cache = make_documented_cache() + row = np.array([0, 2]) + column = np.array([1, 3]) + + with pytest.raises(IndexError, match="unsupported selection type for basic indexing"): + cache[row, column] + + assert tuple(source.reads) == () + + +def test_system_memory_cache_assembles_a_scalar_selection() -> None: + source, cache = make_documented_cache() + + result = cache[1, 2] + + assert result.shape == () + assert result[()] == 10 + assert tuple(source.reads) == ((0, 0),) + assert cache.projection_uses == (("chunk_transform", "context.transform"),) + + +def test_system_memory_cache_is_documentation_only() -> None: + assert not hasattr(zarr_indexing, "SystemMemoryChunkCache") + assert not hasattr(zarr_indexing, "ChunkState") + + +def test_chunk_source_failure_is_retained_as_failed_with_its_cause() -> None: + source, cache = make_documented_cache() + source.failures.add((1, 1)) + + with pytest.raises(CACHE_NAMESPACE["ChunkLoadError"]) as error: + cache[3:5, 4:6] + + assert isinstance(error.value.__cause__, OSError) + assert cache.state((1, 1)).value == "failed" + assert tuple(source.reads) == ((1, 1),) + + +def test_failed_chunk_is_not_retried_implicitly() -> None: + source, cache = make_documented_cache() + source.failures.add((1, 1)) + with pytest.raises(CACHE_NAMESPACE["ChunkLoadError"]): + cache[3:5, 4:6] + with pytest.raises(CACHE_NAMESPACE["ChunkLoadError"]): + cache[3:5, 4:6] + + assert tuple(source.reads) == ((1, 1),) + + +def test_retry_requires_a_failed_chunk() -> None: + _, cache = make_documented_cache() + with pytest.raises(ValueError, match="retry requires failed chunk .*new"): + cache.retry((0, 0)) + + +def test_illegal_chunk_transition_is_rejected() -> None: + _, cache = make_documented_cache() + with pytest.raises(ValueError, match="illegal chunk transition new -> ready"): + cache.reader._transition((0, 0), CACHE_NAMESPACE["ChunkState"].READY, "test") diff --git a/packages/zarr-indexing/tests/test_domain.py b/packages/zarr-indexing/tests/test_domain.py index 9664a0b08a..0278ecd714 100644 --- a/packages/zarr-indexing/tests/test_domain.py +++ b/packages/zarr-indexing/tests/test_domain.py @@ -3,6 +3,7 @@ import pytest from zarr_indexing.domain import IndexDomain +from zarr_indexing.errors import BoundsCheckError class TestIndexDomainConstruction: @@ -171,19 +172,32 @@ def test_narrow_non_zero_origin(self) -> None: def test_narrow_int_out_of_bounds(self) -> None: d = IndexDomain.from_shape((10,)) - with pytest.raises(IndexError, match="out of bounds"): + with pytest.raises(BoundsCheckError, match="out of bounds"): d.narrow((10,)) def test_narrow_int_below_origin(self) -> None: d = IndexDomain(inclusive_min=(5,), exclusive_max=(10,)) - with pytest.raises(IndexError, match="out of bounds"): + with pytest.raises(BoundsCheckError, match="out of bounds"): d.narrow((4,)) - def test_narrow_clamps_to_domain(self) -> None: + def test_narrow_refuses_a_bound_outside_the_domain(self) -> None: + """Clamping made two different requests answer alike, and neither well. + + Indices here are absolute coordinates, so `-5` is a coordinate this + domain does not contain rather than NumPy's "five from the end" — and + clamping returned the whole axis for it, which is what a caller writing + the NumPy spelling would least expect. A stop past the end produced a + domain the parent did not contain. + """ d = IndexDomain.from_shape((10,)) - result = d.narrow((slice(-5, 100),)) - assert result.inclusive_min == (0,) - assert result.exclusive_max == (10,) + with pytest.raises(BoundsCheckError, match="absolute coordinates"): + d.narrow((slice(-5, 100),)) + with pytest.raises(BoundsCheckError, match="out of bounds"): + d.narrow((slice(20, 30),)) + + def test_narrow_accepts_the_bounds_of_the_domain_itself(self) -> None: + d = IndexDomain.from_shape((10,)) + assert d.narrow((slice(0, 10),)) == d def test_narrow_bare_slice(self) -> None: d = IndexDomain.from_shape((10,)) @@ -197,6 +211,8 @@ def test_narrow_too_many_indices(self) -> None: d.narrow((1, 2)) def test_narrow_step_not_one(self) -> None: + """A stride is not a bounds failure — the rest of the algebra raises + `ValueError` for a request it does not implement, and so does this.""" d = IndexDomain.from_shape((10,)) - with pytest.raises(IndexError, match="step=1"): + with pytest.raises(ValueError, match="step=1"): d.narrow((slice(0, 10, 2),)) diff --git a/packages/zarr-indexing/tests/test_json.py b/packages/zarr-indexing/tests/test_json.py index 42b59b2c30..9848c6801f 100644 --- a/packages/zarr-indexing/tests/test_json.py +++ b/packages/zarr-indexing/tests/test_json.py @@ -1,21 +1,23 @@ from __future__ import annotations +from typing import TYPE_CHECKING, Any + import numpy as np import pytest from zarr_indexing.domain import IndexDomain -from zarr_indexing.json import ( - IndexTransformJSON, - index_domain_from_json, - index_domain_to_json, - index_transform_from_json, - index_transform_to_json, +from zarr_indexing.messages import NdselError +from zarr_indexing.output_map import ( + ArrayMap, + ConstantMap, + DimensionMap, output_index_map_from_json, - output_index_map_to_json, ) -from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap from zarr_indexing.transform import IndexTransform +if TYPE_CHECKING: + from zarr_indexing.json import IndexTransformJSON + def _maps_equal(a: object, b: object) -> bool: if type(a) is not type(b): @@ -31,7 +33,6 @@ def _maps_equal(a: object, b: object) -> bool: return ( a.offset == b.offset and a.stride == b.stride - and a.input_dimension == b.input_dimension and np.array_equal(a.index_array, b.index_array) ) @@ -49,45 +50,45 @@ def _transforms_equal(a: IndexTransform, b: IndexTransform) -> bool: class TestIndexDomainJSON: def test_roundtrip(self) -> None: domain = IndexDomain(inclusive_min=(2, 5), exclusive_max=(10, 20)) - json = index_domain_to_json(domain) + json = domain.to_json() assert json == { "input_inclusive_min": [2, 5], "input_exclusive_max": [10, 20], "input_labels": ["", ""], } - restored = index_domain_from_json(json) + restored = IndexDomain.from_json(json) assert restored == domain def test_with_labels(self) -> None: domain = IndexDomain(inclusive_min=(0, 0), exclusive_max=(10, 20), labels=("x", "y")) - json = index_domain_to_json(domain) + json = domain.to_json() assert json["input_labels"] == ["x", "y"] - restored = index_domain_from_json(json) + restored = IndexDomain.from_json(json) assert restored.labels == ("x", "y") def test_without_labels_emits_empty_and_round_trips_to_none(self) -> None: domain = IndexDomain.from_shape((5,)) - json = index_domain_to_json(domain) + json = domain.to_json() # Canonical form always writes labels; an unlabeled domain gets [""]*rank. assert json["input_labels"] == [""] - restored = index_domain_from_json(json) + restored = IndexDomain.from_json(json) assert restored.labels is None def test_zero_origin(self) -> None: domain = IndexDomain.from_shape((10, 20, 30)) - json = index_domain_to_json(domain) + json = domain.to_json() assert json == { "input_inclusive_min": [0, 0, 0], "input_exclusive_max": [10, 20, 30], "input_labels": ["", "", ""], } - assert index_domain_from_json(json) == domain + assert IndexDomain.from_json(json) == domain class TestOutputIndexMapJSON: def test_constant(self) -> None: m = ConstantMap(offset=42) - json = output_index_map_to_json(m) + json = m.to_json() assert json == {"offset": 42} restored = output_index_map_from_json(json) assert isinstance(restored, ConstantMap) @@ -95,7 +96,7 @@ def test_constant(self) -> None: def test_constant_zero(self) -> None: m = ConstantMap(offset=0) - json = output_index_map_to_json(m) + json = m.to_json() assert json == {"offset": 0} restored = output_index_map_from_json(json) assert isinstance(restored, ConstantMap) @@ -103,7 +104,7 @@ def test_constant_zero(self) -> None: def test_dimension(self) -> None: m = DimensionMap(input_dimension=1, offset=10, stride=3) - json = output_index_map_to_json(m) + json = m.to_json() assert json == {"offset": 10, "stride": 3, "input_dimension": 1} restored = output_index_map_from_json(json) assert isinstance(restored, DimensionMap) @@ -114,7 +115,7 @@ def test_dimension(self) -> None: def test_dimension_stride_1_written(self) -> None: """Canonical form writes stride even at its default of 1.""" m = DimensionMap(input_dimension=0) - json = output_index_map_to_json(m) + json = m.to_json() assert json == {"offset": 0, "stride": 1, "input_dimension": 0} restored = output_index_map_from_json(json) assert isinstance(restored, DimensionMap) @@ -123,7 +124,7 @@ def test_dimension_stride_1_written(self) -> None: def test_array(self) -> None: arr = np.array([1, 5, 9], dtype=np.intp) m = ArrayMap(index_array=arr, offset=2, stride=3) - json = output_index_map_to_json(m) + json = m.to_json() # Canonical: stride/offset present, index_array_bounds present, and # no input_dimension (ndsel/TensorStore reject it beside index_array). assert json == { @@ -141,7 +142,7 @@ def test_array(self) -> None: def test_array_stride_1_written(self) -> None: arr = np.array([0, 1, 2], dtype=np.intp) m = ArrayMap(index_array=arr) - json = output_index_map_to_json(m) + json = m.to_json() assert json["stride"] == 1 restored = output_index_map_from_json(json) assert isinstance(restored, ArrayMap) @@ -150,7 +151,7 @@ def test_array_stride_1_written(self) -> None: def test_array_2d(self) -> None: arr = np.array([[1, 2], [3, 4]], dtype=np.intp) m = ArrayMap(index_array=arr) - json = output_index_map_to_json(m) + json = m.to_json() assert json["index_array"] == [[1, 2], [3, 4]] restored = output_index_map_from_json(json) assert isinstance(restored, ArrayMap) @@ -159,7 +160,7 @@ def test_array_2d(self) -> None: def test_degenerate_singleton_array_collapses_to_constant(self) -> None: """An all-singleton index_array selects one coordinate -> constant map.""" m = ArrayMap(index_array=np.array([[4]], dtype=np.intp), offset=1, stride=2) - json = output_index_map_to_json(m) + json = m.to_json() assert json == {"offset": 1 + 2 * 4} restored = output_index_map_from_json(json) assert isinstance(restored, ConstantMap) @@ -169,7 +170,7 @@ def test_degenerate_singleton_array_collapses_to_constant(self) -> None: class TestIndexTransformJSON: def test_identity(self) -> None: t = IndexTransform.from_shape((10, 20)) - json = index_transform_to_json(t) + json = t.to_json() assert json == { "input_rank": 2, "input_inclusive_min": [0, 0], @@ -180,7 +181,7 @@ def test_identity(self) -> None: {"offset": 0, "stride": 1, "input_dimension": 1}, ], } - restored = index_transform_from_json(json) + restored = IndexTransform.from_json(json) assert restored.domain == t.domain assert len(restored.output) == 2 for orig, rest in zip(t.output, restored.output, strict=True): @@ -188,8 +189,8 @@ def test_identity(self) -> None: def test_sliced(self) -> None: t = IndexTransform.from_shape((100,))[10:50:2] - json = index_transform_to_json(t) - restored = index_transform_from_json(json) + json = t.to_json() + restored = IndexTransform.from_json(json) assert restored.domain.shape == t.domain.shape assert isinstance(restored.output[0], DimensionMap) orig = t.output[0] @@ -199,8 +200,8 @@ def test_sliced(self) -> None: def test_with_constant(self) -> None: t = IndexTransform.from_shape((10, 20))[3] - json = index_transform_to_json(t) - restored = index_transform_from_json(json) + json = t.to_json() + restored = IndexTransform.from_json(json) assert isinstance(restored.output[0], ConstantMap) assert restored.output[0].offset == 3 assert isinstance(restored.output[1], DimensionMap) @@ -208,23 +209,21 @@ def test_with_constant(self) -> None: def test_with_array(self) -> None: idx = np.array([1, 5, 9], dtype=np.intp) t = IndexTransform.from_shape((10, 20)).oindex[idx, :] - json = index_transform_to_json(t) + json = t.to_json() # The oindex array must not carry input_dimension on the wire. assert "input_dimension" not in json["output"][0] - restored = index_transform_from_json(json) + restored = IndexTransform.from_json(json) assert isinstance(restored.output[0], ArrayMap) # Orthogonal arrays are normalized to full input rank with a singleton # axis on the dimension they do not vary over. assert restored.output[0].index_array.shape == (3, 1) np.testing.assert_array_equal(restored.output[0].index_array, idx.reshape(3, 1)) - # input_dimension is reconstructed from the sole non-singleton axis. - assert restored.output[0].input_dimension == 0 assert isinstance(restored.output[1], DimensionMap) def test_roundtrip_preserves_singleton_axes(self) -> None: """Full-rank orthogonal arrays keep their singleton axes across JSON.""" t = IndexTransform.from_shape((10, 20)).oindex[np.array([1, 3]), np.array([2, 4, 6])] - restored = index_transform_from_json(index_transform_to_json(t)) + restored = IndexTransform.from_json(t.to_json()) orig0, orig1 = t.output[0], t.output[1] rest0, rest1 = restored.output[0], restored.output[1] assert isinstance(orig0, ArrayMap) @@ -235,16 +234,13 @@ def test_roundtrip_preserves_singleton_axes(self) -> None: assert rest1.index_array.shape == (1, 3) np.testing.assert_array_equal(rest0.index_array, orig0.index_array) np.testing.assert_array_equal(rest1.index_array, orig1.index_array) - # Distinct, exclusively-owned axes -> reconstructed as orthogonal. - assert rest0.input_dimension == 0 - assert rest1.input_dimension == 1 def test_with_labels(self) -> None: domain = IndexDomain(inclusive_min=(0, 0), exclusive_max=(10, 20), labels=("x", "y")) t = IndexTransform.identity(domain) - json = index_transform_to_json(t) + json = t.to_json() assert json["input_labels"] == ["x", "y"] - restored = index_transform_from_json(json) + restored = IndexTransform.from_json(json) assert restored.domain.labels == ("x", "y") def test_tensorstore_compatible_format(self) -> None: @@ -257,10 +253,12 @@ def test_tensorstore_compatible_format(self) -> None: "output": [ {"offset": 5}, {"offset": 10, "stride": 2, "input_dimension": 1}, - {"offset": 0, "stride": 1, "index_array": [1, 2, 0]}, + # Full input rank, which is what TensorStore itself requires: + # it rejects a rank-1 array over a rank-3 domain outright. + {"offset": 0, "stride": 1, "index_array": [[[1, 2, 0]]]}, ], } - t = index_transform_from_json(json) + t = IndexTransform.from_json(json) assert t.domain.shape == (100, 200, 3) assert t.domain.labels == ("x", "y", "channel") assert isinstance(t.output[0], ConstantMap) @@ -270,11 +268,11 @@ def test_tensorstore_compatible_format(self) -> None: assert t.output[1].stride == 2 assert t.output[1].input_dimension == 1 assert isinstance(t.output[2], ArrayMap) - np.testing.assert_array_equal(t.output[2].index_array, [1, 2, 0]) + np.testing.assert_array_equal(t.output[2].index_array, [[[1, 2, 0]]]) # Roundtrip - json_rt = index_transform_to_json(t) - t_rt = index_transform_from_json(json_rt) + json_rt = t.to_json() + t_rt = IndexTransform.from_json(json_rt) assert t_rt.domain == t.domain @@ -284,34 +282,41 @@ class TestCanonicalRoundTrips: def test_oindex_multi_axis(self) -> None: t = IndexTransform.from_shape((10, 20, 30)).oindex[np.array([1, 3]), :, np.array([2, 4, 6])] - rt = index_transform_from_json(index_transform_to_json(t)) + rt = IndexTransform.from_json(t.to_json()) assert _transforms_equal(rt, t) def test_oindex_with_slice(self) -> None: t = IndexTransform.from_shape((10, 20))[2:8].oindex[np.array([3, 5, 7]), :] - rt = index_transform_from_json(index_transform_to_json(t)) + rt = IndexTransform.from_json(t.to_json()) assert _transforms_equal(rt, t) def test_vindex(self) -> None: t = IndexTransform.from_shape((10, 20)).vindex[np.array([1, 3, 5]), np.array([2, 4, 6])] - rt = index_transform_from_json(index_transform_to_json(t)) + rt = IndexTransform.from_json(t.to_json()) assert _transforms_equal(rt, t) def test_vindex_with_residual_slice(self) -> None: t = IndexTransform.from_shape((10, 20, 30)).vindex[np.array([1, 3]), np.array([2, 4]), :] - rt = index_transform_from_json(index_transform_to_json(t)) + rt = IndexTransform.from_json(t.to_json()) assert _transforms_equal(rt, t) def test_length1_degenerate_oindex_collapses(self) -> None: - """A length-1 oindex array becomes an all-singleton ArrayMap; the JSON - round-trip collapses it to a ConstantMap (behaviorally identical).""" + """A length-1 oindex selection is the ConstantMap it equals. + + The selection layer collapses it at construction; a hand-built + all-singleton ArrayMap still collapses on serialize, so the canonical + wire form is a `constant` map either way. + """ t = IndexTransform.from_shape((10, 20)).oindex[np.array([7]), :] m = t.output[0] - assert isinstance(m, ArrayMap) - assert m.index_array.size == 1 - - rt = index_transform_from_json(index_transform_to_json(t)) - # The degenerate array collapsed to a constant selecting the same cell. + assert isinstance(m, ConstantMap) + assert m.offset == 7 + + hand_built = IndexTransform( + domain=t.domain, + output=(ArrayMap(index_array=np.array([[7]], dtype=np.intp)), t.output[1]), + ) + rt = IndexTransform.from_json(hand_built.to_json()) rm = rt.output[0] assert isinstance(rm, ConstantMap) assert rm.offset == 7 @@ -320,10 +325,83 @@ def test_length1_degenerate_oindex_collapses(self) -> None: def test_slices_and_constants(self) -> None: t = IndexTransform.from_shape((10, 20, 30))[2:8:2, 5, :] - rt = index_transform_from_json(index_transform_to_json(t)) + rt = IndexTransform.from_json(t.to_json()) assert _transforms_equal(rt, t) +def _index_array_body(index_array: Any, rank: int = 1, extent: int = 2) -> IndexTransformJSON: + return { + "input_rank": rank, + "input_inclusive_min": [0] * rank, + "input_exclusive_max": [extent] * rank, + "input_labels": [""] * rank, + "output": [{"offset": 0, "stride": 1, "index_array": index_array}], + } + + +@pytest.mark.parametrize( + ("index_array", "detail"), + [ + ([0.9, 1.9], "float64"), + ([0, 1.5], "float64"), + ([True, False], "bool"), + (["a", "b"], "str"), + # Not lists at all, so they are turned away before their content is + # looked at: a bare string would be iterated into characters, and a bare + # integer would become a rank-0 array and then a length-1 map, so a + # document naming no cells would select one. + ("abc", "must be an array of integers"), + (5, "must be an array of integers"), + ([None, None], "object"), + ], + ids=["floats", "mixed", "bools", "strings", "string", "scalar", "nulls"], +) +def test_a_non_integer_index_array_is_rejected(index_array: Any, detail: str) -> None: + """An `index_array` addresses output coordinates, so it must be integral. + + Lowering a float array silently truncated it (`[0.9, 1.9]` selected cells 0 + and 1), a bool array coerced to 0/1, and a string array leaked a raw NumPy + `ValueError` from the middle of the conversion. + """ + with pytest.raises(NdselError) as excinfo: + IndexTransform.from_json(_index_array_body(index_array)) + assert excinfo.value.reason == "invalid_json" + assert "index_array" in str(excinfo.value) + assert detail in str(excinfo.value) + + +def test_a_ragged_index_array_is_rejected() -> None: + """A nested list that is not rectangular is not an array at all.""" + with pytest.raises(NdselError) as excinfo: + IndexTransform.from_json(_index_array_body([[0, 1], [2]])) + assert excinfo.value.reason == "invalid_json" + + +@pytest.mark.parametrize( + ("index_array", "rank", "extent"), + [([0, 1], 1, 2), ([[0], [1]], 2, 2), ([], 1, 0)], + ids=["1d", "2d", "empty"], +) +def test_an_integer_index_array_is_accepted(index_array: Any, rank: int, extent: int) -> None: + """Integers of any nesting still lower, including an empty selection. + + An empty array selects nothing, so the domain it is read over is empty too; + a domain with room for coordinates the array does not supply is rejected + (see `test_an_index_array_that_does_not_span_its_domain_is_rejected`). + """ + t = IndexTransform.from_json(_index_array_body(index_array, rank, extent)) + m = t.output[0] + assert isinstance(m, ArrayMap) + assert m.index_array.dtype == np.intp + + +def test_a_non_integer_index_array_is_rejected_by_the_map_loader() -> None: + """The single-map loader enforces the same constraint as the transform one.""" + with pytest.raises(NdselError) as excinfo: + output_index_map_from_json({"index_array": [0.5, 1.5]}) + assert excinfo.value.reason == "invalid_json" + + def test_infinite_bound_rejected_on_lowering() -> None: body: IndexTransformJSON = { "input_rank": 1, @@ -333,4 +411,176 @@ def test_infinite_bound_rejected_on_lowering() -> None: "output": [{"offset": 0, "stride": 1, "input_dimension": 0}], } with pytest.raises(ValueError, match="infinite"): - index_transform_from_json(body) + IndexTransform.from_json(body) + + +def test_a_lower_rank_index_array_is_widened_on_the_way_in() -> None: + """External JSON may broadcast a lower-rank array; the engine never holds one. + + ndsel leaves index-array rank unvalidated, so a conformant producer may send + an array of lower rank. It is widened at the boundary, which keeps the + full-rank invariant true of every transform the engine builds. + """ + # A rank-1 array widens into the trailing axis, so it spans that axis's + # extent of four. + body: IndexTransformJSON = { + "input_inclusive_min": [0, 0], + "input_exclusive_max": [3, 4], + "output": [{"index_array": [1, 2, 0, 2]}, {"input_dimension": 1}], + } + transform = IndexTransform.from_json(body) + array_map = transform.output[0] + assert isinstance(array_map, ArrayMap) + assert array_map.index_array.shape == (1, 4) + assert array_map.index_array.ndim == transform.domain.ndim + + +def test_an_index_array_of_the_wrong_rank_is_rejected() -> None: + """Inside the engine, a rank that does not match the domain is a bug.""" + with pytest.raises(ValueError, match="index_array has 1 dims"): + IndexTransform( + domain=IndexDomain.from_shape((3, 4)), + output=(ArrayMap(index_array=np.array([1, 2, 0], dtype=np.intp)),), + ) + + +def test_an_index_array_that_does_not_span_its_domain_is_rejected() -> None: + """An array with entries for only part of an axis is not a smaller selection. + + Reading it that way is how a truncated index array turned into a partially + written result rather than an error. + """ + with pytest.raises(ValueError, match="neither 1 nor the domain's extent"): + IndexTransform( + domain=IndexDomain.from_shape((3, 2)), + output=( + ArrayMap(index_array=np.zeros((3, 0), dtype=np.intp)), + DimensionMap(input_dimension=1), + ), + ) + + +def test_an_empty_index_array_collapses_to_a_constant() -> None: + """Selecting nothing must survive a trip through JSON. + + An empty index array names no cell, and can only be empty because an input + dimension is, so nothing is ever read through it. It is degenerate in + exactly the way a size-1 array is, and collapses the same way — which is + also what TensorStore emits for `t[ts.d[0][[]]]`. + + Emitting the array instead produced a document nothing could load: + `tolist()` renders every empty array as `[]` once the leading axis is the + zero-length one, so the rank went with it, and the loader put the dependency + back on a different axis by prepending singletons. + """ + for shape, selection in ( + ((5, 3), (np.array([], dtype=np.intp), slice(None))), + ((5, 5), (np.array([], dtype=np.intp), np.array([], dtype=np.intp))), + ): + transform = IndexTransform.from_shape(shape).oindex[selection] + body = transform.to_json() + + assert all("index_array" not in m for m in body["output"]) + reloaded = IndexTransform.from_json(body) + assert reloaded.domain == transform.domain + assert reloaded.to_json() == body + + +def test_an_empty_index_array_from_elsewhere_is_recovered_from_the_domain() -> None: + """A producer that does emit one is still readable when the domain settles it. + + This package never writes such a document, but ndsel does not forbid it, and + the domain names the axis unambiguously when exactly one dimension is empty. + """ + body: IndexTransformJSON = { + "input_inclusive_min": [0, 0], + "input_exclusive_max": [0, 4], + "output": [{"index_array": []}, {"input_dimension": 1}], + } + array_map = IndexTransform.from_json(body).output[0] + assert isinstance(array_map, ArrayMap) + assert array_map.index_array.shape == (0, 1) + + +def test_an_ambiguous_empty_index_array_is_rejected() -> None: + """Two zero-length dimensions leave nothing to recover the axis from.""" + body: IndexTransformJSON = { + "input_inclusive_min": [0, 0], + "input_exclusive_max": [0, 0], + "output": [{"index_array": []}, {"input_dimension": 1}], + } + with pytest.raises(NdselError) as excinfo: + IndexTransform.from_json(body) + assert excinfo.value.reason == "invalid_json" + assert "zero-length" in str(excinfo.value) + + +@pytest.mark.parametrize( + ("document", "reason", "detail"), + [ + ( + {"input_inclusive_min": [0.0], "input_exclusive_max": [3], "input_labels": [""]}, + "invalid_json", + "must be an integer", + ), + ( + {"input_inclusive_min": [0], "input_exclusive_max": ["3"], "input_labels": [""]}, + "invalid_json", + "must be an integer", + ), + ( + {"input_inclusive_min": [False], "input_exclusive_max": [True], "input_labels": [""]}, + "invalid_json", + "must be an integer", + ), + ( + {"input_inclusive_min": [0], "input_exclusive_max": [3], "input_labels": [5]}, + "invalid_json", + "must be a string", + ), + ( + {"input_inclusive_min": [0], "input_exclusive_max": [2**200], "input_labels": [""]}, + "invalid_json", + "64-bit signed range", + ), + ], + ids=["float", "string", "bool", "non-string-label", "out-of-range"], +) +def test_a_malformed_domain_document_is_rejected(document: Any, reason: str, detail: str) -> None: + """The domain loader validates what the message layer validates. + + Reading the keys directly was a second, undefended way into the same + objects: a bare `int()` truncated `3.9` to 3, coerced `"3"` and `True`, and + let a non-string label into a `tuple[str, ...]` — each building a domain + that was not the document's, and re-dumping as a different document. + """ + with pytest.raises(NdselError) as excinfo: + IndexDomain.from_json(document) + assert excinfo.value.reason == reason + assert detail in str(excinfo.value) + + +def test_a_transform_body_cannot_reinterpret_itself_as_another_message() -> None: + """A `kind` inside the body must not change which message is being read.""" + with pytest.raises(NdselError) as excinfo: + IndexTransform.from_json({"kind": "points", "coords": [[1, 2], [3, 4]]}) + assert excinfo.value.reason == "invalid_json" + assert "kind" in str(excinfo.value) + + +def test_an_engine_invariant_failure_leaves_the_loader_as_a_typed_error() -> None: + """A document is invalid input however deep the check that catches it lives. + + The engine's rank and span invariants are the last gate a document passes, + and they raised a bare `ValueError` written in the engine's vocabulary. + """ + body: IndexTransformJSON = { + "input_rank": 1, + "input_inclusive_min": [0], + "input_exclusive_max": [5], + "input_labels": [""], + "output": [{"index_array": [[1, 2], [3, 4]]}], + } + with pytest.raises(NdselError) as excinfo: + IndexTransform.from_json(body) + assert excinfo.value.reason == "rank_mismatch" diff --git a/packages/zarr-indexing/tests/test_lazy_array.py b/packages/zarr-indexing/tests/test_lazy_array.py new file mode 100644 index 0000000000..ab94be1ae5 --- /dev/null +++ b/packages/zarr-indexing/tests/test_lazy_array.py @@ -0,0 +1,2618 @@ +"""Tests for `zarr_indexing.grid` grids and the `LazyArray` wrapper. + +The happy-path suite is a single oracle test: every selection case is applied +both to a `LazyArray` and to the NumPy array it wraps, and the results must +match. The case list is crossed with four source flavors — an unchunked NumPy +array, NumPy with each of the two declared chunk conventions, and a zarr array +whose chunking is auto-discovered — so the chunked and unchunked resolution +strategies are held to the same answers. +""" + +from __future__ import annotations + +import operator +import pickle +from concurrent.futures import ThreadPoolExecutor +from dataclasses import replace +from typing import TYPE_CHECKING, Any, cast + +import numpy as np +import pytest + +import zarr_indexing.lazy_array as lazy_array_module +from zarr_indexing import ( + ArrayMap, + ChunkGrid, + ChunkProjection, + ConstantMap, + DimensionMap, + EdgeDimensionGrid, + FixedDimension, + IndexTransform, + LazyArray, + ReadContext, + VaryingDimension, + dimension_grids_from_chunks, +) +from zarr_indexing.lazy_array import _out_selection_cell_count, _validate_prepared_parts +from zarr_indexing.reader import Reader, basic_reader, numpy_reader +from zarr_indexing.testing import repartition + +if TYPE_CHECKING: + from collections.abc import Callable, Sequence + +SHAPE = (7, 5, 4) +PART_SHAPE = (3, 2, 3) +EXPLICIT_PARTS = ((3, 3, 1), (2, 2, 1), (3, 1)) + + +class IndexLike: + """A scalar integer selector implemented only through `__index__`.""" + + def __init__(self, value: int) -> None: + self.value = value + + def __index__(self) -> int: + return self.value + + +class IntOnly: + def __int__(self) -> int: + return 2 + + +class BadIndex: + """An `__index__` that lies: the protocol requires an integer.""" + + def __index__(self) -> int: + return cast("int", 2.5) + + +def reference() -> np.ndarray[Any, np.dtype[np.int64]]: + """The array every source flavor holds, and the oracle for every case.""" + return np.arange(int(np.prod(SHAPE)), dtype=np.int64).reshape(SHAPE) + + +class DelegatingReader: + def __init__(self, inner: Reader) -> None: + self.inner = inner + + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> None: + self.inner.read_into(source, context, out) + + +def outer(ref: np.ndarray[Any, Any], selections: Sequence[Any]) -> np.ndarray[Any, Any]: + """NumPy oracle for orthogonal indexing: the outer product of per-axis selections. + + Scalar integers are basic indices — NumPy applies them first and drops the + axis — so they are peeled off before the outer product is formed. + """ + scalars = tuple( + sel if isinstance(sel, (int, np.integer)) and not isinstance(sel, bool) else slice(None) + for sel in selections + ) + reduced = ref[scalars] + axes = [ + np.arange(size)[sel] + for size, sel in zip( + reduced.shape, + [ + s + for s in selections + if not (isinstance(s, (int, np.integer)) and not isinstance(s, bool)) + ], + strict=True, + ) + ] + if len(axes) == 0: + return reduced + return reduced[np.ix_(*axes)] + + +# --------------------------------------------------------------------------- +# EdgeDimensionGrid +# --------------------------------------------------------------------------- + + +@pytest.mark.parametrize( + ("sizes", "expected_index_to_chunk", "expected_offsets", "expected_sizes"), + [ + # A clipped edge chunk. + ((3, 3, 1), [0, 0, 0, 1, 1, 1, 2], [0, 3, 6], [3, 3, 1]), + # A single chunk covering the whole axis. + ((4,), [0, 0, 0, 0], [0], [4]), + # A size-1 axis. + ((1,), [0], [0], [1]), + # Irregular sizes: the grid does not have to be regular. + ((1, 2, 1), [0, 1, 1, 2], [0, 1, 3], [1, 2, 1]), + ], +) +def test_edge_dimension_grid( + sizes: tuple[int, ...], + expected_index_to_chunk: list[int], + expected_offsets: list[int], + expected_sizes: list[int], +) -> None: + """All four `DimensionGridLike` methods agree with hand-computed values.""" + grid = EdgeDimensionGrid(sizes) + extent = sum(sizes) + + assert grid.num_chunks == len(sizes) + assert grid.extent == extent + assert [grid.index_to_chunk(i) for i in range(extent)] == expected_index_to_chunk + assert [grid.chunk_offset(c) for c in range(len(sizes))] == expected_offsets + assert [grid.chunk_size(c) for c in range(len(sizes))] == expected_sizes + np.testing.assert_array_equal( + grid.indices_to_chunks(np.arange(extent, dtype=np.intp)), + np.asarray(expected_index_to_chunk, dtype=np.intp), + ) + + +def test_edge_dimension_grid_rejects_nonpositive_size() -> None: + with pytest.raises(ValueError, match="chunk sizes must be positive"): + EdgeDimensionGrid((3, 0, 2)) + + +def test_edge_dimension_grid_rejects_out_of_bounds_index() -> None: + with pytest.raises(IndexError, match="out of bounds for an axis of extent 4"): + EdgeDimensionGrid((3, 1)).index_to_chunk(4) + + +def test_edge_dimension_grid_rejects_out_of_bounds_chunk() -> None: + with pytest.raises(IndexError, match="chunk index 2 is out of bounds"): + EdgeDimensionGrid((3, 1)).chunk_offset(2) + + +@pytest.mark.parametrize( + "grid", + [ + pytest.param(FixedDimension(size=2, extent=4), id="fixed"), + pytest.param(VaryingDimension(edges=(1, 3), extent=4), id="varying"), + ], +) +def test_compact_dimension_grid_rejects_vector_below_extent(grid: Any) -> None: + with pytest.raises(IndexError, match=r"indices must lie in \[0, 4\); got \[-1, 1\]"): + grid.indices_to_chunks(np.array([-1, 1], dtype=np.intp)) + + +@pytest.mark.parametrize( + "grid", + [ + pytest.param(FixedDimension(size=2, extent=4), id="fixed"), + pytest.param(VaryingDimension(edges=(1, 3), extent=4), id="varying"), + ], +) +def test_compact_dimension_grid_rejects_vector_above_extent(grid: Any) -> None: + with pytest.raises(IndexError, match=r"indices must lie in \[0, 4\); got \[1, 4\]"): + grid.indices_to_chunks(np.array([1, 4], dtype=np.intp)) + + +def test_fixed_dimension_rejects_zero_size_for_nonempty_extent() -> None: + with pytest.raises(ValueError, match="size must be > 0 when extent is nonzero"): + FixedDimension(size=0, extent=4) + + +def test_fixed_dimension_retains_zero_size_for_zero_extent() -> None: + grid = FixedDimension(size=0, extent=0) + + assert grid.nchunks == 0 + assert grid.ngridcells == 0 + + +@pytest.mark.parametrize( + ("chunks", "shape", "expected"), + [ + # Uniform chunk shape, tail clipped. + ((3, 4), (7, 4), (FixedDimension(size=3, extent=7), FixedDimension(size=4, extent=4))), + # Dask-convention per-axis sizes, passed through. + ( + ((3, 3, 1), (2, 2)), + (7, 4), + (VaryingDimension(edges=(3, 3, 1), extent=7), VaryingDimension(edges=(2, 2), extent=4)), + ), + # A chunk longer than the axis collapses to one clipped chunk. + ((10,), (4,), (FixedDimension(size=10, extent=4),)), + # A zero-length axis has no chunks at all. + ((3,), (0,), (FixedDimension(size=3, extent=0),)), + ], +) +def test_dimension_grids_from_chunks( + chunks: Any, shape: tuple[int, ...], expected: tuple[Any, ...] +) -> None: + grids = dimension_grids_from_chunks(chunks, shape) + assert grids == expected + + +def test_regular_dimension_metadata_is_constant_in_chunk_count() -> None: + dimensions = dimension_grids_from_chunks((1,), (1_000_000,)) + + assert dimensions == (FixedDimension(size=1, extent=1_000_000),) + assert dimensions[0].nchunks == 1_000_000 + assert dimensions[0].index_to_chunk(999_999) == 999_999 + + +def test_chunk_grid_distinguishes_codec_and_data_shape_at_the_edge() -> None: + grid = ChunkGrid(dimensions=(FixedDimension(size=3, extent=7),)) + + edge = grid[(2,)] + + assert edge is not None + assert edge.slices == (slice(6, 7, 1),) + assert edge.shape == (1,) + assert edge.codec_shape == (3,) + + +def test_dimension_grids_reject_negative_shape() -> None: + with pytest.raises(ValueError, match="shape entries must be non-negative"): + dimension_grids_from_chunks((3,), (-1,)) + + +def test_dimension_grids_from_chunks_rejects_wrong_length() -> None: + with pytest.raises(ValueError, match="one entry per dimension"): + dimension_grids_from_chunks((3,), (7, 4)) + + +def test_dimension_grids_from_chunks_rejects_mixed_conventions() -> None: + with pytest.raises(ValueError, match="not a mixture"): + dimension_grids_from_chunks((3, (2, 2)), (7, 4)) + + +def test_dimension_grids_from_chunks_rejects_wrong_total() -> None: + with pytest.raises(ValueError, match="sum to 5, but the array extent is 7"): + dimension_grids_from_chunks(((3, 2), (4,)), (7, 4)) + + +def test_dimension_grids_from_chunks_rejects_non_sequence_entry() -> None: + """A float entry is neither convention, and says so instead of raising TypeError.""" + with pytest.raises(ValueError, match=r"3\.5 at dimension 0 is neither"): + dimension_grids_from_chunks((3.5, (4,)), (7, 4)) + + +def test_array_map_dependent_axis_reports_no_axis() -> None: + """A map varying over nothing answers None rather than a stale binding.""" + correlated = ArrayMap(index_array=np.array([[1], [2]], dtype=np.intp)) + assert correlated.dependent_axis == 0 + assert ArrayMap(index_array=np.array([[3]], dtype=np.intp)).dependent_axis is None + + +def test_scalar_on_a_fancy_axis_collapses_to_a_constant() -> None: + """The degenerate-collapse rule: an all-singleton ArrayMap becomes a ConstantMap. + + Without it the map keeps an `input_dimension` naming an axis the integer + index just removed, which after renumbering aliases a different axis. + """ + view = IndexTransform.from_shape((7, 5)).oindex[np.array([3, 1]), slice(None)][0] + assert view.output[0] == ConstantMap(offset=3) + assert isinstance(view.output[1], DimensionMap) + assert view.domain.shape == (5,) + + +# --------------------------------------------------------------------------- +# Sources +# --------------------------------------------------------------------------- + + +def make_zarr_source() -> Any: + """A zarr array holding `reference()`, whose parts are auto-discovered.""" + zarr = pytest.importorskip("zarr") + array = zarr.create_array({}, shape=SHAPE, chunks=PART_SHAPE, dtype="int64") + array[:] = reference() + return array + + +def make_source(flavor: str) -> LazyArray: + """Build a `LazyArray` over `reference()` with the requested partitioning.""" + data = reference() + if flavor == "numpy-whole": + return LazyArray(data) + if flavor == "numpy-explicit-parts": + return LazyArray(data).with_parts_per_axis(EXPLICIT_PARTS) + if flavor == "numpy-uniform-parts": + return LazyArray(data).with_parts(PART_SHAPE) + if flavor == "zarr": + return LazyArray(make_zarr_source()) + if flavor == "zarr-misaligned": + # Parts that deliberately straddle the zarr array's own chunks. + return LazyArray(make_zarr_source()).with_parts((4, 3, 3)) + raise TypeError(f"unknown source flavor {flavor!r}") + + +FLAVORS = [ + "numpy-whole", + "numpy-explicit-parts", + "numpy-uniform-parts", + "zarr", + "zarr-misaligned", +] + + +@pytest.fixture(params=FLAVORS) +def source(request: pytest.FixtureRequest) -> LazyArray: + return make_source(request.param) + + +# --------------------------------------------------------------------------- +# The oracle +# --------------------------------------------------------------------------- + +MASK = (reference() % 11) == 0 +# A mask over the two trailing axes, for the `vindex[..., mask]` idiom. +TRAILING_MASK = (reference()[0] % 3) == 0 + +# (id, lazy view builder, NumPy oracle). Integer scalars are deliberately absent +# from the orthogonal cases: the transform algebra keeps an int-selected axis as +# a length-1 axis under `oindex`, which `np.ix_` cannot express. +CASES: list[tuple[str, Callable[[LazyArray], LazyArray], Callable[[Any], Any]]] = [ + ( + "basic-strided-and-int-drop", + lambda a: a.lazy[1:6:2, :, -1], + lambda r: r[1:6:2, :, -1], + ), + ("basic-ellipsis", lambda a: a.lazy[..., -2], lambda r: r[..., -2]), + ("basic-negative-scalar", lambda a: a.lazy[-3], lambda r: r[-3]), + ("basic-newaxis", lambda a: a.lazy[None, :, :, None], lambda r: r[None, :, :, None]), + ("basic-empty", lambda a: a.lazy[:, 2:2, :], lambda r: r[:, 2:2, :]), + ("basic-all-scalars", lambda a: a.lazy[-1, 0, 2], lambda r: r[-1, 0, 2]), + ( + "oindex-unsorted-duplicates-multi-axis", + lambda a: a.lazy.oindex[[4, 0, 0, 2], :, [3, 1]], + lambda r: outer(r, ([4, 0, 0, 2], slice(None), [3, 1])), + ), + ( + "oindex-negative-and-slice", + lambda a: a.lazy.oindex[:, [-1, 0], 1:4], + lambda r: outer(r, (slice(None), [-1, 0], slice(1, 4))), + ), + ( + "oindex-boolean-axis", + lambda a: a.lazy.oindex[np.array([True, False, True, False, False, False, True]), :, :], + lambda r: outer( + r, + (np.array([True, False, True, False, False, False, True]), slice(None), slice(None)), + ), + ), + ( + "vindex-coordinates", + lambda a: a.lazy.vindex[np.array([0, 6, 3]), np.array([1, 4, 0]), np.array([2, 0, 1])], + lambda r: r[np.array([0, 6, 3]), np.array([1, 4, 0]), np.array([2, 0, 1])], + ), + ( + "vindex-broadcast-pair", + lambda a: a.lazy.vindex[np.array([[0], [6]]), np.array([1, 4]), np.array([2, 0])], + lambda r: r[np.array([[0], [6]]), np.array([1, 4]), np.array([2, 0])], + ), + ( + "vindex-negative-coordinates", + lambda a: a.lazy.vindex[np.array([-1, -7]), np.array([-2, 0]), np.array([0, -1])], + lambda r: r[np.array([-1, -7]), np.array([-2, 0]), np.array([0, -1])], + ), + ("vindex-mask", lambda a: a.lazy.vindex[MASK], lambda r: r[MASK]), + ( + "compose-basic-then-oindex", + lambda a: a.lazy[1:6].lazy.oindex[[3, 0, 0], [4, 1], :], + lambda r: outer(r[1:6], ([3, 0, 0], [4, 1], slice(None))), + ), + ( + "compose-oindex-then-basic-other-axis", + lambda a: a.lazy.oindex[[4, 0, 2], :, :].lazy[:, 1:4, ::2], + lambda r: outer(r, ([4, 0, 2], slice(None), slice(None)))[:, 1:4, ::2], + ), + ( + "compose-basic-then-basic", + lambda a: a.lazy[2:, 1:].lazy[::2, -1], + lambda r: r[2:, 1:][::2, -1], + ), + ( + "compose-basic-then-vindex", + lambda a: a.lazy[1:6, :, 1:].lazy.vindex[ + np.array([0, 4]), np.array([2, 0]), np.array([1, 2]) + ], + lambda r: r[1:6, :, 1:][np.array([0, 4]), np.array([2, 0]), np.array([1, 2])], + ), + # Scalar integers are basic indices in the positional dialect: they drop the + # axis, in every mode, exactly as NumPy does. + ("oindex-scalar-drops-axis", lambda a: a.lazy.oindex[0], lambda r: r[0]), + ( + "oindex-scalar-with-arrays", + lambda a: a.lazy.oindex[0, [1, 2], :], + lambda r: outer(r, (0, [1, 2], slice(None))), + ), + ( + "oindex-scalar-middle-axis", + lambda a: a.lazy.oindex[[3, 1], -1, :], + lambda r: outer(r, ([3, 1], -1, slice(None))), + ), + ("oindex-all-scalars", lambda a: a.lazy.oindex[0, 1, 2], lambda r: r[0, 1, 2]), + ("vindex-all-scalars", lambda a: a.lazy.vindex[0, 1, 2], lambda r: r[0, 1, 2]), + ( + "vindex-scalar-with-arrays", + lambda a: a.lazy.vindex[0, [1, 2], [3, 0]], + lambda r: r[0, [1, 2], [3, 0]], + ), + ( + "vindex-scalar-on-middle-axis", + lambda a: a.lazy.vindex[[1, 2], 0, [3, 0]], + lambda r: r[[1, 2], 0, [3, 0]], + ), + # Scalar applied to a previously fancy-indexed axis, both orders. + ( + "compose-oindex-then-scalar", + lambda a: a.lazy.oindex[[3, 1], :, :].lazy[0], + lambda r: outer(r, ([3, 1], slice(None), slice(None)))[0], + ), + ( + "compose-oindex-then-scalar-negative", + lambda a: a.lazy.oindex[[3, 1, 1], :, :].lazy[-1, 2], + lambda r: outer(r, ([3, 1, 1], slice(None), slice(None)))[-1, 2], + ), + ( + "compose-scalar-then-oindex", + lambda a: a.lazy[0].lazy.oindex[[3, 1], :], + lambda r: outer(r[0], ([3, 1], slice(None))), + ), + ( + "compose-vindex-then-scalar", + lambda a: a.lazy.vindex[np.array([0, 6, 3]), np.array([1, 4, 0]), np.array([2, 0, 1])].lazy[ + 1 + ], + lambda r: r[np.array([0, 6, 3]), np.array([1, 4, 0]), np.array([2, 0, 1])][1], + ), + # Partial vindex whose coordinate arrays are NOT on the leading axes: NumPy + # inserts the gathered axis where the (adjacent) advanced indices sat. + ( + "vindex-trailing-arrays", + lambda a: a.lazy.vindex[..., np.array([1, 4, 0]), np.array([2, 0, 1])], + lambda r: r[..., np.array([1, 4, 0]), np.array([2, 0, 1])], + ), + ( + "vindex-single-trailing-array", + lambda a: a.lazy.vindex[..., np.array([3, 0, 1])], + lambda r: r[..., np.array([3, 0, 1])], + ), + ( + "vindex-trailing-mask", + lambda a: a.lazy.vindex[..., TRAILING_MASK], + lambda r: r[..., TRAILING_MASK], + ), + ( + "vindex-leading-partial", + lambda a: a.lazy.vindex[np.array([1, 2, 2])], + lambda r: r[np.array([1, 2, 2])], + ), + ( + "compose-basic-then-vindex-trailing", + lambda a: a.lazy[2:, 1:].lazy.vindex[..., np.array([1, 3, 0])], + lambda r: r[2:, 1:][..., np.array([1, 3, 0])], + ), + # A ConstantMap sitting between a slice and the coordinate arrays: NumPy + # counts the integer as an advanced index, so the gathered axis moves to the + # front of the chunk block even though the arrays are trailing. + ( + "compose-vindex-trailing-then-scalar", + lambda a: a.lazy.vindex[..., np.array([3, 0])].lazy[2], + lambda r: r[..., np.array([3, 0])][2], + ), + # Two fancy axes, then a scalar on the first: the surviving ArrayMap ends up + # behind a ConstantMap and a slice, which is where NumPy's integer-counts-as- + # advanced rule bites. + ( + "compose-oindex-two-axes-then-scalar", + lambda a: a.lazy.oindex[[3, 1, 0], 3:5, [2, 0, 2]].lazy[0], + lambda r: outer(r, ([3, 1, 0], slice(3, 5), [2, 0, 2]))[0], + ), + # Negative steps: the positional dialect is NumPy's, including the empty + # cases NumPy allows where the transform algebra alone would object. + ("reverse", lambda a: a.lazy[::-1], lambda r: r[::-1]), + ("reverse-every-axis", lambda a: a.lazy[::-1, ::-1, ::-1], lambda r: r[::-1, ::-1, ::-1]), + ("reverse-strided", lambda a: a.lazy[::-2], lambda r: r[::-2]), + ("reverse-nondivisible", lambda a: a.lazy[::-3], lambda r: r[::-3]), + ("reverse-bounded", lambda a: a.lazy[5:1:-1], lambda r: r[5:1:-1]), + ("reverse-negative-start", lambda a: a.lazy[-1:None:-1], lambda r: r[-1:None:-1]), + ("reverse-past-the-start", lambda a: a.lazy[:-8:-1], lambda r: r[:-8:-1]), + ("reverse-empty", lambda a: a.lazy[2:2:-1], lambda r: r[2:2:-1]), + # NumPy reads a reversed *positional* interval as empty; only the literal + # layer calls it a direction error. + ("reverse-inverted-is-empty", lambda a: a.lazy[2:5:-1], lambda r: r[2:5:-1]), + ("reverse-with-int-drop", lambda a: a.lazy[::-2, 2, ::-1], lambda r: r[::-2, 2, ::-1]), + ("reverse-trailing-axis", lambda a: a.lazy[..., ::-1], lambda r: r[..., ::-1]), + ( + "compose-reverse-then-reverse", + lambda a: a.lazy[::-1].lazy[::-1], + lambda r: r[::-1][::-1], + ), + ( + "compose-strided-then-reverse", + lambda a: a.lazy[::2].lazy[::-1], + lambda r: r[::2][::-1], + ), + ( + "compose-reverse-then-strided", + lambda a: a.lazy[::-1].lazy[::2], + lambda r: r[::-1][::2], + ), + ( + "compose-reverse-then-oindex", + lambda a: a.lazy[::-1].lazy.oindex[[3, 0, 0], :, :], + lambda r: outer(r[::-1], ([3, 0, 0], slice(None), slice(None))), + ), + ( + "compose-oindex-then-reverse", + lambda a: a.lazy.oindex[[3, 1, 2], :, :].lazy[::-1], + lambda r: outer(r, ([3, 1, 2], slice(None), slice(None)))[::-1], + ), + ( + "compose-reverse-then-vindex", + lambda a: a.lazy[::-1].lazy.vindex[..., np.array([1, 3, 0])], + lambda r: r[::-1][..., np.array([1, 3, 0])], + ), + ( + "compose-vindex-trailing-then-scalar-and-slice", + lambda a: a.lazy.vindex[..., np.array([3, 0, 1])].lazy[-1, 1:4], + lambda r: r[..., np.array([3, 0, 1])][-1, 1:4], + ), + # A downward walk that begins off the front of the axis selects nothing. + # Written against an oindex axis and a vindex axis, where the selection is + # carried by an index array rather than by the domain. + ( + "compose-oindex-then-empty-downward-walk", + lambda a: a.lazy.oindex[np.array([3, 1, 4]), :, :].lazy[-8::-1], + lambda r: r[np.array([3, 1, 4])][-8::-1], + ), + ( + "compose-vindex-then-empty-downward-walk", + lambda a: a.lazy.vindex[np.array([3, 1]), np.array([2, 0])].lazy[-9::-2], + lambda r: r[np.array([3, 1]), np.array([2, 0])][-9::-2], + ), + ( + "empty-downward-walk-on-a-plain-axis", + lambda a: a.lazy[-11::-1], + lambda r: r[-11::-1], + ), + # A fancy *spelling* whose entries are all slices is not a fancy selection: + # it narrows the view's own axes and must compose exactly like basic + # indexing. The slices start past 0, so a step that applied them to the + # broadcast (singleton) axes of the existing index array would truncate it. + ( + "compose-oindex-then-oindex-slices-only", + lambda a: a.lazy.oindex[[4, 0, 0], :, :].lazy.oindex[:, 2:5, 1:], + lambda r: outer(r, ([4, 0, 0], slice(None), slice(None)))[:, 2:5, 1:], + ), + ( + "compose-oindex-then-oindex-slices-only-strided", + lambda a: a.lazy.oindex[:, [3, 1, 1], :].lazy.oindex[1::2, :, ::-1], + lambda r: outer(r, (slice(None), [3, 1, 1], slice(None)))[1::2, :, ::-1], + ), + ( + "compose-vindex-then-oindex-slices-only", + lambda a: a.lazy.vindex[np.array([4, 0, 2]), np.array([1, 3, 0])].lazy.oindex[1:, 2:], + lambda r: r[np.array([4, 0, 2]), np.array([1, 3, 0])][1:, 2:], + ), + ( + "compose-oindex-then-oindex-array-on-its-own-axis", + lambda a: a.lazy.oindex[[4, 0, 0], :, :].lazy.oindex[[2, 0], 3:, :], + lambda r: outer( + outer(r, ([4, 0, 0], slice(None), slice(None))), + ([2, 0], slice(3, None), slice(None)), + ), + ), +] + + +@pytest.mark.parametrize(("build", "oracle"), [c[1:] for c in CASES], ids=[c[0] for c in CASES]) +def test_selection_matches_numpy( + source: LazyArray, + build: Callable[[LazyArray], LazyArray], + oracle: Callable[[Any], Any], +) -> None: + """Every selection resolves to what NumPy computes positionally on the same data.""" + view = build(source) + expected = np.asarray(oracle(reference())) + + assert view.shape == expected.shape + assert view.ndim == expected.ndim + np.testing.assert_array_equal(np.asarray(view.result()), expected) + # `__getitem__` is eager, and `__array__` routes through `result()`. + np.testing.assert_array_equal(np.asarray(view), expected) + + +# --------------------------------------------------------------------------- +# Randomized chain sweep +# --------------------------------------------------------------------------- + + +def _random_basic(rng: np.random.Generator, shape: tuple[int, ...]) -> tuple[Any, ...]: + selection: list[Any] = [] + for size in shape: + roll = rng.random() + if roll < 0.3: + selection.append(int(rng.integers(-size, size))) + elif roll < 0.55: + start = int(rng.integers(0, size)) + stop = int(rng.integers(start, size + 1)) + selection.append(slice(start, stop, int(rng.integers(1, 4)))) + elif roll < 0.8: + # Downward: `start >= stop` and the stop may fall off the front, + # which is spelled `None`. The start is drawn from below `-size` as + # well, where the walk begins off the front and selects nothing — + # a case that reads as an ordinary negative index but is empty. + start = int(rng.integers(-2 * size - 1, size)) if size else 0 + stop_choice = int(rng.integers(-1, max(start, 0) + 1)) + stop = None if stop_choice < 0 else stop_choice + selection.append(slice(start, stop, -int(rng.integers(1, 4)))) + else: + selection.append(slice(None)) + return tuple(selection) + + +def _random_oindex(rng: np.random.Generator, shape: tuple[int, ...]) -> tuple[Any, ...]: + selection: list[Any] = [] + for size in shape: + roll = rng.random() + if roll < 0.25: + selection.append(int(rng.integers(-size, size))) + elif roll < 0.65: + count = int(rng.integers(1, 5)) + selection.append(rng.integers(-size, size, size=count).tolist()) + elif roll < 0.8: + mask = rng.random(size) < 0.5 + mask[int(rng.integers(0, size))] = True + selection.append(mask) + else: + start = int(rng.integers(0, size)) + selection.append(slice(start, size)) + return tuple(selection) + + +def _broadcast_singleton_axes( + rng: np.random.Generator, entries: list[Any], length: int +) -> list[Any]: + """Reshape 1-D coordinate arrays so the selection carries singleton axes. + + A coordinate array of shape `(1, n)` or `(n, 1)` contributes a broadcast axis + it does not vary over. That axis stays in the view's domain, and a later + basic index that consumes its partner leaves it referenced by no output map + at all — the shape that makes a broadcast axis and a genuine extent-1 axis + indistinguishable from the index array alone. + """ + rank = int(rng.integers(2, 4)) + reshaped: list[Any] = [] + for entry in entries: + if not isinstance(entry, np.ndarray): + reshaped.append(entry) + continue + varying = int(rng.integers(0, rank)) + reshaped.append( + entry.reshape(tuple(length if axis == varying else 1 for axis in range(rank))) + ) + return reshaped + + +def _random_vindex(rng: np.random.Generator, shape: tuple[int, ...]) -> tuple[Any, ...]: + ndim = len(shape) + count = int(rng.integers(1, ndim + 1)) + trailing = bool(rng.random() < 0.5) + axes = range(ndim - count, ndim) if trailing else range(count) + sizes = [shape[axis] for axis in axes] + + entries: list[Any] + if rng.random() < 0.2: + # A single boolean mask spanning the whole covered block. + mask = rng.random(tuple(sizes)) < 0.5 + mask.flat[int(rng.integers(0, mask.size))] = True + entries = [mask] + else: + length = int(rng.integers(1, 5)) + entries = [ + int(rng.integers(-size, size)) + if rng.random() < 0.25 + else rng.integers(-size, size, size=length) + for size in sizes + ] + if rng.random() < 0.35: + entries = _broadcast_singleton_axes(rng, entries, length) + return (Ellipsis, *entries) if trailing else tuple(entries) + + +def _apply_oracle( + ref: np.ndarray[Any, Any], mode: str, selection: tuple[Any, ...] +) -> np.ndarray[Any, Any]: + if mode == "orthogonal": + return outer(ref, selection) + # NumPy's own semantics *are* basic and vectorized indexing. + return ref[selection] + + +def _apply_view(view: LazyArray, mode: str, selection: tuple[Any, ...]) -> LazyArray: + if mode == "basic": + return view.lazy[selection] + if mode == "orthogonal": + return view.lazy.oindex[selection] + return view.lazy.vindex[selection] + + +def _random_slices_only(rng: np.random.Generator, shape: tuple[int, ...]) -> tuple[Any, ...]: + """A selection of slices alone, spelled through `oindex`. + + `oindex` entries that are all slices are not a fancy selection — they narrow + the view's own axes and must compose like basic indexing. A start past 0 is + what distinguishes a step that walks the index array's dependency axes from + one that walks its broadcast singletons, so slices are drawn to reach past + the origin. (`vindex` is coordinate-only and rejects a slice outright, so + this spelling has no vectorized counterpart.) + """ + selection: list[Any] = [] + for size in shape: + roll = rng.random() + if roll < 0.4: + start = int(rng.integers(0, size)) if size else 0 + selection.append(slice(start, size)) + elif roll < 0.7: + start = int(rng.integers(0, size)) if size else 0 + selection.append(slice(start, size, int(rng.integers(1, 3)))) + elif roll < 0.85: + selection.append(slice(None, None, -1)) + else: + selection.append(slice(None)) + return tuple(selection) + + +def _random_chain(rng: np.random.Generator) -> list[tuple[str, tuple[Any, ...]]]: + """A chain of 2-4 steps, any of which may be fancy. + + A step spelled through `oindex` but carrying only slices is drawn separately + (`slices-only`): it narrows an existing index array by a *slice* rather than + by coordinates, a distinct code path kept at full weight. + """ + n_steps = int(rng.integers(2, 5)) + fancy_steps = {int(rng.integers(0, n_steps)) for _ in range(2)} + slices_only_at = int(rng.integers(0, n_steps)) if rng.random() < 0.4 else -1 + + chain: list[tuple[str, tuple[Any, ...]]] = [] + running = reference() + for step in range(n_steps): + if running.ndim == 0 or running.size == 0: + break + if step in fancy_steps: + mode = "orthogonal" if rng.random() < 0.5 else "vectorized" + else: + mode = "basic" + if step == slices_only_at and step not in fancy_steps: + mode = "orthogonal" + selection = _random_slices_only(rng, running.shape) + elif mode == "basic": + selection = _random_basic(rng, running.shape) + elif mode == "orthogonal": + selection = _random_oindex(rng, running.shape) + else: + selection = _random_vindex(rng, running.shape) + chain.append((mode, selection)) + running = _apply_oracle(running, mode, selection) + return chain + + +@pytest.mark.parametrize("flavor", FLAVORS) +def test_random_chains_match_numpy(flavor: str) -> None: + """A seeded sweep of composed chains, under every partitioning. + + The partitioning invariant as a property: `result()` is identical whatever + boxes the read is broken into, including boxes deliberately misaligned with + the source's own. + """ + rng = np.random.default_rng(20260730) + source = make_source(flavor) + partitionings: list[Any] = [None, (2, 2, 2), (7, 5, 4), ((4, 3), (1, 3, 1), (3, 1))] + # Reads against a real store cost more per chain; the NumPy flavors carry + # the bulk of the sweep and exercise the identical code path. + n_chains = 120 if flavor.startswith("zarr") else 400 + + for _ in range(n_chains): + chain = _random_chain(rng) + expected = reference() + for mode, selection in chain: + expected = _apply_oracle(expected, mode, selection) + + view = source + for mode, selection in chain: + view = _apply_view(view, mode, selection) + + assert view.shape == expected.shape, f"{flavor}: {chain}" + np.testing.assert_array_equal( + np.asarray(view.result()), np.asarray(expected), err_msg=f"{flavor}: {chain}" + ) + for parts in partitionings: + np.testing.assert_array_equal( + np.asarray(repartition(view, parts).result()), + np.asarray(expected), + err_msg=f"{flavor} parts={parts}: {chain}", + ) + + +# `result()` can absorb a defect that `parts()` cannot — an empty view assembles +# correctly from no parts at all, and a rank-0 one can be reshaped into place — +# so the iteration contract needs its own sweep, asserting the documented +# assembly literally rather than through `result()`. That sweep is the +# `ChainedIndexing` state machine in `test_lazy_array_stateful.py`, which drives +# the same operations and shrinks a failure to the chain that caused it. + + +PARTITIONINGS_1D: list[Any] = [None, (1,), (2,), (5,)] + + +def test_a_slice_only_fancy_step_after_a_fancy_step_reads_real_data() -> None: + """`oindex[:, 2:8]` after an `oindex` narrows the view, it does not re-index it. + + The second step carries no coordinates, so it is not fancy-after-fancy: it + must compose like basic indexing. Applying its slices to the *broadcast* + axes of the first step's index array instead truncates that array to size 0, + which leaves the resolver with no parts to read and `result()` handing back + an unwritten buffer. + """ + base = np.arange(24).reshape(3, 8) + expected = base[np.ix_([0, 2], range(8))][:, 2:8] + + for parts in (None, (2, 4), (1, 8), (3, 3)): + view = ( + repartition(LazyArray(base), parts).lazy.oindex[np.array([0, 2]), :].lazy.oindex[:, 2:8] + ) + assert view.shape == expected.shape, f"parts={parts}" + np.testing.assert_array_equal(np.asarray(view.result()), expected, err_msg=f"{parts}") + + +def test_a_fancy_step_composes_onto_any_axis_of_a_fancy_view() -> None: + """A second fancy step may land on axes the first one merely broadcasts along. + + Composition evaluates the existing index arrays at the new coordinates, so + `oindex` after `oindex`, `vindex` after `oindex`, and both orders around a + correlated gather all resolve — under every partitioning. + """ + base = np.arange(24).reshape(3, 8) + rows, cols = np.array([0, 2]), np.array([1, 3, 3]) + + for parts in (None, (2, 4), (1, 8), (3, 3)): + view = repartition(LazyArray(base), parts).lazy.oindex[rows, :] + + composed = view.lazy.oindex[:, cols] + expected = base[np.ix_(rows, cols)] + assert composed.shape == expected.shape, f"parts={parts}" + np.testing.assert_array_equal(np.asarray(composed.result()), expected, err_msg=f"{parts}") + + gathered = view.lazy.vindex[np.array([0, 1]), np.array([7, 0])] + np.testing.assert_array_equal( + np.asarray(gathered.result()), + base[np.ix_(rows, range(8))][[0, 1], [7, 0]], + err_msg=f"{parts}", + ) + + pointwise = repartition(LazyArray(base), parts).lazy.vindex[[0, 1, 2], [0, 2, 3]] + np.testing.assert_array_equal( + np.asarray(pointwise.lazy.oindex[[2, 0]].result()), + base[[0, 1, 2], [0, 2, 3]][[2, 0]], + err_msg=f"{parts}", + ) + np.testing.assert_array_equal( + np.asarray(pointwise.lazy.vindex[[1, 1, 0]].result()), + base[[0, 1, 2], [0, 2, 3]][[1, 1, 0]], + err_msg=f"{parts}", + ) + + +def test_a_partial_vindex_after_an_oindex_resolves_the_mixed_transform() -> None: + """A composed transform can mix correlated and orthogonal index arrays. + + `oindex` on the last axis then `vindex` on the first two leaves the + orthogonal gather in place while the new coordinate arrays are correlated; + resolution takes the pointwise path. + """ + base = np.arange(60).reshape(3, 4, 5) + expected = base[:, :, [4, 0]][[0, 2], [1, 3]] + + for parts in (None, (2, 2, 2), (3, 4, 5), (1, 1, 1)): + view = repartition(LazyArray(base), parts).lazy.oindex[:, :, [4, 0]] + composed = view.lazy.vindex[np.array([0, 2]), np.array([1, 3])] + assert composed.shape == expected.shape, f"parts={parts}" + np.testing.assert_array_equal(np.asarray(composed.result()), expected, err_msg=f"{parts}") + + +def test_a_boolean_mask_composes_onto_a_fancy_view() -> None: + base = np.arange(60).reshape(3, 4, 5) + mask = np.array([True, False, True]) + expected = base[[0, 1, 2]][mask] + + for parts in (None, (2, 2, 2), (1, 4, 5)): + view = repartition(LazyArray(base), parts).lazy.oindex[[0, 1, 2], :, :] + np.testing.assert_array_equal( + np.asarray(view.lazy.oindex[mask].result()), expected, err_msg=f"{parts}" + ) + + +def test_an_ellipsis_only_vindex_step_preserves_a_correlated_gather() -> None: + """Regression: a slice-only vindex step misread correlated maps as orthogonal. + + `vindex[...]` (and `vindex[..., scalar]`, whose remainder after the scalar + is split off is ellipsis-only) used to stamp each correlated map with its + block axis as an orthogonal binding. Two "orthogonal" maps then shared one + input axis, and the partition walk rejected its own transform mid-read. + """ + base = np.arange(16).reshape(4, 4) + + for parts in (None, (2, 2), (4, 4), (1, 3)): + pointwise = repartition(LazyArray(base), parts).lazy.vindex[[0, 1, 2], [0, 2, 3]] + np.testing.assert_array_equal( + np.asarray(pointwise.lazy.vindex[...].result()), + base[[0, 1, 2], [0, 2, 3]], + err_msg=f"{parts}", + ) + + planar = repartition(LazyArray(base), parts).lazy.vindex[ + np.array([[0], [1]]), np.array([[1], [3]]) + ] + np.testing.assert_array_equal( + np.asarray(planar.lazy.vindex[..., np.array(0)].result()), + base[[0, 1], [1, 3]], + err_msg=f"{parts}", + ) + + +# --------------------------------------------------------------------------- +# Domain dimensions no output map depends on +# --------------------------------------------------------------------------- +# +# A `vindex` coordinate array with a *singleton* broadcast axis leaves that axis +# in the view's domain while the map varies only over its partner. A later basic +# index that consumes the partner collapses the map to a `ConstantMap`, and the +# singleton axis survives with nothing referencing it. Every stage of resolution +# has to keep counting it: the lowered block needs the axis back at its true +# extent, and a part has to say where its values belong along it. + +UNREFERENCED_AXIS_PARTITIONINGS: list[Any] = [None, (1, 1, 1), (2, 2, 2), (3, 4, 5), (3, 1, 2)] + +# (id, view builder, NumPy oracle) over `np.arange(60).reshape(3, 4, 5)`. +UNREFERENCED_AXIS_CASES: list[ + tuple[str, Callable[[LazyArray], LazyArray], Callable[[Any], Any]] +] = [ + ( + "leading-singleton-row", + lambda a: a.lazy.vindex[np.array([[2, 0]])].lazy[:, 0], + lambda r: r[np.array([[2, 0]])][:, 0], + ), + ( + "trailing-singleton-column", + lambda a: a.lazy.vindex[np.array([[2], [0]])].lazy[0], + lambda r: r[np.array([[2], [0]])][0], + ), + ( + "repeated-coordinates-over-a-singleton", + lambda a: a.lazy.vindex[np.array([[1, 1]]), np.array([[3, 3]])].lazy[:, 0], + lambda r: r[np.array([[1, 1]]), np.array([[3, 3]])][:, 0], + ), + ( + "unreferenced-axis-emptied", + lambda a: a.lazy.vindex[np.array([[2, 0]])].lazy[0:0, 0], + lambda r: r[np.array([[2, 0]])][0:0, 0], + ), + ( + "partial-vindex-with-a-residual-slice", + lambda a: a.lazy.vindex[np.array([[2, 0]]), np.array([[1, 3]])].lazy[:, 0, 1:4], + lambda r: r[np.array([[2, 0]]), np.array([[1, 3]])][:, 0, 1:4], + ), +] + + +def unreferenced_axis_reference() -> np.ndarray[Any, np.dtype[np.int64]]: + return np.arange(60, dtype=np.int64).reshape(3, 4, 5) + + +@pytest.mark.parametrize( + ("build", "oracle"), + [case[1:] for case in UNREFERENCED_AXIS_CASES], + ids=[case[0] for case in UNREFERENCED_AXIS_CASES], +) +@pytest.mark.parametrize("parts", UNREFERENCED_AXIS_PARTITIONINGS) +def test_a_domain_axis_no_output_map_depends_on_still_resolves( + build: Callable[[LazyArray], LazyArray], + oracle: Callable[[Any], Any], + parts: Any, +) -> None: + """The value, the shape and the tiling all hold when an axis is unreferenced.""" + data = unreferenced_axis_reference() + expected = np.asarray(oracle(data)) + view = build(repartition(LazyArray(data), parts)) + + assert view.shape == expected.shape + np.testing.assert_array_equal(np.asarray(view.result()), expected) + + hits = np.zeros(view.shape, dtype=np.int64) + assembled = np.zeros(view.shape, dtype=view.dtype) + for part in view.parts(): + assembled[part.out_selection] = np.asarray(part.view.result()) + np.add.at(hits, part.out_selection, 1) + np.testing.assert_array_equal(assembled, expected) + np.testing.assert_array_equal(hits, np.ones(view.shape, dtype=np.int64)) + + +def test_an_unreferenced_domain_axis_of_extent_zero_stays_empty() -> None: + """An emptied broadcast axis must not be restored as a fabricated row. + + The lowered block has no axis for a dimension nothing depends on, so the + resolver puts one back. Putting it back at extent 1 invents a row of data + for a selection whose own `shape` says it is empty. + """ + data = np.arange(140, dtype=np.int64).reshape(7, 5, 4) + coords = np.array([[6], [3], [0]]) + for parts in (None, (1, 1, 1), (3, 2, 3), (7, 5, 4)): + view = repartition(LazyArray(data), parts).lazy.vindex[coords, -4].lazy[0, 0:0] + expected = data[coords, -4][0, 0:0] + assert view.shape == expected.shape == (0, 4), f"parts={parts}" + np.testing.assert_array_equal(np.asarray(view.result()), expected, err_msg=f"{parts}") + assert list(view.parts()) == [] + + +def test_a_zero_length_axis_resolves_the_same_way_under_every_partitioning() -> None: + """A size-0 axis carries no dependency, so it cannot make a map correlated.""" + base = np.zeros((3, 0)) + expected = base[np.ix_([1, 0, 0], np.arange(0, dtype=int))] + + for parts in (None, ((1, 1, 1), ()), ((3,), ())): + view = ( + repartition(LazyArray(base), parts) + .lazy.oindex[np.array([1, -3, -3]), :] + .lazy.oindex[:, :] + ) + assert view.shape == expected.shape, f"parts={parts}" + np.testing.assert_array_equal(np.asarray(view.result()), expected, err_msg=f"{parts}") + assert list(view.parts()) == [] + + +def test_an_empty_slice_of_a_length_one_correlated_axis_has_no_parts() -> None: + """`parts()` agrees with `result()` that an emptied view selects nothing. + + A correlated selection of exactly one point normalizes to an all-singleton + index array, indistinguishable by shape from an axis the map broadcasts + over — so a later slice that empties the domain leaves the array at size 1. + """ + base = np.arange(5) + mask = np.array([False, True, False, False, False]) + + for parts in PARTITIONINGS_1D: + view = repartition(LazyArray(base), parts).lazy.vindex[mask].lazy[1:-2] + assert view.shape == (0,), f"parts={parts}" + assert list(view.parts()) == [], f"parts={parts}" + np.testing.assert_array_equal(np.asarray(view.result()), base[mask][1:-2]) + + +def test_an_empty_slice_of_a_length_one_vindex_pair_has_no_parts() -> None: + """The same emptied view, spelled with explicit coordinates over two axes.""" + base = np.arange(35).reshape(7, 5) + + for parts in (None, (2, 2), (7, 5)): + view = ( + repartition(LazyArray(base), parts).lazy.vindex[np.array([6]), np.array([0])].lazy[0:0] + ) + assert view.shape == (0,), f"parts={parts}" + assert list(view.parts()) == [], f"parts={parts}" + np.testing.assert_array_equal( + np.asarray(view.result()), base[np.array([6]), np.array([0])][0:0] + ) + + +def test_a_correlated_view_narrowed_to_one_point_has_parts_of_the_views_rank() -> None: + """A rank-0 broadcast block survives intersection without gaining an axis. + + `Partition` documents `out[part.out_selection] = part.view.result()` as the + assembly, so a part's values must arrive at the rank the view has — including + the rank 0 a correlated selection reaches once every coordinate is a scalar. + """ + base = np.arange(140).reshape(7, 5, 4) + cases = [ + # No residual slice: the whole view is the one gathered point. + ((np.array([-1]), np.array([-1]), np.array([2])), 0), + # One residual slice dimension survives alongside the collapsed block. + ((np.array([6, 1]), np.array([4, 0])), 1), + ] + + for parts in (None, (2, 2, 2), (3, 3, 3), (7, 5, 4)): + for selection, tail in cases: + expected = base[selection][tail] + view = repartition(LazyArray(base), parts).lazy.vindex[selection].lazy[tail] + assert view.shape == expected.shape, f"parts={parts}, {selection}" + + assembled = np.zeros(view.shape, dtype=view.dtype) + hits = np.zeros(view.shape, dtype=np.int64) + for part in view.parts(): + assembled[part.out_selection] = np.asarray(part.view.result()) + np.add.at(hits, part.out_selection, 1) + + err = f"parts={parts}, {selection}" + np.testing.assert_array_equal(assembled, expected, err_msg=err) + np.testing.assert_array_equal(hits, np.ones(view.shape, dtype=np.int64), err_msg=err) + np.testing.assert_array_equal(np.asarray(view.result()), expected, err_msg=err) + + +def test_eager_getitem_returns_data(source: LazyArray) -> None: + """`arr[...]` reads immediately, like `numpy.ndarray.__getitem__`.""" + np.testing.assert_array_equal(np.asarray(source[1:3, ::2, -1]), reference()[1:3, ::2, -1]) + + +# --------------------------------------------------------------------------- +# Attribute forwarding +# --------------------------------------------------------------------------- + + +def test_forwards_array_attributes(source: LazyArray) -> None: + assert source.shape == SHAPE + assert source.ndim == len(SHAPE) + assert source.size == int(np.prod(SHAPE)) + assert source.dtype == np.dtype("int64") + assert len(source) == SHAPE[0] + assert "LazyArray" in repr(source) + + +def test_view_shape_comes_from_the_transform(source: LazyArray) -> None: + """A view reports its own shape, not the wrapped array's.""" + view = source.lazy[1:6:2, :, -1] + assert view.shape == (3, 5) + assert view.ndim == 2 + assert view.size == 15 + assert view.dtype == source.dtype + assert "view=" in repr(view) + + +def test_the_wrapper_has_no_chunks_vocabulary() -> None: + """`chunks` is the *source's* word, never the wrapper's.""" + assert not hasattr(make_source("numpy-whole"), "chunks") + assert not hasattr(make_source("zarr"), "chunks") + with pytest.raises(TypeError): + LazyArray(reference(), chunks=PART_SHAPE) # type: ignore[call-arg] + + +def test_scalar_is_basic_even_when_a_slice_separates_it_from_the_arrays() -> None: + """A documented, deliberate departure from one NumPy corner. + + NumPy counts an integer as an *advanced* index for its placement rule, so + `x[0, :, i]` has shape `(len(i), x.shape[1])` — the arrays lead because the + slice separates the integer from them. The positional dialect instead treats + every scalar as a basic index applied first, which is the rule the rest of + the surface follows and the only one `oindex` can express, so the same + selection reads as `x[0][:, i]`. + """ + data = reference() + view = make_source("numpy-uniform-parts").lazy.vindex[0, ..., np.array([3, 0])] + np.testing.assert_array_equal(np.asarray(view.result()), data[0][..., np.array([3, 0])]) + assert view.shape == data[0][..., np.array([3, 0])].shape + assert view.shape != data[0, ..., np.array([3, 0])].shape + + +def test_zero_dimensional_result_is_an_array(source: LazyArray) -> None: + """Both resolvers agree on the kind of a zero-rank result.""" + result = source.lazy[0, 1, 2].result() + assert isinstance(result, np.ndarray) + assert result.ndim == 0 + assert result[()] == reference()[0, 1, 2] + + +def test_construction_selects_readers_explicitly() -> None: + data = reference() + assert LazyArray(data).reader is basic_reader + assert LazyArray.from_numpy(data).reader is numpy_reader + + +def test_reader_wrappers_forward_the_read_contract_unchanged() -> None: + events: list[tuple[str, Any, ReadContext, Any]] = [] + + class RecordingDelegatingReader: + def __init__(self, name: str, inner: Reader) -> None: + self.name = name + self.inner = inner + + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> None: + events.append((self.name, source, context, out)) + self.inner.read_into(source, context, out) + + data = reference() + inner = RecordingDelegatingReader("inner", numpy_reader) + outer = RecordingDelegatingReader("outer", inner) + view = LazyArray(data).with_reader(outer).lazy[1:6:2, ::-1, 1].unpartitioned() + + result = view.result() + + assert [name for name, _, _, _ in events] == ["outer", "inner"] + outer_call, inner_call = events + assert outer_call[1] is inner_call[1] is data + assert outer_call[2] is inner_call[2] + assert outer_call[3] is inner_call[3] is result + np.testing.assert_array_equal(result, data[1:6:2, ::-1, 1]) + + +@pytest.mark.parametrize("value", [object(), [1, 2, 3], "array"]) +def test_from_numpy_rejects_non_ndarrays(value: Any) -> None: + with pytest.raises(TypeError, match="from_numpy requires a numpy.ndarray"): + LazyArray.from_numpy(value) + + +class RecordingReader: + def __init__(self) -> None: + self.calls: list[tuple[Any, ReadContext, Any]] = [] + self.contexts: list[ReadContext] = [] + + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> None: + self.calls.append((source, context, out)) + self.contexts.append(context) + basic_reader.read_into(source, context, out) + + +def test_view_operations_preserve_the_reader_without_reading() -> None: + data = reference() + reader = RecordingReader() + base = LazyArray(data).with_reader(reader) + views = ( + base.lazy[1:5], + base.with_parts((2, 2, 2)), + base.with_parts_per_axis(((3, 3, 1), (2, 3), (1, 3))), + base.unpartitioned(), + ) + assert reader.calls == [] + assert all(view.reader is reader for view in views) + assert all(part.view.reader is reader for part in views[1].parts()) + + +@pytest.mark.parametrize("value", [object(), None, lambda: None]) +def test_with_reader_requires_callable_read_into(value: Any) -> None: + with pytest.raises(TypeError, match="reader.read_into must be callable"): + LazyArray(reference()).with_reader(value) + + +class ReturningReader: + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> Any: + return np.empty(context.transform.domain.shape, dtype=source.dtype) + + +def test_result_rejects_a_reader_that_returns_a_value() -> None: + view = LazyArray(reference()).with_reader(ReturningReader()) + with pytest.raises(TypeError, match="must return None"): + view.result() + + +class BufferRecordingReader(RecordingReader): + def __init__(self) -> None: + super().__init__() + self.owns_data: list[bool] = [] + + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> None: + self.owns_data.append(bool(out.flags.owndata)) + super().read_into(source, context, out) + + +def test_reader_is_called_once_per_touched_part() -> None: + data = np.arange(48).reshape(6, 8) + reader = RecordingReader() + view = LazyArray(data).with_reader(reader).with_parts((3, 4)).lazy[1:5, 2] + np.testing.assert_array_equal(view.result(), data[1:5, 2]) + assert len(reader.calls) == len(tuple(view.parts())) == 2 + assert all( + call[1].transform.domain.inclusive_min == (0,) * call[1].transform.input_rank + for call in reader.calls + ) + + +def test_partition_reader_receives_global_transform_and_existing_projection() -> None: + reader = RecordingReader() + view = LazyArray(np.arange(8)).with_reader(reader).with_parts((4,)) + expected = [part.projection for part in view.parts()] + + np.testing.assert_array_equal(view.result(), np.arange(8)) + + assert [context.projection for context in reader.contexts] == expected + assert [context.transform.apply((0,)) for context in reader.contexts] == [(0,), (4,)] + + +def test_an_empty_result_does_not_call_the_reader() -> None: + reader = RecordingReader() + result = LazyArray(reference()).with_reader(reader).lazy[:, 0:0, :].result() + assert result.shape == (7, 0, 4) + assert reader.calls == [] + + +def test_rectangular_parts_write_into_result_views() -> None: + reader = BufferRecordingReader() + view = LazyArray(reference()).with_reader(reader).with_parts((2, 2, 2)).lazy[1:6, 1:4] + view.result() + assert reader.owns_data + assert not any(reader.owns_data) + + +def test_fancy_part_placement_uses_owned_dense_temporaries() -> None: + reader = BufferRecordingReader() + view = ( + LazyArray(reference()) + .with_reader(reader) + .with_parts((2, 2, 2)) + .lazy.oindex[[6, 1, 1], :, :] + ) + np.testing.assert_array_equal(view.result(), reference()[np.ix_([6, 1, 1], range(5), range(4))]) + assert any(reader.owns_data) + + +def test_reader_exception_propagates_unchanged() -> None: + error = RuntimeError("backend failed") + + class FailingReader: + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> None: + raise error + + with pytest.raises(RuntimeError) as caught: + LazyArray(reference()).with_reader(FailingReader()).result() + assert caught.value is error + + +class ForeignArray: + """A minimal array-like whose advertised `chunks` we do not control.""" + + def __init__(self, data: np.ndarray[Any, Any], chunks: Any) -> None: + self._data = data + self.chunks = chunks + + @property + def shape(self) -> tuple[int, ...]: + return self._data.shape + + @property + def dtype(self) -> Any: + return self._data.dtype + + def __getitem__(self, key: Any) -> Any: + return self._data[key] + + +def test_malformed_discovered_parts_are_ignored() -> None: + """A foreign object's unusable `chunks` falls back to one whole-array part. + + Discovery parses external input, so an attribute that does not describe a + partitioning of the shape means "none I understand", not an error. + """ + data = reference() + for bogus in (((3, 3), (5,), (4,)), (3, 2), "nope", (3.5, 2, 2)): + wrapped = LazyArray(ForeignArray(data, bogus)) + assert len(list(wrapped.parts())) == 1 + np.testing.assert_array_equal(np.asarray(wrapped.lazy[1:3].result()), data[1:3]) + + +def test_discovered_parts_come_from_the_source_vocabulary() -> None: + """`read_chunk_sizes` wins over `chunks`, and both are read as parts.""" + data = reference() + wrapped = LazyArray(ForeignArray(data, PART_SHAPE)) + assert [part.base_coords for part in wrapped.parts()][:3] == [(0, 0, 0), (0, 0, 1), (0, 1, 0)] + assert len(list(wrapped.parts())) == 3 * 3 * 2 + + +# --------------------------------------------------------------------------- +# Boxes +# --------------------------------------------------------------------------- + +# (id, build, expected is_box, expected bounding_box). The bounds are storage +# intervals of the wrapped (7, 5, 4) array, computed by hand. +BOX_CASES: list[tuple[str, Callable[[LazyArray], LazyArray], bool, Any]] = [ + ("identity", lambda a: a, True, ((0, 7), (0, 5), (0, 4))), + ("basic-slice", lambda a: a.lazy[1:6, :, 1:3], True, ((1, 6), (0, 5), (1, 3))), + # Stride 2 over axis 1 touches 0, 2, 4; the hull is the closed span. + ("strided", lambda a: a.lazy[::3, ::2, :], True, ((0, 7), (0, 5), (0, 4))), + ("int-drop", lambda a: a.lazy[2, :, -1], True, ((2, 3), (0, 5), (3, 4))), + ("all-scalars", lambda a: a.lazy[0, 1, 2], True, ((0, 1), (1, 2), (2, 3))), + ("negative-and-open", lambda a: a.lazy[-2:], True, ((5, 7), (0, 5), (0, 4))), + ( + "oindex", + lambda a: a.lazy.oindex[[4, 0, 0], :, [3, 1]], + False, + ((0, 5), (0, 5), (1, 4)), + ), + ( + "vindex", + lambda a: a.lazy.vindex[np.array([0, 6, 3]), np.array([1, 4, 0]), np.array([2, 0, 1])], + False, + ((0, 7), (0, 5), (0, 3)), + ), + ("mask", lambda a: a.lazy.vindex[MASK], False, ((0, 7), (0, 5), (0, 4))), + # Composition preserves the category in both directions. + ("box-of-box", lambda a: a.lazy[1:6].lazy[:, 1:3], True, ((1, 6), (1, 3), (0, 4))), + ( + "box-after-fancy", + lambda a: a.lazy.oindex[[4, 0, 2], :, :].lazy[0:2], + False, + ((0, 5), (0, 5), (0, 4)), + ), + ("empty", lambda a: a.lazy[2:2], True, None), + ( + "empty-fancy", + lambda a: a.lazy.oindex[np.array([], dtype=np.intp), :, :], + False, + None, + ), +] + + +@pytest.mark.parametrize( + ("build", "expected_is_box", "expected_bounds"), + [case[1:] for case in BOX_CASES], + ids=[case[0] for case in BOX_CASES], +) +def test_is_box_and_bounding_box( + source: LazyArray, + build: Callable[[LazyArray], LazyArray], + expected_is_box: bool, + expected_bounds: Any, +) -> None: + """The box/query taxonomy, and the hull every selection has either way.""" + view = build(source) + assert view.is_box is expected_is_box + assert view.bounding_box() == expected_bounds + + +def test_a_unit_stride_box_is_dense_in_its_bounding_box() -> None: + """Stride 1 everywhere: the hull is exactly what the view selects.""" + data = reference() + view = make_source("numpy-uniform-parts").lazy[1:6, :, 1:3] + assert view.is_box + assert view.strides() == (1, 1, 1) + bounds = view.bounding_box() + assert bounds is not None + np.testing.assert_array_equal( + np.asarray(view.result()), + data[tuple(slice(lo, hi) for lo, hi in bounds)], + ) + + +def test_a_strided_box_is_sparse_in_its_bounding_box() -> None: + """Stride > 1: the hull is a superset, and `strides()` is what says by how much.""" + data = reference() + view = make_source("numpy-uniform-parts").lazy[1:6, ::2, :] + assert view.is_box + assert view.strides() == (1, 2, 1) + bounds = view.bounding_box() + assert bounds is not None + assert bounds == ((1, 6), (0, 5), (0, 4)) + + hull = data[tuple(slice(lo, hi) for lo, hi in bounds)] + assert hull.size == 5 * 5 * 4 + assert view.size == 5 * 3 * 4 + # A consumer that slabbed the hull and threw the rest away would over-read. + assert hull.size > view.size + # Applying the strides to the hull recovers the selection exactly. + np.testing.assert_array_equal( + np.asarray(view.result()), + hull[tuple(slice(None, None, step) for step in view.strides() or ())], + ) + + +def test_strides_are_none_for_a_query() -> None: + view = make_source("numpy-uniform-parts").lazy.oindex[[5, 1], :, :] + assert not view.is_box + assert view.strides() is None + + +def test_an_integer_indexed_dimension_has_stride_one() -> None: + view = make_source("numpy-uniform-parts").lazy[2, ::3, :] + assert view.strides() == (1, 3, 1) + assert view.bounding_box() == ((2, 3), (0, 4), (0, 4)) + + +def test_a_query_bounding_box_is_only_a_hull() -> None: + """For a fancy selection the box is a superset, and `is_box` says so.""" + view = make_source("numpy-uniform-parts").lazy.oindex[[5, 1], :, :] + assert not view.is_box + assert view.bounding_box() == ((1, 6), (0, 5), (0, 4)) + # The hull spans 5 rows; the selection touches 2 of them. + assert view.shape[0] == 2 + + +# --------------------------------------------------------------------------- +# Parts +# --------------------------------------------------------------------------- + + +class _ReadMustNotRun: + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> None: + raise AssertionError("prepared-plan validation must happen before any read") + + +def test_prepared_part_validation_allocates_boolean_coverage_bitmap( + monkeypatch: pytest.MonkeyPatch, +) -> None: + view = LazyArray.from_numpy(reference()).with_parts(PART_SHAPE).lazy[1:6, ::2, 1:] + parts = tuple(view.parts()) + allocations: list[tuple[tuple[int, ...], np.dtype[Any]]] = [] + real_zeros = np.zeros + + def recording_zeros(shape: Any, *args: Any, **kwargs: Any) -> np.ndarray[Any, Any]: + result = real_zeros(shape, *args, **kwargs) + allocations.append((tuple(shape), result.dtype)) + return result + + monkeypatch.setattr(lazy_array_module.np, "zeros", recording_zeros) + + _validate_prepared_parts(parts, view.shape) + + assert allocations == [(view.shape, np.dtype(np.bool_))] + + +@pytest.mark.parametrize( + ("data", "part_shape", "build", "expected"), + [ + pytest.param( + np.arange(8), + (3,), + lambda array: array.lazy[1:7:2], + np.array([1, 3, 5]), + id="basic-reordered-parts", + ), + pytest.param( + np.arange(8), + (3,), + lambda array: array.lazy[3], + np.array(3), + id="scalar", + ), + pytest.param( + np.arange(20).reshape(4, 5), + (2, 3), + lambda array: array.lazy.oindex[[3, 1, 1], [4, 0]], + np.array([[19, 15], [9, 5], [9, 5]]), + id="orthogonal-fancy", + ), + pytest.param( + np.arange(20).reshape(4, 5), + (2, 3), + lambda array: array.lazy.vindex[[3, 1, 1], [4, 0, 4]], + np.array([19, 5, 9]), + id="correlated-fancy", + ), + pytest.param( + np.arange(8), + (3,), + lambda array: array.lazy[2:2], + np.array([], dtype=np.int64), + id="empty", + ), + ], +) +def test_result_accepts_prepared_parts_from_the_same_view( + monkeypatch: pytest.MonkeyPatch, + data: np.ndarray[Any, Any], + part_shape: tuple[int, ...], + build: Callable[[LazyArray], LazyArray], + expected: np.ndarray[Any, Any], +) -> None: + view = build(LazyArray.from_numpy(data).with_parts(part_shape)) + parts = tuple(reversed(tuple(view.parts()))) + + def unexpected_replan(self: LazyArray) -> Any: + raise AssertionError("result(parts=...) must not construct another partition plan") + + monkeypatch.setattr(LazyArray, "parts", unexpected_replan) + + np.testing.assert_array_equal(view.result(parts=parts), expected) + + +def test_result_rejects_prepared_parts_owned_by_another_view() -> None: + data = reference() + base = LazyArray.from_numpy(data).with_reader(_ReadMustNotRun()).with_parts(PART_SHAPE) + view = base.lazy[1:6, ::2, 1:] + owned_parts = tuple(view.parts()) + foreign_parts = tuple(base.lazy[1:6, ::2, 1:].parts()) + mixed_parts = (owned_parts[0], *foreign_parts[1:]) + + with pytest.raises(ValueError, match="prepared parts do not belong to this view"): + view.result(parts=mixed_parts) + + +def test_result_rejects_prepared_parts_that_do_not_tile_the_view() -> None: + data = reference() + view = ( + LazyArray.from_numpy(data) + .with_reader(_ReadMustNotRun()) + .with_parts(PART_SHAPE) + .lazy[1:6, ::2, 1:] + ) + parts = tuple(view.parts()) + + with pytest.raises(ValueError, match="prepared parts do not tile the view exactly"): + view.result(parts=parts[:-1]) + + +def test_result_rejects_prepared_parts_with_a_duplicate_and_omission() -> None: + view = LazyArray.from_numpy(np.arange(8)).with_reader(_ReadMustNotRun()).with_parts((4,)) + first, _second = tuple(view.parts()) + + with pytest.raises(ValueError, match="prepared parts do not tile the view exactly"): + view.result(parts=(first, first)) + + +def test_result_rejects_complete_prepared_parts_plus_a_duplicate() -> None: + view = LazyArray.from_numpy(np.arange(8)).with_reader(_ReadMustNotRun()).with_parts((4,)) + first, second = tuple(view.parts()) + + with pytest.raises(ValueError, match="prepared parts do not tile the view exactly"): + view.result(parts=(first, second, first)) + + +def test_result_rejects_overlapping_prepared_parts() -> None: + view = LazyArray.from_numpy(np.arange(8)).with_reader(_ReadMustNotRun()).with_parts((4,)) + first, second = tuple(view.parts()) + overlapping = replace(second, out_selection=(slice(2, 6),)) + + with pytest.raises(ValueError, match="prepared parts do not tile the view exactly"): + view.result(parts=(first, overlapping)) + + +def test_result_rejects_wrong_rank_prepared_parts() -> None: + view = LazyArray.from_numpy(np.arange(8)).with_reader(_ReadMustNotRun()).with_parts((4,)) + first, second = tuple(view.parts()) + wrong_rank = replace(first, out_selection=()) + + with pytest.raises(ValueError, match="prepared parts do not tile the view exactly"): + view.result(parts=(wrong_rank, second)) + + +def test_result_rejects_empty_prepared_parts_for_a_nonempty_view() -> None: + view = LazyArray.from_numpy(np.arange(8)).with_reader(_ReadMustNotRun()).with_parts((4,)) + + with pytest.raises(ValueError, match="prepared parts do not tile the view exactly"): + view.result(parts=()) + + +def test_result_accepts_empty_prepared_parts_for_an_empty_view() -> None: + view = ( + LazyArray.from_numpy(np.arange(8)).with_reader(_ReadMustNotRun()).with_parts((4,)).lazy[0:0] + ) + + np.testing.assert_array_equal(view.result(parts=()), np.array([], dtype=np.int64)) + + +@pytest.mark.parametrize("flavor", FLAVORS) +@pytest.mark.parametrize( + "build", + [ + lambda a: a, + lambda a: a.lazy[1:6, :, 1:], + lambda a: a.lazy.oindex[[4, 0, 0], :, [3, 1]], + lambda a: a.lazy.vindex[..., np.array([1, 4, 0]), np.array([2, 0, 1])], + # A reversing view drives the negative-stride branches of + # `_intersect_dimension_map` and chunk projection, which were + # written defensively long before anything could reach them. + lambda a: a.lazy[::-1, ::-2, :], + lambda a: a.lazy[5:1:-1, :, ::-1], + ], + ids=["identity", "basic", "oindex", "vindex", "reversed", "reversed-bounded"], +) +def test_parts_tile_the_view_exactly_and_disjointly( + flavor: str, build: Callable[[LazyArray], LazyArray] +) -> None: + """Assembling the parts reproduces `result()`; the placements cover with no overlap.""" + view = build(make_source(flavor)) + expected = np.asarray(view.result()) + + assembled = np.zeros(view.shape, dtype=view.dtype) + hits = np.zeros(view.shape, dtype=np.int64) + for part in view.parts(): + assembled[part.out_selection] = np.asarray(part.view.result()) + # `np.add.at` accumulates per element; `+= 1` on a fancy index would + # count a repeated position once and hide a real overlap. + np.add.at(hits, part.out_selection, 1) + + np.testing.assert_array_equal(assembled, expected) + np.testing.assert_array_equal(hits, np.ones(view.shape, dtype=np.int64)) + + +def _transform_point(transform: IndexTransform, point: tuple[int, ...]) -> tuple[int, ...]: + """Evaluate a transform pointwise for projection placement assertions.""" + result: list[int] = [] + for output_map in transform.output: + if isinstance(output_map, ConstantMap): + result.append(output_map.offset) + elif isinstance(output_map, DimensionMap): + result.append(output_map.offset + output_map.stride * point[output_map.input_dimension]) + else: + index = tuple( + 0 + if output_map.index_array.shape[axis] == 1 + else point[axis] - transform.domain.inclusive_min[axis] + for axis in range(output_map.index_array.ndim) + ) + result.append( + output_map.offset + output_map.stride * int(output_map.index_array[index]) + ) + return tuple(result) + + +@pytest.mark.parametrize( + "build", + [ + lambda array: array.lazy.oindex[[6, 0, 2], :, [3, 1]], + lambda array: array.lazy.vindex[..., np.array([4, 0, 4]), np.array([3, 1, 1])], + ], + ids=["orthogonal", "vectorized"], +) +def test_partition_exposes_projection_as_its_placement_authority( + build: Callable[[LazyArray], LazyArray], +) -> None: + """A part's NumPy placement addresses exactly its cell-transform range.""" + view = build(LazyArray(reference()).with_parts(PART_SHAPE)) + assembled = np.zeros(view.shape, dtype=view.dtype) + + for part in view.parts(): + projection = part.projection + assert isinstance(projection, ChunkProjection) + assert part.view.transform == projection.chunk_transform.translate( + tuple(lo for lo, _ in part.box) + ) + assert part.base_coords == projection.chunk_coords + assert part.box == tuple( + zip( + projection.chunk_domain.inclusive_min, + projection.chunk_domain.exclusive_max, + strict=True, + ) + ) + + expected_hits = np.zeros(view.shape, dtype=np.int8) + cell_domain = projection.cell_transform.domain + for positional_point in np.ndindex(*cell_domain.shape): + cell_point = tuple( + coordinate + origin + for coordinate, origin in zip( + positional_point, cell_domain.inclusive_min, strict=True + ) + ) + expected_hits[_transform_point(projection.cell_transform, cell_point)] = 1 + actual_hits = np.zeros(view.shape, dtype=np.int8) + actual_hits[part.out_selection] = 1 + np.testing.assert_array_equal(actual_hits, expected_hits) + + assembled[part.out_selection] = np.asarray(part.view.result()) + + np.testing.assert_array_equal(assembled, np.asarray(view.result())) + + +def test_nonfirst_partition_transform_directly_addresses_its_array() -> None: + source = np.arange(8) + part = list(LazyArray.from_numpy(source).with_parts((4,)).parts())[1] + + assert part.box == ((4, 8),) + assert part.view.transform.apply((0,)) == (4,) + assert part.view.array[part.view.transform.apply((0,))] == 4 + assert part.view.result()[0] == 4 + assert part.projection.chunk_transform.apply((0,)) == (0,) + + +def test_partition_token_encodes_its_public_global_transform() -> None: + source = np.arange(8) + base = LazyArray.from_numpy(source) + partition_view = list(base.with_parts((4,)).parts())[1].view + direct_view = base.lazy[4:8] + + assert partition_view.__dask_tokenize__() == direct_view.__dask_tokenize__() + + +def test_parts_resolve_independently_and_concurrently() -> None: + """Each part's `array` is a standalone `LazyArray` with no shared mutable state.""" + view = make_source("zarr").lazy[1:7, :, 1:].with_parts((2, 2, 2)) + parts = list(view.parts()) + assert len(parts) > 1 + + with ThreadPoolExecutor(max_workers=4) as pool: + values = list(pool.map(lambda part: np.asarray(part.view.result()), parts)) + + assembled = np.zeros(view.shape, dtype=view.dtype) + for part, value in zip(parts, values, strict=True): + assembled[part.out_selection] = value + np.testing.assert_array_equal(assembled, np.asarray(view.result())) + + +def test_parts_report_completeness() -> None: + """`is_complete` distinguishes a fully-covered box from a partial one.""" + array = make_source("numpy-uniform-parts") + assert all(part.is_complete for part in array.parts()) + # Boxes along axis 2 are [0, 3) and [3, 4); dropping column 0 leaves the + # first partially covered and the second whole. + trimmed = {part.base_coords[2]: part.is_complete for part in array.lazy[:, :, 1:].parts()} + assert trimmed == {0: False, 1: True} + # A fancy axis is always reported incomplete. + assert not any(part.is_complete for part in array.lazy.oindex[[4, 0, 0], :, :].parts()) + + +def test_partition_boxes_are_global_and_tile_the_base() -> None: + """Both the selected hull and the whole partition box use global coordinates.""" + view = make_source("numpy-uniform-parts").lazy[1:6, :, 1:] + parts = {part.base_coords: part for part in view.parts()} + + # The reviewer's repro: two parts of the same view now expose distinct + # source-global selected hulls as well as distinct whole partition boxes. + first, second = parts[0, 0, 0], parts[0, 1, 0] + assert first.view.bounding_box() == ((1, 3), (0, 2), (1, 3)) + assert second.view.bounding_box() == ((1, 3), (2, 4), (1, 3)) + assert first.box != second.box + assert first.box == ((0, 3), (0, 2), (0, 3)) + assert second.box == ((0, 3), (2, 4), (0, 3)) + + # Every box is the base partitioning's own box for those coordinates, and + # the touched boxes tile the region the view reads without overlapping. + grids = dimension_grids_from_chunks(PART_SHAPE, SHAPE) + for coords, part in parts.items(): + expected = tuple( + (grid.chunk_offset(c), grid.chunk_offset(c) + grid.data_size(c)) + for grid, c in zip(grids, coords, strict=True) + ) + assert part.box == expected + covered = np.zeros(SHAPE, dtype=np.int64) + for part in parts.values(): + covered[tuple(slice(lo, hi) for lo, hi in part.box)] += 1 + assert covered.max() == 1 + # The view reads rows 1..5 and columns 1.., so every box it touches + # intersects that region and no box outside it is visited. + assert covered[1:6, :, 1:].sum() > 0 + assert covered[6:, :, :].sum() == 0 + + +def test_partition_box_of_a_whole_array_part() -> None: + part = next(iter(make_source("numpy-whole").parts())) + assert part.box == tuple((0, extent) for extent in SHAPE) + + +def test_an_unpartitioned_wrapper_has_a_single_whole_array_part() -> None: + view = make_source("numpy-whole") + parts = list(view.parts()) + assert len(parts) == 1 + assert parts[0].base_coords == (0, 0, 0) + assert parts[0].view.shape == SHAPE + assert parts[0].is_complete + np.testing.assert_array_equal(np.asarray(parts[0].view.result()), reference()) + + +def test_with_parts_keeps_the_view_and_the_base() -> None: + view = make_source("zarr").lazy[1:6, ::2] + repartitioned = view.with_parts((2, 1, 4)) + assert repartitioned.shape == view.shape + assert repartitioned.array is view.array + assert repartitioned.transform == view.transform + # A different partitioning really is a different set of boxes. + assert [part.base_coords for part in repartitioned.parts()] != [ + part.base_coords for part in view.parts() + ] + np.testing.assert_array_equal(np.asarray(repartitioned.result()), np.asarray(view.result())) + + +def test_with_parts_none_forces_one_shot_resolution() -> None: + view = make_source("zarr").lazy.oindex[[4, 0, 0], :, :] + whole = view.unpartitioned() + assert len(list(whole.parts())) == 1 + np.testing.assert_array_equal(np.asarray(whole.result()), np.asarray(view.result())) + + +@pytest.mark.parametrize( + ("parts", "match"), + [ + ((3,), "one entry per dimension"), + ((3, (2, 2), 4), "not a mixture"), + (((3, 3), (2, 2, 1), (3, 1)), "sum to 6, but the array extent is 7"), + ((3, 0, 3), "chunk shape entries must be positive"), + # A float or a None belongs to neither convention; saying "not a + # mixture" would send the reader looking for the wrong mistake. + ((3.5, 2, 2), r"3\.5 at dimension 0 is neither"), + ((None, 5, 4), "None at dimension 0 is neither"), + ((3.5, 2.5, 2.5), r"3\.5 at dimension 0, 2\.5 at dimension 1, .* are neither"), + (((1.5, 5.5), (5,), (4,)), "per-axis chunk sizes must be integers; dimension 0"), + ], +) +def test_with_parts_validates_strictly(parts: Any, match: str) -> None: + """`with_parts` is our own API, so a malformed partitioning raises.""" + with pytest.raises(ValueError, match=match): + repartition(make_source("numpy-whole"), parts) + + +# --------------------------------------------------------------------------- +# Protocols +# --------------------------------------------------------------------------- + + +def test_dask_token_is_deterministic_and_discriminating() -> None: + """Same data and same view token alike; a different selection differs.""" + data = reference() + base = LazyArray(data) + assert base.__dask_tokenize__() == LazyArray(reference()).__dask_tokenize__() + + tokens = { + "base": base.__dask_tokenize__(), + "view": base.lazy[1:3].__dask_tokenize__(), + "other view": base.lazy[2:4].__dask_tokenize__(), + "other data": LazyArray(data + 1).__dask_tokenize__(), + } + assert len({repr(token) for token in tokens.values()}) == len(tokens) + # Equivalent transforms reached different ways still token alike. + assert base.lazy[1:5].lazy[0:2].__dask_tokenize__() == base.lazy[1:3].__dask_tokenize__() + + +def test_reader_and_partitioning_do_not_change_dask_identity() -> None: + base = LazyArray(reference()) + token = base.__dask_tokenize__() + assert base.with_reader(numpy_reader).__dask_tokenize__() == token + assert base.with_reader(basic_reader).__dask_tokenize__() == token + assert base.with_parts((2, 2, 2)).__dask_tokenize__() == token + + +@pytest.mark.parametrize("reader", [basic_reader, numpy_reader, DelegatingReader(numpy_reader)]) +def test_reader_survives_pickle(reader: Reader) -> None: + view = LazyArray(reference()).with_reader(reader).lazy[1:5, ::2] + restored = pickle.loads(pickle.dumps(view)) + assert type(restored.reader) is type(reader) + np.testing.assert_array_equal(restored.result(), view.result()) + + +def test_iteration_yields_eager_slices(source: LazyArray) -> None: + rows = list(source.lazy[2:5]) + assert len(rows) == 3 + for row, expected in zip(rows, reference()[2:5], strict=True): + np.testing.assert_array_equal(np.asarray(row), expected) + + +def test_iteration_over_a_zero_dimensional_view_is_rejected() -> None: + with pytest.raises(TypeError, match="iteration over a 0-d array"): + iter(make_source("numpy-uniform-parts").lazy[0, 0, 0]) + + +def test_len_of_a_zero_dimensional_view_is_rejected() -> None: + with pytest.raises(TypeError, match="len\\(\\) of unsized object"): + len(make_source("numpy-uniform-parts").lazy[0, 0, 0]) + + +@pytest.mark.parametrize( + ("convert", "selection"), + [ + (bool, (1, 1, 1)), + (int, (1, 1, 1)), + (float, (1, 1, 1)), + (operator.index, (1, 1, 1)), + (bool, (1, 1, slice(0, 1))), + ], + ids=["bool-0d", "int-0d", "float-0d", "index-0d", "bool-size-1"], +) +def test_scalar_conversions_match_numpy(convert: Any, selection: Any) -> None: + """Size-1 conversions delegate to NumPy, values and all.""" + data = reference() + view = make_source("numpy-uniform-parts").lazy[selection] + assert convert(view) == convert(data[selection]) + + +@pytest.mark.parametrize( + ("convert", "selection", "error"), + [ + (bool, (slice(0, 2), 0, 0), ValueError), + (bool, (slice(0, 0), 0, 0), ValueError), + (int, (slice(0, 1), 0, 0), TypeError), + (float, (slice(0, 2), 0, 0), TypeError), + (operator.index, (slice(0, 1), 0, 0), TypeError), + ], + ids=["bool-many", "bool-empty", "int-1d", "float-many", "index-1d"], +) +def test_scalar_conversions_raise_what_numpy_raises( + convert: Any, selection: Any, error: type[Exception] +) -> None: + data = reference() + view = make_source("numpy-uniform-parts").lazy[selection] + with pytest.raises(error): + convert(view) + with pytest.raises(error): + convert(data[selection]) + + +def test_pickle_round_trip() -> None: + """A wrapper over a picklable base survives a round trip, view and parts intact.""" + view = LazyArray(reference()).with_parts((2, 2, 2)).lazy[1:6, ::2].lazy.oindex[[3, 0, 0], :, :] + restored = pickle.loads(pickle.dumps(view)) + assert restored.shape == view.shape + assert restored.__dask_tokenize__() == view.__dask_tokenize__() + np.testing.assert_array_equal(np.asarray(restored.result()), np.asarray(view.result())) + + +# --------------------------------------------------------------------------- +# dask interop +# --------------------------------------------------------------------------- + + +def test_dask_from_array_roundtrip() -> None: + """A `LazyArray` is a drop-in dask source — no translation ceremony.""" + da = pytest.importorskip("dask.array") + source = make_source("zarr") + + lazy = da.from_array(source) + np.testing.assert_array_equal(lazy.compute(), reference()) + + # dask chooses its own blocks; the wrapper reads each of them through its + # own parts, so the two partitionings need not agree. + blocked = da.from_array(source, chunks=(4, 3, 3)) + assert blocked.chunks == ((4, 3), (3, 2), (3, 1)) + np.testing.assert_array_equal(blocked[2:, ::2].compute(), reference()[2:, ::2]) + + +# --------------------------------------------------------------------------- +# Errors +# --------------------------------------------------------------------------- + + +def test_boolean_scalar_is_rejected() -> None: + with pytest.raises(IndexError, match="boolean scalars are not valid indices"): + make_source("numpy-uniform-parts").lazy[True] + + +@pytest.mark.parametrize( + ("mode", "selection", "expected"), + [ + pytest.param("basic", IndexLike(2), np.array(2), id="basic-scalar"), + pytest.param( + "basic", + slice(IndexLike(1), IndexLike(7), IndexLike(2)), + np.array([1, 3, 5]), + id="basic-slice-components", + ), + pytest.param("orthogonal", IndexLike(2), np.array(2), id="orthogonal-scalar"), + pytest.param("vectorized", IndexLike(2), np.array(2), id="vectorized-scalar"), + ], +) +def test_positional_selectors_support_the_index_protocol( + mode: str, selection: Any, expected: np.ndarray[Any, Any] +) -> None: + source = LazyArray.from_numpy(np.arange(8)) + if mode == "basic": + view = source.lazy[selection] + else: + view = getattr(source.lazy, "oindex" if mode == "orthogonal" else "vindex")[selection] + + result = np.asarray(view.result()) + assert result.shape == expected.shape + np.testing.assert_array_equal(result, expected) + + +def test_positional_selector_rejects_int_only_objects() -> None: + with pytest.raises(IndexError, match="unsupported selection type"): + LazyArray.from_numpy(np.arange(8)).lazy[IntOnly()] + + +def test_positional_selector_propagates_malformed_index_protocol() -> None: + with pytest.raises(TypeError, match="__index__ returned non-int"): + LazyArray.from_numpy(np.arange(8)).lazy[BadIndex()] + + +def test_positional_slice_propagates_malformed_index_protocol() -> None: + with pytest.raises(TypeError, match="__index__ returned non-int"): + LazyArray.from_numpy(np.arange(8)).lazy[:: BadIndex()] + + +def test_protocol_objects_inside_an_index_array_remain_invalid() -> None: + selection = np.array([IndexLike(2)], dtype=object) + with pytest.raises(IndexError, match="integer or boolean"): + LazyArray.from_numpy(np.arange(8)).lazy.oindex[selection] + + +def test_mask_shape_must_match_the_view() -> None: + array = make_source("numpy-uniform-parts") + with pytest.raises(IndexError, match="boolean index has shape"): + array.lazy.vindex[np.ones((2, 2, 2), dtype=bool)] + + +def test_scalar_index_out_of_bounds() -> None: + with pytest.raises(IndexError, match="index 7 is out of bounds for axis 0 with size 7"): + make_source("numpy-uniform-parts").lazy[7] + + +def test_scalar_index_out_of_bounds_in_a_view() -> None: + """Bounds are the *view's*, not the wrapped array's.""" + array = make_source("numpy-uniform-parts").lazy[1:4] + with pytest.raises(IndexError, match="index 3 is out of bounds for axis 0 with size 3"): + array.lazy[3] + + +def test_index_array_out_of_bounds() -> None: + array = make_source("numpy-uniform-parts") + with pytest.raises(IndexError, match="index 99 is out of bounds for axis 0 with size 7"): + array.lazy.oindex[[0, 99], :, :] + + +def test_too_many_indices() -> None: + with pytest.raises(IndexError, match="too many indices"): + make_source("numpy-uniform-parts").lazy[0, 0, 0, 0] + + +def test_copy_false_conversion_is_rejected() -> None: + array = make_source("numpy-uniform-parts") + with pytest.raises(ValueError, match="cannot be converted to a NumPy array without a copy"): + np.array(array, copy=False) + + +# --------------------------------------------------------------------------- +# Negative steps +# --------------------------------------------------------------------------- + + +def test_reversed_box_reports_a_positive_stride(source: LazyArray) -> None: + """A reversal is still a box; `strides()` is magnitudes, so it matches the forward twin.""" + reversed_view = source.lazy[::-2] + forward = source.lazy[::2] + assert reversed_view.is_box + assert reversed_view.strides() == forward.strides() == (2, 1, 1) + assert reversed_view.bounding_box() == ((0, 7), (0, 5), (0, 4)) + + +def test_a_reversed_view_is_re_based_to_origin_zero() -> None: + """The literal domain of a reversal is negative; the positional dialect hides it.""" + view = make_source("numpy-whole").lazy[::-1] + # The algebra's own answer keeps the source frame. + assert IndexTransform.from_shape(SHAPE)[::-1].domain.inclusive_min[0] == -6 + # The wrapper re-bases, so positions start at 0 as NumPy expects. + assert view.transform.domain.inclusive_min == (0, 0, 0) + assert view.shape == SHAPE + np.testing.assert_array_equal(np.asarray(view.result()), reference()[::-1]) + + +def test_zero_step_is_rejected() -> None: + with pytest.raises(ValueError, match="step cannot be zero"): + make_source("numpy-whole").lazy[::0] + + +def test_reversed_positional_interval_is_empty_not_an_error() -> None: + """NumPy's rule at the boundary; the literal layer keeps TensorStore's.""" + view = make_source("numpy-uniform-parts").lazy[2:5:-1] + assert view.shape == (0, 5, 4) + np.testing.assert_array_equal(np.asarray(view.result()), reference()[2:5:-1]) + # Literal coordinates, on the other hand, call it a direction error. + with pytest.raises(IndexError, match="valid interval"): + IndexTransform.from_shape(SHAPE)[2:5:-1] + + +def test_negative_step_over_a_fancy_axis_reverses_the_coordinates(source: LazyArray) -> None: + """Reversing a gathered axis materializes, rather than attaching a stride.""" + view = source.lazy.oindex[[3, 1, 2], :, :].lazy[::-1] + expected = outer(reference(), ([3, 1, 2], slice(None), slice(None)))[::-1] + np.testing.assert_array_equal(np.asarray(view.result()), expected) + m = view.transform.output[0] + assert isinstance(m, ArrayMap) + np.testing.assert_array_equal(m.index_array.reshape(-1), np.array([2, 1, 3])) + + +# --------------------------------------------------------------------------- +# Minimal sources +# --------------------------------------------------------------------------- + + +class MinimalSource: + """The floor of the wrapped-array protocol: `shape`, `dtype`, `__getitem__`.""" + + def __init__(self, data: np.ndarray[Any, Any]) -> None: + self._data = data + + @property + def shape(self) -> tuple[int, ...]: + return self._data.shape + + @property + def dtype(self) -> Any: + return self._data.dtype + + def __getitem__(self, key: Any) -> Any: + return self._data[key] + + +class RecordingSource(MinimalSource): + """A minimal source that records every attempted data read.""" + + def __init__(self, data: np.ndarray[Any, Any]) -> None: + super().__init__(data) + self.reads: list[Any] = [] + + def __getitem__(self, key: Any) -> Any: + self.reads.append(key) + return super().__getitem__(key) + + +@pytest.mark.parametrize( + "build", + [ + lambda a: a.lazy[:, 2:2, :], + lambda a: a.lazy.vindex[np.array([[6], [3], [0]]), -4].lazy[0, 0:0], + ], + ids=["ordinary", "unreferenced-axis"], +) +def test_an_empty_view_does_not_read_its_source( + build: Callable[[LazyArray], LazyArray], +) -> None: + source = RecordingSource(reference()) + result = build(LazyArray(source)).result() + + assert result.size == 0 + assert source.reads == [] + + +# --------------------------------------------------------------------------- +# Materializing +# --------------------------------------------------------------------------- + + +class NumpyBackedSource: + """A duck array that stores its data in NumPy and returns views from reads. + + Not an `np.ndarray`, so nothing about the source can be compared against the + result's memory — but its blocks are NumPy views of storage the caller must + not be handed. The `BASIC` source this package invites people to wrap. + """ + + def __init__(self, data: np.ndarray[Any, Any]) -> None: + self.data = data + + @property + def shape(self) -> tuple[int, ...]: + return self.data.shape + + @property + def dtype(self) -> Any: + return self.data.dtype + + def __getitem__(self, selection: Any) -> Any: + return self.data[selection] + + +@pytest.mark.parametrize("parts", [None, (2, 2, 2), SHAPE]) +@pytest.mark.parametrize("wrap", [lambda d: d, NumpyBackedSource], ids=["ndarray", "duck"]) +@pytest.mark.parametrize( + ("build", "description"), + [ + (lambda a: a.lazy[1:3, :, :], "a basic slice"), + (lambda a: a.lazy[:, :, :], "the whole array"), + (lambda a: a.lazy[::-1, :, :], "a reversal"), + (lambda a: a.lazy.oindex[[2, 0], :, :], "a gather"), + ], +) +def test_materializing_never_hands_back_the_wrapped_array( + parts: Any, + wrap: Callable[[np.ndarray[Any, Any]], Any], + build: Callable[[LazyArray], LazyArray], + description: str, +) -> None: + """Writing to a materialized result must never reach the source. + + An unpartitioned read of a basic selection can be answered with a *view* of + the wrapped array, and NumPy 2 hands whatever `__array__` returns straight to + the caller. Every route out of the wrapper detaches, so the answer does not + depend on how the read happened to be divided. + + Run over both a raw `ndarray` and a duck array that merely stores its data in + NumPy: the second is the case where the source cannot be compared against the + result, so detaching has to decide from the result's own buffer instead. + """ + data = reference() + view = build(repartition(LazyArray(wrap(data)), parts)) + + for materialize in ( + lambda v: v.result(), + lambda v: np.array(v, copy=True), + lambda v: np.asarray(v), + lambda v: np.array(v), + ): + before = data.copy() + materialized = np.asarray(materialize(view)) + assert not np.shares_memory(materialized, data), description + materialized[...] = -1 + np.testing.assert_array_equal(data, before, err_msg=description) + + +def test_an_eager_getitem_never_hands_back_the_wrapped_array() -> None: + data = reference() + block = LazyArray(data)[1:3] + block[...] = -1 + np.testing.assert_array_equal(data, reference()) + + +def test_result_refuses_to_return_a_partly_written_buffer( + monkeypatch: pytest.MonkeyPatch, +) -> None: + """A partition walk that leaves a gap must raise, not return process memory. + + `result()` scatters into an uninitialized buffer, which is only safe because + the parts tile the view. This is the guard that turns any future break of + that contract into a failure instead of into plausible-looking numbers. + """ + view = LazyArray(reference()).with_parts(PART_SHAPE).lazy[:, 1:, :] + complete = LazyArray.parts + + def drop_one(self: LazyArray) -> Any: + return list(complete(self))[:-1] + + monkeypatch.setattr(LazyArray, "parts", drop_one) + with pytest.raises(AssertionError, match="partition walk addressed"): + view.result() + + +def test_result_refuses_a_partition_of_the_wrong_rank(monkeypatch: pytest.MonkeyPatch) -> None: + """A part addressing fewer axes than the view has is caught by name.""" + view = LazyArray(reference()).with_parts(PART_SHAPE).lazy[:, 1:, :] + complete = LazyArray.parts + + def truncate(self: LazyArray) -> Any: + return [replace(part, out_selection=part.out_selection[:-1]) for part in complete(self)] + + monkeypatch.setattr(LazyArray, "parts", truncate) + with pytest.raises(AssertionError, match="of the view's 3 dimensions"): + view.result() + + +class DuckBlock: + """An array-like meeting exactly the documented `BASIC` floor and no more. + + `shape`, `dtype`, and a `__getitem__` that understands integers and slices. + Anything else — an integer array, `take`, `reshape` — raises, and indexing it + yields another one of itself, so a block that comes back from it is as + limited as the source was. + """ + + def __init__(self, data: np.ndarray[Any, Any]) -> None: + self._data = data + + @property + def shape(self) -> tuple[int, ...]: + return self._data.shape + + @property + def dtype(self) -> Any: + return self._data.dtype + + def __array__(self, dtype: Any = None, copy: bool | None = None) -> Any: + return np.array(self._data, dtype=dtype, copy=True if copy is None else copy) + + def __getitem__(self, key: Any) -> DuckBlock: + selectors = key if isinstance(key, tuple) else (key,) + for selector in selectors: + if not isinstance(selector, (int, np.integer, slice)): + raise TypeError(f"basic indexing only, got {selector!r}") + return DuckBlock(self._data[key]) + + +@pytest.mark.parametrize( + ("build", "oracle"), + [ + (lambda a: a.lazy[1:5, ::2, :], lambda r: r[1:5, ::2, :]), + ( + lambda a: a.lazy.oindex[[4, 0, 0], :, :], + lambda r: r[np.ix_([4, 0, 0], range(5), range(4))], + ), + (lambda a: a.lazy.vindex[[4, 0], [1, 1]], lambda r: r[[4, 0], [1, 1]]), + (lambda a: a.lazy[::-1, :, :], lambda r: r[::-1, :, :]), + ], + ids=["basic", "oindex", "vindex", "reversal"], +) +@pytest.mark.parametrize("parts", [None, PART_SHAPE]) +def test_a_source_meeting_only_the_basic_floor_resolves_any_selection( + build: Callable[[LazyArray], LazyArray], oracle: Callable[[Any], Any], parts: Any +) -> None: + """The floor is a promise about the source; its blocks are coerced, not trusted.""" + expected = np.asarray(oracle(reference())) + view = build(repartition(LazyArray(DuckBlock(reference())), parts)) + assert view.shape == expected.shape + np.testing.assert_array_equal(np.asarray(view.result()), expected) + + +def test_the_duck_block_double_refuses_a_fancy_key() -> None: + """A negative control: the floor test only means something if the double bites.""" + with pytest.raises(TypeError, match="basic indexing only"): + DuckBlock(reference())[np.array([1, 0])] + + +# --------------------------------------------------------------------------- +# Sources with their own opinions +# --------------------------------------------------------------------------- + + +@pytest.mark.filterwarnings("ignore::PendingDeprecationWarning") +def test_numpy_matrix_is_refused() -> None: + """`np.matrix` never reduces rank, so a view's shape could not be honored.""" + with pytest.raises(TypeError, match="numpy.matrix cannot be wrapped"): + LazyArray(np.matrix(np.arange(12).reshape(3, 4))) + + +@pytest.mark.parametrize("parts", [None, (2, 2), (1, 4), (3, 4)]) +def test_a_masked_source_keeps_its_mask_under_every_partitioning(parts: Any) -> None: + data = np.ma.masked_greater(np.arange(12).reshape(3, 4), 7) + got = repartition(LazyArray(data), parts).lazy[:, 1:].result() + expected = data[:, 1:] + assert isinstance(got, np.ma.MaskedArray), parts + np.testing.assert_array_equal(np.ma.getmaskarray(got), np.ma.getmaskarray(expected)) + np.testing.assert_array_equal(np.ma.filled(got, 0), np.ma.filled(expected, 0)) + + +@pytest.mark.parametrize("parts", [None, (2, 2), (3, 4)]) +def test_a_masked_source_keeps_its_mask_when_the_view_is_empty(parts: Any) -> None: + """An empty result is still a result, and its type must not depend on the parts. + + An empty view is answered without reading the source at all, and that + shortcut reached for the array namespace's own `empty` — which knows nothing + about masks — so an unpartitioned empty view came back a plain array while + the same view partitioned came back masked. No cells either way, so nothing + about the values changed; the caller just got a different type depending on + how the read had been divided. + """ + data = np.ma.masked_greater(np.arange(12).reshape(3, 4), 7) + got = repartition(LazyArray(data), parts).lazy[:, 2:2].result() + assert isinstance(got, np.ma.MaskedArray), parts + assert np.asarray(got).shape == (3, 0), parts + + +def test_a_large_array_without_dask_refuses_to_claim_equality( + monkeypatch: pytest.MonkeyPatch, +) -> None: + """Above the digest limit the fallback must miss a cache rather than lie. + + Two arrays differing in one element used to token identically, because the + fallback described the shape and dtype and gave up on the contents. + """ + import sys + + monkeypatch.setitem(sys.modules, "dask.base", None) + big = np.zeros(1 << 19, dtype=np.int64) + other = big.copy() + other[0] = 1 + + assert LazyArray(big).__dask_tokenize__() != LazyArray(other).__dask_tokenize__() + assert LazyArray(big).__dask_tokenize__() != LazyArray(big).__dask_tokenize__() + + # Below the limit the contents are digested, so equal data still tokens alike. + small = np.zeros(8, dtype=np.int64) + assert LazyArray(small).__dask_tokenize__() == LazyArray(small.copy()).__dask_tokenize__() + + +# --------------------------------------------------------------------------- +# Completeness and partition spellings +# --------------------------------------------------------------------------- + + +def test_a_reversing_view_covers_its_parts() -> None: + """A reversal reads every cell of every box, back to front.""" + data = np.arange(48).reshape(8, 6) + forward = LazyArray(data).with_parts((2, 2)).lazy[:, :] + reversed_view = LazyArray(data).with_parts((2, 2)).lazy[::-1, ::-1] + assert [part.is_complete for part in reversed_view.parts()] == [ + part.is_complete for part in forward.parts() + ] + assert all(part.is_complete for part in reversed_view.parts()) + + +def test_a_strided_reversal_is_still_incomplete() -> None: + data = np.arange(48).reshape(8, 6) + view = LazyArray(data).with_parts((2, 2)).lazy[::-2, :] + assert not any(part.is_complete for part in view.parts()) + + +@pytest.mark.parametrize("parts", [((0,), (3,)), ((), (3,)), (1, 1), ((0, 0), (3,))]) +def test_a_zero_length_axis_accepts_every_spelling_of_no_chunks(parts: Any) -> None: + """`(0,)`, `(0, 0)`, `()` and a uniform shape all describe an axis with no cells.""" + data = np.zeros((0, 3)) + view = repartition(LazyArray(data), parts) + assert view.result().shape == (0, 3) + assert list(view.parts()) == [] + + +def test_a_zero_chunk_on_a_nonempty_axis_is_still_rejected() -> None: + with pytest.raises(ValueError, match="chunk sizes must be positive"): + LazyArray(np.zeros((4, 3))).with_parts_per_axis(((0, 4), (3,))) + + +@pytest.mark.parametrize( + "selection", + [ + (slice(None, None, -1), slice(None), slice(None)), + (slice(3, 1, -1), slice(None), slice(None)), + (slice(None, None, -2), slice(None, None, -1), slice(None)), + ], + ids=["reversed", "reversed-partial", "reversed-strided"], +) +def test_the_coverage_count_agrees_with_numpy_for_reversed_selections( + selection: tuple[Any, ...], +) -> None: + """The safety net behind `result()`'s coverage assertion, checked on its own. + + `_out_selection_cell_count` sizes a partition's `out_selection` without + materializing it, and `result()` trusts that count to decide whether the + walk covered the view. Nothing pinned it for a reversed slice, so dropping + its `start <= stop` guard — or wrapping the subtraction in `abs()` — left + the suite green. A net nobody tests only matters once something else breaks, + which is exactly when it needs to be right. + """ + data = reference() + view = LazyArray(data).with_parts((2, 2, 2)).lazy[selection] + out_shape = view.shape + for part in view.parts(): + counted = _out_selection_cell_count(part.out_selection, out_shape) + assert counted == np.empty(out_shape)[part.out_selection].size + + +@pytest.mark.parametrize( + ("selection", "out_shape", "expected"), + [ + (((slice(2, 5)),), (10,), 3), + # A backwards interval selects nothing. The fast path subtracts, which + # would make this negative and let an incomplete walk sum to the view's + # own size — so the count falls back to `range` whenever the interval is + # not a forward, in-bounds one. + (((slice(5, 2)),), (10,), 0), + # Counts from the end, to index 8 — past the stop, so nothing. + (((slice(-2, 5)),), (10,), 0), + ((slice(5, 2), slice(0, 3)), (10, 10), 0), + ], + ids=["forward", "backwards", "negative-start", "backwards-in-a-pair"], +) +def test_the_coverage_count_matches_numpy_for_intervals_the_fast_path_declines( + selection: tuple[Any, ...], out_shape: tuple[int, ...], expected: int +) -> None: + """The guard on `result()`'s safety net, exercised where the walk cannot reach it. + + A partition walk only ever produces concrete forward in-bounds intervals, so + the guard that keeps everything else off the subtraction fast path is not + reachable through `parts()` at all — which is why removing it left the whole + suite green. It is the net's own contract, so it is checked directly. + """ + counted = _out_selection_cell_count(selection, out_shape) + assert counted == np.empty(out_shape)[selection].size + assert counted == expected + + +def test_a_zero_dimensional_index_array_drops_its_axis_like_a_scalar() -> None: + """`a[np.array(2), :]` is `a[2, :]` in NumPy, and now here too. + + Only Python and NumPy integers counted as scalars, so a 0-d array fell + through to the fancy path and was widened into a length-1 index array — + keeping an axis NumPy drops. That was a third answer, agreeing with neither + NumPy nor eager zarr, which rejects it. + """ + data = np.arange(20).reshape(4, 5) + for mode, expected in ( + ("oindex", data[np.array(2), :]), + ("vindex", data[np.array(2), np.array(3)]), + ): + view = ( + LazyArray(data).lazy.oindex[np.array(2), slice(None)] + if mode == "oindex" + else LazyArray(data).lazy.vindex[np.array(2), np.array(3)] + ) + assert view.shape == expected.shape, mode + np.testing.assert_array_equal(np.asarray(view.result()), expected, err_msg=mode) + + +def test_a_multidimensional_array_in_an_orthogonal_selection_is_refused() -> None: + """The rule belongs to the selection, so the message speaks its vocabulary. + + Left to the engine, this surfaced as a rank complaint about an `index_array` + the caller never wrote — the transform layer's words for a mistake made two + layers above it. + """ + with pytest.raises(IndexError, match="must be 1-dimensional"): + LazyArray(np.arange(20).reshape(4, 5)).lazy.oindex[[[0, 1], [2, 3]], slice(None)] + + +def test_with_parts_rejects_a_bare_integer() -> None: + """Both partitioning methods document ValueError for malformed input.""" + view = LazyArray.from_numpy(np.arange(12).reshape(3, 4)) + with pytest.raises(ValueError, match="one entry per dimension"): + view.with_parts(3) # type: ignore[arg-type] + with pytest.raises(ValueError, match="one entry per dimension"): + view.with_parts_per_axis(3) # type: ignore[arg-type] + + +def test_fancy_composition_over_an_empty_axis() -> None: + """Regression: composing fancy steps over an empty axis stays unpinned. + + The empty-domain branch of `compose` produces index arrays that are + singleton on every non-empty axis; pinning one to an axis it merely + broadcasts along made a later basic step index a size-1 axis positionally + and raise, deep inside a legal chain. + """ + base = np.empty((3, 0, 6), dtype=np.int64) + view = LazyArray(base).lazy.oindex[[2, 1], :, [5, 0, 3]] + assert view.shape == (2, 0, 3) + composed = view.lazy.oindex[[1, 0], :, [2, 2]] + assert composed.shape == (2, 0, 2) + scalar = composed.lazy.vindex[..., np.array(1)] + assert scalar.shape == (2, 0) + assert np.asarray(scalar.result()).shape == (2, 0) diff --git a/packages/zarr-indexing/tests/test_lazy_array_stateful.py b/packages/zarr-indexing/tests/test_lazy_array_stateful.py new file mode 100644 index 0000000000..4f5dadc1e4 --- /dev/null +++ b/packages/zarr-indexing/tests/test_lazy_array_stateful.py @@ -0,0 +1,114 @@ +"""This package's own use of the state machine it exports. + +`ChainedIndexingStateMachine` composes indexing steps onto a `LazyArray` and +checks each step against NumPy — see +`zarr_indexing.testing.stateful` for what the invariants assert and why. + +Two sources: a NumPy array, which exercises both built-in readers, and a real +zarr array, whose partitioning is discovered from the store rather than +declared. The zarr case runs a smaller budget: it reads through a store, and it +exercises the same code paths. + +This replaces a seeded `_random_chain` sweep in `test_lazy_array` that read +chained selections through `parts()`. That sweep did reach the states it was +meant to, but a rank-0 correlated view was absorbed by a reshape in `result()` +and mirrored into the sweep rather than read as a failure; asserting the +documented assembly literally makes that impossible to paper over. +`test_lazy_array` keeps its `result()`-based sweep, which is the deterministic +cross-flavor coverage this does not attempt. +""" + +from __future__ import annotations + +from typing import Any, ClassVar + +import numpy as np +import pytest +from hypothesis import settings + +from zarr_indexing import LazyArray, ReadContext +from zarr_indexing.reader import basic_reader, numpy_reader +from zarr_indexing.testing import ( + DEFAULT_SETTINGS, + ChainedIndexingStateMachine, + state_machine_test, + stateful, +) + + +class NumpyIndexing(ChainedIndexingStateMachine): + readers = (numpy_reader,) + + +TestNumpyIndexing = state_machine_test(NumpyIndexing) + + +class UnhashableReader: + __hash__ = None + + def read_into(self, source: Any, context: ReadContext, out: Any, /) -> None: + basic_reader.read_into(source, context, out) + + def __eq__(self, other: object) -> bool: + return isinstance(other, UnhashableReader) + + +def test_reader_set_deduplicates_by_identity_without_hashing() -> None: + first = UnhashableReader() + second = UnhashableReader() + + readers = stateful._reader_set(LazyArray(np.arange(3)), (first, first, second)) + + assert readers[0] is basic_reader + assert readers[1] is first + assert readers[2] is second + assert len(readers) == 3 + + +class OneDimensionalIndexing(ChainedIndexingStateMachine): + """The same chains over a rank-1 source. + + The sorted one-dimensional fancy path in `chunk_resolution` is entered only + when both the input and output ranks are 1, and the output rank is the + *source's* — so the rank-3 default walls that path off from the machine + entirely, and from every downstream project told to subclass it. That path + is where reordering and duplicate coordinates are partitioned, which is the + corruption class this whole harness exists to catch. + """ + + data = np.arange(30, dtype=np.int64) + partitionings: ClassVar[tuple[Any, ...]] = (None, (4,), (30,), ((7, 8, 15),)) + + +TestOneDimensionalIndexing = state_machine_test(OneDimensionalIndexing) + + +class SingletonAxisIndexing(ChainedIndexingStateMachine): + """A source with an extent-1 axis, which the code must not read as a broadcast one. + + An index array's axis is a singleton either because the map broadcasts over + it or because the domain is genuinely one cell wide there, and the two are + told apart by the domain rather than the array. Nothing generated the second + kind. + """ + + data = np.arange(2 * 1 * 3, dtype=np.int64).reshape(2, 1, 3) + partitionings: ClassVar[tuple[Any, ...]] = (None, (1, 1, 1), (2, 1, 2)) + + +TestSingletonAxisIndexing = state_machine_test(SingletonAxisIndexing) + + +class ZarrIndexing(ChainedIndexingStateMachine): + """The same chains against a zarr array through the universal basic reader.""" + + def make_source(self, data: Any) -> Any: + zarr = pytest.importorskip("zarr") + array = zarr.create_array({}, shape=data.shape, chunks=(3, 2, 3), dtype=data.dtype) + array[:] = data + return array + + +TestZarrIndexing = state_machine_test( + ZarrIndexing, config=settings(DEFAULT_SETTINGS, max_examples=50) +) diff --git a/packages/zarr-indexing/tests/test_messages.py b/packages/zarr-indexing/tests/test_messages.py index 14bed66448..2ebd41a263 100644 --- a/packages/zarr-indexing/tests/test_messages.py +++ b/packages/zarr-indexing/tests/test_messages.py @@ -89,3 +89,45 @@ def test_empty_string_kind_is_unknown_kind() -> None: with pytest.raises(NdselError) as excinfo: normalize_ndsel({"kind": ""}) assert excinfo.value.reason == "unknown_kind" + + +class TestNegativeStep: + """ndsel 1.0-draft.2 section 5.3: one desugaring rule, both signs.""" + + def test_full_reverse(self) -> None: + """The spec's own worked example: reversing a length-20 axis.""" + body = normalize_ndsel({"kind": "slice", "start": [19], "stop": [-1], "step": [-1]}) + assert body["input_inclusive_min"] == [-19] + assert body["input_exclusive_max"] == [1] + assert body["output"] == [{"offset": 0, "stride": -1, "input_dimension": 0}] + + def test_trunc_origin_for_a_negative_step(self) -> None: + """`trunc(15 / -2) == -7`; `floor` would give -8.""" + body = normalize_ndsel({"kind": "slice", "start": [15], "stop": [5], "step": [-2]}) + assert body["input_inclusive_min"] == [-7] + assert body["input_exclusive_max"] == [-2] + assert body["output"] == [{"offset": 1, "stride": -2, "input_dimension": 0}] + + def test_empty_is_legal_at_any_coordinate(self) -> None: + body = normalize_ndsel({"kind": "slice", "start": [5], "stop": [5], "step": [-1]}) + assert body["input_inclusive_min"] == body["input_exclusive_max"] == [-5] + + @pytest.mark.parametrize( + "message", + [ + {"kind": "slice", "start": [9], "stop": [0]}, + {"kind": "slice", "start": [9], "stop": [0], "step": [2]}, + {"kind": "slice", "start": [5], "stop": [6], "step": [-1]}, + ], + ids=["unit-step", "positive-step", "negative-step"], + ) + def test_a_reversed_interval_is_an_error(self, message: dict[str, object]) -> None: + """Not clamped to empty: travelling the wrong way is a mistake, either sign.""" + with pytest.raises(NdselError) as excinfo: + normalize_ndsel(message) + assert excinfo.value.reason == "bounds_out_of_order" + + def test_zero_step_still_errors(self) -> None: + with pytest.raises(NdselError) as excinfo: + normalize_ndsel({"kind": "slice", "start": [0], "stop": [4], "step": [0]}) + assert excinfo.value.reason == "step_zero" diff --git a/packages/zarr-indexing/tests/test_ndsel_tensorstore.py b/packages/zarr-indexing/tests/test_ndsel_tensorstore.py index 794ac5f3d5..ab9465c8d1 100644 --- a/packages/zarr-indexing/tests/test_ndsel_tensorstore.py +++ b/packages/zarr-indexing/tests/test_ndsel_tensorstore.py @@ -17,7 +17,6 @@ import numpy as np import pytest -from zarr_indexing.json import transform_from_canonical, transform_to_canonical from zarr_indexing.transform import IndexTransform ts = pytest.importorskip("tensorstore") @@ -38,7 +37,7 @@ def _canonical_transforms() -> list[IndexTransform]: @pytest.mark.parametrize("transform", _canonical_transforms()) def test_body_loads_in_tensorstore_and_round_trips(transform: IndexTransform) -> None: - body = transform_to_canonical(transform) + body = transform.to_json() # (1) The canonical body loads directly as a TensorStore IndexTransform. ts_transform = ts.IndexTransform(json=body) @@ -48,5 +47,5 @@ def test_body_loads_in_tensorstore_and_round_trips(transform: IndexTransform) -> # representational choices (index_array_bounds, default omissions) that # both sides make differently but that denote the same selection. ts_json = ts_transform.to_json() - reloaded = transform_from_canonical(ts_json) - assert transform_to_canonical(reloaded) == transform_to_canonical(transform) + reloaded = IndexTransform.from_json(ts_json) + assert reloaded.to_json() == transform.to_json() diff --git a/packages/zarr-indexing/tests/test_output_map.py b/packages/zarr-indexing/tests/test_output_map.py index 498101444e..d1e21efaa7 100644 --- a/packages/zarr-indexing/tests/test_output_map.py +++ b/packages/zarr-indexing/tests/test_output_map.py @@ -1,6 +1,9 @@ from __future__ import annotations +import pickle + import numpy as np +import pytest from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap @@ -54,3 +57,43 @@ def test_frozen(self) -> None: arr = np.array([0], dtype=np.intp) m = ArrayMap(index_array=arr) assert isinstance(m, ArrayMap) + + def test_owns_index_array_and_keeps_hash_stable(self) -> None: + arr = np.array([1, 3, 5], dtype=np.intp) + m = ArrayMap(index_array=arr) + lookup = {m: "value"} + + arr[:] = 9 + + np.testing.assert_array_equal(m.index_array, [1, 3, 5]) + assert lookup[m] == "value" + + def test_pickle_round_trip_keeps_index_array_read_only(self) -> None: + restored = pickle.loads(pickle.dumps(ArrayMap(index_array=np.array([1, 3, 5])))) + + assert not restored.index_array.flags.writeable + with pytest.raises(ValueError, match="read-only"): + restored.index_array[0] = 9 + + def test_index_array_cannot_be_made_writeable(self) -> None: + m = ArrayMap(index_array=np.array([1, 3, 5])) + + with pytest.raises(ValueError): + m.index_array.flags.writeable = True + + def test_equal_array_maps_have_equal_hashes_across_integer_dtypes(self) -> None: + left = ArrayMap(np.array([1, 2], dtype=np.int32)) + right = ArrayMap(np.array([1, 2], dtype=np.int64)) + assert left == right + assert hash(left) == hash(right) + assert left.index_array.dtype == np.dtype(np.intp) + + def test_rejects_non_integer_index_array(self) -> None: + with pytest.raises(TypeError, match="index_array must have an integer dtype"): + ArrayMap(np.array([1.5, 2.0], dtype=np.float64)) + + def test_rejects_unsigned_index_array_value_outside_intp(self) -> None: + outside_intp = np.array([np.iinfo(np.uint64).max], dtype=np.uint64) + + with pytest.raises(OverflowError, match="outside np.intp range"): + ArrayMap(outside_intp) diff --git a/packages/zarr-indexing/tests/test_reader.py b/packages/zarr-indexing/tests/test_reader.py new file mode 100644 index 0000000000..11241a316c --- /dev/null +++ b/packages/zarr-indexing/tests/test_reader.py @@ -0,0 +1,514 @@ +from __future__ import annotations + +import math +from typing import TYPE_CHECKING, Any, get_type_hints + +import numpy as np +import numpy.typing as npt +import pytest + +import zarr_indexing.reader as reader_module +from zarr_indexing import ( + ArrayMap, + ChunkProjection, + ConstantMap, + DimensionMap, + IndexDomain, + IndexTransform, + LazyArray, + ReadContext, + plan_chunks, +) +from zarr_indexing.grid import dimension_grids_from_chunks +from zarr_indexing.reader import basic_reader, numpy_reader, unit_step_reader + +if TYPE_CHECKING: + from collections.abc import Callable + + +class BasicOnlySource: + def __init__(self, data: np.ndarray[Any, Any]) -> None: + self.data = data + self.keys: list[tuple[Any, ...]] = [] + + @property + def shape(self) -> tuple[int, ...]: + return self.data.shape + + @property + def dtype(self) -> np.dtype[Any]: + return self.data.dtype + + def __getitem__(self, key: tuple[Any, ...]) -> np.ndarray[Any, Any]: + assert all(isinstance(item, slice) and (item.step or 1) > 0 for item in key) + self.keys.append(key) + return self.data[key] + + +class UnitStepOnlySource(BasicOnlySource): + """A source that rejects everything but ascending unit-step slices.""" + + def __getitem__(self, key: tuple[Any, ...]) -> np.ndarray[Any, Any]: + assert all( + isinstance(item, slice) and item.step == 1 and 0 <= item.start <= item.stop <= size + for item, size in zip(key, self.data.shape, strict=True) + ) + self.keys.append(key) + return self.data[key] + + +SOURCE = np.arange(6 * 7 * 8).reshape(6, 7, 8) +BASE = IndexTransform.from_shape(SOURCE.shape) + + +SUCCESSFUL_CONTRACT_CASES = ( + pytest.param( + np.arange(8), + IndexTransform.from_shape((8,))[3], + (3,), + np.zeros((1, 0), dtype=np.intp), + np.array([[3]], dtype=np.intp), + np.array(3), + lambda array: array.lazy[3], + id="constant", + ), + pytest.param( + np.arange(8), + IndexTransform.from_shape((8,))[1:8:2], + (3,), + np.array([[0], [1], [2], [3]], dtype=np.intp), + np.array([[1], [3], [5], [7]], dtype=np.intp), + np.array([1, 3, 5, 7]), + lambda array: array.lazy[1:8:2], + id="positive-affine", + ), + pytest.param( + np.arange(8), + IndexTransform.from_shape((8,))[::-2], + (3,), + np.array([[-3], [-2], [-1], [0]], dtype=np.intp), + np.array([[7], [5], [3], [1]], dtype=np.intp), + np.array([7, 5, 3, 1]), + lambda array: array.lazy[::-2], + id="negative-affine", + ), + pytest.param( + np.arange(8), + IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=(DimensionMap(input_dimension=0, offset=2, stride=0),), + ), + (3,), + np.array([[0], [1], [2]], dtype=np.intp), + np.array([[2], [2], [2]], dtype=np.intp), + np.array([2, 2, 2]), + lambda array: array.lazy.oindex[[2, 2, 2]], + id="zero-affine", + ), + pytest.param( + np.arange(20).reshape(4, 5), + IndexTransform.from_shape((4, 5)).oindex[[3, 1, 1], [4, 0]], + (2, 3), + np.array([[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1]], dtype=np.intp), + np.array([[3, 4], [3, 0], [1, 4], [1, 0], [1, 4], [1, 0]], dtype=np.intp), + np.array([[19, 15], [9, 5], [9, 5]]), + lambda array: array.lazy.oindex[[3, 1, 1], [4, 0]], + id="orthogonal-array", + ), + pytest.param( + np.arange(20).reshape(4, 5), + IndexTransform.from_shape((4, 5)).vindex[[3, 1, 1], [4, 0, 4]], + (2, 3), + np.array([[0], [1], [2]], dtype=np.intp), + np.array([[3, 4], [1, 0], [1, 4]], dtype=np.intp), + np.array([19, 5, 9]), + lambda array: array.lazy.vindex[[3, 1, 1], [4, 0, 4]], + id="correlated-array", + ), + pytest.param( + np.arange(8), + IndexTransform( + domain=IndexDomain((4,), (7,)), + output=(DimensionMap(input_dimension=0, offset=-3, stride=1),), + ), + (3,), + np.array([[4], [5], [6]], dtype=np.intp), + np.array([[1], [2], [3]], dtype=np.intp), + np.array([1, 2, 3]), + None, + id="non-zero-origin", + ), + pytest.param( + np.arange(8), + IndexTransform.from_shape((8,))[2:2], + (3,), + np.empty((0, 1), dtype=np.intp), + np.empty((0, 1), dtype=np.intp), + np.array([], dtype=np.intp), + lambda array: array.lazy[2:2], + id="empty", + ), +) + + +@pytest.mark.parametrize( + ( + "source_data", + "transform", + "chunk_shape", + "request_coordinates", + "storage_coordinates", + "expected_values", + "lazy_selection", + ), + SUCCESSFUL_CONTRACT_CASES, +) +def test_successful_transform_contract_across_planning_readers_and_lazy_array( + source_data: np.ndarray[Any, Any], + transform: IndexTransform, + chunk_shape: tuple[int, ...], + request_coordinates: npt.NDArray[np.intp], + storage_coordinates: npt.NDArray[np.intp], + expected_values: np.ndarray[Any, Any], + lazy_selection: Callable[[LazyArray], LazyArray] | None, +) -> None: + """One literal matrix keeps transform, planning, readers, and wrappers aligned.""" + np.testing.assert_array_equal(transform.apply_many(request_coordinates), storage_coordinates) + + grids = dimension_grids_from_chunks(chunk_shape, source_data.shape) + reconstructed_pairs = [ + ( + tuple(projection.cell_transform.apply(cell_coordinate)), + tuple( + local_coordinate + chunk_origin + for local_coordinate, chunk_origin in zip( + projection.chunk_transform.apply(cell_coordinate), + projection.chunk_domain.inclusive_min, + strict=True, + ) + ), + ) + for projection in plan_chunks(transform, grids) + for cell_coordinate in _domain_coordinates(projection.cell_transform.domain) + ] + expected_pairs = list( + zip( + map(tuple, request_coordinates.tolist()), + map(tuple, storage_coordinates.tolist()), + strict=True, + ) + ) + assert sorted(reconstructed_pairs) == sorted(expected_pairs) + + for reader, source in ( + (basic_reader, BasicOnlySource(source_data)), + (numpy_reader, source_data), + (unit_step_reader, UnitStepOnlySource(source_data)), + ): + out = np.empty(transform.domain.shape, dtype=source_data.dtype) + assert reader.read_into(source, ReadContext(transform), out) is None + np.testing.assert_array_equal(out, expected_values) + + if lazy_selection is not None: + view = lazy_selection(LazyArray.from_numpy(source_data).with_parts(chunk_shape)) + np.testing.assert_array_equal(view.result(), expected_values) + + +def _domain_coordinates(domain: IndexDomain) -> list[tuple[int, ...]]: + return [ + tuple( + position + origin for position, origin in zip(index, domain.inclusive_min, strict=True) + ) + for index in np.ndindex(*domain.shape) + ] + + +def test_read_context_public_annotations_resolve() -> None: + assert get_type_hints(ReadContext)["projection"] == ChunkProjection | None + + +READER_CASES = ( + pytest.param( + SOURCE, + BASE[1:6:2, 2, ::-2], + np.array( + [ + [79, 77, 75, 73], + [191, 189, 187, 185], + [303, 301, 299, 297], + ] + ), + id="strided-reversed-nonzero-origin", + ), + pytest.param( + SOURCE, + BASE.oindex[[5, 1, 1], slice(1, 6), [7, 2]], + np.array( + [ + [[295, 290], [303, 298], [311, 306], [319, 314], [327, 322]], + [[71, 66], [79, 74], [87, 82], [95, 90], [103, 98]], + [[71, 66], [79, 74], [87, 82], [95, 90], [103, 98]], + ] + ), + id="orthogonal-nonzero-origin", + ), + pytest.param( + SOURCE, + BASE.vindex[np.array([[5], [1]]), np.array([[2, 4, 0]])], + np.array( + [ + [ + [296, 297, 298, 299, 300, 301, 302, 303], + [312, 313, 314, 315, 316, 317, 318, 319], + [280, 281, 282, 283, 284, 285, 286, 287], + ], + [ + [72, 73, 74, 75, 76, 77, 78, 79], + [88, 89, 90, 91, 92, 93, 94, 95], + [56, 57, 58, 59, 60, 61, 62, 63], + ], + ] + ), + id="correlated-broadcast", + ), + pytest.param( + SOURCE, + BASE.vindex[[5, 1], [2, 2]], + np.array( + [ + [296, 297, 298, 299, 300, 301, 302, 303], + [72, 73, 74, 75, 76, 77, 78, 79], + ] + ), + id="correlated-vector", + ), + pytest.param( + SOURCE, + BASE[:, 0:0, :], + np.empty((6, 0, 8), dtype=SOURCE.dtype), + id="empty", + ), + pytest.param(SOURCE, BASE[2, 3, 4], np.array(140), id="scalar"), + pytest.param( + np.arange(8), + IndexTransform( + domain=IndexDomain((4,), (7,)), + output=(DimensionMap(input_dimension=0, offset=2, stride=0),), + ), + np.array([2, 2, 2]), + id="zero-stride-nonzero-origin", + ), +) + + +@pytest.mark.parametrize(("source_data", "transform", "expected"), READER_CASES) +@pytest.mark.parametrize("reader_name", ["basic", "numpy", "unit-step"]) +def test_builtin_readers_match_the_transform( + source_data: np.ndarray[Any, Any], + transform: IndexTransform, + expected: np.ndarray[Any, Any], + reader_name: str, +) -> None: + out = np.empty(transform.domain.shape, dtype=source_data.dtype) + if reader_name == "basic": + source = BasicOnlySource(source_data) + result = basic_reader.read_into(source, ReadContext(transform), out) + assert len(source.keys) == 1 + elif reader_name == "unit-step": + source = UnitStepOnlySource(source_data) + result = unit_step_reader.read_into(source, ReadContext(transform), out) + assert len(source.keys) == 1 + else: + result = numpy_reader.read_into(source_data, ReadContext(transform), out) + assert result is None + np.testing.assert_array_equal(out, expected) + + +@pytest.mark.parametrize("reader_name", ["basic", "numpy", "unit-step"]) +def test_builtin_readers_share_transform_affine_overflow(reader_name: str) -> None: + transform = IndexTransform( + domain=IndexDomain.from_shape((1,)), + output=(ArrayMap(np.array([2**62], dtype=np.intp), stride=4),), + ) + + with pytest.raises(OverflowError, match="outside np.intp"): + transform.apply_many(np.array([[0]], dtype=np.intp)) + + out = np.empty(transform.domain.shape, dtype=np.intp) + if reader_name == "basic": + with pytest.raises(OverflowError, match="outside np.intp"): + basic_reader.read_into(BasicOnlySource(np.arange(1)), ReadContext(transform), out) + elif reader_name == "unit-step": + with pytest.raises(OverflowError, match="outside np.intp"): + unit_step_reader.read_into( + UnitStepOnlySource(np.arange(1)), ReadContext(transform), out + ) + else: + with pytest.raises(OverflowError, match="outside np.intp"): + numpy_reader.read_into(np.arange(1), ReadContext(transform), out) + + +def test_empty_domain_composed_fancy_transform_reads_as_empty() -> None: + """An ArrayMap composed over an empty domain resolves like any other map. + + The composed map is legitimately empty along the vanished axis; the + resolvers used to fail reshaping it instead of noticing that an empty + domain selects nothing. + """ + source_data = np.arange(6).reshape(2, 3) + view = LazyArray.from_numpy(source_data).lazy.oindex[slice(0, 0), np.array([2, 1, 2, 0])] + transform = view.lazy.oindex[slice(None), np.array([1, 3, 1])].transform + assert transform.domain.shape == (0, 3) + + for reader, source in ( + (basic_reader, BasicOnlySource(source_data)), + (numpy_reader, source_data), + (unit_step_reader, UnitStepOnlySource(source_data)), + ): + out = np.empty(transform.domain.shape, dtype=source_data.dtype) + assert reader.read_into(source, ReadContext(transform), out) is None + + +def test_unit_step_reader_reads_through_lazy_array() -> None: + """The full dialect resolves through a source that only accepts unit-step slices. + + `UnitStepOnlySource` asserts the shape of every key it receives, so each + selection here also proves no strided, descending, or non-slice key + reached the source — partitioned and unpartitioned alike. + """ + selections: tuple[Callable[[LazyArray], LazyArray], ...] = ( + lambda v: v.lazy[1:5, ::2, ::-1], + lambda v: v.lazy[5:1:-2, None, 3, ::3], + lambda v: v.lazy.oindex[[3, 0, 3], ::-2, [7, 7]], + lambda v: v.lazy.vindex[np.array([[0, 5]]), np.array([[6], [0]]), 2], + lambda v: v.lazy[2:2, :, ::-1], + lambda v: v.lazy[::5, 6, 1:8:4], + ) + for select in selections: + for parts in (None, (2, 3, 8), (6, 7, 1)): + source = UnitStepOnlySource(SOURCE) + view = LazyArray(source).with_reader(unit_step_reader) + if parts is not None: + view = view.with_parts(parts) + expected = select(LazyArray.from_numpy(SOURCE)).result() + np.testing.assert_array_equal(select(view).result(), expected) + # An empty view allocates without reading; every other one must read. + assert (len(source.keys) > 0) == (expected.size > 0) + + +def test_constant_outside_intp_has_transform_planner_reader_error_parity() -> None: + outside_intp = int(np.iinfo(np.intp).max) + 1 + transform = IndexTransform( + domain=IndexDomain((), ()), + output=(ConstantMap(offset=outside_intp),), + ) + + with pytest.raises(OverflowError, match="outside np.intp range"): + transform.apply_many(np.zeros((1, 0), dtype=np.intp)) + + grids = dimension_grids_from_chunks((1,), (1,)) + with pytest.raises(OverflowError, match="outside np.intp range"): + list(plan_chunks(transform, grids)) + + for reader, source in ( + (basic_reader, BasicOnlySource(np.arange(1))), + (numpy_reader, np.arange(1)), + ): + with pytest.raises(OverflowError, match="outside np.intp range"): + reader.read_into(source, ReadContext(transform), np.empty((), dtype=np.intp)) + + +def test_numpy_reader_narrows_basic_slab_before_gather( + monkeypatch: pytest.MonkeyPatch, +) -> None: + source = np.arange(1_000_000).reshape(1000, 1000) + transform = IndexTransform.from_shape(source.shape).oindex[:10, [0, 999]] + seen: list[tuple[int, ...]] = [] + real_take = reader_module._take # pyright: ignore[reportPrivateUsage] + + def recording_take(array: Any, indices: npt.NDArray[np.intp], axis: int) -> Any: + seen.append(tuple(int(value) for value in array.shape)) + return real_take(array, indices, axis) + + monkeypatch.setattr(reader_module, "_take", recording_take) + out = np.empty(transform.domain.shape, dtype=source.dtype) + assert numpy_reader.read_into(source, ReadContext(transform), out) is None + assert out.shape == (10, 2) + np.testing.assert_array_equal( + out, + np.array( + [ + [0, 999], + [1000, 1999], + [2000, 2999], + [3000, 3999], + [4000, 4999], + [5000, 5999], + [6000, 6999], + [7000, 7999], + [8000, 8999], + [9000, 9999], + ] + ), + ) + assert seen + assert all(math.prod(shape) <= 20_000 for shape in seen), seen + + +def test_numpy_reader_preserves_a_mask_in_the_supplied_buffer() -> None: + source = np.ma.masked_greater(np.arange(12).reshape(3, 4), 7) + transform = IndexTransform.from_shape(source.shape)[:, 1:] + out = np.ma.masked_all(transform.domain.shape, dtype=source.dtype) + assert numpy_reader.read_into(source, ReadContext(transform), out) is None + np.testing.assert_array_equal(np.ma.getmaskarray(out), np.ma.getmaskarray(source[:, 1:])) + np.testing.assert_array_equal(np.ma.filled(out, 0), np.ma.filled(source[:, 1:], 0)) + + +# --------------------------------------------------------------------------- +# Diagonal gathers — output maps sharing an input axis +# --------------------------------------------------------------------------- + + +def test_reading_a_diagonal_gather_transform() -> None: + """Two index arrays bound to the same input axis resolve pointwise. + + No selection dialect produces this transform — it is the hand-built + diagonal-extraction form — but the reader resolves it through the same + pointwise path as a correlated gather. + """ + data = np.arange(30).reshape(5, 6) + rows = np.array([4, 0, 2]) + cols = np.array([1, 5, 2]) + transform = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=( + ArrayMap(index_array=rows), + ArrayMap(index_array=cols), + ), + ) + + out = np.empty((3,), dtype=data.dtype) + basic_reader.read_into(data, ReadContext(transform), out) + np.testing.assert_array_equal(out, data[rows, cols]) + + out = np.empty((3,), dtype=data.dtype) + numpy_reader.read_into(data, ReadContext(transform), out) + np.testing.assert_array_equal(out, data[rows, cols]) + + +def test_reading_a_diagonal_gather_with_a_residual_slice_axis() -> None: + data = np.arange(60).reshape(5, 6, 2) + rows = np.array([[4], [0], [2]]) + cols = np.array([[1], [5], [2]]) + transform = IndexTransform( + domain=IndexDomain.from_shape((3, 2)), + output=( + ArrayMap(index_array=rows), + ArrayMap(index_array=cols), + DimensionMap(input_dimension=1), + ), + ) + + out = np.empty((3, 2), dtype=data.dtype) + basic_reader.read_into(data, ReadContext(transform), out) + np.testing.assert_array_equal(out, data[rows[:, 0], cols[:, 0], :]) diff --git a/packages/zarr-indexing/tests/test_tensorstore_parity.py b/packages/zarr-indexing/tests/test_tensorstore_parity.py index 1ed99046e9..9f4123fc02 100644 --- a/packages/zarr-indexing/tests/test_tensorstore_parity.py +++ b/packages/zarr-indexing/tests/test_tensorstore_parity.py @@ -208,6 +208,178 @@ def test_reversed_bounds_raise(self, sel: slice) -> None: _a()[sel] +class TestNegativeStep: + """Section 1 of the negative-step study: one desugaring rule, both signs. + + Every expectation below is TensorStore 0.1.84's recorded output (study + sections 1.3-1.5), which an exhaustive 32,980-case sweep found zero + disagreements with. + """ + + # (domain, slice, expected domain, expected offset, expected stride, cells) + RECORDED: ClassVar[list[tuple[tuple[int, int], slice, tuple[int, int], int, int]]] = [ + ((0, 20), slice(15, 5, -1), (-15, -5), 0, -1), + ((0, 20), slice(15, 5, -2), (-7, -2), 1, -2), + ((0, 20), slice(15, 4, -2), (-7, -1), 1, -2), + ((0, 20), slice(None, None, -1), (-19, 1), 0, -1), + ((0, 20), slice(None, None, -2), (-9, 1), 1, -2), + ((0, 20), slice(5, None, -1), (-5, 1), 0, -1), + ((0, 20), slice(None, 5, -1), (-19, -5), 0, -1), + ((0, 20), slice(5, 5, -1), (-5, -5), 0, -1), + ((0, 20), slice(5, 4, -1), (-5, -4), 0, -1), + ((0, 20), slice(5, 4, -3), (-1, 0), 2, -3), + ((0, 20), slice(15, 5, -4), (-3, 0), 3, -4), + ((0, 20), slice(15, 5, -7), (-2, 0), 1, -7), + ((5, 25), slice(None, None, -2), (-12, -2), 0, -2), + ((-10, 10), slice(-1, -6, -2), (0, 3), -1, -2), + ((-10, 10), slice(-2, -9, -3), (0, 3), -2, -3), + ] + + @pytest.mark.parametrize( + ("domain", "sel", "expected_domain", "offset", "stride"), + RECORDED, + ids=[f"{d}{s}" for d, s, _, _, _ in RECORDED], + ) + def test_recorded_desugaring( + self, + domain: tuple[int, int], + sel: slice, + expected_domain: tuple[int, int], + offset: int, + stride: int, + ) -> None: + t = _identity(*domain)[sel] + assert (t.domain.inclusive_min[0], t.domain.exclusive_max[0]) == expected_domain + m = _dim(t) + assert (m.offset, m.stride) == (offset, stride) + + @pytest.mark.parametrize( + ("domain", "sel", "cells"), + [ + ((0, 20), slice(15, 5, -1), list(range(15, 5, -1))), + ((0, 20), slice(15, 5, -2), [15, 13, 11, 9, 7]), + ((0, 20), slice(None, None, -1), list(range(19, -1, -1))), + ((0, 20), slice(15, 5, -7), [15, 8]), + ((5, 25), slice(None, None, -2), list(range(24, 4, -2))), + ((-10, 10), slice(-1, -6, -2), [-1, -3, -5]), + ((-10, 10), slice(-2, -9, -3), [-2, -5, -8]), + ], + ) + def test_recorded_cells(self, domain: tuple[int, int], sel: slice, cells: list[int]) -> None: + assert _base_cells(_identity(*domain)[sel]) == cells + + def test_trunc_not_floor_or_ceil(self) -> None: + """The three rows of study section 1.2 that discriminate the rounding.""" + # floor would give -8 here, trunc gives -7. + assert _identity(0, 20)[15:5:-2].domain.inclusive_min[0] == -7 + # ceil would give 1 for both of these; trunc gives 0. + assert _identity(-10, 10)[-1:-6:-2].domain.inclusive_min[0] == 0 + assert _identity(-10, 10)[-2:-9:-3].domain.inclusive_min[0] == 0 + + @pytest.mark.parametrize("sel", [slice(5, 15, -1), slice(5, 6, -1)]) + def test_inverted_interval_raises(self, sel: slice) -> None: + with pytest.raises(IndexError, match="valid.*interval"): + _identity(0, 20)[sel] + + @pytest.mark.parametrize("sel", [slice(20, 0, -1), slice(20, 19, -1), slice(15, -5, -1)]) + def test_uncontained_interval_raises(self, sel: slice) -> None: + with pytest.raises(BoundsCheckError, match="not contained"): + _identity(0, 20)[sel] + + def test_zero_step_raises(self) -> None: + with pytest.raises(IndexError, match="step must not be zero"): + _identity(0, 20)[15:5:0] + + def test_empty_interval_legal_outside_the_domain(self) -> None: + t = _identity(0, 20)[25:25:-1] + assert t.domain.shape == (0,) + assert t.domain.inclusive_min[0] == -25 + + @pytest.mark.parametrize( + ("domain", "first", "second", "expected_domain", "offset", "stride", "cells"), + [ + # Study section 1.5, recorded verbatim. Each row applies `second` + # to the view `first` produced — strides multiply, and a double + # reverse recovers the identity. + ( + (0, 20), + slice(0, 20, 2), + slice(None, None, -1), + (-9, 1), + 0, + -2, + list(range(18, -2, -2)), + ), + ((0, 20), slice(0, 20, 2), slice(None, None, -2), (-4, 1), 2, -4, [18, 14, 10, 6, 2]), + ( + (0, 20), + slice(None, None, -1), + slice(None, None, -1), + (0, 20), + 0, + 1, + list(range(20)), + ), + ( + (0, 20), + slice(None, None, -1), + slice(None, None, 2), + (-9, 1), + 1, + -2, + list(range(19, -1, -2)), + ), + ( + (-10, 10), + slice(None, None, -1), + slice(None, None, -3), + (-3, 4), + -1, + 3, + [-10, -7, -4, -1, 2, 5, 8], + ), + ], + ids=[ + "strided-then-reverse", + "strided-then-reverse-by-two", + "double-reverse-is-identity", + "reverse-then-strided", + "reverse-then-strided-on-negative-origin", + ], + ) + def test_recorded_composition( + self, + domain: tuple[int, int], + first: slice, + second: slice, + expected_domain: tuple[int, int], + offset: int, + stride: int, + cells: list[int], + ) -> None: + t = _identity(*domain)[first][second] + assert (t.domain.inclusive_min[0], t.domain.exclusive_max[0]) == expected_domain + m = _dim(t) + assert (m.offset, m.stride) == (offset, stride) + assert _base_cells(t) == cells + + def test_negative_step_over_an_index_array_reverses_it(self) -> None: + """Study section 1.5: a reversing step materializes, it does not stride. + + Recorded: `oindex[[3, 1, 2]]` then `[2:-1:-1]` gives index array + `[[2], [1], [3]]` over domain `[-2, 1)`. + """ + base = IndexTransform.identity(IndexDomain(inclusive_min=(0, 0), exclusive_max=(4, 5))) + gathered = base.oindex[np.array([3, 1, 2]), slice(None)] + reversed_view = gathered[2:-1:-1, :] + + assert reversed_view.domain.inclusive_min[0] == -2 + assert reversed_view.domain.exclusive_max[0] == 1 + m = reversed_view.output[0] + assert isinstance(m, ArrayMap) + np.testing.assert_array_equal(m.index_array.reshape(-1), np.array([2, 1, 3])) + + class TestTranslate: """Oracle sections 4 and 12: translate_by / translate_to preserve the cell mapping.""" diff --git a/packages/zarr-indexing/tests/test_transform.py b/packages/zarr-indexing/tests/test_transform.py index baecd9ada2..a13eaf6e28 100644 --- a/packages/zarr-indexing/tests/test_transform.py +++ b/packages/zarr-indexing/tests/test_transform.py @@ -1,11 +1,39 @@ from __future__ import annotations +from typing import cast + import numpy as np import pytest from zarr_indexing.domain import IndexDomain +from zarr_indexing.errors import BoundsCheckError +from zarr_indexing.lazy_array import LazyArray from zarr_indexing.output_map import ArrayMap, ConstantMap, DimensionMap -from zarr_indexing.transform import IndexTransform, selection_to_transform +from zarr_indexing.transform import ( + IndexTransform, +) + + +class IndexLike: + """A scalar integer selector implemented only through `__index__`.""" + + def __init__(self, value: int) -> None: + self.value = value + + def __index__(self) -> int: + return self.value + + +class IntOnly: + def __int__(self) -> int: + return 2 + + +class BadIndex: + """An `__index__` that lies: the protocol requires an integer.""" + + def __index__(self) -> int: + return cast("int", 2.5) class TestIndexTransformConstruction: @@ -50,6 +78,323 @@ def test_validation_input_dimension_out_of_range(self) -> None: IndexTransform(domain=domain, output=maps) +class TestIndexTransformApply: + @pytest.mark.parametrize( + ("transform", "points", "expected"), + [ + pytest.param( + IndexTransform.identity(IndexDomain((-2, 5), (1, 8))), + np.array([-2, 7], dtype=np.int64), + np.array([-2, 7], dtype=np.intp), + id="identity-negative-and-nonzero-origins", + ), + pytest.param( + IndexTransform( + domain=IndexDomain((3,), (6,)), + output=( + ConstantMap(41), + DimensionMap(0, offset=10, stride=-2), + ), + ), + np.array([[3], [5]], dtype=np.int16), + np.array([[41, 4], [41, 0]], dtype=np.intp), + id="constant-and-negative-stride", + ), + pytest.param( + IndexTransform( + domain=IndexDomain((-2, 5), (1, 8)), + output=( + ArrayMap( + np.array([[7], [11], [13]], dtype=np.intp), + offset=-1, + stride=2, + ), + ), + ), + np.array( + [ + [[-2, 5], [-1, 7]], + [[0, 6], [-2, 6]], + ], + dtype=np.intp, + ), + np.array([[[13], [21]], [[25], [13]]], dtype=np.intp), + id="array-map-singleton-broadcast-multidimensional-batch", + ), + pytest.param( + IndexTransform(IndexDomain((), ()), (ConstantMap(42),)), + np.empty((2, 0), dtype=np.intp), + np.array([[42], [42]], dtype=np.intp), + id="rank-zero-input", + ), + pytest.param( + IndexTransform(IndexDomain((-1,), (2,)), ()), + np.array([[-1], [1]], dtype=np.intp), + np.empty((2, 0), dtype=np.intp), + id="rank-zero-output", + ), + pytest.param( + IndexTransform.identity(IndexDomain.from_shape((2,))), + np.empty((0, 1), dtype=np.intp), + np.empty((0, 1), dtype=np.intp), + id="empty-batch", + ), + ], + ) + def test_apply_many_maps_integer_point_batches( + self, + transform: IndexTransform, + points: np.ndarray, + expected: np.ndarray, + ) -> None: + result = transform.apply_many(points) + + np.testing.assert_array_equal(result, expected) + assert result.dtype == np.dtype(np.intp) + assert result.flags.owndata + + def test_apply_maps_one_point(self) -> None: + transform = IndexTransform( + IndexDomain((-2, 4), (1, 7)), + ( + DimensionMap(1, offset=3, stride=-1), + DimensionMap(0, offset=2, stride=2), + ), + ) + + assert transform.apply((-1, 6)) == (-3, 0) + + def test_apply_rejects_a_point_with_the_wrong_rank(self) -> None: + with pytest.raises(ValueError, match=r"point must have shape \(2,\), got \(1,\)"): + IndexTransform.from_shape((2, 3)).apply((1,)) + + def test_apply_rejects_an_explicitly_floating_rank_zero_point(self) -> None: + transform = IndexTransform(IndexDomain((), ()), ()) + with pytest.raises(TypeError, match="integer dtype"): + transform.apply(np.array([], dtype=np.float64)) + + @pytest.mark.parametrize( + "points", + [ + pytest.param(np.array(1, dtype=np.intp), id="no-coordinate-axis"), + pytest.param(np.zeros((4, 3), dtype=np.intp), id="wrong-trailing-size"), + ], + ) + def test_apply_many_rejects_an_invalid_coordinate_axis(self, points: np.ndarray) -> None: + with pytest.raises(ValueError, match="trailing coordinate axis"): + IndexTransform.from_shape((2, 3)).apply_many(points) + + @pytest.mark.parametrize( + "points", + [ + pytest.param(np.array([[True]], dtype=np.bool_), id="bool"), + pytest.param(np.array([[1.0]], dtype=np.float64), id="float"), + pytest.param(np.array([["1"]], dtype=np.str_), id="string"), + pytest.param(np.array([[1]], dtype=object), id="object"), + ], + ) + def test_apply_many_rejects_non_integer_coordinates(self, points: np.ndarray) -> None: + with pytest.raises(TypeError, match="integer dtype"): + IndexTransform.from_shape((2,)).apply_many(points) + + def test_apply_many_reports_the_first_out_of_bounds_coordinate(self) -> None: + transform = IndexTransform.identity(IndexDomain((-2, 10), (2, 13))) + points = np.array( + [ + [[-2, 10], [-1, 20]], + [[9, 11], [0, 12]], + ], + dtype=np.intp, + ) + + with pytest.raises(BoundsCheckError) as error: + transform.apply_many(points) + + assert str(error.value) == ( + "point at batch position (0, 1) has input dimension 1 coordinate 20 outside [10, 13)" + ) + + def test_apply_reports_a_single_point_error_without_batch_vocabulary(self) -> None: + transform = IndexTransform.identity(IndexDomain((-10,), (10,))) + + with pytest.raises(BoundsCheckError) as error: + transform.apply((11,)) + + assert str(error.value) == ( + "coordinate 11 on input dimension 0 is outside the domain [-10, 10)" + ) + assert error.value.__cause__ is None + assert error.value.__suppress_context__ + + @pytest.mark.parametrize( + "beyond_intp", + [ + pytest.param(int(np.iinfo(np.intp).max) + 1, id="first-uint64-coordinate"), + pytest.param(int(np.iinfo(np.uint64).max), id="maximum-uint64-coordinate"), + ], + ) + def test_apply_many_maps_large_literal_coordinates_exactly(self, beyond_intp: int) -> None: + transform = IndexTransform( + IndexDomain((beyond_intp,), (beyond_intp + 1,)), + (DimensionMap(0, offset=-beyond_intp),), + ) + + result = transform.apply_many(np.array([[beyond_intp]], dtype=np.uint64)) + + np.testing.assert_array_equal(result, np.array([[0]], dtype=np.intp)) + assert result.dtype == np.dtype(np.intp) + assert result.flags.owndata + + @pytest.mark.parametrize( + ("transform", "points"), + [ + pytest.param( + IndexTransform( + IndexDomain.from_shape((1,)), + (ConstantMap(np.iinfo(np.intp).max + 1),), + ), + [[0]], + id="constant", + ), + pytest.param( + IndexTransform( + IndexDomain.from_shape((2,)), + (DimensionMap(0, offset=np.iinfo(np.intp).max),), + ), + [[1]], + id="dimension", + ), + pytest.param( + IndexTransform( + IndexDomain.from_shape((1,)), + ( + ArrayMap( + np.array([1], dtype=np.intp), + offset=np.iinfo(np.intp).max, + ), + ), + ), + [[0]], + id="array", + ), + pytest.param( + IndexTransform.identity( + IndexDomain( + (int(np.iinfo(np.intp).max) + 1,), + (int(np.iinfo(np.intp).max) + 2,), + ) + ), + np.array([[int(np.iinfo(np.intp).max) + 1]], dtype=np.uint64), + id="large-input-identity", + ), + ], + ) + def test_apply_many_rejects_mapped_coordinates_outside_intp( + self, transform: IndexTransform, points: list[list[int]] | np.ndarray + ) -> None: + with pytest.raises(OverflowError, match="output coordinate.*np.intp"): + transform.apply_many(points) + + def test_apply_many_rejects_affine_coordinate_overflow(self) -> None: + transform = IndexTransform( + domain=IndexDomain.from_shape((1,)), + output=(ArrayMap(np.array([2**62], dtype=np.intp), stride=4),), + ) + with pytest.raises(OverflowError, match="outside np.intp"): + transform.apply_many(np.array([[0]], dtype=np.intp)) + + def test_apply_rejects_affine_coordinate_overflow(self) -> None: + transform = IndexTransform( + domain=IndexDomain.from_shape((1,)), + output=(ArrayMap(np.array([2**62], dtype=np.intp), stride=4),), + ) + with pytest.raises(OverflowError, match="outside np.intp"): + transform.apply((0,)) + + +class TestIndexTransformInverted: + @pytest.mark.parametrize( + ("transform", "points"), + [ + pytest.param( + IndexTransform( + IndexDomain((-3, 4), (1, 7)), + ( + DimensionMap(1, offset=10), + DimensionMap(0, offset=2, stride=-1), + ), + ), + np.array([[-3, 4], [0, 6]], dtype=np.intp), + id="permutation-translation-reversal-nonzero-origin", + ), + pytest.param( + IndexTransform( + IndexDomain((5, -2), (8, -1)), + (DimensionMap(0, offset=3), ConstantMap(99)), + ), + np.array([[5, -2], [7, -2]], dtype=np.intp), + id="constant-and-unreferenced-singleton", + ), + pytest.param( + IndexTransform(IndexDomain((), ()), ()), + np.empty((1, 0), dtype=np.intp), + id="rank-zero", + ), + ], + ) + def test_inverted_round_trips_points( + self, transform: IndexTransform, points: np.ndarray + ) -> None: + inverse = transform.inverted() + mapped = transform.apply_many(points) + + np.testing.assert_array_equal(inverse.apply_many(mapped), points) + assert inverse.apply(transform.apply(tuple(points[0]))) == tuple(points[0]) + assert inverse.inverted() == transform + + def test_inverted_rejects_unequal_ranks(self) -> None: + transform = IndexTransform(IndexDomain.from_shape((2,)), (ConstantMap(1), ConstantMap(2))) + with pytest.raises(ValueError, match="input rank must equal output rank"): + transform.inverted() + + def test_inverted_rejects_an_array_map(self) -> None: + transform = IndexTransform( + IndexDomain.from_shape((2,)), + (ArrayMap(np.array([1, 0], dtype=np.intp)),), + ) + with pytest.raises(ValueError, match="ArrayMap"): + transform.inverted() + + def test_inverted_rejects_a_non_unit_stride(self) -> None: + transform = IndexTransform( + IndexDomain.from_shape((2,)), + (DimensionMap(0, stride=2),), + ) + with pytest.raises(ValueError, match=r"stride must be \+1 or -1"): + transform.inverted() + + def test_inverted_rejects_a_repeated_input_dimension(self) -> None: + transform = IndexTransform( + IndexDomain.from_shape((2, 1)), + (DimensionMap(0), DimensionMap(0, offset=5)), + ) + with pytest.raises(ValueError, match="referenced more than once"): + transform.inverted() + + def test_inverted_rejects_an_unreferenced_non_singleton_dimension(self) -> None: + transform = IndexTransform( + IndexDomain.from_shape((2, 2)), + (DimensionMap(0), ConstantMap(7)), + ) + with pytest.raises(ValueError, match="unreferenced input dimension 1.*extent 2"): + transform.inverted() + + def test_inverted_rejects_input_labels_that_cannot_be_preserved(self) -> None: + transform = IndexTransform.identity(IndexDomain((0,), (2,), labels=("row",))) + with pytest.raises(ValueError, match="input labels cannot be represented"): + transform.inverted() + + class TestIndexTransformBasicIndexing: def test_slice_identity(self) -> None: """slice(None) on identity transform is a no-op.""" @@ -180,6 +525,45 @@ def test_bare_slice(self) -> None: result = t[2:8] assert result.domain.shape == (6, 20) + @pytest.mark.parametrize( + ("mode", "selection", "expected_selection"), + [ + pytest.param("basic", IndexLike(2), 2, id="basic-scalar"), + pytest.param( + "basic", + slice(IndexLike(1), IndexLike(7), IndexLike(2)), + slice(1, 7, 2), + id="basic-slice-components", + ), + pytest.param("oindex", IndexLike(2), 2, id="orthogonal-scalar"), + pytest.param("vindex", IndexLike(2), 2, id="vectorized-scalar"), + ], + ) + def test_literal_selectors_support_the_index_protocol( + self, mode: str, selection: object, expected_selection: object + ) -> None: + transform = IndexTransform.from_shape((8,)) + if mode == "basic": + result = transform[selection] + expected = transform[expected_selection] + else: + result = getattr(transform, mode)[selection] + expected = getattr(transform, mode)[expected_selection] + + assert result == expected + + def test_literal_selector_rejects_int_only_objects(self) -> None: + with pytest.raises(IndexError, match="unsupported selection type"): + IndexTransform.from_shape((8,))[IntOnly()] + + def test_literal_selector_propagates_malformed_index_protocol(self) -> None: + with pytest.raises(TypeError, match="__index__ returned non-int"): + IndexTransform.from_shape((8,))[BadIndex()] + + def test_literal_slice_propagates_malformed_index_protocol(self) -> None: + with pytest.raises(TypeError, match="__index__ returned non-int"): + IndexTransform.from_shape((8,))[:: BadIndex()] + class TestBasicIndexingOnArrayMaps: """When a transform already has ArrayMap outputs, basic indexing must @@ -350,6 +734,17 @@ def test_vindex_bool_mask(self) -> None: assert result.domain.shape == (3,) assert isinstance(result.output[0], ArrayMap) + def test_vindex_multidimensional_boolean_list_mask(self) -> None: + result = IndexTransform.from_shape((2, 3)).vindex[ + [[True, False, True], [False, True, False]] + ] + + assert result.domain.shape == (3,) + np.testing.assert_array_equal( + result.apply_many(np.array([[0], [1], [2]], dtype=np.intp)), + np.array([[0, 0], [0, 2], [1, 1]], dtype=np.intp), + ) + def test_vindex_broadcast_different_shapes(self) -> None: t = IndexTransform.from_shape((10, 20)) idx0 = np.array([1, 2, 3], dtype=np.intp) @@ -368,10 +763,24 @@ def test_vindex_multiple_arrays_preserves_shared_axes(self) -> None: assert result.output[1].index_array.shape == (2,) +@pytest.mark.parametrize("mode", ["oindex", "vindex"]) +def test_direct_advanced_index_rejects_float_arrays(mode: str) -> None: + helper = getattr(IndexTransform.from_shape((5,)), mode) + with pytest.raises(IndexError, match="integer or boolean"): + helper[np.array([1.9, 3.2])] + + +@pytest.mark.parametrize("mode", ["oindex", "vindex"]) +def test_direct_advanced_index_rejects_wrong_length_boolean_mask(mode: str) -> None: + helper = getattr(IndexTransform.from_shape((5,)), mode) + with pytest.raises(IndexError, match="boolean index.*dimension 5"): + helper[np.array([True, False])] + + class TestSelectionToTransform: def test_basic_slice(self) -> None: t = IndexTransform.from_shape((10, 20)) - result = selection_to_transform((slice(2, 8), slice(5, 15)), t, "basic") + result = t.select((slice(2, 8), slice(5, 15)), "basic") assert result.domain.shape == (6, 10) assert result.domain.origin == (2, 5) # preserved literal coordinates assert isinstance(result.output[0], DimensionMap) @@ -379,20 +788,20 @@ def test_basic_slice(self) -> None: def test_basic_int(self) -> None: t = IndexTransform.from_shape((10, 20)) - result = selection_to_transform((3, slice(None)), t, "basic") + result = t.select((3, slice(None)), "basic") assert result.input_rank == 1 assert isinstance(result.output[0], ConstantMap) assert result.output[0].offset == 3 def test_basic_ellipsis(self) -> None: t = IndexTransform.from_shape((10, 20)) - result = selection_to_transform(Ellipsis, t, "basic") + result = t.select(Ellipsis, "basic") assert result.domain.shape == (10, 20) def test_orthogonal(self) -> None: t = IndexTransform.from_shape((10, 20)) idx = np.array([1, 3, 5], dtype=np.intp) - result = selection_to_transform((idx, slice(None)), t, "orthogonal") + result = t.select((idx, slice(None)), "orthogonal") assert result.domain.shape == (3, 20) assert isinstance(result.output[0], ArrayMap) @@ -400,7 +809,7 @@ def test_vectorized(self) -> None: t = IndexTransform.from_shape((10, 20)) idx0 = np.array([1, 3], dtype=np.intp) idx1 = np.array([5, 7], dtype=np.intp) - result = selection_to_transform((idx0, idx1), t, "vectorized") + result = t.select((idx0, idx1), "vectorized") assert result.domain.shape == (2,) assert isinstance(result.output[0], ArrayMap) assert isinstance(result.output[1], ArrayMap) @@ -413,7 +822,7 @@ def test_composition_with_non_identity(self) -> None: the composed map stays the identity (out = in). """ t = IndexTransform.from_shape((100,))[10:50] - result = selection_to_transform(slice(15, 30), t, "basic") + result = t.select(slice(15, 30), "basic") assert (result.domain.inclusive_min, result.domain.exclusive_max) == ((15,), (30,)) assert isinstance(result.output[0], DimensionMap) assert result.output[0].offset == 0 @@ -469,6 +878,72 @@ def test_dimension_strided(self) -> None: assert restricted.domain.inclusive_min == (2,) assert restricted.domain.exclusive_max == (4,) + @pytest.mark.parametrize( + ("input_domain", "output_domain", "output_map", "expected"), + [ + ( + (2**53, 2**53 + 3), + (2**53 + 1, 2**53 + 2), + DimensionMap(input_dimension=0), + (2**53 + 1, 2**53 + 2), + ), + ( + (-(2**53) - 2, -(2**53) + 1), + (-(2**53) - 1, -(2**53)), + DimensionMap(input_dimension=0), + (-(2**53) - 1, -(2**53)), + ), + ( + (-(2**53) - 2, -(2**53) + 1), + (2**53 + 1, 2**53 + 2), + DimensionMap(input_dimension=0, stride=-1), + (-(2**53) - 1, -(2**53)), + ), + ( + (2**53, 2**53 + 3), + (-(2**53) - 2, -(2**53) - 1), + DimensionMap(input_dimension=0, stride=-1), + (2**53 + 2, 2**53 + 3), + ), + ], + ids=[ + "positive-coordinates-positive-stride", + "negative-coordinates-positive-stride", + "positive-coordinates-negative-stride", + "negative-coordinates-negative-stride", + ], + ) + def test_dimension_intersection_is_exact_above_float_precision( + self, + input_domain: tuple[int, int], + output_domain: tuple[int, int], + output_map: DimensionMap, + expected: tuple[int, int], + ) -> None: + transform = IndexTransform( + domain=IndexDomain((input_domain[0],), (input_domain[1],)), + output=(output_map,), + ) + + result = transform.intersect(IndexDomain((output_domain[0],), (output_domain[1],))) + + assert result is not None + restricted, _surviving = result + assert restricted.domain == IndexDomain((expected[0],), (expected[1],)) + + def test_dimension_intersection_accepts_unbounded_python_integer_precision(self) -> None: + huge = 10**400 + transform = IndexTransform( + domain=IndexDomain((huge,), (huge + 2,)), + output=(DimensionMap(input_dimension=0),), + ) + + result = transform.intersect(IndexDomain((huge + 1,), (huge + 2,))) + + assert result is not None + restricted, _surviving = result + assert restricted.domain == IndexDomain((huge + 1,), (huge + 2,)) + def test_array_partial(self) -> None: arr = np.array([3, 8, 15, 22], dtype=np.intp) t = IndexTransform( @@ -549,33 +1024,39 @@ def test_translate_2d(self) -> None: class TestArrayMapDependencyAxes: - """`_array_map_dependency_axes` derives the input axes an array varies on + """`ArrayMap.dependency_axes` derives the input axes an array varies on from its (full-rank) shape: non-singleton axes vary, singleton axes do not.""" def test_orthogonal_single_axis(self) -> None: - from zarr_indexing.transform import _array_map_dependency_axes - t = IndexTransform.from_shape((10, 20)).oindex[np.array([1, 3]), np.array([2, 4, 6])] m0, m1 = t.output[0], t.output[1] assert isinstance(m0, ArrayMap) assert isinstance(m1, ArrayMap) - assert _array_map_dependency_axes(m0.index_array) == (0,) - assert _array_map_dependency_axes(m1.index_array) == (1,) + assert m0.dependency_axes == (0,) + assert m1.dependency_axes == (1,) def test_vectorized_shares_axes(self) -> None: - from zarr_indexing.transform import _array_map_dependency_axes - t = IndexTransform.from_shape((10, 20)).vindex[np.array([1, 3]), np.array([2, 4])] m0, m1 = t.output[0], t.output[1] assert isinstance(m0, ArrayMap) assert isinstance(m1, ArrayMap) - assert _array_map_dependency_axes(m0.index_array) == (0,) - assert _array_map_dependency_axes(m1.index_array) == (0,) + assert m0.dependency_axes == (0,) + assert m1.dependency_axes == (0,) def test_scalar_array_has_no_dependency(self) -> None: - from zarr_indexing.transform import _array_map_dependency_axes + assert ArrayMap(np.ones((1, 1), dtype=np.intp)).dependency_axes == () - assert _array_map_dependency_axes(np.ones((1, 1), dtype=np.intp)) == () + def test_zero_length_axis_has_no_dependency(self) -> None: + """An axis of size 0 carries no dependency either: it selects nothing, so + the array does not vary along it any more than along a singleton.""" + assert ArrayMap(np.zeros((0, 4), dtype=np.intp)).dependency_axes == (1,) + assert ArrayMap(np.zeros((3, 0), dtype=np.intp)).dependency_axes == (0,) + assert ArrayMap(np.zeros((0, 1), dtype=np.intp)).dependency_axes == () + + def test_zero_length_axis_does_not_make_a_map_correlated(self) -> None: + """An empty orthogonal selection is legal, so it must classify as one.""" + m = ArrayMap(index_array=np.zeros((0, 4), dtype=np.intp)) + assert m.dependent_axis == 1 class TestIntersectArrayMapClassification: @@ -617,12 +1098,153 @@ def test_correlated_with_residual_slice_preserves_slice_dim(self) -> None: assert any(isinstance(m, DimensionMap) for m in restricted.output) assert out_indices is not None - def test_length1_orthogonal_not_treated_as_correlated(self) -> None: - """A length-1 orthogonal array (all-singleton shape) is still an outer - product with the length-3 axis: out_indices is a dict, not a flat array.""" + def test_length1_orthogonal_collapses_to_a_constant(self) -> None: + """A length-1 orthogonal array holds one coordinate: it is a ConstantMap. + + The length-1 axis stays in the domain, and the remaining genuine array + intersects orthogonally — a single survivor vector, not a joint gather. + """ t = IndexTransform.from_shape((6, 6)).oindex[np.array([2]), np.array([1, 3, 5])] + assert isinstance(t.output[0], ConstantMap) + assert t.domain.shape == (1, 3) chunk = IndexDomain(inclusive_min=(0, 0), exclusive_max=(6, 6)) result = t.intersect(chunk) assert result is not None _restricted, out_indices = result - assert isinstance(out_indices, dict) + assert isinstance(out_indices, np.ndarray) + np.testing.assert_array_equal(out_indices, [0, 1, 2]) + + +class TestDerivedMapDependency: + """A map's `input_dimension` must describe the array it is built with. + + Three separate failures came from one stale value: a vectorized index applied + to an orthogonal map makes it correlated, but the old dependency was carried + onto the new array anyway. Readers fall back to that field when the shape + alone cannot say, so the wrong axis was believed much later — by a scatter + that filed positions under it, which is why the answer depended on how the + read was partitioned. + """ + + def test_a_vindex_over_a_fancy_view_is_marked_correlated(self) -> None: + base = np.arange(6) + view = ( + LazyArray(base) + .lazy.oindex[np.array([0, 1])] + .lazy.vindex[np.array([[0, 1, 0], [1, 0, 1]])] + ) + np.testing.assert_array_equal( + np.asarray(view.result()), base[[0, 1]][[[0, 1, 0], [1, 0, 1]]] + ) + + def test_the_same_view_resolves_alike_however_it_is_partitioned(self) -> None: + base = np.arange(36).reshape(6, 6) + + def build(array: LazyArray) -> LazyArray: + return array.lazy.oindex[np.array([-3, -6, -4]), -4].lazy.vindex[np.array([[-2, -3]])] + + unpartitioned = np.asarray(build(LazyArray(base)).result()) + partitioned = np.asarray(build(LazyArray(base).with_parts((3, 3))).result()) + np.testing.assert_array_equal(partitioned, unpartitioned) + np.testing.assert_array_equal(unpartitioned, np.array([[2, 20]])) + + def test_dependency_axes_are_read_from_the_shape(self) -> None: + """What a map varies over is its non-singleton axes — nothing else. + + The retired `input_dimension` field could contradict the array it rode + on; the shape cannot. + """ + t = IndexTransform( + domain=IndexDomain.from_shape((2, 3)), + output=( + ArrayMap(index_array=np.array([[0, 1, 2]], dtype=np.intp)), + ArrayMap(index_array=np.array([[0], [1]], dtype=np.intp)), + ), + ) + assert t.index_array_structure == "orthogonal" + + +def test_an_orthogonal_step_over_a_correlated_view_is_an_outer_product() -> None: + """`oindex` after `vindex` means the outer product, not a joint gather. + + The reindexing applied its index tuple positionally, which is NumPy's + *vectorized* rule, so two arrays collapsed into one axis and the result came + back a rank short of what was asked for. + """ + base = np.arange(14).reshape(7, 2) + view = LazyArray(base).lazy.vindex[ + np.array([[5, 5], [1, 2], [0, 4]]), np.array([[1, 1], [1, 0], [1, 0]]) + ] + result = np.asarray(view.lazy.oindex[np.array([1, 1, 0]), np.array([1, 1, 0, 1])].result()) + assert result.shape == (3, 4) + np.testing.assert_array_equal(result, np.array([[4, 4, 3, 4], [4, 4, 3, 4], [11, 11, 11, 11]])) + + +@pytest.mark.parametrize( + ("value", "description"), + [(1, "one below the lower bound"), (10, "the exclusive upper bound itself")], +) +def test_an_index_array_value_just_outside_the_domain_is_refused( + value: int, description: str +) -> None: + """The bound checks are probed at the boundary, not comfortably past it. + + Both were only ever exercised from well outside the domain, so relaxing + either by one — `lo - 1` instead of `lo` — went unnoticed while letting a + view read a cell it does not address. + """ + transform = IndexTransform.from_shape((12,))[2:10] + with pytest.raises(BoundsCheckError, match="out of bounds"): + transform.oindex[np.array([value, 3])] + + +def test_an_index_array_value_at_each_end_of_the_domain_is_accepted() -> None: + """The other side of the same boundary: the extremes themselves are in range.""" + transform = IndexTransform.from_shape((12,))[2:10] + array_map = transform.oindex[np.array([2, 9])].output[0] + assert isinstance(array_map, ArrayMap) + np.testing.assert_array_equal(array_map.index_array, np.array([2, 9])) + + +# --------------------------------------------------------------------------- +# Intersecting diagonal gathers +# --------------------------------------------------------------------------- + + +def test_intersecting_a_diagonal_gather_keeps_points_inside_the_domain() -> None: + """Index arrays sharing an input axis intersect pointwise, like vindex.""" + rows = np.array([4, 0, 2]) + cols = np.array([1, 5, 2]) + transform = IndexTransform( + domain=IndexDomain.from_shape((3,)), + output=( + ArrayMap(index_array=rows), + ArrayMap(index_array=cols), + ), + ) + + result = transform.intersect(IndexDomain(inclusive_min=(0, 0), exclusive_max=(3, 3))) + assert result is not None + restricted, survivors = result + # Only the point (2, 2) has both coordinates inside [0, 3) x [0, 3). + assert restricted.domain.shape == (1,) + assert isinstance(survivors, np.ndarray) + np.testing.assert_array_equal(survivors, [2]) + np.testing.assert_array_equal(restricted.apply((0,)), (2, 2)) + + assert transform.intersect(IndexDomain(inclusive_min=(0, 0), exclusive_max=(1, 1))) is None + + +def test_index_array_structure_classifies_the_three_shapes() -> None: + base = IndexTransform.from_shape((4, 6)) + assert (base[1:, ::2]).index_array_structure == "none" + assert (base.oindex[np.array([0, 2]), slice(None)]).index_array_structure == "orthogonal" + assert (base.vindex[np.array([0, 2]), np.array([1, 3])]).index_array_structure == "general" + diagonal = IndexTransform( + domain=IndexDomain.from_shape((2,)), + output=( + ArrayMap(index_array=np.array([0, 1])), + ArrayMap(index_array=np.array([2, 3])), + ), + ) + assert diagonal.index_array_structure == "general" diff --git a/packages/zarr-indexing/uv.lock b/packages/zarr-indexing/uv.lock new file mode 100644 index 0000000000..2687ba71d8 --- /dev/null +++ b/packages/zarr-indexing/uv.lock @@ -0,0 +1,769 @@ +version = 1 +revision = 3 +requires-python = ">=3.12" + +[[package]] +name = "babel" +version = "2.18.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/b2/51899539b6ceeeb420d40ed3cd4b7a40519404f9baf3d4ac99dc413a834b/babel-2.18.0.tar.gz", hash = "sha256:b80b99a14bd085fcacfa15c9165f651fbb3406e66cc603abf11c5750937c992d", size = 9959554, upload-time = "2026-02-01T12:30:56.078Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/f5/21d2de20e8b8b0408f0681956ca2c69f1320a3848ac50e6e7f39c6159675/babel-2.18.0-py3-none-any.whl", hash = "sha256:e2b422b277c2b9a9630c1d7903c2a00d0830c409c59ac8cae9081c92f1aeba35", size = 10196845, upload-time = "2026-02-01T12:30:53.445Z" }, +] + +[[package]] +name = "backrefs" +version = "8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ec/56/4744bcd0c82184e80c52b0ac4076c261a8ffa1f1b343ff2f6e89ce0e1cef/backrefs-8.0.tar.gz", hash = "sha256:b556cd7d36c3a3a2f256b89590b176b8eddfb73bcfaee3a3ddd84ea66d21ce50", size = 7013081, upload-time = "2026-07-26T19:54:24.638Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e3/fd/9bf53b6a6f6f519ffaac765df2f2a25e5c2fc6d32cfd2b2747099e72c911/backrefs-8.0-py310-none-any.whl", hash = "sha256:4a627b817fd2dce43b79ab48da63613340509381cd8ce0897078a0bce79a2ab8", size = 380377, upload-time = "2026-07-26T19:54:17.457Z" }, + { url = "https://files.pythonhosted.org/packages/e1/29/4bd7ae72a2634da00379c2b3bcc5439e7c94620235c6afea8af15229a973/backrefs-8.0-py311-none-any.whl", hash = "sha256:f0c35cf0102ba6b6070c12a492be3c1c1d3f5839529784b9a9565d6d04569a01", size = 392169, upload-time = "2026-07-26T19:54:18.782Z" }, + { url = "https://files.pythonhosted.org/packages/29/13/232505664e8e2a0c7a2eb0c505cfade9d715538f89a5d62bc4c272968f62/backrefs-8.0-py312-none-any.whl", hash = "sha256:87f0fae8c5f207fe9f4b2887efc71d42f4900ac78faa1af08d675ef303692dc5", size = 398084, upload-time = "2026-07-26T19:54:19.954Z" }, + { url = "https://files.pythonhosted.org/packages/8a/69/47a3dc20abc4fa5486655fde681bd55e63211b46c886d8c02223d6468431/backrefs-8.0-py313-none-any.whl", hash = "sha256:601ce68ca12385dbda06ce264406b4c4210cf5b79fd0fd627592365c92f29a88", size = 400040, upload-time = "2026-07-26T19:54:21.194Z" }, + { url = "https://files.pythonhosted.org/packages/1c/cf/e5f9b68a5b0e939a2fb933a66c20180d0c9241bf8927f7a47fa48c1675e9/backrefs-8.0-py314-none-any.whl", hash = "sha256:9ec96efa080938be92323e8e730e57718c9c88eb15ad70bbef4e1766df591408", size = 411903, upload-time = "2026-07-26T19:54:23.221Z" }, +] + +[[package]] +name = "certifi" +version = "2026.7.22" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" }, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bd/2a/23f34ec9d04624958e137efdc394888716353190e75f25dd22c7a2c7a8aa/charset_normalizer-3.4.9.tar.gz", hash = "sha256:673611bbd43f0810bec0b0f028ddeaaa501190339cac411f347ac76917c3ae7b", size = 152439, upload-time = "2026-07-07T14:34:58.454Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/70/4a/ecbd131485c07fcdfad54e28946d513e3da22ef3b4bd854dcafae54ec739/charset_normalizer-3.4.9-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:45b0cc4e3556cd875e09102988d1ab8356c998b596c9fced84547c8138b487a0", size = 319300, upload-time = "2026-07-07T14:33:15.666Z" }, + { url = "https://files.pythonhosted.org/packages/ec/96/5d9364e3342d69f3a045e1777bc47c85c383e6e9466d561b33fdb419d1f9/charset_normalizer-3.4.9-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9b2aff1c7b3884512b9512c3eaadd9bab39fb45042ffaaa1dd08ff2b9f8109d9", size = 215802, upload-time = "2026-07-07T14:33:17.031Z" }, + { url = "https://files.pythonhosted.org/packages/4b/4c/5361f9aa7f2cb58d94f2ab831b3d493f69efb1d239654b4744e3c09527cb/charset_normalizer-3.4.9-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9104ed0bd76a429d46f9ec0dbc9b08ad1d2dcdf2b00a5a0daa1c145329b35b44", size = 237171, upload-time = "2026-07-07T14:33:18.576Z" }, + { url = "https://files.pythonhosted.org/packages/50/78/ce342ca4ff30b2eb49fe6d9578df85974f90c67d294113e94efdd9664cbd/charset_normalizer-3.4.9-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7b86a2b16095d250c6f58b3d9b2eee6f4147754344f3dab0922f7c9bf7d226c9", size = 233075, upload-time = "2026-07-07T14:33:20.084Z" }, + { url = "https://files.pythonhosted.org/packages/01/c4/4fa4c8b3097a11f3c5f09a35b72ed6855fb1d332469504962ab7bafcc702/charset_normalizer-3.4.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e226f6218febc71f6c1fc2fafb91c226f75bdc1d8fb12d66823716e891608fd", size = 224256, upload-time = "2026-07-07T14:33:21.747Z" }, + { url = "https://files.pythonhosted.org/packages/87/3a/ad914516df7e358a81aae018caa5e0470ba827fa6d763b1d2e87d920a5f6/charset_normalizer-3.4.9-cp312-cp312-manylinux_2_31_armv7l.whl", hash = "sha256:90c44bc373b7687f6948b693cceaea1348ae0975d7474746559494468e3c1d84", size = 208784, upload-time = "2026-07-07T14:33:23.313Z" }, + { url = "https://files.pythonhosted.org/packages/d7/74/3c12f9755717dfe5c5c87da63f35d765fa0c00382ec26bf23f7fae34f2ba/charset_normalizer-3.4.9-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9cdef90ae47919cae358d8ab15797a800ed41da7aba5d72419fb510729e2ed4b", size = 219928, upload-time = "2026-07-07T14:33:24.814Z" }, + { url = "https://files.pythonhosted.org/packages/33/9a/895095b83e7907abd6d3d99aad3a38ad0d9686cc186cb0c94c24320fe63e/charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:60f44ade2cf573dad7a277e6f8ca9a51a21dda572b13bd7d8539bb3cd5dbedde", size = 218489, upload-time = "2026-07-07T14:33:26.42Z" }, + { url = "https://files.pythonhosted.org/packages/a1/34/ef5c05f412f42520d7709b7d3784d19640839eb7366ded1755511585429f/charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:a1786910334ed46ab1dd73222f2cd1e05c2c3bb39f6dddb4f8b36fc382058a39", size = 210267, upload-time = "2026-07-07T14:33:27.952Z" }, + { url = "https://files.pythonhosted.org/packages/83/dc/9b29fa4412b318bf3bfea985c35d67eb55e04b59a7c3f2237168b0e0be6f/charset_normalizer-3.4.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:03d07803992c6c7bbc976327f34b18b6160327fc81cb82c9d504720ac0be3b62", size = 226030, upload-time = "2026-07-07T14:33:29.397Z" }, + { url = "https://files.pythonhosted.org/packages/0e/42/6dbc00b8cd16011691203e33570fa42ed5746599a2e878112d16eab403a3/charset_normalizer-3.4.9-cp312-cp312-win32.whl", hash = "sha256:78841cccf1af7b40f6f716338d50c0902dbe88d9f800b3c973b7a9a0a693a642", size = 151185, upload-time = "2026-07-07T14:33:30.781Z" }, + { url = "https://files.pythonhosted.org/packages/80/cc/f920afd1a23c58ccd53c1d36085a71893a4737ff5e66e0371efab6809850/charset_normalizer-3.4.9-cp312-cp312-win_amd64.whl", hash = "sha256:4b3dac63058cc36820b0dd072f89898604e2d39686fe05321729d00d8ac185a0", size = 162557, upload-time = "2026-07-07T14:33:32.176Z" }, + { url = "https://files.pythonhosted.org/packages/f0/e6/0386d43a261ff4e4b30c5857af7df877254b46bec7b9d1b74b6bf969a90b/charset_normalizer-3.4.9-cp312-cp312-win_arm64.whl", hash = "sha256:78fa18e436a1a0e58dbd7e02fc4473f3f32cceb12df9dfca542d075961c307d2", size = 152665, upload-time = "2026-07-07T14:33:33.711Z" }, + { url = "https://files.pythonhosted.org/packages/b2/06/97ec2aeae780b31d742b6352218b43841a6871e2564578ca522dce4a45c3/charset_normalizer-3.4.9-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:440eede837960000d74978f0eba527be106b5b9aee0daf779d395276ed0b0614", size = 317688, upload-time = "2026-07-07T14:33:35.408Z" }, + { url = "https://files.pythonhosted.org/packages/d0/39/8ff066c672434225f8d25f8b739f992af250944392173dcc88362681c9bf/charset_normalizer-3.4.9-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:21e764fd1e70b6a3e205a0e46f3051701f98a8cb3fad66eeb80e48bb502f8698", size = 214982, upload-time = "2026-07-07T14:33:36.996Z" }, + { url = "https://files.pythonhosted.org/packages/92/8f/3a47a3667c83c2df9483d91644c6c107de3bf8874aa1793da9d3012eb986/charset_normalizer-3.4.9-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e4fd89cc178bced6ad29cb3e6dd4aa63fa5017c3524dbd0b25998fb64a87cc8b", size = 236460, upload-time = "2026-07-07T14:33:38.536Z" }, + { url = "https://files.pythonhosted.org/packages/f1/60/b22cdbee7e4013dab8b0d7647fc6181120fbbbc8f7025c226d15bd5a47fc/charset_normalizer-3.4.9-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:bd47ba7fc3ca94896759ea0109775132d3e7ab921fbf54038e1bab2e46c313c9", size = 232003, upload-time = "2026-07-07T14:33:40.059Z" }, + { url = "https://files.pythonhosted.org/packages/ea/f8/72eb13dcabe7257035cea8aefd922caad2f110d252bf9f67c4c2ca763aee/charset_normalizer-3.4.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:84fd18bcc17526fc2b3c1af7d2b9217d32c9c04448c16ec693b9b4f1985c3d33", size = 223149, upload-time = "2026-07-07T14:33:41.631Z" }, + { url = "https://files.pythonhosted.org/packages/b0/3e/faee8f9de92b14ee1198e9163252bb15efee7301b31256a3b6d9ebfdd0dd/charset_normalizer-3.4.9-cp313-cp313-manylinux_2_31_armv7l.whl", hash = "sha256:5b10cd92fc5c498b35a8635df6d5a100207f88b63a4dc1de7ef9a548e1e2cd63", size = 207901, upload-time = "2026-07-07T14:33:43.209Z" }, + { url = "https://files.pythonhosted.org/packages/3a/25/45f30093ae27dd7b92a793b61882a38685f993700113ca36e0c9c14965e1/charset_normalizer-3.4.9-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a4fbdde9dd4a9ce5fd52c2b3a347bb50cc89483ef783f1cb00d408c13f7a96c0", size = 219176, upload-time = "2026-07-07T14:33:44.725Z" }, + { url = "https://files.pythonhosted.org/packages/48/18/c8f397329c35e32f6a837e488986f4ae03bd2abebc453b48714991630c2f/charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:416c229f77e5ea25b3dfd4b582f8d73d7e43c22320302b9ab128a2d3a0b38efe", size = 217356, upload-time = "2026-07-07T14:33:46.192Z" }, + { url = "https://files.pythonhosted.org/packages/86/7e/5ce0bba863470fd1902d5e5843968951bddf38abe4742fc97116ef4598b3/charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:75286256590a6320cf106a0d28970d3560aad9ee09aa7b34fb40524792436d35", size = 209614, upload-time = "2026-07-07T14:33:47.705Z" }, + { url = "https://files.pythonhosted.org/packages/6c/ef/2473d3c4d869155be4af1191111d59c4d5c4e0173026f7e85b176e23bf65/charset_normalizer-3.4.9-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:69b157c5d3292bcd443faca052f3096f637f1e074b98212a933c074ae23dc3b8", size = 224991, upload-time = "2026-07-07T14:33:49.238Z" }, + { url = "https://files.pythonhosted.org/packages/d0/a3/53ddae3db108a088156aa8ddfafd411ebbc1340f48c5573f697b27f69a39/charset_normalizer-3.4.9-cp313-cp313-win32.whl", hash = "sha256:51307f5c71007673a2bf8232ad973483d281e74cb99c8c5a990af1eefa6277d9", size = 150622, upload-time = "2026-07-07T14:33:50.711Z" }, + { url = "https://files.pythonhosted.org/packages/e8/ef/6953a77c7cf2c2ff9998e6f575ab3e380119f100223381565a4f94c1f836/charset_normalizer-3.4.9-cp313-cp313-win_amd64.whl", hash = "sha256:fe2c7201c642b7c308f1675355ad7ff7b66acfe3541625efe5a3ad38f29d6115", size = 161947, upload-time = "2026-07-07T14:33:52.197Z" }, + { url = "https://files.pythonhosted.org/packages/6e/fb/d560d1d1555debbfe7849d9cac6145c1b537709d79576bf22557ed803b82/charset_normalizer-3.4.9-cp313-cp313-win_arm64.whl", hash = "sha256:611057cc5d5c0afc743ba8be6bd828c17e0aaa8643f9d0a9b9bb7dea80eb8012", size = 152594, upload-time = "2026-07-07T14:33:53.486Z" }, + { url = "https://files.pythonhosted.org/packages/7e/8d/496817fa0944239ecae662dd57ea765cfeaec6a735f9f025d4b7b72e7143/charset_normalizer-3.4.9-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:0327fcd59a935777d83410750c50600ee9571af2846f71ce40f25b13da1ef380", size = 317253, upload-time = "2026-07-07T14:33:54.994Z" }, + { url = "https://files.pythonhosted.org/packages/2b/f9/ef4a69ea338ad3c0deceea0f5f7d2380ae8b52132b06d652cb0d2cd86706/charset_normalizer-3.4.9-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8a79d9f4d8001473a30c163556b3c3bfebec837495a412dde78b51672f6134f9", size = 215898, upload-time = "2026-07-07T14:33:56.334Z" }, + { url = "https://files.pythonhosted.org/packages/8c/e7/5ddfd76fc061eb52de219658a4aa431cbacadf0a0219c8854f00da50d289/charset_normalizer-3.4.9-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:33bdcc2a32c0a0e861f60841a512c8acc658c87c2ac59d89e3a46dacf7d866e4", size = 236718, upload-time = "2026-07-07T14:33:57.9Z" }, + { url = "https://files.pythonhosted.org/packages/49/ba/768fa3f36048d81c477a0ce61f813bc1454d80917ccfe550abd9f44f5e24/charset_normalizer-3.4.9-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f840ed6d8ecba8255df8c42b87fadeda98ddfc6eeec05e2dc66e26d46dd6f58a", size = 232519, upload-time = "2026-07-07T14:33:59.811Z" }, + { url = "https://files.pythonhosted.org/packages/f4/c4/b3e049d2aa3766180c78507110543d9d50894cc97f57de543f1be521dcdc/charset_normalizer-3.4.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c25fe15c70c59eb7c5ce8c06a1f3fa1da0ecc5ea1e7a5922c40fd2fa9b0d5046", size = 223143, upload-time = "2026-07-07T14:34:01.517Z" }, + { url = "https://files.pythonhosted.org/packages/19/79/55c32d06d76ae4feafe053f061f3e3ab70bcf19f4007797ce8c3efda7830/charset_normalizer-3.4.9-cp314-cp314-manylinux_2_31_armv7l.whl", hash = "sha256:f7fb7d750cfa0a070d2c24e831fd3481019a60dd317ea2b39acbcebc08b6ed81", size = 206742, upload-time = "2026-07-07T14:34:03.04Z" }, + { url = "https://files.pythonhosted.org/packages/10/e0/47c079dd82d217c807479cd59ffd30af56307ea31c108b75758970459ad3/charset_normalizer-3.4.9-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4d1c96a7a18b9690a4d46df09e3e3382406ae3213727cd1019ebade1c4a81917", size = 219191, upload-time = "2026-07-07T14:34:04.657Z" }, + { url = "https://files.pythonhosted.org/packages/42/ab/b9bc2e77d6b44a7e46ef62ec5cac1c9a6ba7b9135a5d560f002696ec9995/charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a4cfde78a9f2880208d16a93b795726a3017d5977e08d1e162a7a31322479c41", size = 218328, upload-time = "2026-07-07T14:34:06.115Z" }, + { url = "https://files.pythonhosted.org/packages/f1/78/c9c71d599f5aa2d42bcdd35cbbd46d7f535351a57e40ff7d8e5a7e219401/charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:d4d6fcde76f94f5cb9e43e9e9a61f16dacefd228cbbf6f1a09bd9b219a92f1a1", size = 207406, upload-time = "2026-07-07T14:34:07.554Z" }, + { url = "https://files.pythonhosted.org/packages/f6/39/c914445c321a845097ce4f6ac7de9a18228a77b766272125a1ce00d851eb/charset_normalizer-3.4.9-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:898f0e9068ca27d37f8e83a5b962821df851532e6c4a7d615c1c033f9da6eedf", size = 225157, upload-time = "2026-07-07T14:34:09.061Z" }, + { url = "https://files.pythonhosted.org/packages/9b/f2/c0d4b8508565a36bc5c624e88ed297f5b0b1095011034d7f5b83a69908b5/charset_normalizer-3.4.9-cp314-cp314-win32.whl", hash = "sha256:c1c948747b03be832dceed96ca815cef7360de9aa19d37c730f8e3f6101aca48", size = 151095, upload-time = "2026-07-07T14:34:10.901Z" }, + { url = "https://files.pythonhosted.org/packages/49/fd/a1d26144398c67486422a72bf5812cda22cb4ccfcd95a290fb41ceb4b8e2/charset_normalizer-3.4.9-cp314-cp314-win_amd64.whl", hash = "sha256:16b65ea0f2465b6fb52aa22de5eca612aa964ddfec00a912e26f4656cbef890b", size = 162796, upload-time = "2026-07-07T14:34:12.47Z" }, + { url = "https://files.pythonhosted.org/packages/20/95/d75e82f8ce9fd323ebf059c16c9aadefb22a1ecde13b7840b35835e4886c/charset_normalizer-3.4.9-cp314-cp314-win_arm64.whl", hash = "sha256:40a126142a56b2dfc0aacbad1de8310cbf60da7656db0e6b16eebd48e3e93519", size = 153334, upload-time = "2026-07-07T14:34:14.044Z" }, + { url = "https://files.pythonhosted.org/packages/00/5e/17398df3a139985ba9d11ed072531986f408c8fca952835ef1ab1820c02b/charset_normalizer-3.4.9-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:609b3ba8fcc0fb5ab7af00719d0fb6ad0cb518e48e7712d12fd68f1327951198", size = 338848, upload-time = "2026-07-07T14:34:15.688Z" }, + { url = "https://files.pythonhosted.org/packages/cd/91/7253a32e86b7e1d1239b1b36ba6dd0f021a21107ab33054b53119cc083b9/charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:51447e9aa2684679af07ca5021c3db526e0284347ebf4ffcec1154c3350cfe32", size = 223022, upload-time = "2026-07-07T14:34:17.248Z" }, + { url = "https://files.pythonhosted.org/packages/cb/32/2e64bd2be10e89c61e57ebe6a93fd98ae88eb7ebe414b5121f22c96c69eb/charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cc1b0fff8ead343dae06305f954eb8468ba0ec1a97881f42489d198e4ce3c632", size = 241590, upload-time = "2026-07-07T14:34:18.813Z" }, + { url = "https://files.pythonhosted.org/packages/3d/ef/d96ec496cfea0c21db43b0ad03891308b02388d054cc902cf0e5a1ad6a88/charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fa36ec09ef71d158186bc79e359ff5fdd6e7996fe8ab638f00d6b93139ba4fcf", size = 239584, upload-time = "2026-07-07T14:34:20.52Z" }, + { url = "https://files.pythonhosted.org/packages/d4/ce/9af95f7876194bd7a14e3dfe4a4de2e0bff02666a3910d72beafd06cc297/charset_normalizer-3.4.9-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:df115d4d83168fdf2cae48ef1ff6d1cb4c466364e30861b37121de0f3bf1b990", size = 230224, upload-time = "2026-07-07T14:34:22.189Z" }, + { url = "https://files.pythonhosted.org/packages/52/94/af74dde74a3996bd959c350709bfe50e297823d70a8c1cbd54b838880863/charset_normalizer-3.4.9-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:f86c6358749bd4fda175388691e3ba8c46e24c5347d0afd20f9b7edfc9faf07d", size = 212667, upload-time = "2026-07-07T14:34:23.857Z" }, + { url = "https://files.pythonhosted.org/packages/ee/f0/f1c4fe746c395922961b5916ed1d7d6e7d4c84851d19ed43cc89980ec953/charset_normalizer-3.4.9-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:32286a2c8d167e897177b673176c1e3e00d4057caf5d2b64eef9a3666b03018e", size = 227179, upload-time = "2026-07-07T14:34:25.586Z" }, + { url = "https://files.pythonhosted.org/packages/e4/56/6c745619ac397e8871e2bcd3cea1eec86b877488f33888b3aef5c3ed506e/charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:83aed2c10721ddd90f68140685391b50811a880af20654c59af6b6c66c40513c", size = 225372, upload-time = "2026-07-07T14:34:27.212Z" }, + { url = "https://files.pythonhosted.org/packages/78/ad/98aae8630ac71f16711968e38a5acfecce41b778bf2f0312851020f565a8/charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:cd6c3d4b783c556fa00bf540854e42f135e2f256abd29669fcd0da0f2dec79c2", size = 215222, upload-time = "2026-07-07T14:34:28.774Z" }, + { url = "https://files.pythonhosted.org/packages/f7/40/9593d54209765207a7f11073c06494c1721e4ca4a0a426c597679bf7f91e/charset_normalizer-3.4.9-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ee2f2a527e3c1a6e6411eb4209642e138b544a2d72fe5d0d76daf77b24063534", size = 231958, upload-time = "2026-07-07T14:34:30.345Z" }, + { url = "https://files.pythonhosted.org/packages/b1/27/693ee5e8a18191eb38647360c51cd505013e2bd3b366aa43fd5344c21e3c/charset_normalizer-3.4.9-cp314-cp314t-win32.whl", hash = "sha256:0d861473f743244d349b50f850d10eb87aeb22bbdcc8e64f79273c94af5a8226", size = 155580, upload-time = "2026-07-07T14:34:31.884Z" }, + { url = "https://files.pythonhosted.org/packages/80/3f/bd97d3d9c613013d07cb7733d299385b41df37f0471310f5a73dc359f0b8/charset_normalizer-3.4.9-cp314-cp314t-win_amd64.whl", hash = "sha256:9b8e0f3107e2200b76f6054de99016eac3ee6762713587b36baaa7e4bd2ae177", size = 167620, upload-time = "2026-07-07T14:34:33.438Z" }, + { url = "https://files.pythonhosted.org/packages/3d/c6/eee9dca4439b1061f76373f06ea855678cc4a64c1c3c90b50e479edbb8eb/charset_normalizer-3.4.9-cp314-cp314t-win_arm64.whl", hash = "sha256:19ac87f93086ce37b86e098888555c4b4bc48102279bae3350098c0ed664b501", size = 158037, upload-time = "2026-07-07T14:34:35.018Z" }, + { url = "https://files.pythonhosted.org/packages/98/2b/f97f1c193fb855c345d678f5077d6926034db0722df74c8f057020e05a25/charset_normalizer-3.4.9-py3-none-any.whl", hash = "sha256:68e5f26a1ad57ded6d1cfb85331d1c1a195314756471d97758c48498bb4dcdf5", size = 64538, upload-time = "2026-07-07T14:34:56.993Z" }, +] + +[[package]] +name = "click" +version = "8.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/76/d4/81420972a676e8ffea40450d8c8c92943e7218a78fe9b64359836cc9876b/click-8.4.2.tar.gz", hash = "sha256:9a6cea6e60b17ebe0a44c5cc636d94f09bd66142c1cd7d8b4cd731c4917a15f6", size = 338000, upload-time = "2026-06-24T17:45:15.148Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/e2/79c688af8b210d232694e31e59da9f6ec747bae31c3f5946e4e9b98860d5/click-8.4.2-py3-none-any.whl", hash = "sha256:e6f9f66136c816745b9d65817da91d61d957fb16e02e4dcd0552553c5a197b76", size = 119243, upload-time = "2026-06-24T17:45:13.73Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "ghp-import" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "python-dateutil" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d9/29/d40217cbe2f6b1359e00c6c307bb3fc876ba74068cbab3dde77f03ca0dc4/ghp-import-2.1.0.tar.gz", hash = "sha256:9c535c4c61193c2df8871222567d7fd7e5014d835f97dc7b7439069e2413d343", size = 10943, upload-time = "2022-05-02T15:47:16.11Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f7/ec/67fbef5d497f86283db54c22eec6f6140243aae73265799baaaa19cd17fb/ghp_import-2.1.0-py3-none-any.whl", hash = "sha256:8337dd7b50877f163d4c0289bc1f1c7f127550241988d568c1db512c4324a619", size = 11034, upload-time = "2022-05-02T15:47:14.552Z" }, +] + +[[package]] +name = "griffe-inherited-docstrings" +version = "1.1.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "griffelib" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cb/da/fd002dc5f215cd896bfccaebe8b4aa1cdeed8ea1d9d60633685bd61ff933/griffe_inherited_docstrings-1.1.3.tar.gz", hash = "sha256:cd1f937ec9336a790e5425e7f9b92f5a5ab17f292ba86917f1c681c0704cb64e", size = 26738, upload-time = "2026-02-21T09:38:44.312Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/16/20/4bc15f242181daad1c104e0a7d33be49e712461ea89e548152be0365b9ea/griffe_inherited_docstrings-1.1.3-py3-none-any.whl", hash = "sha256:aa7f6e624515c50d9325a5cfdf4b2acac547f1889aca89092d5da7278f739695", size = 6710, upload-time = "2026-02-20T11:06:38.75Z" }, +] + +[[package]] +name = "griffelib" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/33/e4/8d187ea29c2e30b3a09505c567513077d6117861bde1fbd997a167f262ec/griffelib-2.1.0.tar.gz", hash = "sha256:762a186d2c6fd6794d4ea20d428d597ffb857cb56b66421651cbba15bdd5e813", size = 216234, upload-time = "2026-06-19T12:05:42.278Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e4/d3/5268aeabf2ad82658c4e2ff3a060648d0f02f3926cb53247c0e4d0dab49e/griffelib-2.1.0-py3-none-any.whl", hash = "sha256:cc7b3d2d2865ad0b909fcc38086e3f554b5ea7acbaa7bbb7ecaa3f5dfb7d9f00", size = 142560, upload-time = "2026-06-19T12:05:38.742Z" }, +] + +[[package]] +name = "hypothesis" +version = "6.164.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "sortedcontainers" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7a/ac/7b76103bd74d8457e4de0c6a6c3a26ac6327016438bde125e0a3de83a5b8/hypothesis-6.164.0.tar.gz", hash = "sha256:5d63d263d8c71b571638c18d9591f6e34b836c60a12469e9d9105c1c785f00f1", size = 492022, upload-time = "2026-07-30T12:39:49.085Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7c/fe/d5b75a55892b33e72945f82efc71f645d29c0bfdb9f00727f7535a52edcc/hypothesis-6.164.0-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:14b861ac3353f8643b82a3ba76b8a0a54d2a06160c32b9a1f64a8ab41b179089", size = 771561, upload-time = "2026-07-30T12:39:00.404Z" }, + { url = "https://files.pythonhosted.org/packages/1c/b0/2f01e9efc7267446bad0e2a68f7472daa174a72553d213b16aefe44b2bda/hypothesis-6.164.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:3d8c8bb00a4b86ae90b9ad41f3e1c99d016ec3e64c0ff9d676a4bb7be4f56948", size = 767079, upload-time = "2026-07-30T12:39:23.123Z" }, + { url = "https://files.pythonhosted.org/packages/c3/26/d7bcd26b58e1df2bd39116b924b2a72676215d9650e68cbff9a629c3ce30/hypothesis-6.164.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e80e3ba8eaf37664eaa0f2625cef120b330b128a7df570210cf8be4f5ae65aaa", size = 1096364, upload-time = "2026-07-30T12:38:49.972Z" }, + { url = "https://files.pythonhosted.org/packages/9d/17/99fe7ea866935da83444c3ef7885a14fc7349d96ff61c6faebd37ef4edf2/hypothesis-6.164.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8cdf70f821e2d2f3a0bccaab29830aea8aefb63a77806e7e91246fb65a10c8d3", size = 1124963, upload-time = "2026-07-30T12:39:13.1Z" }, + { url = "https://files.pythonhosted.org/packages/38/e8/df08be6296cbc1271d44e81f8ff9dcd6267a07552fb768e0fdc166e93d40/hypothesis-6.164.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bcc3743e22b3cffa7267b4bc74d03628606e4a115495728e986a7be220987315", size = 1145886, upload-time = "2026-07-30T12:39:45.612Z" }, + { url = "https://files.pythonhosted.org/packages/4e/72/d5cf6fbfac40891d4281f630e16a6eb217ff56f97e350a06e0fd9322aa6a/hypothesis-6.164.0-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:730f09d4afcd8a918b3d589bfb6421e3b41c057aa57652a773ef4f512cc60836", size = 1101181, upload-time = "2026-07-30T12:39:05.194Z" }, + { url = "https://files.pythonhosted.org/packages/fb/ff/7ceb002329febffb678b65835ca6e9479a916325d088aadb0210d07f8252/hypothesis-6.164.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9651cb48cb5a995295b442138d15d381547b935dcb0066fca7148a7955347400", size = 1137970, upload-time = "2026-07-30T12:39:16.076Z" }, + { url = "https://files.pythonhosted.org/packages/7c/8f/c12c697b73ca9ca24d8a913879e3e0a9db86479754c7221554247c701565/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:51d161d2655dd86143b370c577267b5b7b4c2e8fcb8a3f22c1a787572aad707c", size = 1270184, upload-time = "2026-07-30T12:38:54.436Z" }, + { url = "https://files.pythonhosted.org/packages/0e/2f/93f1c850c794fc9c80f5e61b3b20652126b865e6f57b348ae530446aadc7/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:e8a250552390128b57e3afe55035ce2c2cb1f6f0919817657854244f071bc5be", size = 1397987, upload-time = "2026-07-30T12:38:21.113Z" }, + { url = "https://files.pythonhosted.org/packages/c5/b8/bab2546325e15e87c8518dfbca263c81dbc35d566c516d66c9da98a38b77/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:570cd51944e1cc3443847d8afa3d17fcf8aac475a1f744c9e7318a5ad7ef5c9f", size = 1270755, upload-time = "2026-07-30T12:38:51.571Z" }, + { url = "https://files.pythonhosted.org/packages/6a/4e/ea97dd39678a42dc5a24e3e2a64d3b950fad9fb1dcce8d7be5afb52a0335/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3a423e543055b3de5af7a7624c4285422541658367211fa293a3a57dd0ad01ba", size = 1312888, upload-time = "2026-07-30T12:38:30.847Z" }, + { url = "https://files.pythonhosted.org/packages/44/84/a6f2d5b12b23d65f16eb398750e430065f9d1f40f4418569e3b87ef58d23/hypothesis-6.164.0-cp310-abi3-win32.whl", hash = "sha256:f5e51490b2ce64c66138f24477d83c71b6224ab0ef65700da10187c464b54e94", size = 657401, upload-time = "2026-07-30T12:39:11.581Z" }, + { url = "https://files.pythonhosted.org/packages/f5/d3/c5ee410daa594cac2d3fe1fbe5473f2390e35f4369e168a817e43341ce2f/hypothesis-6.164.0-cp310-abi3-win_amd64.whl", hash = "sha256:c9059dfbb039342b6590bbce207f90e0f9a80fdf45a404c68c2d3e598be78ab3", size = 663566, upload-time = "2026-07-30T12:39:30.27Z" }, + { url = "https://files.pythonhosted.org/packages/90/91/4942fe3f2f08b920368ed5a2937346259e843e382205513b4a0e70d2de9d/hypothesis-6.164.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:6bc3373fe550cf4d7cadb94ceaeb91e431e1418a96b7baa330487366eaa67d3c", size = 773152, upload-time = "2026-07-30T12:38:33.328Z" }, + { url = "https://files.pythonhosted.org/packages/eb/df/e66d052386a2b6c3e2f3eab32a02d7de3c9c59cd21d5dd58c08ecfa715f0/hypothesis-6.164.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2780297ca68929b153eff7effb2ebe67e9487d2fd9f49fa961007f8f2d236c9e", size = 764713, upload-time = "2026-07-30T12:38:48.59Z" }, + { url = "https://files.pythonhosted.org/packages/f5/d5/5a50d14b8f04809e973c4dea884b367fef3663ff253c1205fa9e96229ef9/hypothesis-6.164.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b400bb4eb5a4a1e19cd5af3cc63817909e6b54b4603e04022bdba46860913d7", size = 1095160, upload-time = "2026-07-30T12:38:58.925Z" }, + { url = "https://files.pythonhosted.org/packages/58/01/781b19ce4382ec239c4dc6ec3bd9f195e69e5570f2814bbf04b5781ecb18/hypothesis-6.164.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fca6632933fc506dd96926d9383483e4c0066c7ff62c748d059a3276da761e7", size = 1145199, upload-time = "2026-07-30T12:39:09.904Z" }, + { url = "https://files.pythonhosted.org/packages/e9/64/30e016863515ca01c1c738b05dd50491353d3ccae6432362e56e0c15d0da/hypothesis-6.164.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b9e1f6e89e5ec34735b727f3ce41d12e7f3b8efc162c91c8a225e10b54b504b4", size = 1267980, upload-time = "2026-07-30T12:38:18.733Z" }, + { url = "https://files.pythonhosted.org/packages/84/23/17eb8d67d59ecd3a820c905fbdf514e371dd7d01631e62a304cdd5793abe/hypothesis-6.164.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:51b0f967f608707b24ed37a298174ae6eec7899bfe3f271d1c3062c39ad66c06", size = 1312181, upload-time = "2026-07-30T12:38:36.056Z" }, + { url = "https://files.pythonhosted.org/packages/42/69/cff9f3cd9524252adda7c8e0e129dfc176e72f64fdf0bf1552d1ea43d78d/hypothesis-6.164.0-cp312-cp312-win_amd64.whl", hash = "sha256:5770df7d518bf867a9379e9081abd9e44db1d15473430e26a0946438c08c5926", size = 660690, upload-time = "2026-07-30T12:38:28.107Z" }, + { url = "https://files.pythonhosted.org/packages/ba/b4/729697380a22dc2ce8feae3c64b08bf3bd3c27e99c3706cb9bdac40c6fc8/hypothesis-6.164.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:29e7cb48974cb9fd87602e20625c890385793c6b56c18a957085a9c291f56ef8", size = 773046, upload-time = "2026-07-30T12:39:40.473Z" }, + { url = "https://files.pythonhosted.org/packages/38/35/72374f02d90dfda198afd8aac6b1e7d1184506f97e62ebcf3d2c1e5bf761/hypothesis-6.164.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1ff8c3819345be8dd15ee6588ee9383869a54c9a3d2232cce5e26b456424135d", size = 764659, upload-time = "2026-07-30T12:38:55.896Z" }, + { url = "https://files.pythonhosted.org/packages/6e/75/fb26388915d71e5949b98ccd0c9d95edcbe6b45d0370f177d43633d81ae2/hypothesis-6.164.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:33e88be13fac3ff7cb789a0b4cc43d99fb297db085f529fbb363188141c7d5bf", size = 1095078, upload-time = "2026-07-30T12:38:34.677Z" }, + { url = "https://files.pythonhosted.org/packages/be/63/f6da6e39667d39a1e44c5df82fbe6cff070c29aaffa9beb62a5322e7d8ae/hypothesis-6.164.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2e296d03a77355ce2e1c32e85a636b555edf0ddaaef277f98f1b84fe38a4595", size = 1145015, upload-time = "2026-07-30T12:39:26.487Z" }, + { url = "https://files.pythonhosted.org/packages/88/c7/55ba09727da3d9a60628c50e31e6083a36f403cb230f5e1a7bd1749a5c39/hypothesis-6.164.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:53698a1b246714539dd0ecc2d556cde613d74e9f7385ec4109e0651ab2d382d6", size = 1268027, upload-time = "2026-07-30T12:38:25.676Z" }, + { url = "https://files.pythonhosted.org/packages/ff/35/4789cade332f799b0e8f2f7ea0fe2aae6157a85e60f74497e316dd17a7e3/hypothesis-6.164.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:004c92c4b869f8e258f0641101b7743cae8420436f4465383f681c086ef95c9d", size = 1311895, upload-time = "2026-07-30T12:39:14.621Z" }, + { url = "https://files.pythonhosted.org/packages/12/8a/18d85e624f8631aec42daa8a2f07c6edcedb7385b2c0f375ba8a30cbd065/hypothesis-6.164.0-cp313-cp313-win_amd64.whl", hash = "sha256:4878f81fa92a580d3e16b53e64e01a9d9fe1dca5973783558493a003138dbd36", size = 660656, upload-time = "2026-07-30T12:38:37.696Z" }, + { url = "https://files.pythonhosted.org/packages/c7/06/3c144d427799c7c72befb0bb3b199d419a89b96e1002fd8f0cc94c84ffb7/hypothesis-6.164.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:9110010bdf6deb3ba9134f8ce8b683e8bb0fba108a351045c96d60c410eb6963", size = 773254, upload-time = "2026-07-30T12:38:38.919Z" }, + { url = "https://files.pythonhosted.org/packages/74/2d/b61a10d9e70df04aa7e8f34efef8e4afe364e8995c59f894e1c35b428214/hypothesis-6.164.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4df103e5d32b47d574c6e857d45361e2cba5a198d6dae4e4ee1bd248b3a2cbfa", size = 764786, upload-time = "2026-07-30T12:38:24.464Z" }, + { url = "https://files.pythonhosted.org/packages/99/68/7f80ac7bdffe78686135311c919534be411d4565c2a5ba38fd389880c553/hypothesis-6.164.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4abec95020960c0ed08e5be318d2bcdde79f2c6fc7785e368a9389d31d3e802a", size = 1095578, upload-time = "2026-07-30T12:38:57.422Z" }, + { url = "https://files.pythonhosted.org/packages/45/f9/97dcbac776bcf33cb4241b52111527821f707b60a84d03d0ea670b09a134/hypothesis-6.164.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b106756cc9abd50ab1632541ea7b7223792d877a084726aa0304237d758181e", size = 1145207, upload-time = "2026-07-30T12:38:23.387Z" }, + { url = "https://files.pythonhosted.org/packages/a4/df/68184b6f71540435c895cf35ad1d67a3634a887c597ab38d3372c0d20186/hypothesis-6.164.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:11c4aab2ae6757fc4bc3bbf009487e24fd3490365817bbf40b9ec85a7e02fabb", size = 1268357, upload-time = "2026-07-30T12:38:52.946Z" }, + { url = "https://files.pythonhosted.org/packages/a0/76/6a6851dc8af89a5c0418937d38456417b2a1fc9db15c992b9cb43d53a7a3/hypothesis-6.164.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:4713edecbc0969557ca135769a36d1e524c8e3b7a2b271de48d98fa29f681bf6", size = 1312183, upload-time = "2026-07-30T12:39:28.604Z" }, + { url = "https://files.pythonhosted.org/packages/2f/19/83adeb1f8f045bd8a1ab9822d0c3db28b337d37fff01d809fcd6e3ea70f8/hypothesis-6.164.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:e6882d316c390d33c55ec8f1675f35ab238d7c0473ccf8d235c69eaef6c621b9", size = 604771, upload-time = "2026-07-30T12:39:33.579Z" }, + { url = "https://files.pythonhosted.org/packages/0b/62/fcb48ebfbccdc5b695de175b9d1d344b3688782150f0603124bb70c0891b/hypothesis-6.164.0-cp314-cp314-win_amd64.whl", hash = "sha256:7c3357633b38bca8c927fd90d02b39a0a3f35f24cdbcfb2fb1dcf69a3f63bd85", size = 660570, upload-time = "2026-07-30T12:39:43.898Z" }, + { url = "https://files.pythonhosted.org/packages/42/61/5857da7db0435fa69df658a9eafba62eb8a1319454005ce2a0d97f6f9e4d/hypothesis-6.164.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:53152cb549f52d661c47768d0d12a192ef26a7a9758a7f13b8ec41e8e63d6325", size = 771839, upload-time = "2026-07-30T12:38:26.842Z" }, + { url = "https://files.pythonhosted.org/packages/6c/9c/22292a9dab1c544362d1759244132c7d71a9d9d5eda5d454ec735fba6bd3/hypothesis-6.164.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:cee7898ad84b63da6506ae48483bb36f319a25ea4c2b1d2df47d021cc4080c24", size = 763363, upload-time = "2026-07-30T12:38:20.042Z" }, + { url = "https://files.pythonhosted.org/packages/e8/29/cc0c6e9a065a32f93fe52dde746232f007d2cabf619d4e7b1b37bd34c424/hypothesis-6.164.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0def33f0d236e54144a5218997e4492925144d4615f25fdbb4ac8e47b7b709e6", size = 1094171, upload-time = "2026-07-30T12:39:35.158Z" }, + { url = "https://files.pythonhosted.org/packages/a7/59/37040d0776a29d4bc6d0ca9a50ca2755200007e4a8ddc27b010115b69c85/hypothesis-6.164.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:471fd80d70f2df606b1320276168bc2c6007a586124a1d81628264ccb9266f68", size = 1144089, upload-time = "2026-07-30T12:38:43.024Z" }, + { url = "https://files.pythonhosted.org/packages/fa/10/5235ed3c090a2f12fa15cc1d08e5a36cfa31bc0607c45199b0806e930ab4/hypothesis-6.164.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:2eb285756aee62890fd08d6e97cf77651dfe7c093ceac094df52120a7a8dbe68", size = 1266595, upload-time = "2026-07-30T12:39:36.979Z" }, + { url = "https://files.pythonhosted.org/packages/7f/97/ffc4cee4dfdffe658e839d5f4df72ae3fa7bfea9401550b475d9700e0ee2/hypothesis-6.164.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:7c5215b5568968c35c6e124e5a4a8068f80419d6171414ddf735b49e1df1ab59", size = 1310998, upload-time = "2026-07-30T12:38:45.788Z" }, + { url = "https://files.pythonhosted.org/packages/dd/08/681d4a272cd2812151581c3328e41a80a34e420d676e419a25b4b9dc2291/hypothesis-6.164.0-cp314-cp314t-win_amd64.whl", hash = "sha256:a845e59fae87bb47a6fb84e0d5adb5679b3b55042fc3f8791da91486103cfbf0", size = 660724, upload-time = "2026-07-30T12:38:40.341Z" }, +] + +[[package]] +name = "idna" +version = "3.18" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cd/63/9496c57188a2ee585e0f1db071d75089a11e98aa86eb99d9d7618fc1edce/idna-3.18.tar.gz", hash = "sha256:ffb385a7e039654cef1ab9ef32c6fafe283c0c0467bba1d9029738ce4a14a848", size = 196711, upload-time = "2026-06-02T14:34:07.794Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/5e/d4e9f1a599fb8e573b7b87160658329fbf28d19eac2718f51fc3def3aa5a/idna-3.18-py3-none-any.whl", hash = "sha256:7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2", size = 65455, upload-time = "2026-06-02T14:34:06.319Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + +[[package]] +name = "markdown" +version = "3.10.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/29/6f/da4c6aea59b3001f2e8c0ec7497475aadaf3b021c10cab5b2858f0f32b26/markdown-3.10.3.tar.gz", hash = "sha256:3589362618f743188b4d955b874402bc814f4f83f544dc207719f4baa7d9c45f", size = 372596, upload-time = "2026-07-30T19:05:29.005Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/69/4a5af2bc115a9a33fefe51709749de8262be3f9ba063d1753a837cdbc49c/markdown-3.10.3-py3-none-any.whl", hash = "sha256:fa6c92a00a4a3c98b22728c64a935ae1928250ae65058a6ded814d2cc29a4cea", size = 110757, upload-time = "2026-07-30T19:05:27.883Z" }, +] + +[[package]] +name = "markupsafe" +version = "3.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, + { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, + { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" }, + { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" }, + { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" }, + { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" }, + { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" }, + { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" }, + { url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" }, + { url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" }, + { url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" }, + { url = "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676", size = 22980, upload-time = "2025-09-27T18:36:45.385Z" }, + { url = "https://files.pythonhosted.org/packages/7f/71/544260864f893f18b6827315b988c146b559391e6e7e8f7252839b1b846a/markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9", size = 21990, upload-time = "2025-09-27T18:36:46.916Z" }, + { url = "https://files.pythonhosted.org/packages/c2/28/b50fc2f74d1ad761af2f5dcce7492648b983d00a65b8c0e0cb457c82ebbe/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1", size = 23784, upload-time = "2025-09-27T18:36:47.884Z" }, + { url = "https://files.pythonhosted.org/packages/ed/76/104b2aa106a208da8b17a2fb72e033a5a9d7073c68f7e508b94916ed47a9/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc", size = 21588, upload-time = "2025-09-27T18:36:48.82Z" }, + { url = "https://files.pythonhosted.org/packages/b5/99/16a5eb2d140087ebd97180d95249b00a03aa87e29cc224056274f2e45fd6/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12", size = 23041, upload-time = "2025-09-27T18:36:49.797Z" }, + { url = "https://files.pythonhosted.org/packages/19/bc/e7140ed90c5d61d77cea142eed9f9c303f4c4806f60a1044c13e3f1471d0/markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed", size = 14543, upload-time = "2025-09-27T18:36:51.584Z" }, + { url = "https://files.pythonhosted.org/packages/05/73/c4abe620b841b6b791f2edc248f556900667a5a1cf023a6646967ae98335/markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5", size = 15113, upload-time = "2025-09-27T18:36:52.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3a/fa34a0f7cfef23cf9500d68cb7c32dd64ffd58a12b09225fb03dd37d5b80/markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485", size = 13911, upload-time = "2025-09-27T18:36:53.513Z" }, + { url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" }, + { url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e6/fa0ffcda717ef64a5108eaa7b4f5ed28d56122c9a6d70ab8b72f9f715c80/markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19", size = 25639, upload-time = "2025-09-27T18:36:56.908Z" }, + { url = "https://files.pythonhosted.org/packages/96/ec/2102e881fe9d25fc16cb4b25d5f5cde50970967ffa5dddafdb771237062d/markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025", size = 23569, upload-time = "2025-09-27T18:36:57.913Z" }, + { url = "https://files.pythonhosted.org/packages/4b/30/6f2fce1f1f205fc9323255b216ca8a235b15860c34b6798f810f05828e32/markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6", size = 23284, upload-time = "2025-09-27T18:36:58.833Z" }, + { url = "https://files.pythonhosted.org/packages/58/47/4a0ccea4ab9f5dcb6f79c0236d954acb382202721e704223a8aafa38b5c8/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f", size = 24801, upload-time = "2025-09-27T18:36:59.739Z" }, + { url = "https://files.pythonhosted.org/packages/6a/70/3780e9b72180b6fecb83a4814d84c3bf4b4ae4bf0b19c27196104149734c/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb", size = 22769, upload-time = "2025-09-27T18:37:00.719Z" }, + { url = "https://files.pythonhosted.org/packages/98/c5/c03c7f4125180fc215220c035beac6b9cb684bc7a067c84fc69414d315f5/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009", size = 23642, upload-time = "2025-09-27T18:37:01.673Z" }, + { url = "https://files.pythonhosted.org/packages/80/d6/2d1b89f6ca4bff1036499b1e29a1d02d282259f3681540e16563f27ebc23/markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354", size = 14612, upload-time = "2025-09-27T18:37:02.639Z" }, + { url = "https://files.pythonhosted.org/packages/2b/98/e48a4bfba0a0ffcf9925fe2d69240bfaa19c6f7507b8cd09c70684a53c1e/markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218", size = 15200, upload-time = "2025-09-27T18:37:03.582Z" }, + { url = "https://files.pythonhosted.org/packages/0e/72/e3cc540f351f316e9ed0f092757459afbc595824ca724cbc5a5d4263713f/markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287", size = 13973, upload-time = "2025-09-27T18:37:04.929Z" }, + { url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" }, + { url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" }, + { url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" }, + { url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" }, + { url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" }, + { url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" }, + { url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" }, + { url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" }, + { url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" }, + { url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" }, + { url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" }, + { url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" }, + { url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" }, + { url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" }, + { url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" }, + { url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" }, + { url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" }, + { url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" }, + { url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" }, + { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, +] + +[[package]] +name = "mergedeep" +version = "1.3.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/3a/41/580bb4006e3ed0361b8151a01d324fb03f420815446c7def45d02f74c270/mergedeep-1.3.4.tar.gz", hash = "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8", size = 4661, upload-time = "2021-02-05T18:55:30.623Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/19/04f9b178c2d8a15b076c8b5140708fa6ffc5601fb6f1e975537072df5b2a/mergedeep-1.3.4-py3-none-any.whl", hash = "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307", size = 6354, upload-time = "2021-02-05T18:55:29.583Z" }, +] + +[[package]] +name = "mkdocs" +version = "1.6.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "ghp-import" }, + { name = "jinja2" }, + { name = "markdown" }, + { name = "markupsafe" }, + { name = "mergedeep" }, + { name = "mkdocs-get-deps" }, + { name = "packaging" }, + { name = "pathspec" }, + { name = "pyyaml" }, + { name = "pyyaml-env-tag" }, + { name = "watchdog" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bc/c6/bbd4f061bd16b378247f12953ffcb04786a618ce5e904b8c5a01a0309061/mkdocs-1.6.1.tar.gz", hash = "sha256:7b432f01d928c084353ab39c57282f29f92136665bdd6abf7c1ec8d822ef86f2", size = 3889159, upload-time = "2024-08-30T12:24:06.899Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/22/5b/dbc6a8cddc9cfa9c4971d59fb12bb8d42e161b7e7f8cc89e49137c5b279c/mkdocs-1.6.1-py3-none-any.whl", hash = "sha256:db91759624d1647f3f34aa0c3f327dd2601beae39a366d6e064c03468d35c20e", size = 3864451, upload-time = "2024-08-30T12:24:05.054Z" }, +] + +[[package]] +name = "mkdocs-autorefs" +version = "1.4.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown" }, + { name = "markupsafe" }, + { name = "mkdocs" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/52/c0/f641843de3f612a6b48253f39244165acff36657a91cc903633d456ae1ac/mkdocs_autorefs-1.4.4.tar.gz", hash = "sha256:d54a284f27a7346b9c38f1f852177940c222da508e66edc816a0fa55fc6da197", size = 56588, upload-time = "2026-02-10T15:23:55.105Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/28/de/a3e710469772c6a89595fc52816da05c1e164b4c866a89e3cb82fb1b67c5/mkdocs_autorefs-1.4.4-py3-none-any.whl", hash = "sha256:834ef5408d827071ad1bc69e0f39704fa34c7fc05bc8e1c72b227dfdc5c76089", size = 25530, upload-time = "2026-02-10T15:23:53.817Z" }, +] + +[[package]] +name = "mkdocs-get-deps" +version = "0.2.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mergedeep" }, + { name = "platformdirs" }, + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ce/25/b3cccb187655b9393572bde9b09261d267c3bf2f2cdabe347673be5976a6/mkdocs_get_deps-0.2.2.tar.gz", hash = "sha256:8ee8d5f316cdbbb2834bc1df6e69c08fe769a83e040060de26d3c19fad3599a1", size = 11047, upload-time = "2026-03-10T02:46:33.632Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/29/744136411e785c4b0b744d5413e56555265939ab3a104c6a4b719dad33fd/mkdocs_get_deps-0.2.2-py3-none-any.whl", hash = "sha256:e7878cbeac04860b8b5e0ca31d3abad3df9411a75a32cde82f8e44b6c16ff650", size = 9555, upload-time = "2026-03-10T02:46:32.256Z" }, +] + +[[package]] +name = "mkdocs-material" +version = "9.7.7" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "babel" }, + { name = "backrefs" }, + { name = "colorama" }, + { name = "jinja2" }, + { name = "markdown" }, + { name = "mkdocs" }, + { name = "mkdocs-material-extensions" }, + { name = "paginate" }, + { name = "pygments" }, + { name = "pymdown-extensions" }, + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f1/cd/c05d3a530ba7934f144fb45f7203cd236adc25c7bdcc34673d202f4b0278/mkdocs_material-9.7.7.tar.gz", hash = "sha256:c0649c065b1b0512d60aad8c10f947f8e455284475239b364b610f2deb4d0855", size = 4097923, upload-time = "2026-07-17T16:21:33.156Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ad/21/17c1bc9e6f47c972ad66fb2ac2568f99f90f1207eeb6fc3b34d094dba7b5/mkdocs_material-9.7.7-py3-none-any.whl", hash = "sha256:8ea9bb1737a5b524a5f9dcf2e1b4ebda8274ae3008aa7845720a97083bef708f", size = 9305438, upload-time = "2026-07-17T16:21:30.017Z" }, +] + +[[package]] +name = "mkdocs-material-extensions" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/79/9b/9b4c96d6593b2a541e1cb8b34899a6d021d208bb357042823d4d2cabdbe7/mkdocs_material_extensions-1.3.1.tar.gz", hash = "sha256:10c9511cea88f568257f960358a467d12b970e1f7b2c0e5fb2bb48cab1928443", size = 11847, upload-time = "2023-11-22T19:09:45.208Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5b/54/662a4743aa81d9582ee9339d4ffa3c8fd40a4965e033d77b9da9774d3960/mkdocs_material_extensions-1.3.1-py3-none-any.whl", hash = "sha256:adff8b62700b25cb77b53358dad940f3ef973dd6db797907c49e3c2ef3ab4e31", size = 8728, upload-time = "2023-11-22T19:09:43.465Z" }, +] + +[[package]] +name = "mkdocstrings" +version = "1.0.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "jinja2" }, + { name = "markdown" }, + { name = "markupsafe" }, + { name = "mkdocs" }, + { name = "mkdocs-autorefs" }, + { name = "pymdown-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/53/71/f85bdf13355073ae15a7375f09879375a830553552e58c1c4b7e0bbc5c8b/mkdocstrings-1.0.6.tar.gz", hash = "sha256:a0b8c2bdd29a6416c80d717aa369bbf7831946bd9f23c2a66db1b1dbe7693dbd", size = 100649, upload-time = "2026-07-11T19:38:05.732Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5d/5b/4c1902e8bdd5c4db63284e9d101dece4038d4025d6d88850ffe0a1578980/mkdocstrings-1.0.6-py3-none-any.whl", hash = "sha256:2703708697487d1b6d6d7b412e176fa436edf120c1bf81dc9e126b12d00893c7", size = 35787, upload-time = "2026-07-11T19:38:04.417Z" }, +] + +[[package]] +name = "mkdocstrings-python" +version = "2.0.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "griffelib" }, + { name = "mkdocs-autorefs" }, + { name = "mkdocstrings" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/b6/e858701499d57eee8b3fd8e78168083956c6683ddbe727b46758b19e1119/mkdocstrings_python-2.0.5.tar.gz", hash = "sha256:3a4d92556ad39637e88af94a5374213af9a8e3040c3824ceaed04b486c017594", size = 199578, upload-time = "2026-06-19T10:41:08.868Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/fc/10ab7e80650a9c9e8f4f1105f8c8e73567f88ed0c06ada589ab81d38687c/mkdocstrings_python-2.0.5-py3-none-any.whl", hash = "sha256:30c837bbff016549f659fcba6539ac351303f0fd7e713c89a040611072236e9d", size = 104951, upload-time = "2026-06-19T10:41:07.378Z" }, +] + +[[package]] +name = "numpy" +version = "2.5.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/22/fd/89965aa4ac08c74998539fcbf24fa3540f3e15237fbeb6bcf9c908f4aade/numpy-2.5.1.tar.gz", hash = "sha256:a48a113e6afea91f5608793bafa7ef2ad481fefbda87ec5069f483de61cb9fa3", size = 20755553, upload-time = "2026-07-04T17:08:00.933Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/7b/14687aa674250e5e546f616f486b0d56d3631cd5b2415739141ce40bdcea/numpy-2.5.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2c889b56fe48b1018f764b0eec8df59ab654e9148aa91faa12596043500de277", size = 16801574, upload-time = "2026-07-04T17:06:12.423Z" }, + { url = "https://files.pythonhosted.org/packages/e1/19/cc5bb2a3f2913d27d6dbb2c78d25921fabaedc6741d4a5a615a11f3c5bf3/numpy-2.5.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ab451b59c5643c570974c43aef780703ef1d3b4965d2be07afd530615a9358d1", size = 11772250, upload-time = "2026-07-04T17:06:15.726Z" }, + { url = "https://files.pythonhosted.org/packages/42/77/fdf34a71dd30f54979b18603bee915e0aaf825b07afe79acd60b04b691e2/numpy-2.5.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:78798bd5b9ad744056af8efa90e3b9ddaa53272a0848a483084a1cc0a13b2dc0", size = 5331516, upload-time = "2026-07-04T17:06:17.913Z" }, + { url = "https://files.pythonhosted.org/packages/ce/e2/eb7efa015b4cce41e2517bf182a7fce0d7d5b9d9ed76a29bfa0f4fe4505c/numpy-2.5.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:2ae0ca40bcb22d6ba59c1dfd5446f49940b0f2d821fde133f10dda11f816b84e", size = 6664863, upload-time = "2026-07-04T17:06:20.02Z" }, + { url = "https://files.pythonhosted.org/packages/a9/4b/a2b32dd94ee9ffbeecb28152240042a3949db33b1c834d44090b80e1b3b8/numpy-2.5.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:61ac47e772e6b8ea489e1d2f441a34c5c3ac17327e7ce294cbdf535795ad4e75", size = 15167977, upload-time = "2026-07-04T17:06:21.621Z" }, + { url = "https://files.pythonhosted.org/packages/b8/a9/6e73d68500f80773f65f0654ea932019d6694329a0eb0ed0533de38df376/numpy-2.5.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:59fda5e192b570217ec2580c96f00e9a7e12ef6866a900eb089b62c1a32545ca", size = 16672469, upload-time = "2026-07-04T17:06:24.064Z" }, + { url = "https://files.pythonhosted.org/packages/24/7d/ad3e59015135f5261c95fd4cafeff159c955febd83a99a1d9250c4233815/numpy-2.5.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f7119ebff1a9829e9f431a4f9d28e703023bb6b9fe7c8f724467dbfc27c94ab3", size = 16527531, upload-time = "2026-07-04T17:06:26.69Z" }, + { url = "https://files.pythonhosted.org/packages/83/d0/a39b2fbcde9cb17a1dac678f254b33a6336298af9df338824c685425d5e8/numpy-2.5.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e824c2acf8862052246be5a44c15da1777940c60d010dd2aab897824d9c430f9", size = 18431940, upload-time = "2026-07-04T17:06:29.521Z" }, + { url = "https://files.pythonhosted.org/packages/04/12/cff070947791c1ed425ff76413189adbdc2fbe215eba7ce7fa454a03c7f8/numpy-2.5.1-cp312-cp312-win32.whl", hash = "sha256:08d60c810432eb83360958dea0999ac4cfb94531ea8efcbf0b7f277c2068aeb2", size = 6066764, upload-time = "2026-07-04T17:06:32.571Z" }, + { url = "https://files.pythonhosted.org/packages/65/66/53f31807a48a750f9d748da273bc3fcedd12b27ff1f3e373bfec55ef2dc0/numpy-2.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:f7d60026c0bdb1380e83bfa7a0419c4577ee4b9a08880afcb6dadeb74c649fa2", size = 12430966, upload-time = "2026-07-04T17:06:34.926Z" }, + { url = "https://files.pythonhosted.org/packages/2b/2a/d1a88066b1c14186f5d3c0d18c94f17b064511982bab0578d49ee9d43c29/numpy-2.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:17a25e09640602e10bc8de0e6fa2b3fd68eedd84ba6d7842dc8f32f9ab87bd0b", size = 10350488, upload-time = "2026-07-04T17:06:37.785Z" }, + { url = "https://files.pythonhosted.org/packages/eb/07/ec2a3f0c91761581d4b7104a740791800025983f9a4dc4e73f91a99aeac4/numpy-2.5.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0bfebd8695f9863592fe744be833a258120b14a9f39da255e8aa8fade2c0ddd1", size = 16796419, upload-time = "2026-07-04T17:06:40.37Z" }, + { url = "https://files.pythonhosted.org/packages/ab/ab/ddb499fc4f8780354395face5b65c7fd107bcd6e1d667a5f07d046956f6f/numpy-2.5.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:30b44a6b53a7ae63c54c089a8726e5563ed302716c5b7ccc85afade40b0e7ff6", size = 11765832, upload-time = "2026-07-04T17:06:42.768Z" }, + { url = "https://files.pythonhosted.org/packages/88/b3/3c28c558a09fc72100c646dac6d2fce8e834c471b0edca01a29996706117/numpy-2.5.1-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:6165343f81b56ef8f514f396989e529b61d9dc709b99421b07e9f3e698e2287d", size = 5325143, upload-time = "2026-07-04T17:06:45.466Z" }, + { url = "https://files.pythonhosted.org/packages/5e/0e/ce19b985bb15c596f4f05954e76cccc77c845083b3b8f938a6c68e523128/numpy-2.5.1-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:4939237038ada79308dda3204ac6462df056b5672b2e25db1149cf873668b3e1", size = 6659749, upload-time = "2026-07-04T17:06:47.288Z" }, + { url = "https://files.pythonhosted.org/packages/2e/20/1ee6614d64332a1bba6411f38e68cb79eec1b2459e20a623777c5c5492a2/numpy-2.5.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1c6759f538fb912fc46de0a6b1758ccf7b57bc7c7ebebc23974fdac3de8db0cd", size = 15164716, upload-time = "2026-07-04T17:06:49.494Z" }, + { url = "https://files.pythonhosted.org/packages/ed/a7/2bcd3fdbb87804755c35b729bf8709d62025c5f4cfd7d5b2415997097515/numpy-2.5.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9726558e8db4a5bf7929a70ae50f63abda4daf0efe810e3bfbab95976f75fc1a", size = 16661440, upload-time = "2026-07-04T17:06:52.061Z" }, + { url = "https://files.pythonhosted.org/packages/fc/d7/a41e3310c886fe457d36e670bbf24fae411aca8a7b6ad92a32afd924077c/numpy-2.5.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3935f3b419b244a02732676fa5317a9193cc596a4c0646db07e5b421229ac9f7", size = 16526305, upload-time = "2026-07-04T17:06:54.605Z" }, + { url = "https://files.pythonhosted.org/packages/53/75/4333a9a707c1edd3a4e1a0c58eca52c0f31e55089fa80db02b5565b24df7/numpy-2.5.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:dc932a65ded7ce9013d120845a2514dcccb1a67bfc8deb8d37633762951904a6", size = 18423008, upload-time = "2026-07-04T17:06:57.54Z" }, + { url = "https://files.pythonhosted.org/packages/ee/90/e314a32b1c11a2ffe818ddad3a57b50b4b6e1b6c487192eb50cdef0415d0/numpy-2.5.1-cp313-cp313-win32.whl", hash = "sha256:4b4ff1608417eb7a59da7b967bbb798cacfe071d2caf526a24281cd562072ed9", size = 6063885, upload-time = "2026-07-04T17:07:00.14Z" }, + { url = "https://files.pythonhosted.org/packages/10/70/800b3fca480af32df9e8ea9f3d4a0c8feb4b32d7f195d174eabbda4829ad/numpy-2.5.1-cp313-cp313-win_amd64.whl", hash = "sha256:6c3fe51bc6a16453d452997053454f309e8e0ed7b42d6b361ce4ac8c32913d74", size = 12425674, upload-time = "2026-07-04T17:07:02.387Z" }, + { url = "https://files.pythonhosted.org/packages/8b/0b/196350c122f50f6ca56846f2d71efd5e0d24b7b2e07355e019b2e2c7a11e/numpy-2.5.1-cp313-cp313-win_arm64.whl", hash = "sha256:f7feb014281029e628ba2d5a007407443b06e418b6fe451d1e2adcbc8eba0107", size = 10350256, upload-time = "2026-07-04T17:07:04.878Z" }, + { url = "https://files.pythonhosted.org/packages/db/f4/731b6085a83faf6ca843394cbd5e217280c214399f7e8b21b9f552af0ae2/numpy-2.5.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:7c786fe9a5bbe360022e584c5a34cf6b54265c71bd7ec8ac3d8fec38968071f8", size = 16795063, upload-time = "2026-07-04T17:07:07.374Z" }, + { url = "https://files.pythonhosted.org/packages/bf/64/0e215f2048dd11a55bb989ed41b3585ef57452404e638d703a211a3e4157/numpy-2.5.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:32985c896d897419ef8da6917872d80b78ad0ea26d85b23245c7366ffde76d75", size = 11776652, upload-time = "2026-07-04T17:07:09.907Z" }, + { url = "https://files.pythonhosted.org/packages/b5/59/2b844c7a6e9deff69b404a66221e1542937734f65d5e6e39411876053862/numpy-2.5.1-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:efd736408cc97c79b9e6917338dfc8f06013b2274f992e96b1d9a81a71e2a2c2", size = 5335944, upload-time = "2026-07-04T17:07:12.227Z" }, + { url = "https://files.pythonhosted.org/packages/86/51/9bf7cb2cabcebc9e017e4ec7e6322b378317a542c08b4cb68479c1efc716/numpy-2.5.1-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:ab84dc6b074fa881cae55bea94cc4f68e285181ba7f32497bf7dee6b1496165b", size = 6656266, upload-time = "2026-07-04T17:07:14.368Z" }, + { url = "https://files.pythonhosted.org/packages/83/3e/fb7615b211b82a32f44d5180a6d421b61f84d4fadd578b48ba4ac34e189f/numpy-2.5.1-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caf3e317d33d60c37986b452613f4ab51246d0691350c03d0cb4a898627f4a95", size = 15179720, upload-time = "2026-07-04T17:07:16.272Z" }, + { url = "https://files.pythonhosted.org/packages/41/5f/0f992cb24560673496c5d68de61913b57166ce530ffda07c1f280e0cc464/numpy-2.5.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:54ad769f17bc2d833b620851989f62054fb9ab93c969d9e1dc3c8e3d56beea21", size = 16664835, upload-time = "2026-07-04T17:07:19.021Z" }, + { url = "https://files.pythonhosted.org/packages/a2/2f/97d6475ee91afe2587797d09446f9d3e475ad4cb681662d824809327b75a/numpy-2.5.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c12afb53450fa976d4c681c50a7423729a4c51c0465ed9f32b8a9cabbc472373", size = 16539135, upload-time = "2026-07-04T17:07:22.015Z" }, + { url = "https://files.pythonhosted.org/packages/c4/5b/4db81e4ba0be7e2776b1de68c82aa862c7f8ec27e1b4927d4ae075e20678/numpy-2.5.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:e8c11c405efc5ff6816d5983c96cdfa215bab3428961243af3ff59b228490438", size = 18426684, upload-time = "2026-07-04T17:07:24.941Z" }, + { url = "https://files.pythonhosted.org/packages/1f/64/c0ba2d90724d450279a7df8f32057241070250a26a7e2b5337d77347f481/numpy-2.5.1-cp314-cp314-win32.whl", hash = "sha256:f2479a47f8d5932d1718168a681ad6e536a9df484c83cfcf9de365e164537ace", size = 6116103, upload-time = "2026-07-04T17:07:27.622Z" }, + { url = "https://files.pythonhosted.org/packages/c1/1a/837f9ed7405adcd7a40538792eb169eddd8fa5630c16a1ef49dae71a30f4/numpy-2.5.1-cp314-cp314-win_amd64.whl", hash = "sha256:24d0eb82c0541d3415a33425db64ae439dffccd7b4dbcb30e7c35120205c506a", size = 12562177, upload-time = "2026-07-04T17:07:29.887Z" }, + { url = "https://files.pythonhosted.org/packages/22/ed/49707938b6dd0a78a9178dd93227dc89e4c11af47f5c798d70366e8d0483/numpy-2.5.1-cp314-cp314-win_arm64.whl", hash = "sha256:5a4c988b38d261deeeaad9954e3deb091ad905c94e8bb6708654ef1d97f286b0", size = 10627739, upload-time = "2026-07-04T17:07:32.568Z" }, + { url = "https://files.pythonhosted.org/packages/a6/c7/bb4b882cfe7f299cbc8b66e42e7dd78cf9d14e40f9469fc5e3db7e15b3bd/numpy-2.5.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a33276be12fa045805f477f22482088b66bb758ffbe89a9d21457de863a32e22", size = 11894709, upload-time = "2026-07-04T17:07:34.941Z" }, + { url = "https://files.pythonhosted.org/packages/40/3f/5af7f4a7f6224aef48017aa82bb6174c7a659d724be0c75017b7e64a55b4/numpy-2.5.1-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:f089d7b00756190aacf1f5d34bdf38c3c430ac82b4f868f8cede73380460fce7", size = 5453810, upload-time = "2026-07-04T17:07:37.495Z" }, + { url = "https://files.pythonhosted.org/packages/20/c9/3474309bc94d634d3f9c3eddf03250ecb8c22cd948ef16fef69a77cc5d7b/numpy-2.5.1-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:09e9bfd8d2cf479c7d174804fb3811c53a8e9f20a37444008606b57d6b7a826d", size = 6761189, upload-time = "2026-07-04T17:07:39.563Z" }, + { url = "https://files.pythonhosted.org/packages/90/8a/558ae39fdd55d7e7f7fef9a84a6e964ac6b23edbd2a07e52bb084500507d/numpy-2.5.1-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e68d8dd1e7eba712948f2053a29ec86917bc70ba1358df869d9f06649ef9cf09", size = 15225039, upload-time = "2026-07-04T17:07:41.682Z" }, + { url = "https://files.pythonhosted.org/packages/63/27/ca7392b2d030277bdf0273e7d23255b3ee57d57a7c170a6f4fb3981e1e5d/numpy-2.5.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:99d5095fa265a0c4152e7bb12759e14381ef5496152f1ce58f44bdf55c44beb4", size = 16701306, upload-time = "2026-07-04T17:07:44.611Z" }, + { url = "https://files.pythonhosted.org/packages/02/42/03d53ae7996c44d4374a8262e9dc41671fd56cbb98f7d47ef85cf5da4c6b/numpy-2.5.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ab87a91b3cc3382b8956095bd8f95e00cf679bb81554339be1a2ba404a1473c1", size = 16589955, upload-time = "2026-07-04T17:07:47.694Z" }, + { url = "https://files.pythonhosted.org/packages/7b/15/6c1784ae469640e65db111e9a34b3d0f14d91e8a38b9ce34810ced370dbb/numpy-2.5.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:224ca51130ef7da85bea2191625181cb4f337f9cb64b471f10c1a12aa8b60077", size = 18464252, upload-time = "2026-07-04T17:07:50.684Z" }, + { url = "https://files.pythonhosted.org/packages/94/a8/f98e50356cf167df656c526c2dfeec2d7dde182f2a3da4b458a5938e2776/numpy-2.5.1-cp314-cp314t-win32.whl", hash = "sha256:6eab239876581b2b3c5a242281b6007bbdbcd1c7085d7709bb57c5929b11e6bf", size = 6263298, upload-time = "2026-07-04T17:07:53.445Z" }, + { url = "https://files.pythonhosted.org/packages/72/ac/96ae880cdecad0b3275d9359fcec72667b49a4863c9f12942e43679dda02/numpy-2.5.1-cp314-cp314t-win_amd64.whl", hash = "sha256:83ce9c80d5b521b0d77ddcbe5447c218d247929b6cc056ca5351342accfff0af", size = 12748623, upload-time = "2026-07-04T17:07:55.384Z" }, + { url = "https://files.pythonhosted.org/packages/a1/5a/4d2b1601df3602dba7a14f3348ba9bfe94a18adb428e693df6154c293831/numpy-2.5.1-cp314-cp314t-win_arm64.whl", hash = "sha256:5a6db61f9aaa57e369905c67d852045d3c4f7126405b29d09b19dec118e9c9cb", size = 10697674, upload-time = "2026-07-04T17:07:58.506Z" }, +] + +[[package]] +name = "packaging" +version = "26.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" }, +] + +[[package]] +name = "paginate" +version = "0.5.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ec/46/68dde5b6bc00c1296ec6466ab27dddede6aec9af1b99090e1107091b3b84/paginate-0.5.7.tar.gz", hash = "sha256:22bd083ab41e1a8b4f3690544afb2c60c25e5c9a63a30fa2f483f6c60c8e5945", size = 19252, upload-time = "2024-08-25T14:17:24.139Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/90/96/04b8e52da071d28f5e21a805b19cb9390aa17a47462ac87f5e2696b9566d/paginate-0.5.7-py2.py3-none-any.whl", hash = "sha256:b885e2af73abcf01d9559fd5216b57ef722f8c42affbb63942377668e35c7591", size = 13746, upload-time = "2024-08-25T14:17:22.55Z" }, +] + +[[package]] +name = "pathspec" +version = "1.1.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/82/42f767fc1c1143d6fd36efb827202a2d997a375e160a71eb2888a925aac1/pathspec-1.1.1.tar.gz", hash = "sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a", size = 135180, upload-time = "2026-04-27T01:46:08.907Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f1/d9/7fb5aa316bc299258e68c73ba3bddbc499654a07f151cba08f6153988714/pathspec-1.1.1-py3-none-any.whl", hash = "sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189", size = 57328, upload-time = "2026-04-27T01:46:07.06Z" }, +] + +[[package]] +name = "platformdirs" +version = "4.11.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/78/9b/560e4be8e26f6fd133a03630a8df0c663b9e8d61b4ade152b72005aec83b/platformdirs-4.11.0.tar.gz", hash = "sha256:0555d18370482847566ffabcaa53ad7c6c1c29f195989ae1ed634a05f76ea1e0", size = 31953, upload-time = "2026-07-21T13:09:36.565Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7d/68/d8d58938dfb1370b266a1a729e6d77a985be23689a0496498ee17b2cbf90/platformdirs-4.11.0-py3-none-any.whl", hash = "sha256:360ccded2b7fce0af0ff80cc8f5942a1c5d99b0e856033acb030bfc634709e74", size = 23247, upload-time = "2026-07-21T13:09:35.422Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "pygments" +version = "2.20.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, +] + +[[package]] +name = "pymdown-extensions" +version = "11.0.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown" }, + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/21/a9/5f0c535ba3b08fe09270c16808e053a968868242ecbd5676d4e3a488bf28/pymdown_extensions-11.0.1.tar.gz", hash = "sha256:dd2905ae6fc5b75582fafb139a1266ffc754705efa902aa50067fa7ff4f94ec0", size = 857113, upload-time = "2026-07-02T17:59:22.955Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d6/54/da572c98c0b77626a91b5d3b89f0231d8bff5125c225420908632f8b342d/pymdown_extensions-11.0.1-py3-none-any.whl", hash = "sha256:db3943a62bab7e03af1364f0c4083e64b91fb097675a4b6cceccfbe9a77e5eb2", size = 269455, upload-time = "2026-07-02T17:59:21.271Z" }, +] + +[[package]] +name = "pytest" +version = "9.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" }, +] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, +] + +[[package]] +name = "pyyaml" +version = "6.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, + { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, + { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, + { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, + { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, + { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, + { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, + { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" }, + { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" }, + { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" }, + { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" }, + { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" }, + { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" }, + { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" }, + { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" }, + { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" }, + { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" }, + { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" }, + { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" }, + { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" }, + { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" }, + { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" }, + { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" }, + { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" }, + { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" }, + { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" }, + { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" }, + { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" }, + { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" }, + { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" }, + { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" }, + { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, +] + +[[package]] +name = "pyyaml-env-tag" +version = "1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/eb/2e/79c822141bfd05a853236b504869ebc6b70159afc570e1d5a20641782eaa/pyyaml_env_tag-1.1.tar.gz", hash = "sha256:2eb38b75a2d21ee0475d6d97ec19c63287a7e140231e4214969d0eac923cd7ff", size = 5737, upload-time = "2025-05-13T15:24:01.64Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/11/432f32f8097b03e3cd5fe57e88efb685d964e2e5178a48ed61e841f7fdce/pyyaml_env_tag-1.1-py3-none-any.whl", hash = "sha256:17109e1a528561e32f026364712fee1264bc2ea6715120891174ed1b980d2e04", size = 4722, upload-time = "2025-05-13T15:23:59.629Z" }, +] + +[[package]] +name = "requests" +version = "2.34.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "charset-normalizer" }, + { name = "idna" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" }, +] + +[[package]] +name = "ruff" +version = "0.15.22" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/3a/06/ae069393fc66e8ff33036d4b368003833bf6e88ccf182e17e7a2f1c754fd/ruff-0.15.22.tar.gz", hash = "sha256:3f15175b1fb580126f58285a5dae6b2ea89000136d980c64499211f116b54809", size = 4785063, upload-time = "2026-07-16T15:14:13.244Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/23/18/ee54b7ae1e121be7a28ea6da4b67564ebb0530e183a54415ab7e3bcd2c4e/ruff-0.15.22-py3-none-linux_armv6l.whl", hash = "sha256:44423e73493737f5e7c5b41d475483898ff37afcdae38bc3da5085e29af1c2d8", size = 10781258, upload-time = "2026-07-16T15:13:19.452Z" }, + { url = "https://files.pythonhosted.org/packages/2f/d2/2520cb14761ddbeaf57642a76942fc36adcbdbe53b4532241995f6fc485c/ruff-0.15.22-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b82c6482946e9eda7ff2e091d25b8bad3f718684e1916d41bd56873cee05b697", size = 10999477, upload-time = "2026-07-16T15:13:23.318Z" }, + { url = "https://files.pythonhosted.org/packages/c9/10/74e53572aa758dfaa678c2a2646b5c5515d884b7ca56be4d2ce03ca4b560/ruff-0.15.22-py3-none-macosx_11_0_arm64.whl", hash = "sha256:11c1c715af53a09f714e011106bffc419751ec8232fcb5da42173284ea3fec6f", size = 10466716, upload-time = "2026-07-16T15:13:26.162Z" }, + { url = "https://files.pythonhosted.org/packages/1e/cc/44eaaf0844e028182f2d0a8f2190d0f359159aed0a9e5ab861d892f1ae2a/ruff-0.15.22-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:742a29cf29bddb7c8327895d6a10e0e6c5b38a96dd407af9b5d0857f809c0576", size = 10892644, upload-time = "2026-07-16T15:13:29.229Z" }, + { url = "https://files.pythonhosted.org/packages/9f/21/8edf559014d2b0f82beea19cfb713993ad802ccda16868769979c6090a84/ruff-0.15.22-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72af58b951b0ae395935ae79763dc349bc0eb706319d28f7a33ad2cfb3cfc178", size = 10576719, upload-time = "2026-07-16T15:13:32.35Z" }, + { url = "https://files.pythonhosted.org/packages/bf/1e/3a13abd392a3b50b62e5938a831f9ab6e588358cacad5c18545b716d2182/ruff-0.15.22-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62d425005c1835eb24e2ee4161cb90e8db263415f4a71c8c72c33abaa6c0c224", size = 11376494, upload-time = "2026-07-16T15:13:35.958Z" }, + { url = "https://files.pythonhosted.org/packages/bf/3e/422d3d95bcf04dd78e1aeac22184d4f9a8fb2c01865d39d44618484a0317/ruff-0.15.22-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e8b9b3f8779a4f08c969defc3c8c35abffaa757e601ed5ae66d6d1db6519969a", size = 12208370, upload-time = "2026-07-16T15:13:39.185Z" }, + { url = "https://files.pythonhosted.org/packages/1e/91/5d065a0e0a02bf4813f5119ad278462eed081d2b832eb7c021ade0ec9e65/ruff-0.15.22-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1e0dd1b2e4d3d585f897a0d137cbf4eaf6223bef4e8ce34d6bb12556c5f9249e", size = 11581098, upload-time = "2026-07-16T15:13:42.132Z" }, + { url = "https://files.pythonhosted.org/packages/f6/f9/a0d4871d12fae702eb1f41b686caf05f1f8b124dc6db6f784f53d74918fa/ruff-0.15.22-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:365523eb91d9224e1bcb03b022fbf0facb8f9e23792a2c53d9d4b3924bdbdebb", size = 11399422, upload-time = "2026-07-16T15:13:45.2Z" }, + { url = "https://files.pythonhosted.org/packages/18/80/c843a5176cddbceb0b7e8dd41cf9993490796c1c469348d384f5a5c13c56/ruff-0.15.22-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:fabfd168afdf29fee5be98b831efa9683c94d7c5a3b58b9ce5a2e38444589a74", size = 11381683, upload-time = "2026-07-16T15:13:48.46Z" }, + { url = "https://files.pythonhosted.org/packages/d4/00/8485de0ae92239438a36cfc51350db9b9e85c9ebdfaea91b18e422706662/ruff-0.15.22-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:225dbf095a87f1d9f90f5fd7924d2613ee452a75a4308c63a8f50f761787aa7c", size = 10850295, upload-time = "2026-07-16T15:13:51.655Z" }, + { url = "https://files.pythonhosted.org/packages/fa/91/24977ec2ec72eaf15e4394ace2959fdff2dd1e14f03e005e838023407169/ruff-0.15.22-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1877d63b9d24ed278744f1523fd11b85540566d54641f97c566d7d9dc5ca5296", size = 10579640, upload-time = "2026-07-16T15:13:54.79Z" }, + { url = "https://files.pythonhosted.org/packages/9c/47/9b51216951974df1f263ac19da550d34252e0ed7218c25f10c5ef9ed7517/ruff-0.15.22-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a1606c510bd7215680d32efab38965f7cdec3ef69f5170a3f4791404ffdd5262", size = 11105077, upload-time = "2026-07-16T15:13:57.915Z" }, + { url = "https://files.pythonhosted.org/packages/c2/47/20e9d4a3b8016778acea5fc32bb50d35d207500a17ddb529ffa6996feef8/ruff-0.15.22-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:630479b18625f5ffc373f77603a22a9f8ac0acd7ff0501178b5db28ec71e9c64", size = 11490980, upload-time = "2026-07-16T15:14:01.032Z" }, + { url = "https://files.pythonhosted.org/packages/4d/76/3f72d8fc38c1cb77b38c56a70da9d0c17700cc1cc50f9649c9d3c8f5ba71/ruff-0.15.22-py3-none-win32.whl", hash = "sha256:e5ba0e4a13fd14abbed2a77b517a3911290c6c6c59ef67784328d1668fab76cf", size = 10789165, upload-time = "2026-07-16T15:14:04.16Z" }, + { url = "https://files.pythonhosted.org/packages/cb/46/4965251734c2b6fcdca1b1b187d20bcac3af0ee5b083b89c910bb961ce3a/ruff-0.15.22-py3-none-win_amd64.whl", hash = "sha256:9be63ba1eb936acd2d1342fb8337c356353706fce233b2a15a09a97037e6acde", size = 11938297, upload-time = "2026-07-16T15:14:07.316Z" }, + { url = "https://files.pythonhosted.org/packages/57/c9/e69b1ff4c8b69093ef08b8919ab767af0569666865b39c30a8795d88d3c6/ruff-0.15.22-py3-none-win_arm64.whl", hash = "sha256:e1168075b72158510839f250027659cdd78476f40507dd517892304c41318661", size = 11298172, upload-time = "2026-07-16T15:14:10.51Z" }, +] + +[[package]] +name = "six" +version = "1.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, +] + +[[package]] +name = "sortedcontainers" +version = "2.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e8/c4/ba2f8066cceb6f23394729afe52f3bf7adec04bf9ed2c820b39e19299111/sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88", size = 30594, upload-time = "2021-05-16T22:03:42.897Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0", size = 29575, upload-time = "2021-05-16T22:03:41.177Z" }, +] + +[[package]] +name = "urllib3" +version = "2.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602, upload-time = "2026-05-07T16:13:18.596Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087, upload-time = "2026-05-07T16:13:17.151Z" }, +] + +[[package]] +name = "watchdog" +version = "6.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/db/7d/7f3d619e951c88ed75c6037b246ddcf2d322812ee8ea189be89511721d54/watchdog-6.0.0.tar.gz", hash = "sha256:9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282", size = 131220, upload-time = "2024-11-01T14:07:13.037Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/39/ea/3930d07dafc9e286ed356a679aa02d777c06e9bfd1164fa7c19c288a5483/watchdog-6.0.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:bdd4e6f14b8b18c334febb9c4425a878a2ac20efd1e0b231978e7b150f92a948", size = 96471, upload-time = "2024-11-01T14:06:37.745Z" }, + { url = "https://files.pythonhosted.org/packages/12/87/48361531f70b1f87928b045df868a9fd4e253d9ae087fa4cf3f7113be363/watchdog-6.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c7c15dda13c4eb00d6fb6fc508b3c0ed88b9d5d374056b239c4ad1611125c860", size = 88449, upload-time = "2024-11-01T14:06:39.748Z" }, + { url = "https://files.pythonhosted.org/packages/5b/7e/8f322f5e600812e6f9a31b75d242631068ca8f4ef0582dd3ae6e72daecc8/watchdog-6.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f10cb2d5902447c7d0da897e2c6768bca89174d0c6e1e30abec5421af97a5b0", size = 89054, upload-time = "2024-11-01T14:06:41.009Z" }, + { url = "https://files.pythonhosted.org/packages/68/98/b0345cabdce2041a01293ba483333582891a3bd5769b08eceb0d406056ef/watchdog-6.0.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:490ab2ef84f11129844c23fb14ecf30ef3d8a6abafd3754a6f75ca1e6654136c", size = 96480, upload-time = "2024-11-01T14:06:42.952Z" }, + { url = "https://files.pythonhosted.org/packages/85/83/cdf13902c626b28eedef7ec4f10745c52aad8a8fe7eb04ed7b1f111ca20e/watchdog-6.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:76aae96b00ae814b181bb25b1b98076d5fc84e8a53cd8885a318b42b6d3a5134", size = 88451, upload-time = "2024-11-01T14:06:45.084Z" }, + { url = "https://files.pythonhosted.org/packages/fe/c4/225c87bae08c8b9ec99030cd48ae9c4eca050a59bf5c2255853e18c87b50/watchdog-6.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a175f755fc2279e0b7312c0035d52e27211a5bc39719dd529625b1930917345b", size = 89057, upload-time = "2024-11-01T14:06:47.324Z" }, + { url = "https://files.pythonhosted.org/packages/a9/c7/ca4bf3e518cb57a686b2feb4f55a1892fd9a3dd13f470fca14e00f80ea36/watchdog-6.0.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:7607498efa04a3542ae3e05e64da8202e58159aa1fa4acddf7678d34a35d4f13", size = 79079, upload-time = "2024-11-01T14:06:59.472Z" }, + { url = "https://files.pythonhosted.org/packages/5c/51/d46dc9332f9a647593c947b4b88e2381c8dfc0942d15b8edc0310fa4abb1/watchdog-6.0.0-py3-none-manylinux2014_armv7l.whl", hash = "sha256:9041567ee8953024c83343288ccc458fd0a2d811d6a0fd68c4c22609e3490379", size = 79078, upload-time = "2024-11-01T14:07:01.431Z" }, + { url = "https://files.pythonhosted.org/packages/d4/57/04edbf5e169cd318d5f07b4766fee38e825d64b6913ca157ca32d1a42267/watchdog-6.0.0-py3-none-manylinux2014_i686.whl", hash = "sha256:82dc3e3143c7e38ec49d61af98d6558288c415eac98486a5c581726e0737c00e", size = 79076, upload-time = "2024-11-01T14:07:02.568Z" }, + { url = "https://files.pythonhosted.org/packages/ab/cc/da8422b300e13cb187d2203f20b9253e91058aaf7db65b74142013478e66/watchdog-6.0.0-py3-none-manylinux2014_ppc64.whl", hash = "sha256:212ac9b8bf1161dc91bd09c048048a95ca3a4c4f5e5d4a7d1b1a7d5752a7f96f", size = 79077, upload-time = "2024-11-01T14:07:03.893Z" }, + { url = "https://files.pythonhosted.org/packages/2c/3b/b8964e04ae1a025c44ba8e4291f86e97fac443bca31de8bd98d3263d2fcf/watchdog-6.0.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:e3df4cbb9a450c6d49318f6d14f4bbc80d763fa587ba46ec86f99f9e6876bb26", size = 79078, upload-time = "2024-11-01T14:07:05.189Z" }, + { url = "https://files.pythonhosted.org/packages/62/ae/a696eb424bedff7407801c257d4b1afda455fe40821a2be430e173660e81/watchdog-6.0.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:2cce7cfc2008eb51feb6aab51251fd79b85d9894e98ba847408f662b3395ca3c", size = 79077, upload-time = "2024-11-01T14:07:06.376Z" }, + { url = "https://files.pythonhosted.org/packages/b5/e8/dbf020b4d98251a9860752a094d09a65e1b436ad181faf929983f697048f/watchdog-6.0.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:20ffe5b202af80ab4266dcd3e91aae72bf2da48c0d33bdb15c66658e685e94e2", size = 79078, upload-time = "2024-11-01T14:07:07.547Z" }, + { url = "https://files.pythonhosted.org/packages/07/f6/d0e5b343768e8bcb4cda79f0f2f55051bf26177ecd5651f84c07567461cf/watchdog-6.0.0-py3-none-win32.whl", hash = "sha256:07df1fdd701c5d4c8e55ef6cf55b8f0120fe1aef7ef39a1c6fc6bc2e606d517a", size = 79065, upload-time = "2024-11-01T14:07:09.525Z" }, + { url = "https://files.pythonhosted.org/packages/db/d9/c495884c6e548fce18a8f40568ff120bc3a4b7b99813081c8ac0c936fa64/watchdog-6.0.0-py3-none-win_amd64.whl", hash = "sha256:cbafb470cf848d93b5d013e2ecb245d4aa1c8fd0504e863ccefa32445359d680", size = 79070, upload-time = "2024-11-01T14:07:10.686Z" }, + { url = "https://files.pythonhosted.org/packages/33/e8/e40370e6d74ddba47f002a32919d91310d6074130fe4e17dabcafc15cbf1/watchdog-6.0.0-py3-none-win_ia64.whl", hash = "sha256:a1914259fa9e1454315171103c6a30961236f508b9b623eae470268bbcc6a22f", size = 79067, upload-time = "2024-11-01T14:07:11.845Z" }, +] + +[[package]] +name = "zarr-indexing" +source = { editable = "." } +dependencies = [ + { name = "numpy" }, +] + +[package.optional-dependencies] +testing = [ + { name = "hypothesis" }, +] + +[package.dev-dependencies] +docs = [ + { name = "griffe-inherited-docstrings" }, + { name = "mkdocs" }, + { name = "mkdocs-material" }, + { name = "mkdocstrings" }, + { name = "mkdocstrings-python" }, + { name = "ruff" }, +] +test = [ + { name = "hypothesis" }, + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [ + { name = "hypothesis", marker = "extra == 'testing'", specifier = ">=6.160.0" }, + { name = "numpy", specifier = ">=2" }, +] +provides-extras = ["testing"] + +[package.metadata.requires-dev] +docs = [ + { name = "griffe-inherited-docstrings", specifier = "==1.1.3" }, + { name = "mkdocs", specifier = "==1.6.1" }, + { name = "mkdocs-material", specifier = "==9.7.7" }, + { name = "mkdocstrings", specifier = "==1.0.6" }, + { name = "mkdocstrings-python", specifier = "==2.0.5" }, + { name = "ruff", specifier = "==0.15.22" }, +] +test = [ + { name = "hypothesis", specifier = ">=6.160.0" }, + { name = "pytest" }, +] From 47f09b1b9fd10052bae28d2eefb43211ba2484c2 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 12 Aug 2026 15:49:15 +0200 Subject: [PATCH 44/61] docs: add card for zarr-http-server (#4249) --- docs/subprojects.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/subprojects.md b/docs/subprojects.md index 1903f759d2..9f7951e836 100644 --- a/docs/subprojects.md +++ b/docs/subprojects.md @@ -32,4 +32,14 @@ without taking on `zarr` as a dependency. pip install zarr-indexing ``` +- [:material-server:{ .lg .middle } __zarr-http-server__](https://zarr.readthedocs.io/projects/zarr-http-server/) + + --- + + HTTP server for Zarr stores, arrays, and groups. + + ```bash + pip install zarr-http-server + ``` + From 5b9c09fcaa9359bc3eaa68c48eea7d31deb3dcd7 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 12 Aug 2026 16:30:21 +0200 Subject: [PATCH 45/61] fix(docs): build subpackage docs from the package directory (#4252) Read the Docs pointed `-f` at each package's mkdocs.yml from the repo root. mkdocs resolves some settings relative to the current working directory rather than to the config file, so building from elsewhere looks for them in the wrong place -- and silently, because the paths are valid, just wrong. zarr-indexing hit this at v0.2.0: `pymdownx.snippets` has a relative `base_path` of `[docs, examples]`, so `--8<-- "snippets/canonical_slice.py"` resolved against the repo root and searched zarr-python's own docs/ rather than the package's. The build failed with SnippetMissingError while `just docs-check` passed, because that runs from the package directory. Building from the package directory makes the Read the Docs invocation identical to the local and CI ones, so a green build there means a green build here. $READTHEDOCS_OUTPUT is absolute, so the cd does not affect where the site lands. Applied to all three packages. Only zarr-indexing is failing today; zarr-metadata and zarr-http-server do not use snippets, so for them this is preventive -- the hazard is any config resolved against the working directory, and it would show up only on Read the Docs. Assisted-by: ClaudeCode:claude-opus-5 --- packages/zarr-http-server/.readthedocs.yaml | 15 ++++++++++++++- packages/zarr-indexing/.readthedocs.yaml | 15 ++++++++++++++- packages/zarr-metadata/.readthedocs.yaml | 15 ++++++++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/packages/zarr-http-server/.readthedocs.yaml b/packages/zarr-http-server/.readthedocs.yaml index 62a1e82b77..efbda6852d 100644 --- a/packages/zarr-http-server/.readthedocs.yaml +++ b/packages/zarr-http-server/.readthedocs.yaml @@ -24,7 +24,20 @@ build: - pip install ./packages/zarr-http-server --group packages/zarr-http-server/pyproject.toml:docs build: html: - - mkdocs build --strict -f packages/zarr-http-server/mkdocs.yml --site-dir $READTHEDOCS_OUTPUT/html + # Build from inside the package rather than pointing `-f` at its config + # from the repo root. mkdocs resolves some settings relative to the + # current working directory rather than to the config file, so building + # from elsewhere looks for them in the wrong place -- and silently, since + # the paths are valid, just wrong. zarr-indexing hit this: with + # `pymdownx.snippets` and a relative `base_path`, its snippets were + # searched for under the repo-root docs/ and the build failed with + # SnippetMissingError, while `just docs-check` passed because it runs + # from here. Building from the package directory makes this identical to + # the local and CI invocations, so a green build there means a green + # build here. + # + # $READTHEDOCS_OUTPUT is absolute, so the cd does not affect it. + - cd packages/zarr-http-server && mkdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html mkdocs: configuration: packages/zarr-http-server/mkdocs.yml diff --git a/packages/zarr-indexing/.readthedocs.yaml b/packages/zarr-indexing/.readthedocs.yaml index b8c7b76e2b..c1925182f7 100644 --- a/packages/zarr-indexing/.readthedocs.yaml +++ b/packages/zarr-indexing/.readthedocs.yaml @@ -24,7 +24,20 @@ build: - pip install ./packages/zarr-indexing --group packages/zarr-indexing/pyproject.toml:docs build: html: - - mkdocs build --strict -f packages/zarr-indexing/mkdocs.yml --site-dir $READTHEDOCS_OUTPUT/html + # Build from inside the package rather than pointing `-f` at its config + # from the repo root. mkdocs resolves some settings relative to the + # current working directory rather than to the config file, so building + # from elsewhere looks for them in the wrong place -- and silently, since + # the paths are valid, just wrong. zarr-indexing hit this: with + # `pymdownx.snippets` and a relative `base_path`, its snippets were + # searched for under the repo-root docs/ and the build failed with + # SnippetMissingError, while `just docs-check` passed because it runs + # from here. Building from the package directory makes this identical to + # the local and CI invocations, so a green build there means a green + # build here. + # + # $READTHEDOCS_OUTPUT is absolute, so the cd does not affect it. + - cd packages/zarr-indexing && mkdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html mkdocs: configuration: packages/zarr-indexing/mkdocs.yml diff --git a/packages/zarr-metadata/.readthedocs.yaml b/packages/zarr-metadata/.readthedocs.yaml index ace6ccddfd..828773818c 100644 --- a/packages/zarr-metadata/.readthedocs.yaml +++ b/packages/zarr-metadata/.readthedocs.yaml @@ -24,7 +24,20 @@ build: - pip install ./packages/zarr-metadata --group packages/zarr-metadata/pyproject.toml:docs build: html: - - mkdocs build --strict -f packages/zarr-metadata/mkdocs.yml --site-dir $READTHEDOCS_OUTPUT/html + # Build from inside the package rather than pointing `-f` at its config + # from the repo root. mkdocs resolves some settings relative to the + # current working directory rather than to the config file, so building + # from elsewhere looks for them in the wrong place -- and silently, since + # the paths are valid, just wrong. zarr-indexing hit this: with + # `pymdownx.snippets` and a relative `base_path`, its snippets were + # searched for under the repo-root docs/ and the build failed with + # SnippetMissingError, while `just docs-check` passed because it runs + # from here. Building from the package directory makes this identical to + # the local and CI invocations, so a green build there means a green + # build here. + # + # $READTHEDOCS_OUTPUT is absolute, so the cd does not affect it. + - cd packages/zarr-metadata && mkdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html mkdocs: configuration: packages/zarr-metadata/mkdocs.yml From bd3e3986bb4acc3d06220a2285b1165f8e7b488b Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 12 Aug 2026 18:28:39 +0200 Subject: [PATCH 46/61] docs: link the zarr-http-server docs site, and fix dead links across subpackage READMEs - #287 (#4253) * docs(http-server): link the docs site and move the detail into it The README was 405 lines while the docs site was a 58-line scaffold -- inverted relative to the sibling packages, whose READMEs run 52-134 lines with the substance on Read the Docs. It also had no link to the site, which now exists. Adds `Documentation: ` at the top, matching where zarr-metadata and zarr-indexing put theirs, and moves the detailed sections into a new docs/guide.md: building apps, running them, several nodes, notebooks, Uvicorn configuration, CORS, byte ranges, read-only serving, writes and shutdown. The README keeps what a reader skimming PyPI needs -- what it is, install, a quick start, the build/run split, and the warning that store_app filters nothing. Fixes found while reviewing rather than moved verbatim: - docs/index.md paired store_app with serve and node_app with serve_background as though they were coupled. They are independent; either app runs under either runner. - docs/index.md sent readers to the README for worked examples, which is backwards now and would have been a loop. - The range section cited RFC 7233, obsoleted by RFC 9110, while the rest of the same section cited 9110. - Write examples used a bare `methods={"GET", "PUT"}` although the read-only section a few paragraphs earlier introduced READ_WRITE_HTTP_METHODS for exactly that. - "Read-only serving" and "Write support" restated each other; merged. - The API reference documented 8 of the 13 public names. Added ReadOnlyHTTPMethod, READ_ONLY_HTTP_METHODS, READ_WRITE_HTTP_METHODS, AUTO_PORT and DEFAULT_PORT -- the missing ReadOnlyHTTPMethod was also breaking a cross-reference from the new guide. Deep links use /en/latest/ rather than /en/stable/: verified to resolve, and it picks up this change as soon as the site rebuilds. (zarr-metadata's README links /en/stable/, which currently 404s.) Assisted-by: ClaudeCode:claude-opus-5 * docs: fix dead links in the subpackage READMEs Two broken links found by checking every URL in all three packages' READMEs and docs rather than only the one being edited. zarr-metadata's `Documentation:` link pointed at readthedocs.io/en/stable/, which 404s -- neither it nor zarr-indexing has a `stable` version. Dropped the version segment so it matches the other two and lets Read the Docs redirect to whatever the default is. `www.uvicorn.org` no longer resolves at all: the domain is gone, not merely moved, so it fails DNS rather than returning a 404. Uvicorn's own PyPI metadata now gives `https://uvicorn.dev/` as its homepage. Fixed in the zarr-http-server README and docs index, the only two places it appeared. Every other link in the three READMEs and their docs trees resolves. The two remaining 404s are this PR's own links to the not-yet-published guide page, which resolve once the site rebuilds. Assisted-by: ClaudeCode:claude-opus-5 --- packages/zarr-http-server/README.md | 408 ++------------------ packages/zarr-http-server/docs/api/index.md | 10 + packages/zarr-http-server/docs/guide.md | 393 +++++++++++++++++++ packages/zarr-http-server/docs/index.md | 51 ++- packages/zarr-http-server/mkdocs.yml | 1 + packages/zarr-metadata/README.md | 2 +- 6 files changed, 474 insertions(+), 391 deletions(-) create mode 100644 packages/zarr-http-server/docs/guide.md diff --git a/packages/zarr-http-server/README.md b/packages/zarr-http-server/README.md index 069b33abf8..53df0d2f50 100644 --- a/packages/zarr-http-server/README.md +++ b/packages/zarr-http-server/README.md @@ -2,12 +2,17 @@ HTTP server for Zarr stores, arrays, and groups. +Documentation: + `zarr-http-server` exposes a Zarr `Store`, `Array`, or `Group` over HTTP via an -ASGI app, so any HTTP-capable client (including zarr-python itself, via -`FsspecStore` or `ObjectStore`) can read the data. The app is built on +ASGI app, so any HTTP-capable client — including zarr-python itself, via +`FsspecStore` or `ObjectStore` — can read the data. The app is built on [Starlette](https://www.starlette.io/) and can be run with any ASGI server; the `serve` / `serve_background` helpers run it with -[Uvicorn](https://www.uvicorn.org/). +[Uvicorn](https://uvicorn.dev/). + +> [!WARNING] +> This package is experimental. Its API may change or be removed at any point. ## Installation @@ -15,391 +20,52 @@ the `serve` / `serve_background` helpers run it with pip install zarr-http-server ``` -### Building an ASGI App - -`store_app` creates an ASGI app that exposes every key -in a store. Only point it at a store whose full contents are safe to serve -publicly — it grants read (and, if `PUT` is enabled, write) access to -everything the store contains, with no per-key filtering: +## Quick start ```python -import zarr -from zarr_http_server import store_app - -store = zarr.storage.MemoryStore() -zarr.create_array(store, shape=(100, 100), chunks=(10, 10), dtype="float64") - -app = store_app(store) - -# Run with any ASGI server, e.g. Uvicorn: -# uvicorn my_module:app --host 0.0.0.0 --port 8000 -``` - -`node_app` creates an ASGI app that only serves keys -belonging to a specific `Array` or `Group`. Requests for keys outside the node -receive a 404, even if those keys exist in the underlying store: - -```python -import zarr -from zarr_http_server import node_app - -store = zarr.storage.MemoryStore() -root = zarr.open_group(store) -root.create_array("a", shape=(10,), dtype="int32") -root.create_array("b", shape=(20,), dtype="float64") - -# Only serve the array at "a" — requests for "b" will return 404. -arr = root["a"] -app = node_app(arr) -``` - -### Running the Server - -Build an app with `store_app` or `node_app`, then run it. `serve` blocks -until the server is stopped, which is the shape for a script or a container -entrypoint: - -```python -from zarr_http_server import serve, store_app - -serve(store_app(store), host="127.0.0.1", port=8000) -``` - -`serve_background` instead starts the server in a daemon thread and returns a -`BackgroundServer` as soon as the socket is listening, so the caller can carry -on. These are two functions rather than one with a flag, because they differ -in the only thing that matters at a call site: whether control comes back. The -handle is also a context manager: - -Both default to `port="auto"`, which prefers port 8000 but falls back to any -free port if it is taken, reporting the result through `server.url` and -uvicorn's startup line. An **explicit** port means the opposite — bind exactly -that or fail — because a caller who names one usually has a proxy or a -container port mapping expecting the server there, and silently moving would -break it while looking healthy. `port=0` keeps its usual meaning of "any free -port, no preference". - -The example below also *reads back* over HTTP, which is a client-side -concern: `zarr.open_array(server.url)` goes through `FsspecStore`, which needs -an HTTP-capable fsspec that `zarr-http-server` does not pull in. - -```bash -pip install "fsspec[http]" -``` - - -```python -import numpy as np - import zarr from zarr_http_server import node_app, serve_background -from zarr.storage import MemoryStore - -store = MemoryStore() -arr = zarr.create_array(store, shape=(100,), chunks=(10,), dtype="float64") -arr[:] = np.arange(100, dtype="float64") - -with serve_background(node_app(arr), host="127.0.0.1") as server: - # Now open the served array from another zarr client. - remote = zarr.open_array(server.url, mode="r") - np.testing.assert_array_equal(remote[:], arr[:]) -# Server is shut down automatically when the block exits. -``` - -### Serving Several Nodes - -Serving two arrays does not mean running two servers. Which approach fits -depends on where the arrays live. - -If they share a parent group, serve the parent — `node_app` recurses through -its members, so both are reachable under one port and node scoping still -applies to everything outside it: - -```python -server = serve_background(node_app(root)) -# -> /a/zarr.json, /a/c/0, /b/zarr.json, ... -``` - -If everything in the store is safe to expose, `store_app(store)` does the -same for the whole key space. - -Otherwise — arrays in *different* stores, or nodes that are not siblings — -`store_app` and `node_app` return plain Starlette apps, so mount them and run -the result: - -```python -from starlette.applications import Starlette -from starlette.routing import Mount - -from zarr_http_server import node_app, serve_background - -app = Starlette(routes=[ - Mount("/first", app=node_app(one)), - Mount("/second", app=node_app(other)), -]) -server = serve_background(app) -``` - -Each mount keeps its own validation, so a request under one cannot reach -another's data — `/first/../second/zarr.json` and its percent-encoded -spellings all return 404. - -Both runners take any ASGI app, so the split is clean: what an app *serves* -(`methods`, `cors_options`, `max_body_size`) is settled when the app is built, -while `serve` / `serve_background` only decide how it runs (`host`, `port`, -`shutdown_timeout`, `uvicorn_options`). - -### Serving from a Notebook - -A notebook needs a server that outlives the cell that started it, so the -`with serve_background(...)` form above is the wrong shape — it shuts the server down -as soon as the block ends. Start it, keep the handle, and stop it later: - -```python -# cell 1 — start -server = serve_background(node_app(array), host="127.0.0.1") -print(server.url) # e.g. http://127.0.0.1:54635 - -# cell 2..n — use it, across as many cells as you like -httpx.get(f"{server.url}/zarr.json") - -# last cell — stop -server.shutdown() -``` -Two things make this comfortable in a kernel you re-run. `serve_background` -runs Uvicorn in a daemon thread with its own event loop, so it never touches -the kernel's loop and cannot block it. And its default `port="auto"` falls -back to a free port when 8000 is taken — re-running a start cell without -stopping the previous server is the classic notebook mistake, and a fixed port -fails there with *address already in use*. `server.url` reports the port -actually bound. - -If you forget to stop one, the thread is a daemon, so restarting the kernel -always clears it — and since each start takes a fresh port, a forgotten server -does not block the next one. - -[`examples/serve_notebook.ipynb`](examples/serve_notebook.ipynb) is a runnable -version of this, covering metadata and chunk reads, byte ranges, and that -writes are refused by default. It is executed by the test suite, so it cannot -drift from the code. - -### Uvicorn Configuration - -`serve` and `serve_background` name the options most callers need — `host`, -`port`, `shutdown_timeout` — and forward anything else to -`uvicorn.Config` through `uvicorn_options`, so nothing uvicorn can do is out -of reach: - -```python -server = serve_background( - store_app(store), - host="0.0.0.0", - port=8443, - uvicorn_options={ - "ssl_keyfile": "key.pem", - "ssl_certfile": "cert.pem", - "proxy_headers": True, - "forwarded_allow_ips": "10.0.0.0/8", - "log_level": "warning", - }, -) -``` - -Keys you pass are merged over the ones set for you, so they win. `server.url` -reflects the scheme actually in use (`https` when TLS is configured) and is -`None` when the server is not bound to a TCP host and port — a `uds` or `fd` -bind has no URL to report. - -### CORS Support - -Both `store_app` and `node_app` accept a `CorsOptions` parameter to enable -[CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) middleware for -browser-based clients: - -```python -from zarr_http_server import CorsOptions, store_app - -app = store_app( - store, - cors_options=CorsOptions( - allow_origins=["*"], - allow_methods=["GET"], - ), -) -``` - -`CorsOptions` carries every parameter Starlette's `CORSMiddleware` accepts — -`allow_headers`, `allow_credentials`, `allow_origin_regex`, -`allow_private_network`, `expose_headers` and `max_age` as well as the two -above — so configuring CORS never means reaching around this package. All keys -are optional. - -Two defaults differ from Starlette's, because the server knows things the -caller should not have to. It emits `Content-Range` on every ranged response, -which is *not* a CORS-safelisted response header, so `expose_headers` defaults -to `["Content-Range"]` — otherwise a browser client can read the bytes but not -learn which bytes it got. And it accepts a `Range` request header, so -`allow_headers` defaults to `["Range"]` — otherwise a preflight naming `Range` -is rejected. A key you supply replaces the default outright, so -`expose_headers=[]` means "expose nothing". - -### HTTP Range Requests - -The server supports the standard `Range` header for partial reads. The three -forms defined by [RFC 7233](https://httpwg.org/specs/rfc7233.html) are supported: - -| Header | Meaning | -| -------------------- | ------------------------------ | -| `bytes=0-99` | First 100 bytes | -| `bytes=100-` | Everything from byte 100 | -| `bytes=-50` | Last 50 bytes | - -A successful range request returns HTTP 206 (Partial Content) with a -`Content-Range` header, including for suffix ranges — the server resolves -`bytes=-50` against the object's size so the response says which bytes it -carries. - -A range that is well-formed but names nothing readable — one lying wholly -beyond the end of the object, an inverted one such as `bytes=5-2`, or -`bytes=-0` — returns 416 (Range Not Satisfiable). A last-byte-position past -the end of the object is *not* in that category: per RFC 9110 §14.1.2 it is -clamped, so `bytes=0-999999` on a short object returns the whole thing. - -A `Range` header the server cannot use is **ignored** rather than refused, per -RFC 9110 §14.2: an unrecognized unit (`chars=0-7`), a multi-range request -(`bytes=0-7, 10-20`, which this server does not build multipart responses -for), or malformed syntax all return 200 with the full representation. - -### Read-only Serving - -Read-only is the default. `store_app(store)` and `node_app(node)` accept -`GET` and `HEAD` and answer **405** to `PUT`, `POST`, `DELETE` and `PATCH` — -no argument is needed to get there. - -`POST` is not merely unrouted, it is unconfigurable: the accepted methods are -`GET`, `HEAD` and `PUT`, and asking for anything else raises `ValueError` when -the app is built. There is no handler behavior for `POST`, so no configuration -can produce one. - -Two named sets let a call site state which it is, instead of leaving it to the -presence or absence of an argument: - -```python -from zarr_http_server import READ_ONLY_HTTP_METHODS, READ_WRITE_HTTP_METHODS, store_app - -app = store_app(store, methods=READ_ONLY_HTTP_METHODS) # GET, HEAD -app = store_app(store, methods=READ_WRITE_HTTP_METHODS) # GET, HEAD, PUT -``` - -The distinction also exists in the type domain. `ReadOnlyHTTPMethod` is a -`Literal["GET", "HEAD"]`, so a read-only set can be *declared* rather than -merely configured — a `frozenset[ReadOnlyHTTPMethod]` containing `"PUT"` is a -type error, not a runtime surprise: - -```python -from zarr_http_server import ReadOnlyHTTPMethod - -reads: frozenset[ReadOnlyHTTPMethod] = frozenset({"GET", "HEAD"}) # ok -reads = frozenset({"GET", "PUT"}) # type error -``` - -Both constants are derived from these Literals, so the runtime sets and the -static types cannot disagree about what the server serves. - -`READ_ONLY_HTTP_METHODS` is exactly the default, so passing it changes nothing -except that the intent is now written down. The practical value is the other -direction: a writable app *must* name a method set, so -`grep -r 'methods=' ` finds every place that opts into writes. - -For a guarantee that does not depend on getting `methods` right, make the -*store* read-only. The store refuses writes itself, so no routing mistake — -now or in a later edit — can produce one: - -```python -app = store_app(store.with_read_only(True)) - -# For a node, open it read-only and node_app inherits that store: -app = node_app(zarr.open_array(store, mode="r")) -``` - -These two layers are independent, and the store is the stronger one: it holds -even if the HTTP layer is misconfigured. Asking for both at once — -`methods={"GET", "PUT"}` on a read-only store — is a contradiction that can -never succeed, so it raises `ValueError` at construction rather than turning -into a 403 for whichever client tries to write first. - -### Write Support - -By default only reads are accepted: `GET`, and `HEAD` alongside it. Starlette -routes `HEAD` wherever `GET` goes, as RFC 9110 §9.3.2 asks of every origin -server, so naming `GET` gets you both — a `HEAD` is answered from the value's -size without transferring it. To enable writes, pass `methods={"GET", "PUT"}`: - -```python -app = store_app(store, methods={"GET", "PUT"}) -``` - -Accepted methods are `GET`, `HEAD`, and `PUT`; anything else raises -`ValueError` when the app is built, since the handler has no behavior for it. - -A `PUT` request stores the request body at the given path and returns 204 (No -Content). Bodies are capped at `DEFAULT_MAX_BODY_SIZE` (256 MiB) and a larger -one returns 413 (Content Too Large) -- `Store.set` takes a whole buffer, so an -accepted body is held in memory in full. Raise or remove the cap with -`max_body_size`: - -```python -from zarr_http_server import DEFAULT_MAX_BODY_SIZE, store_app +store = zarr.storage.MemoryStore() +array = zarr.create_array(store, shape=(100,), chunks=(10,), dtype="float64") -app = store_app(store, methods={"GET", "PUT"}, max_body_size=None) +with serve_background(node_app(array)) as server: + print(server.url) # e.g. http://127.0.0.1:8000 ``` -Note that `store_app` exposes every key in the store, so `PUT` grants -unrestricted write access to all of it. `node_app` confines writes to keys -belonging to the node -- though a client that can write a node's metadata can -change what that node contains, and so what it will serve. - -`store_app` also does not *validate* keys, because it proxies the store's raw -key space and has no array semantics to check against. A client that misspells -a chunk key — `c/00/00` where zarr writes `c/0/0` — gets a successful write to -a key no reader will ever consult, so the data is stored but invisible to -anyone opening the array. `node_app` rejects such a key with 404, since it -knows which node it is serving and therefore which keys are real. If you are -serving a zarr hierarchy to clients you do not control and writes are enabled, -prefer `node_app`. +Building an app and running it are separate steps, and either app works with +either runner: -### Shutting Down +- **Build** with `store_app` to serve every key in a store, or `node_app` to + serve only the keys belonging to one `Array` or `Group` — requests for keys + outside that node return 404 even when those keys exist in the underlying + store. +- **Run** with `serve`, which blocks, or `serve_background`, which returns a + handle you can shut down later. -`BackgroundServer.shutdown()` (and leaving the `with` block) waits up to -`shutdown_timeout` seconds -- 5 by default -- for in-flight requests to finish -before forcing the server closed: +Reads are all that is enabled by default: `GET` and `HEAD` are served, and +`PUT`, `POST`, `DELETE` and `PATCH` are answered with 405. -```python -with serve_background(node_app(arr), shutdown_timeout=30) as server: - ... -``` +> [!CAUTION] +> `store_app` applies no per-key filtering. Only point it at a store whose full +> contents are safe to serve, and note that enabling `PUT` grants write access +> to everything the store contains. The +> [user guide](https://zarr-http-server.readthedocs.io/en/latest/guide/#read-only-serving) +> covers the read-only guarantees available. -## Example +The [user guide](https://zarr-http-server.readthedocs.io/en/latest/guide/) +covers byte ranges, CORS, writes, serving several nodes, running from a +notebook, and Uvicorn configuration. -`examples/serve.py` creates an in-memory Zarr array, serves it over HTTP with -`serve_background`, and fetches the `zarr.json` metadata document and a raw chunk -using `httpx`. +## Examples -`examples/serve_notebook.ipynb` is the notebook equivalent, showing how to -start a server in one cell and stop it in another. Both are executed by the -test suite. - -Running it with uv is the simplest route — the script declares its own -dependencies inline, so uv installs them for you: +[`examples/`](examples/) holds a runnable script and a notebook, both executed +by the test suite so neither can drift from the code: ```bash uv run examples/serve.py ``` -To run it with a plain interpreter, install its `httpx` dependency first: +## License -```bash -pip install httpx -python examples/serve.py -``` +MIT — see [LICENSE.txt](LICENSE.txt). diff --git a/packages/zarr-http-server/docs/api/index.md b/packages/zarr-http-server/docs/api/index.md index 749e11b964..ce5d748b26 100644 --- a/packages/zarr-http-server/docs/api/index.md +++ b/packages/zarr-http-server/docs/api/index.md @@ -28,4 +28,14 @@ and carry no compatibility guarantee. ::: zarr_http_server.HTTPMethod +::: zarr_http_server.ReadOnlyHTTPMethod + +::: zarr_http_server.READ_ONLY_HTTP_METHODS + +::: zarr_http_server.READ_WRITE_HTTP_METHODS + +::: zarr_http_server.AUTO_PORT + +::: zarr_http_server.DEFAULT_PORT + ::: zarr_http_server.DEFAULT_MAX_BODY_SIZE diff --git a/packages/zarr-http-server/docs/guide.md b/packages/zarr-http-server/docs/guide.md new file mode 100644 index 0000000000..d52d5b882d --- /dev/null +++ b/packages/zarr-http-server/docs/guide.md @@ -0,0 +1,393 @@ +--- +title: User guide +--- + +# User guide + +## Building an ASGI app + +[`store_app`][zarr_http_server.store_app] creates an ASGI app that exposes +every key in a store. Only point it at a store whose full contents are safe to +serve publicly — it grants read (and, if `PUT` is enabled, write) access to +everything the store contains, with no per-key filtering: + +```python +import zarr +from zarr_http_server import store_app + +store = zarr.storage.MemoryStore() +zarr.create_array(store, shape=(100, 100), chunks=(10, 10), dtype="float64") + +app = store_app(store) + +# Run with any ASGI server, e.g. Uvicorn: +# uvicorn my_module:app --host 0.0.0.0 --port 8000 +``` + +[`node_app`][zarr_http_server.node_app] creates an ASGI app that only serves +keys belonging to a specific `Array` or `Group`. Requests for keys outside the +node receive a 404, even if those keys exist in the underlying store: + +```python +import zarr +from zarr_http_server import node_app + +store = zarr.storage.MemoryStore() +root = zarr.open_group(store) +root.create_array("a", shape=(10,), dtype="int32") +root.create_array("b", shape=(20,), dtype="float64") + +# Only serve the array at "a" — requests for "b" will return 404. +app = node_app(root["a"]) +``` + +## Running the server + +Build an app, then run it. Either app works with either runner. + +[`serve`][zarr_http_server.serve] blocks until the server is stopped, which is +the shape for a script or a container entrypoint: + +```python +from zarr_http_server import serve, store_app + +serve(store_app(store), host="127.0.0.1", port=8000) +``` + +[`serve_background`][zarr_http_server.serve_background] instead starts the +server in a daemon thread and returns a +[`BackgroundServer`][zarr_http_server.BackgroundServer] as soon as the socket +is listening, so the caller can carry on. These are two functions rather than +one with a flag, because they differ in the only thing that matters at a call +site: whether control comes back. + +### Choosing a port + +Both default to `port="auto"`, which prefers port 8000 but falls back to any +free port if it is taken, reporting the result through `server.url` and +Uvicorn's startup line. An **explicit** port means the opposite — bind exactly +that or fail — because a caller who names one usually has a proxy or a +container port mapping expecting the server there, and silently moving would +break it while looking healthy. `port=0` keeps its usual meaning of "any free +port, no preference". + +### Reading back with a zarr client + +`BackgroundServer` is a context manager, so the server stops when the block +exits. The example below also *reads back* over HTTP, which is a client-side +concern: `zarr.open_array(server.url)` goes through `FsspecStore`, which needs +an HTTP-capable fsspec that `zarr-http-server` does not pull in +(`pip install "fsspec[http]"`). + +```python +import numpy as np +import zarr +from zarr.storage import MemoryStore + +from zarr_http_server import node_app, serve_background + +store = MemoryStore() +arr = zarr.create_array(store, shape=(100,), chunks=(10,), dtype="float64") +arr[:] = np.arange(100, dtype="float64") + +with serve_background(node_app(arr), host="127.0.0.1") as server: + remote = zarr.open_array(server.url, mode="r") + np.testing.assert_array_equal(remote[:], arr[:]) +# Server is shut down automatically when the block exits. +``` + +### Shutting down + +`BackgroundServer.shutdown()` — and leaving the `with` block — waits up to +`shutdown_timeout` seconds, 5 by default, for in-flight requests to finish +before forcing the server closed. It raises if the thread will not stop, so a +silent failure cannot leave you believing the port is free when it is not. + +```python +with serve_background(node_app(arr), shutdown_timeout=30) as server: + ... +``` + +## Serving several nodes + +Serving two arrays does not mean running two servers. Which approach fits +depends on where the arrays live. + +If they share a parent group, serve the parent — `node_app` recurses through +its members, so both are reachable under one port and node scoping still +applies to everything outside it: + +```python +server = serve_background(node_app(root)) +# -> /a/zarr.json, /a/c/0, /b/zarr.json, ... +``` + +If everything in the store is safe to expose, `store_app(store)` does the same +for the whole key space. + +Otherwise — arrays in *different* stores, or nodes that are not siblings — +`store_app` and `node_app` return plain Starlette apps, so mount them and run +the result: + +```python +from starlette.applications import Starlette +from starlette.routing import Mount + +from zarr_http_server import node_app, serve_background + +app = Starlette(routes=[ + Mount("/first", app=node_app(one)), + Mount("/second", app=node_app(other)), +]) +server = serve_background(app) +``` + +Each mount keeps its own validation, so a request under one cannot reach +another's data — `/first/../second/zarr.json` and its percent-encoded spellings +all return 404. + +Both runners take any ASGI app, so the split is clean: what an app *serves* +(`methods`, `cors_options`, `max_body_size`) is settled when the app is built, +while `serve` / `serve_background` only decide how it runs (`host`, `port`, +`shutdown_timeout`, `uvicorn_options`). + +## Serving from a notebook + +A notebook needs a server that outlives the cell that started it, so the `with` +form above is the wrong shape — it shuts the server down as soon as the block +ends. Start it, keep the handle, and stop it later: + +```python +# cell 1 — start +server = serve_background(node_app(array), host="127.0.0.1") +print(server.url) # e.g. http://127.0.0.1:54635 + +# cell 2..n — use it, across as many cells as you like +httpx.get(f"{server.url}/zarr.json") + +# last cell — stop +server.shutdown() +``` + +Two things make this comfortable in a kernel you re-run. `serve_background` +runs Uvicorn in a daemon thread with its own event loop, so it never touches +the kernel's loop and cannot block it. And its default `port="auto"` falls back +to a free port when 8000 is taken — re-running a start cell without stopping +the previous server is the classic notebook mistake, and a fixed port fails +there with *address already in use*. `server.url` reports the port actually +bound. + +If you forget to stop one, the thread is a daemon, so restarting the kernel +always clears it — and since each start takes a fresh port, a forgotten server +does not block the next one. + +[`examples/serve_notebook.ipynb`](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/examples/serve_notebook.ipynb) +is a runnable version of this. It is executed by the test suite, so it cannot +drift from the code. + +## Uvicorn configuration + +`serve` and `serve_background` name the options most callers need — `host`, +`port`, `shutdown_timeout` — and forward anything else to `uvicorn.Config` +through `uvicorn_options`, so nothing Uvicorn can do is out of reach: + +```python +server = serve_background( + store_app(store), + host="0.0.0.0", + port=8443, + uvicorn_options={ + "ssl_keyfile": "key.pem", + "ssl_certfile": "cert.pem", + "proxy_headers": True, + "forwarded_allow_ips": "10.0.0.0/8", + "log_level": "warning", + }, +) +``` + +Keys you pass are merged over the ones set for you, so they win. `server.url` +reflects the scheme actually in use (`https` when TLS is configured) and is +`None` when the server is not bound to a TCP host and port — a `uds` or `fd` +bind has no URL to report. + +## CORS + +Both app builders accept a [`CorsOptions`][zarr_http_server.CorsOptions] +parameter to enable +[CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) middleware for +browser-based clients: + +```python +from zarr_http_server import CorsOptions, store_app + +app = store_app( + store, + cors_options=CorsOptions( + allow_origins=["*"], + allow_methods=["GET"], + ), +) +``` + +`CorsOptions` carries every parameter Starlette's `CORSMiddleware` accepts — +`allow_headers`, `allow_credentials`, `allow_origin_regex`, +`allow_private_network`, `expose_headers` and `max_age` as well as the two +above — so configuring CORS never means reaching around this package. All keys +are optional. + +Two defaults differ from Starlette's, because the server knows things the +caller should not have to. It emits `Content-Range` on every ranged response, +which is *not* a CORS-safelisted response header, so `expose_headers` defaults +to `["Content-Range"]` — otherwise a browser client can read the bytes but not +learn which bytes it got. And it accepts a `Range` request header, so +`allow_headers` defaults to `["Range"]` — otherwise a preflight naming `Range` +is rejected. A key you supply replaces the default outright, so +`expose_headers=[]` means "expose nothing". + +`allow_methods` is checked against what the app actually serves: advertising a +method the route rejects raises `ValueError`, and `"*"` expands to what is +served rather than to every verb Starlette knows. + +## HTTP range requests + +The server supports the standard `Range` header for partial reads. The three +forms defined by [RFC 9110](https://httpwg.org/specs/rfc9110.html#field.range) +are supported: + +| Header | Meaning | +| ------------ | ------------------------ | +| `bytes=0-99` | First 100 bytes | +| `bytes=100-` | Everything from byte 100 | +| `bytes=-50` | Last 50 bytes | + +A successful range request returns HTTP 206 (Partial Content) with a +`Content-Range` header, including for suffix ranges — the server resolves +`bytes=-50` against the object's size so the response says which bytes it +carries. + +A range that is well-formed but names nothing readable — one lying wholly +beyond the end of the object, an inverted one such as `bytes=5-2`, or +`bytes=-0` — returns 416 (Range Not Satisfiable). A last-byte-position past the +end of the object is *not* in that category: per RFC 9110 §14.1.2 it is +clamped, so `bytes=0-999999` on a short object returns the whole thing. + +A `Range` header the server cannot use is **ignored** rather than refused, per +RFC 9110 §14.2: an unrecognized unit (`chars=0-7`), a multi-range request +(`bytes=0-7, 10-20`, which this server does not build multipart responses for), +or malformed syntax all return 200 with the full representation. + +## Read-only serving + +Read-only is the default. `store_app(store)` and `node_app(node)` accept `GET` +and `HEAD` and answer **405** to `PUT`, `POST`, `DELETE` and `PATCH` — no +argument is needed to get there. `HEAD` is served wherever `GET` is, as RFC +9110 §9.3.2 asks of every origin server, and is answered from the value's size +without transferring it. + +`POST` is not merely unrouted, it is unconfigurable: the accepted methods are +`GET`, `HEAD` and `PUT`, and asking for anything else raises `ValueError` when +the app is built. + +Two named sets let a call site state which it is, instead of leaving it to the +presence or absence of an argument: + +```python +from zarr_http_server import READ_ONLY_HTTP_METHODS, READ_WRITE_HTTP_METHODS, store_app + +app = store_app(store, methods=READ_ONLY_HTTP_METHODS) # GET, HEAD +app = store_app(store, methods=READ_WRITE_HTTP_METHODS) # GET, HEAD, PUT +``` + +The distinction also exists in the type domain. +[`ReadOnlyHTTPMethod`][zarr_http_server.ReadOnlyHTTPMethod] is a +`Literal["GET", "HEAD"]`, so a read-only set can be *declared* rather than +merely configured — a `frozenset[ReadOnlyHTTPMethod]` containing `"PUT"` is a +type error, not a runtime surprise: + +```python +from zarr_http_server import ReadOnlyHTTPMethod + +reads: frozenset[ReadOnlyHTTPMethod] = frozenset({"GET", "HEAD"}) # ok +reads = frozenset({"GET", "PUT"}) # type error +``` + +Both constants are derived from those Literals, so the runtime sets and the +static types cannot disagree about what the server serves. + +`READ_ONLY_HTTP_METHODS` is exactly the default, so passing it changes nothing +except that the intent is written down. The practical value is the other +direction: a writable app *must* name a method set, so `grep -r 'methods='` +finds every place that opts into writes. + +For a guarantee that does not depend on getting `methods` right, make the +*store* read-only. The store refuses writes itself, so no routing mistake — now +or in a later edit — can produce one: + +```python +app = store_app(store.with_read_only(True)) + +# For a node, open it read-only and node_app inherits that store: +app = node_app(zarr.open_array(store, mode="r")) +``` + +These two layers are independent, and the store is the stronger one: it holds +even if the HTTP layer is misconfigured. Asking for both at once — +`READ_WRITE_HTTP_METHODS` on a read-only store — is a contradiction that can +never succeed, so it raises `ValueError` at construction rather than turning +into a 403 for whichever client tries to write first. + +## Writes + +To enable writes, name a method set that includes `PUT`: + +```python +from zarr_http_server import READ_WRITE_HTTP_METHODS, store_app + +app = store_app(store, methods=READ_WRITE_HTTP_METHODS) +``` + +A `PUT` stores the request body at the given path and returns 204 (No Content). +Bodies are capped at +[`DEFAULT_MAX_BODY_SIZE`][zarr_http_server.DEFAULT_MAX_BODY_SIZE] (256 MiB) and +a larger one returns 413 (Content Too Large) — `Store.set` takes a whole +buffer, so an accepted body is held in memory in full. Raise or remove the cap +with `max_body_size`: + +```python +app = store_app(store, methods=READ_WRITE_HTTP_METHODS, max_body_size=None) +``` + +!!! danger "Writes through `store_app` are unvalidated" + + `store_app` exposes every key in the store, so `PUT` grants unrestricted + write access to all of it. It also does not *validate* keys, because it + proxies the raw key space and has no array semantics to check against: a + client that misspells a chunk key — `c/00/00` where zarr writes `c/0/0` — + gets a successful write to a key no reader will ever consult, so the data + is stored but invisible to anyone opening the array. + + `node_app` rejects such a key with 404, since it knows which node it is + serving and therefore which keys are real. If you are serving a zarr + hierarchy to clients you do not control and writes are enabled, prefer + `node_app`. + + Note also that a client that can write a node's metadata can change what + that node contains, and so what it will serve. + +## Examples + +Both live in +[`examples/`](https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-http-server/examples) +and are executed by the test suite, so neither can drift from the code. + +`serve.py` creates an in-memory Zarr array, serves it, and fetches the +`zarr.json` metadata document and a raw chunk with `httpx`. It declares its own +dependencies inline, so uv installs them for you: + +```bash +uv run examples/serve.py +``` + +`serve_notebook.ipynb` is the notebook equivalent, showing how to start a +server in one cell and stop it in another. diff --git a/packages/zarr-http-server/docs/index.md b/packages/zarr-http-server/docs/index.md index 5671c12d00..271de6445e 100644 --- a/packages/zarr-http-server/docs/index.md +++ b/packages/zarr-http-server/docs/index.md @@ -22,37 +22,50 @@ ASGI app, so any HTTP-capable client — including zarr-python itself, via `FsspecStore` or `ObjectStore` — can read the data. The app is built on [Starlette](https://www.starlette.io/) and can be run with any ASGI server; the `serve` / `serve_background` helpers run it with -[Uvicorn](https://www.uvicorn.org/). +[Uvicorn](https://uvicorn.dev/). -Two levels of exposure are available: +Building an app and running it are separate steps, and either app works with +either runner: -- **Whole store** ([`store_app`][zarr_http_server.store_app], - run with [`serve`][zarr_http_server.serve]) — serves every key in a - store, exposing its entire key/value space. -- **Single node** ([`node_app`][zarr_http_server.node_app], - run with [`serve_background`][zarr_http_server.serve_background]) — serves only the keys - belonging to one `Array` or `Group`. Requests for keys outside that node +- **Build** with [`store_app`][zarr_http_server.store_app] to serve every key + in a store, or [`node_app`][zarr_http_server.node_app] to serve only the keys + belonging to one `Array` or `Group` — requests for keys outside that node return 404 even when those keys exist in the underlying store. +- **Run** with [`serve`][zarr_http_server.serve], which blocks, or + [`serve_background`][zarr_http_server.serve_background], which returns a + handle you can shut down later. Byte-range reads, configurable CORS headers, and a configurable set of allowed HTTP methods are handled by the app. -!!! danger "Serving a whole store grants access to all of it" +## Quick start + +```python +import zarr +from zarr_http_server import node_app, serve_background + +store = zarr.storage.MemoryStore() +array = zarr.create_array(store, shape=(100,), chunks=(10,), dtype="float64") - `store_app` applies no per-key filtering. Only point it - at a store whose full contents are safe to serve, and note that enabling - `PUT` grants write access to everything the store contains. +with serve_background(node_app(array)) as server: + print(server.url) # e.g. http://127.0.0.1:8000 +``` + +Reads are all that is enabled by default: `GET` and `HEAD` are served, and +`PUT`, `POST`, `DELETE` and `PATCH` are answered with 405. -## Getting started +!!! danger "Serving a whole store grants access to all of it" -The [README](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/README.md) -carries worked examples for building an ASGI app, running a blocking or -background server, and configuring CORS and allowed methods. Runnable -versions live in -[`examples/`](https://github.com/zarr-developers/zarr-python/tree/main/packages/zarr-http-server/examples). + `store_app` applies no per-key filtering. Only point it at a store whose + full contents are safe to serve, and note that enabling `PUT` grants write + access to everything the store contains. See + [read-only serving](guide.md#read-only-serving) for the guarantees + available. -## Reference +## Next steps +- [User guide](guide.md) — building apps, running them, byte ranges, CORS, + writes, notebooks, and Uvicorn configuration - [API reference](api/index.md) - [Changelog](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/CHANGELOG.md) - [License (MIT)](https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/LICENSE.txt) diff --git a/packages/zarr-http-server/mkdocs.yml b/packages/zarr-http-server/mkdocs.yml index 4e7843f36d..7ebfe8c017 100644 --- a/packages/zarr-http-server/mkdocs.yml +++ b/packages/zarr-http-server/mkdocs.yml @@ -13,6 +13,7 @@ use_directory_urls: true nav: - index.md + - guide.md - API Reference: - api/index.md - Changelog: https://github.com/zarr-developers/zarr-python/blob/main/packages/zarr-http-server/CHANGELOG.md diff --git a/packages/zarr-metadata/README.md b/packages/zarr-metadata/README.md index 34c53988db..6b6b172aec 100644 --- a/packages/zarr-metadata/README.md +++ b/packages/zarr-metadata/README.md @@ -2,7 +2,7 @@ Python types, models, and validators for Zarr v2 and v3 metadata. -Documentation: +Documentation: ## What this is From 6ba6e891d103b42d40849de229183fea26745231 Mon Sep 17 00:00:00 2001 From: Johnson K C Date: Wed, 12 Aug 2026 12:29:12 -0700 Subject: [PATCH 47/61] fix: allow `require_array` to accept a `ZDType` (#4189) * fix: allow `require_array` to accept a `ZDType` AsyncGroup.require_array normalised its dtype with np.dtype(), which cannot consume a ZDType, so requiring an existing array with one raised a TypeError. Every sibling creation method already accepts ZDTypeLike. Widen the annotation and normalise via parse_data_type().to_native_dtype(). parse_data_type(None) resolves to float64 just as np.dtype(None) did, so the default is unchanged. This leaves numpy.typing unused, so drop it. * chore: rename changelog fragment to the PR number * fix: keep the float64 default explicit for mypy parse_data_type does not accept None, so pass "float64" directly, which is what np.dtype(None) resolved to before. * test: parametrize require_array dtype cases over (input, expected) pairs Covers the `dtype=None` path, which resolves to float64 and was previously untested, and asserts on the resulting ZDType rather than the native dtype. --------- Co-authored-by: Davis Bennett --- changes/4189.bugfix.md | 1 + src/zarr/core/group.py | 15 ++++++++++----- tests/test_group.py | 25 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 changes/4189.bugfix.md diff --git a/changes/4189.bugfix.md b/changes/4189.bugfix.md new file mode 100644 index 0000000000..76ef7e7a5e --- /dev/null +++ b/changes/4189.bugfix.md @@ -0,0 +1 @@ +Allow `Group.require_array` to accept a `ZDType` for `dtype`, matching the other array creation methods. Previously an existing array could only be required with a string or NumPy dtype. diff --git a/src/zarr/core/group.py b/src/zarr/core/group.py index 65f7767a29..548f2141d2 100644 --- a/src/zarr/core/group.py +++ b/src/zarr/core/group.py @@ -10,7 +10,6 @@ from typing import TYPE_CHECKING, Literal, assert_never, cast, overload import numpy as np -import numpy.typing as npt import zarr.api.asynchronous as async_api from zarr.abc.metadata import Metadata @@ -46,6 +45,7 @@ parse_shapelike, ) from zarr.core.config import config +from zarr.core.dtype import parse_data_type from zarr.core.metadata import ArrayV2Metadata, ArrayV3Metadata from zarr.core.metadata.io import save_metadata from zarr.core.sync import SyncMixin, sync @@ -1225,7 +1225,7 @@ async def require_array( name: str, *, shape: ShapeLike, - dtype: npt.DTypeLike | None = None, + dtype: ZDTypeLike | None = None, exact: bool = False, **kwargs: Any, ) -> AnyAsyncArray: @@ -1239,8 +1239,9 @@ async def require_array( Array name. shape : int or tuple of ints Array shape. - dtype : str or dtype, optional - NumPy dtype. + dtype : ZDTypeLike, optional + The data type of the array, given as a string, a NumPy dtype, or a + Zarr data type. exact : bool, optional If True, require `dtype` to match exactly. If false, require `dtype` can be cast from array dtype. @@ -1258,7 +1259,11 @@ async def require_array( if shape != ds.shape: raise TypeError(f"Incompatible shape ({ds.shape} vs {shape})") - dtype = np.dtype(dtype) + # `np.dtype(None)` used to resolve to float64 here; keep that default. + dtype = parse_data_type( + "float64" if dtype is None else dtype, + zarr_format=self.metadata.zarr_format, + ).to_native_dtype() if exact: if ds.dtype != dtype: raise TypeError(f"Incompatible dtype ({ds.dtype} vs {dtype})") diff --git a/tests/test_group.py b/tests/test_group.py index 29377a5392..f7f2333ef5 100644 --- a/tests/test_group.py +++ b/tests/test_group.py @@ -24,6 +24,7 @@ from zarr.core._info import GroupInfo from zarr.core.buffer import default_buffer_prototype from zarr.core.config import config as zarr_config +from zarr.core.dtype import Float64, Int32 from zarr.core.dtype.common import unpack_dtype_json from zarr.core.dtype.npy.int import UInt8 from zarr.core.group import ( @@ -61,6 +62,7 @@ from zarr.core.buffer.core import Buffer from zarr.core.common import JSON, ZarrFormat + from zarr.core.dtype import ZDType, ZDTypeLike @pytest.fixture(params=["local", "memory", "zip"]) @@ -1439,6 +1441,29 @@ async def test_require_array(store: Store, zarr_format: ZarrFormat) -> None: await root.require_array("bar", shape=(10,), dtype="int8") +@pytest.mark.parametrize( + ("dtype", "expected"), + [ + (Int32(), Int32()), + (np.dtype("int32"), Int32()), + ("int32", Int32()), + (None, Float64()), + ], + ids=["zdtype", "numpy", "str", "none"], +) +async def test_require_array_zdtype( + store: Store, zarr_format: ZarrFormat, dtype: ZDTypeLike | None, expected: ZDType[Any, Any] +) -> None: + """An existing array can be required with a ZDType, as well as a string, a NumPy dtype, + or None. See https://github.com/zarr-developers/zarr-python/issues/3377 + """ + root = await AsyncGroup.from_store(store=store, zarr_format=zarr_format) + await root.create_array("foo", shape=(10,), dtype=expected) + + foo = await root.require_array("foo", shape=(10,), dtype=dtype, exact=True) + assert foo._zdtype == expected + + @pytest.mark.parametrize("consolidate", [True, False]) async def test_members_name(store: Store, consolidate: bool, zarr_format: ZarrFormat): group = Group.from_store(store=store, zarr_format=zarr_format) From d3dc9f527e5b4b75ca492948c820a57be50aa199 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Wed, 12 Aug 2026 21:56:29 +0200 Subject: [PATCH 48/61] fix: accept numpy integers as chunk sizes (#4257) * fix: accept numpy integers as chunk sizes `normalize_chunks_nd` dispatches the scalar convenience form on `numbers.Integral`, but `normalize_chunks_1d` narrowed on `int`. Numpy integer scalars satisfy the former and not the latter, so a per-dimension numpy integer passed the outer dispatch and then fell into the branch meant for explicit per-dimension chunk sequences, where `list(chunks)` raised `TypeError: 'numpy.int64' object is not iterable`. Numpy integers arise naturally whenever a chunk shape is computed rather than written as a literal, since numpy reductions and elementwise ops yield numpy scalars. Narrow on `numbers.Integral` and coerce with `int()`, matching the caller and the sequence branch, which already accepted `Integral` elements. Move the `-1` sentinel check inside that branch. It previously ran on the raw input, so a numpy array chunk specification made `chunks == -1` return an array and raise an ambiguous-truth-value error; rectilinear specs given as numpy arrays now work. A chunk specification that is neither an integer nor iterable now names the offending value and its type instead of surfacing an opaque "object is not iterable" from `list(chunks)`. Fixes #4255 Assisted-by: ClaudeCode:claude-opus-5 * Rename 4255.bugfix.md to 4257.bugfix.md --- changes/4257.bugfix.md | 1 + src/zarr/core/chunk_grids.py | 27 ++++++++++++++++++--------- tests/test_api.py | 2 +- tests/test_chunk_grids.py | 24 ++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 changes/4257.bugfix.md diff --git a/changes/4257.bugfix.md b/changes/4257.bugfix.md new file mode 100644 index 0000000000..6f2740ccb4 --- /dev/null +++ b/changes/4257.bugfix.md @@ -0,0 +1 @@ +Numpy integers are accepted as chunk sizes again. Since 3.3.0 a per-dimension chunk size that was a numpy integer (e.g. `chunks=(np.int64(2), np.int64(2))`, as produced by any computed chunk shape) raised `TypeError: 'numpy.int64' object is not iterable`, because the scalar chunk path narrowed on `int` while its caller dispatched on `numbers.Integral`. Numpy arrays are now also accepted as chunk specifications, and a chunk specification that is neither an integer nor iterable now reports the offending value instead of failing with an opaque iteration error. diff --git a/src/zarr/core/chunk_grids.py b/src/zarr/core/chunk_grids.py index 2cb9762775..584829bc6c 100644 --- a/src/zarr/core/chunk_grids.py +++ b/src/zarr/core/chunk_grids.py @@ -729,17 +729,26 @@ def normalize_chunks_1d( overhang the span. The actual data extent of each chunk is determined by the chunk grid at runtime, not by this function. """ - if chunks == -1: - return np.array([span], dtype=np.int64) - if isinstance(chunks, int): - if chunks <= 0: - raise ValueError(f"Chunk size must be positive, got {chunks}") + # `numbers.Integral` rather than `int` so that numpy integer scalars (which are not + # `int` subclasses) take the uniform-chunk path instead of being treated as a sequence. + if isinstance(chunks, numbers.Integral): + chunk_size = int(chunks) + if chunk_size == -1: + return np.array([span], dtype=np.int64) + if chunk_size <= 0: + raise ValueError(f"Chunk size must be positive, got {chunk_size}") if span == 0: - return np.array([chunks], dtype=np.int64) - n = ceildiv(span, chunks) - return np.full(n, chunks, dtype=np.int64) + return np.array([chunk_size], dtype=np.int64) + n = ceildiv(span, chunk_size) + return np.full(n, chunk_size, dtype=np.int64) else: - chunk_list = list(chunks) + try: + chunk_list = list(chunks) # type: ignore[arg-type] + except TypeError: + raise TypeError( + f"Chunk specification must be an integer or an iterable of integers; got " + f"{chunks!r} of type {type(chunks).__name__}." + ) from None if not chunk_list: raise ValueError("Chunk specification must not be empty") non_int = [ diff --git a/tests/test_api.py b/tests/test_api.py index 2b831e942d..45d0c0dee4 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -79,7 +79,7 @@ def test_create(memory_store: Store) -> None: z = create(shape=(400.5, 100), store=store, overwrite=True) # type: ignore[arg-type] # create array with float chunk shape - with pytest.raises(TypeError, match="'float' object is not iterable"): + with pytest.raises(TypeError, match="Chunk specification must be an integer or an iterable"): z = create(shape=(400, 100), chunks=(16, 16.5), store=store, overwrite=True) # type: ignore[arg-type] diff --git a/tests/test_chunk_grids.py b/tests/test_chunk_grids.py index b730a43901..4640c43d1c 100644 --- a/tests/test_chunk_grids.py +++ b/tests/test_chunk_grids.py @@ -68,6 +68,15 @@ def test_guess_chunks(shape: tuple[int, ...], itemsize: int) -> None: (10, (0,), ((10,),)), ((5, 10), (0, 100), ((5,), (10,) * 10)), ((5, 10), (20, 0), ((5, 5, 5, 5), (10,))), + # numpy integers are accepted anywhere a python int is, whether as the scalar + # convenience form, as per-dimension entries, or as the `-1` sentinel. + (np.int64(10), (100,), ((10,) * 10,)), + ((np.int64(2), np.int64(2)), (4, 4), ((2, 2), (2, 2))), + ((1, 3, np.int64(16), np.int64(16)), (1, 3, 32, 32), ((1,), (3,), (16, 16), (16, 16))), + ((np.int32(30), np.int64(-1)), (100, 20), ((30, 30, 30, 30), (20,))), + (np.array([10, 10]), (100, 100), ((10,) * 10, (10,) * 10)), + # rectilinear chunks given as numpy arrays + ((np.array([60, 40]), np.array([50, 50])), (100, 100), ((60, 40), (50, 50))), ], ) def test_normalize_chunks( @@ -142,7 +151,22 @@ def test_chunk_layout_nested() -> None: id="negative-uniform", msg="Chunk size must be positive", ), + ExpectFail( + input=(np.int64(0), 100), + exception=ValueError, + id="zero-uniform-numpy", + msg="Chunk size must be positive", + ), ExpectFail(input=([], 100), exception=ValueError, id="empty-list", msg="must not be empty"), + # Scalars that are neither integers nor iterable name themselves in the error, + # rather than surfacing an opaque "object is not iterable" from `list(chunks)`. + ExpectFail( + input=(2.5, 100), + exception=TypeError, + id="non-iterable-scalar", + msg="must be an integer or an iterable of integers; got 2.5 of type float", + escape=True, + ), ExpectFail( input=([10, -1, 10], 100), exception=ValueError, From ecb58147c4246965f15d87b8dae3cb8f6292cf7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Aug 2026 07:41:18 +0200 Subject: [PATCH 49/61] chore(deps): bump the actions group with 4 updates (#4258) Bumps the actions group with 4 updates: [CodSpeedHQ/action](https://github.com/codspeedhq/action), [scientific-python/issue-from-pytest-log-action](https://github.com/scientific-python/issue-from-pytest-log-action), [actions/attest](https://github.com/actions/attest) and [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action). Updates `CodSpeedHQ/action` from 5.0.1 to 5.0.2 - [Release notes](https://github.com/codspeedhq/action/releases) - [Changelog](https://github.com/CodSpeedHQ/action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codspeedhq/action/compare/88472375d0a4572cf70a9f1fe3a4e0ab8da1b924...0ca9cbbf4623b599a6c3ed4fc8a922942705d9f1) Updates `scientific-python/issue-from-pytest-log-action` from 1.6.1 to 1.6.2 - [Release notes](https://github.com/scientific-python/issue-from-pytest-log-action/releases) - [Commits](https://github.com/scientific-python/issue-from-pytest-log-action/compare/054799b34bd75a5fd6c86277a4a8a575224e60c6...35b4e0a9e06f8e7e261778289cf4b968b722662d) Updates `actions/attest` from 4.2.1 to 4.2.2 - [Release notes](https://github.com/actions/attest/releases) - [Changelog](https://github.com/actions/attest/blob/main/RELEASE.md) - [Commits](https://github.com/actions/attest/compare/508db95dd578ae2727ebd6217d5ba78e4fbda05d...1e69f48acb82d1966a394da916b4c1698aa569d6) Updates `zizmorcore/zizmor-action` from 0.6.1 to 0.6.2 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/6fc4b006235f201fdab3722e17240ab420d580e5...3dc1ecc9bcb9e94e9b2c709687979e1298497054) --- updated-dependencies: - dependency-name: CodSpeedHQ/action dependency-version: 5.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: scientific-python/issue-from-pytest-log-action dependency-version: 1.6.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/attest dependency-version: 4.2.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.6.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codspeed.yml | 2 +- .github/workflows/hypothesis.yaml | 2 +- .github/workflows/releases.yml | 2 +- .github/workflows/zarr-http-server-release.yml | 4 ++-- .github/workflows/zarr-indexing-release.yml | 4 ++-- .github/workflows/zarr-metadata-release.yml | 4 ++-- .github/workflows/zizmor.yml | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 17e9de89ba..f36fbff233 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -32,7 +32,7 @@ jobs: with: version: '1.16.5' - name: Run the benchmarks - uses: CodSpeedHQ/action@88472375d0a4572cf70a9f1fe3a4e0ab8da1b924 # v5.0.1 + uses: CodSpeedHQ/action@0ca9cbbf4623b599a6c3ed4fc8a922942705d9f1 # v5.0.2 env: ZARR_BENCHMARK_CLEAR_CACHE: '1' with: diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index cfe4477e52..dd49578dd0 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -109,7 +109,7 @@ jobs: && steps.status.outcome == 'failure' && github.event_name == 'schedule' && github.repository_owner == 'zarr-developers' - uses: scientific-python/issue-from-pytest-log-action@054799b34bd75a5fd6c86277a4a8a575224e60c6 # v1.6.1 + uses: scientific-python/issue-from-pytest-log-action@35b4e0a9e06f8e7e261778289cf4b968b722662d # v1.6.2 with: log-path: output-${{ matrix.python-version }}-log.jsonl issue-title: "Nightly Hypothesis tests failed" diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 759c443dd5..a08d5a6d3f 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -81,7 +81,7 @@ jobs: name: releases path: dist - name: Generate artifact attestation - uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 with: subject-path: dist/* - name: Publish package to PyPI diff --git a/.github/workflows/zarr-http-server-release.yml b/.github/workflows/zarr-http-server-release.yml index b8940f7560..b78fa29ab7 100644 --- a/.github/workflows/zarr-http-server-release.yml +++ b/.github/workflows/zarr-http-server-release.yml @@ -82,7 +82,7 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 with: subject-path: dist/* @@ -107,7 +107,7 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 with: subject-path: dist/* diff --git a/.github/workflows/zarr-indexing-release.yml b/.github/workflows/zarr-indexing-release.yml index de57594d2b..2c35abad9f 100644 --- a/.github/workflows/zarr-indexing-release.yml +++ b/.github/workflows/zarr-indexing-release.yml @@ -82,7 +82,7 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 with: subject-path: dist/* @@ -107,7 +107,7 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 with: subject-path: dist/* diff --git a/.github/workflows/zarr-metadata-release.yml b/.github/workflows/zarr-metadata-release.yml index f9516ead71..17c285ded6 100644 --- a/.github/workflows/zarr-metadata-release.yml +++ b/.github/workflows/zarr-metadata-release.yml @@ -82,7 +82,7 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 with: subject-path: dist/* @@ -107,7 +107,7 @@ jobs: path: dist - name: Generate artifact attestation - uses: actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d # v4.2.1 + uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2 with: subject-path: dist/* diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 9022c56455..c90ba718f6 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -32,4 +32,4 @@ jobs: persist-credentials: false - name: Run zizmor - uses: zizmorcore/zizmor-action@6fc4b006235f201fdab3722e17240ab420d580e5 # v0.6.1 + uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2 From 52a63801ad04cf81876abfc324c2febddaad60f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Aug 2026 10:16:31 +0200 Subject: [PATCH 50/61] chore(deps): bump the python-dependencies group with 6 updates (#4259) Bumps the python-dependencies group with 6 updates: | Package | From | To | | --- | --- | --- | | [packaging](https://github.com/pypa/packaging) | `26.2` | `26.3` | | [typer](https://github.com/fastapi/typer) | `0.27.0` | `0.27.1` | | [coverage](https://github.com/coveragepy/coveragepy) | `7.15.2` | `7.15.3` | | [hypothesis](https://github.com/HypothesisWorks/hypothesis) | `6.164.0` | `6.165.2` | | [uv](https://github.com/astral-sh/uv) | `0.12.0` | `0.12.2` | | [ruff](https://github.com/astral-sh/ruff) | `0.16.0` | `0.16.1` | Updates `packaging` from 26.2 to 26.3 - [Release notes](https://github.com/pypa/packaging/releases) - [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pypa/packaging/compare/26.2...26.3) Updates `typer` from 0.27.0 to 0.27.1 - [Release notes](https://github.com/fastapi/typer/releases) - [Changelog](https://github.com/fastapi/typer/blob/master/docs/release-notes.md) - [Commits](https://github.com/fastapi/typer/compare/0.27.0...0.27.1) Updates `coverage` from 7.15.2 to 7.15.3 - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.15.2...7.15.3) Updates `hypothesis` from 6.164.0 to 6.165.2 - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](https://github.com/HypothesisWorks/hypothesis/compare/v6.164.0...v6.165.2) Updates `uv` from 0.12.0 to 0.12.2 - [Release notes](https://github.com/astral-sh/uv/releases) - [Changelog](https://github.com/astral-sh/uv/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/uv/compare/0.12.0...0.12.2) Updates `ruff` from 0.16.0 to 0.16.1 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.16.0...0.16.1) --- updated-dependencies: - dependency-name: packaging dependency-version: '26.3' dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python-dependencies - dependency-name: typer dependency-version: 0.27.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: coverage dependency-version: 7.15.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: hypothesis dependency-version: 6.165.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies - dependency-name: uv dependency-version: 0.12.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: ruff dependency-version: 0.16.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Davis Bennett --- pyproject.toml | 8 +- uv.lock | 340 ++++++++++++++++++++++++------------------------- 2 files changed, 174 insertions(+), 174 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6626f8f0bc..e0fbfc08fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,18 +94,18 @@ homepage = "https://github.com/zarr-developers/zarr-python" # pins deliberately, e.g. via dependabot or `uv lock --upgrade`. [dependency-groups] test = [ - "coverage==7.15.2", + "coverage==7.15.3", "pytest==9.1.1", "pytest-asyncio==1.4.0", "pytest-cov==7.1.0", "pytest-accept==0.3.0", "numpydoc==1.10.0", - "hypothesis==6.164.0", + "hypothesis==6.165.2", "pytest-xdist==3.8.0", "pytest-benchmark==5.2.3", "pytest-codspeed==5.0.3", "tomlkit==0.15.1", - "uv==0.12.0", + "uv==0.12.2", ] remote-tests = [ {include-group = "test"}, @@ -129,7 +129,7 @@ docs = [ "mkdocs-redirects==1.2.3", "markdown-exec[ansi]==1.12.3", "griffe-inherited-docstrings==1.1.3", - "ruff==0.16.0", + "ruff==0.16.1", # Changelog generation {include-group = "release"}, # Optional dependencies to run examples diff --git a/uv.lock b/uv.lock index 5e3e33aefe..120b187e7d 100644 --- a/uv.lock +++ b/uv.lock @@ -621,71 +621,71 @@ wheels = [ [[package]] name = "coverage" -version = "7.15.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/76/d0/55fe630f4cf94e3fcba868240fad8c8cdd1f764e2a932f8926347e6ec4cd/coverage-7.15.2.tar.gz", hash = "sha256:3df60dc267f0a2ca23cb7a9ab1109c62b9335ffbf519fcfe167157c28c09b81d", size = 927741, upload-time = "2026-07-15T18:56:19.558Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/6a/50/eb5bf42e531611a9f8d272556b1ed4de503f84a91413584094487cf69f8f/coverage-7.15.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:1adac78e5abc7c5438f7a209c9ca69d06542f0bf481d728b6989ea80b813fdf9", size = 221587, upload-time = "2026-07-15T18:54:18.439Z" }, - { url = "https://files.pythonhosted.org/packages/06/d1/da99af464c335d4e023a6efcd7ec30f63b88a43c93745154ab74ffb31cea/coverage-7.15.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b868acc62aa5de3be7a9d05c2333bf8359ca987e43f9cb30ff8fbda6a024ab73", size = 221943, upload-time = "2026-07-15T18:54:20.062Z" }, - { url = "https://files.pythonhosted.org/packages/5b/8a/13c42723d61ca447eafa18732e8141dd6a63f2732e1c7e1502c182dd88d7/coverage-7.15.2-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:6f6966fc30e6f06ca8f98fb0ce51eda6b111b3ee8d066a8b1ec9e77fa06ab55d", size = 253450, upload-time = "2026-07-15T18:54:21.765Z" }, - { url = "https://files.pythonhosted.org/packages/d7/29/99021303f98fbdcb63504b4d07bea4cc025b9b2dd907c4f07c85d50a0dab/coverage-7.15.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:68af907f595ab01a78f794932ff3bdf929c316d3000810d38dbc247129e26f8b", size = 256187, upload-time = "2026-07-15T18:54:23.4Z" }, - { url = "https://files.pythonhosted.org/packages/f9/a8/fd503715ed6ca9c5d742923aa5209257340b367a867b2ced0c7d4ba8a0b9/coverage-7.15.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:afa29e2eff3d5729267e2cb2fd4ce9d61c952932fb2694e34ccb5d9540c6a296", size = 257301, upload-time = "2026-07-15T18:54:25.183Z" }, - { url = "https://files.pythonhosted.org/packages/da/40/3f4b8fb409810036ebc2857d36adc0498c6e957b5df0290c5036b2e143f1/coverage-7.15.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:bbf44513ceb1589e31948e20eafbde9deaface90e1a1afa5f5f77b4423d17ce6", size = 259562, upload-time = "2026-07-15T18:54:27.204Z" }, - { url = "https://files.pythonhosted.org/packages/0b/8a/9bdffbef47db77cce3d6b02a28f7e919b19f0106c4b080c2c2246040f885/coverage-7.15.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9deddf09eecb717b7f980414b43d90a5b22ff3967d2949ab29cb0aa83d9e9098", size = 253841, upload-time = "2026-07-15T18:54:29.134Z" }, - { url = "https://files.pythonhosted.org/packages/1b/1e/9031efde019d31a06646261fce6dfc5c3c74e951e27a71e5c9a424563178/coverage-7.15.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ae901f7e55ba405c84ee1cab3d3e962e4e871e4a2bcb9c90911adbd69b42ac5a", size = 255221, upload-time = "2026-07-15T18:54:31.142Z" }, - { url = "https://files.pythonhosted.org/packages/56/db/787acde872389fc84a9ef9d8cd1ccc658e391ab4cb5b28092a714426a394/coverage-7.15.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a0f47002c6eeb7c280228467a4cb0cc15ca2103a8421b986b2d3ec04a0f9bd8b", size = 253366, upload-time = "2026-07-15T18:54:32.886Z" }, - { url = "https://files.pythonhosted.org/packages/2f/9b/6f57bc4b93c842eef1695f8cdaf2318e35e7ba54f5ba80d84be213ab7858/coverage-7.15.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:1cd7a5beb7af3e864a13b1f0fb26efd3695da43ef0daf71e586adfffaf34d5b2", size = 257434, upload-time = "2026-07-15T18:54:34.7Z" }, - { url = "https://files.pythonhosted.org/packages/88/26/b3186a21b2acc83e451118978905c81c7072c3333707804db09a78c096a2/coverage-7.15.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:97a5c5457a9fb1d6c4e06cfb5dc835871fbfb6a6a51addc9e925bdeff5ef7440", size = 252935, upload-time = "2026-07-15T18:54:36.548Z" }, - { url = "https://files.pythonhosted.org/packages/20/c2/c9f3376b2e717ea69ed7a6e9a5fcab968fb0b290db6cf4bd9a1fc7541b75/coverage-7.15.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0901cfe6c13bcd2302da4f83e884555d2a22bda6e4c476f09ef204ba20ca536e", size = 254807, upload-time = "2026-07-15T18:54:38.296Z" }, - { url = "https://files.pythonhosted.org/packages/f0/e1/dfc15401f4a8aaeb486e1ba3e9e3c40522a6e38bd0ecf0b3f29cb8082957/coverage-7.15.2-cp312-cp312-win32.whl", hash = "sha256:b171bdd71cb7ff792bf32e376173b0ace7e7963e7e57c58dfc42063a6a7174cd", size = 223641, upload-time = "2026-07-15T18:54:40.103Z" }, - { url = "https://files.pythonhosted.org/packages/91/40/81b6d809d320cd366ec5bdf8176575e897dcb8efe7fb4b489ef9e93e4d13/coverage-7.15.2-cp312-cp312-win_amd64.whl", hash = "sha256:582edc45c2040543fef83341be23c43024a3ab3ae0c2d8bc498a06282905ad40", size = 224172, upload-time = "2026-07-15T18:54:41.882Z" }, - { url = "https://files.pythonhosted.org/packages/ef/28/9f14ec438149f7de557f45518f09b4a7917b795cc37083aa7db482693f8c/coverage-7.15.2-cp312-cp312-win_arm64.whl", hash = "sha256:a638db90c61cd219aeee65e83a24fdaa57269a741ae0cf773309208ac862cee3", size = 223556, upload-time = "2026-07-15T18:54:43.674Z" }, - { url = "https://files.pythonhosted.org/packages/fc/d5/f8c838e6b7282976f7c918884b792df7a0c42c5bba5d99c60ad2d221d56d/coverage-7.15.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1121caa19159a38b5463eaae4b1e1fde81e525b15ecc5e000cd5b1a108f743a8", size = 221606, upload-time = "2026-07-15T18:54:45.448Z" }, - { url = "https://files.pythonhosted.org/packages/bf/37/97c926376364f66298cc44893b89cdf17b8bc406376497c4061ae4b8a8ff/coverage-7.15.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a300c6934e0989c327b9e8a1e110329da4641149f872bbe9f70168be66da76c1", size = 221982, upload-time = "2026-07-15T18:54:47.341Z" }, - { url = "https://files.pythonhosted.org/packages/b7/30/a36050a6e83c2135ee0776f452ca3948224befc6d7f26acecc082d0c106a/coverage-7.15.2-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2617f8799d268fabdeef42a7e89ac3a23e1deee9025427db2df970f99a89a578", size = 252972, upload-time = "2026-07-15T18:54:49.2Z" }, - { url = "https://files.pythonhosted.org/packages/31/d3/06b5f1daf95f0f15ab05bd75f26ba5f3c8b33d0bb72f3aaa3cf41d1bad3a/coverage-7.15.2-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7dc2950a2992cd676d35c20ae63522836deeb034f08874699d14068710af3dc1", size = 255569, upload-time = "2026-07-15T18:54:51.098Z" }, - { url = "https://files.pythonhosted.org/packages/81/1c/9afb3f8de2b8d36960391c48559a2e3ff96594b58099f115921549ea8d0d/coverage-7.15.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9e36686f7a442185db2400b3df171aac520869faf9deb59df687d28659eda2a6", size = 256806, upload-time = "2026-07-15T18:54:53.145Z" }, - { url = "https://files.pythonhosted.org/packages/64/d8/b989f96061a5e32d82fddd1b1b9ff48a7c8f8ae7606f0e80fd9de54b1e33/coverage-7.15.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7d29ca7bd67af6e12e74632d65f026eabc1364da5c254494cd914446a28a3ef7", size = 258936, upload-time = "2026-07-15T18:54:55.015Z" }, - { url = "https://files.pythonhosted.org/packages/b8/fa/f99771f5110457c7b511c1935ca49ddf288218eaa84322e028b9334146ae/coverage-7.15.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:db9c8438057e5b0f6a22a0af99c0c1d26b57fbbdbd1be5861ddb8f897fcc3a2d", size = 253178, upload-time = "2026-07-15T18:54:57.527Z" }, - { url = "https://files.pythonhosted.org/packages/f6/96/c098a6044d119c751ceede7be91035fa8310170ec24a6523aff72f0a5793/coverage-7.15.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:63022c4c8dec1d0342f05c3ede99842fe3d007689acc45e86f123a1746e4a026", size = 254934, upload-time = "2026-07-15T18:54:59.41Z" }, - { url = "https://files.pythonhosted.org/packages/b2/a2/1457b3a7a50c8d77500103b97a046db863e2f59a1cf6d2f814595f349885/coverage-7.15.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:6c0be82b4d4aa5b2704e08518e2252f3e3d110164bcca826816801052e48a7aa", size = 252898, upload-time = "2026-07-15T18:55:01.338Z" }, - { url = "https://files.pythonhosted.org/packages/6c/0e/76958874c471ecfcdde0d2b2747bb2c61bdbf34a40636f4ce9db9923e643/coverage-7.15.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4510fb9cdf6bb02dfa6af0be4a534b8102d086e22e4a33f8836df663da3d660d", size = 257056, upload-time = "2026-07-15T18:55:03.243Z" }, - { url = "https://files.pythonhosted.org/packages/7c/7c/3d7c4e3bf58baa40327dc7edc2272b17cf02299366d52763db1b0ca1556a/coverage-7.15.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:42ec3d989421b174a2ab607c1539f24127ad362757b7f1c0c0d7a2993f7eb37b", size = 252718, upload-time = "2026-07-15T18:55:05.029Z" }, - { url = "https://files.pythonhosted.org/packages/c8/b8/1cecffed9ce14fb25be9ba42d37b6bb61485c9a3ddd43cd3dde36b6087d8/coverage-7.15.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e8f91bce78e32343af184c3b7fa28fcf5a9e2641f4b6623d392038f804939188", size = 254490, upload-time = "2026-07-15T18:55:06.889Z" }, - { url = "https://files.pythonhosted.org/packages/6c/2c/42984561bc7f4c045dca67516a0c50ee5ef8d84352dbeb5559dc86c4823e/coverage-7.15.2-cp313-cp313-win32.whl", hash = "sha256:434e68d531858205895eb0d74b73d20b84260de426387d53c422a5acda2cf050", size = 223647, upload-time = "2026-07-15T18:55:08.941Z" }, - { url = "https://files.pythonhosted.org/packages/41/9f/39c7c9245efc583beddf89a87683574e663ed93637f3afb6cd7b88405676/coverage-7.15.2-cp313-cp313-win_amd64.whl", hash = "sha256:26c3b04a6377fd7c09800921fa934e3a17c0020439cd59df73e73ae1d4b6a78c", size = 224190, upload-time = "2026-07-15T18:55:10.789Z" }, - { url = "https://files.pythonhosted.org/packages/c7/de/3a2883cf8a213659280ef4b403059e17a9acaeb7fc7fd4105e1226ff2e6d/coverage-7.15.2-cp313-cp313-win_arm64.whl", hash = "sha256:3ed010aa1b69cda8e827aabfca9866216c980e2dca82ab9a78c5f83689964c8b", size = 223583, upload-time = "2026-07-15T18:55:12.678Z" }, - { url = "https://files.pythonhosted.org/packages/81/5f/aed265fd7a3551a394f36dfe41868aee709b7f95db4052205b4ad1563ac3/coverage-7.15.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:40f633c5c5fc783732f6312280122e859538fa24461235597c13d803ea9a108a", size = 221650, upload-time = "2026-07-15T18:55:14.527Z" }, - { url = "https://files.pythonhosted.org/packages/6b/2c/222ba12a545189017120f8eddfc1a0bd4616b47d5d4a8d99421edb2fe4c6/coverage-7.15.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:075560438765b7a2ef43bf7aa7758661b53d889df47f062a31bda6c1ade553a2", size = 221988, upload-time = "2026-07-15T18:55:16.674Z" }, - { url = "https://files.pythonhosted.org/packages/aa/38/304b5877ab46e6c290b4292cfcf3fe28245f0e5597cad7f6acc91fc7e0a4/coverage-7.15.2-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:25fd15dd40a0a2c51a500d664ca29053c09c3259d998407bf982b6e114696138", size = 253029, upload-time = "2026-07-15T18:55:18.856Z" }, - { url = "https://files.pythonhosted.org/packages/6c/58/821b533b8db9e44cf1d8a97bd525149ced40dde1d0093da02cb78e715244/coverage-7.15.2-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b9a6367e4aff723e8ee8190836836124284e8fcd4265e307c844010cfa074f3f", size = 255536, upload-time = "2026-07-15T18:55:21.027Z" }, - { url = "https://files.pythonhosted.org/packages/f1/f2/7aa06604c389d32ea7f0a6a988359a7eafc3cd3f8e7bc2e88cd2fdf0b877/coverage-7.15.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9854ca62c152874b2060772503535be2e8f53f70b8aaa7686b094888d872f984", size = 256881, upload-time = "2026-07-15T18:55:23.125Z" }, - { url = "https://files.pythonhosted.org/packages/a2/4f/1ef342339c7916d0096bc5888cc0f653882cc7bc8f897d5cb89143287c9b/coverage-7.15.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:913b6c56e110da40e035bbd168353bf7aaa2544a5eaccea5d98a4629aac156c7", size = 259196, upload-time = "2026-07-15T18:55:25.099Z" }, - { url = "https://files.pythonhosted.org/packages/fe/f4/7ed055d7a9c5ec13b161773a115a5ccc6b0081d568c31fad830806306cc7/coverage-7.15.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:aaccad4129d735a8a4d526f26929894c9a4e8ef7034566f210b176749d6906e3", size = 253036, upload-time = "2026-07-15T18:55:27.018Z" }, - { url = "https://files.pythonhosted.org/packages/14/79/ea82cca18c242a3a38b6c017da39726aa62dcb64aa635abf79b92009975c/coverage-7.15.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a164b50081fc7357331c4024ef4d17b78ba325f8380d05f5a69599a7e05257ee", size = 254887, upload-time = "2026-07-15T18:55:29.084Z" }, - { url = "https://files.pythonhosted.org/packages/a4/ba/a136db3c0d9562b00e10b72540dbf3a33cd3bc5b95060c9308e247494623/coverage-7.15.2-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:bfd341ccf78128e72c094bc70cc25b3ef309c33c7c2c66ba3ed4309549e02de1", size = 252852, upload-time = "2026-07-15T18:55:31.184Z" }, - { url = "https://files.pythonhosted.org/packages/17/17/ea334246b16b7d059953fad6fdefa11e33c68efbd3fe37b1098120a1fac2/coverage-7.15.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:1473b3ba8e7ee0f076117b1a72c23f579a2b9e2bb742f48a8d86ea27ca93f91a", size = 257128, upload-time = "2026-07-15T18:55:33.163Z" }, - { url = "https://files.pythonhosted.org/packages/ed/c3/074fb66d46d607855f710876b117cbda562c5ab08363528e78820449f937/coverage-7.15.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:17c432b5f73ad52ef46fb06019f6fa7c66ce381961cf0f7dfd1d3a4bd3a98145", size = 252668, upload-time = "2026-07-15T18:55:35.063Z" }, - { url = "https://files.pythonhosted.org/packages/e1/c1/f620850ada9b36435921c9a3a8057013422b1d964eb4bf37fe138724d192/coverage-7.15.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:77f0ef5011df53a4bd1b35211ab122287f8d9b8d7aa1c4553e5c2deb24b1d446", size = 254325, upload-time = "2026-07-15T18:55:37.125Z" }, - { url = "https://files.pythonhosted.org/packages/cc/31/a729ca3689404493af82ef8e6ff70bd88bdda8da89aeef6ca9b387aeb2b4/coverage-7.15.2-cp314-cp314-win32.whl", hash = "sha256:f653e5d7248c1191ec988a85c72edeab46c3ff44f90639a4ed4874ec0be90243", size = 223844, upload-time = "2026-07-15T18:55:39.078Z" }, - { url = "https://files.pythonhosted.org/packages/c6/83/5d809dc808fb1698c671f3e372259bb9158e64b7ea526fc6ab7de64de9fe/coverage-7.15.2-cp314-cp314-win_amd64.whl", hash = "sha256:9911f31aad8906abe337c271343485cf20df5e70df5d2f57f9f136e7b55f26bc", size = 224331, upload-time = "2026-07-15T18:55:41.346Z" }, - { url = "https://files.pythonhosted.org/packages/16/4e/35e488548e952795829e129995c4174df33bf432b591d1aa42c8d9e4e7ad/coverage-7.15.2-cp314-cp314-win_arm64.whl", hash = "sha256:e38def96ad59853824c97953fdcd2c320a84ba3ce99b417db78af8bb6c3db635", size = 223760, upload-time = "2026-07-15T18:55:43.518Z" }, - { url = "https://files.pythonhosted.org/packages/ed/49/dd2c86cd6374038f6e415fb5bfb86db5218553209c081384a020369dee79/coverage-7.15.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:835ec4e20b45f0a7f63ed78f94065aca00de033403df8377bfe8b9c6abc0a7be", size = 222384, upload-time = "2026-07-15T18:55:45.569Z" }, - { url = "https://files.pythonhosted.org/packages/d3/74/173ff17a1c0808e5a438f549f6f145d5ac7528f2791310b63523e3200ac7/coverage-7.15.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7466cc7ab6dc0db871d264bf99e8779f0917ee63d40730af0552f71535a6e072", size = 222647, upload-time = "2026-07-15T18:55:47.544Z" }, - { url = "https://files.pythonhosted.org/packages/84/f8/b8cba872162356fb44ac79c10309d987206a4461e32072fc29228dad7331/coverage-7.15.2-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:e370c12133095ff18432de8c044962be85a5a96d90c6fcbce8e17e76236d2328", size = 264013, upload-time = "2026-07-15T18:55:49.768Z" }, - { url = "https://files.pythonhosted.org/packages/ee/67/a807a7586d0b8cae485308ddd55756f0806c92f8e0b411bacbf23c48edf3/coverage-7.15.2-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fe41909c9515c3bfdb5f02c4d1f857dba322d9a9a1178069b91eea77889df63a", size = 266135, upload-time = "2026-07-15T18:55:51.941Z" }, - { url = "https://files.pythonhosted.org/packages/ce/67/cd78771dc985f7e4ebdcc82b1a96d9a932af9e806f01f2f91a89f4c72e80/coverage-7.15.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6aa28cfb6488e5453b5b762d65f73aa586380f6693a04d58078ce228a29b06c0", size = 268555, upload-time = "2026-07-15T18:55:54.065Z" }, - { url = "https://files.pythonhosted.org/packages/18/3e/10134cf81275188c58568f324fc74aedff32c63ca4d5bbc513a91944a6f0/coverage-7.15.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:bcc0aae933921d03096f53b0b03eeb702129fd406dee59f08d2efacc68681fa5", size = 269674, upload-time = "2026-07-15T18:55:56.066Z" }, - { url = "https://files.pythonhosted.org/packages/75/4a/771b77de446cba985dc414bbc5844bd21604da05dbc044286df8318a48a7/coverage-7.15.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7c63387e21ab21f512c69c9756a8c7dadd322c7275edb064064433c9a09c3743", size = 263101, upload-time = "2026-07-15T18:55:58.107Z" }, - { url = "https://files.pythonhosted.org/packages/5f/b5/70a7011da15f4071943361183aefa27847f3e3aec4fd335f1cb3d3a622b1/coverage-7.15.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:0e55510bc98ae943cece9e667a6c0fe94c6a92913720dea34243657a17993d0c", size = 266007, upload-time = "2026-07-15T18:56:00.468Z" }, - { url = "https://files.pythonhosted.org/packages/b4/0d/f9547e804ce7ad49646ffeffac26699510efbe6c0f751b66fdc960c4e825/coverage-7.15.2-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:2ff08701be2d1556fc78b326c80a3e8042da09352ecb3819105f8e386c8a3071", size = 263611, upload-time = "2026-07-15T18:56:02.615Z" }, - { url = "https://files.pythonhosted.org/packages/ac/59/f576a396659c0efd351f5c1544f67c3560e89c7761cabf7f65e412beeda5/coverage-7.15.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:38c9518b7103826c403a461544e3c2e77151e8676d06eaed85911a97e962584a", size = 267344, upload-time = "2026-07-15T18:56:04.622Z" }, - { url = "https://files.pythonhosted.org/packages/7c/5d/c2e4fce3579c0cb635024293f1a32bbe26df101b3e3a69f22243d1352b6c/coverage-7.15.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:dee88b1ed88587abd8c0269a1fc1f4cc77f7750d1dfde2869e2a123af420e67d", size = 262456, upload-time = "2026-07-15T18:56:06.641Z" }, - { url = "https://files.pythonhosted.org/packages/bb/dd/956287d69436b66094bc4b57ac2da71e43bfd2a5524e958900b9f582fcf8/coverage-7.15.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:2fbeeeecea279727f8ac16c8e1133ddfeee793e985c86ae343d6a5ce744eef8c", size = 264771, upload-time = "2026-07-15T18:56:08.795Z" }, - { url = "https://files.pythonhosted.org/packages/2c/5a/6f979530c2734c575de77cf58f5f28d51f7123a94b5030fd9156fe5f363c/coverage-7.15.2-cp314-cp314t-win32.whl", hash = "sha256:cb0fddaa6884be6aae36ced9544b5e90f7d5f03845a2853bf47a14953a4e8688", size = 224151, upload-time = "2026-07-15T18:56:10.856Z" }, - { url = "https://files.pythonhosted.org/packages/54/7e/27f6b2a74d484742f4017553e710b01e396b23d809df3e95ca0bb9a2824b/coverage-7.15.2-cp314-cp314t-win_amd64.whl", hash = "sha256:77f091ea3a9cc611cd29f433565476bc1936c084ac8eee00ea0e7e70c27e4199", size = 224981, upload-time = "2026-07-15T18:56:12.928Z" }, - { url = "https://files.pythonhosted.org/packages/b1/48/284863423aa474240f6842bd00d680da22f4e6ea2e466618ef7c9c9e69a9/coverage-7.15.2-cp314-cp314t-win_arm64.whl", hash = "sha256:6fc448c377d6eeb00a47c673494bd9bae29280ca53987e1869e67ebedfe20658", size = 224294, upload-time = "2026-07-15T18:56:15.156Z" }, - { url = "https://files.pythonhosted.org/packages/ec/82/32e3bd191d498e64f6f911ad55d14006a0861e54869d2d32452326399e65/coverage-7.15.2-py3-none-any.whl", hash = "sha256:eb6bcae8d1a9d305351ecb108232441d11c5cfe9de840a04388ba5d2db8d735c", size = 213375, upload-time = "2026-07-15T18:56:17.305Z" }, +version = "7.15.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f4/45/78dbf9604ee5b3db24efbf26bed1cb58862fb40480cba821963c69348751/coverage-7.15.3.tar.gz", hash = "sha256:ae7ea5a4614acf399ef0483c4cb34f8f8f01df848d8fcbe7d3ce0865733f1c4d", size = 935592, upload-time = "2026-08-02T18:50:17.006Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/6c/bac99d9d4c6abe856e93bf3f5212982ac0bfac126dd4a042753bd53bc5af/coverage-7.15.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:79a3e32e83227d83d9684459ed579769b56c369ac2d7313099b2d9e031d2e10f", size = 222499, upload-time = "2026-08-02T18:48:15.018Z" }, + { url = "https://files.pythonhosted.org/packages/aa/bc/cb9a39b083bc1aa70586482dab25c9be20bab0ec6c155340e50d9066bb1e/coverage-7.15.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:767feb87c5886d781d0a69fafd450a20826ddab7b79bce1665deb64d21441b60", size = 222866, upload-time = "2026-08-02T18:48:16.884Z" }, + { url = "https://files.pythonhosted.org/packages/58/fb/beaa453d62000a0a5b39838bee2a137afe609a50a71f55e83c73461e513b/coverage-7.15.3-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:50951e37033c40548d777b8a8454a2cd622dba1136780065678dccaec307c47f", size = 254367, upload-time = "2026-08-02T18:48:18.507Z" }, + { url = "https://files.pythonhosted.org/packages/66/64/43e72500ed6815cef189f9193f29d7af4b078830337c95ea976cd0c0d427/coverage-7.15.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:63a4ff67364afb2cac826b8bbd78a5c50ce656a7b7137436b44d7b96a9271088", size = 257103, upload-time = "2026-08-02T18:48:20.172Z" }, + { url = "https://files.pythonhosted.org/packages/66/3a/2893e2937adfe02f45fd38e4a8a0a0d8b7a02ff9e012ac3d009bee3c4f16/coverage-7.15.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e95e42856509675fe26560310313a6117640e96f9a1e19bb3d220116a27c94c", size = 258220, upload-time = "2026-08-02T18:48:21.963Z" }, + { url = "https://files.pythonhosted.org/packages/30/b4/d5e6e2eb1a62961083734291304b1f85df72e2abe95c76eb88a7f472afd0/coverage-7.15.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:abad631cba27094b4631993f4c72e89ac0ca1b3a0236c7abaf8ca79aea619851", size = 260481, upload-time = "2026-08-02T18:48:23.682Z" }, + { url = "https://files.pythonhosted.org/packages/dc/c9/9b72c5c6a9798a9a12cf65f66e077cc1fdd396e61915c862688f9afe1cae/coverage-7.15.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:2b0807f1f051dd82a234ad6acdb6f1425baede60be1e84e862496c8cc9262ab9", size = 254749, upload-time = "2026-08-02T18:48:25.32Z" }, + { url = "https://files.pythonhosted.org/packages/92/20/e1c2f759e2dbce559ba85c40c0e4acfecc6cff4b740c294c88e41ccc6111/coverage-7.15.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d8d6df7aeb5bc464040bbc9ae173d875785d3677ebc4307817997d622d74225e", size = 256138, upload-time = "2026-08-02T18:48:27.064Z" }, + { url = "https://files.pythonhosted.org/packages/a5/ab/48cc7e760f769e86ae290a125ea6e7209dfbdbbbb7ff4f5d9d1ee7a45d57/coverage-7.15.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:974471c506c9f5758808b47c1ebf7949ecd0848f5c1020e78675fefe5ff46866", size = 254283, upload-time = "2026-08-02T18:48:29.082Z" }, + { url = "https://files.pythonhosted.org/packages/15/26/39529a68154f99b3a1829debd8b25eac384effeec890a293b5bbdcb49186/coverage-7.15.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5cba0c9c13e35c86df7998f1afaf6b1da224a3a39e4da59bdabf60c148046dcb", size = 258352, upload-time = "2026-08-02T18:48:30.892Z" }, + { url = "https://files.pythonhosted.org/packages/91/2f/55b82aa3d8d7dd8023a56e7c5c2a70e39a3c44b3353c6cf3faec9ad51566/coverage-7.15.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:4d608dc36a364dce33acbf4fc3a50f9d2054c945f233bb0a2cdb4b90bfa17646", size = 253852, upload-time = "2026-08-02T18:48:32.934Z" }, + { url = "https://files.pythonhosted.org/packages/6a/6d/839f4045124cd3518ecf2c58967e58a911202834e7c5a03cfdf2ab0b29f6/coverage-7.15.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2395869280554a1941da904423c12660c39f721315e1c02d076a7fe0971382f0", size = 255725, upload-time = "2026-08-02T18:48:34.848Z" }, + { url = "https://files.pythonhosted.org/packages/75/21/d25e3e2a9e327798078c877f469dfb6def860bf6e25036529046227d3e15/coverage-7.15.3-cp312-cp312-win32.whl", hash = "sha256:24f3b21840c3eb76cef3cc70b2bf6649010c64471a84a446538a39306e1ba04d", size = 224566, upload-time = "2026-08-02T18:48:36.661Z" }, + { url = "https://files.pythonhosted.org/packages/b1/0f/df90cc1e8d095ce263968a93e04829821b2afb31ac2752c06a2e0a8e3c13/coverage-7.15.3-cp312-cp312-win_amd64.whl", hash = "sha256:fa7b17902c3c1dd8a7adb52679b7f6340bba08443d710c8838e04db8cf62be2a", size = 225098, upload-time = "2026-08-02T18:48:38.941Z" }, + { url = "https://files.pythonhosted.org/packages/65/c7/ec49e43c58967a07163e2d1c6bbd58112b825b2772ab66784afd6a5400ba/coverage-7.15.3-cp312-cp312-win_arm64.whl", hash = "sha256:fcbe83fb7258eacd293bf5322d88807acb35ed12a5cfa99dd8215c083e3b0235", size = 224485, upload-time = "2026-08-02T18:48:40.682Z" }, + { url = "https://files.pythonhosted.org/packages/68/6e/62ae61e1fc434956bec38ed1d5b1c494f58cf579dbd998e77abffe7b3e6b/coverage-7.15.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1182eed05674c63d40951fae27c43e822749f04d25f75df64c2e4fa3168678de", size = 222522, upload-time = "2026-08-02T18:48:42.476Z" }, + { url = "https://files.pythonhosted.org/packages/13/ff/c74c673d81e0e77b6608c3d21331e3db42e30daeb3c8a0a8860d4c9e2e14/coverage-7.15.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c0c4b0d7c4cd56e470d0c9d8441f42e8a96cdfd95050fec027f1d4dd9f11006c", size = 222894, upload-time = "2026-08-02T18:48:44.274Z" }, + { url = "https://files.pythonhosted.org/packages/a1/91/ccb30f5ffafd7d69d0b18e5162f9b711a5654e807b7b0c13497f0826b33f/coverage-7.15.3-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:5c9fce9f4998b0d50a753da765b9215a14decc7863822c89d72da7a89ca625b3", size = 253890, upload-time = "2026-08-02T18:48:46.097Z" }, + { url = "https://files.pythonhosted.org/packages/29/c6/e92a66cda49a2751b09826d51258f199b92aa0cb005bc5f34e9729a52a9c/coverage-7.15.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7a47e2a0a0ace9241e70ee00e44520f88b843094603dd54303f1bafecd929c30", size = 256484, upload-time = "2026-08-02T18:48:47.846Z" }, + { url = "https://files.pythonhosted.org/packages/96/7a/730929164b457cf25cf76c23898b90f9039a104a647890801b6586797b14/coverage-7.15.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:95bad94f83807ae60ed76f3ac012f69b2605ac9ea81bee959a5a483f7fa09c10", size = 257723, upload-time = "2026-08-02T18:48:49.664Z" }, + { url = "https://files.pythonhosted.org/packages/9e/be/04cb5672cb19f5c389eda81ba22d89807699a949653d3625b0e0fda169da/coverage-7.15.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:228e172a76c428bb17d1ab78a2ff188990b0597e5dbd291f52a4edf7412de049", size = 259854, upload-time = "2026-08-02T18:48:51.413Z" }, + { url = "https://files.pythonhosted.org/packages/96/25/5e7fd6af39f6507071455944b8906dd1fe5b7b6bffb6a163ceb20afa0d13/coverage-7.15.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cea9fb33887c99349996266f1fd60abe5af3577a90633392001d27ef46b4b66e", size = 254085, upload-time = "2026-08-02T18:48:53.158Z" }, + { url = "https://files.pythonhosted.org/packages/23/c8/55e58a853f1e61163a6e755897bd14a059d78411e86560f39d9951c019b5/coverage-7.15.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:81760de3155d7f52c21860c4046628dc6bed182f72e3c028e2b4fd46f65aa040", size = 255850, upload-time = "2026-08-02T18:48:55.031Z" }, + { url = "https://files.pythonhosted.org/packages/be/74/8bcec66dbcf3d22bea2a0b2b77ee2fa6f766a647d0023d4eabbc4f2b2756/coverage-7.15.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:b47ea0a1d3a3d089826c6cbfad8429d7d8872e28e86baa95ddef330f6875da21", size = 253818, upload-time = "2026-08-02T18:48:57.163Z" }, + { url = "https://files.pythonhosted.org/packages/ce/06/450b673fdfece0997b4e16a31d6bde6b18889c578f1013ddd34c962ac6f9/coverage-7.15.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5459ba486b2a5d58a6c05254779ecdf525e7f20174d0210ceda75ba40fdb8f2c", size = 257973, upload-time = "2026-08-02T18:48:59.098Z" }, + { url = "https://files.pythonhosted.org/packages/56/fd/3ec7409aec0ddc943132452b65672f065f043b844f1830e1fe173c98b3ab/coverage-7.15.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:c59209f80a08dbfcdd5109a80dc623cd3b9d22895c85757d34f57a6e6e95570f", size = 253638, upload-time = "2026-08-02T18:49:01.199Z" }, + { url = "https://files.pythonhosted.org/packages/75/20/30a8dabb194123631c93f860fdd86401ad405d56cfb1841873afbfe4e92b/coverage-7.15.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:f863856c1779d4a5bb6a94698a2f9073e09c6706501f76f3e7780e72df97d21c", size = 255407, upload-time = "2026-08-02T18:49:03.143Z" }, + { url = "https://files.pythonhosted.org/packages/13/4d/e14365b1953b43653341412f9088b0d752614c626a73a705ff9af400f3a3/coverage-7.15.3-cp313-cp313-win32.whl", hash = "sha256:00cbdc5e322927dc30c5e42b863819b1bb867cc66f26ab5372c585850876ab93", size = 224575, upload-time = "2026-08-02T18:49:05.011Z" }, + { url = "https://files.pythonhosted.org/packages/1c/64/88f762ea80de2070207246faef514513be874486b2773528f2cc2b4b515c/coverage-7.15.3-cp313-cp313-win_amd64.whl", hash = "sha256:835528518a1d823cf336740324b2f335f7c01e609e74abcb5d5163b3e66661e3", size = 225116, upload-time = "2026-08-02T18:49:06.894Z" }, + { url = "https://files.pythonhosted.org/packages/ab/66/03c34c53a319f522554cd29d4f2e16c5eab61aa4cdcf55753129fd7d926c/coverage-7.15.3-cp313-cp313-win_arm64.whl", hash = "sha256:0d2e1f2cbbf36b842f3e2aff8d118c60d677adb498bc6c7fa9c6838738f82767", size = 224509, upload-time = "2026-08-02T18:49:09.129Z" }, + { url = "https://files.pythonhosted.org/packages/35/6f/8c2dc014357618b3226c90f731b8282766c3685786f422558991dc49fbf2/coverage-7.15.3-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:1e3bb08ad574bd9fb6a991f645728f70d333c1c1958dd5fcde65e24cb862813d", size = 222571, upload-time = "2026-08-02T18:49:11.242Z" }, + { url = "https://files.pythonhosted.org/packages/07/50/d867c7ceae9d56b7e74ee61ea834f1aa4f9a1e1c7f0ce39393ba573b1c12/coverage-7.15.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:9e5860eaff02a0b7f1b73304bdf846596ee62ab3a78d25c68044ebf684cb1fef", size = 222902, upload-time = "2026-08-02T18:49:13.448Z" }, + { url = "https://files.pythonhosted.org/packages/62/77/4f6dfc490c5f2bcacb2d296d9aa4d1e128c43b48e94ad313fec7f49f09ad/coverage-7.15.3-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:60874e5bd67f0b1bdbe42ab42c7bafa66a6fb8de88721af6df3f7a02713960cd", size = 253947, upload-time = "2026-08-02T18:49:15.304Z" }, + { url = "https://files.pythonhosted.org/packages/16/8a/6777f192af264165103e2a3d3768dbadb9894a0a2359a16877141d9ae8f5/coverage-7.15.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f9147be876e9d83765e0b82176674dc248a6b9283e25e01e7462611b97e9b731", size = 256452, upload-time = "2026-08-02T18:49:17.801Z" }, + { url = "https://files.pythonhosted.org/packages/7d/7b/3d7ac46a0234bc684f41ee42be95e29b2b6525695adb04083609d5ac2149/coverage-7.15.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:61a01f8c3804760fcc5a3d31c4f3cab792d660d44e17bf7adeaf0ea51e07821e", size = 257798, upload-time = "2026-08-02T18:49:19.878Z" }, + { url = "https://files.pythonhosted.org/packages/ff/1e/c6ee59c29afcb5fdb35f936381340d1a06429a07c48f20e809646647acbe/coverage-7.15.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:95bf3e7f26f792e25eb185f85a5a659d48479265176dcfe22b6f334fd0081b5c", size = 260112, upload-time = "2026-08-02T18:49:21.858Z" }, + { url = "https://files.pythonhosted.org/packages/c1/e1/e8ea39a46e89e3a143312ee5f80336e992e3ae8fe44bf9c76b83fefeed42/coverage-7.15.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:44c41eff9e413fed8740eca75d5438ebeb9d3e45e7cd37c67329213e7a72c764", size = 253944, upload-time = "2026-08-02T18:49:23.926Z" }, + { url = "https://files.pythonhosted.org/packages/95/67/31ab5f6a37fd887d1386f81f0da9306851ad2264e9baaa9c7f606e0b3e17/coverage-7.15.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:54146bafb61f3ba9895b43af0dd17eba01561d586d44ce84ea221b0cbbee5a9e", size = 255805, upload-time = "2026-08-02T18:49:25.973Z" }, + { url = "https://files.pythonhosted.org/packages/fb/6a/ee505a80c8fd89620fb337c0596daecff87f33171fbb4ee3015fc3d7331f/coverage-7.15.3-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:af000dd1bb859ff8066fda4c79512ff938c798116540307226b373099c7b151f", size = 253769, upload-time = "2026-08-02T18:49:27.883Z" }, + { url = "https://files.pythonhosted.org/packages/b0/41/6ab0f81c9e89660230d8f3f581d4732e5ddb75a885b0a5dfc73d315dc94f/coverage-7.15.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:a1b82490577f3889950b5a04f18712aef0207243e0749d60fe28c3c73ebfd5fd", size = 258045, upload-time = "2026-08-02T18:49:30.201Z" }, + { url = "https://files.pythonhosted.org/packages/bc/62/c995e91cae28cf31d6defab3bfb553dda5ac83ac7381b0f2b121264c307a/coverage-7.15.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:c4fc90a60154c3e4b8a2dc206d6dbe852f1c235c249e0dc0cef909d032c9591a", size = 253587, upload-time = "2026-08-02T18:49:32.349Z" }, + { url = "https://files.pythonhosted.org/packages/84/df/f2049980f82d6890321f2065f9e66216eabbf4b2001815db958bc543f40a/coverage-7.15.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f25bb884814a892948b4c20394db3f2364dd452d9492736479e7a493e63b0eb6", size = 255243, upload-time = "2026-08-02T18:49:34.324Z" }, + { url = "https://files.pythonhosted.org/packages/1d/82/2c841b67a978c0eb9c3707630b68f93f9e7585d78bb906bc8823ec6b07a5/coverage-7.15.3-cp314-cp314-win32.whl", hash = "sha256:722dbf8e7828fbcfe0dc8586167dc0a5ce85ad6ea171dbb21ed3f8d6581d3cb8", size = 224759, upload-time = "2026-08-02T18:49:36.326Z" }, + { url = "https://files.pythonhosted.org/packages/b3/78/5c93ec43784fd3e404ca23cd0584ae24bc1732de4a3fc194b68c3be88db0/coverage-7.15.3-cp314-cp314-win_amd64.whl", hash = "sha256:64d0845f9c3ed47302bed265c15ab4dbb64aa4ec1490839b8e328f4e7fa914d2", size = 225246, upload-time = "2026-08-02T18:49:38.366Z" }, + { url = "https://files.pythonhosted.org/packages/9d/77/813a054371f3b018cc63c6bdb46a3c35d5e95d4e3ed4f1449d4196106db5/coverage-7.15.3-cp314-cp314-win_arm64.whl", hash = "sha256:69bc14684f8fbbee9f9dbaa4fe79719b0da9725fc37956785c06ec365acf6926", size = 224673, upload-time = "2026-08-02T18:49:40.552Z" }, + { url = "https://files.pythonhosted.org/packages/8f/63/8c9f36cc71178d26db930baa03a4494abcc516d8d41bf820d0d85ef1d80b/coverage-7.15.3-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:f92df943c24b96cb215ca26b4f6a2283e63c5db80f1635aceea7fff11311917b", size = 223298, upload-time = "2026-08-02T18:49:42.634Z" }, + { url = "https://files.pythonhosted.org/packages/54/66/211f24d058ce9f56ebf1420d55b7574fdae924f6da3836f83c8bd4793e38/coverage-7.15.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:66591c46bdd2971d3ae2bc503a5f0459c2edcaf6b7e045b292000cc95bc6cb95", size = 223568, upload-time = "2026-08-02T18:49:44.706Z" }, + { url = "https://files.pythonhosted.org/packages/dd/bb/9c2ad5574a0d6420a96c6cade4f8a683931b9e79fe609f8924d7b6964616/coverage-7.15.3-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:caa64458b81b18bfc67cdf1f6dc02b23e3edc672f2f8e11771fad75865415a43", size = 264932, upload-time = "2026-08-02T18:49:47.153Z" }, + { url = "https://files.pythonhosted.org/packages/ba/91/938c39e77bdd5a0a440412f975609ce3702dabbda6ac715719d93ca45a7b/coverage-7.15.3-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:447f5421ccf5475956cf516d4ca1d575f487947b6f4e11f9d80c6aefe24b3dc8", size = 267052, upload-time = "2026-08-02T18:49:49.324Z" }, + { url = "https://files.pythonhosted.org/packages/b0/a3/7b431a98af35d9cc6394e54cde9435b33b8591672fbece6a4931267d7a8e/coverage-7.15.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7a0c77ef8cd483a4987a5d12d1d9d5f7ee598dfdc6c0844417d847e5768dc779", size = 269473, upload-time = "2026-08-02T18:49:51.599Z" }, + { url = "https://files.pythonhosted.org/packages/32/58/dbc9951dce46be47a732823a1c571f62bcabdd54a68d8c281489a1a55cfb/coverage-7.15.3-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0b273f4ff657446a06c2d85bf80e134fa869a92852ba5f87854a70e1fb44da77", size = 270591, upload-time = "2026-08-02T18:49:53.865Z" }, + { url = "https://files.pythonhosted.org/packages/71/bd/1d610772c7c0889bfe477a59c46ee66ea53e271f3f06951e9d55b317f7c6/coverage-7.15.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:daea8c4fafa22488600405be2c2be525a9406fba3fc0a83acc726db3e14e2005", size = 264007, upload-time = "2026-08-02T18:49:55.875Z" }, + { url = "https://files.pythonhosted.org/packages/69/97/852eb3dcdba156b1a9078503f098499916bf889f964b61ad4a08223ac169/coverage-7.15.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:93ff57c530f3fa7aa69f92fb9b8892b8aa82712aa970842f4abf28657f42fb57", size = 266926, upload-time = "2026-08-02T18:49:57.944Z" }, + { url = "https://files.pythonhosted.org/packages/52/f8/b72cd238757fba2b587fc7dee047efe6e10b0c18343509faaaf502dd4680/coverage-7.15.3-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:4df21bef8b800eebda9018f53d49c9ace3aeb0090c850139b27923aafcb83e91", size = 264529, upload-time = "2026-08-02T18:50:00.035Z" }, + { url = "https://files.pythonhosted.org/packages/b8/0a/6c52ec4b7fb007cb6433d1fcfda4080cb15d75ad37ef9c31025f3427293e/coverage-7.15.3-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:db567b02685f26034adcbd85055f80d12cdf02111b8ed00886093d98b2874ce2", size = 268263, upload-time = "2026-08-02T18:50:02.161Z" }, + { url = "https://files.pythonhosted.org/packages/c0/4e/f1f9aa3efd109a04353563a43fb5155340c1fdcdeaa6296ebed3b6f510ea/coverage-7.15.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:5318dd51b8600b947e058cf5a4fe54d183d9d13c49b97b64ca7be05a34df9bef", size = 263377, upload-time = "2026-08-02T18:50:04.243Z" }, + { url = "https://files.pythonhosted.org/packages/dd/fb/6b268a0b2728ef1c379ad656b899274477a5f6bed1bf6765b4b387fb0601/coverage-7.15.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c995bfa383c54704839b6c4c2627a1c00895597ada0e5e8190c81d8bd620555c", size = 265688, upload-time = "2026-08-02T18:50:06.428Z" }, + { url = "https://files.pythonhosted.org/packages/29/54/1a3ea96e5d5e7cd41dc432597bfc60692910e635d05e1cc25a8ccc243581/coverage-7.15.3-cp314-cp314t-win32.whl", hash = "sha256:6433fafb8da0e1d02eb53411e0ecdadb6b88f0224fdc23317e703c0e88937d42", size = 225066, upload-time = "2026-08-02T18:50:08.533Z" }, + { url = "https://files.pythonhosted.org/packages/31/9d/a7b0d9afd18ed5274dd00651a78e7810a931c70d94b79996f150bec1a30f/coverage-7.15.3-cp314-cp314t-win_amd64.whl", hash = "sha256:fe578952b1b29fe8c777f43f241d49efac4b56724a3434f5d22ebe3c208df429", size = 225897, upload-time = "2026-08-02T18:50:10.572Z" }, + { url = "https://files.pythonhosted.org/packages/ca/11/34c5ae40b945e69aa72b87dc268135b7049905f3824af573b7073acbb946/coverage-7.15.3-cp314-cp314t-win_arm64.whl", hash = "sha256:d2e1acb7aee29dfa8f3e48c23f36670898baca1209d9bdd3985a50c7f982165e", size = 225212, upload-time = "2026-08-02T18:50:12.63Z" }, + { url = "https://files.pythonhosted.org/packages/37/e7/7069b3d6c018917f49ba2e1c5fb910e498c7fefa3a1b78cb1b79e61ff45d/coverage-7.15.3-py3-none-any.whl", hash = "sha256:da78fa6fc7dafe4212839173133ee85afcf42c5cd5f3e47fa7c1c210453b445e", size = 214297, upload-time = "2026-08-02T18:50:14.709Z" }, ] [[package]] @@ -1029,55 +1029,55 @@ wheels = [ [[package]] name = "hypothesis" -version = "6.164.0" +version = "6.165.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "sortedcontainers" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/7a/ac/7b76103bd74d8457e4de0c6a6c3a26ac6327016438bde125e0a3de83a5b8/hypothesis-6.164.0.tar.gz", hash = "sha256:5d63d263d8c71b571638c18d9591f6e34b836c60a12469e9d9105c1c785f00f1", size = 492022, upload-time = "2026-07-30T12:39:49.085Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7c/fe/d5b75a55892b33e72945f82efc71f645d29c0bfdb9f00727f7535a52edcc/hypothesis-6.164.0-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:14b861ac3353f8643b82a3ba76b8a0a54d2a06160c32b9a1f64a8ab41b179089", size = 771561, upload-time = "2026-07-30T12:39:00.404Z" }, - { url = "https://files.pythonhosted.org/packages/1c/b0/2f01e9efc7267446bad0e2a68f7472daa174a72553d213b16aefe44b2bda/hypothesis-6.164.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:3d8c8bb00a4b86ae90b9ad41f3e1c99d016ec3e64c0ff9d676a4bb7be4f56948", size = 767079, upload-time = "2026-07-30T12:39:23.123Z" }, - { url = "https://files.pythonhosted.org/packages/c3/26/d7bcd26b58e1df2bd39116b924b2a72676215d9650e68cbff9a629c3ce30/hypothesis-6.164.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e80e3ba8eaf37664eaa0f2625cef120b330b128a7df570210cf8be4f5ae65aaa", size = 1096364, upload-time = "2026-07-30T12:38:49.972Z" }, - { url = "https://files.pythonhosted.org/packages/9d/17/99fe7ea866935da83444c3ef7885a14fc7349d96ff61c6faebd37ef4edf2/hypothesis-6.164.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8cdf70f821e2d2f3a0bccaab29830aea8aefb63a77806e7e91246fb65a10c8d3", size = 1124963, upload-time = "2026-07-30T12:39:13.1Z" }, - { url = "https://files.pythonhosted.org/packages/38/e8/df08be6296cbc1271d44e81f8ff9dcd6267a07552fb768e0fdc166e93d40/hypothesis-6.164.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bcc3743e22b3cffa7267b4bc74d03628606e4a115495728e986a7be220987315", size = 1145886, upload-time = "2026-07-30T12:39:45.612Z" }, - { url = "https://files.pythonhosted.org/packages/4e/72/d5cf6fbfac40891d4281f630e16a6eb217ff56f97e350a06e0fd9322aa6a/hypothesis-6.164.0-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:730f09d4afcd8a918b3d589bfb6421e3b41c057aa57652a773ef4f512cc60836", size = 1101181, upload-time = "2026-07-30T12:39:05.194Z" }, - { url = "https://files.pythonhosted.org/packages/fb/ff/7ceb002329febffb678b65835ca6e9479a916325d088aadb0210d07f8252/hypothesis-6.164.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9651cb48cb5a995295b442138d15d381547b935dcb0066fca7148a7955347400", size = 1137970, upload-time = "2026-07-30T12:39:16.076Z" }, - { url = "https://files.pythonhosted.org/packages/7c/8f/c12c697b73ca9ca24d8a913879e3e0a9db86479754c7221554247c701565/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:51d161d2655dd86143b370c577267b5b7b4c2e8fcb8a3f22c1a787572aad707c", size = 1270184, upload-time = "2026-07-30T12:38:54.436Z" }, - { url = "https://files.pythonhosted.org/packages/0e/2f/93f1c850c794fc9c80f5e61b3b20652126b865e6f57b348ae530446aadc7/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:e8a250552390128b57e3afe55035ce2c2cb1f6f0919817657854244f071bc5be", size = 1397987, upload-time = "2026-07-30T12:38:21.113Z" }, - { url = "https://files.pythonhosted.org/packages/c5/b8/bab2546325e15e87c8518dfbca263c81dbc35d566c516d66c9da98a38b77/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:570cd51944e1cc3443847d8afa3d17fcf8aac475a1f744c9e7318a5ad7ef5c9f", size = 1270755, upload-time = "2026-07-30T12:38:51.571Z" }, - { url = "https://files.pythonhosted.org/packages/6a/4e/ea97dd39678a42dc5a24e3e2a64d3b950fad9fb1dcce8d7be5afb52a0335/hypothesis-6.164.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3a423e543055b3de5af7a7624c4285422541658367211fa293a3a57dd0ad01ba", size = 1312888, upload-time = "2026-07-30T12:38:30.847Z" }, - { url = "https://files.pythonhosted.org/packages/44/84/a6f2d5b12b23d65f16eb398750e430065f9d1f40f4418569e3b87ef58d23/hypothesis-6.164.0-cp310-abi3-win32.whl", hash = "sha256:f5e51490b2ce64c66138f24477d83c71b6224ab0ef65700da10187c464b54e94", size = 657401, upload-time = "2026-07-30T12:39:11.581Z" }, - { url = "https://files.pythonhosted.org/packages/f5/d3/c5ee410daa594cac2d3fe1fbe5473f2390e35f4369e168a817e43341ce2f/hypothesis-6.164.0-cp310-abi3-win_amd64.whl", hash = "sha256:c9059dfbb039342b6590bbce207f90e0f9a80fdf45a404c68c2d3e598be78ab3", size = 663566, upload-time = "2026-07-30T12:39:30.27Z" }, - { url = "https://files.pythonhosted.org/packages/90/91/4942fe3f2f08b920368ed5a2937346259e843e382205513b4a0e70d2de9d/hypothesis-6.164.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:6bc3373fe550cf4d7cadb94ceaeb91e431e1418a96b7baa330487366eaa67d3c", size = 773152, upload-time = "2026-07-30T12:38:33.328Z" }, - { url = "https://files.pythonhosted.org/packages/eb/df/e66d052386a2b6c3e2f3eab32a02d7de3c9c59cd21d5dd58c08ecfa715f0/hypothesis-6.164.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2780297ca68929b153eff7effb2ebe67e9487d2fd9f49fa961007f8f2d236c9e", size = 764713, upload-time = "2026-07-30T12:38:48.59Z" }, - { url = "https://files.pythonhosted.org/packages/f5/d5/5a50d14b8f04809e973c4dea884b367fef3663ff253c1205fa9e96229ef9/hypothesis-6.164.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b400bb4eb5a4a1e19cd5af3cc63817909e6b54b4603e04022bdba46860913d7", size = 1095160, upload-time = "2026-07-30T12:38:58.925Z" }, - { url = "https://files.pythonhosted.org/packages/58/01/781b19ce4382ec239c4dc6ec3bd9f195e69e5570f2814bbf04b5781ecb18/hypothesis-6.164.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fca6632933fc506dd96926d9383483e4c0066c7ff62c748d059a3276da761e7", size = 1145199, upload-time = "2026-07-30T12:39:09.904Z" }, - { url = "https://files.pythonhosted.org/packages/e9/64/30e016863515ca01c1c738b05dd50491353d3ccae6432362e56e0c15d0da/hypothesis-6.164.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b9e1f6e89e5ec34735b727f3ce41d12e7f3b8efc162c91c8a225e10b54b504b4", size = 1267980, upload-time = "2026-07-30T12:38:18.733Z" }, - { url = "https://files.pythonhosted.org/packages/84/23/17eb8d67d59ecd3a820c905fbdf514e371dd7d01631e62a304cdd5793abe/hypothesis-6.164.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:51b0f967f608707b24ed37a298174ae6eec7899bfe3f271d1c3062c39ad66c06", size = 1312181, upload-time = "2026-07-30T12:38:36.056Z" }, - { url = "https://files.pythonhosted.org/packages/42/69/cff9f3cd9524252adda7c8e0e129dfc176e72f64fdf0bf1552d1ea43d78d/hypothesis-6.164.0-cp312-cp312-win_amd64.whl", hash = "sha256:5770df7d518bf867a9379e9081abd9e44db1d15473430e26a0946438c08c5926", size = 660690, upload-time = "2026-07-30T12:38:28.107Z" }, - { url = "https://files.pythonhosted.org/packages/ba/b4/729697380a22dc2ce8feae3c64b08bf3bd3c27e99c3706cb9bdac40c6fc8/hypothesis-6.164.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:29e7cb48974cb9fd87602e20625c890385793c6b56c18a957085a9c291f56ef8", size = 773046, upload-time = "2026-07-30T12:39:40.473Z" }, - { url = "https://files.pythonhosted.org/packages/38/35/72374f02d90dfda198afd8aac6b1e7d1184506f97e62ebcf3d2c1e5bf761/hypothesis-6.164.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1ff8c3819345be8dd15ee6588ee9383869a54c9a3d2232cce5e26b456424135d", size = 764659, upload-time = "2026-07-30T12:38:55.896Z" }, - { url = "https://files.pythonhosted.org/packages/6e/75/fb26388915d71e5949b98ccd0c9d95edcbe6b45d0370f177d43633d81ae2/hypothesis-6.164.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:33e88be13fac3ff7cb789a0b4cc43d99fb297db085f529fbb363188141c7d5bf", size = 1095078, upload-time = "2026-07-30T12:38:34.677Z" }, - { url = "https://files.pythonhosted.org/packages/be/63/f6da6e39667d39a1e44c5df82fbe6cff070c29aaffa9beb62a5322e7d8ae/hypothesis-6.164.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2e296d03a77355ce2e1c32e85a636b555edf0ddaaef277f98f1b84fe38a4595", size = 1145015, upload-time = "2026-07-30T12:39:26.487Z" }, - { url = "https://files.pythonhosted.org/packages/88/c7/55ba09727da3d9a60628c50e31e6083a36f403cb230f5e1a7bd1749a5c39/hypothesis-6.164.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:53698a1b246714539dd0ecc2d556cde613d74e9f7385ec4109e0651ab2d382d6", size = 1268027, upload-time = "2026-07-30T12:38:25.676Z" }, - { url = "https://files.pythonhosted.org/packages/ff/35/4789cade332f799b0e8f2f7ea0fe2aae6157a85e60f74497e316dd17a7e3/hypothesis-6.164.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:004c92c4b869f8e258f0641101b7743cae8420436f4465383f681c086ef95c9d", size = 1311895, upload-time = "2026-07-30T12:39:14.621Z" }, - { url = "https://files.pythonhosted.org/packages/12/8a/18d85e624f8631aec42daa8a2f07c6edcedb7385b2c0f375ba8a30cbd065/hypothesis-6.164.0-cp313-cp313-win_amd64.whl", hash = "sha256:4878f81fa92a580d3e16b53e64e01a9d9fe1dca5973783558493a003138dbd36", size = 660656, upload-time = "2026-07-30T12:38:37.696Z" }, - { url = "https://files.pythonhosted.org/packages/c7/06/3c144d427799c7c72befb0bb3b199d419a89b96e1002fd8f0cc94c84ffb7/hypothesis-6.164.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:9110010bdf6deb3ba9134f8ce8b683e8bb0fba108a351045c96d60c410eb6963", size = 773254, upload-time = "2026-07-30T12:38:38.919Z" }, - { url = "https://files.pythonhosted.org/packages/74/2d/b61a10d9e70df04aa7e8f34efef8e4afe364e8995c59f894e1c35b428214/hypothesis-6.164.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4df103e5d32b47d574c6e857d45361e2cba5a198d6dae4e4ee1bd248b3a2cbfa", size = 764786, upload-time = "2026-07-30T12:38:24.464Z" }, - { url = "https://files.pythonhosted.org/packages/99/68/7f80ac7bdffe78686135311c919534be411d4565c2a5ba38fd389880c553/hypothesis-6.164.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4abec95020960c0ed08e5be318d2bcdde79f2c6fc7785e368a9389d31d3e802a", size = 1095578, upload-time = "2026-07-30T12:38:57.422Z" }, - { url = "https://files.pythonhosted.org/packages/45/f9/97dcbac776bcf33cb4241b52111527821f707b60a84d03d0ea670b09a134/hypothesis-6.164.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b106756cc9abd50ab1632541ea7b7223792d877a084726aa0304237d758181e", size = 1145207, upload-time = "2026-07-30T12:38:23.387Z" }, - { url = "https://files.pythonhosted.org/packages/a4/df/68184b6f71540435c895cf35ad1d67a3634a887c597ab38d3372c0d20186/hypothesis-6.164.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:11c4aab2ae6757fc4bc3bbf009487e24fd3490365817bbf40b9ec85a7e02fabb", size = 1268357, upload-time = "2026-07-30T12:38:52.946Z" }, - { url = "https://files.pythonhosted.org/packages/a0/76/6a6851dc8af89a5c0418937d38456417b2a1fc9db15c992b9cb43d53a7a3/hypothesis-6.164.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:4713edecbc0969557ca135769a36d1e524c8e3b7a2b271de48d98fa29f681bf6", size = 1312183, upload-time = "2026-07-30T12:39:28.604Z" }, - { url = "https://files.pythonhosted.org/packages/2f/19/83adeb1f8f045bd8a1ab9822d0c3db28b337d37fff01d809fcd6e3ea70f8/hypothesis-6.164.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:e6882d316c390d33c55ec8f1675f35ab238d7c0473ccf8d235c69eaef6c621b9", size = 604771, upload-time = "2026-07-30T12:39:33.579Z" }, - { url = "https://files.pythonhosted.org/packages/0b/62/fcb48ebfbccdc5b695de175b9d1d344b3688782150f0603124bb70c0891b/hypothesis-6.164.0-cp314-cp314-win_amd64.whl", hash = "sha256:7c3357633b38bca8c927fd90d02b39a0a3f35f24cdbcfb2fb1dcf69a3f63bd85", size = 660570, upload-time = "2026-07-30T12:39:43.898Z" }, - { url = "https://files.pythonhosted.org/packages/42/61/5857da7db0435fa69df658a9eafba62eb8a1319454005ce2a0d97f6f9e4d/hypothesis-6.164.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:53152cb549f52d661c47768d0d12a192ef26a7a9758a7f13b8ec41e8e63d6325", size = 771839, upload-time = "2026-07-30T12:38:26.842Z" }, - { url = "https://files.pythonhosted.org/packages/6c/9c/22292a9dab1c544362d1759244132c7d71a9d9d5eda5d454ec735fba6bd3/hypothesis-6.164.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:cee7898ad84b63da6506ae48483bb36f319a25ea4c2b1d2df47d021cc4080c24", size = 763363, upload-time = "2026-07-30T12:38:20.042Z" }, - { url = "https://files.pythonhosted.org/packages/e8/29/cc0c6e9a065a32f93fe52dde746232f007d2cabf619d4e7b1b37bd34c424/hypothesis-6.164.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0def33f0d236e54144a5218997e4492925144d4615f25fdbb4ac8e47b7b709e6", size = 1094171, upload-time = "2026-07-30T12:39:35.158Z" }, - { url = "https://files.pythonhosted.org/packages/a7/59/37040d0776a29d4bc6d0ca9a50ca2755200007e4a8ddc27b010115b69c85/hypothesis-6.164.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:471fd80d70f2df606b1320276168bc2c6007a586124a1d81628264ccb9266f68", size = 1144089, upload-time = "2026-07-30T12:38:43.024Z" }, - { url = "https://files.pythonhosted.org/packages/fa/10/5235ed3c090a2f12fa15cc1d08e5a36cfa31bc0607c45199b0806e930ab4/hypothesis-6.164.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:2eb285756aee62890fd08d6e97cf77651dfe7c093ceac094df52120a7a8dbe68", size = 1266595, upload-time = "2026-07-30T12:39:36.979Z" }, - { url = "https://files.pythonhosted.org/packages/7f/97/ffc4cee4dfdffe658e839d5f4df72ae3fa7bfea9401550b475d9700e0ee2/hypothesis-6.164.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:7c5215b5568968c35c6e124e5a4a8068f80419d6171414ddf735b49e1df1ab59", size = 1310998, upload-time = "2026-07-30T12:38:45.788Z" }, - { url = "https://files.pythonhosted.org/packages/dd/08/681d4a272cd2812151581c3328e41a80a34e420d676e419a25b4b9dc2291/hypothesis-6.164.0-cp314-cp314t-win_amd64.whl", hash = "sha256:a845e59fae87bb47a6fb84e0d5adb5679b3b55042fc3f8791da91486103cfbf0", size = 660724, upload-time = "2026-07-30T12:38:40.341Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/ea/73/fc3743243603dc49911a1ec073a3a524ea8e1c7d48218d3c2a3faa9a8709/hypothesis-6.165.2.tar.gz", hash = "sha256:680a1adf523ac792b46064f425b112ce6c08a7a8f50e65d08e029de6aa11df95", size = 502277, upload-time = "2026-08-05T21:32:43.713Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5c/63/46c9908fe7bd5ffa5002fa88fe289dfe6d3cea3fad1ab8942fe11f1c8a2b/hypothesis-6.165.2-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:33a7303566e660664f3f02ea1df85f7b966cd6723165c696996cfd8630913b3a", size = 781704, upload-time = "2026-08-05T21:32:03.548Z" }, + { url = "https://files.pythonhosted.org/packages/c5/7f/fdce62542a514f6b33c4fc0a760e6d17bb57602b28cb079b78e55b8ea32d/hypothesis-6.165.2-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:06d8fe4c82a935f67e610c99848360f5caeb04f547c7d7a830a5c74fb96f053a", size = 777243, upload-time = "2026-08-05T21:32:17.546Z" }, + { url = "https://files.pythonhosted.org/packages/9e/c8/39cd922bf3e1ec84977b768d4e8be31ae051e3a6b400b4fdd7ebcddb1eed/hypothesis-6.165.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de2e3f6a6f75c876be481138c6c0802ebe10deef9f13ce1cdd6e0ed21d8e1e28", size = 1106492, upload-time = "2026-08-05T21:31:47.844Z" }, + { url = "https://files.pythonhosted.org/packages/0f/91/7bb502379a8dcc43f2538530c05cf16fd4e386afa587d65cc289484425cf/hypothesis-6.165.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:21668cb5a8a694d45ff4c43f20a8fc577a47467b5102c680a43638b027136368", size = 1135105, upload-time = "2026-08-05T21:31:49.453Z" }, + { url = "https://files.pythonhosted.org/packages/e5/04/4ce8ae1bf78d09d7543ab7037a3beedc7f3d963c7aa04e82842415284689/hypothesis-6.165.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eea4ab5cfdd6c6a23a60777559ea06c34868234fff6542ff6125c0250429348e", size = 1156034, upload-time = "2026-08-05T21:31:44.687Z" }, + { url = "https://files.pythonhosted.org/packages/49/de/b074d899f4a04fa8b99a5bbd66f209c1c02bc21f9f87404539b28b99aff0/hypothesis-6.165.2-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:0a6add02d9b3b73b59f4d69f5b15abbc07113cd335cc140815cec2877e6b496c", size = 1111344, upload-time = "2026-08-05T21:32:27.211Z" }, + { url = "https://files.pythonhosted.org/packages/e8/38/5a8514683a181f82a8ad9f6d084b704fea7a97c9814033939fc493b55fca/hypothesis-6.165.2-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:11013896b6a2ed497079558cb9f89e8b3b564f8859782b38f72cfc1dbeca66ad", size = 1148115, upload-time = "2026-08-05T21:31:01.009Z" }, + { url = "https://files.pythonhosted.org/packages/88/c7/08cf7930d8bec7f1df971c948af2ccb5a402d5b8b19b306af655a603b180/hypothesis-6.165.2-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:4ceabc69a95e761f381663c6452537fde12a2a6e0275e095b6822c0e0f3b1364", size = 1280321, upload-time = "2026-08-05T21:31:14.843Z" }, + { url = "https://files.pythonhosted.org/packages/c5/91/c9ebb7da3b6e06c47aecceb959cf7df6af75025663af543373c5692f97ac/hypothesis-6.165.2-cp310-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:11e1ce261765ffa6acbaf540358426519ca4a5e46b825cf39b429c77c1895689", size = 1408134, upload-time = "2026-08-05T21:31:27.383Z" }, + { url = "https://files.pythonhosted.org/packages/ed/24/13c2fd9f253ba3a92d4aaa61ae45a8b130df57ab5bd6fc481e2aae520e36/hypothesis-6.165.2-cp310-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:b0250099b2e55d72872319918aacc501110a182938a3d56bcae4a999bee5db08", size = 1280884, upload-time = "2026-08-05T21:32:00.188Z" }, + { url = "https://files.pythonhosted.org/packages/6e/fa/2820bdbe0660394544b9e120b03ea7020702d7fa5c76236166de6ababc9d/hypothesis-6.165.2-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:96d02928d1a0b7d59e39fd8ada75f0b7d0377ff29f91c94109f92fc2dab9af74", size = 1322998, upload-time = "2026-08-05T21:31:24.373Z" }, + { url = "https://files.pythonhosted.org/packages/f0/24/38752794eb821f5c77da08523602003c344f3498fce09f20741cd5b5e29c/hypothesis-6.165.2-cp310-abi3-win32.whl", hash = "sha256:0f2044093c8244d73893e755a7fa53154b7eca57b37e1427d9b0d9948f6c2b3e", size = 667506, upload-time = "2026-08-05T21:32:10.547Z" }, + { url = "https://files.pythonhosted.org/packages/5f/71/b28f714a127017750e450d152aa4fbff51bd144c6840090d28b529b408d3/hypothesis-6.165.2-cp310-abi3-win_amd64.whl", hash = "sha256:2aa30716066e5ee7750e56b8f90cefaf4ed28c12b4b1d66cef40014fd3f95196", size = 673650, upload-time = "2026-08-05T21:31:25.726Z" }, + { url = "https://files.pythonhosted.org/packages/98/81/a9039e7eee38523e2ad13e9e4e70c508f25d4205fb4c6ceb98632547ca82/hypothesis-6.165.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b24f1b238deb97fda828a939931de3210f5cef21e87fe0b941fafbeb55ead676", size = 783294, upload-time = "2026-08-05T21:31:56.881Z" }, + { url = "https://files.pythonhosted.org/packages/8d/e5/120642320291d8d117a83491d93527149ddbd15e56399274741fc4bd3a9a/hypothesis-6.165.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:306763ce7186e08ee30dba409b320873d1afc54adf76b44c6bf83b5867d17359", size = 774867, upload-time = "2026-08-05T21:32:05.489Z" }, + { url = "https://files.pythonhosted.org/packages/b5/ef/251607eb2446fb44e8faa83e30aa1b6cc281b6eca5d0ecaabe7527e3395d/hypothesis-6.165.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f878ebc5c33e4e8e8a90bd3d7ccc3f3a7370847aa22243536e673047f0f4c37", size = 1105307, upload-time = "2026-08-05T21:31:53.719Z" }, + { url = "https://files.pythonhosted.org/packages/54/f1/de30869d83f00137a664319a4acb0ba8b1a9e2c879afdc12abb1b4c703f7/hypothesis-6.165.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d726513b32cc6407667ac0812fa3517408f933b89b16b6b84f296335eec18432", size = 1155348, upload-time = "2026-08-05T21:31:58.536Z" }, + { url = "https://files.pythonhosted.org/packages/fa/2c/8925c2bddf6e105d947a04511cd5d536eabc8d4ed926518a0d1672ede007/hypothesis-6.165.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a700c0e193707e3b6f1b23f1d5f534896dd9f79bb2a2340582579bad5f5b59a4", size = 1278124, upload-time = "2026-08-05T21:32:14.049Z" }, + { url = "https://files.pythonhosted.org/packages/b9/00/e285e7987e96d74e229fcb94c58dd8e85290966fc2040fbac4b081fc49c9/hypothesis-6.165.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:50d50e313dfff2e79c754b92a4c88c479dd9e102a56c60caa5b3d6263caa1b02", size = 1322340, upload-time = "2026-08-05T21:31:11.671Z" }, + { url = "https://files.pythonhosted.org/packages/51/7a/990e802222b3a88a284a872fc41339e39d8b619e5266aae45ef1c5da231a/hypothesis-6.165.2-cp312-cp312-win_amd64.whl", hash = "sha256:e2493b71a6e75dbd9ab33f8ab3920a6850a7965de55baf9725738a227ef3bfd2", size = 670805, upload-time = "2026-08-05T21:32:19.278Z" }, + { url = "https://files.pythonhosted.org/packages/22/01/add18f19d5e5f084a59709f0dcebf3cb1edeca475ce8a31573dc33891e66/hypothesis-6.165.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:e2bf15d05264ec9da8d55c3843902f906ced5e84fb3da924eafe165697ab4638", size = 783183, upload-time = "2026-08-05T21:31:55.305Z" }, + { url = "https://files.pythonhosted.org/packages/8e/4b/df2e4c24d208518a6a3dab7acabad7f5ec6c5bb0f4d0bf1701d2fb7206ce/hypothesis-6.165.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3748153d4f64d347f8c988dd41fbef3513b66819e73e9209b1c501bf0d716a13", size = 774829, upload-time = "2026-08-05T21:32:01.891Z" }, + { url = "https://files.pythonhosted.org/packages/72/a0/b75a001efbde704ff2188924a4d4bb3cdf7a22924dc51c155115af64858c/hypothesis-6.165.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f689976e0eb578afbe8ce37669cb637f00f7c545ad303412947ee4abe2f29ce6", size = 1105224, upload-time = "2026-08-05T21:32:35.189Z" }, + { url = "https://files.pythonhosted.org/packages/71/f2/4942f510c6441b5d60dc7f0d8d2af74fe444b62d3af565bdf42d9b6b803d/hypothesis-6.165.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f7c68a5684b2e2ad3c33500198a6073b3d04493fd7b1ef34937645ad092b797d", size = 1155166, upload-time = "2026-08-05T21:31:46.408Z" }, + { url = "https://files.pythonhosted.org/packages/48/11/405ebff50c6949518d34f487017412d5b8f8ee9239e50ecdfdd99a745f4b/hypothesis-6.165.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b40db922ccb53fb77c68d944748a3eb5b945402967b64093d9ba970d028cf1af", size = 1278170, upload-time = "2026-08-05T21:31:43.116Z" }, + { url = "https://files.pythonhosted.org/packages/73/ff/93ad0f4b55100876604d2c316a8c6e0ee037cb0da925caaa478709e504b0/hypothesis-6.165.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:d2fd48ec969b2dbe1c8e25dc86d199c6820b9222846469449b997f5546383378", size = 1322061, upload-time = "2026-08-05T21:32:07.217Z" }, + { url = "https://files.pythonhosted.org/packages/14/37/14b655c664a957e44c7f59d9498e53d79b55f1b752a1bb38fee9da403e9c/hypothesis-6.165.2-cp313-cp313-win_amd64.whl", hash = "sha256:9cf13225121280036ea5a8ff8babb82ec27a4736aea669bbe0bc9839d254575f", size = 670824, upload-time = "2026-08-05T21:32:21.25Z" }, + { url = "https://files.pythonhosted.org/packages/6f/ce/a2de75f1a12b6670edfca890794daab685a63ab1a2e36f28dc2c4d8e831d/hypothesis-6.165.2-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:66be9b848bdcb29132b18de6f574b89b392024c7de442acb393edaa1540cb548", size = 783398, upload-time = "2026-08-05T21:31:37.916Z" }, + { url = "https://files.pythonhosted.org/packages/02/8b/bf01b5f356f64a8af28be2718674e23ff7c0a4dbc5f476295be624b1a5ad/hypothesis-6.165.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:e51742efe8466cf89e26cb94843db8854bd0673a6d80da7e3d1ff6bd9dc006db", size = 774963, upload-time = "2026-08-05T21:31:10.053Z" }, + { url = "https://files.pythonhosted.org/packages/a8/4b/9ad06c5a5613b6d175a7fd1a518a9732bcc4772c0cb24f6d7e5fd63f7fed/hypothesis-6.165.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c648ee54cd734261e1615d80c2ebbd679d6dfbba6ef5aa672354c6ca62b6f446", size = 1105721, upload-time = "2026-08-05T21:32:29.252Z" }, + { url = "https://files.pythonhosted.org/packages/9c/f1/04c8ebe621c8b832106859f9425f91d049a96ccf99c3501f2905f3e1291a/hypothesis-6.165.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:032292cbffc0743b2fe4337a30c21ea9703a70a0021d39bf0c3e68bce7baab18", size = 1155349, upload-time = "2026-08-05T21:31:39.636Z" }, + { url = "https://files.pythonhosted.org/packages/6e/23/41fe5e805638dcb6a1b70c147e909d254d9f09db5ade7a3e790c94ec926e/hypothesis-6.165.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:5dc64171b06472f0b6c2e54bdc25687987e560e15133cf52f55d9ef4c747ebe1", size = 1278502, upload-time = "2026-08-05T21:32:23.405Z" }, + { url = "https://files.pythonhosted.org/packages/ce/42/54fdfc954314980d2b0eabbe57ef2960d85f3b1acb95f3326ff931ed349f/hypothesis-6.165.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:8e5a823ba918641af8177c121f122964d471db2ab1d07c1fe229c77b3a5ab7e8", size = 1322379, upload-time = "2026-08-05T21:31:05.39Z" }, + { url = "https://files.pythonhosted.org/packages/68/db/3667633b31b2b423b320fec4b7ac154e74d6b4a122fadd8e06f9d9afbef1/hypothesis-6.165.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:70966ab7dbe0ea9644eaed8324e037f05ac6a8141646b977da9e77813dac6ed7", size = 614909, upload-time = "2026-08-05T21:31:41.464Z" }, + { url = "https://files.pythonhosted.org/packages/2c/d9/0168c0d6ea32c195225b0673ee8cb7b61de6841d62c87d614d26add35770/hypothesis-6.165.2-cp314-cp314-win_amd64.whl", hash = "sha256:a5b913acd896f4f80597dd38966cd13984a1cfd45512498e8cf054aa7c92ffb9", size = 670684, upload-time = "2026-08-05T21:32:37.076Z" }, + { url = "https://files.pythonhosted.org/packages/21/e4/61cea938488b6958f07b8249bf37fcfb2802367e2a6af65afe82b05ca18c/hypothesis-6.165.2-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:6fa46589088966083ce653f908560cdd3330274cfafaaa65d1fb29b5f6681644", size = 781982, upload-time = "2026-08-05T21:32:15.899Z" }, + { url = "https://files.pythonhosted.org/packages/15/73/b4f9ba3e4b988b567d887b0857962e841b227a81a02ea83ae520e2001c31/hypothesis-6.165.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6b5b922603879b4788447583928eb1cf2e1aafb9ce27f3a7234b7a4557d089a8", size = 773430, upload-time = "2026-08-05T21:31:28.913Z" }, + { url = "https://files.pythonhosted.org/packages/9c/e2/6fb4a2edbc7775dfa4d3950e3537239c6d957eeb6c571275edfd79a2b981/hypothesis-6.165.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8ab3a6b5bb3302f7dcd65b07dcdc0ca353c8c151567dffeda826977e765caaf9", size = 1104317, upload-time = "2026-08-05T21:30:57.765Z" }, + { url = "https://files.pythonhosted.org/packages/5d/06/9479b2acc58996ae18300becbaf910d7c542b5054a47ba05c28bdacd08f1/hypothesis-6.165.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:09f1c626023b68968d2cc5fe1e31548109f4406d81a2c3017b3de9fdd3a02e7d", size = 1154232, upload-time = "2026-08-05T21:31:30.368Z" }, + { url = "https://files.pythonhosted.org/packages/e3/9b/5b5cfce5445a807d042ca5a1a470606613835842d99488a199d994584cae/hypothesis-6.165.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5c95808ab851498513192268e25f40bccd1c3719384c91535bbec3eedea39760", size = 1276739, upload-time = "2026-08-05T21:32:12.324Z" }, + { url = "https://files.pythonhosted.org/packages/2e/aa/6a731776ccaee13dba0624a73f01935fa174f39647ad463a495dcb2206a8/hypothesis-6.165.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:4a1c8bec789f21dc10620ce99e15fcd4f7737b9b4cfa571cdd93e01a17b7b06b", size = 1321119, upload-time = "2026-08-05T21:31:21.113Z" }, + { url = "https://files.pythonhosted.org/packages/43/a1/5d2c7c1346a0089908a3974c9e40ce223c22dd291dfe5df69a8c8cc64b98/hypothesis-6.165.2-cp314-cp314t-win_amd64.whl", hash = "sha256:458c891dfc00133bc4ce2e6c9716838f80f2fd96caf306f5eef42ad02aa4d972", size = 670831, upload-time = "2026-08-05T21:31:17.998Z" }, ] [[package]] @@ -2014,11 +2014,11 @@ wheels = [ [[package]] name = "packaging" -version = "26.2" +version = "26.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" }, + { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" }, ] [[package]] @@ -2889,27 +2889,27 @@ wheels = [ [[package]] name = "ruff" -version = "0.16.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/4d/94/1e5e4967626faf12fa56999cd6222dff6992ceb086ad7945756baf70c7a7/ruff-0.16.0.tar.gz", hash = "sha256:e460aafd5495ec89efaa6ced2e4a9a581116451e1c88b9d37ef497e0f8e93982", size = 4790557, upload-time = "2026-07-23T19:11:30.981Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/4b/81/1c8818fee7ce1a04cd7d1b3172e0a8f8e4f1dc4feb7fc390e16daa8af323/ruff-0.16.0-py3-none-linux_armv6l.whl", hash = "sha256:e5115729eb08c585e5121978ba5d5b60caeae394ce21b9fb5e6cd33a1c6c9b1e", size = 10754633, upload-time = "2026-07-23T19:10:46.415Z" }, - { url = "https://files.pythonhosted.org/packages/23/df/beaf59c09d68db84304d555f188b276a77132a5d5b0b67a5c762aa143628/ruff-0.16.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3c954b1d580bfa035b41654f7858cc7e71d5fc3ac5b723dd62bd9133830ed522", size = 10969164, upload-time = "2026-07-23T19:10:50.271Z" }, - { url = "https://files.pythonhosted.org/packages/42/ce/741cd197496a1abbf51352710fd15ed995d2a2be87189c1da26a450d6e83/ruff-0.16.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e01c21d10eb1b29f47b7454e1f4056db9a3f0260c646aa88457c610291db9f81", size = 10488846, upload-time = "2026-07-23T19:10:52.639Z" }, - { url = "https://files.pythonhosted.org/packages/52/2a/a2db8e88cade358f5cdcb05674a917751074109315d014eb6352d9a893f7/ruff-0.16.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e364e5ed22ed8dc05082fd78e35308618260907ac2d3c1d637b2e682415b6c9", size = 10889729, upload-time = "2026-07-23T19:10:54.89Z" }, - { url = "https://files.pythonhosted.org/packages/42/65/62a771694ebd63029dc953e27dbad40e1588bd4860ff9fe881018fddaa49/ruff-0.16.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d327b8fc113a1d4421a04f3839d3752057c8dd1ee320223a6f3f52d04ada462a", size = 10568275, upload-time = "2026-07-23T19:10:56.993Z" }, - { url = "https://files.pythonhosted.org/packages/3f/e2/ced249fe8af5f086c5c58cc21cc3356d50f32f7401c5df87050c999620a7/ruff-0.16.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9b50c55e263103586b3dcf5f73d479eb8cb5fdb6098fec59a62891dab653717", size = 11385112, upload-time = "2026-07-23T19:10:59.615Z" }, - { url = "https://files.pythonhosted.org/packages/87/0b/05154977a8fd69eeb6c103271f55403bfd8711f5c0f8ed07489d95a504e7/ruff-0.16.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0ff4a79ce3ec0172f3241943835de1c4cb4e2dcd07f0f8c2d02603dbbbee4b17", size = 12207008, upload-time = "2026-07-23T19:11:02.154Z" }, - { url = "https://files.pythonhosted.org/packages/fb/29/98225831a3a1eab0e02f4acc6ca6559a98611dcc68b6965ff4b7234627c1/ruff-0.16.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e95c448fca1fb2a18372a9440926c5a6ee789639bb975c72e7ae6d0b04218ab4", size = 11650842, upload-time = "2026-07-23T19:11:04.557Z" }, - { url = "https://files.pythonhosted.org/packages/91/66/6bd3cf90500653d55dc0ffc8507aa8300bd49d0214b2e8cb4d3fef2943ba/ruff-0.16.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f11a8d11010301d0a398a2fdef67691feca7294da6aef55e2150e8fa2cd520b", size = 11400718, upload-time = "2026-07-23T19:11:09.233Z" }, - { url = "https://files.pythonhosted.org/packages/8e/a2/a54eb4eae05d66364050a5d3b8a9c5ef88196531b3cbe7109d873f87f819/ruff-0.16.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:48044c678e9cb8698246c99b14aaccfa6601dea7379eb48a6f8f73f7a6d86cd0", size = 11426177, upload-time = "2026-07-23T19:11:11.994Z" }, - { url = "https://files.pythonhosted.org/packages/1a/be/16e3eea4b2a478a496919f5e36f17c4559e54620bd3bbac5d6affa068006/ruff-0.16.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7aa0959bad8eb8bef50340154fc9b58678dae31fa4293afa38b44b6e552c0213", size = 10856126, upload-time = "2026-07-23T19:11:14.221Z" }, - { url = "https://files.pythonhosted.org/packages/a2/84/252eb8b868a16eec7257c14f504f77537e734b2d69c762e639e588e304a3/ruff-0.16.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:28ea2b7df8ebf7f9da6b7d47b230ab48f387c0a29be3b474c4d0740e197bb9af", size = 10571208, upload-time = "2026-07-23T19:11:16.378Z" }, - { url = "https://files.pythonhosted.org/packages/21/09/817a482f542f7570cbb4554b26e896610c7114f539b1d9e2d2145bf6bef6/ruff-0.16.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:33a3dfac8c35f81498dea9181bccc2f4c4bc8f1521a1dd9406e77643e0f0fb09", size = 11063329, upload-time = "2026-07-23T19:11:19.173Z" }, - { url = "https://files.pythonhosted.org/packages/2e/23/9403c180ca1cb9b1f7335f5c3e5305c09d49ea5b345196682a36028bde4a/ruff-0.16.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a5237a0bda500d30d81b8e07a6973a5cbc772864cbf746ae2f4e8a2e01c9f4ed", size = 11489751, upload-time = "2026-07-23T19:11:21.74Z" }, - { url = "https://files.pythonhosted.org/packages/b2/1d/1b2ef7bcde851c78d7f17f1cca13fd6dc695fc4b3d6197941e72cae5b132/ruff-0.16.0-py3-none-win32.whl", hash = "sha256:7fab76fa065c873f41ff744347c6e77bcc3dfec4bcc754dc26b63d23c0f7f5fb", size = 10785885, upload-time = "2026-07-23T19:11:23.947Z" }, - { url = "https://files.pythonhosted.org/packages/b2/a3/d5e4ef7a56be3f928ffb90b94c25ba7d3cb9c7fe0736aeaaedf361770712/ruff-0.16.0-py3-none-win_amd64.whl", hash = "sha256:429c117f022bf481fabd9d551e7a3952b24c65e6ef44337ea09d90bebef14472", size = 11923141, upload-time = "2026-07-23T19:11:26.409Z" }, - { url = "https://files.pythonhosted.org/packages/cb/9a/8415f2657cbe200f41a4531ccededf135505a92d4a012229121f885b26f9/ruff-0.16.0-py3-none-win_arm64.whl", hash = "sha256:14296fedcd2705c77ab8235439278bbb38f285cf7da5528b00b3e330c3d4872d", size = 11273407, upload-time = "2026-07-23T19:11:28.705Z" }, +version = "0.16.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/70/25/7113f6d5498888c5fb7db34081cba7d5971c4cb1bfb26819966eee68f003/ruff-0.16.1.tar.gz", hash = "sha256:fedad7c801dabd3fb9741d76aca39246e6ddd9ca446a015875207bf19f1e6bc7", size = 4877500, upload-time = "2026-07-30T19:37:01.379Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1b/bd/694da69368e0973de65df2ddc73ab18d43c469d5963d9b150911de6bc513/ruff-0.16.1-py3-none-linux_armv6l.whl", hash = "sha256:58edb313b88f0c5460a26adf5f39a37a3be789494a15e3e411e35fa78b89f9a0", size = 10839126, upload-time = "2026-07-30T19:36:13.697Z" }, + { url = "https://files.pythonhosted.org/packages/3f/f0/b626e5d5bd0dd9576263658ef12885e2288afd1029a48e26ffed65ec1ac1/ruff-0.16.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:fde5a99e2f97479af66edd6622c6d5a2a7592c77cf4153d9e4428f5eeb55b60c", size = 11070253, upload-time = "2026-07-30T19:36:17.14Z" }, + { url = "https://files.pythonhosted.org/packages/83/63/f40acfb6b35b88623e71684942b552c3edd96035f5d98f313815f7b277de/ruff-0.16.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e0d4c20532fca4f7fa609369161d968dd28f65d83dabbd61d8e9c7edbf7001f6", size = 10561425, upload-time = "2026-07-30T19:36:20.04Z" }, + { url = "https://files.pythonhosted.org/packages/aa/dd/14ec0e9c2b4d315547dd38765004b4863e354e1b52cb308272215d9f6f6d/ruff-0.16.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30affbcedf59ad5703d9c91f82266e02b47739f797e1a7b6e158e5526a6dae38", size = 10948879, upload-time = "2026-07-30T19:36:22.476Z" }, + { url = "https://files.pythonhosted.org/packages/33/e9/9d870cbae575030fdef595f04b4b97573c525b5497cce4f4498cf2f85446/ruff-0.16.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:24e9c631573cbca9d20f1283f8f479b2afa4a8503504822bd71a293889f16743", size = 10643691, upload-time = "2026-07-30T19:36:24.914Z" }, + { url = "https://files.pythonhosted.org/packages/c4/09/12743d544e2173f53ecd27217c65f90d2bc0f8424a66a60339e56bbc0457/ruff-0.16.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b41bdd48fb420987a9b5212e4957c26ad4abce401fa9ea9d4d85843727945f4f", size = 11435354, upload-time = "2026-07-30T19:36:28.447Z" }, + { url = "https://files.pythonhosted.org/packages/7f/89/a1652b2daee52083c9554a6333b678a8b01d0400f976827bb87857f9449a/ruff-0.16.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b0d1e1393b7648079e13669de1c1f4fde06d4583e84d8fd5c1551e0a77a2aa75", size = 12259033, upload-time = "2026-07-30T19:36:31.326Z" }, + { url = "https://files.pythonhosted.org/packages/16/96/ecdcb8c54ee7b123b487f807eb014e6e019155a0b81dfb669acd52f28ce3/ruff-0.16.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:07bf434b1c95f4e093be4532068ef4fcf00924eb2ade8796075980902d6fd54a", size = 11667981, upload-time = "2026-07-30T19:36:34.394Z" }, + { url = "https://files.pythonhosted.org/packages/cd/90/c52e12e0d862e9572f2a33aa227409143520abe53111e9a6babbac7b4af8/ruff-0.16.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39897739f112253ee4fdd2e8aa9a4f9ded99fb2be367d5f31dfa4ded6025584c", size = 11468183, upload-time = "2026-07-30T19:36:37.339Z" }, + { url = "https://files.pythonhosted.org/packages/2c/6b/4ffb7ad1d83eb16cf8cbb3c8815d3f11c88460fd162d4b372a2059be1c2a/ruff-0.16.1-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:82ae3c0c0d74daf17b968a10b7b3bb3ef297ab7de0c1f749646b25e690ccb150", size = 11470071, upload-time = "2026-07-30T19:36:39.91Z" }, + { url = "https://files.pythonhosted.org/packages/9c/72/32ae7db4c0b5e32ab611787caa19d1546800676d79f7483b7100a3561bf4/ruff-0.16.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4d5f2ed10f8242d83fc08d521301089364e3375375705356f20c0e31606ef3ef", size = 10919503, upload-time = "2026-07-30T19:36:42.65Z" }, + { url = "https://files.pythonhosted.org/packages/f7/ca/3d901ba6ad6fc38da39c3448fc6c59ac945679293a17c3ceb6d6c1cba13e/ruff-0.16.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a4665b309891f83f3e3c25447935f1213e9abbd4b5640af7a1f2def9f8d413c1", size = 10649861, upload-time = "2026-07-30T19:36:45.18Z" }, + { url = "https://files.pythonhosted.org/packages/92/79/894ef1ced26552d5f8c9cf6d85b0687840e1128c55aeab7b9c2d54a0d880/ruff-0.16.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:26e9ca5c9bc3971f20d3cf18a957f52ffd6a5f6564ff15c4912a144dcac22494", size = 11148137, upload-time = "2026-07-30T19:36:47.936Z" }, + { url = "https://files.pythonhosted.org/packages/2d/69/3609a09fa1cb46cc28b762363e440a354204e5dff01bd0c8d7437874d6b9/ruff-0.16.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:67e1e1e3fa4f0c82f0e36d4cd61e661f6e7a6196cb1aa92fe0828fa7b8f257cd", size = 11559211, upload-time = "2026-07-30T19:36:50.448Z" }, + { url = "https://files.pythonhosted.org/packages/fc/8a/fb22af2fd78a736e241fabf67e30ce1799a64244026377a49e133af90762/ruff-0.16.1-py3-none-win32.whl", hash = "sha256:d31765e131295b8445caf301e3e8a85b34d1b9b211b4109b7ba457888b051806", size = 10838258, upload-time = "2026-07-30T19:36:53.298Z" }, + { url = "https://files.pythonhosted.org/packages/d4/35/e57fd9fb5d423961df087a00b12d42c0a830288dc2f3b45ecca299158b4f/ruff-0.16.1-py3-none-win_amd64.whl", hash = "sha256:09b05e8b90c2cb06ad63464350e7a45e8e44a2dfe52072ebfba6666ca8d3f596", size = 11961111, upload-time = "2026-07-30T19:36:56.107Z" }, + { url = "https://files.pythonhosted.org/packages/cb/46/240ea004bf6dc4feb40e9832f2205a476a47dd5b8a3f8211a5fc5f95e20e/ruff-0.16.1-py3-none-win_arm64.whl", hash = "sha256:dbaadaac38c70239f056d306b7476f246b0bf000fa6b3876402acbf5b227eaf8", size = 11309414, upload-time = "2026-07-30T19:36:58.79Z" }, ] [[package]] @@ -3113,7 +3113,7 @@ wheels = [ [[package]] name = "typer" -version = "0.27.0" +version = "0.27.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "annotated-doc" }, @@ -3121,9 +3121,9 @@ dependencies = [ { name = "rich" }, { name = "shellingham" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/37/78/fda3361b56efc27944f24225f6ecd13d96d6fcfe37bd0eb34e2f4c63f9fc/typer-0.27.0.tar.gz", hash = "sha256:629bd12ea5d13a17148125d9a264f949eb171fb3f120f9b04d85873cab054fa5", size = 203430, upload-time = "2026-07-15T19:21:07.007Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ae/40/4a3db7990d1f62a53182aa96eaef57aeb2886a27f90a195bc66713565d31/typer-0.27.1.tar.gz", hash = "sha256:a79bef8469a79c45498e7b814ecf8d603cc7644e9acbd9e19cac0334240b18df", size = 203994, upload-time = "2026-08-03T14:41:03.438Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/40/03/26a383c9e58c213199d1aad1c3d353cfc22d4444ec6d2c0bf8ad02523843/typer-0.27.0-py3-none-any.whl", hash = "sha256:6f4b27631e47f077871b7dc30e933ec0131c1390fbe0e387ea5574b5bac9ccf1", size = 122716, upload-time = "2026-07-15T19:21:05.553Z" }, + { url = "https://files.pythonhosted.org/packages/43/89/9518bc0c3929bee36b3a4a8e3daddd6e03f92f9961c66d4983b837160543/typer-0.27.1-py3-none-any.whl", hash = "sha256:53150287edd11baeb4e4722c8e394fcdf8181c0ae89485cba8d25c778d5edd56", size = 122874, upload-time = "2026-08-03T14:41:04.391Z" }, ] [[package]] @@ -3171,28 +3171,28 @@ wheels = [ [[package]] name = "uv" -version = "0.12.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a7/e7/5a94b658b08c46142cf7bf1d0c432cc7d04375b80f42765633414e7541bd/uv-0.12.0.tar.gz", hash = "sha256:80ba22cae467c6f47d2157ec2b840c032cac709b85ab1300ac4dcfeb29986462", size = 5827380, upload-time = "2026-07-28T18:57:12.191Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/20/e9/5663af6b4d90827c008005cfe7926a747688bd408226913d249b9de8492b/uv-0.12.0-py3-none-linux_armv6l.whl", hash = "sha256:11cc7ef5386fe54536cc8921676728a0e5c348cf522c8ee1fa0b81cbafc20cbc", size = 21499556, upload-time = "2026-07-28T18:56:27.552Z" }, - { url = "https://files.pythonhosted.org/packages/4b/8e/b88ae4a3b704f60f8e9dcdef78047c3749077b2f1e884bd387c8e41fe378/uv-0.12.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:074e693e9b2df99f621166b44760abe0d53cd9b0ae96fcbfec5809497925da87", size = 19751720, upload-time = "2026-07-28T18:56:30.623Z" }, - { url = "https://files.pythonhosted.org/packages/a5/7b/15d6865264120bd30c738b4bf63ddff66d087087cadeb2a6b88c6284a446/uv-0.12.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:009758d8fde2da2b90900f5fe863c71d0e1b8b28bbdba59863ceb967973a3735", size = 18117978, upload-time = "2026-07-28T18:56:32.904Z" }, - { url = "https://files.pythonhosted.org/packages/0e/bc/2066cc63e6930e3d5e27c73a9c439418164eafb4f1c24845f17caf63eaea/uv-0.12.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:effc2de9f044e880306f3c52b048bf24ee4fe63429c82dd6509c9a0f3d1b8f0b", size = 20833318, upload-time = "2026-07-28T18:56:35.567Z" }, - { url = "https://files.pythonhosted.org/packages/2d/d6/49fef7e4e3c401540113115846e47094aff7cda86f54ba79477636758e38/uv-0.12.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:e9e660171873f905a6782bf2a5e7515aba1a8e8a5cfce0add68fbe7a22ead8b0", size = 21056599, upload-time = "2026-07-28T18:56:38.117Z" }, - { url = "https://files.pythonhosted.org/packages/2e/b9/cc32f406b5429cbb0f0849938d12a24a33c3bd28b710c8ccd0955c588131/uv-0.12.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53c5c07fafcf620d23faa8f339742806d57cb82122c97544d0f3750f55e2fe36", size = 21100563, upload-time = "2026-07-28T18:56:40.305Z" }, - { url = "https://files.pythonhosted.org/packages/42/ff/36eef4c1624ed371d8367cf96207f35ba81b42b8308688d1acad835432cc/uv-0.12.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b80a1a89aad16c6d84dd96b0c795b44f3824f0765e815af2f93fd05cb4a894cd", size = 21763617, upload-time = "2026-07-28T18:56:42.59Z" }, - { url = "https://files.pythonhosted.org/packages/05/23/b82dbd945c5b8a88ed5dc8c2c001619677ad5aea246318716c773711aef9/uv-0.12.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a1e84987c4b4d832796b779ad614e91c1b44ac1ade5163c00654b70881ef53cb", size = 22917937, upload-time = "2026-07-28T18:56:45.546Z" }, - { url = "https://files.pythonhosted.org/packages/7b/d9/44f5f753fda99820b972251c3be9ca9e56d98f4ced752cea623f19479fa8/uv-0.12.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dbb9d9c40e91b6bf5e124230277fe5579ecf685e6de47e61a0eed8af5ffa0cdb", size = 22555435, upload-time = "2026-07-28T18:56:47.882Z" }, - { url = "https://files.pythonhosted.org/packages/4b/ba/bc14d74741b0292edd8e61e87a4bd96f79447a1b9d27e85cda2e8539039b/uv-0.12.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cbff74f884846d794713670faf8abe10db3bd70c43b01e63223f74eb7d958689", size = 21986958, upload-time = "2026-07-28T18:56:50.271Z" }, - { url = "https://files.pythonhosted.org/packages/1d/52/e14f0a91be4b426f18107f63b1b87e99ec671e8907689cf45144a79c4f76/uv-0.12.0-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:c818bb6aead39652e2ad644583fa418ac8d92baf50b4c6f685738bb2598e33bd", size = 20965849, upload-time = "2026-07-28T18:56:52.628Z" }, - { url = "https://files.pythonhosted.org/packages/0d/a6/ef7b436f9983c467b88bacb5ce58620398c7fe7fa86ee67906bfce343201/uv-0.12.0-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:5fe6cdc82cacc630827f2ec779b91b0d13ff57ff476e41bdcace05cd61261951", size = 21671684, upload-time = "2026-07-28T18:56:54.923Z" }, - { url = "https://files.pythonhosted.org/packages/9d/c8/19086d68078b514be4c266081e11d5530b07d099cb05d011e1fa6a216e10/uv-0.12.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:fcf4b6d0807f8f05a7dd8c090f080674e8526db27a0764af2a5a54ab5096c3eb", size = 21798247, upload-time = "2026-07-28T18:56:57.226Z" }, - { url = "https://files.pythonhosted.org/packages/4d/87/571847075bbe2205ec7ae108c17d01742a1251aea9fe5f9cd5da1496922e/uv-0.12.0-py3-none-musllinux_1_1_i686.whl", hash = "sha256:4be9870fca2952143f33a02347c8da603bbe645283e3e989f038ef7b306b3ecb", size = 20977006, upload-time = "2026-07-28T18:56:59.544Z" }, - { url = "https://files.pythonhosted.org/packages/be/df/d391bc0f5901ff8a0d6285eb433222cacb972b5e5817a420e084ee698894/uv-0.12.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:ed4053e07048ab3561de95c3b686b7983f997cd19d53a265a238103b5dbf258a", size = 22186132, upload-time = "2026-07-28T18:57:02.014Z" }, - { url = "https://files.pythonhosted.org/packages/9c/fe/d440d50811ef913cb035e4c5f346799d9353fd5a8aa8479e57d7efc34692/uv-0.12.0-py3-none-win32.whl", hash = "sha256:bef14df9bec1ee7577fdc5b37d02ad8128574a2eebc130c525255edac051b9a4", size = 19210613, upload-time = "2026-07-28T18:57:04.493Z" }, - { url = "https://files.pythonhosted.org/packages/cb/27/c3da5b9136925ea2bc9209f7cabbfae12fd191f778456ead0f2d6de446a7/uv-0.12.0-py3-none-win_amd64.whl", hash = "sha256:ffdfed09a23e67ef6facf1d4db978a3cd73a886674644131a11a933fd746904a", size = 20005960, upload-time = "2026-07-28T18:57:07.332Z" }, - { url = "https://files.pythonhosted.org/packages/9f/bc/d04df3b6c36be124cb99e7eab59db514ec528f2b5c5ac2ed9fec41fbdc71/uv-0.12.0-py3-none-win_arm64.whl", hash = "sha256:e3d748f526739110dd9e267ecca30604b64a5fe3344f903d348b5a3af1f0a90a", size = 18981523, upload-time = "2026-07-28T18:57:09.743Z" }, +version = "0.12.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4d/e7/653d48766f5a7a330fdb83e7de67705e2a428bc65f783ed11a0d835e9865/uv-0.12.2.tar.gz", hash = "sha256:1fa777b1b334b4b4c95af09ae0b128c2404084f412a851bdb0b6f5e2eb357df1", size = 5873701, upload-time = "2026-08-05T19:21:55.919Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/47/22/629a8fbca3d2d4a00030e76e4aeb5bf99458b74ceb8e681e7d64c1a9094b/uv-0.12.2-py3-none-linux_armv6l.whl", hash = "sha256:618214e75871dba436c469456bdd8019ead2cf66689bd786bd48261e367f2b1f", size = 21779937, upload-time = "2026-08-05T19:20:52.663Z" }, + { url = "https://files.pythonhosted.org/packages/db/46/012f5592c94cbbaca7a2aedb3d853891519a63675b846b1f72dc22bf984d/uv-0.12.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:594dab10d5ff79ca686807fd25c9f4ebd5c40157ddc4a25c0dd934d18ae56bc2", size = 20046124, upload-time = "2026-08-05T19:20:56.871Z" }, + { url = "https://files.pythonhosted.org/packages/bc/bd/55222e2da09f12be3e662e4a36a9c68cde85c27c943c0867f3b12f1aea76/uv-0.12.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c5d10c5ba988afe7fe0cd0b943219eaa45d4191a37e3165126b0bb3e308373cb", size = 18415024, upload-time = "2026-08-05T19:21:00.228Z" }, + { url = "https://files.pythonhosted.org/packages/3b/88/3b08dd402cea1121b45baf2a2e1b105ecea9fa6b007564fca14f04eedf58/uv-0.12.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:974a79184f901cd6f6fb4155d8fb2f709c951b4f5843352dabccee08afcfd8ee", size = 21167788, upload-time = "2026-08-05T19:21:03.587Z" }, + { url = "https://files.pythonhosted.org/packages/8e/ab/df7048e32f7dc8c111bafd1c0000771182d44ba598cb2ca6aa01d6e1a701/uv-0.12.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:e57b047a5fcc5433a01397b6750e0abd472b320677b35bec24b5810db0414a55", size = 21295352, upload-time = "2026-08-05T19:21:07.198Z" }, + { url = "https://files.pythonhosted.org/packages/ec/64/116bda88bf0aef59010b8bb0e7210876aee2d02859f720b1fbeda02538b0/uv-0.12.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:86ec228fe419e75b1d943d4c12ae1b7dd1e23caef565d52474467b5ca1e4e6a5", size = 21328080, upload-time = "2026-08-05T19:21:10.803Z" }, + { url = "https://files.pythonhosted.org/packages/28/c7/9ea07fb177cafa41c5a7a419b8304a8721608a36ce54c08233c63bc65e02/uv-0.12.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8740cbb2d2d3f9da79049621506f45f1ec2afbb63badda1458c5eadac2ddc233", size = 21965650, upload-time = "2026-08-05T19:21:14.879Z" }, + { url = "https://files.pythonhosted.org/packages/04/36/8d2857c23b946766930e2a7cb29b2625c2ae1d91f7334c3f8ce3e4fd32f3/uv-0.12.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:06ce541290777ddf31dcbfa35827270244b8015f7dd0b2e5db8394753e6023b5", size = 23249866, upload-time = "2026-08-05T19:21:18.376Z" }, + { url = "https://files.pythonhosted.org/packages/20/a1/c9b594b8639e35ebac78e3fc14cd1c7d45db159a86c8beede317b66f975c/uv-0.12.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2665c331bff339e3bbe406d3c48ef241b4d96e4dc77b4ff7b8051b9f4a839fd2", size = 22927435, upload-time = "2026-08-05T19:21:21.979Z" }, + { url = "https://files.pythonhosted.org/packages/a7/fe/a87be2a492440945e745b0dc81aef7fea9730d8194af88d854b7641f5ddf/uv-0.12.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a8d93d1fe019561b70494a8e1332492afb5f14dadc33d5239569d0964164d10", size = 22321279, upload-time = "2026-08-05T19:21:25.578Z" }, + { url = "https://files.pythonhosted.org/packages/ae/8c/a980effdb4cb95462184bf2f1973e2d320e62743c904e1f7351177b25297/uv-0.12.2-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:8e2f9faae9ea4fd02d46f0a3a22f0a7d5076aa0046750a3250ec0f3ede8e36aa", size = 21312018, upload-time = "2026-08-05T19:21:29.183Z" }, + { url = "https://files.pythonhosted.org/packages/87/b1/a83935957bf84414106e6486eb99d265085a04acd8584ff5220c18a5239a/uv-0.12.2-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:d19cb83db136b0def185cbb23e8894b1fb43587cd8c14e30681e9381144199a1", size = 21950961, upload-time = "2026-08-05T19:21:32.929Z" }, + { url = "https://files.pythonhosted.org/packages/ca/68/04137a4dfc95fe0014a509ae643de065043811a988b8bbde3fa02397c080/uv-0.12.2-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:78ca00dcaf7fa5fb720d50232fc1e0931839d29a97ebb0e44f24e564c4d90763", size = 22088891, upload-time = "2026-08-05T19:21:36.308Z" }, + { url = "https://files.pythonhosted.org/packages/e4/f2/b2885d06aed6c494387a25c64eaefe129ac73fe366fe887db27e1263c126/uv-0.12.2-py3-none-musllinux_1_1_i686.whl", hash = "sha256:cea51e735c0b68b8492c8b3d0496db1fd335a548011ae2093a6a9bd3a4cb4056", size = 21202799, upload-time = "2026-08-05T19:21:39.745Z" }, + { url = "https://files.pythonhosted.org/packages/74/90/f347d51195286a7a3a7ad1075e557a5f86e20df4feaa9b009f9a2bd13a92/uv-0.12.2-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:da7780a76d0691eee1af4d43a3e637ece62b1d4ae5fe78a1a9feb299cd731d23", size = 22517594, upload-time = "2026-08-05T19:21:43.364Z" }, + { url = "https://files.pythonhosted.org/packages/f8/90/4b040b8c6b40aa7d599c884a3abf34d566eabf360c33baaf3c00c2763a51/uv-0.12.2-py3-none-win32.whl", hash = "sha256:528c4bc3d41548670ec5619c339e158ea8818d88ab64337f158fd814d91397fb", size = 19400742, upload-time = "2026-08-05T19:21:46.788Z" }, + { url = "https://files.pythonhosted.org/packages/48/ae/ab4a58082da1e890b785402c17bc94d8b0aeb29fb6ab366aebfec63ad301/uv-0.12.2-py3-none-win_amd64.whl", hash = "sha256:0c837592d9f5bc88e3c0c8da9ab868e79cf26f2938e0a02b59221af084d83de0", size = 20180444, upload-time = "2026-08-05T19:21:50.152Z" }, + { url = "https://files.pythonhosted.org/packages/44/34/900d4bf7cbde72e0386cbebe392a4bd12057acb404253656b1092298be94/uv-0.12.2-py3-none-win_arm64.whl", hash = "sha256:ac36c7c26ee892855184e9346e56fa7b58a2e4f82ae7519fdd9c6d8670c49d96", size = 19122020, upload-time = "2026-08-05T19:21:53.399Z" }, ] [[package]] @@ -3566,10 +3566,10 @@ provides-extras = ["cast-value-rs", "cli", "gpu", "optional", "remote"] dev = [ { name = "astroid", specifier = "==4.1.2" }, { name = "botocore" }, - { name = "coverage", specifier = "==7.15.2" }, + { name = "coverage", specifier = "==7.15.3" }, { name = "fsspec", specifier = ">=2023.10.0" }, { name = "griffe-inherited-docstrings", specifier = "==1.1.3" }, - { name = "hypothesis", specifier = "==6.164.0" }, + { name = "hypothesis", specifier = "==6.165.2" }, { name = "markdown-exec", extras = ["ansi"], specifier = "==1.12.3" }, { name = "mike", specifier = "==2.2.0" }, { name = "mkdocs", specifier = "==1.6.1" }, @@ -3590,12 +3590,12 @@ dev = [ { name = "pytest-cov", specifier = "==7.1.0" }, { name = "pytest-xdist", specifier = "==3.8.0" }, { name = "requests", specifier = "==2.34.2" }, - { name = "ruff", specifier = "==0.16.0" }, + { name = "ruff", specifier = "==0.16.1" }, { name = "s3fs", specifier = ">=2023.10.0" }, { name = "tomlkit", specifier = "==0.15.1" }, { name = "towncrier", specifier = "==25.8.0" }, { name = "universal-pathlib" }, - { name = "uv", specifier = "==0.12.0" }, + { name = "uv", specifier = "==0.12.2" }, ] docs = [ { name = "astroid", specifier = "==4.1.2" }, @@ -3609,16 +3609,16 @@ docs = [ { name = "mkdocstrings-python", specifier = "==2.0.5" }, { name = "numcodecs", extras = ["msgpack"] }, { name = "pytest", specifier = "==9.1.1" }, - { name = "ruff", specifier = "==0.16.0" }, + { name = "ruff", specifier = "==0.16.1" }, { name = "s3fs", specifier = ">=2023.10.0" }, { name = "towncrier", specifier = "==25.8.0" }, ] release = [{ name = "towncrier", specifier = "==25.8.0" }] remote-tests = [ { name = "botocore" }, - { name = "coverage", specifier = "==7.15.2" }, + { name = "coverage", specifier = "==7.15.3" }, { name = "fsspec", specifier = ">=2023.10.0" }, - { name = "hypothesis", specifier = "==6.164.0" }, + { name = "hypothesis", specifier = "==6.165.2" }, { name = "moto", extras = ["s3", "server"], specifier = "==5.2.2" }, { name = "numpydoc", specifier = "==1.10.0" }, { name = "obstore", specifier = ">=0.5.1" }, @@ -3632,11 +3632,11 @@ remote-tests = [ { name = "requests", specifier = "==2.34.2" }, { name = "s3fs", specifier = ">=2023.10.0" }, { name = "tomlkit", specifier = "==0.15.1" }, - { name = "uv", specifier = "==0.12.0" }, + { name = "uv", specifier = "==0.12.2" }, ] test = [ - { name = "coverage", specifier = "==7.15.2" }, - { name = "hypothesis", specifier = "==6.164.0" }, + { name = "coverage", specifier = "==7.15.3" }, + { name = "hypothesis", specifier = "==6.165.2" }, { name = "numpydoc", specifier = "==1.10.0" }, { name = "pytest", specifier = "==9.1.1" }, { name = "pytest-accept", specifier = "==0.3.0" }, @@ -3646,5 +3646,5 @@ test = [ { name = "pytest-cov", specifier = "==7.1.0" }, { name = "pytest-xdist", specifier = "==3.8.0" }, { name = "tomlkit", specifier = "==0.15.1" }, - { name = "uv", specifier = "==0.12.0" }, + { name = "uv", specifier = "==0.12.2" }, ] From 4aba6911221096b297649a5239173012d5c124bf Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Thu, 13 Aug 2026 13:20:41 +0200 Subject: [PATCH 51/61] fix(build): add an sdist allowlist to zarr-http-server (#4262) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit packages/zarr-http-server had no [tool.hatch.build.targets.sdist] section at all, so hatchling defaulted to 'everything not gitignored' — a blocklist by another name, and the same shape of problem the root pyproject.toml had. Add an explicit allowlist matching the ones packages/zarr-indexing and packages/zarr-metadata already carry. This drops changes/ (towncrier fragments are consumed into CHANGELOG.md at release time), .readthedocs.yaml (only means anything in the repository) and uv.lock, and keeps /examples, which the suite genuinely needs: tests/test_examples.py runs examples/serve.py and executes every cell of examples/serve_notebook.ipynb. Verified from an unpacked sdist: 210 passed, tests/test_examples.py green. Assisted-by: ClaudeCode:claude-opus-5 --- packages/zarr-http-server/pyproject.toml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/packages/zarr-http-server/pyproject.toml b/packages/zarr-http-server/pyproject.toml index ef38d67e49..10db7ae496 100644 --- a/packages/zarr-http-server/pyproject.toml +++ b/packages/zarr-http-server/pyproject.toml @@ -90,6 +90,28 @@ raw-options = { root = "../..", git_describe_command = "git describe --dirty --t [tool.hatch.build.targets.wheel] packages = ["src/zarr_http_server"] +# An allowlist, so nothing that merely happens to sit in the package directory +# — a scratch script, a stray notebook — can ride along in a release. With no +# sdist section at all hatchling defaults to "everything not gitignored", which +# is a blocklist by another name. The list keeps an sdist self-testing: +# `tests/test_examples.py` runs `examples/serve.py` and executes every cell of +# `examples/serve_notebook.ipynb`, so those are part of the suite rather than +# decoration, and `/docs` plus `/mkdocs.yml` are a self-contained site. +# `changes/` and `.readthedocs.yaml` are deliberately absent: towncrier +# fragments are consumed into `CHANGELOG.md` at release time, and the RTD +# config only means anything in the repository. `pyproject.toml`, `README.md` +# and `LICENSE.txt` are added by hatchling itself. +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", + "/docs", + "/examples", + "/mkdocs.yml", + "/justfile", + "/CHANGELOG.md", +] + [tool.ruff] extend = "../../pyproject.toml" target-version = "py312" From 9fd669fd22a414ed19e79bc6a17a42b6b44ea8b8 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Thu, 13 Aug 2026 16:31:35 +0200 Subject: [PATCH 52/61] fix(build): use an sdist allowlist so the zarr sdist stops shipping subpackages (#4261) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(build): use an sdist allowlist so the zarr sdist stops shipping subpackages The root sdist config was a blocklist naming /.github, /bench and /docs, so every release shipped whatever else happened to sit in the repository root. That included the whole packages/ tree — the zarr-indexing, zarr-metadata and zarr-http-server sources, which are released as their own distributions — plus ci/, design/, towncrier fragments and other repo furniture. 2.9M of the 1.4M sdist was other people's packages. Replace it with an explicit allowlist, matching what packages/zarr-indexing and packages/zarr-metadata already do. Including /docs also fixes a second problem: tests/test_docs.py walks docs/ and testpaths collects docs/user-guide, so with docs/ excluded the shipped test suite died at collection with 'Not a file or directory'. tests/test_docs.py now runs green from an unpacked sdist (61 passed, 2 skipped), and full collection finds 7581 tests with no errors. Assisted-by: ClaudeCode:claude-opus-5 * docs(build): trim the sdist allowlist comment Drop the narration of the blocklist this replaced -- that history lives in git -- and keep only the durable rationale and the reason each entry is on the list. Assisted-by: ClaudeCode:claude-opus-5 --- changes/4261.misc.md | 1 + pyproject.toml | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 changes/4261.misc.md diff --git a/changes/4261.misc.md b/changes/4261.misc.md new file mode 100644 index 0000000000..ca2a3fbb1e --- /dev/null +++ b/changes/4261.misc.md @@ -0,0 +1 @@ +The contents of the `zarr` source distribution are now defined by an explicit allowlist rather than a blocklist. Previously the sdist bundled the whole `packages/` tree — `zarr-indexing`, `zarr-metadata` and `zarr-http-server`, which are released as their own distributions — along with CI configuration and other repository files. The sdist also now ships `docs/`, so the test suite it carries can be collected and run from an unpacked sdist. diff --git a/pyproject.toml b/pyproject.toml index e0fbfc08fc..5e8129a6a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,11 +2,23 @@ requires = ["hatchling>=1.29.0", "hatch-vcs"] build-backend = "hatchling.build" +# An allowlist, not a blocklist: anything new — a subpackage under `packages/`, a +# config file in the repository root — stays out of the sdist unless it is named +# here. Beyond `src` and `tests`, the entries are what keeps the shipped test +# suite and docs build runnable from an unpacked sdist: `tests/test_docs.py` +# walks `docs/` and `testpaths` collects `docs/user-guide`; the pages under +# `docs/user-guide/examples/` pull their source out of `examples/` via pymdownx +# snippet includes; `mkdocs.yml` and `mkdocs_hooks.py` let `mkdocs build` run +# too. `pyproject.toml`, `README.md`, `LICENSE.txt` and `.gitignore` are added by +# hatchling itself. [tool.hatch.build.targets.sdist] -exclude = [ - "/.github", - "/bench", +include = [ + "/src", + "/tests", "/docs", + "/examples", + "/mkdocs.yml", + "/mkdocs_hooks.py", ] [project] From e62e45bfac1f9b6e0892ce4df45d75315a302be3 Mon Sep 17 00:00:00 2001 From: Yong-Shin Jiang <86658970+vup903@users.noreply.github.com> Date: Thu, 13 Aug 2026 08:06:52 -0700 Subject: [PATCH 53/61] Add unified JSON metadata validation via msgspec (#3285) (#4063) * Add unified parse_json runtime type checker (#3285) Introduce zarr.core.json_parse.parse_json, a single type-annotation-driven validator that consolidates the scattered per-field parse_* helpers. Handles primitives, Literal, unions/Optional, fixed and variadic tuples, Sequence/list (coerced to tuple), Mapping/dict, and TypedDict, with a bool-vs-int safe primitive check. Adds tests/test_json_parse.py (94 tests) and a changelog fragment. No existing call sites migrated yet; this is the proof-of-direction module. Co-Authored-By: Claude Opus 4.8 (1M context) * Migrate parse_order, parse_bool, parse_zarr_format to parse_json (#3285) Pilot migration delegating three representative helpers to the unified parse_json validator. Public signatures and return types are unchanged. parse_zarr_format re-wraps parse_json's ValueError/TypeError as MetadataValidationError with the original message to preserve observable behavior. parse_json is imported function-locally to avoid circular imports. Focused suites green: test_common/test_config/test_metadata/test_json_parse = 430 passed. Co-Authored-By: Claude Opus 4.8 (1M context) * Fix lint and make TypedDict NotRequired robust under future annotations (#3285) Apply ruff check/format to satisfy the Lint CI hook. Keep typing.Union/Optional spellings in tests (with noqa) to cover that origin path alongside X | Y. Rework _parse_typeddict to derive required/optional from get_type_hints(include_extras=True) + __total__ instead of __required_keys__, so class-syntax NotRequired is detected even when 'from __future__ import annotations' stringizes the hints (as in zarr's metadata modules). test_json_parse + test_common + test_metadata = 393 passed. Co-Authored-By: Claude Opus 4.8 (1M context) * Annotate origin as Any to satisfy mypy in _parse_typeddict (#3285) get_origin(hint) is Required/NotRequired tripped mypy's comparison-overlap and unreachable checks; typing origin as Any keeps the runtime check while satisfying mypy. Full 'uv run --frozen mypy' is clean (190 files); ruff check/format clean. Co-Authored-By: Claude Opus 4.8 (1M context) * Migrate Batch 1 literal parsers to parse_json (#3285) Delegate the literal/type check of parse_indexing_order, parse_node_type, parse_node_type_array, parse_separator, two parse_zarr_format variants (group, v2), and parse_name to the unified parse_json. Public signatures and return types unchanged; each preserves its original exception type and message (wrapping parse_json's ValueError/TypeError into MetadataValidationError / NodeTypeValidationError / the original ValueError/TypeError where tests assert on them). parse_json imported function-locally to avoid circular imports. Focused suites + full mypy green (1196 passed). Co-Authored-By: Claude Opus 4.8 (1M context) * Migrate Batch 2 codec primitive parsers to parse_json (#3285) Delegate the int/bool type check of parse_checksum, parse_clevel, parse_blocksize, parse_typesize, parse_gzip_level, and parse_zstd_level to parse_json, keeping each helper's range/bound check and exact error messages. Original exception types are preserved by wrapping parse_json's ValueError/TypeError. Note: parse_json rejects bool where the old isinstance(data, int) accepted it; verified no caller/test passes a bool to these, so this is a deliberate, more-correct strictening. parse_json imported function-locally. Codec suite + full mypy green (794 passed). Co-Authored-By: Claude Opus 4.8 (1M context) * Replace hand-written parse_json with msgspec.convert (#3285) Delete the bespoke parse_json runtime type checker and route JSON metadata validation through msgspec.convert, which handles the type coercions zarr needs (Literal membership, int/bool strictness, list-to-tuple). A small hand-written fallback (validate_json_value) covers the recursive JSON values msgspec cannot build a schema for, and adds an explicit nesting-depth limit. The registry/dtype/numcodec parsers stay hand-written since they need runtime lookups. Also fixes a latent generator-exhaustion bug in parse_storage_transformers, adds msgspec as a dependency (pinned in the min_deps env), and preserves the exception types and messages every migrated helper raised. Net ~555 lines removed. Tests, mypy and ruff all green. Co-Authored-By: Claude Opus 4.8 (1M context) * Encapsulate convert + field-context error into parse_field (#3285) Address review feedback: factor the repeated convert-then-re-raise pattern out of each per-field parser. convert now raises a field-agnostic ValueError("Expected instance of TYPE, got DATA"); the new parse_field wraps it and re-raises with field context ("Failed to parse input for FIELD") using the caller's chosen exception type, chaining the original error. Every per-field parser collapses to a one-liner. Co-Authored-By: Claude Opus 4.8 (1M context) * docs: replace Sphinx roles in json_parse with plain literals (#3285) The new ci/lint_docs.py check flags :func:/:class: roles, which pass through as literal text under MkDocs/mkdocstrings instead of becoming links. msgspec is not in the configured inventories, so cross-references would not resolve; using inline literals matches how the codebase already writes np.nonzero. Co-Authored-By: Claude Opus 5 (1M context) * fix: keep literal members and the offending value in parse errors (#3285) The msgspec rewrite regressed error quality for Literal types: _type_name fell back to __name__, rendering Literal[3] as bare "Literal", and parse_field dropped the value entirely. The old per-field parsers reported both, e.g. "Invalid value for 'zarr_format'. Expected '3'. Got '3.0'." _type_name now renders parameterized types via str(), so members survive, and parse_field reports expected type and received value: Failed to parse input for 'zarr_format': expected Literal[3], got 3.0. Co-Authored-By: Claude Opus 5 (1M context) * refactor: hoist json_parse imports to module level (#3285) These were function-local to dodge import cycles under the old hand-written parse_json. After the msgspec rewrite json_parse's only zarr import is JSON under TYPE_CHECKING, so it has no runtime zarr dependency and cannot form a cycle. Verified each touched module still imports standalone. Hoisting exposed a latent packaging gap: msgspec was added to pyproject.toml but never locked, so uv.lock lacked it. That stayed hidden only because json_parse was imported lazily; at module level it broke `uv run --frozen` (ModuleNotFoundError in the docs job). Regenerated the lock, which adds msgspec 0.21.1 and nothing else. Co-Authored-By: Claude Opus 5 (1M context) * docs: note the stricter metadata parsing in the changelog (#3285) The old per-field checks compared with ==, so numerically equal values passed: zarr_format=2.0 was accepted. msgspec requires an actual int, so such inputs are now rejected. Spec-conforming metadata is unaffected. Co-Authored-By: Claude Opus 5 (1M context) * docs: link msgspec symbols via its inventory (#3285) Adds msgspec's Sphinx inventory so the json_parse docstrings can reference msgspec.convert and msgspec.ValidationError as real cross-references instead of inert literals. Verified the inventory is served at msgspec.dev (the jcristharif.com path in the package metadata is stale) and that both symbols resolve in it. Same-module names stay plain literals: zarr.core.json_parse is internal and not rendered in the API reference, so a cross-reference to it would not resolve and would fail `mkdocs build --strict`. Co-Authored-By: Claude Opus 5 (1M context) --------- Co-authored-by: Claude Opus 4.8 (1M context) Co-authored-by: Davis Bennett --- changes/3285.feature.md | 13 +++ mkdocs.yml | 1 + pyproject.toml | 2 + src/zarr/codecs/blosc.py | 26 +++--- src/zarr/codecs/gzip.py | 10 +-- src/zarr/codecs/zstd.py | 15 ++-- src/zarr/core/chunk_key_encodings.py | 5 +- src/zarr/core/common.py | 22 +++-- src/zarr/core/config.py | 7 +- src/zarr/core/group.py | 14 ++- src/zarr/core/json_parse.py | 103 ++++++++++++++++++++++ src/zarr/core/metadata/v2.py | 7 +- src/zarr/core/metadata/v3.py | 29 ++++--- tests/test_common.py | 22 ++++- tests/test_json_parse.py | 122 +++++++++++++++++++++++++++ tests/test_metadata/test_v2.py | 2 +- uv.lock | 42 +++++++++ 17 files changed, 369 insertions(+), 73 deletions(-) create mode 100644 changes/3285.feature.md create mode 100644 src/zarr/core/json_parse.py create mode 100644 tests/test_json_parse.py diff --git a/changes/3285.feature.md b/changes/3285.feature.md new file mode 100644 index 0000000000..3809c0ab02 --- /dev/null +++ b/changes/3285.feature.md @@ -0,0 +1,13 @@ +JSON metadata validation now delegates to ``msgspec.convert`` for the type +coercions it supports (``Literal`` membership, ``int`` / ``bool`` strictness, +list-to-tuple), replacing the per-field hand-written ``parse_*`` logic. A small +fallback validates the recursive JSON values msgspec cannot, now with an +explicit nesting-depth limit, and a latent generator-exhaustion bug in +``parse_storage_transformers`` is fixed. See #3285. + +As a result some metadata inputs are now parsed more strictly. The previous +per-field checks compared values with ``==``, which accepts any numerically +equal object, so a float such as ``2.0`` was accepted as ``zarr_format``; it is +now rejected because it is not an ``int``. Booleans are likewise no longer +accepted where an ``int`` is expected, since ``bool`` is an ``int`` subclass. +Metadata that conforms to the Zarr specification is unaffected. diff --git a/mkdocs.yml b/mkdocs.yml index ca8165af4c..1fde8d9fe3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -199,6 +199,7 @@ plugins: - https://docs.xarray.dev/en/stable/objects.inv - https://numpy.org/doc/stable/objects.inv - https://numcodecs.readthedocs.io/en/stable/objects.inv + - https://msgspec.dev/objects.inv - https://developmentseed.org/obstore/latest/objects.inv - https://filesystem-spec.readthedocs.io/en/latest/objects.inv - https://requests.readthedocs.io/en/latest/objects.inv diff --git a/pyproject.toml b/pyproject.toml index 5e8129a6a9..f341a488ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,7 @@ dependencies = [ 'google-crc32c>=1.5', 'typing_extensions>=4.14', 'donfig>=0.8', + 'msgspec>=0.19', ] dynamic = [ @@ -281,6 +282,7 @@ extra-dependencies = [ 'typing_extensions==4.14.*', 'donfig==0.8.*', 'obstore==0.5.*', + 'msgspec==0.19.*', ] [tool.hatch.envs.default] diff --git a/src/zarr/codecs/blosc.py b/src/zarr/codecs/blosc.py index 087de716fc..ee45632153 100644 --- a/src/zarr/codecs/blosc.py +++ b/src/zarr/codecs/blosc.py @@ -14,6 +14,7 @@ from zarr.core.buffer.cpu import as_numpy_array_wrapper from zarr.core.common import JSON, NamedRequiredConfig, parse_named_configuration from zarr.core.dtype.common import HasItemSize +from zarr.core.json_parse import parse_field if TYPE_CHECKING: from typing import Self @@ -104,27 +105,24 @@ class BloscCname(metaclass=_DeprecatedStrEnumMeta): def parse_typesize(data: JSON) -> int: - if isinstance(data, int): - if data > 0: - return data - else: - raise ValueError( - f"Value must be greater than 0. Got {data}, which is less or equal to 0." - ) - raise TypeError(f"Value must be an int. Got {type(data)} instead.") + parsed: int = parse_field(data, int, "typesize", error=TypeError) + if parsed > 0: + return parsed + else: + raise ValueError( + f"Value must be greater than 0. Got {parsed}, which is less or equal to 0." + ) # todo: real validation def parse_clevel(data: JSON) -> int: - if isinstance(data, int): - return data - raise TypeError(f"Value should be an int. Got {type(data)} instead.") + parsed: int = parse_field(data, int, "clevel", error=TypeError) + return parsed def parse_blocksize(data: JSON) -> int: - if isinstance(data, int): - return data - raise TypeError(f"Value should be an int. Got {type(data)} instead.") + parsed: int = parse_field(data, int, "blocksize", error=TypeError) + return parsed def _parse_cname(data: object) -> BloscCnameLiteral: diff --git a/src/zarr/codecs/gzip.py b/src/zarr/codecs/gzip.py index b8591748f7..7d86a03ba8 100644 --- a/src/zarr/codecs/gzip.py +++ b/src/zarr/codecs/gzip.py @@ -10,6 +10,7 @@ from zarr.abc.codec import BytesBytesCodec from zarr.core.buffer.cpu import as_numpy_array_wrapper from zarr.core.common import JSON, parse_named_configuration +from zarr.core.json_parse import parse_field if TYPE_CHECKING: from typing import Self @@ -19,13 +20,12 @@ def parse_gzip_level(data: JSON) -> int: - if not isinstance(data, (int)): - raise TypeError(f"Expected int, got {type(data)}") - if data not in range(10): + parsed: int = parse_field(data, int, "level", error=TypeError) + if parsed not in range(10): raise ValueError( - f"Expected an integer from the inclusive range (0, 9). Got {data} instead." + f"Expected an integer from the inclusive range (0, 9). Got {parsed} instead." ) - return data + return parsed @dataclass(frozen=True) diff --git a/src/zarr/codecs/zstd.py b/src/zarr/codecs/zstd.py index f93c25a3c7..6d9f8910a7 100644 --- a/src/zarr/codecs/zstd.py +++ b/src/zarr/codecs/zstd.py @@ -12,6 +12,7 @@ from zarr.abc.codec import BytesBytesCodec from zarr.core.buffer.cpu import as_numpy_array_wrapper from zarr.core.common import JSON, parse_named_configuration +from zarr.core.json_parse import parse_field if TYPE_CHECKING: from typing import Self @@ -21,17 +22,15 @@ def parse_zstd_level(data: JSON) -> int: - if isinstance(data, int): - if data >= 23: - raise ValueError(f"Value must be less than or equal to 22. Got {data} instead.") - return data - raise TypeError(f"Got value with type {type(data)}, but expected an int.") + parsed: int = parse_field(data, int, "level", error=TypeError) + if parsed >= 23: + raise ValueError(f"Value must be less than or equal to 22. Got {parsed} instead.") + return parsed def parse_checksum(data: JSON) -> bool: - if isinstance(data, bool): - return data - raise TypeError(f"Expected bool. Got {type(data)}.") + parsed: bool = parse_field(data, bool, "checksum", error=TypeError) + return parsed @dataclass(frozen=True) diff --git a/src/zarr/core/chunk_key_encodings.py b/src/zarr/core/chunk_key_encodings.py index fb2fd95dee..d871e279d2 100644 --- a/src/zarr/core/chunk_key_encodings.py +++ b/src/zarr/core/chunk_key_encodings.py @@ -13,15 +13,14 @@ NamedConfig, parse_named_configuration, ) +from zarr.core.json_parse import parse_field from zarr.registry import get_chunk_key_encoding_class, register_chunk_key_encoding SeparatorLiteral = Literal[".", "/"] def parse_separator(data: JSON) -> SeparatorLiteral: - if data not in (".", "/"): - raise ValueError(f"Expected an '.' or '/' separator. Got {data} instead.") - return cast("SeparatorLiteral", data) + return cast("SeparatorLiteral", parse_field(data, Literal[".", "/"], "separator")) class ChunkKeyEncodingParams(TypedDict): diff --git a/src/zarr/core/common.py b/src/zarr/core/common.py index 1541683b09..3da5c108b6 100644 --- a/src/zarr/core/common.py +++ b/src/zarr/core/common.py @@ -20,6 +20,7 @@ from typing_extensions import ReadOnly from zarr.core.config import config as zarr_config +from zarr.core.json_parse import convert, parse_field from zarr.errors import ZarrRuntimeWarning if TYPE_CHECKING: @@ -147,12 +148,13 @@ def parse_enum[E: Enum](data: object, cls: type[E]) -> E: def parse_name(data: JSON, expected: str | None = None) -> str: - if isinstance(data, str): - if expected is None or data == expected: - return data - raise ValueError(f"Expected '{expected}'. Got {data} instead.") - else: - raise TypeError(f"Expected a string, got an instance of {type(data)}.") + try: + data = cast("str", convert(data, str)) + except (ValueError, TypeError) as exc: + raise TypeError(f"Expected a string, got an instance of {type(data)}.") from exc + if expected is None or data == expected: + return data + raise ValueError(f"Expected '{expected}'. Got {data} instead.") def parse_configuration(data: JSON) -> JSON: @@ -227,15 +229,11 @@ def parse_fill_value(data: Any) -> Any: def parse_order(data: Any) -> Literal["C", "F"]: - if data in ("C", "F"): - return cast("Literal['C', 'F']", data) - raise ValueError(f"Expected one of ('C', 'F'), got {data} instead.") + return cast("Literal['C', 'F']", parse_field(data, Literal["C", "F"], "order")) def parse_bool(data: Any) -> bool: - if isinstance(data, bool): - return data - raise ValueError(f"Expected bool, got {data} instead.") + return cast("bool", convert(data, bool)) def parse_int(data: Any) -> int: diff --git a/src/zarr/core/config.py b/src/zarr/core/config.py index 42c5ed3b60..c0ebb31353 100644 --- a/src/zarr/core/config.py +++ b/src/zarr/core/config.py @@ -33,6 +33,8 @@ from donfig import Config as DConfig +from zarr.core.json_parse import parse_field + if TYPE_CHECKING: from donfig.config_obj import ConfigSet @@ -159,7 +161,4 @@ def enable_gpu(self) -> ConfigSet: def parse_indexing_order(data: Any) -> Literal["C", "F"]: - if data in ("C", "F"): - return cast("Literal['C', 'F']", data) - msg = f"Expected one of ('C', 'F'), got {data} instead." - raise ValueError(msg) + return cast("Literal['C', 'F']", parse_field(data, Literal["C", "F"], "order")) diff --git a/src/zarr/core/group.py b/src/zarr/core/group.py index 548f2141d2..d061e1a5c6 100644 --- a/src/zarr/core/group.py +++ b/src/zarr/core/group.py @@ -46,6 +46,7 @@ ) from zarr.core.config import config from zarr.core.dtype import parse_data_type +from zarr.core.json_parse import parse_field from zarr.core.metadata import ArrayV2Metadata, ArrayV3Metadata from zarr.core.metadata.io import save_metadata from zarr.core.sync import SyncMixin, sync @@ -85,18 +86,15 @@ def parse_zarr_format(data: Any) -> ZarrFormat: """Parse the zarr_format field from metadata.""" - if data in (2, 3): - return cast("ZarrFormat", data) - msg = f"Invalid zarr_format. Expected one of 2 or 3. Got {data}." - raise ValueError(msg) + return cast("ZarrFormat", parse_field(data, Literal[2, 3], "zarr_format")) def parse_node_type(data: Any) -> NodeType: """Parse the node_type field from metadata.""" - if data in ("array", "group"): - return cast("Literal['array', 'group']", data) - msg = f"Invalid value for 'node_type'. Expected 'array' or 'group'. Got '{data}'." - raise MetadataValidationError(msg) + return cast( + "Literal['array', 'group']", + parse_field(data, Literal["array", "group"], "node_type", error=MetadataValidationError), + ) # todo: convert None to empty dict diff --git a/src/zarr/core/json_parse.py b/src/zarr/core/json_parse.py new file mode 100644 index 0000000000..09c5ca074e --- /dev/null +++ b/src/zarr/core/json_parse.py @@ -0,0 +1,103 @@ +"""Helpers for validating JSON-decoded metadata. + +Most JSON metadata validation is delegated to +[`msgspec.convert`][msgspec.convert], which handles the type coercions Zarr +needs (``Literal`` membership, ``int``/``bool`` strictness, list-to-tuple, +``TypedDict`` with ``NotRequired``). ``convert`` is a thin wrapper that +translates [`msgspec.ValidationError`][msgspec.ValidationError] into the +``TypeError`` the rest of the codebase already raises. + +msgspec cannot handle two things in Zarr's metadata types: + +* the recursive ``JSON`` / ``JSONValue`` aliases, which it rejects at + schema-build time, and +* PEP 728 ``extra_items=`` extension fields, which it silently drops. + +``validate_json_value`` is the small hand-written fallback for the first of +those. See https://github.com/zarr-developers/zarr-python/issues/3285. +""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Final, cast, get_origin + +import msgspec + +if TYPE_CHECKING: + from zarr.core.common import JSON + +__all__ = ["MAX_JSON_DEPTH", "convert", "parse_field", "validate_json_value"] + +MAX_JSON_DEPTH: Final = 64 +"""Maximum nesting depth accepted by ``validate_json_value``.""" + + +def _type_name(type_: Any) -> str: + """Render ``type_`` for an error message. + + Parameterized types keep their arguments, so a ``Literal`` reports its + members (``Literal[2, 3]``) rather than the bare origin name. ``__name__`` + would drop them, which loses the most useful part of the message. + """ + if get_origin(type_) is not None: + return str(type_).replace("typing.", "") + return getattr(type_, "__name__", None) or str(type_).replace("typing.", "") + + +def convert(value: object, type_: Any, *, strict: bool = True) -> Any: + """Validate and coerce ``value`` against ``type_`` via [`msgspec.convert`][msgspec.convert]. + + On a mismatch msgspec raises + [`msgspec.ValidationError`][msgspec.ValidationError]; this re-raises + a plain, field-agnostic ``ValueError`` naming the expected type, so callers + can add their own field context (see ``parse_field``). + """ + try: + return msgspec.convert(value, type_, strict=strict) + except msgspec.ValidationError as exc: + raise ValueError(f"Expected instance of {_type_name(type_)}, got {value!r}.") from exc + + +def parse_field( + data: object, type_: Any, field: str, *, error: type[Exception] = ValueError +) -> Any: + """Validate ``data`` for metadata field ``field`` against ``type_``. + + Wraps ``convert`` and, on failure, re-raises ``error`` with field + context, chaining the underlying type error. This keeps the + ``convert``-then-re-raise pattern in one place rather than repeating it in + every per-field parser. + """ + try: + return convert(data, type_) + except ValueError as exc: + raise error( + f"Failed to parse input for {field!r}: expected {_type_name(type_)}, got {data!r}." + ) from exc + + +def validate_json_value(value: object, *, max_depth: int = MAX_JSON_DEPTH, _depth: int = 0) -> JSON: + """Check that ``value`` is a JSON value and return it unchanged. + + msgspec cannot build a schema for Zarr's recursive ``JSON`` / ``JSONValue`` + aliases, so this covers the fields typed that way (``attributes``, + ``fill_value``, extension-field values). Unlike the previous per-field + parsers it also enforces ``max_depth``: a pathologically nested document + could otherwise exhaust the interpreter stack. + """ + if _depth > max_depth: + raise ValueError(f"JSON value nesting exceeds the maximum depth of {max_depth}.") + if value is None or isinstance(value, (bool, int, float, str)): + return cast("JSON", value) + if isinstance(value, (list, tuple)): + for item in value: + validate_json_value(item, max_depth=max_depth, _depth=_depth + 1) + return cast("JSON", value) + if isinstance(value, Mapping): + for key, item in value.items(): + if not isinstance(key, str): + raise TypeError(f"JSON object keys must be str, got {type(key).__name__}.") + validate_json_value(item, max_depth=max_depth, _depth=_depth + 1) + return cast("JSON", value) + raise TypeError(f"Value {value!r} is not a valid JSON value.") diff --git a/src/zarr/core/metadata/v2.py b/src/zarr/core/metadata/v2.py index 91515d87b9..70d4e1e59c 100644 --- a/src/zarr/core/metadata/v2.py +++ b/src/zarr/core/metadata/v2.py @@ -41,6 +41,7 @@ parse_shapelike, ) from zarr.core.config import config, parse_indexing_order +from zarr.core.json_parse import parse_field from zarr.core.metadata.common import parse_attributes @@ -278,9 +279,9 @@ def parse_dtype(data: npt.DTypeLike) -> np.dtype[Any]: def parse_zarr_format(data: object) -> Literal[2]: - if data == 2: - return 2 - raise ValueError(f"Invalid value. Expected 2. Got {data}.") + from typing import Literal + + return cast("Literal[2]", parse_field(data, Literal[2], "zarr_format")) def parse_filters(data: object) -> tuple[Numcodec, ...] | None: diff --git a/src/zarr/core/metadata/v3.py b/src/zarr/core/metadata/v3.py index 9eaccc5076..fc47f8fc95 100644 --- a/src/zarr/core/metadata/v3.py +++ b/src/zarr/core/metadata/v3.py @@ -34,6 +34,7 @@ from zarr.core.config import config from zarr.core.dtype import VariableLengthUTF8, ZDType, get_data_type_from_json from zarr.core.dtype.common import check_dtype_spec_v3 +from zarr.core.json_parse import parse_field, validate_json_value from zarr.core.metadata.common import parse_attributes from zarr.errors import MetadataValidationError, NodeTypeValidationError, UnknownCodecError from zarr.registry import get_codec_class @@ -47,17 +48,16 @@ def parse_zarr_format(data: object) -> Literal[3]: - if data == 3: - return 3 - msg = f"Invalid value for 'zarr_format'. Expected '3'. Got '{data}'." - raise MetadataValidationError(msg) + return cast( + "Literal[3]", parse_field(data, Literal[3], "zarr_format", error=MetadataValidationError) + ) def parse_node_type_array(data: object) -> Literal["array"]: - if data == "array": - return "array" - msg = f"Invalid value for 'node_type'. Expected 'array'. Got '{data}'." - raise NodeTypeValidationError(msg) + return cast( + 'Literal["array"]', + parse_field(data, Literal["array"], "node_type", error=NodeTypeValidationError), + ) def parse_codecs(data: object) -> tuple[Codec, ...]: @@ -130,11 +130,12 @@ def parse_storage_transformers(data: object) -> tuple[dict[str, JSON], ...]: """ if data is None: return () - if isinstance(data, Iterable): - if len(tuple(data)) >= 1: - return data # type: ignore[return-value] - else: - return () + if isinstance(data, Iterable) and not isinstance(data, (str, bytes)): + # Materialise once. The previous implementation called ``len(tuple(data))`` + # and then returned ``data`` itself, which exhausted (and discarded) a + # one-shot iterable and could return a value typed as a tuple that was not + # actually a tuple. + return tuple(data) raise TypeError( f"Invalid storage_transformers. Expected an iterable of dicts. Got {type(data)} instead." ) @@ -656,7 +657,7 @@ def from_dict(cls, data: dict[str, JSON]) -> Self: chunk_grid=_data_typed["chunk_grid"], # type: ignore[arg-type] chunk_key_encoding=_data_typed["chunk_key_encoding"], # type: ignore[arg-type] codecs=_data_typed["codecs"], - attributes=_data_typed.get("attributes", {}), # type: ignore[arg-type] + attributes=validate_json_value(_data_typed.get("attributes", {})), # type: ignore[arg-type] dimension_names=_data_typed.get("dimension_names", None), fill_value=fill_value_parsed, data_type=data_type, diff --git a/tests/test_common.py b/tests/test_common.py index 5d8df326da..846dcbbad9 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -11,8 +11,10 @@ ANY_ACCESS_MODE, AccessModeLiteral, concurrent_iter, + parse_bool, parse_int, parse_name, + parse_order, parse_shapelike, product, ) @@ -97,10 +99,28 @@ def test_parse_name_valid(data: tuple[Any, Any]) -> None: @pytest.mark.parametrize("data", [0, 1, "hello", "f"]) def test_parse_indexing_order_invalid(data: Any) -> None: - with pytest.raises(ValueError, match="Expected one of"): + with pytest.raises(ValueError, match="Failed to parse input for 'order'"): parse_indexing_order(data) +@pytest.mark.parametrize("data", [0, 1, "hello", "f"]) +def test_parse_order_invalid(data: Any) -> None: + with pytest.raises(ValueError, match="Failed to parse input for 'order'"): + parse_order(data) + + +@pytest.mark.parametrize("data", [0, 1, "true", None, [True]]) +def test_parse_bool_invalid(data: Any) -> None: + """Non-bool values are rejected with a ValueError.""" + with pytest.raises(ValueError, match="Expected instance of bool"): + parse_bool(data) + + +@pytest.mark.parametrize("data", [True, False]) +def test_parse_bool_valid(data: bool) -> None: + assert parse_bool(data) is data + + @pytest.mark.parametrize("data", ["1", 1.0, True, False, None, [1], (1,)]) def test_parse_int_invalid(data: Any) -> None: """Non-int values (including bools, which are int subclasses) are rejected.""" diff --git a/tests/test_json_parse.py b/tests/test_json_parse.py new file mode 100644 index 0000000000..da723119aa --- /dev/null +++ b/tests/test_json_parse.py @@ -0,0 +1,122 @@ +"""Tests for :mod:`zarr.core.json_parse`. + +``convert`` delegates JSON type coercion to :func:`msgspec.convert` (translating +``msgspec.ValidationError`` into ``TypeError``); ``validate_json_value`` is the +hand-written fallback for the recursive ``JSON`` alias msgspec cannot build, +including a nesting-depth limit. The final group is a regression test for the +``parse_storage_transformers`` fix that motivated the depth limit work. +""" + +from __future__ import annotations + +from typing import Literal + +import pytest + +from zarr.core.json_parse import MAX_JSON_DEPTH, convert, parse_field, validate_json_value +from zarr.core.metadata.v3 import parse_storage_transformers + + +class TestConvert: + def test_literal(self) -> None: + assert convert(3, Literal[3]) == 3 + assert convert("array", Literal["array", "group"]) == "array" + + def test_literal_rejects_non_member(self) -> None: + with pytest.raises(ValueError, match="Expected instance of"): + convert(4, Literal[3]) + with pytest.raises(ValueError, match="Expected instance of"): + convert("Q", Literal["C", "F"]) + + def test_sequence_coerced_to_tuple(self) -> None: + assert convert([1, 2, 3], tuple[int, ...]) == (1, 2, 3) + assert convert([1, 2], tuple[int, int]) == (1, 2) + + def test_int(self) -> None: + assert convert(5, int) == 5 + + def test_bool_int_strictness(self) -> None: + # bool is an int subclass, but the two must not be interchangeable. + with pytest.raises(ValueError): + convert(True, int) + with pytest.raises(ValueError): + convert(1, bool) + # ... and True must not satisfy Literal[1]. + with pytest.raises(ValueError): + convert(True, Literal[1]) + + +class TestParseField: + def test_valid_passthrough(self) -> None: + assert parse_field(3, Literal[3], "zarr_format") == 3 + + def test_wraps_with_field_context(self) -> None: + with pytest.raises(ValueError, match="Failed to parse input for 'zarr_format'"): + parse_field(4, Literal[3], "zarr_format") + + def test_custom_error_type_and_chaining(self) -> None: + class MyError(ValueError): + pass + + with pytest.raises(MyError, match="Failed to parse input for 'node_type'") as exc_info: + parse_field(5, Literal["array"], "node_type", error=MyError) + # the generic type error is chained as the cause + assert isinstance(exc_info.value.__cause__, ValueError) + + +class TestValidateJsonValue: + @pytest.mark.parametrize("value", [None, True, 1, 1.5, "s"]) + def test_primitives(self, value: object) -> None: + assert validate_json_value(value) is value + + def test_nested(self) -> None: + value = {"a": [1, 2.0, "x", True, None], "b": {"c": [{}]}} + assert validate_json_value(value) is value + + def test_rejects_non_str_keys(self) -> None: + with pytest.raises(TypeError, match="keys must be str"): + validate_json_value({1: "x"}) + + def test_rejects_non_json_leaf(self) -> None: + with pytest.raises(TypeError, match="not a valid JSON value"): + validate_json_value(object()) + with pytest.raises(TypeError, match="not a valid JSON value"): + validate_json_value({"a": object()}) + + def test_depth_limit(self) -> None: + def nest(depth: int) -> object: + v: object = "leaf" + for _ in range(depth): + v = {"k": v} + return v + + # At the limit it passes; one level deeper it is rejected. This bound is + # new behavior the previous per-field parsers never had. + assert validate_json_value(nest(MAX_JSON_DEPTH)) is not None + with pytest.raises(ValueError, match="maximum depth"): + validate_json_value(nest(MAX_JSON_DEPTH + 1)) + + +class TestStorageTransformersRegression: + """`parse_storage_transformers` used to call `len(tuple(data))` and then + return `data` itself, exhausting a one-shot iterable and returning a value + typed as a tuple but not actually a tuple.""" + + def test_none(self) -> None: + assert parse_storage_transformers(None) == () + + def test_empty(self) -> None: + assert parse_storage_transformers([]) == () + + def test_list_returns_tuple(self) -> None: + result = parse_storage_transformers([{"a": 1}]) + assert result == ({"a": 1},) + assert isinstance(result, tuple) + + def test_generator_not_exhausted(self) -> None: + result = parse_storage_transformers(iter([{"a": 1}, {"b": 2}])) + assert result == ({"a": 1}, {"b": 2}) + + def test_non_iterable_rejected(self) -> None: + with pytest.raises(TypeError, match="Expected an iterable"): + parse_storage_transformers(5) diff --git a/tests/test_metadata/test_v2.py b/tests/test_metadata/test_v2.py index 0f280f0401..1358f458d6 100644 --- a/tests/test_metadata/test_v2.py +++ b/tests/test_metadata/test_v2.py @@ -32,7 +32,7 @@ def test_parse_zarr_format_valid() -> None: # The explicit id for "3" avoids colliding with the auto-generated id for the int 3. @pytest.mark.parametrize("data", [None, 1, 3, 4, 5, pytest.param("3", id="3-str")]) def test_parse_zarr_format_invalid(data: Any) -> None: - with pytest.raises(ValueError, match=f"Invalid value. Expected 2. Got {data}"): + with pytest.raises(ValueError, match="Failed to parse input for 'zarr_format'"): parse_zarr_format(data) diff --git a/uv.lock b/uv.lock index 120b187e7d..07710e2c86 100644 --- a/uv.lock +++ b/uv.lock @@ -1684,6 +1684,46 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d2/8a/27e2e57055176e366a46b85d02d68e7a5bcfbdd8474c9706375d965f24d3/msgpack-1.2.1-cp314-cp314t-win_arm64.whl", hash = "sha256:0adcf06ffde0777c0e1a9b771a2b1c4226ba1bbf748c8efcc02fcdeca3299107", size = 71160, upload-time = "2026-06-18T16:13:51.498Z" }, ] +[[package]] +name = "msgspec" +version = "0.21.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e3/60/f79b9b013a16fa3a58350c9295ddc6789f2e335f36ea61ed10a21b215364/msgspec-0.21.1.tar.gz", hash = "sha256:2313508e394b0d208f8f56892ca9b2799e2561329de9763b19619595a6c0f72c", size = 319193, upload-time = "2026-04-12T21:44:50.394Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6e/cf/317224852c00248c620a9bcf4b26e2e4ab8afd752f18d2a6ef73ebd423b6/msgspec-0.21.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d4248cf0b6129b7d230eacd493c17cc2d4f3989f3bb7f633a928a85b7dcfa251", size = 196188, upload-time = "2026-04-12T21:44:07.181Z" }, + { url = "https://files.pythonhosted.org/packages/6d/81/074612945c0666078f7366f40000013de9f6ba687491d450df699bceebc9/msgspec-0.21.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5102c7e9b3acff82178449b85006d96310e690291bb1ea0142f1b24bcb8aabcb", size = 188473, upload-time = "2026-04-12T21:44:08.736Z" }, + { url = "https://files.pythonhosted.org/packages/8a/37/655101799590bcc5fddb2bd3fe0e6194e816c2d1da7c361725f5eb89a910/msgspec-0.21.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:846758412e9518252b2ac9bffd6f0e54d9ff614f5f9488df7749f81ff5c80920", size = 218871, upload-time = "2026-04-12T21:44:09.917Z" }, + { url = "https://files.pythonhosted.org/packages/b5/d1/d4cd9fe89c7d400d7a18f86ccc94daa3f0927f53558846fcb60791dce5d6/msgspec-0.21.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:21995e74b5c598c2e004110ad66ec7f1b8c20bf2bcf3b2de8fd9a3094422d3ff", size = 225025, upload-time = "2026-04-12T21:44:11.191Z" }, + { url = "https://files.pythonhosted.org/packages/24/bf/e20549e602b9edccadeeff98760345a416f9cce846a657e8b18e3396b212/msgspec-0.21.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6129f0cca52992e898fd5344187f7c8127b63d810b2fd73e36fca73b4c6475ee", size = 222672, upload-time = "2026-04-12T21:44:12.481Z" }, + { url = "https://files.pythonhosted.org/packages/b4/68/04d7a8f0f786545cf9b8c280c57aa6befb5977af6e884b8b54191cbe44b3/msgspec-0.21.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ef3ec2296248d1f8b9231acb051b6d471dfde8f21819e86c9adaaa9f42918521", size = 227303, upload-time = "2026-04-12T21:44:13.709Z" }, + { url = "https://files.pythonhosted.org/packages/cc/4d/619866af2840875be408047bf9e70ceafbae6ab50660de7134ed1b25eb86/msgspec-0.21.1-cp312-cp312-win_amd64.whl", hash = "sha256:d4ab834a054c6f0cbeef6df9e7e1b33d5f1bc7b86dea1d2fd7cad003873e783d", size = 190017, upload-time = "2026-04-12T21:44:14.977Z" }, + { url = "https://files.pythonhosted.org/packages/5e/2e/a8f9eca8fd00e097d7a9e99ba8a4685db994494448e3d4f0b7f6e9a3c0f7/msgspec-0.21.1-cp312-cp312-win_arm64.whl", hash = "sha256:628aaa35c74950a8c59da330d7e98917e1c7188f983745782027748ee4ca573e", size = 175345, upload-time = "2026-04-12T21:44:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/7e/74/f11ede02839b19ff459f88e3145df5d711626ca84da4e23520cebf819367/msgspec-0.21.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:764173717a01743f007e9f74520ed281f24672c604514f7d76c1c3a10e8edb66", size = 196176, upload-time = "2026-04-12T21:44:17.613Z" }, + { url = "https://files.pythonhosted.org/packages/bb/40/4476c1bd341418a046c4955aff632ec769315d1e3cb94e6acf86d461f9ed/msgspec-0.21.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:344c7cd0eaed1fb81d7959f99100ef71ec9b536881a376f11b9a6c4803365697", size = 188524, upload-time = "2026-04-12T21:44:18.815Z" }, + { url = "https://files.pythonhosted.org/packages/ca/d9/9e9d7d7e5061b47540d03d640fab9b3965ba7ae49c1b2154861c8f007518/msgspec-0.21.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:48943e278b3854c2f89f955ddc6f9f430d3f0784b16e47d10604ee0463cd21f5", size = 218880, upload-time = "2026-04-12T21:44:20.028Z" }, + { url = "https://files.pythonhosted.org/packages/74/66/2bb344f34abb4b57e60c7c9c761994e0417b9718ec1460bf00c296f2a7ea/msgspec-0.21.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a9aa659ebb0101b1cbc31461212b87e341d961f0ab0772aaf068a99e001ec4aa", size = 225050, upload-time = "2026-04-12T21:44:21.577Z" }, + { url = "https://files.pythonhosted.org/packages/1a/84/7c1e412f76092277bf760cef12b7979d03314d259ab5b5cafde5d0c1722d/msgspec-0.21.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7b27d1a8ead2b6f5b0c4f2d07b8be1ccfcc041c8a0e704781edebe3ae13c484", size = 222713, upload-time = "2026-04-12T21:44:22.83Z" }, + { url = "https://files.pythonhosted.org/packages/4e/27/0bba04b2b4ef05f3d068429410bc71d2cea925f1596a8f41152cccd5edb8/msgspec-0.21.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:38fe93e86b61328fe544cb7fd871fad5a27c8734bfda90f65e5dbe288ae50f61", size = 227259, upload-time = "2026-04-12T21:44:24.11Z" }, + { url = "https://files.pythonhosted.org/packages/b0/2d/09574b0eea02fed2c2c1383dbaae2c7f79dc16dcd6487a886000afb5d7c4/msgspec-0.21.1-cp313-cp313-win_amd64.whl", hash = "sha256:8bc666331c35fcce05a7cd2d6221adbe0f6058f8e750711413d22793c080ac6a", size = 189857, upload-time = "2026-04-12T21:44:25.359Z" }, + { url = "https://files.pythonhosted.org/packages/46/34/105b1576ad182879914f0c821f17ee1d13abb165cb060448f96fe2aff078/msgspec-0.21.1-cp313-cp313-win_arm64.whl", hash = "sha256:42bb1241e0750c1a4346f2aa84db26c5ffd99a4eb3a954927d9f149ff2f42898", size = 175403, upload-time = "2026-04-12T21:44:26.608Z" }, + { url = "https://files.pythonhosted.org/packages/5a/ad/86954e987d1d6a5c579e2c2e7832b65e0fff194179fdac4f581536086024/msgspec-0.21.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:fab48eb45fdbfbdb2c0edfec00ffc53b6b6085beefc6b50b61e01659f9f8757f", size = 196261, upload-time = "2026-04-12T21:44:27.807Z" }, + { url = "https://files.pythonhosted.org/packages/d1/a1/c5e46c3e42b866199365e35d11dddfd1fbd8bba4fdb3c52f965b1607ce94/msgspec-0.21.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:3cb779ea0c35bc807ff941d415875c1f69ca0be91a2e907ab99a171811d86a9a", size = 188729, upload-time = "2026-04-12T21:44:28.99Z" }, + { url = "https://files.pythonhosted.org/packages/85/7d/1e29a319d678d6cb962ae5bdf32a6858ebdf38f73bc654c0e9c742a0c2c8/msgspec-0.21.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:68604db36b3b4dd9bf160e436e12798a4738848144cea1aca1cb984011eb160f", size = 219866, upload-time = "2026-04-12T21:44:31.104Z" }, + { url = "https://files.pythonhosted.org/packages/25/1f/cca084ca2572810fff12ea9dbdcbe39eac048f40daf4a9077b49fcbe8cee/msgspec-0.21.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3d6b9dc50948eaf65df54d2fd0ff66e6d8c32f116037209ee861810eb9b676cb", size = 224993, upload-time = "2026-04-12T21:44:32.649Z" }, + { url = "https://files.pythonhosted.org/packages/71/94/d2120fc9d419a89a3a7c13e5b7078798c4b392a96a02a6e2b3ce43a8766c/msgspec-0.21.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:52c5e21930942302394429c5a582ce7e6b62c7f983b3760834c2ce107e0dd6df", size = 223535, upload-time = "2026-04-12T21:44:33.839Z" }, + { url = "https://files.pythonhosted.org/packages/75/17/42418b66a3ad972a89bab73dd78b79cc6282bb488a25e73c853cee7443b9/msgspec-0.21.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:abbb39d65681fa24ed394e01af3d59d869068324f900c61d06062b7fb9980f2f", size = 227222, upload-time = "2026-04-12T21:44:35.093Z" }, + { url = "https://files.pythonhosted.org/packages/c4/33/265c894268cca88ff67b144ca2b4c522fc8b9a6f1966a3640c70516e78e1/msgspec-0.21.1-cp314-cp314-win_amd64.whl", hash = "sha256:5666b1b560b97b6ec2eb3fca8a502298ebac56e13bbca1f88523538ce83d01ea", size = 193810, upload-time = "2026-04-12T21:44:36.612Z" }, + { url = "https://files.pythonhosted.org/packages/3b/8f/a6d35f25bf1fc63c492fdd88fdce01ba0875ead48c2b91f90f33653b4131/msgspec-0.21.1-cp314-cp314-win_arm64.whl", hash = "sha256:d8b8578e4c83b14ceea4cef0d0b747e31d9330fe4b03b2b2ad4063866a178f93", size = 179125, upload-time = "2026-04-12T21:44:38.198Z" }, + { url = "https://files.pythonhosted.org/packages/c6/39/74839641e64b99d87da55af0fc472854d42b46e2183b9e2a67fe1bb2a512/msgspec-0.21.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:15f523d51c00ebad412213bfe9f06f0a50ec2b93e0c19e824a2d267cabb48ea2", size = 200171, upload-time = "2026-04-12T21:44:39.414Z" }, + { url = "https://files.pythonhosted.org/packages/70/9b/ce0cca6d2d87fcd4b6ff97600790494e64f26a2c55d61507cd2755c16193/msgspec-0.21.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:4e47390360583ba3d5c6cb44cf0a9f61b0a06a899d3c2c00627cedebb2e2884b", size = 192879, upload-time = "2026-04-12T21:44:40.882Z" }, + { url = "https://files.pythonhosted.org/packages/a7/08/673a7bb05e5702dc787ddd3011195b509f9867927970da59052211929987/msgspec-0.21.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f60800e6299b798142dc40b0644da77ceac5ea0568be58228417eae14135c847", size = 226281, upload-time = "2026-04-12T21:44:42.181Z" }, + { url = "https://files.pythonhosted.org/packages/7d/45/86508cf57283e9070b3c447e3ab25b792a7a0855a3ea4e0c6d111ac34c97/msgspec-0.21.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5f8e9dfcd98419cf7568808470c4317a3fb30bef0e3715b568730a2b272a20d7", size = 229863, upload-time = "2026-04-12T21:44:43.442Z" }, + { url = "https://files.pythonhosted.org/packages/2c/62/e7c9367cd08d590559faacd711edbae36840342843e669440363f33c7d36/msgspec-0.21.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:92d89dfad13bd1ea640dc3e37e724ed380da1030b272bdf5ecafb983c3ad7c75", size = 230445, upload-time = "2026-04-12T21:44:44.806Z" }, + { url = "https://files.pythonhosted.org/packages/42/b4/c0f54632103846b658a10930025f4de41c8724b5e4805a5f3b395586cb7e/msgspec-0.21.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0d03867786e5d7ba25d666df4b11320c27170f4aeafcb8e3a8b0a50a4fb742ca", size = 231822, upload-time = "2026-04-12T21:44:46.343Z" }, + { url = "https://files.pythonhosted.org/packages/ea/1d/0d85cc79d0ccf5508e9c846cc66552a6a16bf92abd1dbd8362617f7b35cd/msgspec-0.21.1-cp314-cp314t-win_amd64.whl", hash = "sha256:740fbf1c9d59992ca3537d6fbe9ebbf9eaf726a65fbf31448e0ecbc710697a63", size = 206650, upload-time = "2026-04-12T21:44:47.601Z" }, + { url = "https://files.pythonhosted.org/packages/90/91/56c5d560f20e6c20e9e4f55bd0e458f7f162aa689ee350346c04c48eac0b/msgspec-0.21.1-cp314-cp314t-win_arm64.whl", hash = "sha256:0d2cc73df6058d811a126ac3a8ad63a4dfa210c82f9cf5a004802eaf4712de90", size = 183149, upload-time = "2026-04-12T21:44:48.833Z" }, +] + [[package]] name = "multidict" version = "6.7.1" @@ -3432,6 +3472,7 @@ source = { editable = "." } dependencies = [ { name = "donfig" }, { name = "google-crc32c" }, + { name = "msgspec" }, { name = "numcodecs" }, { name = "numpy" }, { name = "packaging" }, @@ -3552,6 +3593,7 @@ requires-dist = [ { name = "donfig", specifier = ">=0.8" }, { name = "fsspec", marker = "extra == 'remote'", specifier = ">=2023.10.0" }, { name = "google-crc32c", specifier = ">=1.5" }, + { name = "msgspec", specifier = ">=0.19" }, { name = "numcodecs", specifier = ">=0.14" }, { name = "numpy", specifier = ">=2" }, { name = "obstore", marker = "extra == 'remote'", specifier = ">=0.5.1" }, From 12aa83b69b1513b6958d49fc0e3c6768c0b2e1f8 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Thu, 13 Aug 2026 21:50:07 +0200 Subject: [PATCH 54/61] deps: bump cast-value.rs to >= 0.4.2 (#4260) * deps: bump cast-value.rs to >= 0.4.2 * deps: update uv.lock for cast-value-rs >= 0.4.2 The pyproject floor alone left uv.lock pinning 0.4.0, so any lock-honoring install (uv sync --locked/--frozen) kept the version that silently transposes non-row-major input. Assisted-by: ClaudeCode:claude-fable-5 * fix(cast_value): enforce the cast-value-rs floor at runtime The pyproject floor only binds installs that go through the zarr[cast-value-rs] extra. An environment that already has an older cast-value-rs installed kept silently corrupting non-row-major input after upgrading zarr, which is the failure this floor exists to stop. Check the installed version at import and raise from _do_cast, so the error surfaces when the codec is used rather than breaking `import zarr` for everyone else. A backend without distribution metadata (a `maturin develop` build) has no version to compare and is left alone. Assisted-by: ClaudeCode:claude-fable-5 * test(cast_value): cover cast_value next to the transpose codec Regression test for #4237: a cast_value codec on either side of a transpose codec must round-trip, because transpose hands the next codec a non-row-major view. Imported unchanged from #4238, where this test was written. The np.ascontiguousarray workaround that accompanied it there is deliberately left out: cast-value-rs 0.4.2 normalizes layout itself, and the workaround promotes 0-d arrays to shape (1,), breaking 0-d arrays. Co-authored-by: Raphael Jolivet Assisted-by: ClaudeCode:claude-fable-5 --------- Co-authored-by: Raphael Jolivet Co-authored-by: Raphael Jolivet --- changes/4260.bugfix.md | 1 + pyproject.toml | 2 +- src/zarr/codecs/cast_value.py | 45 +++++++-- tests/test_codecs/test_cast_value.py | 134 +++++++++++++++++++++++++++ uv.lock | 122 ++++++++++++------------ 5 files changed, 230 insertions(+), 74 deletions(-) create mode 100644 changes/4260.bugfix.md diff --git a/changes/4260.bugfix.md b/changes/4260.bugfix.md new file mode 100644 index 0000000000..b703c47a35 --- /dev/null +++ b/changes/4260.bugfix.md @@ -0,0 +1 @@ +The `cast_value` codec now requires `cast-value-rs>=0.4.2`. Earlier versions of that backend silently corrupted data when handed an array that was not row-major — the layout the `transpose` codec produces — so a `cast_value` codec next to a `transpose` codec would either write transposed values with no error or fail with `ValueError: Input array must be contiguous`. The minimum version is enforced at runtime as well as in the package metadata, so an environment that already has an older `cast-value-rs` installed now raises `ImportError` when the codec is used, instead of corrupting data. diff --git a/pyproject.toml b/pyproject.toml index f341a488ed..dca663277e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,7 +81,7 @@ remote = [ gpu = [ "cupy-cuda12x; sys_platform != 'darwin'", ] -cast-value-rs = ["cast-value-rs"] +cast-value-rs = ["cast-value-rs>=0.4.2"] cli = ["typer"] optional = ["universal-pathlib"] diff --git a/src/zarr/codecs/cast_value.py b/src/zarr/codecs/cast_value.py index eb8a4de248..b19a10c873 100644 --- a/src/zarr/codecs/cast_value.py +++ b/src/zarr/codecs/cast_value.py @@ -5,16 +5,18 @@ rounding, out-of-range handling, and explicit scalar mappings. Requires the optional ``cast-value-rs`` package for the actual casting -logic. Install it with: ``pip install cast-value-rs``. +logic. Install it with: ``pip install 'cast-value-rs>=0.4.2'``. """ from __future__ import annotations from collections.abc import Mapping from dataclasses import dataclass, replace +from importlib.metadata import PackageNotFoundError, version from typing import TYPE_CHECKING, Final, Literal, TypedDict, cast import numpy as np +from packaging.version import Version from zarr.abc.codec import ArrayArrayCodec from zarr.core.common import JSON, parse_named_configuration @@ -123,12 +125,40 @@ def parse_scalar_map(obj: ScalarMapJSON | ScalarMap) -> ScalarMap: # Backend: cast-value-rs # --------------------------------------------------------------------------- +# Versions below this silently transpose input arrays that are not row-major - +# the layout `transpose` hands to the next codec - writing corrupted data with +# no error. Keep in sync with the `cast-value-rs` extra in pyproject.toml. +CAST_VALUE_RS_MIN_VERSION: Final = "0.4.2" + +_INSTALL_HINT: Final = f"Install it with: pip install 'cast-value-rs>={CAST_VALUE_RS_MIN_VERSION}'" + + +def _check_backend_version() -> str | None: + """Return a message describing an unusable backend version, or `None` if it is usable.""" + try: + installed = version("cast-value-rs") + except PackageNotFoundError: + # Importable but without distribution metadata, e.g. a `maturin develop` + # build. There is no version to compare, so let it through. + return None + if Version(installed) < Version(CAST_VALUE_RS_MIN_VERSION): + return ( + f"The cast_value codec requires cast-value-rs >= {CAST_VALUE_RS_MIN_VERSION}, " + f"but version {installed} is installed. Earlier versions silently corrupt data " + f"when the input array is not row-major. {_INSTALL_HINT}" + ) + return None + + +# Set once at import; raised from `_do_cast`, so an unusable backend does not +# make `import zarr` fail for users who never touch this codec. +_BACKEND_ERROR: str | None try: from cast_value_rs import cast_array as cast_array_rs - - _HAS_RUST_BACKEND = True except ModuleNotFoundError: - _HAS_RUST_BACKEND = False + _BACKEND_ERROR = f"The cast_value codec requires the 'cast-value-rs' package. {_INSTALL_HINT}" +else: + _BACKEND_ERROR = _check_backend_version() def _check_representable( @@ -305,11 +335,8 @@ def _do_cast( target_dtype: np.dtype, scalar_map: Mapping[str | float | int, str | float | int] | None, ) -> np.ndarray: - if not _HAS_RUST_BACKEND: - raise ImportError( - "The cast_value codec requires the 'cast-value-rs' package. " - "Install it with: pip install cast-value-rs" - ) + if _BACKEND_ERROR is not None: + raise ImportError(_BACKEND_ERROR) scalar_map_entries: dict[float | int, float | int] | None = None if scalar_map is not None: src_dtype = arr.dtype diff --git a/tests/test_codecs/test_cast_value.py b/tests/test_codecs/test_cast_value.py index c43edb76e8..c2e78770d9 100644 --- a/tests/test_codecs/test_cast_value.py +++ b/tests/test_codecs/test_cast_value.py @@ -4,10 +4,13 @@ import numpy as np import pytest +from numpy.testing import assert_array_equal import zarr from tests.conftest import Expect, ExpectFail +from zarr.codecs import BytesCodec, TransposeCodec from zarr.codecs.cast_value import CastValue +from zarr.storage import MemoryStore try: import cast_value_rs # noqa: F401 @@ -477,3 +480,134 @@ def test_parse_scalar_map(case: Expect[Any, Any]) -> None: from zarr.codecs.cast_value import parse_scalar_map assert parse_scalar_map(case.input) == case.output + + +# --------------------------------------------------------------------------- +# Backend version guard +# --------------------------------------------------------------------------- + + +@pytest.mark.parametrize( + "case", + [ + Expect(input="0.4.2", output=None, id="exactly-minimum"), + Expect(input="0.4.3", output=None, id="newer-patch"), + Expect(input="0.5.0", output=None, id="newer-minor"), + Expect(input="1.0.0", output=None, id="newer-major"), + Expect(input="0.4.2.post1", output=None, id="post-release"), + Expect(input="0.4.0", output="0.4.0", id="known-corrupting"), + Expect(input="0.4.1", output="0.4.1", id="one-patch-below"), + Expect(input="0.3.0", output="0.3.0", id="older-minor"), + Expect(input="0.4.2.dev1", output="0.4.2.dev1", id="pre-release-of-minimum"), + ], + ids=lambda c: c.id, +) +def test_check_backend_version( + case: Expect[str, str | None], monkeypatch: pytest.MonkeyPatch +) -> None: + """Versions at or above the minimum pass; older ones report the installed version.""" + from zarr.codecs import cast_value as mod + + monkeypatch.setattr(mod, "version", lambda _: case.input) + result = mod._check_backend_version() + + if case.output is None: + assert result is None + else: + assert result is not None + assert case.output in result + assert mod.CAST_VALUE_RS_MIN_VERSION in result + + +def test_check_backend_version_allows_missing_metadata(monkeypatch: pytest.MonkeyPatch) -> None: + """A backend without distribution metadata is allowed: there is no version to compare.""" + from importlib.metadata import PackageNotFoundError + + from zarr.codecs import cast_value as mod + + def raise_not_found(_: str) -> str: + raise PackageNotFoundError + + monkeypatch.setattr(mod, "version", raise_not_found) + assert mod._check_backend_version() is None + + +def test_encode_rejects_outdated_backend(monkeypatch: pytest.MonkeyPatch) -> None: + """Using the codec with an outdated backend raises instead of corrupting data.""" + from zarr.codecs import cast_value as mod + + monkeypatch.setattr(mod, "_BACKEND_ERROR", "outdated backend") + codec = CastValue(data_type="uint16") + + with pytest.raises(ImportError, match="outdated backend"): + codec._do_cast( + np.arange(4, dtype=np.float32), target_dtype=np.dtype("uint16"), scalar_map=None + ) + + +def test_min_version_matches_pyproject() -> None: + """The runtime floor and the packaging floor must not drift apart.""" + import re + import tomllib + from pathlib import Path + + from zarr.codecs.cast_value import CAST_VALUE_RS_MIN_VERSION + + pyproject = Path(__file__).parents[2] / "pyproject.toml" + if not pyproject.is_file(): + pytest.skip("pyproject.toml is not available in an installed checkout") + + with pyproject.open("rb") as f: + extras = tomllib.load(f)["project"]["optional-dependencies"] + + (requirement,) = extras["cast-value-rs"] + match = re.fullmatch(r"cast-value-rs>=(?P[\w.]+)", requirement) + assert match is not None, f"unexpected requirement form: {requirement!r}" + assert match.group("version") == CAST_VALUE_RS_MIN_VERSION + + +# --------------------------------------------------------------------------- +# Non-contiguous input (regression for #4237) +# --------------------------------------------------------------------------- + + +@requires_cast_value_rs +def test_enforce_contiguous_arrays() -> None: + """ + Transpose codec produces non-contiguous arrays. + Ensure cast_value makes them contiguous before processing. + """ + data = np.arange(20, dtype=np.float32).reshape(5, 2, 2) + + def make_array(filters: list[Any]) -> Any: + return zarr.create_array( + store=MemoryStore(), + shape=data.shape, + dtype=data.dtype, + chunks=data.shape, + filters=filters, + serializer=BytesCodec(endian="little"), + compressors=None, + zarr_format=3, + ) + + # Cast before transpose + array = make_array( + [ + CastValue(data_type="uint16"), + TransposeCodec(order=(1, 2, 0)), + ] + ) + array[:] = data + assert_array_equal(array[:], data) + + # Cast after transpose + array = make_array( + [ + TransposeCodec(order=(1, 2, 0)), + CastValue(data_type="uint16"), + ] + ) + + array[:] = data + assert_array_equal(array[:], data) diff --git a/uv.lock b/uv.lock index 07710e2c86..05a746af06 100644 --- a/uv.lock +++ b/uv.lock @@ -376,69 +376,63 @@ wheels = [ [[package]] name = "cast-value-rs" -version = "0.4.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/44/88/3659e7a3e5c861ad1c689145adf26cc1a47a9e3dd8367690bfaab9fae161/cast_value_rs-0.4.0.tar.gz", hash = "sha256:26d71727b0b20c84ddcc721eddfc338fcfc2bd7dc500e0727fded2112a3ce7c3", size = 48896, upload-time = "2026-04-01T21:02:33.292Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c9/0b/13bbb127b1695272ab391d8d81266ae4fbae3dbcbb3943b1c712bc32ea82/cast_value_rs-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f2f9c4ace575812436d74e84bf9c8e297e2c3c7d1aaccfa4507d4efc0b0b642c", size = 509234, upload-time = "2026-04-01T21:00:10.683Z" }, - { url = "https://files.pythonhosted.org/packages/1d/d7/fb1e893a6897dbba983854942a1c5bd9d2689ae5e640c1878856bfbad4f6/cast_value_rs-0.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:233aca7d1012056f064c0e13921d1ddcd0998824225614fdd72afc325114eafd", size = 465329, upload-time = "2026-04-01T21:00:12.221Z" }, - { url = "https://files.pythonhosted.org/packages/6c/61/087af77ba17979b0b6f4556793b36407f04457768f6127877ac50728c5fb/cast_value_rs-0.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e0eaddd64f2e00a8545279a0d937d8e41c85df847b1d34d693199a5946489a8d", size = 494432, upload-time = "2026-04-01T21:00:13.501Z" }, - { url = "https://files.pythonhosted.org/packages/5d/98/c0c4239f1172d64eee3eeaa11aed9b096429d94f22e2d052ac8eaa55016b/cast_value_rs-0.4.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6c15d16d459f43c66f4e913eef97aeb9f593e783344d276f93c86fc4785eadc8", size = 531316, upload-time = "2026-04-01T21:00:15.146Z" }, - { url = "https://files.pythonhosted.org/packages/4a/a6/cd954496bde7ca8d55018e389643a9a053e165cb0bb9e9ab08a6a5679bbd/cast_value_rs-0.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:94f1430914a585f8475bc3b0617cc67d9eecb928cfe90548aa36a96ebdfed877", size = 659598, upload-time = "2026-04-01T21:00:16.71Z" }, - { url = "https://files.pythonhosted.org/packages/de/12/58e62a3ba13e68969a51b180b8d94c13754cd41dbb8a751f724de25c17dd/cast_value_rs-0.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6b7bc5a910c2554da173e050bf49c2b24086273ce72fb3d941e58d2387174a99", size = 562379, upload-time = "2026-04-01T21:00:17.975Z" }, - { url = "https://files.pythonhosted.org/packages/6d/20/d6e5555fbad2c7a89740d44c235a8db00913370fdec218fa7c5ba67b3d02/cast_value_rs-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b251eaf7dae58e51119b0f827fb348a72990ebe887e69d3a8b2c86f13b4c82ae", size = 556899, upload-time = "2026-04-01T21:00:19.45Z" }, - { url = "https://files.pythonhosted.org/packages/45/0d/d4f81048ba28c0867076a9e5fa65af849260c5643be1f8ebf6e356e51999/cast_value_rs-0.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f97ea32da52c147342afe89c5bbfd7edc9644c832b2f54deb3388afb0c1ae911", size = 587816, upload-time = "2026-04-01T21:00:20.827Z" }, - { url = "https://files.pythonhosted.org/packages/9d/d2/fe6ebbc017d75920b095150ae02aff387b710c24562ae23c96c9b388e787/cast_value_rs-0.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:52763c9da83e3e00dc8e63cd15b25bc9044bdd85148d67a3979fb396954c45be", size = 671468, upload-time = "2026-04-01T21:00:22.265Z" }, - { url = "https://files.pythonhosted.org/packages/5a/78/9ee727254cc74198e34571d97260590bbdd11b71f193ddccf8374fc14629/cast_value_rs-0.4.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:e01e1941d035e1c640dfb900c89fab50787665640cd99ce403842de584720c68", size = 809484, upload-time = "2026-04-01T21:00:23.668Z" }, - { url = "https://files.pythonhosted.org/packages/9b/2b/07f75100dc76e600c3c9562e72d4be05a3a6bc4fc761d5a4dddb169f282a/cast_value_rs-0.4.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:840f3000310aa2846839cd547312371d3e5a73cc95ed750e6c726638cf6c762c", size = 803296, upload-time = "2026-04-01T21:00:25.433Z" }, - { url = "https://files.pythonhosted.org/packages/e3/9e/5b9d2e4fb157ddc8a5ee15d380e145078fad126f138630cf2bac5136971e/cast_value_rs-0.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5ee3813bd223a45dd67a1a848ede57f6677183320152a315b3c69db8f745e9f2", size = 760952, upload-time = "2026-04-01T21:00:27.002Z" }, - { url = "https://files.pythonhosted.org/packages/8e/8e/6ff327c27b7e24161b5d04f7916bce044c3d7750695d1d7ed139f13e977f/cast_value_rs-0.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:bc91d540ddc6e16785e464867a980c4fb714dc0d83a16d2dfa604604403266bd", size = 442019, upload-time = "2026-04-01T21:00:28.322Z" }, - { url = "https://files.pythonhosted.org/packages/04/3f/ed6b219d7b62d32a0248940891c75dfc97e4df88e62966076cb0f5f9fc91/cast_value_rs-0.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:01a8161db167a4cf1d73b3eced2af01ed7bc0a6ffa937c3bd5ff33af79ba51c4", size = 387803, upload-time = "2026-04-01T21:00:30.151Z" }, - { url = "https://files.pythonhosted.org/packages/d3/9d/16d38e5cdb91df16b06f4145482aacc3d486789d4901d149c8e346ff121d/cast_value_rs-0.4.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:a4a3b92d45447ca8407ccc4e4c50dbffb5f0266b83bc4eec8d44de51c8a5e7cd", size = 509653, upload-time = "2026-04-01T21:00:31.422Z" }, - { url = "https://files.pythonhosted.org/packages/da/74/e293ca02ce1e0e8b3be08d2c28e450a3321eb2526af35b5c4e6837904181/cast_value_rs-0.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:63d06fc8ce800a98ce542da5a7631a39a19e3f1e99a25546e392bf415ccaaf0d", size = 465604, upload-time = "2026-04-01T21:00:32.759Z" }, - { url = "https://files.pythonhosted.org/packages/4f/6d/1b7f161028fa617c9e896b37f014dce393578bfda32362de5b9e7f623d2c/cast_value_rs-0.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e8a4b525b9cdf0b7fd62373e3452b62973943d441820bf49a71d6bb6ae4e55d", size = 494568, upload-time = "2026-04-01T21:00:34.277Z" }, - { url = "https://files.pythonhosted.org/packages/fc/7b/e1f51e320330ac75ffecf037dd100d66c89a0b534fa4adc7cd8ffb87b2aa/cast_value_rs-0.4.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6d605e8d8bd5ec841c7b7e8302ef3fd944ed4af5d89f7ecdc60f71309712a319", size = 532007, upload-time = "2026-04-01T21:00:35.813Z" }, - { url = "https://files.pythonhosted.org/packages/03/b8/f2e109eee0dbdf611b608ee3384c9b5c8cf953c2dac80c9ce181c2a8e475/cast_value_rs-0.4.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b9a77f9debac4f017748695b5e126f137fbc62df3f02ef90467f50791d5d2572", size = 660049, upload-time = "2026-04-01T21:00:37.062Z" }, - { url = "https://files.pythonhosted.org/packages/c6/f9/eafbe3622f0f2ec35979059ee693a25a219549ca727741d105a41246e35d/cast_value_rs-0.4.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dab9edb59f25165a934022b2372865cd19bdb187719c1df324b503f478524276", size = 562394, upload-time = "2026-04-01T21:00:38.754Z" }, - { url = "https://files.pythonhosted.org/packages/cb/ae/96c0bafb8f1dc3b55598dbb34b1febf92632f1f2c4a7d439866593c8fa0a/cast_value_rs-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:972df11faab7b0794f16c3d6f8040a9c6b9c55b5ffc23e232057d141103f9830", size = 556762, upload-time = "2026-04-01T21:00:39.977Z" }, - { url = "https://files.pythonhosted.org/packages/a4/47/db0182272fa794fba3c0102d28b9c7eaaab9755bae3ff4d603d66a6d0fe8/cast_value_rs-0.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a226c0ceb6397751bf92475b6f0d63f843ca81e8c7e94ce023d33e78b96e5d9f", size = 587838, upload-time = "2026-04-01T21:00:41.281Z" }, - { url = "https://files.pythonhosted.org/packages/08/74/733a8c1562f6001888652cf5867d6439fd92aae5db4ce8979d1150fa1c2e/cast_value_rs-0.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bbe2bd7df06bc8cafd3fbbcb66ea3f8ccbb2273c771fbe3538f98205f455705c", size = 671420, upload-time = "2026-04-01T21:00:42.559Z" }, - { url = "https://files.pythonhosted.org/packages/b7/ff/725a0eb649a5a512c6aab87dfd9b2159c3fbe103a6ee1f63bbfe80969d34/cast_value_rs-0.4.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:efc00cfc1b376b920839424244fa7d79c7e2ee26b62e8c48ebc025e0bf350770", size = 809907, upload-time = "2026-04-01T21:00:44.147Z" }, - { url = "https://files.pythonhosted.org/packages/0a/66/abedf22ec734f387dddc8a8a2fb72587adbe1c48ce144649dcc63c86eb6d/cast_value_rs-0.4.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7dad4ecf608c7170f78ae45e0454b891c6c0e579c1190b68a5e448b714b79257", size = 803277, upload-time = "2026-04-01T21:00:45.545Z" }, - { url = "https://files.pythonhosted.org/packages/5f/1b/8f19f848ca622c3090be39759420820ff70ac414be41b1762c191de06394/cast_value_rs-0.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:15c89f529b4cc37ebac8b2f6e0a1f8a90e2b2b71703e6629d3ff579efab77323", size = 761021, upload-time = "2026-04-01T21:00:46.962Z" }, - { url = "https://files.pythonhosted.org/packages/fb/1a/684b634f621e35b4b0bbbde7ec28913b8925002b865e6f7b9d886dcccaef/cast_value_rs-0.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:a6247099de0b71e63f8156bbd97f9e964a1ddcc9b3d547b6a4839a0e911bdf54", size = 441797, upload-time = "2026-04-01T21:00:48.671Z" }, - { url = "https://files.pythonhosted.org/packages/cc/35/393c9a1ccd4f2b85b178bda2b3f73ee6aae133d03b9be18ddce43b2ee6f9/cast_value_rs-0.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:fb18be6232a4e6d616e1ba2555bf105e663d22091abd0c6371d8f1a4c1670c82", size = 387884, upload-time = "2026-04-01T21:00:49.936Z" }, - { url = "https://files.pythonhosted.org/packages/fb/a1/ac26f64f9ffda3d9f0b4a350b7a727da17ee5be417545743c84fd18ab5ef/cast_value_rs-0.4.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c51764b7fcedd5484ae4f7d8ee7a1f7f7a40736789f9c412f1ba780a6aba0cb", size = 490003, upload-time = "2026-04-01T21:00:51.191Z" }, - { url = "https://files.pythonhosted.org/packages/b6/e9/a74d2ecc6e8f5fa0bd23b8f45ae1f11800b3e079c31f4eaad120140ed942/cast_value_rs-0.4.0-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5afeb1555b24a73c2b344dbb19e91a83260751dc2f8f9e1d3d1b44535cd3f520", size = 518662, upload-time = "2026-04-01T21:00:52.513Z" }, - { url = "https://files.pythonhosted.org/packages/61/0d/7d25a5dc2e5f6a284684e39859607d41cb1fa5a3219d372facffd04c7ed9/cast_value_rs-0.4.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f9111ce32ca83a61565d92200b462007af6b1aa8895c81ea4732057567784298", size = 652482, upload-time = "2026-04-01T21:00:53.765Z" }, - { url = "https://files.pythonhosted.org/packages/6a/36/d71bac4a6589fcb6d1320940bd8744cf2dcce65928d0de021c87d0356ae9/cast_value_rs-0.4.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aeab17fe7e6cc1881af272bc681f7ae3971e11d079e440efd9012ed7d9e074d3", size = 558125, upload-time = "2026-04-01T21:00:55.429Z" }, - { url = "https://files.pythonhosted.org/packages/86/9f/74a5dcb2dcfc3aaad6f9308d3ce0cf59be32b0d9563328c9331457888fd5/cast_value_rs-0.4.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:b5b040dd4838d0e4b2dee603bf61bef5b0625c35a91e859b0abd103c275c4207", size = 666195, upload-time = "2026-04-01T21:00:57.05Z" }, - { url = "https://files.pythonhosted.org/packages/27/02/8c66fb39dd8c3efa05b3ee70c135aefc1631cf28cc08fca1d20515f34da4/cast_value_rs-0.4.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:59a55898bbf82d8d2b417960aac9db6fa195cd44451e7667076d5b8eb0b28ffd", size = 796949, upload-time = "2026-04-01T21:00:58.399Z" }, - { url = "https://files.pythonhosted.org/packages/cc/13/349a2f64e1a0ffa2d211c9282d1cc7b41ac5edf473d24ec95cbc9d2fbf70/cast_value_rs-0.4.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:a528723cef699de74bf7344d55e8b2f21e2fdaf24dda22cf9bbb0f75effb296f", size = 778419, upload-time = "2026-04-01T21:01:00.154Z" }, - { url = "https://files.pythonhosted.org/packages/b9/1b/926df4b577ed051920a63e13ac1435fdb9f7fbd5d28c2f7ec545050be675/cast_value_rs-0.4.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:a8d7a887e44a3ef642f5b5e462b6352062ba8041ef6d90f4b31c816f63dbb34f", size = 741379, upload-time = "2026-04-01T21:01:01.996Z" }, - { url = "https://files.pythonhosted.org/packages/b9/36/3ec2848a1914655e85201f8def177526b4c17802b9530f17ad53de68c42a/cast_value_rs-0.4.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:4c73d47bd6d4e066b99482a48fc48a3a6220b42a282063125e3fa6c495754698", size = 509569, upload-time = "2026-04-01T21:01:03.308Z" }, - { url = "https://files.pythonhosted.org/packages/47/b9/2ea6f9de182e0b454e852435d26238bef8eb58995ff8a1b4c48bb00ae4bc/cast_value_rs-0.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:18d0bdec57d7e747bec3fb258c7d2d48389bd8f05df5f59f109f9a8ec1f41dc1", size = 465923, upload-time = "2026-04-01T21:01:04.68Z" }, - { url = "https://files.pythonhosted.org/packages/a9/15/feab5abdc6b02db474d840130b5a2a64afcb757db5f83446ca874eac6de5/cast_value_rs-0.4.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c03a09951fcb2433dd55d28ffffb04f5119d8abd5d231fc739a49908a9cab47b", size = 494033, upload-time = "2026-04-01T21:01:06.263Z" }, - { url = "https://files.pythonhosted.org/packages/94/f6/d40ec4d3db15e07864038bdf4c8ab11165a517fa88d507bc5b859573aadd/cast_value_rs-0.4.0-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:84494970c1b3aa373100671b0b3a01f56c65a4dd5ed16b1be8c565ac6b3f0000", size = 532024, upload-time = "2026-04-01T21:01:07.574Z" }, - { url = "https://files.pythonhosted.org/packages/d5/88/0cc4718632c9e47e7558964fa1d78841737f19a49c68e6aa7ac1074faf61/cast_value_rs-0.4.0-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0f95e67121c7ddbb1c06719694bb1559fd8d6e4e826ef1f93be7df5106b4f1c6", size = 661337, upload-time = "2026-04-01T21:01:09.152Z" }, - { url = "https://files.pythonhosted.org/packages/b8/4f/26acfba143169e319267dcc93ccf55a113ebb99fc6bb1209195ded2c5f60/cast_value_rs-0.4.0-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:67079ea95b83b6c41471c35d7ae821d9148cf66739281c07bfd8f4ccbced5c8c", size = 562268, upload-time = "2026-04-01T21:01:10.547Z" }, - { url = "https://files.pythonhosted.org/packages/3e/19/c23c8ebae9a06bf919ed4788e80c90cbc23b6443e5adf797a59967b66602/cast_value_rs-0.4.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:259b1b315171e8e1bde0284828601c289f1c75dc782cdb215786aec3b79a05f5", size = 555358, upload-time = "2026-04-01T21:01:12.024Z" }, - { url = "https://files.pythonhosted.org/packages/05/dd/df59efda2ded4eddfb0d7f3f473a2efd638a5cc0775f3d91646293970572/cast_value_rs-0.4.0-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:84b733c91540247abee411d7052406a68f60ceaabb33a70a5eac7fd333d74220", size = 588031, upload-time = "2026-04-01T21:01:13.343Z" }, - { url = "https://files.pythonhosted.org/packages/8d/1f/97b1d82b696f0b77ae9cba4ca6368a9d0f3ee61a6b7907fd34b1d8e117e8/cast_value_rs-0.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c007832a316160c08642aed44bef1e2f3103488e29fb078f7c571c01e6f65caf", size = 671191, upload-time = "2026-04-01T21:01:14.627Z" }, - { url = "https://files.pythonhosted.org/packages/b8/99/343eebb11a372defd7b049c0f627d29c67450bd5f9fbf28241d1f7b0712f/cast_value_rs-0.4.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:d8b2b9b69314b4596beaadb6c98a955bd6b1d988f54ae4cd14ab804f6e1bd450", size = 810173, upload-time = "2026-04-01T21:01:16.267Z" }, - { url = "https://files.pythonhosted.org/packages/06/32/739a3ca0b9ef1f97929faf06a7b68b64b01cce0f9bcbeb885c0c51ac24e4/cast_value_rs-0.4.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:6a2de5f66441a174ec8cc63e672f2b6ddc4aada73fb98d795e0da17d9c41771a", size = 805596, upload-time = "2026-04-01T21:01:17.711Z" }, - { url = "https://files.pythonhosted.org/packages/24/3f/56b33108837f195730a3f9467f686010132f459f0fcd050d8de74b111f74/cast_value_rs-0.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2c0b31d3f8ef8857f7b0a7b2e6ef1b43e1a88263cb20406860ce38a06c727f1a", size = 759220, upload-time = "2026-04-01T21:01:19.29Z" }, - { url = "https://files.pythonhosted.org/packages/d4/a1/18cbe0d297ba384a75f1d4476d67e88b5525afab77bddad6b8478992a8f3/cast_value_rs-0.4.0-cp314-cp314-win32.whl", hash = "sha256:6339adbce2686ad8218a38d17b543d71c062fb341c1411be6c45ab425abd2c64", size = 373865, upload-time = "2026-04-01T21:01:21.1Z" }, - { url = "https://files.pythonhosted.org/packages/93/4c/2dc5a2347c150bd8aa1e67549f8e03368a4249f214548e237c191514ac0e/cast_value_rs-0.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:0dd4240cb62ddee6b2f794151a5d7b263dfb22cd8d0903598a1d900bd1d7b536", size = 443712, upload-time = "2026-04-01T21:01:22.768Z" }, - { url = "https://files.pythonhosted.org/packages/25/3b/4c560902bf7825c1c479c3f0084aedec73cd355d54931bad4995faeb0f3f/cast_value_rs-0.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:6852abf682a5e9fa2bab04ccd43dc24dfe1056653f1a92dcf1a0d9ebd07af2cc", size = 388130, upload-time = "2026-04-01T21:01:24.284Z" }, - { url = "https://files.pythonhosted.org/packages/b7/c0/f32d10128e6f0f5a58bc9adcb7525f5fa241bd682af0bb0fb7ce92b4f200/cast_value_rs-0.4.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f4fbddd4e2b255219597c39092ba10d9873c9fe37a8189add459fe77f310b86e", size = 489885, upload-time = "2026-04-01T21:01:25.596Z" }, - { url = "https://files.pythonhosted.org/packages/bc/20/302156a38f1c7aef7f25864fd5895e831f5304a67d5af4d33874f676cdbf/cast_value_rs-0.4.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:01e053e5022cab8ce4a2e7605afe3e7c5685e3f56c90d05adcda69f8e5ec12d9", size = 517573, upload-time = "2026-04-01T21:01:26.887Z" }, - { url = "https://files.pythonhosted.org/packages/a0/cd/d1502aa5bf0fb0fb5d410d0dac67962c47df9ea6a8d0934cd95f15a09834/cast_value_rs-0.4.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2840f7b76085e472f510ec0e1802ae5799f85a5c2ed9d909a9790c15054f0480", size = 649447, upload-time = "2026-04-01T21:01:28.219Z" }, - { url = "https://files.pythonhosted.org/packages/0a/0a/f580ff584de55f1884cd8c15e1d2c9256188e58c5c981cd249894e2a87a4/cast_value_rs-0.4.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86a75d9ba1315c3ad33690e5f251ebfe053ed84cfe645d027d2e639f4a4c6dd7", size = 558318, upload-time = "2026-04-01T21:01:29.51Z" }, - { url = "https://files.pythonhosted.org/packages/2b/46/15f7318c2de3831689c0d9c40ed9a9179488d1650e1201e581df29fc10ea/cast_value_rs-0.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:4a56393964fea114ccb09d2c0fd14939e4aac0fb3178c7ff7af6b9f530f04267", size = 666217, upload-time = "2026-04-01T21:01:30.871Z" }, - { url = "https://files.pythonhosted.org/packages/3a/3f/716eb0d80ef6b7c9498487cefb86e603a0f893a2e11273fe6484659b46bf/cast_value_rs-0.4.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:ab4b8d4cbb7bfcf73690c36447d34af66bcab7fb7bdf8242ee33cb725e2ed736", size = 796289, upload-time = "2026-04-01T21:01:32.546Z" }, - { url = "https://files.pythonhosted.org/packages/fb/98/162a1d37a3d574783ff8d09286ffa33a108493c53367802e617f47607837/cast_value_rs-0.4.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:3693cf1b91b624061bcd649be53b2dd367ea3c18c212790c9a84a050df40ecca", size = 777483, upload-time = "2026-04-01T21:01:33.867Z" }, - { url = "https://files.pythonhosted.org/packages/df/e3/6e3390fc9693d5a5e9ca0d677ca8666174a1e43328bdf57b9af23f138143/cast_value_rs-0.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:2a343f5cdddb17b7ae95ef9fa6013f8e66bd40ee97ceaa47e8972c021814df59", size = 744015, upload-time = "2026-04-01T21:01:35.143Z" }, +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/56/a4/634d1917ac49ea69291471e87eee9c1aa45d71d6da9b2cd5e1bfe82729de/cast_value_rs-0.4.2.tar.gz", hash = "sha256:fd621b8dd4f7e93bbffdb119882d85e2731c2f0fb1d30de85f29e8e04c044822", size = 86862, upload-time = "2026-08-13T09:16:59.199Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/67/c7/9db59d415df2d1c9f905c4da951fe023c6259a162584ef68bd81c171d448/cast_value_rs-0.4.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:6d8e1c6d7b0fec6b1060f83867d20ebd0cb1ac6fa2954cd82f418a31a96ac504", size = 494354, upload-time = "2026-08-13T09:14:41.627Z" }, + { url = "https://files.pythonhosted.org/packages/8f/53/10ece0b4ba4a0c156674c2db7e5d05ce9b04efe72e191417546e111d645c/cast_value_rs-0.4.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8c953321ff7954e0fe1b25c1baf96f0a9cae0961b8a56ce63dc7b94e2ea7d85c", size = 458463, upload-time = "2026-08-13T09:14:43.371Z" }, + { url = "https://files.pythonhosted.org/packages/91/0b/e50ac2eb271eb6c34402b4abe317c795bc7d650d332d0bf422ae868aa2cd/cast_value_rs-0.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68492eef745691c80754cd027e216dbd5f7a4ce2e07fddfded3ee59bd947afb5", size = 487628, upload-time = "2026-08-13T09:14:44.86Z" }, + { url = "https://files.pythonhosted.org/packages/a9/0f/69befc7905af2e73a2739b26444787cd528331c041f37235f3853bf15f75/cast_value_rs-0.4.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fbf145ed6f724fa7f5ddc9715f78e0d450ac141fc05299c83b2e7d627793ddaf", size = 555538, upload-time = "2026-08-13T09:14:46.305Z" }, + { url = "https://files.pythonhosted.org/packages/4a/1b/4105fabec3268139bda3555422808211ec29428e17fa56566c1af7957c04/cast_value_rs-0.4.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73fb23256dda16e4e9f49bfedebe0e068f00ece85091b526c102618f66144216", size = 650896, upload-time = "2026-08-13T09:14:48.049Z" }, + { url = "https://files.pythonhosted.org/packages/83/2a/452cf37675af02c3ac8bfa01fc962cb744a1392c51bccfb6d1faca423067/cast_value_rs-0.4.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8184135c78ebcabb904574a1b3bc5704c131140feae1b58d65c888fe08b46029", size = 561036, upload-time = "2026-08-13T09:14:49.431Z" }, + { url = "https://files.pythonhosted.org/packages/d4/87/edb215d17da304a6b36489fc51b8eb785c5b041c2fcc5f200f16adde3133/cast_value_rs-0.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:686ea86aad1ffebd0b6793549043108600593a85032457eb88a3a0513a4100f5", size = 549187, upload-time = "2026-08-13T09:14:50.801Z" }, + { url = "https://files.pythonhosted.org/packages/63/82/0f9963ef0bcb434cd1244cb2620123c2d71763d429d017ceb98fbb6faf48/cast_value_rs-0.4.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d6c425d2803e13408755a0022faa9efd0ab0becdf3573a1a8a7af64b1adee4ba", size = 591027, upload-time = "2026-08-13T09:14:52.281Z" }, + { url = "https://files.pythonhosted.org/packages/90/97/b489f8048491f2ece21bf99d5a1fea3bbfaf3cd0e9f555ac4a0352c11d81/cast_value_rs-0.4.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:92556f1bb9d6b222736d967228565ec745c640c29bc291d1cb730a1011d3dcac", size = 665201, upload-time = "2026-08-13T09:14:53.769Z" }, + { url = "https://files.pythonhosted.org/packages/ce/9f/fabffd9788f0b2d3f49ca4582b8859ab58b929b1b8837ec0be1263399279/cast_value_rs-0.4.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:1b0881c23a8f5ff1dc6c70542179f2fc9191e0b7fa7a02f65316fb48904cd8d1", size = 831085, upload-time = "2026-08-13T09:14:55.244Z" }, + { url = "https://files.pythonhosted.org/packages/b5/66/ca653bf9b51eb624615623611db28ec9428a351259fcf5625c5520faf759/cast_value_rs-0.4.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:8a67648bf47d9b740388efaf6f05185f22dea783e97eba895efdd1dbafe8e3cc", size = 788462, upload-time = "2026-08-13T09:14:56.666Z" }, + { url = "https://files.pythonhosted.org/packages/f1/54/3a9280f791c8765a54f7814a010d2f460c7d5f5483be3e5634f4d9b38d75/cast_value_rs-0.4.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:decf297bc576675fff2139885fb88f84844e27b99e5d28eaa01909db7a327c4b", size = 753055, upload-time = "2026-08-13T09:14:58.302Z" }, + { url = "https://files.pythonhosted.org/packages/06/26/09f4618dbab2de8ea427e817c349b8391b4d559316de899e9b54dde6143e/cast_value_rs-0.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:79a8c13af39bf65014dd6567dc5fa7c42dfda246e4335ab52814f3dd6fb42cac", size = 442068, upload-time = "2026-08-13T09:15:00.414Z" }, + { url = "https://files.pythonhosted.org/packages/fc/49/7def5933625ff3c98e7d20cbd7de0aa1e83098ffa425a9df087764657767/cast_value_rs-0.4.2-cp312-cp312-win_arm64.whl", hash = "sha256:b8af7de3639271ad9e62aba4d15ddd22819c706bd7c7859663fdbb022397bdad", size = 397846, upload-time = "2026-08-13T09:15:02.022Z" }, + { url = "https://files.pythonhosted.org/packages/6f/fc/1f48ae9ea1f10caf3bbc31b288d08137835d8965188f6ddcccdb3c7d398e/cast_value_rs-0.4.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:297445abc64891a2e62af93e4f35bb280f874ac548646d0a6b04a86d45e636a5", size = 494394, upload-time = "2026-08-13T09:15:03.604Z" }, + { url = "https://files.pythonhosted.org/packages/7f/f3/d633218979cd8839fcfbade64a277c0ff9d8ff59d21bbd8a59f1467085b4/cast_value_rs-0.4.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:b8b6e0781b4ce61a559cc050d836a52157bd30b1f59d63fdeee79fbc19ab7e57", size = 458677, upload-time = "2026-08-13T09:15:04.947Z" }, + { url = "https://files.pythonhosted.org/packages/97/e4/96d72ccf5e00dd7af7bf55c96313df2ffba1f34a224f10430716232775c0/cast_value_rs-0.4.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8399dc89570c01537c07adc03fc2fc0e43a517be8a198e2f9e3f8a70dd003be0", size = 487289, upload-time = "2026-08-13T09:15:06.493Z" }, + { url = "https://files.pythonhosted.org/packages/93/30/18313de8c1d3826e9a6abd883b7a7981b19391f674dcd52ff2635d19f8ee/cast_value_rs-0.4.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:939417d72c9945ce24eb959e6b2cd32f7aa7d0a50a06a0fac484056b10b650dd", size = 555221, upload-time = "2026-08-13T09:15:08.28Z" }, + { url = "https://files.pythonhosted.org/packages/e9/1f/ed22b2e536ccbd4c5b234d869fc8f478347a45f7b940273023a0d6013134/cast_value_rs-0.4.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:101318e594ee998a5ccbc5ea7ed045cbd9fd22d45cac467c745fbd30309f1343", size = 650972, upload-time = "2026-08-13T09:15:10.103Z" }, + { url = "https://files.pythonhosted.org/packages/d7/d2/39f9ff9b678dfb01d206aec6be0f486137d5e9669ebadf0d1f356d2a7324/cast_value_rs-0.4.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d23bac26b2c2fe6a2368d10fbb072a71671f6e0d4d8cf9e893f62ed3530bbd1b", size = 560869, upload-time = "2026-08-13T09:15:11.602Z" }, + { url = "https://files.pythonhosted.org/packages/60/18/f63e8378db66b5a99e96c1422c68ba02a4e35de34355b90cf6d169d99ae6/cast_value_rs-0.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b9d799a20d7517974d61d7c4dd54e5d7ef439e726012c087bada31bc644b1535", size = 548885, upload-time = "2026-08-13T09:15:13.18Z" }, + { url = "https://files.pythonhosted.org/packages/98/af/12349007b670b11e16d3be51c29ab2398550b2653dae692a5d788d3dda87/cast_value_rs-0.4.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b9f0f04815efcc47592474e91f61f24810139396696f0690f3d0bf0e6ff3bb4a", size = 590846, upload-time = "2026-08-13T09:15:14.67Z" }, + { url = "https://files.pythonhosted.org/packages/a3/cf/6a39df104923bc397ae58f90e21d1e87edd62d17f24fe3d6777e6c4d3e5f/cast_value_rs-0.4.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e69f81dab0b47c74c1f30c79198c412938b6c41510b8124dbd08fb36d13a8807", size = 665064, upload-time = "2026-08-13T09:15:16.527Z" }, + { url = "https://files.pythonhosted.org/packages/36/df/0a9ac5bae4e1d3b7b4a79795054d822c26bdbc3bedad71fe13e8ce666c4b/cast_value_rs-0.4.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:59e15ec495e8707447180e0111e65e083464da60236edd5c3387efedce3da997", size = 830909, upload-time = "2026-08-13T09:15:18.088Z" }, + { url = "https://files.pythonhosted.org/packages/2f/7d/9e99c969dd76087dbf731667982d8bb6b390d29c8f37c09dd330657b0487/cast_value_rs-0.4.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:f9e787397588fabb28a146a28159150f44e8ef85a25abe364f989044f1b7159d", size = 788217, upload-time = "2026-08-13T09:15:19.706Z" }, + { url = "https://files.pythonhosted.org/packages/21/a9/5d7410d37be26bed1dc740c885a0c7fdb213b93e9b13ac76fb3282aa50ea/cast_value_rs-0.4.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5c66ca6ad21758993830a9f4d24263065727bf767e4524d79ded0c0b61e3da9d", size = 752817, upload-time = "2026-08-13T09:15:21.197Z" }, + { url = "https://files.pythonhosted.org/packages/65/10/9c18cb01104bb211c9b0d9a956fae3f1a40f743c35bbc6763d0114ec36a7/cast_value_rs-0.4.2-cp313-cp313-win_amd64.whl", hash = "sha256:26fe305d5bd35d21c5ee72c5651892895447e175ba3019a24713c565d965c0ef", size = 442025, upload-time = "2026-08-13T09:15:22.575Z" }, + { url = "https://files.pythonhosted.org/packages/64/49/42a0b48a71aca3ebb0abd0948fa9d484723c3562af30a8d6904b874abb2f/cast_value_rs-0.4.2-cp313-cp313-win_arm64.whl", hash = "sha256:9ce6678fc4b1bdc459178225347acd8019f1d22bca1e13ab86cc2a3e4ecb2f46", size = 397871, upload-time = "2026-08-13T09:15:23.906Z" }, + { url = "https://files.pythonhosted.org/packages/be/e9/baf39cd3991962705ffd055fce071e23e7707f62df3fb44af2ffe0e84d11/cast_value_rs-0.4.2-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:cefdcfd4d2b95e3b35fd98b3d3d865be9b3ef1bc1264db3bc1b8c50c5e8ac999", size = 495672, upload-time = "2026-08-13T09:15:25.168Z" }, + { url = "https://files.pythonhosted.org/packages/ed/9f/7ac6bf95d160f3fd89020aa952ffb4a49216b85a3fda02f84bc2c2612a2f/cast_value_rs-0.4.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:cbcec2cfd199c1e404f5bda71b273b4a7470762f4b55c1c21f09d60d2762e339", size = 458480, upload-time = "2026-08-13T09:15:26.647Z" }, + { url = "https://files.pythonhosted.org/packages/65/e5/46c2985ccbae41c8140f04f2acc9080761f10e8d2f8101c46083e632f812/cast_value_rs-0.4.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c224a9b30c2521cd06eac4bb1ac3860f41c902695e6f806344bc039d7a8a1d93", size = 486807, upload-time = "2026-08-13T09:15:28.129Z" }, + { url = "https://files.pythonhosted.org/packages/18/13/97851c45b275fbc9d42b5d5a340fd5ea430525b60c2eacfe6a36399d69ef/cast_value_rs-0.4.2-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1eaa7c3d5fe418a74928f78514f9baeaeb8e31b93db96b1761edd6144f0d2eff", size = 555335, upload-time = "2026-08-13T09:15:29.648Z" }, + { url = "https://files.pythonhosted.org/packages/7f/b3/c84c1e820786ddb062b162112b80e5dfc1b5b54b11125618f38c1e18d075/cast_value_rs-0.4.2-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3bddec46b36f29964c8d4bbe82b8270575fbe1c0fb41c404bb3da1778f390a24", size = 650347, upload-time = "2026-08-13T09:15:31.044Z" }, + { url = "https://files.pythonhosted.org/packages/60/38/52b4cc31570384e0286e28a03164a357d53a8aba7421ef83e500843d5449/cast_value_rs-0.4.2-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ab3fd77144d26e2da2a113f862c05ea1cf465df347daf5deb6cf1689253fddfa", size = 561498, upload-time = "2026-08-13T09:15:32.485Z" }, + { url = "https://files.pythonhosted.org/packages/41/c8/313e1d016b0adfccd1ead2bb28d2c94313ab62534bd6e11db19a480d3b55/cast_value_rs-0.4.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4affe8668a2f17764ed978c2dddb2b49554f36a71389e6928a8a5523c1a4173", size = 548676, upload-time = "2026-08-13T09:15:33.912Z" }, + { url = "https://files.pythonhosted.org/packages/81/8b/a11f8e514598ebfc084507b0db390ecbdc6bfcffbf91ae666e0de93e6c25/cast_value_rs-0.4.2-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a67316b00ca01a78865d222badef2b1cb6c60ad5ebd360bf4fa3b224e87b8ffa", size = 590803, upload-time = "2026-08-13T09:15:35.384Z" }, + { url = "https://files.pythonhosted.org/packages/94/1e/ed86da6fe69eff312cc83e348cf4715d4168ab2699783febd24bfd477cd8/cast_value_rs-0.4.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9946054c77d7c5df579e9e99ebebd4d8a220cb04a6af1b6467112dfe07eee72d", size = 664118, upload-time = "2026-08-13T09:15:36.797Z" }, + { url = "https://files.pythonhosted.org/packages/0b/01/58a3eadff1233bd98d5809e2f6b5dc6d1b8c4c770664145f57fd0bdce756/cast_value_rs-0.4.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:95b064458233a7ef0525481eccfd2d37e86620d877ab1535ae809d37355cf131", size = 830686, upload-time = "2026-08-13T09:15:38.645Z" }, + { url = "https://files.pythonhosted.org/packages/e6/40/a234d9d06013a0bee08f662ab083b3a55decfa2dbb315094fdf06693d425/cast_value_rs-0.4.2-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:d7de068a1dcc65d1aaf4e93228198b588776bd25b62ef42478ab7efe5245a6f3", size = 787835, upload-time = "2026-08-13T09:15:40.078Z" }, + { url = "https://files.pythonhosted.org/packages/d6/72/93f906345d03972de52e3e74dd4ed12b56aab53bec85cc96020690ba6dbe/cast_value_rs-0.4.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ae0cbdd44290a74e34519eb990b33bf0f8e96f0fde95ffc799913ff1aab27719", size = 753039, upload-time = "2026-08-13T09:15:41.702Z" }, + { url = "https://files.pythonhosted.org/packages/e3/a5/47b6db4f68da086db3f3768775f545b9b7f660cab8f61039c91de1f813c4/cast_value_rs-0.4.2-cp314-cp314-win32.whl", hash = "sha256:d438517530d3a8d6bc810ab6dee831c48b45287435513fea1b0476b5d4fda07d", size = 387092, upload-time = "2026-08-13T09:15:43.218Z" }, + { url = "https://files.pythonhosted.org/packages/d3/9c/5f71a5e94875bb999646227a583792dbbe9a2b257df0d961e8a2da879f9e/cast_value_rs-0.4.2-cp314-cp314-win_amd64.whl", hash = "sha256:7e7bb9faa4820b7eb0d99074fd61efff3a7392e72b6abe4b41c9d6b6d14fe457", size = 442126, upload-time = "2026-08-13T09:15:44.623Z" }, + { url = "https://files.pythonhosted.org/packages/95/1c/8e7546a044da8e92eafbb12594169301cc94e2a071fd3e34204595d0a05f/cast_value_rs-0.4.2-cp314-cp314-win_arm64.whl", hash = "sha256:1f57e762a06102d61e940548a6ab841e05ad1f51f1c4e2aa26bc27a8c59a5abc", size = 398200, upload-time = "2026-08-13T09:15:46.117Z" }, + { url = "https://files.pythonhosted.org/packages/a0/09/527646deeb622e5a597e4271e9e06d9d7cd24d64de77b8cb4ce250128c18/cast_value_rs-0.4.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:230f6440db74d2d11e513060d0e72aa3f897546465bc778d30aaeac90f8e733e", size = 485197, upload-time = "2026-08-13T09:15:47.622Z" }, + { url = "https://files.pythonhosted.org/packages/b9/79/aaa713cb151a902439b670a4774ea76d0a5dadf1f03954f6a34af2a6cb1e/cast_value_rs-0.4.2-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:37538170dc1fedbfd62dd56670e443b881474e7eda7f583a3c989c83a9ff15fc", size = 538669, upload-time = "2026-08-13T09:15:49.148Z" }, + { url = "https://files.pythonhosted.org/packages/d3/b1/2cf4f4f13f74caaa4dab4ddf4924fdeeffb39920d5ec30a80112aa041efa/cast_value_rs-0.4.2-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86d00b9cef0d38d0c5631ba63270c38c5d7c85aa87c609644f204919f939f0c9", size = 649341, upload-time = "2026-08-13T09:15:50.614Z" }, + { url = "https://files.pythonhosted.org/packages/39/8b/1faa6b27cda3dd793635c7945118e49188b6714d6bf23bb072efd718e467/cast_value_rs-0.4.2-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:89434eebb7a12f66e99382e08c32648f055e24d9fce66274adef6620af2aebbd", size = 555253, upload-time = "2026-08-13T09:15:52.252Z" }, + { url = "https://files.pythonhosted.org/packages/8b/c2/d31f177025b51a3fda70c5888b92f5fd30ec53bc2df2c046fc9a2717cd36/cast_value_rs-0.4.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:704171aec75f417f5a70a3eb5f107fbfc79183620093c9d9074290920a5981f1", size = 547964, upload-time = "2026-08-13T09:15:53.669Z" }, + { url = "https://files.pythonhosted.org/packages/64/99/521c2d6347ca39deef237909dfee61c6d2cb806dcc20d74636e209bc646e/cast_value_rs-0.4.2-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2add2599d299436ec161661a8e119a69742c763a0936e542db92b1ce9d6e0c04", size = 574778, upload-time = "2026-08-13T09:15:55.479Z" }, + { url = "https://files.pythonhosted.org/packages/f0/70/35c7cb37839454aeb93b9576b42daebd8249dd59e3834cd1be020b4b0660/cast_value_rs-0.4.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:da5df79a926bdcc1f5494612f621027970a9702eb49d556068025166d4c0ace2", size = 662461, upload-time = "2026-08-13T09:15:56.97Z" }, + { url = "https://files.pythonhosted.org/packages/24/4f/a71bfaea1286bd12cc912733d650bd89a07c4430ee715202551c6e3eb0b0/cast_value_rs-0.4.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:5552e3c80d43de7a8a821793cb57da0dd3720a377051a5bf86bcabe094e87777", size = 814743, upload-time = "2026-08-13T09:15:58.652Z" }, + { url = "https://files.pythonhosted.org/packages/94/a3/b04e0f42dafeae30604abca079cce303ebb69ba24f3c4debbf211ecc781c/cast_value_rs-0.4.2-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:73978c6dd2ce45a05a59ec7090df8b3f2a579ee86db9b1c7df21ede17f32189e", size = 782340, upload-time = "2026-08-13T09:16:00.135Z" }, + { url = "https://files.pythonhosted.org/packages/3a/6c/913de75054092de796509dc04b92fc6ac1bf83dc86901f1f482667dead16/cast_value_rs-0.4.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:45d630592afb18880d4df0d7afb28b8cfc0ba6aa742d8db115f616df284b453a", size = 754068, upload-time = "2026-08-13T09:16:01.572Z" }, ] [[package]] @@ -3588,7 +3582,7 @@ test = [ [package.metadata] requires-dist = [ - { name = "cast-value-rs", marker = "extra == 'cast-value-rs'" }, + { name = "cast-value-rs", marker = "extra == 'cast-value-rs'", specifier = ">=0.4.2" }, { name = "cupy-cuda12x", marker = "sys_platform != 'darwin' and extra == 'gpu'" }, { name = "donfig", specifier = ">=0.8" }, { name = "fsspec", marker = "extra == 'remote'", specifier = ">=2023.10.0" }, From b1d413281ef3aebe9034b32b92db3c19dc4875f9 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Fri, 14 Aug 2026 12:17:09 +0200 Subject: [PATCH 55/61] fix(zarr-metadata): make JSONValue's array arm covariant (#4264) * fix(zarr-metadata): make JSONValue's array arm covariant `list["JSONValue"] | tuple["JSONValue", ...]` is invariant in the element type, so a value typed with any narrower element -- a `list[str]` field on a TypedDict, a `Sequence[float]` -- was not assignable to `JSONValue`, and a TypedDict carrying such fields was not assignable to `Mapping[str, JSONValue]`. pyright's diagnostic for the failure suggests the fix verbatim: "Consider switching from list to Sequence which is covariant." The array arm is now `Sequence["JSONValue"]`. The docstring records the deliberate type-level cost (`Sequence` admits `str`/`bytes`; runtime narrowing must exclude them regardless of the alias's spelling). Found while aliasing zarr-cm's JsonValue to this type: the two aliases are structurally identical except for this arm, and with it changed, pyright unifies them across the package boundary. Assisted-by: ClaudeCode:claude-opus-5 * Rename 295.bugfix.md to 4264.bugfix.md --- packages/zarr-metadata/changes/4264.bugfix.md | 9 +++++++ .../src/zarr_metadata/_common.py | 24 ++++++++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 packages/zarr-metadata/changes/4264.bugfix.md diff --git a/packages/zarr-metadata/changes/4264.bugfix.md b/packages/zarr-metadata/changes/4264.bugfix.md new file mode 100644 index 0000000000..466bf5941d --- /dev/null +++ b/packages/zarr-metadata/changes/4264.bugfix.md @@ -0,0 +1,9 @@ +`JSONValue`'s array arm is now the covariant `Sequence["JSONValue"]` rather +than the invariant `list["JSONValue"] | tuple["JSONValue", ...]`. Values typed +with a narrower element type — a `list[str]` field on a TypedDict, a +`Sequence[float]` — now count as JSON values, and TypedDicts whose fields +carry precise types are now assignable to `Mapping[str, JSONValue]`. +Type-level cost, accepted deliberately: `Sequence` says nothing about the +concrete container and admits `str`/`bytes`, so runtime code narrowing a JSON +array must exclude `str`/`bytes`/`bytearray` — as it already had to, since +`str` was always a union arm. diff --git a/packages/zarr-metadata/src/zarr_metadata/_common.py b/packages/zarr-metadata/src/zarr_metadata/_common.py index f3259f7b73..08c143107f 100644 --- a/packages/zarr-metadata/src/zarr_metadata/_common.py +++ b/packages/zarr-metadata/src/zarr_metadata/_common.py @@ -6,21 +6,14 @@ `zarr_metadata.v3.data_type`. """ -from collections.abc import Mapping +from collections.abc import Mapping, Sequence from typing import NotRequired from typing_extensions import TypeAliasType, TypedDict JSONValue = TypeAliasType( "JSONValue", - int - | float - | bool - | str - | list["JSONValue"] - | tuple["JSONValue", ...] - | Mapping[str, "JSONValue"] - | None, + int | float | bool | str | Sequence["JSONValue"] | Mapping[str, "JSONValue"] | None, ) """A recursive type alias for JSON-encodable values. @@ -28,6 +21,19 @@ self-reference is a named recursion point that pydantic can resolve when building a `TypeAdapter`; a bare recursive `TypeAlias` raises `PydanticUserError`/`RecursionError` at validation time. + +The array arm is the covariant `Sequence` rather than the invariant +`list["JSONValue"] | tuple["JSONValue", ...]`, so values typed with a +*narrower* element type still count as JSON values: a `list[str]` field on a +TypedDict is assignable to `JSONValue` under `Sequence` but not under +`list[JSONValue]` (`list` is invariant in its element type, and pyright's +diagnostic for that failure suggests exactly this change). This is what lets +downstream TypedDicts give their fields precise types (`Sequence[str]`, +`list[int]`, ...) while remaining assignable to `Mapping[str, JSONValue]`. +The type-level cost, accepted deliberately: `Sequence` says nothing about the +concrete container, and it admits `str`/`bytes` (`str` was already a union +arm); runtime code narrowing a JSON array must exclude `str`/`bytes`/ +`bytearray` regardless of how this alias is spelled. """ From f4a239c72e0548db5faedfbe1a36cfea6e837b25 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Fri, 14 Aug 2026 14:40:45 +0200 Subject: [PATCH 56/61] chore(zarr-metadata): build 0.5.0 changelog (#4266) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(zarr-metadata): note the sdist allowlist, and let misc entries speak #4248 gave this package's sdist an explicit allowlist and merged without a news fragment, so a user-visible packaging change was about to miss the 0.5.0 notes. Add one. Filing it as `misc` exposed that towncrier's built-in `misc` type sets `showcontent = false`: the entry would render as a bare PR link, which tells a reader nothing. Restate all five types the `changes/README.md` menu offers — declaring any type replaces the built-in set — as the defaults verbatim except for `misc`, which now shows its content. A change worth a release note is worth a sentence, whatever its category. Assisted-by: ClaudeCode:claude-opus-5 * chore(zarr-metadata): build 0.5.0 changelog Consume the pending news fragments — #4232's constant-naming-grammar removal note, #4264's note widening `JSONValue`'s array arm to the covariant `Sequence`, and #4248's sdist allowlist — into CHANGELOG.md via towncrier for the zarr_metadata-v0.5.0 release. Minor, not patch: the `JSONValue` widening changes a published type's meaning for every consumer that annotates against it, and #4232 removes the old version-last constant spellings outright. Assisted-by: ClaudeCode:claude-opus-5 --- packages/zarr-metadata/CHANGELOG.md | 90 +++++++++++++++++++ .../zarr-metadata/changes/4232.removal.md | 63 ------------- packages/zarr-metadata/changes/4264.bugfix.md | 9 -- packages/zarr-metadata/pyproject.toml | 30 +++++++ 4 files changed, 120 insertions(+), 72 deletions(-) delete mode 100644 packages/zarr-metadata/changes/4232.removal.md delete mode 100644 packages/zarr-metadata/changes/4264.bugfix.md diff --git a/packages/zarr-metadata/CHANGELOG.md b/packages/zarr-metadata/CHANGELOG.md index ac4ad3535a..c1e9f81a61 100644 --- a/packages/zarr-metadata/CHANGELOG.md +++ b/packages/zarr-metadata/CHANGELOG.md @@ -2,6 +2,96 @@ +## 0.5.0 (2026-08-14) + +### Bugfixes + +- `JSONValue`'s array arm is now the covariant `Sequence["JSONValue"]` rather + than the invariant `list["JSONValue"] | tuple["JSONValue", ...]`. Values typed + with a narrower element type — a `list[str]` field on a TypedDict, a + `Sequence[float]` — now count as JSON values, and TypedDicts whose fields + carry precise types are now assignable to `Mapping[str, JSONValue]`. + Type-level cost, accepted deliberately: `Sequence` says nothing about the + concrete container and admits `str`/`bytes`, so runtime code narrowing a JSON + array must exclude `str`/`bytes`/`bytearray` — as it already had to, since + `str` was always a union arm. ([#4264](https://github.com/zarr-developers/zarr-python/pull/4264)) + +### Deprecations and Removals + +- Unified the naming grammar for SCREAMING_SNAKE constants with the one used for + type names. A constant's name is now a purely syntactic transformation of the + name of the `Literal` type it manifests, so the format version is spelled + `ZARR_V2`/`ZARR_V3` and comes first, matching the `ZarrV2`/`ZarrV3` prefix on + the corresponding type: + + - `ARRAY_METADATA_STORE_KEY_V2` → `ZARR_V2_ARRAY_METADATA_STORE_KEY` + - `ARRAY_METADATA_STORE_KEY_V3` → `ZARR_V3_ARRAY_METADATA_STORE_KEY` + - `ATTRIBUTES_STORE_KEY_V2` → `ZARR_V2_ATTRIBUTES_STORE_KEY` + - `GROUP_METADATA_STORE_KEY_V2` → `ZARR_V2_GROUP_METADATA_STORE_KEY` + - `GROUP_METADATA_STORE_KEY_V3` → `ZARR_V3_GROUP_METADATA_STORE_KEY` + - `CONSOLIDATED_METADATA_STORE_KEY_V2` → `ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY` + - `ARRAY_ORDER_V2` → `ZARR_V2_ARRAY_ORDER` + - `ARRAY_DIMENSION_SEPARATOR_V2` → `ZARR_V2_ARRAY_DIMENSION_SEPARATOR` + - `CONSOLIDATED_METADATA_KEY_V3` → `ZARR_V3_CONSOLIDATED_METADATA_KEY` + + The old names are removed, not aliased. This supersedes the 0.4.0 convention + under which type names put the format version first while constants put it + last: every constant that manifests a `Literal` type now follows the same rule + as that type. + + The last of those is the one rename the syntactic rule does not force: + `ZARR_V3_CONSOLIDATED_METADATA_KEY` manifests no `Literal` type, so it is + outside the rule and was renamed for consistency with its siblings. + + Digit runs stay glued to the token they follow, so spec vocabulary is + preserved: `Uint8DataTypeName` pairs with `UINT8_DATA_TYPE_NAME` (not + `UINT_8_...`) and `Crc32cCodecName` with `CRC32C_CODEC_NAME`. No dtype, codec, + chunk-grid, or chunk-key-encoding constant changed name. + + Constants that do not manifest a `Literal` type are outside the rule and are + unchanged: the `*_METADATA_*_KEYS_V2`/`_V3` key sets, the + `CANONICAL_*_HEX_FLOAT*` bit patterns, and `UNSET`. The key sets keep the + version-last spelling, so `zarr_metadata.model` exports both + `ARRAY_METADATA_REQUIRED_KEYS_V2` and `ZARR_V2_ARRAY_METADATA_STORE_KEY`. They + name validation policy rather than a spec document, have no paired type to + derive from, and renaming them would be a second breaking change buying only + cosmetic consistency — so it is deliberately deferred. + + `tests/test_public_api.py::test_constant_names_derive_from_their_type_names` + derives every constant name from the type it manifests and asserts they match, + so the two grammars cannot diverge again. + + Store keys also moved to the modules that describe the documents they name, + matching the package's layering (the `v2`/`v3` modules describe the specs; the + `model` layer is built on top of them). `ZARR_V2_ATTRIBUTES_STORE_KEY` now + lives in `zarr_metadata.v2.attributes` beside the `.zattrs` type it names, + rather than in the array model; the other five moved likewise, and + `ZarrV2AttributesStoreKey` is no longer an array-specific concept. + `zarr_metadata.model` re-exports all six, so + `from zarr_metadata.model import ZARR_V2_ARRAY_METADATA_STORE_KEY` is + unaffected. + + `CONSOLIDATED_METADATA_KEY_V3` moved to `zarr_metadata.v3.consolidated` and was + renamed to `ZARR_V3_CONSOLIDATED_METADATA_KEY` for consistency. It is not a + store key: unlike v2's `.zmetadata` file, v3 consolidated metadata is embedded + as an extension field inside the group's own `zarr.json`. + + All seven keys and the six store-key `Literal` aliases are now also exported + from the top-level `zarr_metadata` namespace, alongside the document types and + the rest of the spec vocabulary, so `from zarr_metadata import + ZARR_V2_ARRAY_METADATA_STORE_KEY` works. The model layer's validators, parsers, + type guards, and metadata key sets remain `zarr_metadata.model` imports. + + ([#4232](https://github.com/zarr-developers/zarr-python/pull/4232)) + +### Misc + +- The source distribution now ships an explicit allowlist (`/src`, `/tests`, + `/docs`, `/mkdocs.yml`, `/justfile`, `/CHANGELOG.md`) rather than whatever + happens to sit in the package directory, so an sdist both tests and documents + itself and cannot pick up scratch files from the tree it was built in. ([#4248](https://github.com/zarr-developers/zarr-python/pull/4248)) + + ## 0.4.0 (2026-07-29) ### Features diff --git a/packages/zarr-metadata/changes/4232.removal.md b/packages/zarr-metadata/changes/4232.removal.md deleted file mode 100644 index 73b2a18666..0000000000 --- a/packages/zarr-metadata/changes/4232.removal.md +++ /dev/null @@ -1,63 +0,0 @@ -Unified the naming grammar for SCREAMING_SNAKE constants with the one used for -type names. A constant's name is now a purely syntactic transformation of the -name of the `Literal` type it manifests, so the format version is spelled -`ZARR_V2`/`ZARR_V3` and comes first, matching the `ZarrV2`/`ZarrV3` prefix on -the corresponding type: - -- `ARRAY_METADATA_STORE_KEY_V2` → `ZARR_V2_ARRAY_METADATA_STORE_KEY` -- `ARRAY_METADATA_STORE_KEY_V3` → `ZARR_V3_ARRAY_METADATA_STORE_KEY` -- `ATTRIBUTES_STORE_KEY_V2` → `ZARR_V2_ATTRIBUTES_STORE_KEY` -- `GROUP_METADATA_STORE_KEY_V2` → `ZARR_V2_GROUP_METADATA_STORE_KEY` -- `GROUP_METADATA_STORE_KEY_V3` → `ZARR_V3_GROUP_METADATA_STORE_KEY` -- `CONSOLIDATED_METADATA_STORE_KEY_V2` → `ZARR_V2_CONSOLIDATED_METADATA_STORE_KEY` -- `ARRAY_ORDER_V2` → `ZARR_V2_ARRAY_ORDER` -- `ARRAY_DIMENSION_SEPARATOR_V2` → `ZARR_V2_ARRAY_DIMENSION_SEPARATOR` -- `CONSOLIDATED_METADATA_KEY_V3` → `ZARR_V3_CONSOLIDATED_METADATA_KEY` - -The old names are removed, not aliased. This supersedes the 0.4.0 convention -under which type names put the format version first while constants put it -last: every constant that manifests a `Literal` type now follows the same rule -as that type. - -The last of those is the one rename the syntactic rule does not force: -`ZARR_V3_CONSOLIDATED_METADATA_KEY` manifests no `Literal` type, so it is -outside the rule and was renamed for consistency with its siblings. - -Digit runs stay glued to the token they follow, so spec vocabulary is -preserved: `Uint8DataTypeName` pairs with `UINT8_DATA_TYPE_NAME` (not -`UINT_8_...`) and `Crc32cCodecName` with `CRC32C_CODEC_NAME`. No dtype, codec, -chunk-grid, or chunk-key-encoding constant changed name. - -Constants that do not manifest a `Literal` type are outside the rule and are -unchanged: the `*_METADATA_*_KEYS_V2`/`_V3` key sets, the -`CANONICAL_*_HEX_FLOAT*` bit patterns, and `UNSET`. The key sets keep the -version-last spelling, so `zarr_metadata.model` exports both -`ARRAY_METADATA_REQUIRED_KEYS_V2` and `ZARR_V2_ARRAY_METADATA_STORE_KEY`. They -name validation policy rather than a spec document, have no paired type to -derive from, and renaming them would be a second breaking change buying only -cosmetic consistency — so it is deliberately deferred. - -`tests/test_public_api.py::test_constant_names_derive_from_their_type_names` -derives every constant name from the type it manifests and asserts they match, -so the two grammars cannot diverge again. - -Store keys also moved to the modules that describe the documents they name, -matching the package's layering (the `v2`/`v3` modules describe the specs; the -`model` layer is built on top of them). `ZARR_V2_ATTRIBUTES_STORE_KEY` now -lives in `zarr_metadata.v2.attributes` beside the `.zattrs` type it names, -rather than in the array model; the other five moved likewise, and -`ZarrV2AttributesStoreKey` is no longer an array-specific concept. -`zarr_metadata.model` re-exports all six, so -`from zarr_metadata.model import ZARR_V2_ARRAY_METADATA_STORE_KEY` is -unaffected. - -`CONSOLIDATED_METADATA_KEY_V3` moved to `zarr_metadata.v3.consolidated` and was -renamed to `ZARR_V3_CONSOLIDATED_METADATA_KEY` for consistency. It is not a -store key: unlike v2's `.zmetadata` file, v3 consolidated metadata is embedded -as an extension field inside the group's own `zarr.json`. - -All seven keys and the six store-key `Literal` aliases are now also exported -from the top-level `zarr_metadata` namespace, alongside the document types and -the rest of the spec vocabulary, so `from zarr_metadata import -ZARR_V2_ARRAY_METADATA_STORE_KEY` works. The model layer's validators, parsers, -type guards, and metadata key sets remain `zarr_metadata.model` imports. diff --git a/packages/zarr-metadata/changes/4264.bugfix.md b/packages/zarr-metadata/changes/4264.bugfix.md deleted file mode 100644 index 466bf5941d..0000000000 --- a/packages/zarr-metadata/changes/4264.bugfix.md +++ /dev/null @@ -1,9 +0,0 @@ -`JSONValue`'s array arm is now the covariant `Sequence["JSONValue"]` rather -than the invariant `list["JSONValue"] | tuple["JSONValue", ...]`. Values typed -with a narrower element type — a `list[str]` field on a TypedDict, a -`Sequence[float]` — now count as JSON values, and TypedDicts whose fields -carry precise types are now assignable to `Mapping[str, JSONValue]`. -Type-level cost, accepted deliberately: `Sequence` says nothing about the -concrete container and admits `str`/`bytes`, so runtime code narrowing a JSON -array must exclude `str`/`bytes`/`bytearray` — as it already had to, since -`str` was always a union arm. diff --git a/packages/zarr-metadata/pyproject.toml b/packages/zarr-metadata/pyproject.toml index 0df3385dc7..a58d3579a1 100644 --- a/packages/zarr-metadata/pyproject.toml +++ b/packages/zarr-metadata/pyproject.toml @@ -137,3 +137,33 @@ underlines = ["", "", ""] title_format = "## {version} ({project_date})" issue_format = "[#{issue}](https://github.com/zarr-developers/zarr-python/pull/{issue})" start_string = "\n" + +# Declaring any type replaces towncrier's built-in set, so all five the +# `changes/README.md` menu offers are restated here. They are the defaults +# verbatim except for `misc`, whose `showcontent` towncrier defaults to false: +# a `misc` entry would render as a bare PR link, which tells a reader nothing. +# A change worth a release note is worth a sentence, whatever its category. +[[tool.towncrier.type]] +directory = "feature" +name = "Features" +showcontent = true + +[[tool.towncrier.type]] +directory = "bugfix" +name = "Bugfixes" +showcontent = true + +[[tool.towncrier.type]] +directory = "doc" +name = "Improved Documentation" +showcontent = true + +[[tool.towncrier.type]] +directory = "removal" +name = "Deprecations and Removals" +showcontent = true + +[[tool.towncrier.type]] +directory = "misc" +name = "Misc" +showcontent = true From 743169953b6fca7edaa08fe7ce0814989b6ea51c Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Fri, 14 Aug 2026 21:29:41 +0200 Subject: [PATCH 57/61] docs: add roadmap page outlining future plans (#4149) --- changes/4149.doc.md | 1 + docs/roadmap.md | 189 ++++++++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 2 +- 3 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 changes/4149.doc.md create mode 100644 docs/roadmap.md diff --git a/changes/4149.doc.md b/changes/4149.doc.md new file mode 100644 index 0000000000..8a473acac9 --- /dev/null +++ b/changes/4149.doc.md @@ -0,0 +1 @@ +Added a Roadmap page to the documentation outlining future plans and intended changes to the library. diff --git a/docs/roadmap.md b/docs/roadmap.md new file mode 100644 index 0000000000..4b5dbc4599 --- /dev/null +++ b/docs/roadmap.md @@ -0,0 +1,189 @@ +# Roadmap + +This page describes where Zarr-Python is headed: the goals for the next major +cycle of work, the changes we intend to make, and how those changes will be +released. It is a living document; discussion and counter-proposals are welcome +on the +[Zarr-Python issue tracker](https://github.com/zarr-developers/zarr-python/issues). + +*The history of this roadmap, including the detailed technical proposals it +was distilled from, can be traced in the +[zarr-python-planning](https://github.com/zarr-developers/zarr-python-planning) +repository.* + +!!! note + + This roadmap reflects the current thinking of the core developers. It is a + statement of direction, not a schedule. We don't know how long these changes + will take, only that we are committed to moving the project in the direction outlined + here. + +## Where we are + +The [3.0 release](https://github.com/zarr-developers/zarr-python/releases/tag/v3.0.0) +was a total redesign of the library's internals, with three goals: full support +for the Zarr V2 and V3 storage formats, storage APIs that are ergonomic for high-latency +storage (such as cloud storage), and backwards compatibility with Zarr-Python 2.x where +possible. Those goals were largely achieved! Going by the content of issues and pull requests +submitted to the library, few users are grappling with 2.x → 3.x migration issues. Instead, we see +users asking for things like better APIs, where "better" usually means faster. + +The 3.x redesign was carried out under hard backwards-compatibility +constraints, and it inherited many structural patterns from the 2.x +implementation it replaced. The library has never had a release cycle whose +primary goal was the *shape* of the internals. The next body of work — which we +call **"v4"** — is that overdue investment. We think iterating on the internals of +the library will make it *much* easier to bring faster, more expressive APIs to Zarr-Python +users. + +## Goals + +If the 3.0 goals could be sloganized as "migrate to Zarr V3, and improve cloud +storage support", the slogan for the v4 goals is: +**"a frictionless Zarr-based Python ecosystem for chunked arrays"**. Zarr-Python +should be *foundational* for the growing number of Python packages that work +with data in the Zarr format. Concretely, that means pushing in these +directions: + +- Deliver excellent performance, out of the box, while retaining maintainability. +- Make Zarr-Python APIs ergonomic and useful for developers. +- Expand our scope to cover vital quality-of-life routines like data copying, + rechunking, and the like. +- Ease the growth of Python tools across all levels of the Zarr stack. +- Accelerate the implementation of new codecs, chunk grids, chunk key + encodings, etc. + +An important design input: [`zarrs`](https://github.com/zarrs/zarrs) (Rust) and +[TensorStore](https://github.com/google/tensorstore) (C++) are two independent +Zarr implementations that use architectural patterns we want to learn from. +We see them as complementary rather than competitive. + +!!! note + + Many of the features in this roadmap will not require breaking public 3.x APIs. We can and will + ship those features in 3.x releases; at the same time, we consider it clarifying to frame the + coherent development direction as vectored at a 4.0 milestone. + +## The Zarr stack + +Different applications need different levels of Zarr support: a convention +validator only needs to read metadata documents; a visualization tool may only +need read-only array access; other tools need everything. We think of this as a +"Zarr stack", from most abstract to most concrete: + +1. **Conventions** — application and/or domain-specific schemas built on top of Zarr (OME-NGFF, + GeoZarr, anndata-zarr, multiscales). +2. **Groups** — Zarr hierarchies, traversal, group-level attributes. +3. **Arrays** — the user-facing array object, plus indexing and slicing. +4. **Chunk decoding** — the codec pipeline. +5. **Chunk addressing** — chunk grids and key encodings that map array + coordinates to store keys. +6. **Stores** — the key-value layer. +7. **Metadata** — pure data documents describing arrays and groups. + +Today, Zarr-Python is a monolith that serves every level: a consumer who only +needs metadata handling has to install the full dependency footprint of the +whole library, and a faster chunk-decoding implementation cannot plug in +without re-implementing the layers above it. The v4 direction is to re-shape +Zarr-Python around the stack, so that each level is something you can depend +on, conform to, or replace, without buying every other level. + +We plan to "stackify" Zarr-Python by spinning core functionality out into separate Python packages, e.g. `zarr-metadata`, `zarr-indexing`, `zarr-storage`, +`zarr-codec`, `zarr-dtype`, each with narrow scope, all composed in the `zarr` package. The Rust `zarrs` library +successfully uses a structure like this, and we are keen to share the benefits of a more modular, maintainable codebase. Two of these subpackages, +[`zarr-metadata`](https://zarr.readthedocs.io/projects/zarr-metadata/en/latest/) and [`zarr-indexing`](https://zarr.readthedocs.io/projects/zarr-indexing/en/latest/), are already +published. + +## What we intend to change + +The following section details how we want to evolve the internal logic that drives Zarr-Python. + +### Foundation: swappable backends + +We propose to refactor Zarr-Python internals around a *swappable engine* — a protocol, or protocols, +that define the core routines a Zarr implementation must support. Zarr-Python becomes one user-facing +API that can be driven by multiple backends, including externally defined backends. We think this will allow users on many different platforms to get the best performance for their particular environment while retaining a familiar API. + +#### Rust bindings + +We want a Python backend (i.e., the status quo), but also a Rust-based backend, via bindings to the +[`zarrs`](https://docs.rs/zarrs/latest/zarrs/) crate. The [zarrs-python](https://zarrs-python.readthedocs.io/en/latest/) project demonstrates that +bridging `zarrs` and Zarr-Python buys a *lot* of performance in the specific case of chunk encoding. But zarrs-python is constrained today by limited +modularity in Zarr-Python internals. Refactoring our internals around swappable backends should address this limitation. + +Any Python package that interfaces with `zarrs` will need Pythonic bindings to the Rust library. So we are *very* excited about the [zarrista](https://developmentseed.org/zarrista/latest/) package, which aims to provide complete Python bindings for `zarrs`. + +#### Sync / Async partitioning + +Internally we will branch over two kinds of backends: synchronous and asynchronous. The synchronous backend is suitable for arrays and groups persisted to low-latency storage like in-memory stores or local file systems, where async scheduling is pure friction. The asynchronous backend will use Python's `async` support and will provide concurrent APIs where it helps: for arrays and groups persisted to high-latency storage. + +### Lazy indexing + +The Zarr-Python Array API was initially designed to mirror NumPy, with eager +array indexing syntax. `Array.__getitem__` performs IO eagerly and returns a NumPy array. +That was helpful to the dominant use-case at the time of its creation, but it +means deferred IO and computation currently require an external library +such as Dask. It means there is no built-in support for representing multi-step +reads as a single deferred plan. Further, it means that every chained +selection round-trips to storage independently. + +We can fix this by introducing an API for lazy indexing. Under this model, an array indexing operation +like `array[::2]` desugars to a declarative state like `(array, selection)`. Chained selections like +`array[10:100][::2]` are fused immediately, and we defer actual IO for the time when the result of +indexing is needed. [TensorStore](https://google.github.io/tensorstore/) is an excellent role model +for Zarr-Python here, and we can deliver this functionality without breaking ordinary indexing behavior. +See this [discussion](https://github.com/zarr-developers/zarr-python/discussions/1603) for more +background. + +### Data types + +First-class support for ML-specific dtypes — `bfloat16`, the `float8` +variants, packed `int4`/`uint4` — via +[`ml_dtypes`](https://github.com/jax-ml/ml_dtypes). These data types have specifications written up in `zarr-extensions`, but there's no simple to get them integrated in Zarr-Python today. + +### Device-agnostic IO + +Make Zarr-Python's IO surfaces device-agnostic rather than adding GPU support +as a bolted-on feature: stores and codecs grow APIs for writing into a +caller-provided buffer (`read_into`, `decode_into`), and the `Array` facade +returns array-like objects in the user's chosen Array API namespace. GPU +support falls out once the assumption of CPU destinations is removed, and CPU +paths get faster too, because pre-allocated output buffers eliminate per-chunk +allocation. + +### Configuration, registries, and plugins + +Move configuration from "global mutable state read implicitly" to "typed data +passed explicitly": a typed config object replacing the untyped global `donfig` +dict, array-scoped runtime config passed at open time, a registry redesign that +addresses implementations by stable identity and resolves plugin name-conflicts +deliberately, and named profiles replacing global mutators. + +### Coordinated and distributed writes + +This area is actually an unfinished aspect of the 2.x → 3.0 migration: Zarr-Python 2.x supported +synchronization logic via file-based locks, and we have not implemented equivalent functionality in +3.x. We don't have *concrete* plans for closing this gap. Re-implementing simple object-based locking, for +backends that support it, is a direct solution we should consider. But a transactional storage model, +where a sequence of basic storage operations like reading and writing could be submitted in a batch and +executed serially, with rollbacks under failure, is also quite appealing. +As with array indexing, TensorStore is the trailblazer here, and we can learn from its example. + +We can also avoid the need for synchronization mechanisms entirely with better planning. +Many users of the 2.x synchronization tooling needed to simply write values from one chunked source +to another, without worrying about chunk alignment. This can be addressed e.g. by creating a write +plan that partitions the input chunks into batches within which writes cannot race. + +## How to get involved + +- **Discuss the plans.** Comments and counter-proposals on any of the themes + above are welcome on the + [issue tracker](https://github.com/zarr-developers/zarr-python/issues) and in + the [developer chat](https://ossci.zulipchat.com/). +- **Review in-flight work.** The `IndexTransform` algebra that lazy indexing is + built on is in review at + [#3906](https://github.com/zarr-developers/zarr-python/pull/3906). +- **Weigh in as a downstream maintainer.** If your project's use of + Zarr-Python would be affected by the codec API rewrite, the stores rewrite, + or the lazy-indexing work, the planning phase is the time to surface + workloads or patterns that don't fit. diff --git a/mkdocs.yml b/mkdocs.yml index 1fde8d9fe3..4d06701a87 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -102,6 +102,7 @@ nav: - 'zarr-metadata ↪': https://zarr.readthedocs.io/projects/zarr-metadata/ - 'zarr-indexing ↪': https://zarr.readthedocs.io/projects/zarr-indexing/ - release-notes.md + - roadmap.md - contributing.md - Blog: - blog/index.md @@ -221,7 +222,6 @@ plugins: 'search.html.md': 'index.md' 'tutorial.md': 'user-guide/installation.md' 'getting-started.md': 'quick-start.md' - 'roadmap.md': 'https://zarr.readthedocs.io/en/v3.0.8/developers/roadmap.html' 'installation.md': 'user-guide/installation.md' 'release.md': 'release-notes.md' 'about.html.md': 'index.md' From ce10c0b9ae89aa306a6ba0f4284c40c5488ec5f8 Mon Sep 17 00:00:00 2001 From: Davis Bennett Date: Mon, 17 Aug 2026 14:41:27 +0200 Subject: [PATCH 58/61] fix: accept universal-pathlib UPath as a StoreLike value (#4265) * chore(deps): bump the actions group across 1 directory with 8 updates (#176) Bumps the actions group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi) | `0.9.5` | `0.9.6` | | [codecov/codecov-action](https://github.com/codecov/codecov-action) | `6.0.0` | `6.0.1` | | [github/issue-metrics](https://github.com/github/issue-metrics) | `4.2.2` | `4.2.7` | | [j178/prek-action](https://github.com/j178/prek-action) | `2.0.3` | `2.0.4` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.0` | `7.0.1` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `7.0.0` | `8.0.1` | | [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) | `1.13.0` | `1.14.0` | | [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.5.3` | `0.5.6` | Updates `prefix-dev/setup-pixi` from 0.9.5 to 0.9.6 - [Release notes](https://github.com/prefix-dev/setup-pixi/releases) - [Commits](https://github.com/prefix-dev/setup-pixi/compare/1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0...5185adfbffb4bd703da3010310260805d89ebb11) Updates `codecov/codecov-action` from 6.0.0 to 6.0.1 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/57e3a136b779b570ffcdbf80b3bdc90e7fab3de2...e79a6962e0d4c0c17b229090214935d2e33f8354) Updates `github/issue-metrics` from 4.2.2 to 4.2.7 - [Release notes](https://github.com/github/issue-metrics/releases) - [Commits](https://github.com/github/issue-metrics/compare/c9e9838147fd355dace335ba787f01b6641a400a...1e38d5e62363e14db8019ed7d106b9855bdba6cc) Updates `j178/prek-action` from 2.0.3 to 2.0.4 - [Release notes](https://github.com/j178/prek-action/releases) - [Commits](https://github.com/j178/prek-action/compare/6ad80277337ad479fe43bd70701c3f7f8aa74db3...bdca6f102f98e2b4c7029491a53dfd366469e33d) Updates `actions/upload-artifact` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v7...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a) Updates `actions/download-artifact` from 7.0.0 to 8.0.1 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v7...3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c) Updates `pypa/gh-action-pypi-publish` from 1.13.0 to 1.14.0 - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.13.0...cef221092ed1bacb1cc03d23a2d87d1d172e277b) Updates `zizmorcore/zizmor-action` from 0.5.3 to 0.5.6 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/b1d7e1fb5de872772f31590499237e7cce841e8e...5f14fd08f7cf1cb1609c1e344975f152c7ee938d) --- updated-dependencies: - dependency-name: prefix-dev/setup-pixi dependency-version: 0.9.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: codecov/codecov-action dependency-version: 6.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: github/issue-metrics dependency-version: 4.2.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: j178/prek-action dependency-version: 2.0.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/download-artifact dependency-version: 8.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: pypa/gh-action-pypi-publish dependency-version: 1.14.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.5.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: accept universal-pathlib UPath as a StoreLike value A remote UPath now creates an FsspecStore from the filesystem and storage options the UPath already carries, and a local UPath creates a LocalStore so that UPath("/data") and Path("/data") agree. This previously worked only by accident. In universal-pathlib < 0.3 every UPath subclassed pathlib.Path and implemented __fspath__, so a remote path was either converted to a URI string by the caller (xarray does this) or wrapped in a LocalStore that happened to dispatch through fsspec. Since universal-pathlib 0.3 remote paths do neither, and passing one raised TypeError: Unsupported type for store_like. The UPath branch is checked before the Path branch so that routing is identical on both universal-pathlib 0.2 and 0.3. FsspecStore.from_upath now converts the UPath's filesystem to async mode instead of raising TypeError for synchronous filesystems and warning for sync-mode instances of async ones. The memory:// routing test wraps a synchronous MemoryFileSystem, which needs fsspec's AsyncFileSystemWrapper, so it is skipped below fsspec 2024.12.0 as test_wrap_sync_filesystem already does. Closes #4244 Assisted-by: ClaudeCode:claude-fable-5 * fix: correct changelog number and pin the local root in the UPath test The changelog fragment was named for 4245, which towncrier renders as a link to an unrelated issue ("Link Checker Report"). Rename it to the PR number. test_make_store_upath only asserted the store type, so a mangled local path would still produce a LocalStore and pass. Assert the root as well. Silence PLC0414 on the UPath re-export: the alias looks redundant but is the explicit re-export mypy requires under strict mode, and ruff 0.16.0 enables the rule by default. Assisted-by: ClaudeCode:claude-opus-4.8 * docs: don't promise a storage_options error the example doesn't show The sentence ended in a colon introducing an example of passing storage_options alongside a UPath, but the snippet shows the working case and never passes storage_options. Worse, the `anon=True` on the UPath sits right after the sentence and reads as the thing being called out, when it is the recommended way to supply the option. State the rule as prose and let the example just show normal usage. Assisted-by: ClaudeCode:claude-opus-4.8 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- changes/4265.bugfix.md | 13 +++++++++ docs/user-guide/storage.md | 10 +++++++ src/zarr/storage/_common.py | 16 +++++++++-- src/zarr/storage/_fsspec.py | 6 ++++- src/zarr/storage/_utils.py | 4 ++- tests/test_store/test_core.py | 47 +++++++++++++++++++++++++++++++++ tests/test_store/test_fsspec.py | 42 +++++++++++++++++++++++++++++ 7 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 changes/4265.bugfix.md diff --git a/changes/4265.bugfix.md b/changes/4265.bugfix.md new file mode 100644 index 0000000000..6daf0fc7d0 --- /dev/null +++ b/changes/4265.bugfix.md @@ -0,0 +1,13 @@ +Accept [universal-pathlib](https://github.com/fsspec/universal_pathlib) `UPath` objects wherever +zarr accepts a `StoreLike` value. A remote `UPath` now creates an `FsspecStore` using the +filesystem and storage options the `UPath` already carries, and a local `UPath` creates a +`LocalStore`, so that `UPath('/data')` and `Path('/data')` behave the same. + +Previously this worked only by accident: in universal-pathlib < 0.3 every `UPath` subclassed +`pathlib.Path` and implemented `__fspath__`, so remote paths were either converted to a URI string +by the caller or wrapped in a `LocalStore` that happened to dispatch through fsspec. Since +universal-pathlib 0.3 remote paths do neither, and passing one raised +`TypeError: Unsupported type for store_like`. + +`FsspecStore.from_upath` also now converts the `UPath`'s filesystem to async mode, instead of +raising `TypeError` for synchronous filesystems and warning for sync-mode instances of async ones. diff --git a/docs/user-guide/storage.md b/docs/user-guide/storage.md index b288c9976d..a34e2e2874 100644 --- a/docs/user-guide/storage.md +++ b/docs/user-guide/storage.md @@ -90,6 +90,16 @@ print(group) - an FSSpec [FSMap object](https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.FSMap), which will create an [FsspecStore](#remote-store). +- a [universal-pathlib](https://github.com/fsspec/universal_pathlib) `UPath`, which will create an + [FsspecStore](#remote-store), or a [local store](#local-store) if the `UPath` is local. Put your + storage options on the `UPath` itself; passing a separate `storage_options` argument alongside + one raises `TypeError`. + + ```python exec="false" reason="requires universal-pathlib, which is not in the docs environment" + from upath import UPath + group = zarr.open_group(UPath('s3://noaa-nwm-retro-v2-zarr-pds', anon=True), mode='r') + ``` + - a [`Store`][zarr.abc.store.Store] or [`StorePath`][zarr.storage.StorePath] - see explicit store creation below. diff --git a/src/zarr/storage/_common.py b/src/zarr/storage/_common.py index 64dc486e01..72b5fc8a40 100644 --- a/src/zarr/storage/_common.py +++ b/src/zarr/storage/_common.py @@ -24,7 +24,7 @@ from zarr.errors import ContainsArrayAndGroupError, ContainsArrayError, ContainsGroupError from zarr.storage._local import LocalStore from zarr.storage._memory import ManagedMemoryStore, MemoryStore -from zarr.storage._utils import _join_paths, normalize_path, parse_store_url +from zarr.storage._utils import UPath, _join_paths, normalize_path, parse_store_url _has_fsspec = importlib.util.find_spec("fsspec") if _has_fsspec: @@ -301,7 +301,7 @@ def __eq__(self, other: object) -> bool: return False -type StoreLike = Store | StorePath | FSMap | Path | str | dict[str, Buffer] +type StoreLike = Store | StorePath | FSMap | Path | UPath | str | dict[str, Buffer] async def make_store( @@ -321,6 +321,7 @@ async def make_store( - `dict[str, Buffer]` = `MemoryStore` object. - `None` = `MemoryStore` object. - `FSMap` = `FsspecStore` object. + - `UPath` = `FsspecStore` object, or `LocalStore` for a local `UPath`. Parameters ---------- @@ -381,6 +382,17 @@ async def make_store( # Create a new in-memory store return await make_store({}, mode=mode, storage_options=storage_options) + elif isinstance(store_like, UPath): + # This must be checked before Path: in universal-pathlib < 0.3 every UPath, including + # remote ones like S3Path, subclasses pathlib.Path, and would otherwise be misrouted to a + # LocalStore. Local UPaths get a LocalStore so that UPath("/data") and Path("/data") agree, + # mirroring how the equivalent strings are routed below. + if store_like.protocol in ("", "file"): + return await make_store( + Path(store_like.path), mode=mode, storage_options=storage_options + ) + return FsspecStore.from_upath(store_like, read_only=_read_only) + elif isinstance(store_like, Path): # Create a new LocalStore return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only) diff --git a/src/zarr/storage/_fsspec.py b/src/zarr/storage/_fsspec.py index b109f80935..a212e95f2f 100644 --- a/src/zarr/storage/_fsspec.py +++ b/src/zarr/storage/_fsspec.py @@ -171,8 +171,12 @@ def from_upath( ------- FsspecStore """ + # A UPath hands back a filesystem in whatever mode it was constructed with, which is + # synchronous unless the caller passed asynchronous=True. Route it through _make_async so + # that sync-mode instances of async filesystems are re-created in async mode, and + # genuinely synchronous filesystems are wrapped. return cls( - fs=upath.fs, + fs=_make_async(upath.fs), path=upath.path.rstrip("/"), read_only=read_only, allowed_exceptions=allowed_exceptions, diff --git a/src/zarr/storage/_utils.py b/src/zarr/storage/_utils.py index b100f862cf..ca10b0679e 100644 --- a/src/zarr/storage/_utils.py +++ b/src/zarr/storage/_utils.py @@ -6,7 +6,9 @@ from urllib.parse import urlparse if importlib.util.find_spec("upath"): - from upath.core import UPath + # Re-exported for zarr.storage._common, which needs it to recognize UPath store_like values. + # The redundant-looking alias is the explicit re-export mypy requires under strict mode. + from upath.core import UPath as UPath # noqa: PLC0414 else: class UPath: # type: ignore[no-redef] diff --git a/tests/test_store/test_core.py b/tests/test_store/test_core.py index 4138eebe6a..7ba4344810 100644 --- a/tests/test_store/test_core.py +++ b/tests/test_store/test_core.py @@ -4,9 +4,11 @@ from typing import Any, Literal import pytest +from packaging.version import parse as parse_version import zarr from zarr import Group +from zarr.abc.store import Store from zarr.core.buffer import cpu from zarr.core.common import ZARR_JSON, AccessModeLiteral, ZarrFormat from zarr.storage import FsspecStore, LocalStore, MemoryStore, StoreLike, StorePath, ZipStore @@ -14,6 +16,7 @@ _contains_node_v3, contains_array, contains_group, + make_store, make_store_path, ) from zarr.storage._utils import ( @@ -248,6 +251,50 @@ async def test_make_store_path_storage_options_raises(store_like: StoreLike) -> await make_store_path(store_like, storage_options={"foo": "bar"}) +# universal-pathlib 0.2.x emits this from its own subclass registry when a local UPath is built. +@pytest.mark.filterwarnings( + "ignore:Detected a customized `__new__` method in subclass:DeprecationWarning" +) +@pytest.mark.parametrize( + ("url", "expected"), + [ + ("memory://bucket/foo.zarr", FsspecStore), + ("s3://bucket/foo.zarr", FsspecStore), + ("file://{tmp}/foo.zarr", LocalStore), + ("{tmp}/foo.zarr", LocalStore), + ], +) +async def test_make_store_upath(url: str, expected: type[Store], tmp_path: Path) -> None: + """ + A remote UPath becomes an FsspecStore, and a local one becomes a LocalStore, so that + UPath("/data") and Path("/data") agree. See https://github.com/zarr-developers/zarr-python/issues/4244. + """ + upath = pytest.importorskip("upath") + fsspec = pytest.importorskip("fsspec") + if url.startswith("s3://"): + pytest.importorskip("s3fs") + if url.startswith("memory://") and parse_version(fsspec.__version__) < parse_version( + "2024.12.0" + ): + # MemoryFileSystem is synchronous, so it can only be used once fsspec is new enough to + # supply AsyncFileSystemWrapper. + pytest.skip("No AsyncFileSystemWrapper") + store = await make_store(upath.UPath(url.format(tmp=tmp_path))) + assert isinstance(store, expected) + if isinstance(store, LocalStore): + # The local branch rebuilds the root from the UPath, so a mangled path would still + # produce a LocalStore. Pin the root down too, since "file://{tmp}" has no leading + # slash on Windows. + assert store.root == tmp_path / "foo.zarr" + + +async def test_make_store_upath_storage_options_raises() -> None: + """A UPath carries its own storage options, so a separate mapping is ambiguous.""" + upath = pytest.importorskip("upath") + with pytest.raises(TypeError, match="storage_options"): + await make_store(upath.UPath("memory://bucket/foo.zarr"), storage_options={"foo": "bar"}) + + async def test_unsupported() -> None: with pytest.raises(TypeError, match="Unsupported type for store_like: 'int'"): await make_store_path(1) diff --git a/tests/test_store/test_fsspec.py b/tests/test_store/test_fsspec.py index c367b908c5..bb03970d5b 100644 --- a/tests/test_store/test_fsspec.py +++ b/tests/test_store/test_fsspec.py @@ -2,6 +2,7 @@ import json import re +import warnings from typing import TYPE_CHECKING, Any import numpy as np @@ -249,6 +250,47 @@ def test_from_upath(self, endpoint_url: str) -> None: assert result.fs.asynchronous assert result.path == f"{test_bucket_name}/foo/bar" + @pytest.mark.skipif( + parse_version(fsspec.__version__) < parse_version("2024.03.01"), + reason="Prior bug in from_upath", + ) + def test_from_upath_sync_filesystem(self, endpoint_url: str) -> None: + """ + A UPath built without ``asynchronous=True`` -- the common case -- yields an async-mode + filesystem that keeps the original storage options. + """ + upath = pytest.importorskip("upath") + path = upath.UPath( + f"s3://{test_bucket_name}/foo/bar/", + endpoint_url=endpoint_url, + anon=False, + ) + assert not path.fs.asynchronous + with warnings.catch_warnings(): + warnings.simplefilter("error", ZarrUserWarning) + result = FsspecStore.from_upath(path) + assert result.fs.asynchronous + assert result.fs.endpoint_url == endpoint_url + assert result.path == f"{test_bucket_name}/foo/bar" + + async def test_open_group_from_upath(self, endpoint_url: str) -> None: + """ + Passing a remote UPath to the top-level API works. + + Regression test for https://github.com/zarr-developers/zarr-python/issues/4244. + """ + upath = pytest.importorskip("upath") + path = upath.UPath( + f"s3://{test_bucket_name}/upath-group", + endpoint_url=endpoint_url, + anon=False, + ) + group = await zarr.api.asynchronous.open_group(path, mode="w", attributes={"key": "value"}) + assert isinstance(group.store_path.store, FsspecStore) + + reopened = await zarr.api.asynchronous.open_group(path, mode="r") + assert dict(reopened.attrs) == {"key": "value"} + def test_init_warns_if_fs_asynchronous_is_false(self, endpoint_url: str) -> None: try: from fsspec import url_to_fs From 20ba31e3e1142fae83b178d6e0a29538c2b18725 Mon Sep 17 00:00:00 2001 From: glaziermag <130600081+glaziermag@users.noreply.github.com> Date: Thu, 20 Aug 2026 00:46:24 -0700 Subject: [PATCH 59/61] fix: make the nightly hypothesis failure alarm able to file issues (#4274) Co-authored-by: glaziermag --- .github/workflows/hypothesis.yaml | 6 +++++- pyproject.toml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index dd49578dd0..f463397c85 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -25,6 +25,9 @@ jobs: hypothesis: name: Slow Hypothesis Tests + permissions: + contents: read + issues: write environment: name: codecov-upload deployment: false @@ -83,6 +86,7 @@ jobs: id: status env: HATCH_ENV: test.py${{ matrix.python-version }}-${{ matrix.dependency-set }} + PYTEST_ADDOPTS: "--report-log=output-${{ matrix.python-version }}-log.jsonl" run: | echo "Using Hypothesis profile: $HYPOTHESIS_PROFILE" hatch env run --env "$HATCH_ENV" run-hypothesis @@ -113,4 +117,4 @@ jobs: with: log-path: output-${{ matrix.python-version }}-log.jsonl issue-title: "Nightly Hypothesis tests failed" - issue-label: "topic-hypothesis" + issue-label: "automated issue" diff --git a/pyproject.toml b/pyproject.toml index dca663277e..ebe12bbb91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -114,6 +114,7 @@ test = [ "pytest-accept==0.3.0", "numpydoc==1.10.0", "hypothesis==6.165.2", + "pytest-reportlog==0.4.0", "pytest-xdist==3.8.0", "pytest-benchmark==5.2.3", "pytest-codspeed==5.0.3", From bf8f8632f146449b12e0ea7e40576f8dbbde6fa1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:55:20 +0200 Subject: [PATCH 60/61] chore(deps): bump the python-dependencies group across 1 directory with 7 updates (#4278) Bumps the python-dependencies group with 7 updates in the / directory: | Package | From | To | | --- | --- | --- | | [numpy](https://github.com/numpy/numpy) | `2.5.1` | `2.5.2` | | [coverage](https://github.com/coveragepy/coveragepy) | `7.15.3` | `7.15.4` | | [hypothesis](https://github.com/HypothesisWorks/hypothesis) | `6.165.2` | `6.165.5` | | [pytest-reportlog](https://github.com/pytest-dev/pytest-reportlog) | `0.4.0` | `1.0.0` | | [uv](https://github.com/astral-sh/uv) | `0.12.2` | `0.12.3` | | [ruff](https://github.com/astral-sh/ruff) | `0.16.1` | `0.16.2` | | [astroid](https://github.com/pylint-dev/astroid) | `4.1.2` | `4.3.0` | Updates `numpy` from 2.5.1 to 2.5.2 - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](https://github.com/numpy/numpy/compare/v2.5.1...v2.5.2) Updates `coverage` from 7.15.3 to 7.15.4 - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.15.3...7.15.4) Updates `hypothesis` from 6.165.2 to 6.165.5 - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](https://github.com/HypothesisWorks/hypothesis/compare/v6.165.2...v6.165.5) Updates `pytest-reportlog` from 0.4.0 to 1.0.0 - [Release notes](https://github.com/pytest-dev/pytest-reportlog/releases) - [Changelog](https://github.com/pytest-dev/pytest-reportlog/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-reportlog/compare/v0.4.0...v1.0.0) Updates `uv` from 0.12.2 to 0.12.3 - [Release notes](https://github.com/astral-sh/uv/releases) - [Changelog](https://github.com/astral-sh/uv/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/uv/compare/0.12.2...0.12.3) Updates `ruff` from 0.16.1 to 0.16.2 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.16.1...0.16.2) Updates `astroid` from 4.1.2 to 4.3.0 - [Release notes](https://github.com/pylint-dev/astroid/releases) - [Changelog](https://github.com/pylint-dev/astroid/blob/main/ChangeLog) - [Commits](https://github.com/pylint-dev/astroid/compare/v4.1.2...v4.3.0) --- updated-dependencies: - dependency-name: numpy dependency-version: 2.5.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: coverage dependency-version: 7.15.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: hypothesis dependency-version: 6.165.5 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: pytest-reportlog dependency-version: 1.0.0 dependency-type: direct:development update-type: version-update:semver-major dependency-group: python-dependencies - dependency-name: uv dependency-version: 0.12.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: ruff dependency-version: 0.16.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-dependencies - dependency-name: astroid dependency-version: 4.3.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 12 +- uv.lock | 502 ++++++++++++++++++++++++++++--------------------- 2 files changed, 292 insertions(+), 222 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ebe12bbb91..4cfe02b0e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,19 +107,19 @@ homepage = "https://github.com/zarr-developers/zarr-python" # pins deliberately, e.g. via dependabot or `uv lock --upgrade`. [dependency-groups] test = [ - "coverage==7.15.3", + "coverage==7.15.4", "pytest==9.1.1", "pytest-asyncio==1.4.0", "pytest-cov==7.1.0", "pytest-accept==0.3.0", "numpydoc==1.10.0", - "hypothesis==6.165.2", - "pytest-reportlog==0.4.0", + "hypothesis==6.165.5", + "pytest-reportlog==1.0.0", "pytest-xdist==3.8.0", "pytest-benchmark==5.2.3", "pytest-codspeed==5.0.3", "tomlkit==0.15.1", - "uv==0.12.2", + "uv==0.12.3", ] remote-tests = [ {include-group = "test"}, @@ -143,13 +143,13 @@ docs = [ "mkdocs-redirects==1.2.3", "markdown-exec[ansi]==1.12.3", "griffe-inherited-docstrings==1.1.3", - "ruff==0.16.1", + "ruff==0.16.2", # Changelog generation {include-group = "release"}, # Optional dependencies to run examples "numcodecs[msgpack]", "s3fs>=2023.10.0", - "astroid==4.1.2", + "astroid==4.3.0", "pytest==9.1.1", ] dev = [ diff --git a/uv.lock b/uv.lock index 05a746af06..327d3e0822 100644 --- a/uv.lock +++ b/uv.lock @@ -243,11 +243,11 @@ wheels = [ [[package]] name = "astroid" -version = "4.1.2" +version = "4.3.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/da/fd/24475b7cfb70298e8921bc077adb46a3fe77887422545d8a061573e130ee/astroid-4.1.2.tar.gz", hash = "sha256:d6c4a52bfcda4bbeb7359dead642b0248b90f7d9a07e690230bd86fefd6d37f1", size = 414896, upload-time = "2026-03-22T19:16:42.075Z" } +sdist = { url = "https://files.pythonhosted.org/packages/33/a0/fc1c9f396c354456d859eb09fa13186bda34cb5b000f47a7103fcf84fe66/astroid-4.3.0.tar.gz", hash = "sha256:2b5b5048d6edc40e748e2728790e444b81c3d358e19cc89db6e973236192362f", size = 438804, upload-time = "2026-08-07T20:28:28.363Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/54/97/4ee9b0438e85bf0a808a89ef0be357319252ab27e1b313ae0aef7aeaa5a6/astroid-4.1.2-py3-none-any.whl", hash = "sha256:21312e682c0866dc5a309ee57e4b88ea92751b9955a58b1c31371cbbeb088707", size = 279956, upload-time = "2026-03-22T19:16:40.062Z" }, + { url = "https://files.pythonhosted.org/packages/00/0a/f277a39699ac334e332c991b6ce9e47a30bb2bdac6d2141fdbd2d39835a9/astroid-4.3.0-py3-none-any.whl", hash = "sha256:47f329c1f4709c479f84f824c4f3a132816603a749cd4aa6ee9030e69951491a", size = 286532, upload-time = "2026-08-07T20:28:26.602Z" }, ] [[package]] @@ -615,71 +615,101 @@ wheels = [ [[package]] name = "coverage" -version = "7.15.3" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f4/45/78dbf9604ee5b3db24efbf26bed1cb58862fb40480cba821963c69348751/coverage-7.15.3.tar.gz", hash = "sha256:ae7ea5a4614acf399ef0483c4cb34f8f8f01df848d8fcbe7d3ce0865733f1c4d", size = 935592, upload-time = "2026-08-02T18:50:17.006Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/6c/bac99d9d4c6abe856e93bf3f5212982ac0bfac126dd4a042753bd53bc5af/coverage-7.15.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:79a3e32e83227d83d9684459ed579769b56c369ac2d7313099b2d9e031d2e10f", size = 222499, upload-time = "2026-08-02T18:48:15.018Z" }, - { url = "https://files.pythonhosted.org/packages/aa/bc/cb9a39b083bc1aa70586482dab25c9be20bab0ec6c155340e50d9066bb1e/coverage-7.15.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:767feb87c5886d781d0a69fafd450a20826ddab7b79bce1665deb64d21441b60", size = 222866, upload-time = "2026-08-02T18:48:16.884Z" }, - { url = "https://files.pythonhosted.org/packages/58/fb/beaa453d62000a0a5b39838bee2a137afe609a50a71f55e83c73461e513b/coverage-7.15.3-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:50951e37033c40548d777b8a8454a2cd622dba1136780065678dccaec307c47f", size = 254367, upload-time = "2026-08-02T18:48:18.507Z" }, - { url = "https://files.pythonhosted.org/packages/66/64/43e72500ed6815cef189f9193f29d7af4b078830337c95ea976cd0c0d427/coverage-7.15.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:63a4ff67364afb2cac826b8bbd78a5c50ce656a7b7137436b44d7b96a9271088", size = 257103, upload-time = "2026-08-02T18:48:20.172Z" }, - { url = "https://files.pythonhosted.org/packages/66/3a/2893e2937adfe02f45fd38e4a8a0a0d8b7a02ff9e012ac3d009bee3c4f16/coverage-7.15.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e95e42856509675fe26560310313a6117640e96f9a1e19bb3d220116a27c94c", size = 258220, upload-time = "2026-08-02T18:48:21.963Z" }, - { url = "https://files.pythonhosted.org/packages/30/b4/d5e6e2eb1a62961083734291304b1f85df72e2abe95c76eb88a7f472afd0/coverage-7.15.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:abad631cba27094b4631993f4c72e89ac0ca1b3a0236c7abaf8ca79aea619851", size = 260481, upload-time = "2026-08-02T18:48:23.682Z" }, - { url = "https://files.pythonhosted.org/packages/dc/c9/9b72c5c6a9798a9a12cf65f66e077cc1fdd396e61915c862688f9afe1cae/coverage-7.15.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:2b0807f1f051dd82a234ad6acdb6f1425baede60be1e84e862496c8cc9262ab9", size = 254749, upload-time = "2026-08-02T18:48:25.32Z" }, - { url = "https://files.pythonhosted.org/packages/92/20/e1c2f759e2dbce559ba85c40c0e4acfecc6cff4b740c294c88e41ccc6111/coverage-7.15.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d8d6df7aeb5bc464040bbc9ae173d875785d3677ebc4307817997d622d74225e", size = 256138, upload-time = "2026-08-02T18:48:27.064Z" }, - { url = "https://files.pythonhosted.org/packages/a5/ab/48cc7e760f769e86ae290a125ea6e7209dfbdbbbb7ff4f5d9d1ee7a45d57/coverage-7.15.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:974471c506c9f5758808b47c1ebf7949ecd0848f5c1020e78675fefe5ff46866", size = 254283, upload-time = "2026-08-02T18:48:29.082Z" }, - { url = "https://files.pythonhosted.org/packages/15/26/39529a68154f99b3a1829debd8b25eac384effeec890a293b5bbdcb49186/coverage-7.15.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5cba0c9c13e35c86df7998f1afaf6b1da224a3a39e4da59bdabf60c148046dcb", size = 258352, upload-time = "2026-08-02T18:48:30.892Z" }, - { url = "https://files.pythonhosted.org/packages/91/2f/55b82aa3d8d7dd8023a56e7c5c2a70e39a3c44b3353c6cf3faec9ad51566/coverage-7.15.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:4d608dc36a364dce33acbf4fc3a50f9d2054c945f233bb0a2cdb4b90bfa17646", size = 253852, upload-time = "2026-08-02T18:48:32.934Z" }, - { url = "https://files.pythonhosted.org/packages/6a/6d/839f4045124cd3518ecf2c58967e58a911202834e7c5a03cfdf2ab0b29f6/coverage-7.15.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2395869280554a1941da904423c12660c39f721315e1c02d076a7fe0971382f0", size = 255725, upload-time = "2026-08-02T18:48:34.848Z" }, - { url = "https://files.pythonhosted.org/packages/75/21/d25e3e2a9e327798078c877f469dfb6def860bf6e25036529046227d3e15/coverage-7.15.3-cp312-cp312-win32.whl", hash = "sha256:24f3b21840c3eb76cef3cc70b2bf6649010c64471a84a446538a39306e1ba04d", size = 224566, upload-time = "2026-08-02T18:48:36.661Z" }, - { url = "https://files.pythonhosted.org/packages/b1/0f/df90cc1e8d095ce263968a93e04829821b2afb31ac2752c06a2e0a8e3c13/coverage-7.15.3-cp312-cp312-win_amd64.whl", hash = "sha256:fa7b17902c3c1dd8a7adb52679b7f6340bba08443d710c8838e04db8cf62be2a", size = 225098, upload-time = "2026-08-02T18:48:38.941Z" }, - { url = "https://files.pythonhosted.org/packages/65/c7/ec49e43c58967a07163e2d1c6bbd58112b825b2772ab66784afd6a5400ba/coverage-7.15.3-cp312-cp312-win_arm64.whl", hash = "sha256:fcbe83fb7258eacd293bf5322d88807acb35ed12a5cfa99dd8215c083e3b0235", size = 224485, upload-time = "2026-08-02T18:48:40.682Z" }, - { url = "https://files.pythonhosted.org/packages/68/6e/62ae61e1fc434956bec38ed1d5b1c494f58cf579dbd998e77abffe7b3e6b/coverage-7.15.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1182eed05674c63d40951fae27c43e822749f04d25f75df64c2e4fa3168678de", size = 222522, upload-time = "2026-08-02T18:48:42.476Z" }, - { url = "https://files.pythonhosted.org/packages/13/ff/c74c673d81e0e77b6608c3d21331e3db42e30daeb3c8a0a8860d4c9e2e14/coverage-7.15.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c0c4b0d7c4cd56e470d0c9d8441f42e8a96cdfd95050fec027f1d4dd9f11006c", size = 222894, upload-time = "2026-08-02T18:48:44.274Z" }, - { url = "https://files.pythonhosted.org/packages/a1/91/ccb30f5ffafd7d69d0b18e5162f9b711a5654e807b7b0c13497f0826b33f/coverage-7.15.3-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:5c9fce9f4998b0d50a753da765b9215a14decc7863822c89d72da7a89ca625b3", size = 253890, upload-time = "2026-08-02T18:48:46.097Z" }, - { url = "https://files.pythonhosted.org/packages/29/c6/e92a66cda49a2751b09826d51258f199b92aa0cb005bc5f34e9729a52a9c/coverage-7.15.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7a47e2a0a0ace9241e70ee00e44520f88b843094603dd54303f1bafecd929c30", size = 256484, upload-time = "2026-08-02T18:48:47.846Z" }, - { url = "https://files.pythonhosted.org/packages/96/7a/730929164b457cf25cf76c23898b90f9039a104a647890801b6586797b14/coverage-7.15.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:95bad94f83807ae60ed76f3ac012f69b2605ac9ea81bee959a5a483f7fa09c10", size = 257723, upload-time = "2026-08-02T18:48:49.664Z" }, - { url = "https://files.pythonhosted.org/packages/9e/be/04cb5672cb19f5c389eda81ba22d89807699a949653d3625b0e0fda169da/coverage-7.15.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:228e172a76c428bb17d1ab78a2ff188990b0597e5dbd291f52a4edf7412de049", size = 259854, upload-time = "2026-08-02T18:48:51.413Z" }, - { url = "https://files.pythonhosted.org/packages/96/25/5e7fd6af39f6507071455944b8906dd1fe5b7b6bffb6a163ceb20afa0d13/coverage-7.15.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cea9fb33887c99349996266f1fd60abe5af3577a90633392001d27ef46b4b66e", size = 254085, upload-time = "2026-08-02T18:48:53.158Z" }, - { url = "https://files.pythonhosted.org/packages/23/c8/55e58a853f1e61163a6e755897bd14a059d78411e86560f39d9951c019b5/coverage-7.15.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:81760de3155d7f52c21860c4046628dc6bed182f72e3c028e2b4fd46f65aa040", size = 255850, upload-time = "2026-08-02T18:48:55.031Z" }, - { url = "https://files.pythonhosted.org/packages/be/74/8bcec66dbcf3d22bea2a0b2b77ee2fa6f766a647d0023d4eabbc4f2b2756/coverage-7.15.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:b47ea0a1d3a3d089826c6cbfad8429d7d8872e28e86baa95ddef330f6875da21", size = 253818, upload-time = "2026-08-02T18:48:57.163Z" }, - { url = "https://files.pythonhosted.org/packages/ce/06/450b673fdfece0997b4e16a31d6bde6b18889c578f1013ddd34c962ac6f9/coverage-7.15.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5459ba486b2a5d58a6c05254779ecdf525e7f20174d0210ceda75ba40fdb8f2c", size = 257973, upload-time = "2026-08-02T18:48:59.098Z" }, - { url = "https://files.pythonhosted.org/packages/56/fd/3ec7409aec0ddc943132452b65672f065f043b844f1830e1fe173c98b3ab/coverage-7.15.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:c59209f80a08dbfcdd5109a80dc623cd3b9d22895c85757d34f57a6e6e95570f", size = 253638, upload-time = "2026-08-02T18:49:01.199Z" }, - { url = "https://files.pythonhosted.org/packages/75/20/30a8dabb194123631c93f860fdd86401ad405d56cfb1841873afbfe4e92b/coverage-7.15.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:f863856c1779d4a5bb6a94698a2f9073e09c6706501f76f3e7780e72df97d21c", size = 255407, upload-time = "2026-08-02T18:49:03.143Z" }, - { url = "https://files.pythonhosted.org/packages/13/4d/e14365b1953b43653341412f9088b0d752614c626a73a705ff9af400f3a3/coverage-7.15.3-cp313-cp313-win32.whl", hash = "sha256:00cbdc5e322927dc30c5e42b863819b1bb867cc66f26ab5372c585850876ab93", size = 224575, upload-time = "2026-08-02T18:49:05.011Z" }, - { url = "https://files.pythonhosted.org/packages/1c/64/88f762ea80de2070207246faef514513be874486b2773528f2cc2b4b515c/coverage-7.15.3-cp313-cp313-win_amd64.whl", hash = "sha256:835528518a1d823cf336740324b2f335f7c01e609e74abcb5d5163b3e66661e3", size = 225116, upload-time = "2026-08-02T18:49:06.894Z" }, - { url = "https://files.pythonhosted.org/packages/ab/66/03c34c53a319f522554cd29d4f2e16c5eab61aa4cdcf55753129fd7d926c/coverage-7.15.3-cp313-cp313-win_arm64.whl", hash = "sha256:0d2e1f2cbbf36b842f3e2aff8d118c60d677adb498bc6c7fa9c6838738f82767", size = 224509, upload-time = "2026-08-02T18:49:09.129Z" }, - { url = "https://files.pythonhosted.org/packages/35/6f/8c2dc014357618b3226c90f731b8282766c3685786f422558991dc49fbf2/coverage-7.15.3-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:1e3bb08ad574bd9fb6a991f645728f70d333c1c1958dd5fcde65e24cb862813d", size = 222571, upload-time = "2026-08-02T18:49:11.242Z" }, - { url = "https://files.pythonhosted.org/packages/07/50/d867c7ceae9d56b7e74ee61ea834f1aa4f9a1e1c7f0ce39393ba573b1c12/coverage-7.15.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:9e5860eaff02a0b7f1b73304bdf846596ee62ab3a78d25c68044ebf684cb1fef", size = 222902, upload-time = "2026-08-02T18:49:13.448Z" }, - { url = "https://files.pythonhosted.org/packages/62/77/4f6dfc490c5f2bcacb2d296d9aa4d1e128c43b48e94ad313fec7f49f09ad/coverage-7.15.3-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:60874e5bd67f0b1bdbe42ab42c7bafa66a6fb8de88721af6df3f7a02713960cd", size = 253947, upload-time = "2026-08-02T18:49:15.304Z" }, - { url = "https://files.pythonhosted.org/packages/16/8a/6777f192af264165103e2a3d3768dbadb9894a0a2359a16877141d9ae8f5/coverage-7.15.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f9147be876e9d83765e0b82176674dc248a6b9283e25e01e7462611b97e9b731", size = 256452, upload-time = "2026-08-02T18:49:17.801Z" }, - { url = "https://files.pythonhosted.org/packages/7d/7b/3d7ac46a0234bc684f41ee42be95e29b2b6525695adb04083609d5ac2149/coverage-7.15.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:61a01f8c3804760fcc5a3d31c4f3cab792d660d44e17bf7adeaf0ea51e07821e", size = 257798, upload-time = "2026-08-02T18:49:19.878Z" }, - { url = "https://files.pythonhosted.org/packages/ff/1e/c6ee59c29afcb5fdb35f936381340d1a06429a07c48f20e809646647acbe/coverage-7.15.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:95bf3e7f26f792e25eb185f85a5a659d48479265176dcfe22b6f334fd0081b5c", size = 260112, upload-time = "2026-08-02T18:49:21.858Z" }, - { url = "https://files.pythonhosted.org/packages/c1/e1/e8ea39a46e89e3a143312ee5f80336e992e3ae8fe44bf9c76b83fefeed42/coverage-7.15.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:44c41eff9e413fed8740eca75d5438ebeb9d3e45e7cd37c67329213e7a72c764", size = 253944, upload-time = "2026-08-02T18:49:23.926Z" }, - { url = "https://files.pythonhosted.org/packages/95/67/31ab5f6a37fd887d1386f81f0da9306851ad2264e9baaa9c7f606e0b3e17/coverage-7.15.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:54146bafb61f3ba9895b43af0dd17eba01561d586d44ce84ea221b0cbbee5a9e", size = 255805, upload-time = "2026-08-02T18:49:25.973Z" }, - { url = "https://files.pythonhosted.org/packages/fb/6a/ee505a80c8fd89620fb337c0596daecff87f33171fbb4ee3015fc3d7331f/coverage-7.15.3-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:af000dd1bb859ff8066fda4c79512ff938c798116540307226b373099c7b151f", size = 253769, upload-time = "2026-08-02T18:49:27.883Z" }, - { url = "https://files.pythonhosted.org/packages/b0/41/6ab0f81c9e89660230d8f3f581d4732e5ddb75a885b0a5dfc73d315dc94f/coverage-7.15.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:a1b82490577f3889950b5a04f18712aef0207243e0749d60fe28c3c73ebfd5fd", size = 258045, upload-time = "2026-08-02T18:49:30.201Z" }, - { url = "https://files.pythonhosted.org/packages/bc/62/c995e91cae28cf31d6defab3bfb553dda5ac83ac7381b0f2b121264c307a/coverage-7.15.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:c4fc90a60154c3e4b8a2dc206d6dbe852f1c235c249e0dc0cef909d032c9591a", size = 253587, upload-time = "2026-08-02T18:49:32.349Z" }, - { url = "https://files.pythonhosted.org/packages/84/df/f2049980f82d6890321f2065f9e66216eabbf4b2001815db958bc543f40a/coverage-7.15.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f25bb884814a892948b4c20394db3f2364dd452d9492736479e7a493e63b0eb6", size = 255243, upload-time = "2026-08-02T18:49:34.324Z" }, - { url = "https://files.pythonhosted.org/packages/1d/82/2c841b67a978c0eb9c3707630b68f93f9e7585d78bb906bc8823ec6b07a5/coverage-7.15.3-cp314-cp314-win32.whl", hash = "sha256:722dbf8e7828fbcfe0dc8586167dc0a5ce85ad6ea171dbb21ed3f8d6581d3cb8", size = 224759, upload-time = "2026-08-02T18:49:36.326Z" }, - { url = "https://files.pythonhosted.org/packages/b3/78/5c93ec43784fd3e404ca23cd0584ae24bc1732de4a3fc194b68c3be88db0/coverage-7.15.3-cp314-cp314-win_amd64.whl", hash = "sha256:64d0845f9c3ed47302bed265c15ab4dbb64aa4ec1490839b8e328f4e7fa914d2", size = 225246, upload-time = "2026-08-02T18:49:38.366Z" }, - { url = "https://files.pythonhosted.org/packages/9d/77/813a054371f3b018cc63c6bdb46a3c35d5e95d4e3ed4f1449d4196106db5/coverage-7.15.3-cp314-cp314-win_arm64.whl", hash = "sha256:69bc14684f8fbbee9f9dbaa4fe79719b0da9725fc37956785c06ec365acf6926", size = 224673, upload-time = "2026-08-02T18:49:40.552Z" }, - { url = "https://files.pythonhosted.org/packages/8f/63/8c9f36cc71178d26db930baa03a4494abcc516d8d41bf820d0d85ef1d80b/coverage-7.15.3-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:f92df943c24b96cb215ca26b4f6a2283e63c5db80f1635aceea7fff11311917b", size = 223298, upload-time = "2026-08-02T18:49:42.634Z" }, - { url = "https://files.pythonhosted.org/packages/54/66/211f24d058ce9f56ebf1420d55b7574fdae924f6da3836f83c8bd4793e38/coverage-7.15.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:66591c46bdd2971d3ae2bc503a5f0459c2edcaf6b7e045b292000cc95bc6cb95", size = 223568, upload-time = "2026-08-02T18:49:44.706Z" }, - { url = "https://files.pythonhosted.org/packages/dd/bb/9c2ad5574a0d6420a96c6cade4f8a683931b9e79fe609f8924d7b6964616/coverage-7.15.3-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:caa64458b81b18bfc67cdf1f6dc02b23e3edc672f2f8e11771fad75865415a43", size = 264932, upload-time = "2026-08-02T18:49:47.153Z" }, - { url = "https://files.pythonhosted.org/packages/ba/91/938c39e77bdd5a0a440412f975609ce3702dabbda6ac715719d93ca45a7b/coverage-7.15.3-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:447f5421ccf5475956cf516d4ca1d575f487947b6f4e11f9d80c6aefe24b3dc8", size = 267052, upload-time = "2026-08-02T18:49:49.324Z" }, - { url = "https://files.pythonhosted.org/packages/b0/a3/7b431a98af35d9cc6394e54cde9435b33b8591672fbece6a4931267d7a8e/coverage-7.15.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7a0c77ef8cd483a4987a5d12d1d9d5f7ee598dfdc6c0844417d847e5768dc779", size = 269473, upload-time = "2026-08-02T18:49:51.599Z" }, - { url = "https://files.pythonhosted.org/packages/32/58/dbc9951dce46be47a732823a1c571f62bcabdd54a68d8c281489a1a55cfb/coverage-7.15.3-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0b273f4ff657446a06c2d85bf80e134fa869a92852ba5f87854a70e1fb44da77", size = 270591, upload-time = "2026-08-02T18:49:53.865Z" }, - { url = "https://files.pythonhosted.org/packages/71/bd/1d610772c7c0889bfe477a59c46ee66ea53e271f3f06951e9d55b317f7c6/coverage-7.15.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:daea8c4fafa22488600405be2c2be525a9406fba3fc0a83acc726db3e14e2005", size = 264007, upload-time = "2026-08-02T18:49:55.875Z" }, - { url = "https://files.pythonhosted.org/packages/69/97/852eb3dcdba156b1a9078503f098499916bf889f964b61ad4a08223ac169/coverage-7.15.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:93ff57c530f3fa7aa69f92fb9b8892b8aa82712aa970842f4abf28657f42fb57", size = 266926, upload-time = "2026-08-02T18:49:57.944Z" }, - { url = "https://files.pythonhosted.org/packages/52/f8/b72cd238757fba2b587fc7dee047efe6e10b0c18343509faaaf502dd4680/coverage-7.15.3-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:4df21bef8b800eebda9018f53d49c9ace3aeb0090c850139b27923aafcb83e91", size = 264529, upload-time = "2026-08-02T18:50:00.035Z" }, - { url = "https://files.pythonhosted.org/packages/b8/0a/6c52ec4b7fb007cb6433d1fcfda4080cb15d75ad37ef9c31025f3427293e/coverage-7.15.3-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:db567b02685f26034adcbd85055f80d12cdf02111b8ed00886093d98b2874ce2", size = 268263, upload-time = "2026-08-02T18:50:02.161Z" }, - { url = "https://files.pythonhosted.org/packages/c0/4e/f1f9aa3efd109a04353563a43fb5155340c1fdcdeaa6296ebed3b6f510ea/coverage-7.15.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:5318dd51b8600b947e058cf5a4fe54d183d9d13c49b97b64ca7be05a34df9bef", size = 263377, upload-time = "2026-08-02T18:50:04.243Z" }, - { url = "https://files.pythonhosted.org/packages/dd/fb/6b268a0b2728ef1c379ad656b899274477a5f6bed1bf6765b4b387fb0601/coverage-7.15.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c995bfa383c54704839b6c4c2627a1c00895597ada0e5e8190c81d8bd620555c", size = 265688, upload-time = "2026-08-02T18:50:06.428Z" }, - { url = "https://files.pythonhosted.org/packages/29/54/1a3ea96e5d5e7cd41dc432597bfc60692910e635d05e1cc25a8ccc243581/coverage-7.15.3-cp314-cp314t-win32.whl", hash = "sha256:6433fafb8da0e1d02eb53411e0ecdadb6b88f0224fdc23317e703c0e88937d42", size = 225066, upload-time = "2026-08-02T18:50:08.533Z" }, - { url = "https://files.pythonhosted.org/packages/31/9d/a7b0d9afd18ed5274dd00651a78e7810a931c70d94b79996f150bec1a30f/coverage-7.15.3-cp314-cp314t-win_amd64.whl", hash = "sha256:fe578952b1b29fe8c777f43f241d49efac4b56724a3434f5d22ebe3c208df429", size = 225897, upload-time = "2026-08-02T18:50:10.572Z" }, - { url = "https://files.pythonhosted.org/packages/ca/11/34c5ae40b945e69aa72b87dc268135b7049905f3824af573b7073acbb946/coverage-7.15.3-cp314-cp314t-win_arm64.whl", hash = "sha256:d2e1acb7aee29dfa8f3e48c23f36670898baca1209d9bdd3985a50c7f982165e", size = 225212, upload-time = "2026-08-02T18:50:12.63Z" }, - { url = "https://files.pythonhosted.org/packages/37/e7/7069b3d6c018917f49ba2e1c5fb910e498c7fefa3a1b78cb1b79e61ff45d/coverage-7.15.3-py3-none-any.whl", hash = "sha256:da78fa6fc7dafe4212839173133ee85afcf42c5cd5f3e47fa7c1c210453b445e", size = 214297, upload-time = "2026-08-02T18:50:14.709Z" }, +version = "7.15.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/be/c3/4f2195f512fb172aa425a8803a874b2baa9ba7f80ff7b6080998761fc701/coverage-7.15.4.tar.gz", hash = "sha256:0548198fff07ccf4faf469520bce1c2eceb1ce3e62891921138dec10907f9d00", size = 936952, upload-time = "2026-08-06T13:50:24.442Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1d/48/bc8d4ba7b37551a767bd863f15b3f80182b271c2f55975356f5f7dbe94c2/coverage-7.15.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d4fedd1f7f428f9fe83b1ead5e7cc87a43427be31aadafbac3ac0636dc7abb22", size = 222543, upload-time = "2026-08-06T13:47:37.562Z" }, + { url = "https://files.pythonhosted.org/packages/20/dd/88d6f83f1fffc974a3691a34a97951c5b12df7512a6782c5963883cbc058/coverage-7.15.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:37e2f0cdf58e2e1fed4e4d5a8f8786ae2f7eb80b478016876667dc4a01d60a97", size = 222905, upload-time = "2026-08-06T13:47:38.927Z" }, + { url = "https://files.pythonhosted.org/packages/bd/5c/54ee0d4748585bb0acab9891cd8d92f2d3593165b4e59fc9de113bfb3140/coverage-7.15.4-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:fb55d0e70bb15f2e81477613627286581414693d74ac7963c93a790dd453ca9d", size = 254407, upload-time = "2026-08-06T13:47:40.488Z" }, + { url = "https://files.pythonhosted.org/packages/8c/3f/f0642a372f494bd0d7dad3b497083b910194a5f1c88be2c94fef707c3b59/coverage-7.15.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:899b9da30f3c6c336566e3707495bb23e8302d39d862f01fa78c48b99b9437e2", size = 257145, upload-time = "2026-08-06T13:47:41.931Z" }, + { url = "https://files.pythonhosted.org/packages/71/17/8b46d0ed68251016002ec972c8fc0119961a765d0984cafb8bf317c43758/coverage-7.15.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d15715e8c46552827e5e4f30a35575a2dbcad14454cf3284c54483946bd16931", size = 258257, upload-time = "2026-08-06T13:47:43.527Z" }, + { url = "https://files.pythonhosted.org/packages/30/b8/8498a0e72d0adbe15477dd07463d2b3bb2c9f6a4815e8589e50939e2c3ae/coverage-7.15.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:002a438859f7b430bc99afeaf01a6d187dad1d0dc907b64cdeffc632a5db8fd8", size = 260517, upload-time = "2026-08-06T13:47:45.121Z" }, + { url = "https://files.pythonhosted.org/packages/41/e1/7dce19c3bdb1e3dd63e769508216500edad81bd5f69a26d724e32aceaf78/coverage-7.15.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e4193a04b518f7968f3099755f5509ee7cccc6dc2b92a6b14841934d22e222c9", size = 254785, upload-time = "2026-08-06T13:47:46.541Z" }, + { url = "https://files.pythonhosted.org/packages/dd/b1/e1494703c675a2561723cd9b89f45c9168782c31280c611b1f767851e57c/coverage-7.15.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e98dcc55d572b38e69d117da7e8e8efb8500f1f5eaf81ecd460a63220790b839", size = 256176, upload-time = "2026-08-06T13:47:48.155Z" }, + { url = "https://files.pythonhosted.org/packages/73/76/a5629d270fb638a43a4b10466f51e2f49d532c1aa4da2913cbbb150bbe0a/coverage-7.15.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:af6c538498ce66c10d3fd541c2a8d5b03da5850355add34e6cba564210cb9e72", size = 254321, upload-time = "2026-08-06T13:47:49.757Z" }, + { url = "https://files.pythonhosted.org/packages/ff/4f/9c44447218435d5766b911534f9d798144a5560f85e9a54ebe5f3f5d19f9/coverage-7.15.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:1d10025d96ea89fc2f73714dbc4cbd433fe012c1ac9e23f895d7728b238b6e52", size = 258390, upload-time = "2026-08-06T13:47:51.248Z" }, + { url = "https://files.pythonhosted.org/packages/de/36/c1e127616fb3fa18a9ff71e76c417f2fd7424332a4870015ac224ef4c039/coverage-7.15.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d802e1947603162ded419bff83ac7489820355d2b856dfb09206574e3a37ac0c", size = 253894, upload-time = "2026-08-06T13:47:52.816Z" }, + { url = "https://files.pythonhosted.org/packages/e9/b9/fdb92c8ae7a8bb9b850cc253b7b3b9c8526f68130002048b5671cd510d09/coverage-7.15.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c2de40895718f91951b86712b4c5b694acaf9a0a49be13874896f599a1eed3f4", size = 255763, upload-time = "2026-08-06T13:47:54.296Z" }, + { url = "https://files.pythonhosted.org/packages/6f/c0/a7d51b2587c7bdb76e71b0896d2565bf7d60436b5122fc83e511adb1f7cd/coverage-7.15.4-cp312-cp312-win32.whl", hash = "sha256:5c3431b2161279b7db5c2a1aa58ae02e5cb8c3c42d93a5094be3f5537bd5b11b", size = 224597, upload-time = "2026-08-06T13:47:56.074Z" }, + { url = "https://files.pythonhosted.org/packages/49/b9/5c5f80cc55f5acaaca6dee677626bfcec8c87204a7809b438b08e84f4571/coverage-7.15.4-cp312-cp312-win_amd64.whl", hash = "sha256:6befeab5fb2b51c958ca4ac6c5d141a1e8240f4f76e46350f1911963deda49cd", size = 225135, upload-time = "2026-08-06T13:47:57.52Z" }, + { url = "https://files.pythonhosted.org/packages/47/e4/2a4561f89ff6bf7c925c287d0f2cce8bdf139c3a33735c87e3203401cf94/coverage-7.15.4-cp312-cp312-win_arm64.whl", hash = "sha256:67bc345491ab55b837277d76f5775d057e8c7f1ac44d890d8c2c82adde258c6f", size = 224515, upload-time = "2026-08-06T13:47:58.977Z" }, + { url = "https://files.pythonhosted.org/packages/f1/84/651a9310859673aaa3b3203f1aa1641ca60fcf2494683e1c9474c7172780/coverage-7.15.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c705b28feb2775dc82a25f1d473a370bc37ff93f5177f4e29ce2425f560f6921", size = 222565, upload-time = "2026-08-06T13:48:00.796Z" }, + { url = "https://files.pythonhosted.org/packages/82/f9/4dcf700137e8af550670f4d74d1b63828ce93e1e2b05e5f10710eb2ea987/coverage-7.15.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3ff205ab5e3ecc670f6a4dd19d9cbf12ede53dd41cfc1e15716ec961ea6d314e", size = 222936, upload-time = "2026-08-06T13:48:02.391Z" }, + { url = "https://files.pythonhosted.org/packages/07/4a/612ff1e780b3fbfd637486f542f84adc5503873d8b5d279dec1ffeef9414/coverage-7.15.4-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:5172326e861a38b48b48befca15e0f477a26b283337a33a739c8fed229934e36", size = 253926, upload-time = "2026-08-06T13:48:04.382Z" }, + { url = "https://files.pythonhosted.org/packages/b0/04/d1cff1c2ead4708a6a79c01d3736b6a25bd38a36678398f72a8dd33dfad9/coverage-7.15.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:12b59c90084e3234fb11184886bf4a40f4f16a8c8f867be2e087b81f8e8868d4", size = 256523, upload-time = "2026-08-06T13:48:05.996Z" }, + { url = "https://files.pythonhosted.org/packages/b9/80/d34e13fb4b293cbdb9665838cf5522077b8ad14ef947550631a4bced36a5/coverage-7.15.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:349062d66f00b40fa2c1c222438bad25fabf755631b5d82937fe985c8008615c", size = 257759, upload-time = "2026-08-06T13:48:08.036Z" }, + { url = "https://files.pythonhosted.org/packages/0f/e7/2c5fe7636fdb0732fe0f09f308a5b066864078b7fc61f6678e8478554f2e/coverage-7.15.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4256ced708e598e05209bc1a8ab4074e04a51dba4c62fb45926a229af675ace7", size = 259890, upload-time = "2026-08-06T13:48:09.834Z" }, + { url = "https://files.pythonhosted.org/packages/92/28/9689f0858dfff59c2ea688938ab9fa2925631235df67126a42b6c5c70ae1/coverage-7.15.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d80f974b20782d9612c8b4c9beeca867074c7cf4079d1419843fa25a26428b25", size = 254121, upload-time = "2026-08-06T13:48:11.459Z" }, + { url = "https://files.pythonhosted.org/packages/f9/e2/785077c230c157243eb5aa9a26c3be260ecd02001bead54a3cada3df8e03/coverage-7.15.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2e179f19bfe1d31f8eeeaa12990194d761c4f62f0759661000bca6cd8729f40b", size = 255891, upload-time = "2026-08-06T13:48:13.209Z" }, + { url = "https://files.pythonhosted.org/packages/d4/90/e20371b17b40f912f21305c2db2f30efa3de306f7320fc916804872c85a4/coverage-7.15.4-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:8bc16bb47b7679670eceff71d78bfb7d6e5b143f6c2cd117487ec7c75e0d4b78", size = 253859, upload-time = "2026-08-06T13:48:14.736Z" }, + { url = "https://files.pythonhosted.org/packages/05/49/25371987ee459a5f67c0427fb75c74f9358e65f2c71fe75bf41c1b6c5fcb/coverage-7.15.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:1cd685005cd2c4200adfc14cf39a603b9320efab3f18a8f7f156d20c9cc3345f", size = 258011, upload-time = "2026-08-06T13:48:16.464Z" }, + { url = "https://files.pythonhosted.org/packages/30/6e/32e67467f6154bf4f1c4f63b05acc5097cba4237d45bbeeea446b52e8ac1/coverage-7.15.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:337399ad2c93b3acd2a937627dae8b3e86b66707cd3d3e856347999aadf1ef8d", size = 253676, upload-time = "2026-08-06T13:48:18.493Z" }, + { url = "https://files.pythonhosted.org/packages/03/c1/8b24192e89286399765155251f99ee9f070a9d637109018ac23d99b99f6f/coverage-7.15.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:96e257121228ec5cd2bb919276e94ac11074471bc37d68dbae0e8308cce15fff", size = 255453, upload-time = "2026-08-06T13:48:20.057Z" }, + { url = "https://files.pythonhosted.org/packages/16/6f/8b41ebdf67c87854e17c035336a90f1cfbad0c14c2a584301be6ff148718/coverage-7.15.4-cp313-cp313-win32.whl", hash = "sha256:c65a9e0dfc6143491879da4e13b5e30f8be192055de508d737fb14601edbd22c", size = 224605, upload-time = "2026-08-06T13:48:21.655Z" }, + { url = "https://files.pythonhosted.org/packages/e0/e2/2946c7f0b42b152ecb21ff1bdad72e3d301e790c0c487e4a86e8c9f69347/coverage-7.15.4-cp313-cp313-win_amd64.whl", hash = "sha256:2ff8f5e9b8f7a94f0c11c45631eee103dbcb7d63274edd12c56efe1be690b3b4", size = 225148, upload-time = "2026-08-06T13:48:23.376Z" }, + { url = "https://files.pythonhosted.org/packages/9e/83/3f4a69957f48ae7a0aba76c34743f88963d607b19e03f3f8e66f91cae0f9/coverage-7.15.4-cp313-cp313-win_arm64.whl", hash = "sha256:6e0a8a5083b096487d6cfced94cdd514d8f5db6f113610fb36c0620edb1028cf", size = 224536, upload-time = "2026-08-06T13:48:25.117Z" }, + { url = "https://files.pythonhosted.org/packages/ea/ac/748cf29eeb2d6be34a3176ce26a4f49e38085ee08e8935f05f6f26ed7e0f/coverage-7.15.4-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:770e9325ab5ea6d56f77e59b29ecfe0ac20b57a82a601876f90494a4dda0386f", size = 222608, upload-time = "2026-08-06T13:48:26.806Z" }, + { url = "https://files.pythonhosted.org/packages/0b/02/1abbf5c984677b0aa439cdacaccbf38d248939d8ef8fe1cc7a50d73edb77/coverage-7.15.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:d12b33a3a50a1676b7784dc8d00a0c6d66a9f2add4b85a041c19b6a7e53ef23c", size = 222940, upload-time = "2026-08-06T13:48:28.432Z" }, + { url = "https://files.pythonhosted.org/packages/eb/e1/ff8f9f53d9fcf586125b55d0b1f04ec1c14955fee41e83d5814bee141bb5/coverage-7.15.4-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:5669c8378ebde86f5def7a25d29586631b58acc27ffde04399f678f3dfc6e082", size = 253985, upload-time = "2026-08-06T13:48:29.995Z" }, + { url = "https://files.pythonhosted.org/packages/a1/26/595759762e514e81be1d7d01ed03444303bcd152226a6529998d253f9201/coverage-7.15.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:ff97a14362eef486483ed44042ca2027ea257df6ff768e62358ee0c9776925ac", size = 256492, upload-time = "2026-08-06T13:48:31.634Z" }, + { url = "https://files.pythonhosted.org/packages/24/68/b79aabac54d482be23b5fcdd4f4662bff24a78edc4ee29201726929936d5/coverage-7.15.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5a325e815318638aed1655d9c06e6d7c2d3d46c09231ce988070428a8762d734", size = 257837, upload-time = "2026-08-06T13:48:33.186Z" }, + { url = "https://files.pythonhosted.org/packages/09/0f/bf7f297885a5bf6fd71e5782404e0ff059ca09e8711ceb3a08544abde45a/coverage-7.15.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:474223409d88eb20d2d6a0d37ea60e8647a65a90cc008dc1f0410af5f64f1e0d", size = 260152, upload-time = "2026-08-06T13:48:34.75Z" }, + { url = "https://files.pythonhosted.org/packages/fd/f1/296744e854ff8368542343457414380465e9ceefb9192342feb9d3bc461d/coverage-7.15.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7f2f62ae3cd189dd2e13aece758c57b3eecbd27be070dbd4cbd10936049e5dbf", size = 253978, upload-time = "2026-08-06T13:48:36.434Z" }, + { url = "https://files.pythonhosted.org/packages/55/b0/bbdb2e9057493e66220a2e149ca2d301ba0e3a58a83bd6b90de9826d16f3/coverage-7.15.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:39ece820e29e0a2ba34b3ecb3be83c27e997eed8926f2ba6fe7ce7a0bda5843b", size = 255846, upload-time = "2026-08-06T13:48:38.317Z" }, + { url = "https://files.pythonhosted.org/packages/96/e4/38015b2b6d21258713bd17e76b59d033b191efb5703589cffd037dfbca20/coverage-7.15.4-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:f21b56dcace11dfe013014201f577dcd592b2a9b72182d930361b47cf6f73f25", size = 253808, upload-time = "2026-08-06T13:48:39.993Z" }, + { url = "https://files.pythonhosted.org/packages/0b/64/0d515c1e60ee6fbfd1a0e79c07cd87d388a233b7adc37758735677203808/coverage-7.15.4-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:93a3a0b662abcc10c73a47cbc72cd60f63618d6989fb2d1286e50eacd974f303", size = 258081, upload-time = "2026-08-06T13:48:41.971Z" }, + { url = "https://files.pythonhosted.org/packages/91/71/04d9e7a3642146c6351338aef4ef85ab11dbbb54744c13245caba1aad1c0/coverage-7.15.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:141fae2cabf5569b782c10afc4c850ce10f618c13f8db54765cba99cc839da1f", size = 253624, upload-time = "2026-08-06T13:48:43.731Z" }, + { url = "https://files.pythonhosted.org/packages/b4/a7/6c28b74c81ebff66987b0e2522ba5cffa3e90b0c33cb6a2eb264d4ee8cf1/coverage-7.15.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:81294c7e6ab30c5f74c0353b11b2fd6320e72d9bee6ac73b357caa8b916323a5", size = 255280, upload-time = "2026-08-06T13:48:45.58Z" }, + { url = "https://files.pythonhosted.org/packages/52/af/bc19996a7014b98d7bbb0f0939453c67074af65784a3aa16a789a07381fa/coverage-7.15.4-cp314-cp314-win32.whl", hash = "sha256:7bbd7d6418e0dab31a206af5203bd43ae36edb8e7fba1940b055d3e9249290d7", size = 224768, upload-time = "2026-08-06T13:48:47.525Z" }, + { url = "https://files.pythonhosted.org/packages/ee/90/219484e476d6e101ba0a444852579e05f5b75c37c611a42ed1190f73ef62/coverage-7.15.4-cp314-cp314-win_amd64.whl", hash = "sha256:f0204ed122758782970526057093f448051a39db9d810d4e344bb87a3546f425", size = 225259, upload-time = "2026-08-06T13:48:49.513Z" }, + { url = "https://files.pythonhosted.org/packages/b7/66/fa77daf4e383e5f776dac62c2409b6af81910ae6fe326bd5170dba74cc63/coverage-7.15.4-cp314-cp314-win_arm64.whl", hash = "sha256:9e71e7bc71c686a123347ae47a0de33a175e797a85bb57b791492adf4eec8ed8", size = 224684, upload-time = "2026-08-06T13:48:51.235Z" }, + { url = "https://files.pythonhosted.org/packages/58/5b/f03bf0ce362bbf3f785fa5219620d00778d4ac6fc9e407734828e9c672f6/coverage-7.15.4-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7c922735321eef3f87c280a3d39afff6b646723a2880b862cda4ac7a093b8aa8", size = 223338, upload-time = "2026-08-06T13:48:52.896Z" }, + { url = "https://files.pythonhosted.org/packages/0f/76/e77d0ae22501831cc9f92193e8a957a5caa1dd177f90a6d1d9b106242d92/coverage-7.15.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f41c17c4668a655ce96d090d8d5ffdc24ef64b5a02f9753884d08483e8a4a41a", size = 223609, upload-time = "2026-08-06T13:48:54.688Z" }, + { url = "https://files.pythonhosted.org/packages/82/1a/b1f089da8d38ac612fa2dd6dc7f4a1a7657d12f3e261d2996edd3a838d0b/coverage-7.15.4-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:46822e9b6ff1c6a72b518c162c44a8f45a61a1d609c51084bf5b16c023c5037b", size = 264970, upload-time = "2026-08-06T13:48:56.403Z" }, + { url = "https://files.pythonhosted.org/packages/bf/31/e66d98d6e9c7fcc88470f1e234eaf6b1950dc0dfbf797f7282c1c861da24/coverage-7.15.4-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:3d6f4955b73b5445271379a59e3792b0d978f42d4a01e0cf7a67d9c33a3bb0a5", size = 267088, upload-time = "2026-08-06T13:48:58.41Z" }, + { url = "https://files.pythonhosted.org/packages/59/a1/ae94eb2c541add426378408379f233591e069040b1e2cdb33df9498a0682/coverage-7.15.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3fc9e047706fb4a9abb54f719d3aa643e80e5bb3818182c40aee01ac0f0247ba", size = 269508, upload-time = "2026-08-06T13:49:00.42Z" }, + { url = "https://files.pythonhosted.org/packages/9c/c7/88a10694a1c6a213569766aba9f25847b28155d4ac731b13226db216356d/coverage-7.15.4-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:05e491d4f3165d62d4f5c8fd48dfeabf2ae8f42cbbd484319af33ea851b78982", size = 270629, upload-time = "2026-08-06T13:49:02.234Z" }, + { url = "https://files.pythonhosted.org/packages/b3/34/d8b8232e5e55169933b59aabcef2fedfa4b9d8897361bb80fcbda146505f/coverage-7.15.4-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:226c66e80ec0598d3b9b4874123df167ccca342aca8714f77cac6829688ee09c", size = 264043, upload-time = "2026-08-06T13:49:04.102Z" }, + { url = "https://files.pythonhosted.org/packages/7e/35/58b009dbf8c471c7224716478b9fed4a7e1af15320e1ed41660978504663/coverage-7.15.4-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ac41cc14bebda0dbfb0628036b7f75706935c95bcc07fefe9a0f93614aa60a57", size = 266963, upload-time = "2026-08-06T13:49:05.821Z" }, + { url = "https://files.pythonhosted.org/packages/62/aa/57fbda1b42c892968273c56b6ee9dc0f1310850859230a507bc7873b1f65/coverage-7.15.4-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:8af623e5cd92080acddd02b38f2f406a2c3a0893c38950b211890361448fbf26", size = 264569, upload-time = "2026-08-06T13:49:07.706Z" }, + { url = "https://files.pythonhosted.org/packages/98/8a/360e6e7f24d477b7e889703af0afa878d15b6d4d8d2a822b2835c169a879/coverage-7.15.4-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:07545711d4f0f32852a18f18ad11f76f0109909d09e78b9008b4cfc67e829429", size = 268299, upload-time = "2026-08-06T13:49:09.587Z" }, + { url = "https://files.pythonhosted.org/packages/4e/89/6f701261aee21b6b5fa8f7872229406dc917e125069448292223bf213606/coverage-7.15.4-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:a0865421cfdc53654b342d515e5a233187590882d20b95752150e53f65460017", size = 263413, upload-time = "2026-08-06T13:49:11.604Z" }, + { url = "https://files.pythonhosted.org/packages/3f/0f/6f04036edc260ed425af83e834f627fad48941ce97b50bfe6edd8b6fa623/coverage-7.15.4-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:460115e32ee40566476db5048f9bec1e842c127ad8e6f8be745aad3ac9cbc839", size = 265725, upload-time = "2026-08-06T13:49:13.38Z" }, + { url = "https://files.pythonhosted.org/packages/c4/ce/d19b5d4d5c49a7bfb925fd74310fee7d28bc99520ac3367ccbc54e662518/coverage-7.15.4-cp314-cp314t-win32.whl", hash = "sha256:cbde877ef9dd7baf272b9bfef2b8a25edd45d9170fc326951dd20eb480335e85", size = 225079, upload-time = "2026-08-06T13:49:15.265Z" }, + { url = "https://files.pythonhosted.org/packages/26/bb/7aa1b3b173faee0679037ca950bbbe1247273656697994d8d13f80f8d4b4/coverage-7.15.4-cp314-cp314t-win_amd64.whl", hash = "sha256:3da9e92d1c551fd7563833e9ade686efb0c4b7363ab7681a94283958c950bf5e", size = 225911, upload-time = "2026-08-06T13:49:17.279Z" }, + { url = "https://files.pythonhosted.org/packages/81/1c/4ea9e47426d80038d9222db3c4534cb6021a74b237d3ff97ffd33b6600dd/coverage-7.15.4-cp314-cp314t-win_arm64.whl", hash = "sha256:3a54f5a0d85050c73a38f6793090ee83974531e67fe5e57a1da9bee11398aa5e", size = 225219, upload-time = "2026-08-06T13:49:19.293Z" }, + { url = "https://files.pythonhosted.org/packages/2b/c4/dc5d2ac8f9142e7ec7de66e7bf0591db29d78955a040bd915870d9c0e657/coverage-7.15.4-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:2c9872e4d9dc5d3cf616bf4b382f5a00359305a5be666a3dd0b5cdb4e49597f9", size = 222604, upload-time = "2026-08-06T13:49:21.279Z" }, + { url = "https://files.pythonhosted.org/packages/70/39/33e63df81fe2ee100897451841c821467635923e58e37c6bd4b46dd8106c/coverage-7.15.4-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:e101dbb4b9b72f0cddd8cdc8c9c5b47f456766f5e0ac82dbfb75e5c55409b78a", size = 222944, upload-time = "2026-08-06T13:49:23.187Z" }, + { url = "https://files.pythonhosted.org/packages/99/1f/ef3ffb5557febc75a0d97aa459d0266d7d741110265121cc6d8539343d44/coverage-7.15.4-cp315-cp315-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:7d1abebdb047729e852b9c77a00497dfbeb11eb3a117e037d7dbc3ac8e5f5c54", size = 254050, upload-time = "2026-08-06T13:49:25.008Z" }, + { url = "https://files.pythonhosted.org/packages/6f/f5/1f0f6f77698c3601ca0ae7431e34b24c62ca2f06fecb23b73ed1f651d2be/coverage-7.15.4-cp315-cp315-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d28a4a899354d0ea6214cc59b4fa19eefbce1b9ff1688ab579acf49e894bd3fb", size = 256967, upload-time = "2026-08-06T13:49:26.896Z" }, + { url = "https://files.pythonhosted.org/packages/03/7a/2ed9bed79925f4367c83c77f66a89e5ca7229c288d2d19ad5f36d1ca0070/coverage-7.15.4-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ffb3c2aacea411cc7e1d27712490c11108e2de1d39019ae32915493a59a8b9ed", size = 258587, upload-time = "2026-08-06T13:49:28.692Z" }, + { url = "https://files.pythonhosted.org/packages/45/8c/fa34044f71b7cc4ecb6da9c2408770959b0591fa9b5fb6fb6bca38f94298/coverage-7.15.4-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a9447978a92f405d301123cfd39ff49895490efb769a758fe2734c7f631bf8ce", size = 260785, upload-time = "2026-08-06T13:49:30.472Z" }, + { url = "https://files.pythonhosted.org/packages/4f/54/d5727ce36b4524a7394ab9f5f1df378e1f23affcdab01037dc8655185cc7/coverage-7.15.4-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:050467a7983b8e2fe7dd41a78bb30c3e7f8c0b8cafda14b1c46f8b5e3cf2dd3c", size = 254545, upload-time = "2026-08-06T13:49:32.271Z" }, + { url = "https://files.pythonhosted.org/packages/dc/e6/6e3783e576719590194bdffb6dd6d85490801785b7c331e35a245d8cb8b5/coverage-7.15.4-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:d003b7a5708ddad5c206c79607a6b92abb6fc13c57d99d8a4468cc03a2941ced", size = 256682, upload-time = "2026-08-06T13:49:34.089Z" }, + { url = "https://files.pythonhosted.org/packages/dc/f2/bacdbde18b69ed2de424fcf64d9fb0a4913753d4f0eca8bae9daad69f4bd/coverage-7.15.4-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:c38efe30fd74e5c19e9433f11fb1f5dc9c6522770971b7c6145bbaa413dc8800", size = 254560, upload-time = "2026-08-06T13:49:36.052Z" }, + { url = "https://files.pythonhosted.org/packages/6c/a3/1fb927196e3477c1b48831169ab58ba08f451ba87ae311ff1de68b26a616/coverage-7.15.4-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:1f4f826d70f772ab8b0c052329580d7fe8b8abd191e4ce0c8f81aec6614665d3", size = 258792, upload-time = "2026-08-06T13:49:38.01Z" }, + { url = "https://files.pythonhosted.org/packages/41/58/30d4c149c69053de0edfe325614c1d28d508f62b1783e0e4a234d2e49136/coverage-7.15.4-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:4a4bf917c9953f57c957be31c1cd504e3bd2f34d4a352b9d391a3025336f6768", size = 253968, upload-time = "2026-08-06T13:49:39.934Z" }, + { url = "https://files.pythonhosted.org/packages/89/e4/77f639371b918aad30dda4051f95404b43578f7f2e2f87ba73e02ed1ff37/coverage-7.15.4-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:1c9bf40ebef178a45192c75c4964760bb261b0e6ad725da5fc4c93f674f19753", size = 255893, upload-time = "2026-08-06T13:49:41.825Z" }, + { url = "https://files.pythonhosted.org/packages/5c/62/13be29b3ddab35f14c87967a4820a05106d2a3eccb4fa4ff550bf30b75e0/coverage-7.15.4-cp315-cp315-win32.whl", hash = "sha256:43619d04c3671792d2c4706ae8bf45e265dc87bbd4078189ef8b847ea1e74be2", size = 224768, upload-time = "2026-08-06T13:49:44.08Z" }, + { url = "https://files.pythonhosted.org/packages/a1/70/af0c6be0f964af6954f6b74bc109b0dbca02824696d2520fb17fe1ab06e3/coverage-7.15.4-cp315-cp315-win_amd64.whl", hash = "sha256:be619439dbcd31a2eab10b32de9fff62c26ed4bab69dc32b8363fdaaa0882809", size = 225242, upload-time = "2026-08-06T13:49:45.899Z" }, + { url = "https://files.pythonhosted.org/packages/4f/2d/f3bd3aab899fc9efc18b53133ee68f5f98574ef480649b23e12962226387/coverage-7.15.4-cp315-cp315-win_arm64.whl", hash = "sha256:def597967dafc2e8d97c9097ea453c464e0bb8ed38f193a43070f10dc623bb6d", size = 224674, upload-time = "2026-08-06T13:49:48.322Z" }, + { url = "https://files.pythonhosted.org/packages/f5/ca/f69251cd63eabc6438321aea22148754cce758a26bde07dd490e3fe7cfc5/coverage-7.15.4-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:c7dbc748ac8a1e3e59a2b28bea47675e6e778081dbbf081bde0d75def2fcbe1d", size = 223333, upload-time = "2026-08-06T13:49:50.293Z" }, + { url = "https://files.pythonhosted.org/packages/a7/a7/037b53b2885b0d8447064432491a4d5a1014cd9f97a594d53acd0c04541a/coverage-7.15.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:2413074a5ecbb61a01a7888fc72db0ca324d13588c5b38bc0dd8564cdcdfea26", size = 223630, upload-time = "2026-08-06T13:49:52.637Z" }, + { url = "https://files.pythonhosted.org/packages/80/4f/152b8a4779ae90da11bb24f7467df8a59f0be48a5c52acb856325ca48289/coverage-7.15.4-cp315-cp315t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:4e6f6f632b7b2f714bf7a1346e8f97b650ee71f3c298aaad42a2ab60f0f07645", size = 264489, upload-time = "2026-08-06T13:49:54.52Z" }, + { url = "https://files.pythonhosted.org/packages/10/2d/84b4b9e0e1dd6528a51920ff7031f35b789382e467a28ec6a5a578cb8812/coverage-7.15.4-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:8df457da2249d3c75ca2e5e835d59c725abfe92d27fdff6cd99eed85b51d5e9a", size = 267567, upload-time = "2026-08-06T13:49:56.721Z" }, + { url = "https://files.pythonhosted.org/packages/53/fc/ba01cc25299f9f8a2c8b02d3b28c53f3543d9fbfbe4e74fa2760b48f163e/coverage-7.15.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:050f66a08805acb5b8a23c6d4a517b1ecf82c08e81ed0e4bd727df065e5c6624", size = 270123, upload-time = "2026-08-06T13:49:58.736Z" }, + { url = "https://files.pythonhosted.org/packages/cf/d0/db2647cbf40b14f8c308f94ff7bf89c06d564e59f396906edf50086ec788/coverage-7.15.4-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1587fb771d1ccceef708fdde1e5af8c7ed24b486b61d13a321acb7d8145390aa", size = 271107, upload-time = "2026-08-06T13:50:00.811Z" }, + { url = "https://files.pythonhosted.org/packages/70/ff/4d2d17924552c458bb4f77dd631f0e3bc92fbbdf2d2d916cd4b33bbfd5b1/coverage-7.15.4-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8b4f1c3a69ca580f3fbd6b2046915f536d7f586874f25c1bb23add2a3c88d50f", size = 264955, upload-time = "2026-08-06T13:50:03.023Z" }, + { url = "https://files.pythonhosted.org/packages/ee/de/dc010c7a3691f396d93bbc26bfcafa1c2a3a351cd520470f15faf5795bd5/coverage-7.15.4-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:ffb58d7eff5b7f6ecc6fa21d6288ab7f968a212cb67d682c269c09b9eba3b66f", size = 267949, upload-time = "2026-08-06T13:50:05.557Z" }, + { url = "https://files.pythonhosted.org/packages/78/ea/dc96a11375e83c045c2f7c61fb6918277cfe9401db7c0f7b1d111a84b2e5/coverage-7.15.4-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:d9df165544774574ee004b953023d1bebada1894a80b1052a43d798b0f676e67", size = 264421, upload-time = "2026-08-06T13:50:07.612Z" }, + { url = "https://files.pythonhosted.org/packages/c8/86/b77131a0f9503ce461cd577076147d7a9040f0c5dda772686f729e2cc9cb/coverage-7.15.4-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:f9de0a24a4079b53e523b5c5e2c5945ec251ab486652659955187cf255a259bc", size = 269121, upload-time = "2026-08-06T13:50:09.58Z" }, + { url = "https://files.pythonhosted.org/packages/24/24/944bc35007862955e7ebf05754e645419dcf5d7526c52735cfa2715e8ebf/coverage-7.15.4-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:150089274bdc9f940628552cb92844e0223c987f1902ab8efe9f45a2ec758d88", size = 264565, upload-time = "2026-08-06T13:50:11.722Z" }, + { url = "https://files.pythonhosted.org/packages/c7/cc/a3bb9f93e7e740659163e2ea584f8196ddcd2c456a5dbe15f6c50105fec1/coverage-7.15.4-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:a58a94fed5da6997d258e8f7668c1e195fbd04a691d781b7558f1e468f9e68bc", size = 266522, upload-time = "2026-08-06T13:50:13.786Z" }, + { url = "https://files.pythonhosted.org/packages/49/dd/e0e40f3560d878d888c580698ff5ad1179f5e1c3ac949684ef66b41a3817/coverage-7.15.4-cp315-cp315t-win32.whl", hash = "sha256:ebd5a6d8466ff30836572f3ba2cae8a5e8f85029b1c6d5e2ed338dc472a5166a", size = 225068, upload-time = "2026-08-06T13:50:15.825Z" }, + { url = "https://files.pythonhosted.org/packages/c6/7e/37732ea80eebc30e976e4cdab15c190bc42d96959a42e38ddf6f8c60468f/coverage-7.15.4-cp315-cp315t-win_amd64.whl", hash = "sha256:288bde2a2d7ab6b6c2d7252fcde8b524387f2d970bdba9658fc6f8bbcaef0f9b", size = 225895, upload-time = "2026-08-06T13:50:17.928Z" }, + { url = "https://files.pythonhosted.org/packages/c6/08/1e00f7923eaaba45fb3d51dd794125fc766304b1df264f3a9c6557bfb30e/coverage-7.15.4-cp315-cp315t-win_arm64.whl", hash = "sha256:68be5e1de60ff13c9095bbec0e5a7fa45b33b101752215b91345ea1f61c4a278", size = 225213, upload-time = "2026-08-06T13:50:19.981Z" }, + { url = "https://files.pythonhosted.org/packages/b4/d9/e70c286c979378f061d8266e279b686ab0b0b688e1fe0af864684f23a77d/coverage-7.15.4-py3-none-any.whl", hash = "sha256:964730a1e9de9c0cf11be6a1a3c79ce419c34882842abd256086ba4698705e84", size = 214332, upload-time = "2026-08-06T13:50:22.192Z" }, ] [[package]] @@ -1023,55 +1053,55 @@ wheels = [ [[package]] name = "hypothesis" -version = "6.165.2" +version = "6.165.5" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "sortedcontainers" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ea/73/fc3743243603dc49911a1ec073a3a524ea8e1c7d48218d3c2a3faa9a8709/hypothesis-6.165.2.tar.gz", hash = "sha256:680a1adf523ac792b46064f425b112ce6c08a7a8f50e65d08e029de6aa11df95", size = 502277, upload-time = "2026-08-05T21:32:43.713Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5c/63/46c9908fe7bd5ffa5002fa88fe289dfe6d3cea3fad1ab8942fe11f1c8a2b/hypothesis-6.165.2-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:33a7303566e660664f3f02ea1df85f7b966cd6723165c696996cfd8630913b3a", size = 781704, upload-time = "2026-08-05T21:32:03.548Z" }, - { url = "https://files.pythonhosted.org/packages/c5/7f/fdce62542a514f6b33c4fc0a760e6d17bb57602b28cb079b78e55b8ea32d/hypothesis-6.165.2-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:06d8fe4c82a935f67e610c99848360f5caeb04f547c7d7a830a5c74fb96f053a", size = 777243, upload-time = "2026-08-05T21:32:17.546Z" }, - { url = "https://files.pythonhosted.org/packages/9e/c8/39cd922bf3e1ec84977b768d4e8be31ae051e3a6b400b4fdd7ebcddb1eed/hypothesis-6.165.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de2e3f6a6f75c876be481138c6c0802ebe10deef9f13ce1cdd6e0ed21d8e1e28", size = 1106492, upload-time = "2026-08-05T21:31:47.844Z" }, - { url = "https://files.pythonhosted.org/packages/0f/91/7bb502379a8dcc43f2538530c05cf16fd4e386afa587d65cc289484425cf/hypothesis-6.165.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:21668cb5a8a694d45ff4c43f20a8fc577a47467b5102c680a43638b027136368", size = 1135105, upload-time = "2026-08-05T21:31:49.453Z" }, - { url = "https://files.pythonhosted.org/packages/e5/04/4ce8ae1bf78d09d7543ab7037a3beedc7f3d963c7aa04e82842415284689/hypothesis-6.165.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eea4ab5cfdd6c6a23a60777559ea06c34868234fff6542ff6125c0250429348e", size = 1156034, upload-time = "2026-08-05T21:31:44.687Z" }, - { url = "https://files.pythonhosted.org/packages/49/de/b074d899f4a04fa8b99a5bbd66f209c1c02bc21f9f87404539b28b99aff0/hypothesis-6.165.2-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:0a6add02d9b3b73b59f4d69f5b15abbc07113cd335cc140815cec2877e6b496c", size = 1111344, upload-time = "2026-08-05T21:32:27.211Z" }, - { url = "https://files.pythonhosted.org/packages/e8/38/5a8514683a181f82a8ad9f6d084b704fea7a97c9814033939fc493b55fca/hypothesis-6.165.2-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:11013896b6a2ed497079558cb9f89e8b3b564f8859782b38f72cfc1dbeca66ad", size = 1148115, upload-time = "2026-08-05T21:31:01.009Z" }, - { url = "https://files.pythonhosted.org/packages/88/c7/08cf7930d8bec7f1df971c948af2ccb5a402d5b8b19b306af655a603b180/hypothesis-6.165.2-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:4ceabc69a95e761f381663c6452537fde12a2a6e0275e095b6822c0e0f3b1364", size = 1280321, upload-time = "2026-08-05T21:31:14.843Z" }, - { url = "https://files.pythonhosted.org/packages/c5/91/c9ebb7da3b6e06c47aecceb959cf7df6af75025663af543373c5692f97ac/hypothesis-6.165.2-cp310-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:11e1ce261765ffa6acbaf540358426519ca4a5e46b825cf39b429c77c1895689", size = 1408134, upload-time = "2026-08-05T21:31:27.383Z" }, - { url = "https://files.pythonhosted.org/packages/ed/24/13c2fd9f253ba3a92d4aaa61ae45a8b130df57ab5bd6fc481e2aae520e36/hypothesis-6.165.2-cp310-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:b0250099b2e55d72872319918aacc501110a182938a3d56bcae4a999bee5db08", size = 1280884, upload-time = "2026-08-05T21:32:00.188Z" }, - { url = "https://files.pythonhosted.org/packages/6e/fa/2820bdbe0660394544b9e120b03ea7020702d7fa5c76236166de6ababc9d/hypothesis-6.165.2-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:96d02928d1a0b7d59e39fd8ada75f0b7d0377ff29f91c94109f92fc2dab9af74", size = 1322998, upload-time = "2026-08-05T21:31:24.373Z" }, - { url = "https://files.pythonhosted.org/packages/f0/24/38752794eb821f5c77da08523602003c344f3498fce09f20741cd5b5e29c/hypothesis-6.165.2-cp310-abi3-win32.whl", hash = "sha256:0f2044093c8244d73893e755a7fa53154b7eca57b37e1427d9b0d9948f6c2b3e", size = 667506, upload-time = "2026-08-05T21:32:10.547Z" }, - { url = "https://files.pythonhosted.org/packages/5f/71/b28f714a127017750e450d152aa4fbff51bd144c6840090d28b529b408d3/hypothesis-6.165.2-cp310-abi3-win_amd64.whl", hash = "sha256:2aa30716066e5ee7750e56b8f90cefaf4ed28c12b4b1d66cef40014fd3f95196", size = 673650, upload-time = "2026-08-05T21:31:25.726Z" }, - { url = "https://files.pythonhosted.org/packages/98/81/a9039e7eee38523e2ad13e9e4e70c508f25d4205fb4c6ceb98632547ca82/hypothesis-6.165.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b24f1b238deb97fda828a939931de3210f5cef21e87fe0b941fafbeb55ead676", size = 783294, upload-time = "2026-08-05T21:31:56.881Z" }, - { url = "https://files.pythonhosted.org/packages/8d/e5/120642320291d8d117a83491d93527149ddbd15e56399274741fc4bd3a9a/hypothesis-6.165.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:306763ce7186e08ee30dba409b320873d1afc54adf76b44c6bf83b5867d17359", size = 774867, upload-time = "2026-08-05T21:32:05.489Z" }, - { url = "https://files.pythonhosted.org/packages/b5/ef/251607eb2446fb44e8faa83e30aa1b6cc281b6eca5d0ecaabe7527e3395d/hypothesis-6.165.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f878ebc5c33e4e8e8a90bd3d7ccc3f3a7370847aa22243536e673047f0f4c37", size = 1105307, upload-time = "2026-08-05T21:31:53.719Z" }, - { url = "https://files.pythonhosted.org/packages/54/f1/de30869d83f00137a664319a4acb0ba8b1a9e2c879afdc12abb1b4c703f7/hypothesis-6.165.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d726513b32cc6407667ac0812fa3517408f933b89b16b6b84f296335eec18432", size = 1155348, upload-time = "2026-08-05T21:31:58.536Z" }, - { url = "https://files.pythonhosted.org/packages/fa/2c/8925c2bddf6e105d947a04511cd5d536eabc8d4ed926518a0d1672ede007/hypothesis-6.165.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a700c0e193707e3b6f1b23f1d5f534896dd9f79bb2a2340582579bad5f5b59a4", size = 1278124, upload-time = "2026-08-05T21:32:14.049Z" }, - { url = "https://files.pythonhosted.org/packages/b9/00/e285e7987e96d74e229fcb94c58dd8e85290966fc2040fbac4b081fc49c9/hypothesis-6.165.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:50d50e313dfff2e79c754b92a4c88c479dd9e102a56c60caa5b3d6263caa1b02", size = 1322340, upload-time = "2026-08-05T21:31:11.671Z" }, - { url = "https://files.pythonhosted.org/packages/51/7a/990e802222b3a88a284a872fc41339e39d8b619e5266aae45ef1c5da231a/hypothesis-6.165.2-cp312-cp312-win_amd64.whl", hash = "sha256:e2493b71a6e75dbd9ab33f8ab3920a6850a7965de55baf9725738a227ef3bfd2", size = 670805, upload-time = "2026-08-05T21:32:19.278Z" }, - { url = "https://files.pythonhosted.org/packages/22/01/add18f19d5e5f084a59709f0dcebf3cb1edeca475ce8a31573dc33891e66/hypothesis-6.165.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:e2bf15d05264ec9da8d55c3843902f906ced5e84fb3da924eafe165697ab4638", size = 783183, upload-time = "2026-08-05T21:31:55.305Z" }, - { url = "https://files.pythonhosted.org/packages/8e/4b/df2e4c24d208518a6a3dab7acabad7f5ec6c5bb0f4d0bf1701d2fb7206ce/hypothesis-6.165.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3748153d4f64d347f8c988dd41fbef3513b66819e73e9209b1c501bf0d716a13", size = 774829, upload-time = "2026-08-05T21:32:01.891Z" }, - { url = "https://files.pythonhosted.org/packages/72/a0/b75a001efbde704ff2188924a4d4bb3cdf7a22924dc51c155115af64858c/hypothesis-6.165.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f689976e0eb578afbe8ce37669cb637f00f7c545ad303412947ee4abe2f29ce6", size = 1105224, upload-time = "2026-08-05T21:32:35.189Z" }, - { url = "https://files.pythonhosted.org/packages/71/f2/4942f510c6441b5d60dc7f0d8d2af74fe444b62d3af565bdf42d9b6b803d/hypothesis-6.165.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f7c68a5684b2e2ad3c33500198a6073b3d04493fd7b1ef34937645ad092b797d", size = 1155166, upload-time = "2026-08-05T21:31:46.408Z" }, - { url = "https://files.pythonhosted.org/packages/48/11/405ebff50c6949518d34f487017412d5b8f8ee9239e50ecdfdd99a745f4b/hypothesis-6.165.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b40db922ccb53fb77c68d944748a3eb5b945402967b64093d9ba970d028cf1af", size = 1278170, upload-time = "2026-08-05T21:31:43.116Z" }, - { url = "https://files.pythonhosted.org/packages/73/ff/93ad0f4b55100876604d2c316a8c6e0ee037cb0da925caaa478709e504b0/hypothesis-6.165.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:d2fd48ec969b2dbe1c8e25dc86d199c6820b9222846469449b997f5546383378", size = 1322061, upload-time = "2026-08-05T21:32:07.217Z" }, - { url = "https://files.pythonhosted.org/packages/14/37/14b655c664a957e44c7f59d9498e53d79b55f1b752a1bb38fee9da403e9c/hypothesis-6.165.2-cp313-cp313-win_amd64.whl", hash = "sha256:9cf13225121280036ea5a8ff8babb82ec27a4736aea669bbe0bc9839d254575f", size = 670824, upload-time = "2026-08-05T21:32:21.25Z" }, - { url = "https://files.pythonhosted.org/packages/6f/ce/a2de75f1a12b6670edfca890794daab685a63ab1a2e36f28dc2c4d8e831d/hypothesis-6.165.2-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:66be9b848bdcb29132b18de6f574b89b392024c7de442acb393edaa1540cb548", size = 783398, upload-time = "2026-08-05T21:31:37.916Z" }, - { url = "https://files.pythonhosted.org/packages/02/8b/bf01b5f356f64a8af28be2718674e23ff7c0a4dbc5f476295be624b1a5ad/hypothesis-6.165.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:e51742efe8466cf89e26cb94843db8854bd0673a6d80da7e3d1ff6bd9dc006db", size = 774963, upload-time = "2026-08-05T21:31:10.053Z" }, - { url = "https://files.pythonhosted.org/packages/a8/4b/9ad06c5a5613b6d175a7fd1a518a9732bcc4772c0cb24f6d7e5fd63f7fed/hypothesis-6.165.2-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c648ee54cd734261e1615d80c2ebbd679d6dfbba6ef5aa672354c6ca62b6f446", size = 1105721, upload-time = "2026-08-05T21:32:29.252Z" }, - { url = "https://files.pythonhosted.org/packages/9c/f1/04c8ebe621c8b832106859f9425f91d049a96ccf99c3501f2905f3e1291a/hypothesis-6.165.2-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:032292cbffc0743b2fe4337a30c21ea9703a70a0021d39bf0c3e68bce7baab18", size = 1155349, upload-time = "2026-08-05T21:31:39.636Z" }, - { url = "https://files.pythonhosted.org/packages/6e/23/41fe5e805638dcb6a1b70c147e909d254d9f09db5ade7a3e790c94ec926e/hypothesis-6.165.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:5dc64171b06472f0b6c2e54bdc25687987e560e15133cf52f55d9ef4c747ebe1", size = 1278502, upload-time = "2026-08-05T21:32:23.405Z" }, - { url = "https://files.pythonhosted.org/packages/ce/42/54fdfc954314980d2b0eabbe57ef2960d85f3b1acb95f3326ff931ed349f/hypothesis-6.165.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:8e5a823ba918641af8177c121f122964d471db2ab1d07c1fe229c77b3a5ab7e8", size = 1322379, upload-time = "2026-08-05T21:31:05.39Z" }, - { url = "https://files.pythonhosted.org/packages/68/db/3667633b31b2b423b320fec4b7ac154e74d6b4a122fadd8e06f9d9afbef1/hypothesis-6.165.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:70966ab7dbe0ea9644eaed8324e037f05ac6a8141646b977da9e77813dac6ed7", size = 614909, upload-time = "2026-08-05T21:31:41.464Z" }, - { url = "https://files.pythonhosted.org/packages/2c/d9/0168c0d6ea32c195225b0673ee8cb7b61de6841d62c87d614d26add35770/hypothesis-6.165.2-cp314-cp314-win_amd64.whl", hash = "sha256:a5b913acd896f4f80597dd38966cd13984a1cfd45512498e8cf054aa7c92ffb9", size = 670684, upload-time = "2026-08-05T21:32:37.076Z" }, - { url = "https://files.pythonhosted.org/packages/21/e4/61cea938488b6958f07b8249bf37fcfb2802367e2a6af65afe82b05ca18c/hypothesis-6.165.2-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:6fa46589088966083ce653f908560cdd3330274cfafaaa65d1fb29b5f6681644", size = 781982, upload-time = "2026-08-05T21:32:15.899Z" }, - { url = "https://files.pythonhosted.org/packages/15/73/b4f9ba3e4b988b567d887b0857962e841b227a81a02ea83ae520e2001c31/hypothesis-6.165.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6b5b922603879b4788447583928eb1cf2e1aafb9ce27f3a7234b7a4557d089a8", size = 773430, upload-time = "2026-08-05T21:31:28.913Z" }, - { url = "https://files.pythonhosted.org/packages/9c/e2/6fb4a2edbc7775dfa4d3950e3537239c6d957eeb6c571275edfd79a2b981/hypothesis-6.165.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8ab3a6b5bb3302f7dcd65b07dcdc0ca353c8c151567dffeda826977e765caaf9", size = 1104317, upload-time = "2026-08-05T21:30:57.765Z" }, - { url = "https://files.pythonhosted.org/packages/5d/06/9479b2acc58996ae18300becbaf910d7c542b5054a47ba05c28bdacd08f1/hypothesis-6.165.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:09f1c626023b68968d2cc5fe1e31548109f4406d81a2c3017b3de9fdd3a02e7d", size = 1154232, upload-time = "2026-08-05T21:31:30.368Z" }, - { url = "https://files.pythonhosted.org/packages/e3/9b/5b5cfce5445a807d042ca5a1a470606613835842d99488a199d994584cae/hypothesis-6.165.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5c95808ab851498513192268e25f40bccd1c3719384c91535bbec3eedea39760", size = 1276739, upload-time = "2026-08-05T21:32:12.324Z" }, - { url = "https://files.pythonhosted.org/packages/2e/aa/6a731776ccaee13dba0624a73f01935fa174f39647ad463a495dcb2206a8/hypothesis-6.165.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:4a1c8bec789f21dc10620ce99e15fcd4f7737b9b4cfa571cdd93e01a17b7b06b", size = 1321119, upload-time = "2026-08-05T21:31:21.113Z" }, - { url = "https://files.pythonhosted.org/packages/43/a1/5d2c7c1346a0089908a3974c9e40ce223c22dd291dfe5df69a8c8cc64b98/hypothesis-6.165.2-cp314-cp314t-win_amd64.whl", hash = "sha256:458c891dfc00133bc4ce2e6c9716838f80f2fd96caf306f5eef42ad02aa4d972", size = 670831, upload-time = "2026-08-05T21:31:17.998Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/7a/3a/b840ea8b26e0c4795584dc93c832c5d1a9ff37db1818cc91b2ee8110f757/hypothesis-6.165.5.tar.gz", hash = "sha256:0df7fdefd2e10bbfe7d690eb22c7181a739e8040026907207faa305d86e6e4db", size = 503056, upload-time = "2026-08-12T22:34:58.164Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/46/fba332db906bb26f3c27285d17f5210bee54c3d7e1545e4d1bcae08ec437/hypothesis-6.165.5-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:e9ee79ccf2de7b185821ed8364eccfea7300b52b30a8c626f6b7213f3b38e5d5", size = 782500, upload-time = "2026-08-12T22:33:48.567Z" }, + { url = "https://files.pythonhosted.org/packages/cd/68/f3cd7814a571ecf58c97a40686c97814c9f6be95dd258d9144d909f0900e/hypothesis-6.165.5-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:b732ea0c758e9c587eea8bb89ea27c985cb7609304e484ff8e5ffdb890f56ae5", size = 778047, upload-time = "2026-08-12T22:33:44.541Z" }, + { url = "https://files.pythonhosted.org/packages/85/a4/e0825ff8e353bf92b77f9b990c3e0e1160a0f2953feb95647cf2ced0b1a0/hypothesis-6.165.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edb08b192ea64a75e82dcc0b49e515f9ca86e4523c678bf8035c993f3bf7323f", size = 1107271, upload-time = "2026-08-12T22:33:31.315Z" }, + { url = "https://files.pythonhosted.org/packages/63/85/1005fece1e0f59f8974c2e4be3fae1d0436a77b9fbee9a6203d7b250536d/hypothesis-6.165.5-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eb74178189e0a8451e0b7cde4a236f4c8bee848ce01d42df968623ac11a4671a", size = 1135836, upload-time = "2026-08-12T22:34:06.044Z" }, + { url = "https://files.pythonhosted.org/packages/8d/8a/6f51cf111f590b883f5fcdb21b54345beeab516ad9c07d4256b731d66ef4/hypothesis-6.165.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a970cfb945f31b3115b013ede9fe3f0d68b37ff5b86499cc44ccec3d3fe1eeaa", size = 1156825, upload-time = "2026-08-12T22:34:28.263Z" }, + { url = "https://files.pythonhosted.org/packages/4c/7e/fbf54b49173d118681576259acdec61e045b825d516ca1fd5155f7a14ac1/hypothesis-6.165.5-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:569a7cd8b737019420a5530584ee28fba9dfa3ed877621764a2627f804e983c6", size = 1112117, upload-time = "2026-08-12T22:34:13.239Z" }, + { url = "https://files.pythonhosted.org/packages/d2/95/98bd41c67215950f73f8df711b7d13e40f0fad21c1ff61271b676abc4e19/hypothesis-6.165.5-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:61f30a43dc377ba94885e1990be785434686d76a8f37605336dd697c696dad4c", size = 1148864, upload-time = "2026-08-12T22:34:22.427Z" }, + { url = "https://files.pythonhosted.org/packages/0b/07/9dac0e757abc9dd0500b173adbfe018b1742af5ab35c46169cea290bbf65/hypothesis-6.165.5-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6a25168ab05d52a084e216f8f033472a8bd18167e0e8fc25a8774722db884be2", size = 1282719, upload-time = "2026-08-12T22:33:55.326Z" }, + { url = "https://files.pythonhosted.org/packages/62/9a/0dcce83dfa414427c2632be45a2338edb5b80e2b9b1c7d88c70c2478c90d/hypothesis-6.165.5-cp310-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:6984a5b7e62b19ddd78643d954dfa90ec8dabbdac4df43a4e63f60fa06514eb2", size = 1409219, upload-time = "2026-08-12T22:33:39.521Z" }, + { url = "https://files.pythonhosted.org/packages/31/8f/82ed9fe9dae7cb79714c5de9cbccd5c4847348971e4ee61c5ad2013417d9/hypothesis-6.165.5-cp310-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:77b57c6c5154357955d724a5ba198aa421f1273a9f88a6ae24d23a1c6d1c91b8", size = 1281995, upload-time = "2026-08-12T22:34:38.42Z" }, + { url = "https://files.pythonhosted.org/packages/b9/4b/06ca1631cce0a9a9806ef15535b9502967751a066dfd620876ff4b8e1eaf/hypothesis-6.165.5-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:d77557a13f3cfbabc9b96909fc985563e474627208d981689e4925dc4708722f", size = 1324044, upload-time = "2026-08-12T22:33:57.817Z" }, + { url = "https://files.pythonhosted.org/packages/b0/d7/ac8ae1cf829faa5204a743db0e06880ff71bdd105927592b504e34368391/hypothesis-6.165.5-cp310-abi3-win32.whl", hash = "sha256:7c5fd96d54f63fca065cbc21579be0e9b75190af48ff77d5cb759111fe5edae0", size = 668283, upload-time = "2026-08-12T22:33:32.83Z" }, + { url = "https://files.pythonhosted.org/packages/1c/62/77acaaea919da21dbf9e76b78a87f9ac66fb44dc2e95afce07dad6da1185/hypothesis-6.165.5-cp310-abi3-win_amd64.whl", hash = "sha256:bcc3f34121b046e6091b35901b77e24dd1c674fc234b6e09b102e5efb03afa11", size = 674433, upload-time = "2026-08-12T22:34:47.75Z" }, + { url = "https://files.pythonhosted.org/packages/e6/d0/176ea6d8480d35a1a4fc2ffb1a61126441b2ac067216737052358581d5a7/hypothesis-6.165.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:1f330c91d532810bc2ac849e4d0d44a5a4f72508b4c92f1af91b7f2c90c4379a", size = 784074, upload-time = "2026-08-12T22:34:20.56Z" }, + { url = "https://files.pythonhosted.org/packages/3e/0c/3d128243dfc0ae059935c6607869f244efdc5676bb6e0006a2795cfebaeb/hypothesis-6.165.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:331e8026a380629c8b3b01850f0504a5191617694fe8703ffbb7de32cfbb370e", size = 775642, upload-time = "2026-08-12T22:34:14.757Z" }, + { url = "https://files.pythonhosted.org/packages/6f/40/e80bb810b26fe5807f7c8e3c3c5c3c7556d7128a195e0a57f2480b8a78e2/hypothesis-6.165.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4ebe628c589b512a0e20b99aa3799e2331ba2c590dadf411d3bee95f9edb914", size = 1106103, upload-time = "2026-08-12T22:33:53.788Z" }, + { url = "https://files.pythonhosted.org/packages/a6/1c/14648fa3d821bfe4f132e5482837320f191bc60f38a4bd2b687096adf6e5/hypothesis-6.165.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:397685c7e74e6c489bab521bf437c7aba366e275e54f8bb03a6f4571df71faa8", size = 1156164, upload-time = "2026-08-12T22:34:04.621Z" }, + { url = "https://files.pythonhosted.org/packages/59/59/74718a2b859e3b6673589f1591785dd15cdec2ff02b7c8d18f3fc0a42ed2/hypothesis-6.165.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ed071268fb878d206ff3172dfef29681cda4982c2752d57e3ad1cf70aa3d7535", size = 1280047, upload-time = "2026-08-12T22:33:51.258Z" }, + { url = "https://files.pythonhosted.org/packages/72/5f/1de655e95992c4657f302ec0eca0dd2cfb6bfaaa3b698836432daedac992/hypothesis-6.165.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:381bb61f342c47d0bbfed6af7fecc93f1a8d4778e0c12e7415bdfe0f9bdc9121", size = 1323384, upload-time = "2026-08-12T22:34:03.192Z" }, + { url = "https://files.pythonhosted.org/packages/52/e9/1f265bf5f575396e8097010c39b11c2c4dd905064c694a0f53dffff58445/hypothesis-6.165.5-cp312-cp312-win_amd64.whl", hash = "sha256:92f2dfb1417bfaf93fdbe654261c68dbbfd573b74473a570895bf81958c045e7", size = 671570, upload-time = "2026-08-12T22:34:51.694Z" }, + { url = "https://files.pythonhosted.org/packages/f1/af/2c3357cda375d8ba1276dec4d0a7b51404f86cc6855f1541b424cf99d5f7/hypothesis-6.165.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:55b907b33ece350a8b69890a7f09b22b6a93761a8724c3ed12a9cd71b2a03eb1", size = 783966, upload-time = "2026-08-12T22:34:40.078Z" }, + { url = "https://files.pythonhosted.org/packages/0b/64/71cbfa9e741a0d657570af6b42f5f81ca795fdd0bddca44bc89309b46e16/hypothesis-6.165.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2cf1a6b2ccaf36e0a2b1f95515edec4db6db14a4e7afd9c36ff477552ffc0f11", size = 775594, upload-time = "2026-08-12T22:34:00.589Z" }, + { url = "https://files.pythonhosted.org/packages/ac/1f/ccb8f0034c8e17f488bc60d74ac21ac0e8945f507ed0b6e8634b67da925e/hypothesis-6.165.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5faa41aca389826d21f311ae5e59b36eb8bb38933a88bc07ad08bd868af6daae", size = 1106007, upload-time = "2026-08-12T22:34:25.431Z" }, + { url = "https://files.pythonhosted.org/packages/13/9d/64f7f7e1398fb04286816b9770138a35d730f008ac45b44b6425dcc0dd61/hypothesis-6.165.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a194f401e5d0345ef459f5aa80a50676a64e146c4f57474d70f7ccbe11c886c7", size = 1155990, upload-time = "2026-08-12T22:33:37.139Z" }, + { url = "https://files.pythonhosted.org/packages/21/e9/4bc808417bac59e9c154cbfb38705613adba4f1f37a815607211ab9ee0ab/hypothesis-6.165.5-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:dd2acd36004b990504125c4e679cf98addf3ca2ce873b38a52f71c66716cc7a6", size = 1280030, upload-time = "2026-08-12T22:34:53.359Z" }, + { url = "https://files.pythonhosted.org/packages/7b/ff/dd0de28497f64ca01c059e32eca7e06a69c39f50ab614969ae636b7ceb3f/hypothesis-6.165.5-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:709d61590c8cd627479fb4255e085239b91b29a4d386e83f910c5117cfe5b25b", size = 1323111, upload-time = "2026-08-12T22:33:41.959Z" }, + { url = "https://files.pythonhosted.org/packages/45/45/756e1050f26041f6c3aeae2b7e41b10160b2560de0ec46fd3341f6a3cb52/hypothesis-6.165.5-cp313-cp313-win_amd64.whl", hash = "sha256:de4b6d24a0e6adfdd99b2ee1f8d9f43e6ba6146b3860a643e8bce6b41fcebdc6", size = 671569, upload-time = "2026-08-12T22:34:33.938Z" }, + { url = "https://files.pythonhosted.org/packages/63/5e/e4178b39d5e7307d3658ec54733f3b7d953df12a38681b91ab1929b740cb/hypothesis-6.165.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:6f877ace8cb1bc0af9e3c83bf2a63f0a29f54f99ec813d1ecc9c3224b514c036", size = 784066, upload-time = "2026-08-12T22:34:42.97Z" }, + { url = "https://files.pythonhosted.org/packages/7b/f1/9c338484238ef0169f77ae7fdd28e34d1dacc0501f003cf7b0009f1f1f58/hypothesis-6.165.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:f9d0b87ba2fa7ae53c09650e07cb74a117b383d7ab4839415341ac802596d1e5", size = 775741, upload-time = "2026-08-12T22:34:31.002Z" }, + { url = "https://files.pythonhosted.org/packages/a8/79/4502ccc73f5dbaa29c9cc1f33af0337aa28cc03c86ae289530bb70c0fc73/hypothesis-6.165.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:842481f603ef919c2594784bfbaa600916250a35e9d54cc4260e27d415eacc0a", size = 1106541, upload-time = "2026-08-12T22:34:24.067Z" }, + { url = "https://files.pythonhosted.org/packages/b8/e9/10575fe56720cc6be25f7bc8cef708ee1b6e6669ca0b7fd16f7dbf460190/hypothesis-6.165.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1ecee1a9241db6c2d51ebbe58aa2575364f4fa21583f5d22ac2a8885bbe9490", size = 1156172, upload-time = "2026-08-12T22:33:35.018Z" }, + { url = "https://files.pythonhosted.org/packages/c1/3e/b89e390f580d55b2d65bf726d7602a80f7725cc414bd60526bed0caf507b/hypothesis-6.165.5-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c108e99e4029318ed85ec5c39f5687c36604606394de3ff4da6e42356a2cceff", size = 1280392, upload-time = "2026-08-12T22:34:18.877Z" }, + { url = "https://files.pythonhosted.org/packages/9a/81/b33b5c0aedf35c298011748c679d652839a86b55ea616ca7561b85ac233f/hypothesis-6.165.5-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a811fe1f763e725692fa730c8b27ee3909f652f9c885dd89ee06f2583fd80944", size = 1323482, upload-time = "2026-08-12T22:34:49.696Z" }, + { url = "https://files.pythonhosted.org/packages/f2/8f/0361d9fce27af669ae936f535ad8275c35736cccf7d9ed66275f3eca874d/hypothesis-6.165.5-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:38353c9aaf946f76fd2d7d5e59c1564eac93ad362e98c7d6ffa705aa0e38974d", size = 615638, upload-time = "2026-08-12T22:34:54.979Z" }, + { url = "https://files.pythonhosted.org/packages/2d/fa/f49d197e125db4dd6725f248a838c1a8230e50d91889237fbf21705b6d45/hypothesis-6.165.5-cp314-cp314-win_amd64.whl", hash = "sha256:377af80792d187cc222bb2666e979c7e559ebb0f1b312c5376d7216f9c91bbf1", size = 671380, upload-time = "2026-08-12T22:33:36.096Z" }, + { url = "https://files.pythonhosted.org/packages/28/90/f939079a65499cad6352f566c3c632da5292f80e2253a72cc9bf6684d4bb/hypothesis-6.165.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:e2c423f947be24a7a7324962bf4984bc2231d61c01a4ce4d794e5c7e72b918f3", size = 782526, upload-time = "2026-08-12T22:33:33.895Z" }, + { url = "https://files.pythonhosted.org/packages/51/55/8afa60314542179289b2ef7eb6623cc8d9a6405488d2f3266e7610e003d4/hypothesis-6.165.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:05e7e8288b2f5fbb34a30b45c9df72a5ce9da0d5ce90705c76b28dda75aac984", size = 774157, upload-time = "2026-08-12T22:33:56.544Z" }, + { url = "https://files.pythonhosted.org/packages/6b/83/93ba4b711c0bfa5a2acc200d60f6fb3c947ea1a4b7f6ef0dacc02ac90de0/hypothesis-6.165.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3837b9e586a78f961aa7c0eedb979fa1cf3dcc8302103ac1e75c2520e943555f", size = 1104748, upload-time = "2026-08-12T22:33:46.901Z" }, + { url = "https://files.pythonhosted.org/packages/57/b9/c0b04ab66762526855fc97c18ecafe038fb1b428f48b2234e3c17b75b4ad/hypothesis-6.165.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb8fac650e976dfe4d48682f902224a70e2e64ec0716a8822818fa958b456053", size = 1154827, upload-time = "2026-08-12T22:34:17.53Z" }, + { url = "https://files.pythonhosted.org/packages/4c/9b/9368493ef62fba5a3ae8b09164466c3ad166b329ae2df01c897dfc3f3790/hypothesis-6.165.5-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:0a5004c3fe761b642ca556abf4551bc9a94d190320bcf7ce118cf8b792eaf71c", size = 1278417, upload-time = "2026-08-12T22:34:16.196Z" }, + { url = "https://files.pythonhosted.org/packages/6f/21/5eef54851cb51f47ebe123312c4c737934cb6469f6af38bd6e052037f89c/hypothesis-6.165.5-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:df05b18c2dcb1701532044d4d119cecc08b7d91fcf72e78a17b03257053cc6e9", size = 1322104, upload-time = "2026-08-12T22:33:38.255Z" }, + { url = "https://files.pythonhosted.org/packages/9e/4e/9ed7f0b7c6b0a5d0d6aa0e0a5c05420db8ce21de6c96ce17139c0dbd8d2c/hypothesis-6.165.5-cp314-cp314t-win_amd64.whl", hash = "sha256:56f3a5b0b21695cdc6c8ccb7cf8da63f5822de4691cf23b9d95b5931b042af00", size = 671372, upload-time = "2026-08-12T22:34:46.023Z" }, ] [[package]] @@ -1914,53 +1944,75 @@ msgpack = [ [[package]] name = "numpy" -version = "2.5.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/22/fd/89965aa4ac08c74998539fcbf24fa3540f3e15237fbeb6bcf9c908f4aade/numpy-2.5.1.tar.gz", hash = "sha256:a48a113e6afea91f5608793bafa7ef2ad481fefbda87ec5069f483de61cb9fa3", size = 20755553, upload-time = "2026-07-04T17:08:00.933Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/62/7b/14687aa674250e5e546f616f486b0d56d3631cd5b2415739141ce40bdcea/numpy-2.5.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2c889b56fe48b1018f764b0eec8df59ab654e9148aa91faa12596043500de277", size = 16801574, upload-time = "2026-07-04T17:06:12.423Z" }, - { url = "https://files.pythonhosted.org/packages/e1/19/cc5bb2a3f2913d27d6dbb2c78d25921fabaedc6741d4a5a615a11f3c5bf3/numpy-2.5.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ab451b59c5643c570974c43aef780703ef1d3b4965d2be07afd530615a9358d1", size = 11772250, upload-time = "2026-07-04T17:06:15.726Z" }, - { url = "https://files.pythonhosted.org/packages/42/77/fdf34a71dd30f54979b18603bee915e0aaf825b07afe79acd60b04b691e2/numpy-2.5.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:78798bd5b9ad744056af8efa90e3b9ddaa53272a0848a483084a1cc0a13b2dc0", size = 5331516, upload-time = "2026-07-04T17:06:17.913Z" }, - { url = "https://files.pythonhosted.org/packages/ce/e2/eb7efa015b4cce41e2517bf182a7fce0d7d5b9d9ed76a29bfa0f4fe4505c/numpy-2.5.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:2ae0ca40bcb22d6ba59c1dfd5446f49940b0f2d821fde133f10dda11f816b84e", size = 6664863, upload-time = "2026-07-04T17:06:20.02Z" }, - { url = "https://files.pythonhosted.org/packages/a9/4b/a2b32dd94ee9ffbeecb28152240042a3949db33b1c834d44090b80e1b3b8/numpy-2.5.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:61ac47e772e6b8ea489e1d2f441a34c5c3ac17327e7ce294cbdf535795ad4e75", size = 15167977, upload-time = "2026-07-04T17:06:21.621Z" }, - { url = "https://files.pythonhosted.org/packages/b8/a9/6e73d68500f80773f65f0654ea932019d6694329a0eb0ed0533de38df376/numpy-2.5.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:59fda5e192b570217ec2580c96f00e9a7e12ef6866a900eb089b62c1a32545ca", size = 16672469, upload-time = "2026-07-04T17:06:24.064Z" }, - { url = "https://files.pythonhosted.org/packages/24/7d/ad3e59015135f5261c95fd4cafeff159c955febd83a99a1d9250c4233815/numpy-2.5.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f7119ebff1a9829e9f431a4f9d28e703023bb6b9fe7c8f724467dbfc27c94ab3", size = 16527531, upload-time = "2026-07-04T17:06:26.69Z" }, - { url = "https://files.pythonhosted.org/packages/83/d0/a39b2fbcde9cb17a1dac678f254b33a6336298af9df338824c685425d5e8/numpy-2.5.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e824c2acf8862052246be5a44c15da1777940c60d010dd2aab897824d9c430f9", size = 18431940, upload-time = "2026-07-04T17:06:29.521Z" }, - { url = "https://files.pythonhosted.org/packages/04/12/cff070947791c1ed425ff76413189adbdc2fbe215eba7ce7fa454a03c7f8/numpy-2.5.1-cp312-cp312-win32.whl", hash = "sha256:08d60c810432eb83360958dea0999ac4cfb94531ea8efcbf0b7f277c2068aeb2", size = 6066764, upload-time = "2026-07-04T17:06:32.571Z" }, - { url = "https://files.pythonhosted.org/packages/65/66/53f31807a48a750f9d748da273bc3fcedd12b27ff1f3e373bfec55ef2dc0/numpy-2.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:f7d60026c0bdb1380e83bfa7a0419c4577ee4b9a08880afcb6dadeb74c649fa2", size = 12430966, upload-time = "2026-07-04T17:06:34.926Z" }, - { url = "https://files.pythonhosted.org/packages/2b/2a/d1a88066b1c14186f5d3c0d18c94f17b064511982bab0578d49ee9d43c29/numpy-2.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:17a25e09640602e10bc8de0e6fa2b3fd68eedd84ba6d7842dc8f32f9ab87bd0b", size = 10350488, upload-time = "2026-07-04T17:06:37.785Z" }, - { url = "https://files.pythonhosted.org/packages/eb/07/ec2a3f0c91761581d4b7104a740791800025983f9a4dc4e73f91a99aeac4/numpy-2.5.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0bfebd8695f9863592fe744be833a258120b14a9f39da255e8aa8fade2c0ddd1", size = 16796419, upload-time = "2026-07-04T17:06:40.37Z" }, - { url = "https://files.pythonhosted.org/packages/ab/ab/ddb499fc4f8780354395face5b65c7fd107bcd6e1d667a5f07d046956f6f/numpy-2.5.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:30b44a6b53a7ae63c54c089a8726e5563ed302716c5b7ccc85afade40b0e7ff6", size = 11765832, upload-time = "2026-07-04T17:06:42.768Z" }, - { url = "https://files.pythonhosted.org/packages/88/b3/3c28c558a09fc72100c646dac6d2fce8e834c471b0edca01a29996706117/numpy-2.5.1-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:6165343f81b56ef8f514f396989e529b61d9dc709b99421b07e9f3e698e2287d", size = 5325143, upload-time = "2026-07-04T17:06:45.466Z" }, - { url = "https://files.pythonhosted.org/packages/5e/0e/ce19b985bb15c596f4f05954e76cccc77c845083b3b8f938a6c68e523128/numpy-2.5.1-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:4939237038ada79308dda3204ac6462df056b5672b2e25db1149cf873668b3e1", size = 6659749, upload-time = "2026-07-04T17:06:47.288Z" }, - { url = "https://files.pythonhosted.org/packages/2e/20/1ee6614d64332a1bba6411f38e68cb79eec1b2459e20a623777c5c5492a2/numpy-2.5.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1c6759f538fb912fc46de0a6b1758ccf7b57bc7c7ebebc23974fdac3de8db0cd", size = 15164716, upload-time = "2026-07-04T17:06:49.494Z" }, - { url = "https://files.pythonhosted.org/packages/ed/a7/2bcd3fdbb87804755c35b729bf8709d62025c5f4cfd7d5b2415997097515/numpy-2.5.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9726558e8db4a5bf7929a70ae50f63abda4daf0efe810e3bfbab95976f75fc1a", size = 16661440, upload-time = "2026-07-04T17:06:52.061Z" }, - { url = "https://files.pythonhosted.org/packages/fc/d7/a41e3310c886fe457d36e670bbf24fae411aca8a7b6ad92a32afd924077c/numpy-2.5.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3935f3b419b244a02732676fa5317a9193cc596a4c0646db07e5b421229ac9f7", size = 16526305, upload-time = "2026-07-04T17:06:54.605Z" }, - { url = "https://files.pythonhosted.org/packages/53/75/4333a9a707c1edd3a4e1a0c58eca52c0f31e55089fa80db02b5565b24df7/numpy-2.5.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:dc932a65ded7ce9013d120845a2514dcccb1a67bfc8deb8d37633762951904a6", size = 18423008, upload-time = "2026-07-04T17:06:57.54Z" }, - { url = "https://files.pythonhosted.org/packages/ee/90/e314a32b1c11a2ffe818ddad3a57b50b4b6e1b6c487192eb50cdef0415d0/numpy-2.5.1-cp313-cp313-win32.whl", hash = "sha256:4b4ff1608417eb7a59da7b967bbb798cacfe071d2caf526a24281cd562072ed9", size = 6063885, upload-time = "2026-07-04T17:07:00.14Z" }, - { url = "https://files.pythonhosted.org/packages/10/70/800b3fca480af32df9e8ea9f3d4a0c8feb4b32d7f195d174eabbda4829ad/numpy-2.5.1-cp313-cp313-win_amd64.whl", hash = "sha256:6c3fe51bc6a16453d452997053454f309e8e0ed7b42d6b361ce4ac8c32913d74", size = 12425674, upload-time = "2026-07-04T17:07:02.387Z" }, - { url = "https://files.pythonhosted.org/packages/8b/0b/196350c122f50f6ca56846f2d71efd5e0d24b7b2e07355e019b2e2c7a11e/numpy-2.5.1-cp313-cp313-win_arm64.whl", hash = "sha256:f7feb014281029e628ba2d5a007407443b06e418b6fe451d1e2adcbc8eba0107", size = 10350256, upload-time = "2026-07-04T17:07:04.878Z" }, - { url = "https://files.pythonhosted.org/packages/db/f4/731b6085a83faf6ca843394cbd5e217280c214399f7e8b21b9f552af0ae2/numpy-2.5.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:7c786fe9a5bbe360022e584c5a34cf6b54265c71bd7ec8ac3d8fec38968071f8", size = 16795063, upload-time = "2026-07-04T17:07:07.374Z" }, - { url = "https://files.pythonhosted.org/packages/bf/64/0e215f2048dd11a55bb989ed41b3585ef57452404e638d703a211a3e4157/numpy-2.5.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:32985c896d897419ef8da6917872d80b78ad0ea26d85b23245c7366ffde76d75", size = 11776652, upload-time = "2026-07-04T17:07:09.907Z" }, - { url = "https://files.pythonhosted.org/packages/b5/59/2b844c7a6e9deff69b404a66221e1542937734f65d5e6e39411876053862/numpy-2.5.1-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:efd736408cc97c79b9e6917338dfc8f06013b2274f992e96b1d9a81a71e2a2c2", size = 5335944, upload-time = "2026-07-04T17:07:12.227Z" }, - { url = "https://files.pythonhosted.org/packages/86/51/9bf7cb2cabcebc9e017e4ec7e6322b378317a542c08b4cb68479c1efc716/numpy-2.5.1-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:ab84dc6b074fa881cae55bea94cc4f68e285181ba7f32497bf7dee6b1496165b", size = 6656266, upload-time = "2026-07-04T17:07:14.368Z" }, - { url = "https://files.pythonhosted.org/packages/83/3e/fb7615b211b82a32f44d5180a6d421b61f84d4fadd578b48ba4ac34e189f/numpy-2.5.1-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caf3e317d33d60c37986b452613f4ab51246d0691350c03d0cb4a898627f4a95", size = 15179720, upload-time = "2026-07-04T17:07:16.272Z" }, - { url = "https://files.pythonhosted.org/packages/41/5f/0f992cb24560673496c5d68de61913b57166ce530ffda07c1f280e0cc464/numpy-2.5.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:54ad769f17bc2d833b620851989f62054fb9ab93c969d9e1dc3c8e3d56beea21", size = 16664835, upload-time = "2026-07-04T17:07:19.021Z" }, - { url = "https://files.pythonhosted.org/packages/a2/2f/97d6475ee91afe2587797d09446f9d3e475ad4cb681662d824809327b75a/numpy-2.5.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c12afb53450fa976d4c681c50a7423729a4c51c0465ed9f32b8a9cabbc472373", size = 16539135, upload-time = "2026-07-04T17:07:22.015Z" }, - { url = "https://files.pythonhosted.org/packages/c4/5b/4db81e4ba0be7e2776b1de68c82aa862c7f8ec27e1b4927d4ae075e20678/numpy-2.5.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:e8c11c405efc5ff6816d5983c96cdfa215bab3428961243af3ff59b228490438", size = 18426684, upload-time = "2026-07-04T17:07:24.941Z" }, - { url = "https://files.pythonhosted.org/packages/1f/64/c0ba2d90724d450279a7df8f32057241070250a26a7e2b5337d77347f481/numpy-2.5.1-cp314-cp314-win32.whl", hash = "sha256:f2479a47f8d5932d1718168a681ad6e536a9df484c83cfcf9de365e164537ace", size = 6116103, upload-time = "2026-07-04T17:07:27.622Z" }, - { url = "https://files.pythonhosted.org/packages/c1/1a/837f9ed7405adcd7a40538792eb169eddd8fa5630c16a1ef49dae71a30f4/numpy-2.5.1-cp314-cp314-win_amd64.whl", hash = "sha256:24d0eb82c0541d3415a33425db64ae439dffccd7b4dbcb30e7c35120205c506a", size = 12562177, upload-time = "2026-07-04T17:07:29.887Z" }, - { url = "https://files.pythonhosted.org/packages/22/ed/49707938b6dd0a78a9178dd93227dc89e4c11af47f5c798d70366e8d0483/numpy-2.5.1-cp314-cp314-win_arm64.whl", hash = "sha256:5a4c988b38d261deeeaad9954e3deb091ad905c94e8bb6708654ef1d97f286b0", size = 10627739, upload-time = "2026-07-04T17:07:32.568Z" }, - { url = "https://files.pythonhosted.org/packages/a6/c7/bb4b882cfe7f299cbc8b66e42e7dd78cf9d14e40f9469fc5e3db7e15b3bd/numpy-2.5.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a33276be12fa045805f477f22482088b66bb758ffbe89a9d21457de863a32e22", size = 11894709, upload-time = "2026-07-04T17:07:34.941Z" }, - { url = "https://files.pythonhosted.org/packages/40/3f/5af7f4a7f6224aef48017aa82bb6174c7a659d724be0c75017b7e64a55b4/numpy-2.5.1-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:f089d7b00756190aacf1f5d34bdf38c3c430ac82b4f868f8cede73380460fce7", size = 5453810, upload-time = "2026-07-04T17:07:37.495Z" }, - { url = "https://files.pythonhosted.org/packages/20/c9/3474309bc94d634d3f9c3eddf03250ecb8c22cd948ef16fef69a77cc5d7b/numpy-2.5.1-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:09e9bfd8d2cf479c7d174804fb3811c53a8e9f20a37444008606b57d6b7a826d", size = 6761189, upload-time = "2026-07-04T17:07:39.563Z" }, - { url = "https://files.pythonhosted.org/packages/90/8a/558ae39fdd55d7e7f7fef9a84a6e964ac6b23edbd2a07e52bb084500507d/numpy-2.5.1-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e68d8dd1e7eba712948f2053a29ec86917bc70ba1358df869d9f06649ef9cf09", size = 15225039, upload-time = "2026-07-04T17:07:41.682Z" }, - { url = "https://files.pythonhosted.org/packages/63/27/ca7392b2d030277bdf0273e7d23255b3ee57d57a7c170a6f4fb3981e1e5d/numpy-2.5.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:99d5095fa265a0c4152e7bb12759e14381ef5496152f1ce58f44bdf55c44beb4", size = 16701306, upload-time = "2026-07-04T17:07:44.611Z" }, - { url = "https://files.pythonhosted.org/packages/02/42/03d53ae7996c44d4374a8262e9dc41671fd56cbb98f7d47ef85cf5da4c6b/numpy-2.5.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ab87a91b3cc3382b8956095bd8f95e00cf679bb81554339be1a2ba404a1473c1", size = 16589955, upload-time = "2026-07-04T17:07:47.694Z" }, - { url = "https://files.pythonhosted.org/packages/7b/15/6c1784ae469640e65db111e9a34b3d0f14d91e8a38b9ce34810ced370dbb/numpy-2.5.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:224ca51130ef7da85bea2191625181cb4f337f9cb64b471f10c1a12aa8b60077", size = 18464252, upload-time = "2026-07-04T17:07:50.684Z" }, - { url = "https://files.pythonhosted.org/packages/94/a8/f98e50356cf167df656c526c2dfeec2d7dde182f2a3da4b458a5938e2776/numpy-2.5.1-cp314-cp314t-win32.whl", hash = "sha256:6eab239876581b2b3c5a242281b6007bbdbcd1c7085d7709bb57c5929b11e6bf", size = 6263298, upload-time = "2026-07-04T17:07:53.445Z" }, - { url = "https://files.pythonhosted.org/packages/72/ac/96ae880cdecad0b3275d9359fcec72667b49a4863c9f12942e43679dda02/numpy-2.5.1-cp314-cp314t-win_amd64.whl", hash = "sha256:83ce9c80d5b521b0d77ddcbe5447c218d247929b6cc056ca5351342accfff0af", size = 12748623, upload-time = "2026-07-04T17:07:55.384Z" }, - { url = "https://files.pythonhosted.org/packages/a1/5a/4d2b1601df3602dba7a14f3348ba9bfe94a18adb428e693df6154c293831/numpy-2.5.1-cp314-cp314t-win_arm64.whl", hash = "sha256:5a6db61f9aaa57e369905c67d852045d3c4f7126405b29d09b19dec118e9c9cb", size = 10697674, upload-time = "2026-07-04T17:07:58.506Z" }, +version = "2.5.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/9a/80/db0b4559e57ec36362bedbb05530a87fafbcb6067708c946967a41d449e7/numpy-2.5.2.tar.gz", hash = "sha256:d482d171c406ae88c5b19cad3b6a1c4c5209f886ab74bc44c2c865c23f52d860", size = 20773161, upload-time = "2026-08-09T13:48:27.962Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/69/72/dccb0aaf40972777283303919f613964227266d0c13adebb79ac124f1c3e/numpy-2.5.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:14e373cfc6387177e8409dac3c7159be8eb05cd77096cd7c950268b86f62831c", size = 16891693, upload-time = "2026-08-09T13:44:51.702Z" }, + { url = "https://files.pythonhosted.org/packages/60/2e/b5aee50a1f74ac815cf8331812cb8251e29024025de462e0c047641c614c/numpy-2.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4bbd96c833ecc8cc069ce518078fc8c60cb9cbfb0fea5b7a803ad65035596d03", size = 11903109, upload-time = "2026-08-09T13:44:55.501Z" }, + { url = "https://files.pythonhosted.org/packages/f3/f4/29e78102a80601cf034d4e9767022cffeca2c3b4c926e1754572ca95593d/numpy-2.5.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:6e8172ddfcf5cf74b811d372b570b83c60bd2de87a6fbfbebdadb4a9bd9c6cbb", size = 5350202, upload-time = "2026-08-09T13:44:58.401Z" }, + { url = "https://files.pythonhosted.org/packages/11/4b/dcd3b7eadaf4035d2c7a4289d232523a6964f602598ef7674e4bd7291f93/numpy-2.5.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:65f188481f1669e26f62b701e8205d19e460fa4a9b52a1414ba382330e4a3414", size = 6687736, upload-time = "2026-08-09T13:45:00.813Z" }, + { url = "https://files.pythonhosted.org/packages/e5/21/4947e0e9d6c9fc2e2ff15b8949049ee44f63adb9cacc729ab8793f97e712/numpy-2.5.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8ee9c4eeb8454b3660a8b53493563c3e121c2fc94fbd72b848ef814ed7b676a9", size = 15612696, upload-time = "2026-08-09T13:45:04.151Z" }, + { url = "https://files.pythonhosted.org/packages/3a/5f/62d28cf019460c7f1394105b4d49d9911a9c444cb77ab0bd95a204c5a6de/numpy-2.5.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3cdec01fa790a186d430433fdd4d4ffb70eed6f0eeb4bf05c8dbe2dce0a9bcb8", size = 16722264, upload-time = "2026-08-09T13:45:07.714Z" }, + { url = "https://files.pythonhosted.org/packages/14/25/3f0be4c1b9fdf5dd5e708a6806978564d7c46a055c000496309ff2a2f8af/numpy-2.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7999d4ddb0c4025018373fd787510d46e04c769467af22869707b3c1cfd459ab", size = 16974396, upload-time = "2026-08-09T13:45:11.316Z" }, + { url = "https://files.pythonhosted.org/packages/22/72/6262cbdeeb45da9d971e40715f579d791603ba8ec0b5e2db1ac55454421d/numpy-2.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c1f017dc0875c9209d219f97feceb7d54c2661bb243deb4114478e1295808af7", size = 18476044, upload-time = "2026-08-09T13:45:14.869Z" }, + { url = "https://files.pythonhosted.org/packages/36/33/29208b8b075bde62d26a81d14b358c42b0f69b6cabd98d4ff97f37f22b05/numpy-2.5.2-cp312-cp312-win32.whl", hash = "sha256:d6a48072864e3324e194a8fbb3c657bcc5b5c869dbc64c9537b1d5c862572c0a", size = 6072817, upload-time = "2026-08-09T13:45:17.867Z" }, + { url = "https://files.pythonhosted.org/packages/7f/b9/87fea2769fe1c47c1b5b01d8310772c9d1a85d485de7cf386ef7a3332b02/numpy-2.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:28ac63476ec7651484215ee7fa15a1f78b57c14621f01e392afe17b9a1390ce4", size = 12464674, upload-time = "2026-08-09T13:45:20.734Z" }, + { url = "https://files.pythonhosted.org/packages/14/52/032b97e00461ab0809bbe4c588b035620e5a14b8cdee47ecddefc7b17d33/numpy-2.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:27650bb0e7140fa3d37b9923b4803645e0b125d190f326eecfd3f4dad8e8ade1", size = 10397131, upload-time = "2026-08-09T13:45:23.73Z" }, + { url = "https://files.pythonhosted.org/packages/f5/d2/6b24738a0ef4557d189b150046cd07823c50e4273e8aebd651222e24306f/numpy-2.5.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8e4cb9a754c8a0c62eaa88273a5fba3391f4a610d1dee893c0755da31c083f15", size = 16886595, upload-time = "2026-08-09T13:45:27.323Z" }, + { url = "https://files.pythonhosted.org/packages/65/60/f2d208d366f263f39c6e69ed309290717aab41078b6d04c9be2a84fa2a07/numpy-2.5.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:52c808f96484f5571a5cc863775ce50247c17dfb3b0361f8ed6b4b0456f80080", size = 11896845, upload-time = "2026-08-09T13:45:31.638Z" }, + { url = "https://files.pythonhosted.org/packages/3c/79/81e0bf24f4d020a2b1d5cd297a9f60c3f24eeb116f9bba5870443f7b6a4a/numpy-2.5.2-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:29d81e97f668489cba8ebfd796b9bdd453525d35dd9e162e2daec94bf3fc7740", size = 5343880, upload-time = "2026-08-09T13:45:34.373Z" }, + { url = "https://files.pythonhosted.org/packages/ba/cc/e3141cf06d1a8a2c7e107543fe1269c1d1af760d4d683c0794a4ee1127c2/numpy-2.5.2-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:afb3f0632d6b2e3ba04dbce8d1e48d321b369138b73830b5ca371a0e8d479d56", size = 6682264, upload-time = "2026-08-09T13:45:36.7Z" }, + { url = "https://files.pythonhosted.org/packages/29/f1/2a64a307d92c5d98f5255a4014eb43bb6103ee477087b61ecae44a3aa9b9/numpy-2.5.2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0aadf13b60048d501e05fa699efaf7734e2494f3498a4c2a5521d822640324f3", size = 15609566, upload-time = "2026-08-09T13:45:39.518Z" }, + { url = "https://files.pythonhosted.org/packages/7b/44/59a1eb68e773c4098d107ef34a0dbdeca501d72ffcfbff9a7707343921ce/numpy-2.5.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:29b86ff8a6cc556b47ec6b64b194815cc80e6bf5eedcc6cddfd65318cb0b4eee", size = 16709995, upload-time = "2026-08-09T13:45:43.661Z" }, + { url = "https://files.pythonhosted.org/packages/8a/4c/3e54d4ddbc359a1295f8b633e8106bcd4d7d4a206e82df051bdfb3058755/numpy-2.5.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6950c4b7dd562453090548ba7f5da7e59f57f85663f15d5dcc60e249192f7e59", size = 16972511, upload-time = "2026-08-09T13:45:47.094Z" }, + { url = "https://files.pythonhosted.org/packages/f2/9f/02e371638ebf19b66d46231e4be52999e87f32d1961b113bc45656608b22/numpy-2.5.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b9727f472d2f3888053b8a75ab0cb94745a9de224bb5846dbadc0092101bc71d", size = 18465609, upload-time = "2026-08-09T13:45:50.808Z" }, + { url = "https://files.pythonhosted.org/packages/eb/ae/ad6645abc7a3510fe48e8ea1ab4598166f500057ef4ebf38bfad4f1577de/numpy-2.5.2-cp313-cp313-win32.whl", hash = "sha256:4f9744f9fbdcea0bc552e8f19e1f141f811a3f9bc2be2cc6e86d982cab23e3f4", size = 6070204, upload-time = "2026-08-09T13:45:54.111Z" }, + { url = "https://files.pythonhosted.org/packages/15/20/f3489f86d81ea460b2bcdceaed094142ca6579f6be0ec527b781d39afe68/numpy-2.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:85aaccb24182c25df891ad0ec333585967e115269d5f1b17f2c9ae005bc96657", size = 12460532, upload-time = "2026-08-09T13:45:57.167Z" }, + { url = "https://files.pythonhosted.org/packages/d5/21/35b31dde1b283b79de828b80f876afd8c94e28fe1e9c375f89e261cc4c0d/numpy-2.5.2-cp313-cp313-win_arm64.whl", hash = "sha256:bd68ece1553d2023c09a4226d9e41c586ad2d20594d1a456186c33513d2cb3f2", size = 10396725, upload-time = "2026-08-09T13:46:00.478Z" }, + { url = "https://files.pythonhosted.org/packages/ac/f8/c3b222bf075b50afd8e949a07a15c4b312a4a84bd8102a332bcd953cbbb4/numpy-2.5.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:d787cf769c3baeb5f6235e778edb52c08dfa923789b5958f28e6450f96107cb1", size = 16885180, upload-time = "2026-08-09T13:46:03.939Z" }, + { url = "https://files.pythonhosted.org/packages/17/e1/2c1d4b1987795a92b5bbf7c24fe249ab96aa2573ab0d7604802c189d7b86/numpy-2.5.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:24b9dc2e3d84aa58523798805194e23e736f3f6ce2d1a5b92583ae734e6dbda8", size = 11907878, upload-time = "2026-08-09T13:46:07.045Z" }, + { url = "https://files.pythonhosted.org/packages/b9/ee/d08226fc858044355983a6e5b94f08ff6f3969e0a2b160a4a89f0ddb3445/numpy-2.5.2-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:9e9413326d726c2545bfa65d2c0876871e8d8386e77f992c1d426e180bbd4323", size = 5354922, upload-time = "2026-08-09T13:46:10.04Z" }, + { url = "https://files.pythonhosted.org/packages/94/f0/6d3d933056440ebbc5e6bad92065fc6c26a48a84a36b1208580e94eea76c/numpy-2.5.2-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:60e902ac295855348a5ca2ea4c89108989a9f5fddfad3dfc0a8f36b10358567e", size = 6679168, upload-time = "2026-08-09T13:46:12.275Z" }, + { url = "https://files.pythonhosted.org/packages/c4/3b/ecd49dd90033cceb2704d88ca905d4d7d89b0e8c739608754ffd325fa820/numpy-2.5.2-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:50e500dc868e9313530ce12ba470fe50ff3afe3d62993ed6eff652dacd555b65", size = 15624501, upload-time = "2026-08-09T13:46:15.322Z" }, + { url = "https://files.pythonhosted.org/packages/c7/99/461bd36dbdfac6c1c53efa370bd55a83227542d0d118f1677dbf1a3dacd5/numpy-2.5.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:318b9a4c845dbea06708a29c84ee429cc3065048db34cdb799047643492050ee", size = 16713701, upload-time = "2026-08-09T13:46:18.949Z" }, + { url = "https://files.pythonhosted.org/packages/f9/9c/2b251df9e8a5d647b62b0cbc1b90a91850c1cf4859ecb532fd0b4eacff6c/numpy-2.5.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:34c319e2963be042673fb46570501b2f06c41924e17e3563d58646b4380dfb68", size = 16986065, upload-time = "2026-08-09T13:46:23.006Z" }, + { url = "https://files.pythonhosted.org/packages/8f/25/20de43f53ff1390534a124475055a19f01fe10c920a0fd11b8e18d6d6052/numpy-2.5.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f06571a052127dc1b4e8b83029b4d1b20daa2b64a31cdd181fc6bc774e9000eb", size = 18470031, upload-time = "2026-08-09T13:46:27.102Z" }, + { url = "https://files.pythonhosted.org/packages/56/5e/0c577ca308d6da5eb79b546ba10bbe5b60148192194e2da060913b1de4f1/numpy-2.5.2-cp314-cp314-win32.whl", hash = "sha256:2cc779226e476d1e1f08c74068c419e60f41a9e0e069c92f6671d31d5c985e98", size = 6121028, upload-time = "2026-08-09T13:46:30.046Z" }, + { url = "https://files.pythonhosted.org/packages/15/5c/7bcbd5b11f94199073320410cddcbb80cee62415bfeb540874b265c2d922/numpy-2.5.2-cp314-cp314-win_amd64.whl", hash = "sha256:7587f53dfbd5edc0f7b87c6217b4c6d2d1f2ef9c3da70bc1315e7db5f8d7ec9d", size = 12597627, upload-time = "2026-08-09T13:46:32.886Z" }, + { url = "https://files.pythonhosted.org/packages/87/bc/4d0b06fba0da90ccc75af62823cb9dcedb6c9ea0cffa058cb2c9ee773a77/numpy-2.5.2-cp314-cp314-win_arm64.whl", hash = "sha256:3e4c367352d3747784248a227fbec218e193b56f7e6692e3b64fc805478ecfdf", size = 10680414, upload-time = "2026-08-09T13:46:36.036Z" }, + { url = "https://files.pythonhosted.org/packages/cd/17/f429aac9dc08833a0d0f188eba38c532a751b1a1f2ca6018a37b455cb321/numpy-2.5.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b879fb674276e331513fb136b78dbc6bd3c848309e0d841cfd63be3896c4cfc1", size = 12026967, upload-time = "2026-08-09T13:46:39.084Z" }, + { url = "https://files.pythonhosted.org/packages/ca/9f/d0849de96a2a4ceaa16662f18ee13eaa9c0aa418269fdc8c4857c56b11da/numpy-2.5.2-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:fd0d703772bba096843785bd38371e31bb4a0c1151497ad5739d182114a73f7f", size = 5473874, upload-time = "2026-08-09T13:46:42.075Z" }, + { url = "https://files.pythonhosted.org/packages/89/3c/8df216d4a4a5422a3de045301cf7df8ea47286d76f5cb7160b0128ac26b7/numpy-2.5.2-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:3a2f061cebd9e3d23bdcfaaded5e2293a4c6a5b60fa42df85d410a725ce621bf", size = 6789276, upload-time = "2026-08-09T13:46:44.387Z" }, + { url = "https://files.pythonhosted.org/packages/e6/3a/20d7e9891c4ddfadd6ff8d95bf4b29f353d8e1770553de2099880551dfb9/numpy-2.5.2-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6df895598c0edcb41030126c89e0f353b07d93238116143b7405e937359736c4", size = 15659154, upload-time = "2026-08-09T13:46:47.538Z" }, + { url = "https://files.pythonhosted.org/packages/aa/d6/f3aa3d2688bf501b858835c6bd087ae9b51a56ae6fca8e2b0990abd177af/numpy-2.5.2-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1ab3d4a901f844ea836c3e80bf463c6a27d7f3c14e8e292fcf28d348b25b9bce", size = 16748909, upload-time = "2026-08-09T13:46:51.442Z" }, + { url = "https://files.pythonhosted.org/packages/7d/8f/1c5cae8d2baf86ab802ae97a00be55bc7e21ebc11b12bbc33376c5f05342/numpy-2.5.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:cebc2d6dbb605a7703d59751dea4bd6b0ab127a5a4338a6f432df1936fef8b26", size = 17027685, upload-time = "2026-08-09T13:46:55.095Z" }, + { url = "https://files.pythonhosted.org/packages/5c/27/71d3467404aedc1c24ce79610f91b52b0b0f466c43a701aa56fc75c145ab/numpy-2.5.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:eaca7ff36f0f52e2111ec71f169d8fd3e889e7ddc0d2592e0d703fd8d3ce8fac", size = 18501181, upload-time = "2026-08-09T13:46:59.09Z" }, + { url = "https://files.pythonhosted.org/packages/14/2f/42921d27c40aea7e077f4a423ae509fd9220b028cd787bafefd8ab2b3a5f/numpy-2.5.2-cp314-cp314t-win32.whl", hash = "sha256:ddf47472af2e4280d79bac82304f5e80150211f1b9e614b760061d5fdfbb6eba", size = 6271085, upload-time = "2026-08-09T13:47:01.903Z" }, + { url = "https://files.pythonhosted.org/packages/75/e6/bad5f5d56de9b1971bac959963dda276d35c40f1854475005434bbe08692/numpy-2.5.2-cp314-cp314t-win_amd64.whl", hash = "sha256:44ef9675d908e65f9953063837c3277730f3f4437615a4cdab67b366cabaf884", size = 12787971, upload-time = "2026-08-09T13:47:04.963Z" }, + { url = "https://files.pythonhosted.org/packages/df/05/f608795cb34391acd67e38d94a3c36abd8d8576293a3a80727d7595c372c/numpy-2.5.2-cp314-cp314t-win_arm64.whl", hash = "sha256:eaa088384c46f519dacb93b7ec483a6d6b19a4a2085ae4f25ab9b1c43d387d1e", size = 10750306, upload-time = "2026-08-09T13:47:07.976Z" }, + { url = "https://files.pythonhosted.org/packages/33/c6/28de0191c5f82b7d42a0a51390ba98587048aa93a39fafb05bdbe6e8d00c/numpy-2.5.2-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:078f9b027b478c9379b9677babbf0f8b8f1ecfada27636d7b9a93990c638739f", size = 16885274, upload-time = "2026-08-09T13:47:11.439Z" }, + { url = "https://files.pythonhosted.org/packages/dd/d1/973ca116000d244897e468ea1aff30b589e5022e3c8744b71706fe33bd57/numpy-2.5.2-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:50a68f4bacd8a2b33d8da3d2269d0d78500f86ea582e4786dc10f5ef2c2c6842", size = 11907846, upload-time = "2026-08-09T13:47:15.128Z" }, + { url = "https://files.pythonhosted.org/packages/78/d9/8c4b3937ef204cb2fd88d389ccd0f265a2ffb11f35a01d2064cf46714bd6/numpy-2.5.2-cp315-cp315-macosx_14_0_arm64.whl", hash = "sha256:e79aba74ffaf5f78a050d777c184cddf8fdffabab38acf5f3ef1fecbc17895d6", size = 5354892, upload-time = "2026-08-09T13:47:18.07Z" }, + { url = "https://files.pythonhosted.org/packages/74/9b/b6ee65ea2999fdb7023935e108e6fb776ee4082aa15f159acfa857e578c8/numpy-2.5.2-cp315-cp315-macosx_14_0_x86_64.whl", hash = "sha256:9a0731745a72a184490a582fb4af2533512bd071ace67785b5fdffc0ae58dce8", size = 6679309, upload-time = "2026-08-09T13:47:20.456Z" }, + { url = "https://files.pythonhosted.org/packages/43/f3/acb18d8b137a393c8e7803a8c994c9e64bde3930692a69d826993113a159/numpy-2.5.2-cp315-cp315-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4ec954036759bcee3aa484f8603bd9c14f3e776293b85578b8734c2d72777c69", size = 15625850, upload-time = "2026-08-09T13:47:24.365Z" }, + { url = "https://files.pythonhosted.org/packages/a9/bf/a8e9bb0db815a0e265b5744ebedd3af0bd5faad8604e5b50a1cd012f3c91/numpy-2.5.2-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dc649493697006bc90614a5f0bbc8cb3cb1866715c474e473694968d7e6b99ab", size = 16713664, upload-time = "2026-08-09T13:47:27.965Z" }, + { url = "https://files.pythonhosted.org/packages/0c/c3/6e913736b3dd6582344af32418b5fb9dab34282e8a8174ae1d54ceb0fc13/numpy-2.5.2-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:cf7de32f486e4ac9e2d93b810f9e9ac72a728dd46a32a0bb403222f27f653514", size = 16986749, upload-time = "2026-08-09T13:47:31.541Z" }, + { url = "https://files.pythonhosted.org/packages/80/09/7d3b23eff5c7428ef6c01e6f7052bb60d504c4d33e317b36b8959c24ad97/numpy-2.5.2-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:2ffa7bacab3e2ee1b19ed31766bb60bb380b68c23f051e199c5cc598afd68710", size = 18470495, upload-time = "2026-08-09T13:47:35.364Z" }, + { url = "https://files.pythonhosted.org/packages/a5/a4/68a321d825374f6eb677ffe8ef8c6b9a328304e6fd2e39d9530822776607/numpy-2.5.2-cp315-cp315-win32.whl", hash = "sha256:6b588cc8f902d6bff201c19fd00c43ab8545671e3554d014e12e14139e5e8617", size = 6120696, upload-time = "2026-08-09T13:47:38.561Z" }, + { url = "https://files.pythonhosted.org/packages/c8/23/deafbb1700f79fae9cd1e91220f133d124cc267de1b584da3fbf6db2f6cd/numpy-2.5.2-cp315-cp315-win_amd64.whl", hash = "sha256:07d4e89f3a9ab0a9ba24264ccdb642b3dd951b2281e8883a5481a4aa79cc31a7", size = 12597324, upload-time = "2026-08-09T13:47:41.401Z" }, + { url = "https://files.pythonhosted.org/packages/33/cd/3272ba105e3bbbdaeb11357eda31e7a6825ffe159e8171665660299a948f/numpy-2.5.2-cp315-cp315-win_arm64.whl", hash = "sha256:a610dc7e3c52edd39c2bc2375ff9c3fd59cb3ad00e4472d36f83bc1457145788", size = 10680466, upload-time = "2026-08-09T13:47:44.873Z" }, + { url = "https://files.pythonhosted.org/packages/0e/0e/58370637b1bb70a5c9ce2b43f4b521ccb224e36ccb76a6596b17ae4b447c/numpy-2.5.2-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:40f4d451aed46a8046a1aae41c4e55fb3612273df9c502480135e1501576a34b", size = 16993947, upload-time = "2026-08-09T13:47:48.97Z" }, + { url = "https://files.pythonhosted.org/packages/10/93/2abcb807712b289d6d60fe4cf30532f98974a8396d885650f3ba5a13026e/numpy-2.5.2-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:c081cbe16ba1ab53078e5ff29013621e33c509eedab055775d956427712c236e", size = 12025331, upload-time = "2026-08-09T13:47:52.646Z" }, + { url = "https://files.pythonhosted.org/packages/8b/3a/2898e003a5fbaf87e76c039b4ee1f5eb390471b4ffe74887c1f34c4e791e/numpy-2.5.2-cp315-cp315t-macosx_14_0_arm64.whl", hash = "sha256:0090ccdd57ec2703e9b49d0bf554767370581c1dd0a6b2bb2b2d9def317d042a", size = 5472336, upload-time = "2026-08-09T13:47:55.403Z" }, + { url = "https://files.pythonhosted.org/packages/61/a5/23f69d07c544597b29758b31b55c27dc9d541012a2c1496189fef702aec2/numpy-2.5.2-cp315-cp315t-macosx_14_0_x86_64.whl", hash = "sha256:6a9bb119fb8dd21ba30b3f0e555b7e2b081bd9883af21ec9c1c633d161cda3a8", size = 6788387, upload-time = "2026-08-09T13:47:58.192Z" }, + { url = "https://files.pythonhosted.org/packages/15/ea/c0dbdbcf22f43782510a3e492dd3da73c6112b69cac8929d16d127536fc4/numpy-2.5.2-cp315-cp315t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a839318485284a6fb31be4f8f2c91c8f2cb22f4543c4a8903f12b0671ffe07cc", size = 15667096, upload-time = "2026-08-09T13:48:01.562Z" }, + { url = "https://files.pythonhosted.org/packages/fc/5e/29c73c31748cdb0f7566642125ba17fd5b56780cddf891b085dab27e4466/numpy-2.5.2-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba0a474801b8dc67b66bf465548abc90e82b44d2611b5770f33008dcabffe8ec", size = 16751730, upload-time = "2026-08-09T13:48:05.706Z" }, + { url = "https://files.pythonhosted.org/packages/47/95/02501e8454796bb58dadf7a99d3181e0b464bf264e1003039572f9779fac/numpy-2.5.2-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:0a4035ae1129ff8777f08bfbd44f1e5d8e9c049ce0c2dd78fc0d92c13e7251c0", size = 17038686, upload-time = "2026-08-09T13:48:09.627Z" }, + { url = "https://files.pythonhosted.org/packages/0e/b5/53a681d91b5c82687067d8ea5035e02d917b5509d6f334cb06484a954714/numpy-2.5.2-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:77843ca236b777e67f8d6b3660ea116e499612703a0ecd7093f316201eb9d8e2", size = 18507727, upload-time = "2026-08-09T13:48:13.744Z" }, + { url = "https://files.pythonhosted.org/packages/42/06/6e11443f7b64ee376c860506091103bf68f92d2cab9e8d96d4501babf07c/numpy-2.5.2-cp315-cp315t-win32.whl", hash = "sha256:7354826bc6f8f69402e9b7fe28d15fcd34feebd74f856f111585c5b0c9fb0251", size = 6269775, upload-time = "2026-08-09T13:48:17.543Z" }, + { url = "https://files.pythonhosted.org/packages/f1/18/195d6b86cd72dbbc501edfa778005fa6b87afd34c153e46028cd3a0938f4/numpy-2.5.2-cp315-cp315t-win_amd64.whl", hash = "sha256:e5651f3f87add730ee6608d915009e19c911fba0cb000c7e3ea994b7d768eb12", size = 12782559, upload-time = "2026-08-09T13:48:21.023Z" }, + { url = "https://files.pythonhosted.org/packages/b4/07/458c344f0f0c178f4481dad5cca790626ffe4c34eabf9467069d06ee4999/numpy-2.5.2-cp315-cp315t-win_arm64.whl", hash = "sha256:5f8e00be2ec6f45f4e8a41a527f68d44a7d96fee92a650e4d8b1326f77f61e6e", size = 10748103, upload-time = "2026-08-09T13:48:24.21Z" }, ] [[package]] @@ -2567,6 +2619,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/9d/7a/d968e294073affff457b041c2be9868a40c1c71f4a35fcc1e45e5493067b/pytest_cov-7.1.0-py3-none-any.whl", hash = "sha256:a0461110b7865f9a271aa1b51e516c9a95de9d696734a2f71e3e78f46e1d4678", size = 22876, upload-time = "2026-03-21T20:11:14.438Z" }, ] +[[package]] +name = "pytest-reportlog" +version = "1.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/93/d5/2f4a73822efaad1d6aea6660468d6290963e5f61d2f9d9ca707f7f0b1c13/pytest_reportlog-1.0.0.tar.gz", hash = "sha256:75aec3a92bb53456c3e028605a636579d26f31c6f1e035ad9f706c203cfcb74e", size = 5646, upload-time = "2025-11-11T16:05:15.98Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/05/70/807cbdac584629623c1c2f76b7a39a343e3989510cd52385f1f40581e963/pytest_reportlog-1.0.0-py3-none-any.whl", hash = "sha256:3fc837ef3be6e50f33b52aaf99f88bfbb2ec525febbc3990389d24bbfba28753", size = 6015, upload-time = "2025-11-11T16:05:14.585Z" }, +] + [[package]] name = "pytest-xdist" version = "3.8.0" @@ -2923,27 +2987,27 @@ wheels = [ [[package]] name = "ruff" -version = "0.16.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/70/25/7113f6d5498888c5fb7db34081cba7d5971c4cb1bfb26819966eee68f003/ruff-0.16.1.tar.gz", hash = "sha256:fedad7c801dabd3fb9741d76aca39246e6ddd9ca446a015875207bf19f1e6bc7", size = 4877500, upload-time = "2026-07-30T19:37:01.379Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1b/bd/694da69368e0973de65df2ddc73ab18d43c469d5963d9b150911de6bc513/ruff-0.16.1-py3-none-linux_armv6l.whl", hash = "sha256:58edb313b88f0c5460a26adf5f39a37a3be789494a15e3e411e35fa78b89f9a0", size = 10839126, upload-time = "2026-07-30T19:36:13.697Z" }, - { url = "https://files.pythonhosted.org/packages/3f/f0/b626e5d5bd0dd9576263658ef12885e2288afd1029a48e26ffed65ec1ac1/ruff-0.16.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:fde5a99e2f97479af66edd6622c6d5a2a7592c77cf4153d9e4428f5eeb55b60c", size = 11070253, upload-time = "2026-07-30T19:36:17.14Z" }, - { url = "https://files.pythonhosted.org/packages/83/63/f40acfb6b35b88623e71684942b552c3edd96035f5d98f313815f7b277de/ruff-0.16.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e0d4c20532fca4f7fa609369161d968dd28f65d83dabbd61d8e9c7edbf7001f6", size = 10561425, upload-time = "2026-07-30T19:36:20.04Z" }, - { url = "https://files.pythonhosted.org/packages/aa/dd/14ec0e9c2b4d315547dd38765004b4863e354e1b52cb308272215d9f6f6d/ruff-0.16.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30affbcedf59ad5703d9c91f82266e02b47739f797e1a7b6e158e5526a6dae38", size = 10948879, upload-time = "2026-07-30T19:36:22.476Z" }, - { url = "https://files.pythonhosted.org/packages/33/e9/9d870cbae575030fdef595f04b4b97573c525b5497cce4f4498cf2f85446/ruff-0.16.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:24e9c631573cbca9d20f1283f8f479b2afa4a8503504822bd71a293889f16743", size = 10643691, upload-time = "2026-07-30T19:36:24.914Z" }, - { url = "https://files.pythonhosted.org/packages/c4/09/12743d544e2173f53ecd27217c65f90d2bc0f8424a66a60339e56bbc0457/ruff-0.16.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b41bdd48fb420987a9b5212e4957c26ad4abce401fa9ea9d4d85843727945f4f", size = 11435354, upload-time = "2026-07-30T19:36:28.447Z" }, - { url = "https://files.pythonhosted.org/packages/7f/89/a1652b2daee52083c9554a6333b678a8b01d0400f976827bb87857f9449a/ruff-0.16.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b0d1e1393b7648079e13669de1c1f4fde06d4583e84d8fd5c1551e0a77a2aa75", size = 12259033, upload-time = "2026-07-30T19:36:31.326Z" }, - { url = "https://files.pythonhosted.org/packages/16/96/ecdcb8c54ee7b123b487f807eb014e6e019155a0b81dfb669acd52f28ce3/ruff-0.16.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:07bf434b1c95f4e093be4532068ef4fcf00924eb2ade8796075980902d6fd54a", size = 11667981, upload-time = "2026-07-30T19:36:34.394Z" }, - { url = "https://files.pythonhosted.org/packages/cd/90/c52e12e0d862e9572f2a33aa227409143520abe53111e9a6babbac7b4af8/ruff-0.16.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39897739f112253ee4fdd2e8aa9a4f9ded99fb2be367d5f31dfa4ded6025584c", size = 11468183, upload-time = "2026-07-30T19:36:37.339Z" }, - { url = "https://files.pythonhosted.org/packages/2c/6b/4ffb7ad1d83eb16cf8cbb3c8815d3f11c88460fd162d4b372a2059be1c2a/ruff-0.16.1-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:82ae3c0c0d74daf17b968a10b7b3bb3ef297ab7de0c1f749646b25e690ccb150", size = 11470071, upload-time = "2026-07-30T19:36:39.91Z" }, - { url = "https://files.pythonhosted.org/packages/9c/72/32ae7db4c0b5e32ab611787caa19d1546800676d79f7483b7100a3561bf4/ruff-0.16.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4d5f2ed10f8242d83fc08d521301089364e3375375705356f20c0e31606ef3ef", size = 10919503, upload-time = "2026-07-30T19:36:42.65Z" }, - { url = "https://files.pythonhosted.org/packages/f7/ca/3d901ba6ad6fc38da39c3448fc6c59ac945679293a17c3ceb6d6c1cba13e/ruff-0.16.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a4665b309891f83f3e3c25447935f1213e9abbd4b5640af7a1f2def9f8d413c1", size = 10649861, upload-time = "2026-07-30T19:36:45.18Z" }, - { url = "https://files.pythonhosted.org/packages/92/79/894ef1ced26552d5f8c9cf6d85b0687840e1128c55aeab7b9c2d54a0d880/ruff-0.16.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:26e9ca5c9bc3971f20d3cf18a957f52ffd6a5f6564ff15c4912a144dcac22494", size = 11148137, upload-time = "2026-07-30T19:36:47.936Z" }, - { url = "https://files.pythonhosted.org/packages/2d/69/3609a09fa1cb46cc28b762363e440a354204e5dff01bd0c8d7437874d6b9/ruff-0.16.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:67e1e1e3fa4f0c82f0e36d4cd61e661f6e7a6196cb1aa92fe0828fa7b8f257cd", size = 11559211, upload-time = "2026-07-30T19:36:50.448Z" }, - { url = "https://files.pythonhosted.org/packages/fc/8a/fb22af2fd78a736e241fabf67e30ce1799a64244026377a49e133af90762/ruff-0.16.1-py3-none-win32.whl", hash = "sha256:d31765e131295b8445caf301e3e8a85b34d1b9b211b4109b7ba457888b051806", size = 10838258, upload-time = "2026-07-30T19:36:53.298Z" }, - { url = "https://files.pythonhosted.org/packages/d4/35/e57fd9fb5d423961df087a00b12d42c0a830288dc2f3b45ecca299158b4f/ruff-0.16.1-py3-none-win_amd64.whl", hash = "sha256:09b05e8b90c2cb06ad63464350e7a45e8e44a2dfe52072ebfba6666ca8d3f596", size = 11961111, upload-time = "2026-07-30T19:36:56.107Z" }, - { url = "https://files.pythonhosted.org/packages/cb/46/240ea004bf6dc4feb40e9832f2205a476a47dd5b8a3f8211a5fc5f95e20e/ruff-0.16.1-py3-none-win_arm64.whl", hash = "sha256:dbaadaac38c70239f056d306b7476f246b0bf000fa6b3876402acbf5b227eaf8", size = 11309414, upload-time = "2026-07-30T19:36:58.79Z" }, +version = "0.16.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/73/e1/4508a569211b35599016e84ba65c1a992b7a4004b4b6c4bea02a851cba1b/ruff-0.16.2.tar.gz", hash = "sha256:c3d7828d12e8927a6fc65fe38e2c2541b9e762d360a1786d752cb1b8883b3c9c", size = 4885811, upload-time = "2026-08-07T13:31:01.432Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/14/57/db19951540f98859c956b50bdb4d31089b4d91e9f15e2968e7d5193806d5/ruff-0.16.2-py3-none-linux_armv6l.whl", hash = "sha256:3c8de4cf2181f01d57946d87d777aa52916976fc09942aed89938fab5e013318", size = 10847925, upload-time = "2026-08-07T13:30:14.468Z" }, + { url = "https://files.pythonhosted.org/packages/13/5a/995fe85a8470d3e391ac0f7fa8054bb454eaf33ee138196d6172ed1079c0/ruff-0.16.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9a48cc05c6fbc811ca81b5d7ba95375affea6582d1b8024e455e41afbbf55344", size = 11072662, upload-time = "2026-08-07T13:30:18.143Z" }, + { url = "https://files.pythonhosted.org/packages/32/53/370d767c61c71a971a4ace36703a7ecd8c393956349a7325d7fab2b56827/ruff-0.16.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a2c0d14fcbb26c91f0f867a6dc9bd71bbc30b1b6151829c884f23faeab2e5700", size = 10566771, upload-time = "2026-08-07T13:30:20.899Z" }, + { url = "https://files.pythonhosted.org/packages/85/d6/9d96948caf5a632be62d62202d5ec914d6856f204fd79eb036e5915e79ea/ruff-0.16.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:335c621622c4650330be50842561c6586ac6971bb8ab5407fe34dcc9efb16bbe", size = 10975825, upload-time = "2026-08-07T13:30:23.517Z" }, + { url = "https://files.pythonhosted.org/packages/3b/92/ea87129b3414acb0b5770563779c51804d37ac67675c7ba35447ddb14773/ruff-0.16.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:20e66910f2c37cc753f9ef6580c914a621b80c4fa3549d3e3521e29d0f5bfc3f", size = 10649437, upload-time = "2026-08-07T13:30:26.097Z" }, + { url = "https://files.pythonhosted.org/packages/ac/43/f8f291dcd4af5bb7872b74fdfa41a7cd7c856ca1d4069670971cf1b9f5cb/ruff-0.16.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7e36fbfba65510548156902bcf1350a979a958ce0347ce0f90d73894036b39f", size = 11446761, upload-time = "2026-08-07T13:30:28.752Z" }, + { url = "https://files.pythonhosted.org/packages/71/4a/ef991fb2fcf516ab71f0808adcdd8da5e18c8cde447f4ceaf5f47a5132a5/ruff-0.16.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f0eab35f80df8f134aae5d1630e751901321d317cc8e50dc39e36fa3ed34cd12", size = 12336364, upload-time = "2026-08-07T13:30:31.468Z" }, + { url = "https://files.pythonhosted.org/packages/f3/24/f615e74f307e6ca0e56a482872477b856c70d530aa356abfb6dfe5ca8a80/ruff-0.16.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40ea8c0594feb894e89c8c61ab9c103d38b0ea72dfde6c594107147ca31b1140", size = 11630720, upload-time = "2026-08-07T13:30:34.426Z" }, + { url = "https://files.pythonhosted.org/packages/c5/d3/8ef50149e8412a77f7ab409efdef0e2b23803707a3863da4fc64cb23d459/ruff-0.16.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ab3d62dde0b19facdd632008cc4827fc28ada7736c6bd35ab6f1050f0bfed53f", size = 11466130, upload-time = "2026-08-07T13:30:36.958Z" }, + { url = "https://files.pythonhosted.org/packages/dd/a7/a19334985c4dea8c381981fa252cd854c7ee52dc4b1686dc16f4a911c702/ruff-0.16.2-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:e43e1f5b8388da9eca1b9e88328d47a5cec794633ccf6f7484ac2dd15eee92c0", size = 11523634, upload-time = "2026-08-07T13:30:39.822Z" }, + { url = "https://files.pythonhosted.org/packages/6e/6c/96d192b0e742412ceda08c0a50f9669b253dde9fd6a60ea1a10c9fa79a63/ruff-0.16.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c24788a980581e1d7ea3a0cbe4344c4fbeb0a6a9b1f4713aa46bb104f8294690", size = 10949807, upload-time = "2026-08-07T13:30:42.745Z" }, + { url = "https://files.pythonhosted.org/packages/fa/51/e26599ceca11e79ee255c7df515995561edf87e9ca1893284e44d98f5a86/ruff-0.16.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:81806b08329130005dd4a8a8394a0c9da8c6f4cafb16ba438d2a2ee6a18bedf1", size = 10646891, upload-time = "2026-08-07T13:30:45.522Z" }, + { url = "https://files.pythonhosted.org/packages/68/01/800c4b1f97bc8d7c6029e06b1f20473a3cf1e13c4933d8f3342add83fc55/ruff-0.16.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:4ce4e02bad779bef557f541a1b31f20d6abeae1cc05ed1b1ac019d4ffd1044c8", size = 11162063, upload-time = "2026-08-07T13:30:48.131Z" }, + { url = "https://files.pythonhosted.org/packages/e4/d0/1477ea50fc5a0d4b0b71d1d63d50770bdd794d90b43e37a7618e63ec9894/ruff-0.16.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e0422abdf70070255fc4073ce9dfc814cc03db577013761ddd09bc1e4a9a4fbd", size = 11556038, upload-time = "2026-08-07T13:30:50.686Z" }, + { url = "https://files.pythonhosted.org/packages/b8/76/a7776f32048d991e16d4fa8ff91790b877342d3596cc3ed04acdbf1aaedc/ruff-0.16.2-py3-none-win32.whl", hash = "sha256:bf3a63d78fb39f4bf5ac8ae52051c5520505301abe19ba4e204c453b3f09bb0b", size = 10872850, upload-time = "2026-08-07T13:30:53.471Z" }, + { url = "https://files.pythonhosted.org/packages/00/0d/929c800d920e61397d82a01b60bffc68da3052c17d31de59efaad2e4ed75/ruff-0.16.2-py3-none-win_amd64.whl", hash = "sha256:bcabe2f6d0fc7819f1431793005af4e4de7371927d037345bf941252b195b9fa", size = 12023338, upload-time = "2026-08-07T13:30:56.193Z" }, + { url = "https://files.pythonhosted.org/packages/5b/6c/93e26c22c5f78ff87363e07da49c84955affbeb1098bd1936bf3b3f293bf/ruff-0.16.2-py3-none-win_arm64.whl", hash = "sha256:d614e95cedf38a2053fd351c55b103ba30d017d61688fdbfd40ee0412852a99f", size = 11374065, upload-time = "2026-08-07T13:30:58.775Z" }, ] [[package]] @@ -3205,28 +3269,28 @@ wheels = [ [[package]] name = "uv" -version = "0.12.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/4d/e7/653d48766f5a7a330fdb83e7de67705e2a428bc65f783ed11a0d835e9865/uv-0.12.2.tar.gz", hash = "sha256:1fa777b1b334b4b4c95af09ae0b128c2404084f412a851bdb0b6f5e2eb357df1", size = 5873701, upload-time = "2026-08-05T19:21:55.919Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/47/22/629a8fbca3d2d4a00030e76e4aeb5bf99458b74ceb8e681e7d64c1a9094b/uv-0.12.2-py3-none-linux_armv6l.whl", hash = "sha256:618214e75871dba436c469456bdd8019ead2cf66689bd786bd48261e367f2b1f", size = 21779937, upload-time = "2026-08-05T19:20:52.663Z" }, - { url = "https://files.pythonhosted.org/packages/db/46/012f5592c94cbbaca7a2aedb3d853891519a63675b846b1f72dc22bf984d/uv-0.12.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:594dab10d5ff79ca686807fd25c9f4ebd5c40157ddc4a25c0dd934d18ae56bc2", size = 20046124, upload-time = "2026-08-05T19:20:56.871Z" }, - { url = "https://files.pythonhosted.org/packages/bc/bd/55222e2da09f12be3e662e4a36a9c68cde85c27c943c0867f3b12f1aea76/uv-0.12.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c5d10c5ba988afe7fe0cd0b943219eaa45d4191a37e3165126b0bb3e308373cb", size = 18415024, upload-time = "2026-08-05T19:21:00.228Z" }, - { url = "https://files.pythonhosted.org/packages/3b/88/3b08dd402cea1121b45baf2a2e1b105ecea9fa6b007564fca14f04eedf58/uv-0.12.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:974a79184f901cd6f6fb4155d8fb2f709c951b4f5843352dabccee08afcfd8ee", size = 21167788, upload-time = "2026-08-05T19:21:03.587Z" }, - { url = "https://files.pythonhosted.org/packages/8e/ab/df7048e32f7dc8c111bafd1c0000771182d44ba598cb2ca6aa01d6e1a701/uv-0.12.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:e57b047a5fcc5433a01397b6750e0abd472b320677b35bec24b5810db0414a55", size = 21295352, upload-time = "2026-08-05T19:21:07.198Z" }, - { url = "https://files.pythonhosted.org/packages/ec/64/116bda88bf0aef59010b8bb0e7210876aee2d02859f720b1fbeda02538b0/uv-0.12.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:86ec228fe419e75b1d943d4c12ae1b7dd1e23caef565d52474467b5ca1e4e6a5", size = 21328080, upload-time = "2026-08-05T19:21:10.803Z" }, - { url = "https://files.pythonhosted.org/packages/28/c7/9ea07fb177cafa41c5a7a419b8304a8721608a36ce54c08233c63bc65e02/uv-0.12.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8740cbb2d2d3f9da79049621506f45f1ec2afbb63badda1458c5eadac2ddc233", size = 21965650, upload-time = "2026-08-05T19:21:14.879Z" }, - { url = "https://files.pythonhosted.org/packages/04/36/8d2857c23b946766930e2a7cb29b2625c2ae1d91f7334c3f8ce3e4fd32f3/uv-0.12.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:06ce541290777ddf31dcbfa35827270244b8015f7dd0b2e5db8394753e6023b5", size = 23249866, upload-time = "2026-08-05T19:21:18.376Z" }, - { url = "https://files.pythonhosted.org/packages/20/a1/c9b594b8639e35ebac78e3fc14cd1c7d45db159a86c8beede317b66f975c/uv-0.12.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2665c331bff339e3bbe406d3c48ef241b4d96e4dc77b4ff7b8051b9f4a839fd2", size = 22927435, upload-time = "2026-08-05T19:21:21.979Z" }, - { url = "https://files.pythonhosted.org/packages/a7/fe/a87be2a492440945e745b0dc81aef7fea9730d8194af88d854b7641f5ddf/uv-0.12.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a8d93d1fe019561b70494a8e1332492afb5f14dadc33d5239569d0964164d10", size = 22321279, upload-time = "2026-08-05T19:21:25.578Z" }, - { url = "https://files.pythonhosted.org/packages/ae/8c/a980effdb4cb95462184bf2f1973e2d320e62743c904e1f7351177b25297/uv-0.12.2-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:8e2f9faae9ea4fd02d46f0a3a22f0a7d5076aa0046750a3250ec0f3ede8e36aa", size = 21312018, upload-time = "2026-08-05T19:21:29.183Z" }, - { url = "https://files.pythonhosted.org/packages/87/b1/a83935957bf84414106e6486eb99d265085a04acd8584ff5220c18a5239a/uv-0.12.2-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:d19cb83db136b0def185cbb23e8894b1fb43587cd8c14e30681e9381144199a1", size = 21950961, upload-time = "2026-08-05T19:21:32.929Z" }, - { url = "https://files.pythonhosted.org/packages/ca/68/04137a4dfc95fe0014a509ae643de065043811a988b8bbde3fa02397c080/uv-0.12.2-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:78ca00dcaf7fa5fb720d50232fc1e0931839d29a97ebb0e44f24e564c4d90763", size = 22088891, upload-time = "2026-08-05T19:21:36.308Z" }, - { url = "https://files.pythonhosted.org/packages/e4/f2/b2885d06aed6c494387a25c64eaefe129ac73fe366fe887db27e1263c126/uv-0.12.2-py3-none-musllinux_1_1_i686.whl", hash = "sha256:cea51e735c0b68b8492c8b3d0496db1fd335a548011ae2093a6a9bd3a4cb4056", size = 21202799, upload-time = "2026-08-05T19:21:39.745Z" }, - { url = "https://files.pythonhosted.org/packages/74/90/f347d51195286a7a3a7ad1075e557a5f86e20df4feaa9b009f9a2bd13a92/uv-0.12.2-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:da7780a76d0691eee1af4d43a3e637ece62b1d4ae5fe78a1a9feb299cd731d23", size = 22517594, upload-time = "2026-08-05T19:21:43.364Z" }, - { url = "https://files.pythonhosted.org/packages/f8/90/4b040b8c6b40aa7d599c884a3abf34d566eabf360c33baaf3c00c2763a51/uv-0.12.2-py3-none-win32.whl", hash = "sha256:528c4bc3d41548670ec5619c339e158ea8818d88ab64337f158fd814d91397fb", size = 19400742, upload-time = "2026-08-05T19:21:46.788Z" }, - { url = "https://files.pythonhosted.org/packages/48/ae/ab4a58082da1e890b785402c17bc94d8b0aeb29fb6ab366aebfec63ad301/uv-0.12.2-py3-none-win_amd64.whl", hash = "sha256:0c837592d9f5bc88e3c0c8da9ab868e79cf26f2938e0a02b59221af084d83de0", size = 20180444, upload-time = "2026-08-05T19:21:50.152Z" }, - { url = "https://files.pythonhosted.org/packages/44/34/900d4bf7cbde72e0386cbebe392a4bd12057acb404253656b1092298be94/uv-0.12.2-py3-none-win_arm64.whl", hash = "sha256:ac36c7c26ee892855184e9346e56fa7b58a2e4f82ae7519fdd9c6d8670c49d96", size = 19122020, upload-time = "2026-08-05T19:21:53.399Z" }, +version = "0.12.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/3c/fa/19a665278931fca142cf1c21927b18b36cffb5fd137bf5228f937a977f84/uv-0.12.3.tar.gz", hash = "sha256:1eb3fea456aea47489d92e10451c9129b7dd9fd8854c4eb17020ba68489d5d9a", size = 5877698, upload-time = "2026-08-07T16:33:32.486Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0e/b1/eabb1f57339a63630a9b195f8bcdbcca101f4f5cbc5556e6f592d6049d80/uv-0.12.3-py3-none-linux_armv6l.whl", hash = "sha256:0c0561cd369002a5968e138ea477e86507a337b3ede44f441c90d85ed2f54714", size = 21777249, upload-time = "2026-08-07T16:32:18.631Z" }, + { url = "https://files.pythonhosted.org/packages/ed/52/7d23602e140bdd5bb25ffa8bf3943a86688e8cd558a9894dfbb83728e943/uv-0.12.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:0550669163cc67d5a7dc8e1702bc011e4a075a4ae52ad50891be654fc6635e0d", size = 20081726, upload-time = "2026-08-07T16:32:23.182Z" }, + { url = "https://files.pythonhosted.org/packages/e4/66/ba257c91d69921d773f523c9e4c3ffb04e233694c415517f5ef797403a4f/uv-0.12.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7c99f2524fe4b11d74dec85cef9b4d8b725d142dec04cd237f1c06fbdae1ee54", size = 18426262, upload-time = "2026-08-07T16:32:27.55Z" }, + { url = "https://files.pythonhosted.org/packages/c4/e4/7e93226f4f33c3cc25dc942056f46be9c48e846338f8644a700123726dc8/uv-0.12.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:ac21bea426ddf95fa76d8dc1f67350faed7b4a81951825cf2aaef99fc4144815", size = 21156889, upload-time = "2026-08-07T16:32:31.447Z" }, + { url = "https://files.pythonhosted.org/packages/bd/b7/2504476931b7102cc6bfec5289efefe1279fe03964cb8ad7113691372605/uv-0.12.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:1e569258e17a536c1bd90a68935dc8250b0ecc81ba80efd814ed169c33de0f93", size = 21319192, upload-time = "2026-08-07T16:32:35.638Z" }, + { url = "https://files.pythonhosted.org/packages/e3/83/e9a93bf4d737bf00d7fa4e2a82ed0ed23bc30d44262127f5f8b9a4dd9150/uv-0.12.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6c8e5a2d2ce4ea511293f919357c427dab0f12104ebfdd6602727f5c38958c22", size = 21334826, upload-time = "2026-08-07T16:32:40.034Z" }, + { url = "https://files.pythonhosted.org/packages/5a/ef/19215f66a02451ca2698062e98690d5f2a7e65574104ba04c188c4b59c70/uv-0.12.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:115e96e176fa3525ffb999572ec6041b915f15189403613ccefcc1f128f0ea0c", size = 22014926, upload-time = "2026-08-07T16:32:44.159Z" }, + { url = "https://files.pythonhosted.org/packages/7c/a3/38526a97a5d376c59955025e54740ae35a4c7d8d80c6dfbee13fae588964/uv-0.12.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:913dc068e906f459df892cac789e6e9e10ac9d6af0bbb3c36fcc09347b0c986c", size = 23248637, upload-time = "2026-08-07T16:32:48.342Z" }, + { url = "https://files.pythonhosted.org/packages/38/63/a7a98d075383669b6a3ff4ca410cb9c18b6d0921df1c524bd0859a8474fe/uv-0.12.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:77fa7f501baa7c4d097b0c424914d7924db8e54f882c4f40056228ecf56feb98", size = 22929428, upload-time = "2026-08-07T16:32:52.452Z" }, + { url = "https://files.pythonhosted.org/packages/8d/c4/97fdd4fca11d06633bb500849f70e4e6b201bcba3833894732e709be2d60/uv-0.12.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1482d1462b1aecd18ee33627363fe1c63d6a194f12d40d37efc446d9e0d800a1", size = 22346263, upload-time = "2026-08-07T16:32:56.563Z" }, + { url = "https://files.pythonhosted.org/packages/c4/46/ab0906c8c3b6eeaf2412ab5af6077a38930db90e2c99c1b82e066f240a81/uv-0.12.3-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:248b6b282f96f98d79dddecd1b2acd1893efd84667321f26703feffff6433211", size = 21288225, upload-time = "2026-08-07T16:33:00.578Z" }, + { url = "https://files.pythonhosted.org/packages/2e/0f/f40530b0b336212fff1bc50887d263a9f03d8859e6c1c5210e11d104df10/uv-0.12.3-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl", hash = "sha256:9201c7a1edadb07f64b695f17eac9db2d264eeb4b888c195aa11e7908d0ebf41", size = 21981757, upload-time = "2026-08-07T16:33:05.101Z" }, + { url = "https://files.pythonhosted.org/packages/0a/cf/240a3bebd15be490f867e155aa59522889d8d6310985421902f87d1fad99/uv-0.12.3-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:6114afd294411995a761c4cde0b721d550ff6d2fc2312046e8403eca6adacda5", size = 22117547, upload-time = "2026-08-07T16:33:09.124Z" }, + { url = "https://files.pythonhosted.org/packages/2f/da/fb143759f86b260f20634e11a27b9312eb6ff9c43c6756102e82875cd82d/uv-0.12.3-py3-none-musllinux_1_1_i686.whl", hash = "sha256:ba034f32abf966a101cf2434455faaf8d54dfacfff0d4b4c70d673f36e985728", size = 21255639, upload-time = "2026-08-07T16:33:13.38Z" }, + { url = "https://files.pythonhosted.org/packages/91/40/c1e0b626919792bf66847429d0c0bbf580a5f148a37268c10d9132f4871a/uv-0.12.3-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:13535c7d40faa7821c3763f5b6c605eef8556ea16277dc1a07a21203fd3c19e4", size = 22560342, upload-time = "2026-08-07T16:33:17.484Z" }, + { url = "https://files.pythonhosted.org/packages/fa/bf/246d088b4baf0239c8a06afa0ce155ce460942d08a9ac505fac5d0f99fe1/uv-0.12.3-py3-none-win32.whl", hash = "sha256:67b639a56dd36193b55a3bcea10f9dffcab37ed3c1eb26e964e52896df0bb205", size = 19420018, upload-time = "2026-08-07T16:33:21.544Z" }, + { url = "https://files.pythonhosted.org/packages/59/ed/3f816f972357578f1a21afdff8af9c93e87416afd0e150fc60be7eb280ab/uv-0.12.3-py3-none-win_amd64.whl", hash = "sha256:aeafd6e02b9a8d8beb447040bfc57ab172bdf244208f7147b4f7bbc327135797", size = 20215028, upload-time = "2026-08-07T16:33:25.751Z" }, + { url = "https://files.pythonhosted.org/packages/ff/63/0b08bf418b4d00e911465ad24a5f09040cc51247c362ffe56f859173e99f/uv-0.12.3-py3-none-win_arm64.whl", hash = "sha256:59121ef7217567adf4af41f7d3b04e42abb0c6a11bc87c930b838f9354f9c651", size = 19120228, upload-time = "2026-08-07T16:33:29.609Z" }, ] [[package]] @@ -3517,6 +3581,7 @@ dev = [ { name = "pytest-benchmark" }, { name = "pytest-codspeed" }, { name = "pytest-cov" }, + { name = "pytest-reportlog" }, { name = "pytest-xdist" }, { name = "requests" }, { name = "ruff" }, @@ -3559,6 +3624,7 @@ remote-tests = [ { name = "pytest-benchmark" }, { name = "pytest-codspeed" }, { name = "pytest-cov" }, + { name = "pytest-reportlog" }, { name = "pytest-xdist" }, { name = "requests" }, { name = "s3fs" }, @@ -3575,6 +3641,7 @@ test = [ { name = "pytest-benchmark" }, { name = "pytest-codspeed" }, { name = "pytest-cov" }, + { name = "pytest-reportlog" }, { name = "pytest-xdist" }, { name = "tomlkit" }, { name = "uv" }, @@ -3600,12 +3667,12 @@ provides-extras = ["cast-value-rs", "cli", "gpu", "optional", "remote"] [package.metadata.requires-dev] dev = [ - { name = "astroid", specifier = "==4.1.2" }, + { name = "astroid", specifier = "==4.3.0" }, { name = "botocore" }, - { name = "coverage", specifier = "==7.15.3" }, + { name = "coverage", specifier = "==7.15.4" }, { name = "fsspec", specifier = ">=2023.10.0" }, { name = "griffe-inherited-docstrings", specifier = "==1.1.3" }, - { name = "hypothesis", specifier = "==6.165.2" }, + { name = "hypothesis", specifier = "==6.165.5" }, { name = "markdown-exec", extras = ["ansi"], specifier = "==1.12.3" }, { name = "mike", specifier = "==2.2.0" }, { name = "mkdocs", specifier = "==1.6.1" }, @@ -3624,17 +3691,18 @@ dev = [ { name = "pytest-benchmark", specifier = "==5.2.3" }, { name = "pytest-codspeed", specifier = "==5.0.3" }, { name = "pytest-cov", specifier = "==7.1.0" }, + { name = "pytest-reportlog", specifier = "==1.0.0" }, { name = "pytest-xdist", specifier = "==3.8.0" }, { name = "requests", specifier = "==2.34.2" }, - { name = "ruff", specifier = "==0.16.1" }, + { name = "ruff", specifier = "==0.16.2" }, { name = "s3fs", specifier = ">=2023.10.0" }, { name = "tomlkit", specifier = "==0.15.1" }, { name = "towncrier", specifier = "==25.8.0" }, { name = "universal-pathlib" }, - { name = "uv", specifier = "==0.12.2" }, + { name = "uv", specifier = "==0.12.3" }, ] docs = [ - { name = "astroid", specifier = "==4.1.2" }, + { name = "astroid", specifier = "==4.3.0" }, { name = "griffe-inherited-docstrings", specifier = "==1.1.3" }, { name = "markdown-exec", extras = ["ansi"], specifier = "==1.12.3" }, { name = "mike", specifier = "==2.2.0" }, @@ -3645,16 +3713,16 @@ docs = [ { name = "mkdocstrings-python", specifier = "==2.0.5" }, { name = "numcodecs", extras = ["msgpack"] }, { name = "pytest", specifier = "==9.1.1" }, - { name = "ruff", specifier = "==0.16.1" }, + { name = "ruff", specifier = "==0.16.2" }, { name = "s3fs", specifier = ">=2023.10.0" }, { name = "towncrier", specifier = "==25.8.0" }, ] release = [{ name = "towncrier", specifier = "==25.8.0" }] remote-tests = [ { name = "botocore" }, - { name = "coverage", specifier = "==7.15.3" }, + { name = "coverage", specifier = "==7.15.4" }, { name = "fsspec", specifier = ">=2023.10.0" }, - { name = "hypothesis", specifier = "==6.165.2" }, + { name = "hypothesis", specifier = "==6.165.5" }, { name = "moto", extras = ["s3", "server"], specifier = "==5.2.2" }, { name = "numpydoc", specifier = "==1.10.0" }, { name = "obstore", specifier = ">=0.5.1" }, @@ -3664,15 +3732,16 @@ remote-tests = [ { name = "pytest-benchmark", specifier = "==5.2.3" }, { name = "pytest-codspeed", specifier = "==5.0.3" }, { name = "pytest-cov", specifier = "==7.1.0" }, + { name = "pytest-reportlog", specifier = "==1.0.0" }, { name = "pytest-xdist", specifier = "==3.8.0" }, { name = "requests", specifier = "==2.34.2" }, { name = "s3fs", specifier = ">=2023.10.0" }, { name = "tomlkit", specifier = "==0.15.1" }, - { name = "uv", specifier = "==0.12.2" }, + { name = "uv", specifier = "==0.12.3" }, ] test = [ - { name = "coverage", specifier = "==7.15.3" }, - { name = "hypothesis", specifier = "==6.165.2" }, + { name = "coverage", specifier = "==7.15.4" }, + { name = "hypothesis", specifier = "==6.165.5" }, { name = "numpydoc", specifier = "==1.10.0" }, { name = "pytest", specifier = "==9.1.1" }, { name = "pytest-accept", specifier = "==0.3.0" }, @@ -3680,7 +3749,8 @@ test = [ { name = "pytest-benchmark", specifier = "==5.2.3" }, { name = "pytest-codspeed", specifier = "==5.0.3" }, { name = "pytest-cov", specifier = "==7.1.0" }, + { name = "pytest-reportlog", specifier = "==1.0.0" }, { name = "pytest-xdist", specifier = "==3.8.0" }, { name = "tomlkit", specifier = "==0.15.1" }, - { name = "uv", specifier = "==0.12.2" }, + { name = "uv", specifier = "==0.12.3" }, ] From d44f9f92ab4f12a8008de2553a7c9988669e3910 Mon Sep 17 00:00:00 2001 From: Dylan Pulver <35541198+dylanpulver@users.noreply.github.com> Date: Sat, 22 Aug 2026 15:07:00 +0300 Subject: [PATCH 61/61] fix: reject a string-valued zero scale in the scale_offset codec (#4279) ScaleOffset.validate compared self.scale against 0 before parsing it. scale is documented and typed as int | float | str, and no string is ever == 0, so "0", "0.0" and the spec's hex form walked past the guard. On float dtypes that wrote every chunk as zero and read it back as NaN with no error; on integer dtypes it surfaced as an unhandled ZeroDivisionError. Compare the parsed scalar instead. Co-authored-by: Dylan Pulver --- changes/4279.bugfix.md | 1 + src/zarr/codecs/scale_offset.py | 9 ++++++--- tests/test_codecs/test_scale_offset.py | 23 +++++++++++++++++++---- 3 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 changes/4279.bugfix.md diff --git a/changes/4279.bugfix.md b/changes/4279.bugfix.md new file mode 100644 index 0000000000..7d99a49ccf --- /dev/null +++ b/changes/4279.bugfix.md @@ -0,0 +1 @@ +A `scale_offset` codec configured with a string-valued zero scale is now rejected. `scale` accepts strings, and no string is ever equal to `0`, so `"0"`, `"0.0"` and the hex form `"0x0000000000000000"` skipped the "scale must be non-zero" check that the numeric `0` triggers. On float data types the array was created, every chunk was written as zero and read back as `nan` with no error, and the zero scale was persisted to the metadata so reopening the store reproduced it; on integer data types the codec raised `ZeroDivisionError` instead of `ValueError`. The check now runs on the parsed scalar rather than the value as supplied. diff --git a/src/zarr/codecs/scale_offset.py b/src/zarr/codecs/scale_offset.py index c96e177c6b..f2908da1b6 100644 --- a/src/zarr/codecs/scale_offset.py +++ b/src/zarr/codecs/scale_offset.py @@ -355,15 +355,18 @@ def validate( f"scale_offset codec only supports integer and floating-point data types. " f"Got {dtype}." ) - if self.scale == 0: - raise ValueError("scale_offset scale must be non-zero.") + parsed: dict[str, Any] = {} for name, value in [("offset", self.offset), ("scale", self.scale)]: try: - dtype.from_json_scalar(value, zarr_format=3) + parsed[name] = dtype.from_json_scalar(value, zarr_format=3) except (TypeError, ValueError, OverflowError) as e: raise ValueError( f"scale_offset {name} value {value!r} is not representable in dtype {native}." ) from e + # ``scale`` may be given as a string, and no string is ever ``== 0``, so this has to + # compare the parsed scalar rather than the value as supplied. + if parsed["scale"] == 0: + raise ValueError("scale_offset scale must be non-zero.") def resolve_metadata(self, chunk_spec: ArraySpec) -> ArraySpec: zdtype = chunk_spec.dtype diff --git a/tests/test_codecs/test_scale_offset.py b/tests/test_codecs/test_scale_offset.py index 513caf463a..0081bb1901 100644 --- a/tests/test_codecs/test_scale_offset.py +++ b/tests/test_codecs/test_scale_offset.py @@ -249,16 +249,31 @@ def test_uint64_encode_rejects_underflow() -> None: arr[:] = np.array([100, 50, 200], dtype="uint64") -def test_rejects_zero_scale() -> None: - """scale=0 is rejected (destroys data and breaks decode division).""" +@pytest.mark.parametrize( + ("dtype", "scale"), + [ + ("int32", 0), + ("int32", "0"), + ("float64", 0.0), + ("float64", "0.0"), + ("float64", "0x0000000000000000"), + ], + ids=["int-numeric", "int-string", "float-numeric", "float-string", "float-hex"], +) +def test_rejects_zero_scale(dtype: str, scale: object) -> None: + """scale=0 is rejected (destroys data and breaks decode division). + + A string ``scale`` is a documented input, so every spelling of zero has to be + rejected the same way as the numeric one. + """ with pytest.raises(ValueError, match="scale must be non-zero"): zarr.create_array( store={}, shape=(10,), - dtype="int32", + dtype=dtype, chunks=(10,), - filters=[ScaleOffset(offset=0, scale=0)], + filters=[ScaleOffset(offset=0, scale=scale)], compressors=None, fill_value=0, )