feat(validator): validate examples.zarr channel_combos metadata#68
Draft
VBaratham wants to merge 6 commits into
Draft
feat(validator): validate examples.zarr channel_combos metadata#68VBaratham wants to merge 6 commits into
VBaratham wants to merge 6 commits into
Conversation
Add validation for the OPTIONAL channel_combos panel metadata on the examples.zarr root group (see ops-schema example-images.md #67): - OPSChannelComboMetadata model + validate_ops_examples_channel_combos_metadata: shape checks (unique non-empty names, non-empty primary_channel, priority >= 0 when present). - examples.py: cross-leaf rule (check_primary_channels) asserting each primary_channel is present in every leaf of its combo, sampling one leaf per distinct source_screen (default_sample_leaves; local + S3 via fsspec). - Route any group carrying top-level `channel_combos` to the examples validator before NGFF/HCS dispatch — the spec forbids HCS checks on this artifact. New ZarrNodeType.EXAMPLES_ROOT + registry entry. Tests: shape, cross-leaf rule, local-fixture sampler, orchestrator, and end-to-end validate_zarr_node routing. 21 new tests pass; existing zarr tests unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The examples-root routing test round-trips through `zarr.open_group`, and a hand-written root `zarr.json` didn't read back consistently across zarr/platform combos (passed on macOS, failed on Linux CI with node_type=None). Write the root group via the zarr API so its metadata is exactly what the installed zarr expects. Leaves stay hand-written (read by the fsspec sampler, not zarr). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The examples-root routing branch (`if "channel_combos" in raw_attrs: -> validate_examples_root`) plus its import were left out of the original commit, so CI ran the unmodified dispatcher: examples roots fell through to open_ome_zarr, failed NGFF validation, and returned node_type=None (local passed only because the working tree had the change). Commit validator.py and restore the test to its clean form (the zarr-fixture/debug churn chased the wrong cause). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the single REQUIRED `primary_channel` with an OPTIONAL ordered `display_channels` list (omit ⇒ show all channels, the default). The cross-leaf rule now checks every listed label is present in every leaf of its combo, rather than a single primary. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Validates the OPTIONAL
channel_combospanel metadata on theexamples.zarrroot group (the spec side is ops-schema #67).OPSChannelComboMetadata+validate_ops_examples_channel_combos_metadata): names unique + non-empty,primary_channelnon-empty,priority ≥ 0when present (optional).examples.py):primary_channelMUST be present in every leaf of its combo. Sampled one leaf per distinctsource_screen(the channel set is uniform within a screen, but a combo can aggregate multiple screens with differing sets).check_primary_channelsis a pure, dependency-injected rule;default_sample_leavesdoes the fsspec walk (local + S3).channel_combosattribute is dispatched to the examples validator before NGFF/HCS checks — the spec forbids applying HCS checks to this artifact. NewZarrNodeType.EXAMPLES_ROOT+ registry entry.Tests
21 new tests (shape,
labels_from_attrs, pure cross-leaf rule, real local-fixture sampler, orchestrator pass/fail, end-to-endvalidate_zarr_noderouting) — all pass. Existing zarr tests (34) unaffected.Notes
rlim/port-dca-zarr-validator-2(per request) — that branch's restructuredzarr_validation/package + multi-screen handling is the right base. Retarget tomainafter it merges.ops_validator/__init__.pyeagerly imports the experimental validator →pronto(only in the[all]extra), sopip install -e ".[dev]"alone can't collect tests; needs[all,dev]. Not addressed here.🤖 Generated with Claude Code