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.

Code inspection and synthetic arithmetic only: no real .plx recording has been tested. A recording with unequal analog block sizes is needed before proposing a reader fix. 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.

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