Skip to content

filename2epochid: read the DAQ systems' live epoch tables, as MATLAB does - #350

Merged
stevevanhooser merged 1 commit into
mainfrom
claude/filename2epochid-live-epochtable
Nov 2, 2026
Merged

stevevanhooser merged 1 commit into
mainfrom
claude/filename2epochid-live-epochtable

Conversation

@stevevanhooser

Copy link
Copy Markdown
Contributor

Problem

ndi.fun.epoch.filename2epochid read daqsystem.epoch_table from stored daq_system documents. No document schema has that field, and nothing writes one, so the function returned nothing for every filename. epochid2element had the same defect and was fixed earlier.

Change

This now matches +ndi/+fun/+epoch/filename2epochid.m:

  • It calls session.daqsystem_load() and asks each DAQ system for its live epochtable().
  • A filename matches an epoch when it is a substring of any of the epoch's underlying_epochs['underlying'] files (MATLAB's contains).
  • Several filenames can name the same epoch (NDI-matlab 774a01f71).
  • It accepts a single filename string, and a single DAQ system returned on its own rather than in a list.
  • It warns about any filename that no epoch claims, as MATLAB does.
  • It still returns the existing dict[str, list[str]].

Bridge

INTERFACE UPDATE: the filename2epochid entry in src/ndi/fun/ndi_matlab_python_bridge.yaml now has a rewritten decision_log and accepts list[str] | str. The sibling epochid2element entry no longer says this defect is still open.

Tests

The fictional-schema test in tests/test_fun.py is replaced with tests that use mock DAQ systems. They cover a basic match, a single string with several systems, several filenames naming one epoch, the warning for an unmatched filename, and a session with no DAQ systems.

black --check, ruff check and the full pytest tests/ all pass. The bridge tests also pass when run against a full NDI-matlab checkout.


Generated by Claude Code

…does

filename2epochid read daqsystem.epoch_table out of stored daq_system
documents. No schema has that field, so it returned nothing for every
filename. It now mirrors +ndi/+fun/+epoch/filename2epochid.m: load the
session's DAQ systems (daqsystem_load) and match each filename as a
substring of every epoch's underlying_epochs['underlying'] in the live
epochtable(). Several filenames can name one epoch (NDI-matlab
774a01f71), a single filename string is accepted, and filenames no epoch
claims raise a warning, as in MATLAB. The dict-of-lists return shape is
kept. Bridge decision_log updated; tests added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011v7R5uJJtaq8SVB4eEwnBR
@stevevanhooser
stevevanhooser merged commit 700cfeb into main Nov 2, 2026
15 checks passed
@stevevanhooser
stevevanhooser deleted the claude/filename2epochid-live-epochtable branch November 2, 2026 13:17
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.

2 participants