AllenInstitute / ecephys_etl_pipelines

Pipelines and modules for processing extracellular electrophysiology data
Other
1 stars 2 forks source link

off by one error in stimulus file #37

Closed danielsf closed 2 years ago

danielsf commented 2 years ago

A large number of the ecephys sessions for the VBN release provoke an error when current_frame exceeds the length of draw_log in this block of code

https://github.com/AllenInstitute/AllenSDK/blob/master/allensdk/brain_observatory/behavior/stimulus_processing.py#L388-L400

    while current_frame <= stop_frame:
        epoch_length = 0
        while current_frame < stop_frame and draw_log[current_frame] == 1:
            epoch_length += 1
            current_frame += 1
        else:
            current_frame += 1

        if epoch_length:
            draw_epochs.append(
                (current_frame - epoch_length - 1, current_frame - 1,)
            )

Probably we need to do something more clever to set the value of stop_frame.

Tasks

Validation

danielsf commented 2 years ago

This will likely be addressed as part of

https://app.zenhub.com/workspaces/allensdk-10-5c17f74db59cfb36f158db8c/issues/alleninstitute/allensdk/2346

aamster commented 2 years ago

It is not correct to load the stimulus presentations table via the behavior stimulus pkl file as was done in VBO. The stimulus presentations table for VBN is read directly from a precomputed csv. This code block is only executed when we try to load the stimulus presentations table from the behavior pkl file. Therefore this is a nonissue.