Index.from_chunks(): manifest-built indices for the parquet-primary sidecar store#2
Merged
Conversation
…set/Chunk construction and shell shims (issue #1)
…r paths, both tiers
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.
Closes #1. Implemented exactly per the plan posted there
(#1 (comment)).
What
Index.from_chunks(source, datasets)(staticmethod): construct adecode-capable index from an externally-supplied chunk manifest — no
granule file access, no stored bincode. Plain python/numpy inputs only;
parquet decoding stays caller-side.
Index.filters(dataset)→{"gzip": int|None, "shuffle": bool, "byte_order": "little"|"big"|"unknown"}— the missing extractor-sidegetter;
datasets()/shape()/chunk_shape()/dtype()/filters()/chunks()nowproduce everything
from_chunksconsumes.limitation.
Construction route (hybrid, as planned)
The per-dataset payload is built entirely with hidefix 0.12 public API
(
Chunk::new,Dataset::new,DatasetD::D1..D9,Datatype,Order).The two non-constructible shells (
Index,GroupIndex— private fields)go through in-memory serde shims with bincode-identical layout, serialized
and immediately deserialized through the same code path
load()uses(shared
holder_from_byteshelper). Bincode never touches disk.Validation / errors
ValueErrorwith dataset name + offending key on: missing keys, rankmismatches, chunk-table length mismatches, wrong chunk count vs
ceil(shape/chunk_shape), non-chunk-aligned or out-of-bounds offsets,duplicate offsets, unsupported dtype,
gzipgiven as bool, and any nonzerofilter_mask(hidefix's chunk model is(addr, size, offset)— per-chunkfilter masks are unrepresentable; ATL03 masks are all zero per
englacial/zagg PR #159). Chunk rows are sorted internally.
Tests
45 total (was 37), all green both tiers:
from_chunks→ byte-identicalread/read_plan/read_from_buffersvs the directly-built index(incl. empty + boundary-crossing ranges),
filters()values vs h5py,save/load coherence of a from_chunks index, unsorted rows, plain-list
inputs, no-file-access construction (phantom source path), and 15+ error
paths.
and buffer-fed reads.
clippy -D warnings, fmt, and both CI workflows green.