The intention behind the current implementation of header fields in the Edf and EdfSignal classes, based on RawHeaderFields, was to avoid bugs caused by having to repeat the field length everywhere a header field is set. However, it comes with a few issues:
there are several places where #type: ignore comments are needed to make mypy happy, because some non-public attributes are created via setattr
it is difficult to create subclasses with differing behavior, which is required for implementing #34 and for supporting BDF
the idea to keep the raw header fields as bytes in non-public variables of the same name can't be followed consistently, if custom getters and setters are needed (e.g. for EdfSignal.label, Edf.startdate, Edf.starttime)
it could be difficult for new contributors to grasp the nested logic and "magic"
I think these issues outweigh the initially desired benefit and would therefore like to replace the custom descriptors with ordinary properties.
The intention behind the current implementation of header fields in the
Edf
andEdfSignal
classes, based onRawHeaderField
s, was to avoid bugs caused by having to repeat the field length everywhere a header field is set. However, it comes with a few issues:#type: ignore
comments are needed to make mypy happy, because some non-public attributes are created viasetattr
EdfSignal.label
,Edf.startdate
,Edf.starttime
)I think these issues outweigh the initially desired benefit and would therefore like to replace the custom descriptors with ordinary properties.