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

Conversation

Projects
None yet
2 participants
@philippjfr
Member

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.

@jlstevens

This comment has been minimized.

Member

jlstevens commented Apr 9, 2017

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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

jlstevens commented Apr 9, 2017

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

@jlstevens

This comment has been minimized.

Member

jlstevens commented Apr 9, 2017

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

@jlstevens jlstevens merged commit 8396441 into master Apr 9, 2017

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 78.764%
Details
s3-reference-data-cache Test data is cached.
Details

@philippjfr philippjfr deleted the stream_memoize branch Apr 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment