Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Ivorforce
Copy link
Contributor

@Ivorforce Ivorforce commented Jun 27, 2024

… 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:

  • Documentation
  • Unit Tests (?)

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):

  • Deprecate no_file field, instead use a None test against sig_data
  • Since all paths end up with a byte stream anyway, separate concerns between file parsing and stream generation. Parsers get streams from loaders, becoming agnostic to file systems and downloads. (Edit: Addressed in Streamline file reading to use io streams #498)

Let me know what you think.

@Ivorforce Ivorforce changed the title Add the ability to pass sig and hea streams to rdrecord and rdheader Add sig and hea stream parameters to rdrecord and rdheader Jun 28, 2024
… rdann, in case the file is not read from disk.
@Ivorforce Ivorforce changed the title Add sig and hea stream parameters to rdrecord and rdheader Add sig and hea stream parameters to rdrecord, rdheader and rdann Jul 1, 2024
@Ivorforce
Copy link
Contributor Author

Ivorforce commented Jul 1, 2024

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant