Done
Description
Right now we have the Record class with a huge number of attributes in the top level object. These attributes are varied, fall into many categories, and become very hard to keep track of.
I also find it rather awkward that there is no separate 'header' or 'metadata' type of object. ie. rdheader and rdrecord both return the same type of object.
Initial idea:
RecordInfoclass for storing all the header data. Includes record and signal specification fields, and comments.rdheaderwill create this type.- Same
Recordclass for WFDB records. Theinfoattribute will be aRecordInfoobject.
Having the top level p_signal, d_signal attributes is not my favorite, but I feel like it's rather pointless to have another object to capture these fields.
Open to suggestions.
Metadata
Metadata
Assignees
Labels
No labels
Activity
tompollard commentedon Jun 1, 2022
I agree that some restructuring of the Record class would be helpful:
wfdb-python/wfdb/io/record.py
Line 575 in 3c88d19
It would be good to chat about this. I'm getting myself slightly confused about how these classes (e.g.
RecordInfofor header information andRecordfor data) would relate to the files themselves (e.g.x.heafor headers andx.datfor data).Side note, but it would be nice if these variables had friendlier names.
p_signal,d_signal,e_p_signal, ande_d_signalare pretty opaque.cx1111 commentedon Jun 10, 2022
Related discussion in #376 about signals. Agree with providing friendlier signal attributes (or none at all, see the other issue).
The workflow would be demonstrated in the draft PR #388, which I've just left a comment on.
Add logical Record metadata snapshot (#767)
tompollard commentedon Dec 1, 2026
The original concern has moved forward:
read_header()now returns a separate immutable header description, andRecord.metadatagives a snapshot of the current logical record view. We did not adopt the proposedRecord.infoobject or move all mutable fields offRecord; that larger design work is tracked more precisely in #744 (grouping per-channel metadata) and #749 (decoupling the I/O internals from dynamic fields). #746 covers the multi-segment part. I am closing this older umbrella issue so those open issues remain the place for the unresolved design decisions.