Repository navigation
Conversation
d-v-b
added a commit
that referenced
this pull request
Oct 29, 2026
Assisted-by: ClaudeCode:claude-fable-5
d-v-b
force-pushed
the
claude/arrayio-context
branch
3 times, most recently
from
October 29, 2026 12:28
89fa080 to
be7fcdc
Compare
Extends zarr.core.context.Context — the extensions-in-scope value the structured data type resolution already uses — with codecs and codec_pipeline, and threads an optional context through the resolution functions: parse_dtype and the data-type getters, codec normalization (_resolve_codec, _parse_*_codec, parse_codecs), metadata from_dict on both formats, parse_array_metadata, create_codec_pipeline, and build_array_metadata. A kind the context leaves None resolves from the default registries exactly as before; a kind it sets is a closed world, and a name outside it fails to resolve, naming the scope. ArrayIO and AsyncArrayIO take the context in build, open and their constructors, and AsyncArray passes one through to the AsyncArrayIO it wraps. With the document-first binding the context is consumed only where the document resolves into classes: opening an array whose codec names fall outside the context still works for document operations, and resolution fails when the data path is built. Refs zarr-developers#4217 Assisted-by: ClaudeCode:claude-fable-5
d-v-b
force-pushed
the
claude/arrayio-context
branch
from
October 29, 2026 13:21
be7fcdc to
6e91402
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Added a
contexttozarr.ArrayIOandzarr.AsyncArrayIO: a value defining the data types, codecs and codec pipeline in scope for one array. Extension names in a stored document or inbuild's keyword arguments resolve through the context instead of the default registries; a kind the context leaves unset falls back to the defaults, while a kind it sets is a closed world, and a name outside it fails to resolve with an error naming the scope.The type is the existing
zarr.core.context.Context— the extensions-in-scope value the structured data type resolution already threads through nested reads — extended withcodecs: Mapping[str, type[Codec]]andcodec_pipeline: type[CodecPipeline], and exported fromzarr.experimental(the ArrayIO classes themselves are public in thezarrnamespace). An optionalcontext=is threaded through the resolution functions:parse_dtypeand the data-type getters, codec normalization (_resolve_codec,_parse_*_codec,parse_codecs),from_dicton both metadata classes,parse_array_metadata,create_codec_pipeline, andbuild_array_metadata. With no context, every path is byte-identical to before.The layering and the document-model binding land in #419; this PR only adds the context. With the document-first binding the context is consumed only where the document resolves into classes, so opening an array whose codec names fall outside the context still works for document operations, and resolution fails when the data path is built.
Scope notes:
from_dictandbuild_array_metadata).Stack
Stacked on #419 (
claude/arrayio-lazy-metadata-48d8e5); merge that first. This PR is theclaude/arrayio-contextbranch.🤖 Generated with Claude Code