Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions demo.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tests/test_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class TestRecord(unittest.TestCase):
"""
Test read and write of single segment WFDB records, including
Physionet streaming.
PhysioNet streaming.
Target files created using the original WFDB Software Package
version 10.5.24
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_2a(self):
# Compare data streaming from Physionet
sig_pn, fields_pn = wfdb.rdsamp('100', pn_dir = 'mitdb')
# This comment line was manually added and is not present in the
# original Physionet record
# original PhysioNet record
del(fields['comments'][0])

assert np.array_equal(sig_round, sig_target)
Expand All @@ -183,7 +183,7 @@ def test_2b(self):
record_pn = wfdb.rdrecord('100', sampfrom=1, sampto=10800,
channels=[1], physical=False, pn_dir='mitdb')
# This comment line was manually added and is not present in the
# original Physionet record
# original PhysioNet record
del(record.comments[0])

# Option of selecting channels by name
Expand Down Expand Up @@ -530,7 +530,7 @@ def tearDownClass(cls):
class TestMultiRecord(unittest.TestCase):
"""
Test read and write of multi segment WFDB records, including
Physionet streaming.
PhysioNet streaming.
Target files created using the original WFDB Software Package
version 10.5.24
Expand Down
8 changes: 4 additions & 4 deletions wfdb/io/_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ def _rd_segment(file_name, dir_name, pn_dir, fmt, n_sig, sig_len, byte_offset,
The full directory where the dat file(s) are located, if the dat
file(s) are local.
pn_dir : str
The Physionet directory where the dat file(s) are located, if
The PhysioNet directory where the dat file(s) are located, if
the dat file(s) are remote.
fmt : list
The formats of the dat files.
Expand Down Expand Up @@ -1042,7 +1042,7 @@ def _rd_dat_signals(file_name, dir_name, pn_dir, fmt, n_sig, sig_len,
The full directory where the dat file(s) are located, if the dat
file(s) are local.
pn_dir : str
The Physionet directory where the dat file(s) are located, if
The PhysioNet directory where the dat file(s) are located, if
the dat file(s) are remote.
fmt : list
The formats of the dat files.
Expand Down Expand Up @@ -1359,7 +1359,7 @@ def _rd_dat_file(file_name, dir_name, pn_dir, fmt, start_byte, n_samp):
The full directory where the dat file(s) are located, if the dat
file(s) are local.
pn_dir : str
The Physionet directory where the dat file(s) are located, if
The PhysioNet directory where the dat file(s) are located, if
the dat file(s) are remote.
fmt : list
The formats of the dat files.
Expand Down Expand Up @@ -2069,7 +2069,7 @@ def _infer_sig_len(file_name, fmt, n_sig, dir_name, pn_dir=None):
The full directory where the dat file(s) are located, if the dat
file(s) are local.
pn_dir : str, optional
The Physionet directory where the dat file(s) are located, if
The PhysioNet directory where the dat file(s) are located, if
the dat file(s) are remote.

Returns
Expand Down
8 changes: 4 additions & 4 deletions wfdb/io/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ def rdann(record_name, extension, sampfrom=0, sampto=None, shift_samps=False,
Specifies whether to return the sample indices relative to `sampfrom`
(True), or sample 0 (False).
pn_dir : str, optional
Option used to stream data from Physionet. The Physionet database
Option used to stream data from Physionet. The PhysioNet database
directory from which to find the required annotation file. eg. For
record '100' in 'http://physionet.org/content/mitdb': pn_dir='mitdb'.
return_label_elements : list, optional
Expand Down Expand Up @@ -1732,7 +1732,7 @@ def load_byte_pairs(record_name, extension, pn_dir):
The annotatator extension of the annotation file. ie. for file
'100.atr', extension='atr'.
pn_dir : str
Option used to stream data from Physionet. The Physionet database
Option used to stream data from Physionet. The PhysioNet database
directory from which to find the required annotation file. eg. For
record '100' in 'http://physionet.org/content/mitdb': pn_dir='mitdb'.

Expand All @@ -1746,7 +1746,7 @@ def load_byte_pairs(record_name, extension, pn_dir):
if pn_dir is None:
with open(record_name + '.' + extension, 'rb') as f:
filebytes = np.fromfile(f, '<u1').reshape([-1, 2])
# Physionet file
# PhysioNet file
else:
filebytes = download._stream_annotation(record_name+'.'+extension, pn_dir).reshape([-1, 2])

Expand Down Expand Up @@ -2218,7 +2218,7 @@ def ann2rr(record_name, extension, pn_dir=None, start_time=None,
The annotatator extension of the annotation file. ie. for file
'100.atr', extension='atr'.
pn_dir : str
Option used to stream data from Physionet. The Physionet database
Option used to stream data from Physionet. The PhysioNet database
directory from which to find the required annotation file. eg. For
record '100' in 'http://physionet.org/content/mitdb': pn_dir='mitdb'.
start_time : float
Expand Down
32 changes: 16 additions & 16 deletions wfdb/io/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
from wfdb.io import record


# The Physionet index url
# The PhysioNet index url
PN_INDEX_URL = 'https://physionet.org/files/'
PN_CONTENT_URL = 'https://physionet.org/content/'

class Config(object):
"""
General class structure for the Physionet database.
General class structure for the PhysioNet database.

Attributes
----------
Expand All @@ -25,7 +25,7 @@ class Config(object):
"""
pass

# The configuration database index url. Uses Physionet index by default.
# The configuration database index url. Uses PhysioNet index by default.
config = Config()
config.db_index_url = PN_INDEX_URL

Expand All @@ -39,7 +39,7 @@ def set_db_index_url(db_index_url=PN_INDEX_URL):
----------
db_index_url : str, optional
The desired new database index url. Leave as default to reset
to the Physionet index url.
to the PhysioNet index url.

Returns
-------
Expand Down Expand Up @@ -94,7 +94,7 @@ def _stream_header(file_name, pn_dir):
file_name : str
The name of the headerr file to be read.
pn_dir : str
The Physionet database directory from which to find the
The PhysioNet database directory from which to find the
required header file. eg. For file '100.hea' in
'http://physionet.org/content/mitdb', pn_dir='mitdb'.

Expand Down Expand Up @@ -148,7 +148,7 @@ def _stream_dat(file_name, pn_dir, byte_count, start_byte, dtype):
file_name : str
The name of the dat file to be read.
pn_dir : str
The Physionet directory where the dat file is located.
The PhysioNet directory where the dat file is located.
byte_count : int
The number of bytes to be read.
start_byte : int
Expand Down Expand Up @@ -196,7 +196,7 @@ def _stream_annotation(file_name, pn_dir):
file_name : str
The name of the annotation file to be read.
pn_dir : str
The Physionet directory where the annotation file is located.
The PhysioNet directory where the annotation file is located.

Returns
-------
Expand All @@ -220,7 +220,7 @@ def _stream_annotation(file_name, pn_dir):

def get_dbs():
"""
Get a list of all the Physionet databases available.
Get a list of all the PhysioNet databases available.

Parameters
----------
Expand Down Expand Up @@ -251,7 +251,7 @@ def get_dbs():
return dbs


# ---- Helper functions for downloading Physionet files ------- #
# ---- Helper functions for downloading PhysioNet files ------- #


def get_record_list(db_dir, records='all'):
Expand All @@ -277,7 +277,7 @@ def get_record_list(db_dir, records='all'):
>>> wfdb.get_record_list('mitdb')

"""
# Full url Physionet database
# Full url PhysioNet database
if os.sep not in db_dir:
db_url = posixpath.join(config.db_index_url, db_dir, record.get_version(db_dir))
else:
Expand Down Expand Up @@ -321,7 +321,7 @@ def get_annotators(db_dir, annotators):
>>> wfdb.get_annotators('mitdb')

"""
# Full url Physionet database
# Full url PhysioNet database
db_url = posixpath.join(config.db_index_url, db_dir)

if annotators is not None:
Expand Down Expand Up @@ -364,7 +364,7 @@ def make_local_dirs(dl_dir, dl_inputs, keep_subdirs):
The desired input names for creating the directories.
keep_subdirs : bool
Whether to keep the relative subdirectories of downloaded files as they
are organized in Physionet (True), or to download all files into the
are organized in PhysioNet (True), or to download all files into the
same base directory (False).

Returns
Expand Down Expand Up @@ -475,12 +475,12 @@ def dl_full_file(url, save_file_name):

def dl_files(db, dl_dir, files, keep_subdirs=True, overwrite=False):
"""
Download specified files from a Physionet database.
Download specified files from a PhysioNet database.

Parameters
----------
db : str
The Physionet database directory to download. eg. For database:
The PhysioNet database directory to download. eg. For database:
'http://physionet.org/content/mitdb', db='mitdb'.
dl_dir : str
The full local directory path in which to download the files.
Expand All @@ -489,7 +489,7 @@ def dl_files(db, dl_dir, files, keep_subdirs=True, overwrite=False):
database base directory.
keep_subdirs : bool, optional
Whether to keep the relative subdirectories of downloaded files as they
are organized in Physionet (True), or to download all files into the
are organized in PhysioNet (True), or to download all files into the
same base directory (False).
overwrite : bool, optional
If True, all files will be redownloaded regardless. If False, existing
Expand All @@ -511,7 +511,7 @@ def dl_files(db, dl_dir, files, keep_subdirs=True, overwrite=False):
'data/001a.dat'])

"""
# Full url Physionet database
# Full url PhysioNet database
db_dir = posixpath.join(db, record.get_version(db))
db_url = posixpath.join(PN_CONTENT_URL, db_dir) + os.sep

Expand Down
10 changes: 5 additions & 5 deletions wfdb/io/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ def get_version(pn_dir):
Parameters
----------
pn_dir : str
The Physionet database directory from which to find the
The PhysioNet database directory from which to find the
required version number. eg. For the project 'mitdb' in
'http://physionet.org/content/mitdb', pn_dir='mitdb'.

Expand Down Expand Up @@ -2509,13 +2509,13 @@ 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
Physionet database. The database must contain a 'RECORDS' file in
PhysioNet database. The database must contain a 'RECORDS' file in
its base directory which lists its WFDB records.

Parameters
----------
db_dir : str
The Physionet database directory to download. eg. For database:
The PhysioNet database directory to download. eg. For database:
'http://physionet.org/content/mitdb/', db_dir='mitdb'.
dl_dir : str
The full local directory path in which to download the files.
Expand All @@ -2535,7 +2535,7 @@ def dl_database(db_dir, dl_dir, records='all', annotators='all',
https://physionet.org/content/prcp/
keep_subdirs : bool, optional
Whether to keep the relative subdirectories of downloaded files
as they are organized in Physionet (True), or to download all
as they are organized in PhysioNet (True), or to download all
files into the same base directory (False).
overwrite : bool, optional
If True, all files will be redownloaded regardless. If False,
Expand All @@ -2556,7 +2556,7 @@ def dl_database(db_dir, dl_dir, records='all', annotators='all',
>>> wfdb.dl_database('ahadb', os.getcwd())

"""
# Full url Physionet database
# Full url PhysioNet database
if os.sep in db_dir:
dir_list = db_dir.split(os.sep)
db_dir = posixpath.join(dir_list[0], get_version(dir_list[0]), *dir_list[1:])
Expand Down