beacon-biosignals / EDF.jl

Read and write EDF files in Julia
MIT License
18 stars 5 forks source link

deal with malformed TAL #47

Open kolia opened 3 years ago

kolia commented 3 years ago

Time-stamped Annotations Lists

If you need to deal with malformed TAL onsets, durations or annotations somehow, the irrecoverable errors that get thrown are not very helpful.

Two errors seen in the wild are Float64 parse errors here https://github.com/beacon-biosignals/EDF.jl/blob/f370e83fcb5437e0691e92c4d7ade836bd43e477/src/read.jl#L156-L157 and here https://github.com/beacon-biosignals/EDF.jl/blob/f370e83fcb5437e0691e92c4d7ade836bd43e477/src/read.jl#L167 (and there are probably be other ways that TAL parsing can go wrong).

Maybe a good way would be to add an option to not throw on TAL parse errors, and instead return a list of structured errors that tell you the offending byte range, alongside the requested EDF, to make it easier to fix the offending EDF bytes.