v0.0.9 - ADC resolution pipeline
Breaking changes
sample_raterenamed tosampling_rateinLeadandSignalCharacteristicsLead.unitssemantics changed — now empty ("") whenis_raw=True(raw ADC counts); set to the physical unit (voltages) only afterto_physical()or when data is already in physical unitsLead.is_rawis now auto-detected — parsers no longer hardcodeis_raw=True; insteadis_raw = not (resolution == 1.0 and offset == 0.0)
New features
- Automatic ADC-to-physical scaling —
FileParser.parse(auto_scale=True)(default) converts raw ADC samples to mV viato_physical()+convert_units("mV"). Disable withauto_scale=False Lead.to_physical()— converts raw ADC samples usingphysical = samples × resolution + offsetLead.convert_units(target)— converts between voltage units (uV, mV, V)ECGRecord.to_physical()/ECGRecord.convert_units(target)— batch conversion for all leads and median beatsFileParser.supported_formats()— returns format metadata for all 12 parsersECGRecord.__repr__()andECGRecord.plot()— YAML-style console display and quick plotting- Multi-lead numpy array support —
plot_leads,plot_12lead,iplot_leads,iplot_12leadaccept raw numpy arrays withfs=parameter LeadsLiketype alias — for multi-lead inputs (list of Lead, ECGRecord, 2D array, list of arrays)
New Lead fields
resolution_unit— unit of the resolution scale factor (e.g."uV","mV"); what samples will be in afterto_physical()adc_resolution— original ADC resolution as stored in the source file (e.g.153.0for 153 nV/count in ISHNE)adc_resolution_unit— unit ofadc_resolutionas defined by the format (e.g."nV"for ISHNE and SCP-ECG)
Improvements
-
Simplified multi-lead plots: full signal by default with configurable
rows/colsgrid layout -
plot_12leadandiplot_12leadassign standard 12-lead names to unnamed inputs -
Static plots no longer force matplotlib Agg backend
Full Changelog: https://github.com/UMMISCO/ECGDataKit/commits/v0.0.9