Repository navigation
RFC 0001: biosig-zarr, with .bzx as its single-file form - #2
Draft
neuromechanist wants to merge 11 commits into
Draft
neuromechanist wants to merge 11 commits into
neuromechanist wants to merge 11 commits into
Conversation
11 tasks done
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.
RFC 0001: biosig-zarr, a Zarr format for biosignal recordings, with
.bzxas its single-file formThe Neuroelectromagnetic Data Archive and Tools Resource (NEMAR) already serves 231,259 biosig-zarr stores (98.4% of the 235,038 recordings in its 910 public datasets, about 116,285 hours, measured 2026-11-20), read by its data viewer and by its Model Context Protocol (MCP) server for agentic research. At least 978 of those stores were converted from a source with a measured gap. This Request for Comments (RFC) asks the whole biosignal community, from electroencephalography (EEG), magnetoencephalography (MEG), intracranial EEG (iEEG), electromyography (EMG) and electrocardiography (ECG) to physiology, motion and wearables, and the people who build Zarr tools, to comment on the format and its single-file form,
.bzx(a ZIP archive using the ZIP64 extension), before it is frozen. It proposesformat_version3, which keeps the timing of recordings with gaps, jittered streams and sparse signals explicit, in a form that no reader can silently misread: classic European Data Format (EDF) assumes contiguous records, and while its discontinuous variant EDF+D can encode irregular samples as individually timestamped records of duration 0, version 2 of this format has nowhere to keep that timing. Version 3 also records the source recording's resolution and every lossy step beside the stored samples. The proposed text is the comparison2.0.2...3.0.0-draft.3in nemarOrg/biosig-zarr; it becomes3.0.0only if the RFC is accepted. The package rules are compared with OME-Zarr RFC-9 (the Open Microscopy Environment's proposal for zipped OME-Zarr), which is prior art, not a dependency. Abbreviations used in the questions: the General Data Format for biomedical signals (GDF), the Waveform Database format (WFDB), the Shared Near Infrared Spectroscopy Format (SNIRF), the Climate and Forecast conventions (CF), Hypertext Transfer Protocol (HTTP), Neurodata Without Borders (NWB), Brain Imaging Data Structure (BIDS).Questions for commenters
Answer any subset; a short answer with a real file behind it is worth more than a long one without.
The format as a whole
unit,channel_typeandmodalityare free-form strings (open question 11). Which vocabulary would you want them bound to?The package (
.bzx)zarr.jsonentries precede chunk entries in breadth-first order (open question 27)?.bzxfiles circulate, and where should it live (open question 24)?format_versionwith the store, as recommended, or have a version of their own?.bzxover HTTP range requests, or only local files?Names
.bzxcollide with anything you use (open question 30)?biosig-zarrlikely to be confused with the BioSig library, and does that matter?Irregular and sparse series
RecordingDuration,SamplingFrequencyandRecordingTypesay, and do yourevents.tsvonsets count gap time?valid_intervalsbe an attribute with a cap of 65,536, or arrays? What is the most fragmented recording you have?source_time: null(order known, elapsed time unknown) the right home for undated BrainVision segments, EEGLABboundaryevents and concatenated runs? Should epoched data be accepted this way, or refused?missing_value: nullfor bit-exact copies worth a second case in every reader?timestampedgroups with one sharedtimearray enough for your irregular data? Does anyone need a time per channel inside one group?continuity(continuous,step,instantaneous,unknown) the right vocabulary, and should it also apply to uniform groups?time, or do you need integer ticks?Resolution
derivationvocabularies complete (the channels' list of lossy steps, and thetimearray's list of timestamp corrections), and is an empty list a claim you would rely on?int32andfloat64be core storage types, and may a signal reader refuse them?source_adc_bitsexist when almost no EEG format states it?int<N>anduint<N>right forsource_sample_type, or should the list be closed?source_step,source_offsetandsource_digital_rangelet you restore the source header of the formats you export to? Which format do they fail for?Why not NWB
hdmf-zarrand NWB on Zarr today? What is out of date?Reader safety, the timeline and events
start_timeper uniform group the right model for streams that start at different times, and for a source cut from a longer session?onset_source_basis(timeline,concatenated,unknown) enough to align events in a recording with gaps, and is the onset-to-sample rule the rule you would implement?Resolution, continued
dtypeandscale, or isdtypeenough?Sub-sample gaps
valid_intervalsand needs thetimestampedkind. Do you have uniform recordings with such gaps, and is that the right home for them?Closes {{CLOSE_UTC}} UTC. The window is 21 days from the thread's creation. It is short on purpose: NEMAR welcomes review assisted by artificial intelligence when knowledgeable people use it and check what it produces, and with that help a careful review fits in three weeks; one extension of at most 14 days is possible. At most one NEMAR RFC is open for comment at a time.
The record is at {link to text/0001-biosig-zarr.md at its merge commit}.
How to comment. Reply under this RFC's Discussion with a GitHub account. Without one, write to [email protected] before the close; a maintainer posts your comment here with your consent, and with your name only if you agree.
Notes for the shepherd (not part of the opening post):
opened_atanddiscussionset opens the RFC. Setopened_atto the thread'screatedAtrounded down to the minute in UTC, fill{{CLOSE_UTC}}and the record link above.3.0.0-draft.3of nemarOrg/biosig-zarr, which holds the text, the JSON schemas (schemas/,schemas/v3/) and 20 conformance vectors (conformance/).bun run lint,bun run typecheck,bun test(140 pass),bun run src/check.ts(rfc-check: ok),uvx typos text/(exit 0).Round 1 fix (commits 03451d1 and 2b867e8):
valid_intervals[0,20) and [24,40), the gap runs from 2.00 s to 2.40 s; an event at 2.02 s keeps its onset and returns no acquired sample, though nearest-index rounding gives index 20. Intervals are half-open in sample indices. Gaps shorter than one sample cannot be represented on the grid and need the timestamped kind; new question 40 asks about them (commit 2b867e8).int16with a reserved missing code: 65,535 codes, 65,534 steps.start_time, onset rule andonset_source_basis); question 28 covers thetimearray's tokens; question 14 tied to the byte-range rule;valuesstorage type stated; open question 6 closed for integer stores only; archive-comment refusal marked as proposed and tied to question 10; biosigIO also refuses thebiosig-zarrname; unsourced "asked more than anything" dropped; issue 1771 comment anchors linked; the BEP 045 sentence reworded; D1 to D12 tags removed; abbreviations defined in this post.zarr_conventions, the refusal of a version 3 group withoutkind, the definition of "in effect", and the timestampedvaluesattributes.Round 2 fix: layer-3 in-effect aligned with the version 3 text (commit b49245f):
valid_intervalsis in effect when it holds more than one interval, as in the version 3 text.B4b: points at 3.0.0-draft.2 (commit 72098ad): the comparison is now
2.0.1...3.0.0-draft.2; every3.0.0-draft.1mention is now3.0.0-draft.2; the opening paragraph linksschemas/,schemas/v3/,conformance/README.mdandmanifest.jsonat that tag and counts 20 vectors, includingv3-gap-10hzandv3-gap-exact-copy; a sentence in Problem states that quoted specification text is under the W3C Software and Document License, with a link toLICENSE.mdat2.0.0.B4c: points at 3.0.0-draft.3, with the independence notice (commits 16b552d, 567ee7f, b600d58 and 0e4947c): the comparison is now
2.0.2...3.0.0-draft.3, and every3.0.0-draft.2mention is now3.0.0-draft.3; the quoted-text notice names the biosig-zarr contributors as the copyright holder, names this RFC's own license, Creative Commons Attribution 4.0 International (CC BY 4.0), and linksLICENSE.mdat2.0.2; Problem states that the specification is independent of NEMAR since 2026-11-20 (biosig-zarr Architecture Decision Record (ADR) 0005): its editor decides under itsGOVERNANCE.md, and NEMAR is its origin, first implementer and host, which backstops it and guarantees its continuation without deciding it; the packing rules are the specification's own, the version 2 reading rule is decided by the specification's editor, and the specification's editor decides this RFC; the release Digital Object Identifier (DOI) is issued through nemar-doi, which registers it and does not own it; a new row under "Decided, and out of scope for comment", a2.0.2row in "History of the format" and a change log line record the change. Gates run on head:bun run lint,bun run typecheck,bun test(140 pass),bun run src/check.ts(rfc-check: ok),uvx typos text/(exit 0).B4d: the back catalog count (commits 326fcbd and b6bbb3c): the promise to count the affected recordings is replaced by the counts of a read-only scan of the public catalog, linked through the public tag
rfc-0001-evidencein nemarOrg/nemar-cli (commitc48405fe); Summary gains one sentence (at least 978 stores converted from a source with a measured gap); Problem states 978 of the 231,259 stores (0.42%) from 36 datasets, 547 more that can be discontinuous (528 undated BrainVision segments, 19 with overlapping or backward segment dates), the two EDF+D stores whose dropped gap is inferred from the index and labeled so, and that the counts are lower bounds; the re-conversion bullet states at least 1,525 stores in 56 datasets; the interim EDF+D refusal bullet states what it concerns in the catalog (nm000456); the2, independentrow of "History of the format" keeps 2026-11-20 and says the2.0.2release was on 2026-11-21; a References line and a change log line record the evidence. Gates run on head b6bbb3c:bun run lint(no fixes applied),bun run typecheck,bun test(140 pass, 0 fail),bun run src/check.ts(rfc-check: ok),uvx typos text/(exit 0); every Acceptance grep returned its expected count.