wfdb-python icon indicating copy to clipboard operation
wfdb-python copied to clipboard

Write multi-character annotation mnemnonics

Open bemoody opened this issue 3 years ago • 0 comments

WFDB annotation mnemonics ("symbols", in wfdb-python parlance) are not limited to a single character. (All of the standard mnemonics are a single character, but a custom mnemonic defined using setannstr can be multiple characters; the only limitation is that it can't contain spaces or control characters.)

Thanks to pull request #404 it is now possible to define custom annotation mnemonics when calling wfdb.wrann. However, custom_triplet_bytes will choke if any of them are not a single character (something that can be passed to ord).

(interpret_defintion_annotations will read multi-character mnemonics correctly, though note that it has the same problem as rdheader used to have: it uses findall when it should be using match or fullmatch.)

bemoody avatar Jul 25 '22 20:07 bemoody