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

Allow disabling stream memoization #1256

Merged
merged 4 commits into from
Apr 9, 2017
Merged

Allow disabling stream memoization #1256

merged 4 commits into from
Apr 9, 2017

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Apr 9, 2017

Addresses #1215, allowing disabling memoization when a specific stream is active, which forces a callback to be triggered when a new event comes in.

@philippjfr philippjfr added tag: API type: feature A major new feature labels Apr 9, 2017
@jlstevens
Copy link
Contributor

Having already given you all my feedback in person, I am happy to merge as soon as there are unit tests checking the memoization is working as we expect.

@jlstevens
Copy link
Contributor

jlstevens commented Apr 9, 2017

That said, there is a sorting issue on Python 3:

Traceback (most recent call last):
  File "/home/travis/build/ioam/holoviews/tests/testdynamic.py", line 176, in test_dynamic_overlay_memoization
    overlay = overlaid[()]
  File "/home/travis/build/ioam/holoviews/holoviews/core/spaces.py", line 758, in __getitem__
    val = self._execute_callback(*tuple_key)
  File "/home/travis/build/ioam/holoviews/holoviews/core/spaces.py", line 617, in _execute_callback
    retval = self.callback(*args, **dict(flattened))
  File "/home/travis/build/ioam/holoviews/holoviews/core/spaces.py", line 443, in __call__
    streams = sorted({s for i in inputs for s in get_nested_streams(i)})
TypeError: unorderable types: PositionXY() < PositionXY()

You could either go back to the old version or just use the original ordering while removing duplicates:

streams = []
for stream in [s for i in inputs for s in get_nested_streams(i)]:
   if stream not in streams: streams.append(stream)

We might have a list deduplication utility already and it might be a good idea if we don't.

@jlstevens
Copy link
Contributor

Looks good. I'll wait for the tests to pass, have one last look and probably merge.

@jlstevens
Copy link
Contributor

Tests are passing and the new stuff looks fine. Merging.

@jlstevens jlstevens merged commit 8396441 into master Apr 9, 2017
@philippjfr philippjfr deleted the stream_memoize branch April 11, 2017 12:19
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tag: API type: feature A major new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants