Repository navigation
Ingest: write the epoch's data, ingest by segment in parallel, and compare tool (NDI-matlab#1089, #1090, #1091) - #346
Conversation
…ogress)
Ingestion made each epoch's documents without any data, so nothing
could be read from an ingested epoch ("channel_list.bin not found").
- ndi_daq_reader_mfdaq.ingest_epochfiles (NDI-matlab 6ff0264e5, #1089):
the channel list (channel_list.bin, MATLAB's saveStructArray format)
and the data in compressed segments -- analog in the reader's
underlying type, digital, time, event/marker/text -- plus ProgressFcn,
the fraction of the epoch done after each segment.
- ingestEpochDocuments (b192ae605): fractional ProgressFcn while an
epoch is underway, also from worker processes (Manager queue).
- Intan reader: underlying_datatype (uint16, as MATLAB); aux inputs read
at their own sample rate; digital channels as NDR numbers them (16
were requested and NDR refused); reads past the end are not padded.
- Metadata readers store readmetadata's parameters (data.bin) and
readmetadata_ingested reads them back.
- mfdaq_epoch_channel.writeToFile writes MATLAB's format; readFromFile
still reads the older JSON files.
Needs ndi-compress's compress_ephys format options
(Waltham-Data-Science/NDI-compress-python#4).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
|
Generated by Claude Code |
|
Once #4 merges, re-running CI here should leave only the bridge-completeness failures, which #347 fixes. Generated by Claude Code |
ndi_daq_reader_mfdaq.ingest_epochfiles is split into ingest_epochfiles_plan, ingest_segment and the static ingest_attach_segments, as in MATLAB, and ingest_epochfiles runs them in sequence. ingestEpochDocuments now plans each epoch in the caller and hands single segments (and each epoch's metadata readers) to the worker processes, so the pool stays busy however unequal the epochs are; progress is counted in the caller from the plan weights, which retires the Manager queue. New ndi.test.ingest.compare / mfdaq_compare compare a raw session with an ingested copy: epochs, channel lists, every sample of every continuous type (RelativeTolerance / TimeTolerance) and every event, with a report of every check. tests/test_ingest_compare.py mirrors ingestCompareTest, plus a parallel many-segment ingest that must compare equal, a corrupted sample that must be reported, and MATLAB's plan/segment/attach equivalence test. Bridge: mfdaq_reader -> 5c5784c6a with the three new methods, ingestEpochDocuments -> 569fdab67; fun/epoch (9821a12e6) and setup (fd7ddbf06) bumped with notes, as nothing there needs porting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
|
MATLAB/Python bridge completeness is red on 30435c0 for reasons outside this PR. The checks for every entry this PR touches ( The two failures are entries missing for MATLAB's update dialog (VH-Lab/NDI-matlab 19b8ab573 and 749b1a266):
Generated by Claude Code |
…branch #347 already re-examined the ndi.fun.epoch and ndi.setup bridge entries against NDI-matlab main, so its versions of those two files are kept and this branch's duplicate notes are dropped. CHANGELOG keeps every entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw
Ports VH-Lab/NDI-matlab#1089, #1090 and #1091, all of which are merged. CI checks against NDI-matlab main and installs ndi-compress from NDI-compress-python main, which now has Waltham-Data-Science/NDI-compress-python#4.
Why
Python ingestion made each epoch's documents without any data. After a Python ingest, reading an ingested epoch failed with
channel_list.bin not found. NDI-matlab leads, so this ports three things from it: its writer, its segment-level parallel scheduler, and its raw-vs-ingested comparison tool.What
ndi_daq_reader_mfdaqingestion (NDI-matlab 6ff0264e5, 569fdab67):channel_list.bin, with each channel's sample rate, offset and scale);ingest_epochfiles_plan,ingest_segmentand the staticingest_attach_segments.ingest_epochfiles(..., ProgressFcn=)runs the three in sequence.ingestEpochDocuments(b192ae605, 569fdab67):ProcessPoolExecutor, so every worker stays busy even with one long epoch.ProgressFcn'snumDoneis fractional, counted in the calling process from the plan weights.ndi.test.ingest.compare/mfdaq_compare(#1091) compare a raw session with an ingested copy of it:RelativeToleranceandTimeTolerance), and every event;underlying_datatypegives uint16, as in MATLAB;data.bin, andreadmetadata_ingestedreads them back.mfdaq_epoch_channel.writeToFilewrites MATLAB'ssaveStructArrayformat.Differences from MATLAB (in the bridge decision logs)
do_group*. MATLAB writesdi_group*, which collides with digital inputs of the same group; this looks like a MATLAB bug.datatypestringrejects'float64'.ChannelInfoalways has every field, whereas MATLAB compares only the fields both lists share.Bridge
mfdaq_readeris synced to NDI-matlab 5c5784c6a, with entries for the three new methods.ingestEpochDocumentsis synced to 569fdab67.mainpasses the bridge checks again. Thefun/epochandsetupnotes are Update button: package table with tick boxes; bridge catch-up with NDI-matlab main #347's, kept in the merge.Testing
tests/test_ingest_data_writer.py(10 tests) ingests the example Intan session and reads every channel type back, comparing against the raw reads. This includes epochs split across several segments and windows that cross segment boundaries.tests/test_ingest_compare.py(8 tests):ingestCompareTest;🤖 Generated with Claude Code
https://claude.ai/code/session_011v7R5rnKYwncJkrNZRXhtw