Skip to content

Filter epoch entries by matching DAQ system device name#48

Merged
stevevanhooser merged 3 commits into
mainfrom
claude/fix-epoch-duplicates-fmU4s
Mar 22, 2026
Merged

Filter epoch entries by matching DAQ system device name#48
stevevanhooser merged 3 commits into
mainfrom
claude/fix-epoch-duplicates-fmU4s

Conversation

@stevevanhooser
Copy link
Copy Markdown
Contributor

Summary

This change adds validation to ensure that epoch probe map entries are only included if their associated device belongs to the current DAQ system being processed. This prevents mismatched device entries from being incorrectly included in epoch tables.

Key Changes

  • Added DAQ system name extraction in buildepochtable() method, checking both name and _name attributes
  • Added DAQ system name extraction in buildmultipleepochtables() method with the same fallback logic
  • Implemented device name matching logic in both methods that:
    • Extracts the device name from the matching epoch probe map via devicename attribute or by parsing the devicestring (taking the first colon-separated component)
    • Compares the extracted device name against the current DAQ system's name (case-insensitive)
    • Skips the epoch entry if the device names don't match
  • Applied identical filtering logic to both buildepochtable() and buildmultipleepochtables() for consistency

Implementation Details

The device name extraction uses a fallback approach:

  1. First attempts to use the devicename attribute if available
  2. Falls back to parsing devicestring by splitting on ":" and taking the first component
  3. Performs case-insensitive comparison to handle potential naming variations

https://claude.ai/code/session_016R2mDR7X4ySBpod8U54i1z

claude added 3 commits March 22, 2026 20:53
When multiple DAQ systems report the same epochs (same epoch_id and
epoch_session_id), buildepochtable and buildmultipleepochtables would
include duplicate entries. Deduplicate by tracking seen (epoch_id,
epoch_session_id) pairs and skipping already-seen epochs.

https://claude.ai/code/session_016R2mDR7X4ySBpod8U54i1z
Instead of blindly deduplicating by epoch_id (which could match the
wrong DAQ system), check that the matching epochprobemap's device name
matches the current DAQ system's name. This mirrors the MATLAB behavior
where only epochs from the correct device are included.

https://claude.ai/code/session_016R2mDR7X4ySBpod8U54i1z
The test mock_daqsys needs name and _name attributes set to match the
devicestring in the epochprobemap, so the device name check works
correctly.

https://claude.ai/code/session_016R2mDR7X4ySBpod8U54i1z
@stevevanhooser stevevanhooser merged commit 82ab3f6 into main Mar 22, 2026
5 checks passed
@stevevanhooser stevevanhooser deleted the claude/fix-epoch-duplicates-fmU4s branch March 22, 2026 23:24
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