Comments (4)
Just as a heads up, I would not use next
as an arg name since it shadows a python builtin.
from streamz.
Maybe we have an accumulate which takes in two streams, the first has the data and the second exists just to send a reset message (or even a new start value?). This way we could reset based off of some property of the data, eg we reached some threshold (via cyclic graphing) or reset based on something completely different occurring somewhere else in the graph.
from streamz.
Perhaps you can put this logic into your accumulator function?
from streamz.
funny, i was working on this yesterday. What @mrocklin mentioned is what I'm doing. Basically, have an stop condition and initial condition in accumulator:
def acc(prevstate, nextstate):
# initial condition
if prevstate is None:
return nextstate
# stop condition (reset to initial condition)
if nextstate is None:
# if prevstate will get set to None
return None
# rest of acc logic
(assumes returns_state=False
here)
If you want to be cleaner, prev
could be a tuple of mydata, state
where state gives information on clearing or not. This ensures more homogeneity downstream.
It's messy, but I feel that enforcing a global clearing mechanism might be too restrictive, considering the stream can already do this. I'd def like to see a use case where it's necessary though. I haven't used this feature so much.
just thoughts, what do you think? I'm interested in exploring more concise methods.
About a stream that resets another, I would vote against that as we'd have to worry about synchronizing yet another stream, when we may not always have to.
EDIT : Changed next
to nextstate
just to avoid any confusion. thanks @CJ-Wright
from streamz.
Related Issues (20)
- How to load initial state or backfill the stream dataframe HOT 2
- missing positional argument: 'topic' in to_mqtt HOT 5
- How to parametrize stream/pipeline creation? HOT 2
- Passing Username and Password to from_mqtt() HOT 4
- Dynamically add upstreams to zip HOT 2
- Dropping `pkg_resources`
- AttributeError: 'Output' object has no attribute '_ipython_display_' HOT 3
- flatten doesn't work with iterables without defined length HOT 2
- visualizing streams and changing variables during runtime HOT 5
- Is it possible to use event time/syntethic time rather than system time? HOT 2
- Time based lookback window? HOT 1
- Streamz not working in Jupyterlite
- Collect does not allow awaitable sinks
- Quickstart lacks conda/environments/streamz_dev.yml HOT 6
- Hello from LorryStream and Kotori / Streamz is cool HOT 1
- Add pytest fixture to clean up the IO loop HOT 4
- Streamz hvplot resets zoom and pan on each update HOT 3
- streamz's typing system can't work properly in vscode HOT 1
- Streamz with websocket not steaming any data HOT 5
- Parallel streams with buffers HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamz.