MIT-LCP / wfdb-python

Native Python WFDB package
MIT License
748 stars 302 forks source link

sig_length is None #126

Closed Saqibm128 closed 6 years ago

Saqibm128 commented 6 years ago

I am currently attempting to use wfdb.rdrecord on a file from the MIMIC3 database

I downloaded wfdb version 2.1 into my site-packages. If I use wfdb.rdrecord on this specific file with the sampto parameter set, the following traceback will trigger

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/msaqib/miniconda3/envs/py36/lib/python3.6/site-packages/wfdb/io/record.py", line 1140, in rdrecord
    smooth_frames, return_res)
  File "/home/msaqib/miniconda3/envs/py36/lib/python3.6/site-packages/wfdb/io/record.py", line 209, in check_read_inputs
    if sampfrom > self.sig_len:
TypeError: '>' not supported between instances of 'int' and 'NoneType'

If I don't set the sampto parameter, a different error occurs:

  File "<stdin>", line 1, in <module>
  File "/home/msaqib/miniconda3/envs/py36/lib/python3.6/site-packages/wfdb/io/record.py", line 1140, in rdrecord
    smooth_frames, return_res)
  File "/home/msaqib/miniconda3/envs/py36/lib/python3.6/site-packages/wfdb/io/record.py", line 201, in check_read_inputs
    raise TypeError('sampto must be an integer')

I believe the issue is with the waveform file, but wfdb should be more graceful and attempt to read it in?

cx1111 commented 6 years ago

There was a recent issue with this. I think the latest version 2.1.1 fixes it? Let me know if it doesn't.

Saqibm128 commented 6 years ago

will go ahead and try it. thank you!