Skip to content

Commit

Permalink
Merge pull request #927 from ioam/dynamic_item_fix
Browse files Browse the repository at this point in the history
Ensure get_dynamic_item does not modify object
  • Loading branch information
jlstevens committed Oct 12, 2016
2 parents b0aa8e4 + a24783d commit b9aa0f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions holoviews/core/util.py
Expand Up @@ -957,8 +957,8 @@ def get_dynamic_item(map_obj, dimensions, key):
dmaps = map_obj.traverse(lambda x: x, ['DynamicMap'])
dmap = dmaps[0] if dmaps else map_obj
if key == () and (not dimensions or not dmap.kdims):
return key, map_obj.map(lambda x: x[()], ['DynamicMap', 'HoloMap'],
clone=False)
map_obj.traverse(lambda x: x[()], ['DynamicMap'])
return key, map_obj.map(lambda x: x.last, ['DynamicMap'])
elif isinstance(key, tuple):
dims = {d.name: k for d, k in zip(dimensions, key)
if d in map_obj.kdims}
Expand All @@ -968,8 +968,8 @@ def get_dynamic_item(map_obj, dimensions, key):
key_offset = max([key-map_obj.cache_size, 0])
key = map_obj.keys()[min([key-key_offset,
len(map_obj)-1])]
el = map_obj.map(lambda x: x[key], ['DynamicMap'],
clone=False)
map_obj.traverse(lambda x: x[key], ['DynamicMap'])
el = map_obj.map(lambda x: x[key], ['DynamicMap'])
elif key >= map_obj.counter:
el = next(map_obj)
key = list(map_obj.keys())[-1]
Expand Down

0 comments on commit b9aa0f4

Please sign in to comment.