Skip to content

pool_blocks crashes on single-trial blocks #243

@lschwetlick

Description

@lschwetlick

Minimal repro:

bla2 = np.array([
    [100, 50, 50],
    [101, 51, 51],
    [200, 60, 60],
    [201, 61, 61],
    [300, 70, 70],
    [301, 71, 71],
    [400, 80, 80]
])

# Crashes with:
# TypeError: cannot unpack non-iterable numpy.float64 object
pooled = ps.pool_blocks(bla2, max_tol=50, max_gap=50, max_length=10)

Two things:

  • max_length refers to cumulative trial count (not number of rows), which isn’t super clear in the doc.
  • If pooling results in just one trial (because one line already exceeds the max_length), the code crashes — probably needs to reshape the block before summing.

we should either error gracefully or reshape before.

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