Skip to content

Correct the eegprep-lean tier table and where channel units live - #1468

Merged
neuromechanist merged 3 commits into
devfrom
docs/lean-zarr-is-an-extra
Sep 21, 2026
Merged

neuromechanist merged 3 commits into
devfrom
docs/lean-zarr-is-an-extra

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Two corrections to what eegprep-lean's tiers are and what its base tier can answer. Both were found while building the plot tier in sccn/eegprep#409.

zarr is an extra, not a base dependency

ADR 0069's table puts zarr in the base, at 12 packages and 4.2 MB, described as "read a window of data". The implementation cannot follow it.

zarr installs under Pyodide only as micropip.install("zarr==3.4.0", deps=False). Its numcodecs>=0.14 pin is metadata, and numcodecs publishes no emscripten wheel at any version, so a normal resolve fails on a dependency these stores never touch at runtime. A base tier that declared zarr would make micropip.install("eegprep-lean") fail outright in the browser the distribution exists for.

So the tier ADR 0069 measured at 12 packages and 4.2 MB is [zarr], and the base beneath it is the package alone.

ADR 0069's measurements are unchanged. What was wrong is the install name each row sits under.

The base tier answers more than the table implied

The unit each channel is measured in, and the channel's own label, are attributes of the channel group, not of the level-0 array. The array carries scale, offset and physical_formula but not the unit those produce, so a reader inspecting only the array concludes units are unknowable. eegprep-lean did exactly that and shipped the claim; nm000103 names its channels E1 through E129 and declares them in uV.

The same document carries original_rate, which does not always equal rate: the store resamples level 0 to min(native rate, modality cap), and the cap for EEG and MEG is 250 Hz, so nm000103 was acquired at 500 Hz and is served at 250. A client reporting only rate lets a caller believe they hold the recording as acquired.

Reading that document needs no zarr and no numpy, so it belongs to the base tier.

The preprocess row was measured with matplotlib present

ADR 0069 measured the tiers cumulatively, so the 30.4 MB figure includes matplotlib's 9.8 MB. The row is now [zarr,plot,preprocess], and the table says [zarr,preprocess] alone has not been measured. The package count corroborates this: 22 to 23 is one new package going from [zarr,plot], which only works if scipy's sole new dependency, numpy, was already satisfied by matplotlib.

How each document is treated

  • ADR 0069 gets an inline correction note, in the style of the one it already carries for the [ica] tier, rather than an edited table. Never delete, supersede or annotate.
  • .context/eegprep_lean_contract.md is a design doc, not an ADR, and it is what a reader of eegprep-lean consults, so its table is corrected in place and a section on what the base tier can answer is added.
  • Open question 1 is narrowed: the base tier's membership is settled (nothing), and what remains unwritten is the [zarr] tier's package list.

bun test ./test/adr-index.unit.test.ts passes: 8 tests.

ADR 0069's tier table puts zarr in eegprep-lean's base, at 12 packages and
4.2 MB. The implementation cannot follow it. zarr installs under Pyodide
only with deps=False, because its numcodecs>=0.14 pin is metadata and
numcodecs publishes no emscripten wheel at any version, so a base that
declared zarr would make micropip.install("eegprep-lean") fail outright
in the browser the distribution exists for.

The ADR gets a correction note in the style of the one already there for
the [ica] tier. The contract doc, which is what a reader of eegprep-lean
consults, gets the table corrected in place. ADR 0069's measurements are
unchanged; only the install names they sit under were wrong.
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR1468

Version: 0.10.5-PR1468.ec6a688
Commit: ec6a688


🤖 Updated on each push.

The unit is an attribute of the channel group, not of the level-0 array,
which carries scale, offset and physical_formula but not the unit they
produce. A reader that inspects only the array concludes units are
unknowable; eegprep-lean did, and shipped that claim. The same document
carries original_rate, which does not always equal rate, because the
store caps level 0 at 250 Hz for EEG and MEG.

Both need no zarr and no numpy to read, so they belong to the base tier,
which the tier table understated.

Also corrects the preprocess row: ADR 0069 measured the tiers
cumulatively, so 30.4 MB was measured with matplotlib present and the row
now names plot as well.
@neuromechanist neuromechanist changed the title Record that zarr is an extra, not a base dependency Correct the eegprep-lean tier table and where channel units live Sep 21, 2026
The map still said the package did not exist. It does: #406 the index
reader, #408 the window reader, #409 the plot tier plus channel labels,
units and acquisition rate. #410 stays open for read_window's missing
offline coverage.
@neuromechanist
neuromechanist merged commit cede22c into dev Sep 21, 2026
12 checks passed
@neuromechanist
neuromechanist deleted the docs/lean-zarr-is-an-extra branch September 21, 2026 16:22

This branch was previously deployed

1 inactive deployment
npm — ec6a6885 Deployed Sep 21, 2026 by neuromechanist via publish #2778
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant