-
Notifications
You must be signed in to change notification settings - Fork 5
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
Separate proper signals from annotations signals #48
Comments
I like this. Branching on type seems distinctly unjulian and we're still preserving the logical structure and data equivalence of the file, even if a round-tripped file won't be bit-for-bit identical. But I would do this after the BDF support is added. Then anybody who doesn't like this design decision and wants to stick with the older version still has good EDF/BDF support. |
cc also @jrevels, who introduced the current structure |
My bias for decisions like these is to preserve the underlying structure implied by the format specification and provide convenience functions on top as necessary, rather than to adopt a different underlying structure for the sake of perceived convenience. That actually was the motivation behind #29. Why not just provide a convenience function (or two) that returns the iterators you'd like? It'd be a less disruptive change, seems to solve the problems you mentioned, and avoids the downsides you mention in the OP. |
Yeah, that works for me. |
Currently
EDF.File
storesEDF.Signal
s andEDF.AnnotationsSignal
s together in a single vector, closely mimicking how the file itself stores signals, and allowing us to store the signals in the order in which they appear in the file. This structure was introduced in #29. However, this leads to some common and annoying patterns like branching on the type during iteration. One immediate example isEDF.jl/src/read.jl
Lines 195 to 201 in 87e6823
I find myself working around this structure often in similar ways.
I would propose things be restructured somewhere between the current state and the structure prior to #29:
Storing the annotations as a vector permits one of the cases fixed in #29: multiple "EDF Annotations" signals in a single file.
The primary downsides to this proposition:
I personally think this mismatch between the on-disk and Julia representations (one of only two mismatches I can think of offhand) is worth it for the ergonomics but I'd be interest to hear what others think.
The text was updated successfully, but these errors were encountered: