MIT-LCP / wfdb-python

Native Python WFDB package
MIT License
738 stars 300 forks source link

Add sig and hea stream parameters to rdrecord, rdheader and rdann #491

Open Ivorforce opened 3 months ago

Ivorforce commented 3 months ago

… in case the file is not read from disk.

This is needed if, for example, files are streamed using a file upload dialog versus read from the file system. Personally, I ran into this limitation using Dash's Upload widget.

There are some basic ToDos:

However, with this PR the code is starting to get a bit messy. I propose the following changes to make it cleaner again (happy to oblige within the PR if accepted):

Let me know what you think.

Ivorforce commented 3 months ago

Update: I have added the same cabability to rdann.

rdann seems to have an additional problem right now of simply not working. A simple .astype(np.int32) seems to fix the issue, but may not be what's actually needed. Edit: The astype issue is discussed in #493. I have removed the temporary fix from this PR.)

Ivorforce commented 3 months ago

Update 2: I have opened #498. That PR is a more comprehensive and streamlined rewrite, and thus supersedes it, in my opinion.