Skip to content

Commit

Permalink
Merge branch 'master' of github.com:MIT-LCP/wfdb-python
Browse files Browse the repository at this point in the history
  • Loading branch information
cx1111 committed Mar 8, 2018
2 parents 64f122e + 45d5a7d commit 6506889
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
8 changes: 5 additions & 3 deletions wfdb/io/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,8 +1314,8 @@ def orderednoconseclist(fulllist):
return noconseclist


def dl_database(db_dir, dl_dir, records='all', annotators='all', keep_subdirs=True,
overwrite = False):
def dl_database(db_dir, dl_dir, records='all', annotators='all',
keep_subdirs=True, overwrite = False):
"""
Download WFDB record (and optionally annotation) files from a
Physiobank database. The database must contain a 'RECORDS' file in
Expand Down Expand Up @@ -1361,8 +1361,10 @@ def dl_database(db_dir, dl_dir, records='all', annotators='all', keep_subdirs=Tr
>>> wfdb.dl_database('ahadb', os.getcwd())
"""
# Full url physiobank database
db_url = posixpath.join(download.db_index_url, db_dir)
# Check if the database is valid
r = requests.get(dburl)
r = requests.get(db_url)
r.raise_for_status()

# Get the list of records
Expand Down
22 changes: 18 additions & 4 deletions wfdb/processing/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,15 @@ def resample_singlechan(x, ann, fs, fs_target):
new_sample = resample_ann(resampled_t, ann.sample)
assert ann.sample.shape == new_sample.shape

resampled_ann = Annotation(ann.record_name, ann.extension, new_sample,
ann.symbol, ann.num, ann.subtype, ann.chan, ann.aux_note, fs_target)
resampled_ann = Annotation(record_name=ann.record_name,
extension=ann.extension,
sample=new_sample,
symbol=ann.symbol,
subtype=ann.subtype,
chan=ann.chan,
num=ann.num,
aux_note=ann.aux_note,
fs=fs_target)

return resampled_x, resampled_ann

Expand Down Expand Up @@ -165,8 +172,15 @@ def resample_multichan(xs, ann, fs, fs_target, resamp_ann_chan=0):
new_sample = resample_ann(lt, ann.sample)
assert ann.sample.shape == new_sample.shape

resampled_ann = Annotation(ann.record_name, ann.extension, new_sample, ann.symbol,
ann.num, ann.subtype, ann.chan, ann.aux_note, fs_target)
resampled_ann = Annotation(record_name=ann.record_name,
extension=ann.extension,
sample=new_sample,
symbol=ann.symbol,
subtype=ann.subtype,
chan=ann.chan,
num=ann.num,
aux_note=ann.aux_note,
fs=fs_target)

return np.column_stack(lx), resampled_ann

Expand Down
2 changes: 1 addition & 1 deletion wfdb/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.1'
__version__ = '2.0.2'

0 comments on commit 6506889

Please sign in to comment.