Repository navigation
Description
Part of #90 (PR #61 catch-up). This is item M4, and it is a live defect, not just a parity gap — verified against main today.
The defect
src/ndi/setup/lab.py:163-178 builds the daq/daqmetadatareader document with exactly one field:
mr_doc = session.newdocument(
"daq/daqmetadatareader",
**{
"base.name": name,
"daqmetadatareader.ndi_daqmetadatareader_class": mr_class,
},
)No file parameter is set. And MetadataReaderFileParameters — which appears in 10 bundled lab configs — is read by zero lines of Python in src/:
$ grep -rn "MetadataReaderFileParameters" src/ --include=*.py
(no matches)
So every lab configured through setup.lab() gets a metadata reader that matches no files and therefore reads no stimulus metadata. Affected configs:
| Lab config | file parameters that are being dropped |
|---|---|
vhlab/vhvis_spike2.json |
stims.mat |
vhlab/vhajbpod_np.json, vhlab/vhtaste_bpod.json |
(.*)\.json |
angeluccilab/angelucci_visstim.json |
stimData.mat |
dbkatzlab/narendra_intan.json |
3 .tsv files |
rayolab/rayo_stim.json |
#_\d{6}_\d{6}\._epochprobemap\.txt\> |
kjnielsenlab/nielsen_vis.json, nielsen_visnp.json |
(.*)\.analyzer\> |
Second half of the same defect: lab.py:165-169 collapses a multi-entry reader spec with metadata_reader_class[0], building one reader where MATLAB (+setup/lab.m) builds one per file-parameter entry. dbkatzlab/narendra_intan.json declares three .tsv metadata files and gets one reader with none of them — 2 of 3 files silently lost even once the first bug is fixed.
Third: setup.lab() installs no sync rules at all, so every lab comes up with an empty syncgraph. MATLAB installs a default filematch(2) syncrule. This is a pre-existing divergence, not a regression.
What it would take
- Read
MetadataReaderFileParametersinlab.pyand set it on thedaqmetadatareaderdocument, in the same MATLAB cell-string form_to_matlab_cell_stralready produces forfilenavigator.fileparameters. - Build one reader per file-parameter entry when the spec has several, matching
+setup/lab.m. Error rather than guess when several classes are given alongside a single file parameter (PR NDI-python 2026-08 catch-up — hardening bundle + MATLAB parity + CI safety #61 commit576e7d1took that position). - Port
ndi.setup.sync— a newsrc/ndi/setup/sync/package withadd_sync_rules, mirroring+setup/+sync/*at MATLAB881919d39,928de391c,68431eb38,ffe310085. Supportforce_update. - Vendor
ndi_common/sync_rules/from NDI-matlab (vhlab/vhintan_intan2spike2.json,vhlab/vhtaste_sync2bpod.jsonat minimum) — the directory does not exist in this repo today. - Install the default
filematch(2)syncrule inlab(). - Related, found while porting: syncrule class resolution silently falls back to the abstract base on an unknown name instead of erroring. Fix that in the same pass.
Test surface
PR #61 carried 36 tests for this (tests/test_setup_lab.py, tests/test_setup_sync.py, commits de693e9, 280826a, 576e7d1, b20a188). The symmetry proof is the blankSession comparison asserting metadata-reader file parameters and installed syncrules on both sides — without that assertion the make/read pair passes while both languages produce nothing.
Reference commits on catchup/ndi-python-2026-08: de693e9, 280826a, 576e7d1, b20a188.
Activity
Merge pull request #178 from Waltham-Data-Science/claude/ndi-python-i…