MIT-LCP / wfdb-python

Native Python WFDB package
MIT License
730 stars 298 forks source link

Unable to write WFDB with subtyp = -1 #469

Closed vinay-hebb closed 7 months ago

vinay-hebb commented 7 months ago

I am reading a mitdb 101 record and writing back with a different name without making changes to annotation, this code is throwing error. I am not able to understand why check on subtype is present while writing WFDB if subtyp == -1 is possible. Please let me know how to avoid this error.

Reproducible example below

import wfdb ann = wfdb.rdann('101', extension='atr') wfdb.wrann('101_temp','atr',ann.sample,ann.symbol,aux_note=ann.aux_note,write_dir='.',subtype=ann.subtype)

ValueError: The 'subtype' field must only contain non-negative integers up to 127'

(WFDB Version: 3.3.0, Python 3.8.8)

bemoody commented 7 months ago

This was fixed in version 3.4.0. Please reopen if the issue still occurs with version 4.x.