Skip to content

Conversation

bemoody
Copy link
Collaborator

@bemoody bemoody commented Sep 1, 2021

  • Hyphens should be permitted in segment names. Currently hyphens are permitted in record names and signal file names, but not in segment names.

  • When parsing a line in a header file, we must start at the beginning of the line. Currently we search for the expected pattern anywhere within the line, which means any "junk" at the start of the line is silently ignored.

This means that if a multi-segment record includes a segment with a hyphen in the name, everything up to and including the hyphen is silently ignored.

A related problem occurs if there are slashes in a segment or signal file name. Although subdirectories are permitted in WFDB format, wfdb-python currently doesn't support them, so these should raise an exception rather than being silently ignored.

Benjamin Moody added 5 commits August 31, 2021 15:01
When reading a header file, each line is parsed by matching it against
a regular expression.  Previously, this was done by searching for the
pattern *anywhere* in the input line (using findall()) rather than at
the start of the line (using match()).

In particular, if the first token on the line (e.g., a signal file
name or segment name) contains a disallowed character, this must be
treated as an error, rather than silently ignoring everything up to
and including the disallowed character.

Note, however, that horizontal whitespace is permitted at the start of
the line, so the expressions must begin with "[ \t]*".
@tompollard
Copy link
Member

thanks Benjamin

@tompollard tompollard merged commit 9bacc15 into master Sep 10, 2021
@tompollard tompollard deleted the header-syntax branch September 10, 2021 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants