Skip to content

Commit

Permalink
Fixed no memoization bug if stream provides no kwargs (#3070)
Browse files Browse the repository at this point in the history
# Conflicts:
#	holoviews/tests/teststreams.py
  • Loading branch information
philippjfr committed Oct 25, 2018
1 parent 8ad686f commit c9dc8ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions holoviews/core/spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,9 @@ def clone(self, callable=None, **overrides):

def __call__(self, *args, **kwargs):
# Nothing to do for callbacks that accept no arguments
kwarg_hash = kwargs.pop('memoization_hash', ())
kwarg_hash = kwargs.pop('_memoization_hash_', ())
(self.args, self.kwargs) = (args, kwargs)
if not args and not kwargs: return self.callable()
if not args and not kwargs and not any(kwarg_hash): return self.callable()
inputs = [i for i in self.inputs if isinstance(i, DynamicMap)]
streams = []
for stream in [s for i in inputs for s in get_nested_streams(i)]:
Expand Down Expand Up @@ -905,7 +905,7 @@ def _execute_callback(self, *args):
else:
kwargs = dict(flattened)
if not isinstance(self.callback, Generator):
kwargs['memoization_hash'] = hash_items
kwargs['_memoization_hash_'] = hash_items

with dynamicmap_memoization(self.callback, self.streams):
retval = self.callback(*args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions holoviews/tests/teststreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def test_class_value_update(self):




class TestSubscribers(ComparisonTestCase):

def test_exception_subscriber(self):
Expand Down

0 comments on commit c9dc8ce

Please sign in to comment.