MideTechnology / idelib

Python API for accessing .IDE data recordings made by enDAQ devices.
MIT License
5 stars 0 forks source link

Handle channels with no data better #19

Open CrepeGoat opened 3 years ago

CrepeGoat commented 3 years ago

(original issue title: are zero-sample channels valid?)

The cloud code ran into errors when using idelib to parse an IDE recording, where one of the recording's channels had zero samples (GitHub issue here). While this is a bug somewhere, I don't know what part of the code should be responsible for ensuring that this doesn't happen (i.e., is this the device's fault, or idelib's fault?)

If the above-linked situation is a valid, expected use-case for IDE recordings, then this issue here should be reopened as an idelib bug.

StokesMIDE commented 3 years ago

They shouldn't exist, but they can. The Lab ignores channels with no data, but I think that might be part of the Lab itself.

That said it could/should be handled better. I think accessing a channel with zero samples raises an IndexError in most cases; to be more Pythonic, it should probably return an empty EventArray. Making this an 'enhancement' issue and editing the title.