refactor: Remove try/except import for popup functionality #3351
Annotations
6 errors
Test Examples:
examples/user_guide/13-Custom_Interactivity.ipynb#L1
examples/user_guide/13-Custom_Interactivity.ipynb::Cell 17
Notebook cell execution failed
Cell 17: Cell execution caused an exception
Input:
points = hv.Points(np.random.randn(1000, 2))
hv.streams.BoundsXY(source=points, popup="Used Box Select")
hv.streams.Lasso(source=points, popup="Used Lasso Select")
hv.streams.Tap(source=points, popup="Used Tap")
points.opts(
tools=["box_select", "lasso_select", "tap"],
active_tools=["lasso_select"],
size=6,
color="black",
fill_color=None,
width=500,
height=500
)
Traceback:
---------------------------------------------------------------------------
VersionError Traceback (most recent call last)
File ~/work/holoviews/holoviews/.pixi/envs/test-312/lib/python3.12/site-packages/IPython/core/formatters.py:977, in MimeBundleFormatter.__call__(self, obj, include, exclude)
974 method = get_real_method(obj, self.print_method)
976 if method is not None:
--> 977 return method(include=include, exclude=exclude)
978 return None
979 else:
File ~/work/holoviews/holoviews/holoviews/core/dimension.py:1275, in Dimensioned._repr_mimebundle_(self, include, exclude)
1268 def _repr_mimebundle_(self, include=None, exclude=None):
1269 """
1270 Resolves the class hierarchy for the class rendering the
1271 object using any display hooks registered on Store.display
1272 hooks. The output of all registered display_hooks is then
1273 combined and returned.
1274 """
-> 1275 return Store.render(self)
File ~/work/holoviews/holoviews/holoviews/core/options.py:1423, in Store.render(cls, obj)
1421 data, metadata = {}, {}
1422 for hook in hooks:
-> 1423 ret = hook(obj)
1424 if ret is None:
1425 continue
File ~/work/holoviews/holoviews/holoviews/ipython/display_hooks.py:287, in pprint_display(obj)
285 if not ip.display_formatter.formatters['text/plain'].pprint:
286 return None
--> 287 return display(obj, raw_output=True)
File ~/work/holoviews/holoviews/holoviews/ipython/display_hooks.py:255, in display(obj, raw_output, **kwargs)
253 elif isinstance(obj, (CompositeOverlay, ViewableElement)):
254 with option_state(obj):
--> 255 output = element_display(�
|
Test Examples:
examples/user_guide/13-Custom_Interactivity.ipynb#L1
examples/user_guide/13-Custom_Interactivity.ipynb::Cell 18
Notebook cell execution failed
Cell 18: Cell execution caused an exception
Input:
def popup_stats(index):
if not index:
return
return points.iloc[index].dframe().describe()
points = hv.Points(np.random.randn(1000, 2))
hv.streams.Selection1D(
source=points,
popup=popup_stats
)
points.opts(
tools=["box_select", "lasso_select", "tap"],
active_tools=["lasso_select"],
size=6,
color="black",
fill_color=None,
width=500,
height=500
)
Traceback:
---------------------------------------------------------------------------
VersionError Traceback (most recent call last)
File ~/work/holoviews/holoviews/.pixi/envs/test-312/lib/python3.12/site-packages/IPython/core/formatters.py:977, in MimeBundleFormatter.__call__(self, obj, include, exclude)
974 method = get_real_method(obj, self.print_method)
976 if method is not None:
--> 977 return method(include=include, exclude=exclude)
978 return None
979 else:
File ~/work/holoviews/holoviews/holoviews/core/dimension.py:1275, in Dimensioned._repr_mimebundle_(self, include, exclude)
1268 def _repr_mimebundle_(self, include=None, exclude=None):
1269 """
1270 Resolves the class hierarchy for the class rendering the
1271 object using any display hooks registered on Store.display
1272 hooks. The output of all registered display_hooks is then
1273 combined and returned.
1274 """
-> 1275 return Store.render(self)
File ~/work/holoviews/holoviews/holoviews/core/options.py:1423, in Store.render(cls, obj)
1421 data, metadata = {}, {}
1422 for hook in hooks:
-> 1423 ret = hook(obj)
1424 if ret is None:
1425 continue
File ~/work/holoviews/holoviews/holoviews/ipython/display_hooks.py:287, in pprint_display(obj)
285 if not ip.display_formatter.formatters['text/plain'].pprint:
286 return None
--> 287 return display(obj, raw_output=True)
File ~/work/holoviews/holoviews/holoviews/ipython/display_hooks.py:255, in display(obj, raw_output, **kwargs)
253 elif isinstance(obj, (CompositeOverlay, ViewableElement)):
254 with option_state(obj):
--> 255 output = element_display�[
|
Test Examples:
examples/user_guide/13-Custom_Interactivity.ipynb#L1
examples/user_guide/13-Custom_Interactivity.ipynb::Cell 19
Notebook cell execution failed
Cell 19: Cell execution caused an exception
Input:
hv.streams.Selection1D(
source=points,
popup=popup_stats,
popup_position="left",
popup_anchor="right"
)
points.opts(
tools=["box_select", "lasso_select", "tap"],
active_tools=["lasso_select"],
size=6,
color="black",
fill_color=None,
width=500,
height=500
)
Traceback:
---------------------------------------------------------------------------
VersionError Traceback (most recent call last)
File ~/work/holoviews/holoviews/.pixi/envs/test-312/lib/python3.12/site-packages/IPython/core/formatters.py:977, in MimeBundleFormatter.__call__(self, obj, include, exclude)
974 method = get_real_method(obj, self.print_method)
976 if method is not None:
--> 977 return method(include=include, exclude=exclude)
978 return None
979 else:
File ~/work/holoviews/holoviews/holoviews/core/dimension.py:1275, in Dimensioned._repr_mimebundle_(self, include, exclude)
1268 def _repr_mimebundle_(self, include=None, exclude=None):
1269 """
1270 Resolves the class hierarchy for the class rendering the
1271 object using any display hooks registered on Store.display
1272 hooks. The output of all registered display_hooks is then
1273 combined and returned.
1274 """
-> 1275 return Store.render(self)
File ~/work/holoviews/holoviews/holoviews/core/options.py:1423, in Store.render(cls, obj)
1421 data, metadata = {}, {}
1422 for hook in hooks:
-> 1423 ret = hook(obj)
1424 if ret is None:
1425 continue
File ~/work/holoviews/holoviews/holoviews/ipython/display_hooks.py:287, in pprint_display(obj)
285 if not ip.display_formatter.formatters['text/plain'].pprint:
286 return None
--> 287 return display(obj, raw_output=True)
File ~/work/holoviews/holoviews/holoviews/ipython/display_hooks.py:255, in display(obj, raw_output, **kwargs)
253 elif isinstance(obj, (CompositeOverlay, ViewableElement)):
254 with option_state(obj):
--> 255 output = element_display(obj)
256 elif isinstanc
|
Test Examples:
examples/user_guide/13-Custom_Interactivity.ipynb#L1
examples/user_guide/13-Custom_Interactivity.ipynb::Cell 20
Notebook cell execution failed
Cell 20: Cell execution caused an exception
Input:
def popup_distribution(index):
x, y = points.iloc[index].data.T
return hv.Distribution((x, y)).opts(
width=100,
height=100,
toolbar=None,
yaxis="bare",
xlabel="",
xticks=[-1, 0, 1],
xlim=(-2, 2),
)
points = hv.Points(np.random.randn(1000, 2))
hv.streams.Selection1D(
source=points,
popup=popup_distribution,
)
points.opts(
tools=["box_select", "lasso_select", "tap"],
active_tools=["lasso_select"],
size=6,
color="black",
fill_color=None,
width=500,
height=500
)
Traceback:
---------------------------------------------------------------------------
VersionError Traceback (most recent call last)
File ~/work/holoviews/holoviews/.pixi/envs/test-312/lib/python3.12/site-packages/IPython/core/formatters.py:977, in MimeBundleFormatter.__call__(self, obj, include, exclude)
974 method = get_real_method(obj, self.print_method)
976 if method is not None:
--> 977 return method(include=include, exclude=exclude)
978 return None
979 else:
File ~/work/holoviews/holoviews/holoviews/core/dimension.py:1275, in Dimensioned._repr_mimebundle_(self, include, exclude)
1268 def _repr_mimebundle_(self, include=None, exclude=None):
1269 """
1270 Resolves the class hierarchy for the class rendering the
1271 object using any display hooks registered on Store.display
1272 hooks. The output of all registered display_hooks is then
1273 combined and returned.
1274 """
-> 1275 return Store.render(self)
File ~/work/holoviews/holoviews/holoviews/core/options.py:1423, in Store.render(cls, obj)
1421 data, metadata = {}, {}
1422 for hook in hooks:
-> 1423 ret = hook(obj)
1424 if ret is None:
1425 continue
File ~/work/holoviews/holoviews/holoviews/ipython/display_hooks.py:287, in pprint_display(obj)
285 if not ip.display_formatter.formatters['text/plain'].pprint:
286 return None
--> 287 return display(obj, raw_output=True)
File ~/work/holoviews/holoviews/holoviews/ipython/display_hooks.py:255, in display(obj, raw_output, **kwargs)
253 elif isinstance(obj, (CompositeOver
|
Test Examples:
examples/user_guide/13-Custom_Interactivity.ipynb#L1
examples/user_guide/13-Custom_Interactivity.ipynb::Cell 21
Notebook cell execution failed
Cell 21: Cell execution caused an exception
Input:
import panel as pn
pn.extension()
def popup_form(index):
def hide_popup(_):
layout.visible = False
if not index:
return
df = points.iloc[index].dframe().describe()
button = pn.widgets.Button(name="Close", sizing_mode="stretch_width")
layout = pn.Column(button, df)
button.on_click(hide_popup)
return layout
points = hv.Points(np.random.randn(1000, 2))
hv.streams.Selection1D(source=points, popup=popup_form)
points.opts(
tools=["box_select", "lasso_select", "tap"],
active_tools=["lasso_select"],
size=6,
color="black",
fill_color=None,
width=500,
height=500
)
Traceback:
---------------------------------------------------------------------------
VersionError Traceback (most recent call last)
File ~/work/holoviews/holoviews/.pixi/envs/test-312/lib/python3.12/site-packages/IPython/core/formatters.py:977, in MimeBundleFormatter.__call__(self, obj, include, exclude)
974 method = get_real_method(obj, self.print_method)
976 if method is not None:
--> 977 return method(include=include, exclude=exclude)
978 return None
979 else:
File ~/work/holoviews/holoviews/holoviews/core/dimension.py:1275, in Dimensioned._repr_mimebundle_(self, include, exclude)
1268 def _repr_mimebundle_(self, include=None, exclude=None):
1269 """
1270 Resolves the class hierarchy for the class rendering the
1271 object using any display hooks registered on Store.display
1272 hooks. The output of all registered display_hooks is then
1273 combined and returned.
1274 """
-> 1275 return Store.render(self)
File ~/work/holoviews/holoviews/holoviews/core/options.py:1423, in Store.render(cls, obj)
1421 data, metadata = {}, {}
1422 for hook in hooks:
-> 1423 ret = hook(obj)
1424 if ret is None:
1425 continue
File ~/work/holoviews/holoviews/holoviews/ipython/display_hooks.py:287, in pprint_display(obj)
285 if not ip.display_formatter.formatters['text/plain'].pprint:
286 return None
--> 287 return display(obj, raw_output=True)
File ~/work/holoviews/holoviews/holoviews/ipython/display_hooks.py:255, in display(obj, raw_output, **kwargs)
253 �[38
|
Test Examples
Process completed with exit code 1.
|
Loading