Skip to content

Commit 69f06d2

Browse files
committed
add package version info. Add hyphens to signal name regex
1 parent d6dee49 commit 69f06d2

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@
1414
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
1515
long_description = f.read()
1616

17+
# Get the version number from the version.py file
18+
from wfdb.version import __version__
19+
1720
setup(
1821
name='wfdb',
1922

2023
# Versions should comply with PEP440. For a discussion on single-sourcing
2124
# the version across setup.py and the project code, see
2225
# https://packaging.python.org/en/latest/single_source_version.html
23-
version='1.3.6',
26+
version=__version__,
2427

2528
description='The WFDB Python Toolbox',
2629
long_description=long_description,

wfdb/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
from .readwrite.downloads import getdblist
66
from .plot.plots import plotrec, plotann
77
from . import processing
8+
from .version import __version__

wfdb/readwrite/_headers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def getsignames(self):
418418
rxSIGNAL = re.compile(
419419
''.join(
420420
[
421-
"(?P<filename>[\w]*\.?[\w]*~?)[ \t]+(?P<fmt>\d+)x?"
421+
"(?P<filename>[-\w]+\.?[\w]*~?)[ \t]+(?P<fmt>\d+)x?"
422422
"(?P<sampsperframe>\d*):?(?P<skew>\d*)\+?(?P<byteoffset>\d*)[ \t]*",
423423
"(?P<adcgain>-?\d*\.?\d*e?[\+-]?\d*)\(?(?P<baseline>-?\d*)\)?/?(?P<units>[\w\^\-\?%]*)[ \t]*",
424424
"(?P<adcres>\d*)[ \t]*(?P<adczero>-?\d*)[ \t]*(?P<initvalue>-?\d*)[ \t]*",

wfdb/readwrite/records.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ def checkfield(self, field, channels=None):
122122

123123
if field == 'filename':
124124
# Check for filename characters
125-
acceptedstring = re.match('[\w]+\.?[\w]+',f)
125+
acceptedstring = re.match('[-\w]+\.?[\w]+',f)
126126
if not acceptedstring or acceptedstring.string != f:
127-
raise ValueError('File names should only contain alphanumerics and an extension. eg. record_100.dat')
127+
raise ValueError('File names should only contain alphanumerics, hyphens, and an extension. eg. record_100.dat')
128128
# Check that dat files are grouped together
129129
if orderedsetlist(self.filename)[0] != orderednoconseclist(self.filename):
130130
raise ValueError('filename error: all entries for signals that share a given file must be consecutive')

wfdb/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '1.3.7'

0 commit comments

Comments
 (0)