Repository navigation
Epic #854: catalog channel count + electrode-system classification - #863
Merged
Merged
Conversation
Phase 1 of epic #854. Additive only: - migration 0054 adds n_channels (INTEGER) + electrode_system (TEXT) to datasets, with indexes for filterability. - expose both in the public list + ?mine list SELECTs. The detail endpoint already returns them via SELECT d.*. Values stay NULL until phase 2 (#858) computes them and phase 3 (#859) backfills; the website channel/montage filter reads NULL as "not classified yet". No existing column or alias changes, so no contract regression. Closes #857. Part of #854.
Phase 2 of epic #854. Populate the migration-0054 columns during enrichment: - channel-montage.ts (pure, unit-tested): parseChannelsTsv, parseEegChannelCount, resolveNChannels (measured channels.tsv EEG count wins over a disagreeing sidecar), classifyElectrodeSystem (egi-geodesic / biosemi / 10-20 / 10-10 / 10-05 / other), grounded in MNE-derived label sets (montage-label-sets.ts). - getBidsTreeStats samples an exemplar eeg channels.tsv + eeg.json from the subjects it already walks and runs the classifiers (best-effort: a probe failure leaves the columns NULL, never breaks the modality/subject walk). - writeDatasetMetadataColumns COALESCE-writes n_channels + electrode_system; the reindex caller threads them through. EEG-only for now; populated via the reindex/walk path (the LLM-enrich path omits them, COALESCE-safe). Backfill of existing rows is phase 3 (#859). Closes #858. Part of #854.
Phase 1: channel/montage schema + projection (#857)
Phase 2: channel count + electrode-system compute (#858)
Phase 3 of epic #854. One-time backfill for the columns added in phase 1/2 across existing EEG datasets: - migration 0055 adds channel_montage_checked_at (resumability marker, mirrors archive_checked_at). - POST /admin/datasets/channel-montage-sweep?limit=N: candidates are repo-backed (nm*/on*), EEG, non-sandbox, unchecked rows. Runs the phase-2 getBidsTreeStats probe and writes n_channels + electrode_system DIRECTLY (no updated_at bump, so the backfill doesn't re-sort every EEG dataset to "newest"). Idempotent; bounded per call (<=30) under the Worker subrequest cap. - scripts/backfill-channel-montage.sh drives it until remaining=0. Real-SQLite test applies migrations 0054+0055 and pins the candidate scoping + the no-updated_at-bump write. Closes #859. Part of #854.
Phase 3: channel/montage backfill sweep (#859)
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR863Version: 🤖 Updated on each push. |
This branch was previously deployed
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.
Summary
Adds a per-dataset channel count + electrode-system class to the catalog so the website can filter/identify high-density and special-system (EGI geodesic, BioSemi) EEG datasets. Additive throughout — no existing column/alias/contract changes.
Phases (all merged to this epic branch)
n_channels,electrode_system) + list/detail projection. Columns ship NULL.channel-montage.tsclassifier (egi-geodesic/biosemi/10-20/10-10/10-05/other, MNE-grounded label sets;n_channelsfromEEGChannelCountcross-checked against a measuredchannels.tsv), wired intogetBidsTreeStats(best-effort exemplar probe) +writeDatasetMetadataColumns.channel_montage_checked_at) +POST /admin/datasets/channel-montage-sweepone-time backfill (writes the two columns directly, noupdated_atbump) + driver script.Deploy / backfill
Migrations 0054/0055 apply on deploy (dev D1 on this merge; prod D1 on the eventual dev→main). After deploy, run
scripts/backfill-channel-montage.shagainst dev to validate, then prod to populate the public catalog. Going-forward datasets populate via the reindex/enrichment walk.The website's guarded Channels & montage filter (already built) lights up once these columns populate.
Testing
tsc --noEmitgreen across all phases; existing datasets/metadata suites unchanged.Closes #854. Closes #857, #858, #859.