Skip to content

Plexon reader: each block's start offset is computed from its own size instead of the previous block's, so offsets are wrong when block sizes differ #1976

Open

Description

@evadiva3

Description

Plexon reader: each block's start offset is computed from its own size instead of the previous block's, so offsets are wrong when block sizes differ

Reproduction

import numpy as np

sample_counts = np.array([100, 200, 50])
current = np.zeros(3, dtype=int)
for index in range(1, len(sample_counts)):
    current[index] = current[index - 1] + sample_counts[index]
expected = np.r_[0, np.cumsum(sample_counts[:-1])]
print(current)   # [0 200 250]
print(expected)  # [0 100 300]

Environment

Mac; Python 3.13.9; development checkout e899f3e1e13e11ed09045c463ee340ac86f98311.

Now validated against the public plexon/File_plexon_3.plx recording from ephy_testing_data: its 5,007 analog blocks include sample counts of 120 and 86, and the original parser places the final block start 34 samples early. The fix in #1980 corrects the starts and reproduces the stored sample values in a chunk near the end. Related: #1971.

AI assistance

OpenAI Codex (GPT-6.1 Sol): code review, regression-test preparation, test execution, and submission preparation. The description is copied from my original tracker notes.

Validation for #1980: generated-file regression fails before the fix and passes after; Plexon and core tests give 652 passed, 13 skipped. Black checks pass, and Flake8 has no new findings.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions