-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add circular/ring buffer and data wrapper, that can be used to facilitate a streaming viewer #186
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #186 +/- ##
==========================================
+ Coverage 85.11% 85.39% +0.28%
==========================================
Files 45 46 +1
Lines 4783 4951 +168
==========================================
+ Hits 4071 4228 +157
- Misses 712 723 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@jacopoabramo ... let me know how you feel about this API |
Looks nice! One question I have: supposing that the data incoming from a stream is processed on-the-fly, and the new data type of the array is changed (i.e. from EDIT: a second question, now that I've been thinking about it. Is a |
then you should make a float32 ring buffer… not a uint16 one. Point is you need to create the buffer with whatever dtype you are going to append. You have control over that.
no, if one only ever wants to look at the last image ( and never see any previous images) then you don’t need this. You could use a ring buffer of max_capacity 1 for that too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the functionality! Just wondering how much API actually has to be exposed...
#134 (now closed) was trying to add a simplified way to stream data into the viewer (as if coming off the scope). The primary challenge is mostly just to store that data somewhere, so the user can simply call
append()
as new frames come in, and then tell the viewer to update. The key bit of tech then is just a nice storage API for a ring-buffer.This PR adds a ring buffer object (vendored and updated from https://github.com/eric-wieser/numpy_ringbuffer), and makes a DataWrapper for it so that you c