Commit 076f02b
Add HDF5 metadata sidecar support (hdf5-meta extension)
Implements the optional hdf5-meta extension: a columnar HDF5 sidecar
alongside the .sigmf-meta JSON for faster, smaller column-oriented
metadata access on Recordings with large captures/annotations arrays.
- sigmf/hdf5.py: writer (write_hdf5_sidecar), full-dict reader
(read_hdf5_sidecar), and SigMFFileHDF5 — a lazy, columnar reader that
serves captures/annotations as numpy columns/arrays without building
per-row dicts (the actual speedup). Entry points hdf5.open (zero JSON)
and hdf5.fromfile (discover via one JSON read, prefer fresh sidecar).
- SigMFFile.tofile(write_hdf5=True): writes the sidecar and declares the
extension. sigmf.fromfile is unchanged and always reads pure JSON, so
existing behavior and the authoritative-JSON contract are preserved.
- Stale-sidecar guard via a source-metadata digest; h5py is an optional
dependency (pip install sigmf[hdf5]), lazily imported.
- tests/test_hdf5.py: round-trip, columnar reads, discovery, stale/
corrupt/missing fallback, edge cases.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent a3db459 commit 076f02b
7 files changed
Lines changed: 1071 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
64 | 91 | | |
65 | 92 | | |
66 | 93 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
0 commit comments