Skip to content

Commit

Permalink
Dynamic operations support stream instances
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Oct 5, 2016
1 parent a142454 commit 5e79596
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions holoviews/util.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import inspect

import param

from .core import DynamicMap, ViewableElement
from .core.operation import ElementOperation
from .core.util import Aliases
from .core import util

from .streams import Stream

class Dynamic(param.ParameterizedFunction):
"""
Expand Down Expand Up @@ -36,8 +38,12 @@ def __call__(self, map_obj, **params):
dmap = self._make_dynamic(map_obj, callback)
if isinstance(self.p.operation, ElementOperation):
streams = []
for s in self.p.streams:
stream = s()
for stream in self.p.streams:
if inspect.isclass(stream) and issubclass(stream, Stream):
stream = stream()
elif not isinstance(stream, Stream):
raise ValueError('Stream must only contain Stream '
'classes or instances')
stream.update(**{k: self.p.operation.p.get(k) for k, v in
stream.contents.items()})
streams.append(stream)
Expand Down

0 comments on commit 5e79596

Please sign in to comment.