Repository navigation
Add a split-Zarr-to-H5 writer with source-H5 parity checks - #1
Merged
Merged
Conversation
New recordings are published only as primary Zarr, derivative Zarr and summary JSON. bdsp.zarr_to_h5.write_h5 (CLI: bdsp-zarr-to-h5) assembles them into one local H5 in the layout the converter read: - signals as int16 with a recovered calibration that reproduces every Zarr sample bit-exactly through the converter's formula (float32 with an identity calibration when none exists); mV/V units restored; - annotations with original codes and event maps; - feature time-series families copied from the payload extension; - the full recording summary and exported vectors from the JSON. Metadata the split format never stored is listed in bdsp_h5_export instead of being invented. bdsp.h5_compare.compare_h5 checks a rebuilt H5 against its source, and validation/h5_parity.py runs that check (and the converter's own verifier) on seeded samples. On 5 recordings per cohort, all 25 from S0001, I0002, I0003, I0004 and I0006 passed; 1,024/1,024 signals had identical physical samples and the converter verified all 30 rebuilt H5s. I0007 cannot be rebuilt completely because its derivative Zarr stores are not published (0 of 300 sampled subjects); see validation/reports/2026-11-27-h5-parity.md. Bumps the version to 0.5.0.
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
New recordings are published only as split Zarr (primary + derivative + summary JSON). This adds a writer that assembles them back into one local H5 in the layout the converter read, plus a parity check against the archived source H5.
bdsp.zarr_to_h5.write_h5/bdsp-zarr-to-h5CLIevent_map.bdsp.sleep-feature-payload.v1.prefilter,rule, producer provenance,features/research) is listed inbdsp_h5_export, not invented.bdsp.h5_compare.compare_h5: compares a rebuilt H5 with its source (names and counts only, never values).validation/h5_parity.py: seeded, resumable live check that also runs the converter's own verifier with the rebuilt H5 standing in as the source.docs/bids-zarr/H5_EXPORT.md, plus short links from the guides. Version bump to 0.5.0.Verification
pytest: 51 passed, 1 skipped (the existing opt-in AWS test). The new synthetic round-trip tests include mV units, sparse and boolean channels, payload families and tamper detection.validation/reports/2026-11-27-h5-parity.md:bdsp.read_h5,open_h5andto_dataframegive identical results on a real rebuilt vs source H5.Finding
I0007 derivative Zarr stores are not published: 0 of 300 sampled subjects have one, and only the summary JSON exists. Rebuilt I0007 H5s therefore lack CAISR annotations and feature time series. Everything I0007 does publish matches.
No cloud data were modified. Participant-level evidence stays in the ignored
validation/results/.