Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deal with malformed TAL #47

Open
kolia opened this issue Jul 1, 2021 · 0 comments
Open

deal with malformed TAL #47

kolia opened this issue Jul 1, 2021 · 0 comments

Comments

@kolia
Copy link
Contributor

kolia commented Jul 1, 2021

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

EDF.jl/src/read.jl

Lines 156 to 157 in f370e83

onset_in_seconds = flipsign(parse(Float64, timestamp[1]), sign)
duration_in_seconds = length(timestamp) == 2 ? parse(Float64, timestamp[2]) : nothing

and here
error("starting byte of a TAL must be '+' or '-'; found $sign")

(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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant