-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
274 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from streamz_ext import Stream | ||
from streamz_ext.graph import node_style, run_vis | ||
import matplotlib.pyplot as plt | ||
|
||
source = Stream() | ||
|
||
|
||
def sleep_inc(x): | ||
if x == 5: | ||
raise RuntimeError() | ||
return x + 1 | ||
|
||
|
||
def print_sleep(x): | ||
print(x) | ||
|
||
|
||
b = source.map(sleep_inc) | ||
b.sink(print_sleep) | ||
b.sink(print_sleep) | ||
gv = run_vis( | ||
source, | ||
source_node=True, | ||
edge_style={"color": "k"}, | ||
node_label_style={"font_size": 10}, | ||
edge_label_style=lambda x: {"label": x["label"], "font_size": 15}, | ||
node_style=node_style, | ||
force_draw=True, | ||
) | ||
plt.pause(.1) | ||
for i in range(10): | ||
try: | ||
source.emit(i) | ||
plt.pause(.1) | ||
except RuntimeError: | ||
pass | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
**Added:** | ||
|
||
* ``graph`` provides tooling for live pipeline visualization, detailing | ||
current node status | ||
* ``examples`` folder and ``live_plot.py`` for an example using the live plot | ||
|
||
**Changed:** None | ||
|
||
**Deprecated:** None | ||
|
||
**Removed:** None | ||
|
||
**Fixed:** None | ||
|
||
**Security:** None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
toolz | ||
tornado | ||
streamz | ||
distributed | ||
distributed | ||
grave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.