Skip to content

Conversation

@cboulay
Copy link
Member

@cboulay cboulay commented Feb 6, 2026

ezmsg-event/src/ezmsg/event/peak.py — Switched from [channel, time] to [time, channel] axis ordering:

  • moveaxis(..., ax_idx, -1) → moveaxis(..., ax_idx, 0)
  • All shape[-1]/shape[:-1] → shape[0]/shape[1:]
  • All cross_idx[-1]/cross_idx[:-1] → cross_idx[0]/cross_idx[1:]
  • Slicing data[..., slice] → data[slice] (axis 0)
  • Concatenation axis=-1 → axis=0
  • Tuple construction reordered to time-first: (time_idx,) + (feat_tuple)
  • Pad width reordered: ((0, n_pad),) + ((0, 0),) * ...
  • Added sorting step after np.where(b_cross_over): with time-first arrays, np.where returns events sorted by time rather than grouped by feature. A lexsort reorders
    events by feature-first to maintain correctness of the refractory period logic and elapsed tracking.

ezmsg-event/tests/test_peak.py — 3 changes:

  • sparse.concatenate(..., axis=1) → axis=0
  • feat_inds, samp_inds = nonzero() → samp_inds, feat_inds = nonzero()
  • Added lexsort to sort result indices by (feat, samp) for comparison with expected values (which are built channel-by-channel)

@cboulay cboulay merged commit 8870b88 into dev Feb 6, 2026
4 checks passed
@cboulay cboulay deleted the peak_swap_axes branch February 6, 2026 22:02
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.

1 participant