Raising warning about unbounded dynamic map in display_hooks.map_display
@@ -179,8 +179,14 @@ def element_display(element, max_frames):
@display_hook
def map_display(vmap, max_frames):
if not isinstance(vmap, (HoloMap, DynamicMap)): return None
- if len(vmap) == 0 and (not isinstance(vmap, DynamicMap) or vmap.unbounded):
+ if len(vmap) == 0 and isinstance(vmap, DynamicMap) and vmap.unbounded:
+ dims = ', '.join('%r' % dim for dim in vmap.unbounded)
+ msg = ('DynamicMap cannot be displayed as {dims} dimension(s) are unbounded. '
+ '\nSet dimensions bounds with the DynamicMap redim.range '
+ 'or redim.values methods.')
+ sys.stderr.write(msg.format(dims=dims))
return None
+
elif len(vmap) > max_frames:
max_frame_warning(max_frames)
return None
