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 committed Oct 4, 2019
1 parent 0f1560d commit b0bf2a8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions holoviews/core/accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,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 @@ -92,11 +94,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 b0bf2a8

Please sign in to comment.