Skip to content

Commit

Permalink
Fix issues in .apply (#4025)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Oct 4, 2019
1 parent d441a43 commit 9afc5b4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions holoviews/core/accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def pipelined_call(*args, **kwargs):
from ..operation.element import method as method_op, factory
from .data import Dataset, MultiDimensionalMapping
inst = args[0]

if not hasattr(inst._obj, '_pipeline'):
# Wrapped object doesn't support the pipeline property
return __call__(*args, **kwargs)
Expand Down Expand Up @@ -137,6 +138,8 @@ def __call__(self, function, streams=[], link_inputs=True, dynamic=None, **kwarg
'and setting dynamic=False is only '
'possible if key dimensions define '
'a discrete parameter space.')
if not len(samples):
return self._obj[samples]
return HoloMap(self._obj[samples]).apply(
function, streams, link_inputs, dynamic, **kwargs)

Expand Down Expand Up @@ -164,11 +167,13 @@ def function(object, **kwargs):
)

if dynamic is None:
dynamic = (bool(streams) or isinstance(self._obj, DynamicMap) or
util.is_param_method(function, has_deps=True) or
params or dependent_kws)
is_dynamic = (bool(streams) or isinstance(self._obj, DynamicMap) or
util.is_param_method(function, has_deps=True) or
params or dependent_kws)
else:
is_dynamic = dynamic

if (applies or isinstance(self._obj, HoloMap)) and dynamic:
if (applies or isinstance(self._obj, HoloMap)) and is_dynamic:
return Dynamic(self._obj, operation=function, streams=streams,
kwargs=kwargs, link_inputs=link_inputs)
elif applies:
Expand Down

0 comments on commit 9afc5b4

Please sign in to comment.