Skip to content

process peri-event: trials path is read as CSV without validation #150

Description

@celefthe

process peri-event reads TRIALS_PATH with pd.read_csv unconditionally (process/__init__.py:483). Passing a binary file, e.g. the recording HDF5 when the positional arguments are swapped, fails with a pandas decode error rather than a usable message:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

Suggested fix

Validate trials_path before reading: require a .csv suffix, and raise a click.ClickException naming the file if the read fails or the required event column is missing.

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

    bugSomething isn't workingprocessingWhat we do with the delta Fs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions