Skip to content
Permalink
Browse files

Using DynamicMap._deep_indexable=False when restoring option state

  • Loading branch information...
jlstevens committed Sep 4, 2016
1 parent ce1ed4c commit 4f89b18a994e8be4636140c04e9efc95b1e97221
Showing with 13 additions and 4 deletions.
  1. +1 −1 holoviews/core/dimension.py
  2. +12 −3 holoviews/ipython/display_hooks.py
@@ -601,7 +601,7 @@ def __init__(self, data, **params):

def _valid_dimensions(self, dimensions):
"""Validates key dimension input
Returns kdims if no dimensions are specified"""
if dimensions is None:
dimensions = self.kdims
@@ -89,14 +89,21 @@ def last_frame(obj):
# Display hooks #
#===============#

def option_state(element, state=None):
# Temporary fix to avoid issues with DynamicMap traversal
DynamicMap._deep_indexable = False
optstate = StoreOptions.state(element)
DynamicMap._deep_indexable = True
return optstate


def display_hook(fn):
@wraps(fn)
def wrapped(element):
global FULL_TRACEBACK
if Store.current_backend is None:
return
optstate = StoreOptions.state(element)
optstate = option_state(element)
try:
html = fn(element,
max_frames=OutputMagic.options['max_frames'],
@@ -115,7 +122,8 @@ def wrapped(element):
sys.stderr.write("Rendering process skipped: %s" % str(e))
return None
except AbbreviatedException as e:
try: StoreOptions.state(element, state=optstate)
try:
option_state(element, state=optstate)
except: pass
FULL_TRACEBACK = '\n'.join(traceback.format_exception(e.etype,
e.value,
@@ -126,7 +134,8 @@ def wrapped(element):
return "<b>{name}</b>{msg}<br>{message}".format(msg=msg, **info)

except Exception as e:
try: StoreOptions.state(element, state=optstate)
try:
option_state(element, state=optstate)
except: pass
raise
return wrapped

0 comments on commit 4f89b18

Please sign in to comment.
You can’t perform that action at this time.