Repository navigation
NEMAR procedures: band power topography, ERP topography, time-frequency by condition (#721) - #722
Conversation
…frequency by condition Three documents and their config entries (seven procedures now); the two sound-alike when lines are reworded. Blocks run on nm000132 sub-001 by hand; the tests and the browser lane follow in later commits.
Declared step sequences for the three new documents, byte-identical shared blocks, the position table against nm000132's 30 EEG labels and xx099905's three, the few-channel caveat, and the when lines. Tested: pytest.
30 and 3 positioned channels draw one figure each (surface and markers, or markers only); a synthetic tone peaks at its frequency and time in the dB map. Tested: bun frontend/test-data-lane.js, 238 passed.
…s slow (single processor, limited compute and memory) and name ways to shorten it Tested: tests/test_assistants/test_nemar_runtime.py, tests/test_core/test_config, tests/test_scripts pass.
…xtras (92 of 343), with tests; tested
…pute block in the Pyodide lane (printed, not asserted); tested
Preview Deployment
This preview will be updated automatically when you push new commits. |
…he time-frequency slowness rationale; tested
…r and flat plan order, tidy tests; changelog notes the slow-run warning; tested
Review round 1: outcomesFix commits are on this branch (289c673, fb375bc, 715555b).
|
…43 comment; tested
|
Review round 2 outcomes (fix commit e15e12c on this branch):
The time-frequency slow-run warning (single processor, limited compute and memory) is unchanged and still pinned by its test. |
|
Project manager verdict: not merging. Unmet: the size criterion. band-power-topography is 16,757 and erp-topography 15,250 characters, against the required about 12,000 each, and the test cap is TOPOGRAPHY_SIZE_CAP = 17,000, not 12,500. This is the open maintainer decision already noted in the review rounds: either accept about 17k per topography document (record it in #721) or cut the shared blocks and relax the byte-pin tests to reach 12.5k. Also, at the time of this check Test (3.11), Test (3.12) and Frontend Tests were still pending; Lint passes. Met: the table rename and label coverage tests, the time-frequency warning tests (before the numbered steps), no lane figure added (measurement was not a browser figure), the prompt-size and document-size facts, the N170 re-measurement, and Refs #721 and Refs #719. Every review finding has an outcome in the round 1 and 2 comments. |
…question stays among the first three Many NEMAR datasets name channels in schemes the 10-10 table cannot place (EGI E1-E128, BioSemi A1-D32), so a scalp map offered on every dataset page would often place no electrodes. Test now pins the ERP image among the first three and no scalp-map template. Tested: tests/test_assistants, tests/test_core/test_config, tests/test_scripts (1314 passed); bun frontend/test-widget-dataset-questions.js (61 passed); ruff clean.
Refs #721
Refs #719
Summary
Three more NEMAR procedure documents (band power topography, ERP topography, time-frequency by condition), so NEMAR declares seven.
This PR finishes #721 on the existing commits: the shared electrode position table is trimmed from 343 to 92 labels, the shared scalp-map prose is trimmed, the time-frequency slow-run warning is tested, the compute block is timed in the Pyodide lane. The dataset page's starter questions are unchanged (see the update below).
The issue stays open: it needs the post-merge consistency check and live runs, which are the maintainer's.
Fp1toIz), the aliasesT3T4T5T6, and the sitesA1A2M1M2, derived from the existing table (not re-derived from MNE), same fence in both documents.I1,I2and every 10-05 label (AFp1h,FFC1h, ...) are gone.A1,A2,M1andM2were already in the old table, so none had to be placed again.frontend/test-data-lane.jstimes the document's compute block (one warm-up, three timed runs, median, printed and never asserted).Size
Prompt size (measured with the real
CommunityConfigandCommunityAssistant._format_procedures_section):len(nemar.system_prompt)## Known proceduressection,propose_planbound## Known proceduressection, nopropose_planThe seven documents, in characters (
len(document)fromprocedure_documents(); the limit is 32,000):power-spectrumband-powererp-by-conditionerp-image-by-conditionband-power-topographyerp-topographytime-frequency-by-conditionThe position fence went from 8,998 to 2,251 characters.
The issue's target of about 12,000 characters per topography document is not met, and the test cap (
TOPOGRAPHY_SIZE_CAP) is 17,000, not 12,500.The table was 9k of 22 to 24k; most of the rest is the shared drawing and matching blocks, the byte-identical Welch and filter blocks and the plan, which tests pin byte for byte.
Those pins are test choices and could be relaxed, so going lower is possible, but it means cutting shared blocks and loosening tests.
Accepted by the maintainer's session: about 17k per topography document (about 4,200 tokens, fetched only for a topography request). The 12,000 figure in the brief was an estimate made before the shared blocks were counted.
The PR stays on
Refs #721until that is decided; the headroom test (under 28,000) stays.What nm000132 sub-001 N170 shows
Every block was run from the documents' own fences (scratch environment outside the repo, CPython 3.12 with
eegprep_lean0.5.0, the real recording,sub-001/eeg/sub-001_task-N170_eeg.set, groupeeg_250hz, events fromevents.tsv), against the trimmed table.All of the earlier figures are confirmed; none moved.
HEOG_left,HEOG_right,VEOG_lowerleft out; all 30 have a position (left out, no position: none).The removed 10-05 labels change nothing for these 30 channels, nor for
C3,Cz,C4.A frontal maximum, not the textbook posterior one.
Face minus car is most negative at P9 (-4.55 uV), P10 (-3.57), PO7 (-3.46), P7 (-3.19) and most positive at FC4 (+4.14), F4 (+3.86), FCz (+3.23), Cz (+3.03).
PO8 face minus scrambled face, 150 to 260 ms, mean -4.19 uV (79 and 78 epochs at that channel alone).
The slow-run figure: not added
The lane measures the compute block (80 epochs per condition, 2 conditions, 19 frequencies, 250 Hz) at a median of 0.033 s (runs 0.032, 0.033, 0.037 s) in Pyodide under Bun on an Apple M4 laptop, 10 cores, 16 GB, not a browser; native CPython gives 0.016 s after a first call of 0.34 s.
That is not a figure of "about N seconds", and I did not extrapolate a browser figure, so the warning gains no "(about N in testing)" and there is no regex assertion for one.
The compute block alone is not what makes the run long on a single-processor browser with limited memory (the read, the package load and a longer window or more epochs are); the maintainer's warning stands as written.
Tests
tests/test_assistants/test_nemar_runtime.py: the table test is renamed and updated (aliases and extras, 3 decimals, radius bound,T3 == T7,T6 == P8,Czat the origin, every other label a 10-10 label); both documents carry byte-identical fences under the size cap; the count in both documents and inCHANGELOG.mdis the table's real count; every label of nm000132's 30 EEG channels (which are ERP CORE's 30, so nothing extra to add) and of xx099905's 3 is positioned after the document's ownlocate()andleft out, no position: noneprints; the time-frequency plan holds the warning's five phrases before the first numbered step.normalize_step, shared blocks are byte-identical, markers only below 8 positioned channels with the plan still proposed, disjointwhenlines, filtering decided once in time-frequency, findings for few channels. No gaps found.scripts/plan_consistency.pywas not changed or run (paid LLM calls); the post-merge consistency check and the live runs are the maintainer's.Commands run
uv run python promptsize.py(scratch): prompt and document sizes aboveuv run pytest tests/test_assistants/test_nemar_runtime.py: 107 passeduv run --python 3.12 --all-extras pytest tests/test_assistants tests/test_core tests/test_frontend tests/test_api --no-cov: 4353 passed, 21 skipped, 0 failed (after the round-2 fixes; the earlier full run had 5 external-service failures unrelated to this change)bun frontend/test-data-lane.js: 246 passed, 0 failed (same 30 labels, and the 3-label case C3, Cz, C4)uv run ruff check .anduv run ruff format --check .: clean