Skip to content

Check spike waveforms read with t_start and t_stop in the rawio compliance tests #1960

Open

Description

@h-mayorquin

Right now the compliance tests check a time-limited read for spike timestamps. read_spike_times reads one spike with a forced t_start and t_stop and checks it against the full read:

if spike_times.size > 3:
# load only one spike by forcing limits
t_start = spike_times[1] - 0.001
t_stop = spike_times[1] + 0.001
spike_timestamp2 = reader.get_spike_timestamps(
block_index=block_index,
seg_index=seg_index,
spike_channel_index=spike_channel_index,
t_start=t_start,
t_stop=t_stop,
)
assert spike_timestamp2.shape[0] == 1
spike_times2 = reader.rescale_spike_timestamp(spike_timestamp2, "float64")
assert spike_times2[0] == spike_times[1]

However, read_spike_waveforms only reads with t_start=None and t_stop=None:

raw_waveforms = reader.get_spike_raw_waveforms(
block_index=block_index,
seg_index=seg_index,
spike_channel_index=spike_channel_index,
t_start=None,
t_stop=None,
)

No reader-specific test reads waveforms with a time range either, so this path is not tested for any reader.

This came up in #1955. There the Blackrock reader now picks the spikes in the time range first and then reads only their waveforms from the file. @cboulay suggested a test that compares a time-limited read with the matching slice of the full read:
#1955 (review)

I think this belongs in the compliance tests instead of the Blackrock tests as it applies to every reader that returns waveforms. So I would do in read_spike_waveforms what read_spike_times already does for timestamps: read the waveforms of one spike with forced limits and check that they equal the matching row of the full read.

Would that make sense?

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