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

Added stream activate and deactivate methods #933

Merged
merged 2 commits into from
Oct 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install:
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION scipy numpy freetype nose bokeh pandas jupyter ipython=4.2.0 param matplotlib=1.5.1 xarray datashader
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION scipy numpy freetype nose bokeh pandas jupyter ipython=4.2.0 param pyqt=4 matplotlib=1.5.1 xarray datashader
- source activate test-environment
- conda install -c conda-forge -c scitools iris sip=4.18 plotly
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then
Expand Down
12 changes: 12 additions & 0 deletions holoviews/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def trigger(cls, streams):
for subscriber in subscribers:
subscriber(**dict(union))

for stream in streams:
stream.deactivate()


def __init__(self, preprocessors=[], source=None, subscribers=[], **params):
"""
Expand All @@ -125,6 +128,15 @@ def __init__(self, preprocessors=[], source=None, subscribers=[], **params):
if source:
self.registry[id(source)].append(self)


def deactivate(self):
"""
Allows defining an action after the stream has been triggered,
e.g. resetting parameters on streams with transient events.
"""
pass


@property
def source(self):
return self._source
Expand Down