-
Notifications
You must be signed in to change notification settings - Fork 312
Closed
Description
OS: Windows 7x64,
Python: version 3.6.3 from Anaconda 5.01 (64-bit)
WFDB: version 1.3.9.
I tried out the demo.ipynb but the following demos failed. Does anyone know what is going on?
Previously I had 1.3.5 installed with conda. But then I uninstalled it and reinstall the latest version (1.3.9) with pip install. No luck, both version gave me the same error.
Thanks
Demo 13
# Demo 13 - Read a WFDB annotation file and create a copy via the wrann() instance method
# of the Annotation object
# Read an annotation from Physiobank
annotation = wfdb.rdann('sampledata/100', 'atr')
annotation.annotator = 'cpy'
# Call the instance method of the object
annotation.wrann()
# The new file can be read
ann100copy = wfdb.rdann('100', 'cpy')
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-20-50e8f790cdb9> in <module>()
10
11 # The new file can be read
---> 12 ann100copy = wfdb.rdann('100', 'cpy')
~\Desktop\AM2_local\C_Dataset_Cleanup\libs\wfdb_python\wfdb\readwrite\annotations.py in rdann(recordname, extension, sampfrom, sampto, shiftsamps, pbdir, return_label_elements, summarize_labels)
1139
1140 # Read the file in byte pairs
-> 1141 filebytes = load_byte_pairs(recordname, extension, pbdir)
1142
1143 # Get wfdb annotation fields from the file bytes
~\Desktop\AM2_local\C_Dataset_Cleanup\libs\wfdb_python\wfdb\readwrite\annotations.py in load_byte_pairs(recordname, extension, pbdir)
1204 # local file
1205 if pbdir is None:
-> 1206 with open(recordname + '.' + extension, 'rb') as f:
1207 filebytes = np.fromfile(f, '<u1').reshape([-1, 2])
1208 # physiobank file
FileNotFoundError: [Errno 2] No such file or directory: '100.cpy'
Demo 14
# Demo 14 - Write a WFDB annotation file without using an Annotator object via the gateway wrann function.
# Read an annotation as an Annotation object
annotation = wfdb.rdann('b001', 'atr', pbdir='cebsdb')
# Call the gateway wrann function, manually inserting fields as function input parameters
wfdb.wrann('b001', 'cpy', annotation.sample, annotation.anntype)
# The new file can be read
annbcopy = wfdb.rdann('b001', 'cpy')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-21-03b9a9b72f9b> in <module>()
5
6 # Call the gateway wrann function, manually inserting fields as function input parameters
----> 7 wfdb.wrann('b001', 'cpy', annotation.sample, annotation.anntype)
8
9 # The new file can be read
AttributeError: 'Annotation' object has no attribute 'anntype'
Demo 15
# Demo 15 - View what the 'anntype' symbols mean in the standard WFDB library
wfdb.showanncodes()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-22-819a63ac8751> in <module>()
1 # Demo 15 - View what the 'anntype' symbols mean in the standard WFDB library
----> 2 wfdb.showanncodes()
AttributeError: module 'wfdb' has no attribute 'showanncodes'
wfel
Metadata
Metadata
Assignees
Labels
No labels