Skip to content
Permalink
Browse files

Periodic utility now stops when StopIteration is raised (pyviz#1792)

  • Loading branch information...
jlstevens authored and ea42gh committed Aug 8, 2017
1 parent dd575fb commit 39e27adfe6a0a614756538c138029620d2ebd5a0
Showing with 7 additions and 2 deletions.
  1. +4 −1 holoviews/core/util.py
  2. +3 −1 holoviews/plotting/util.py
@@ -164,7 +164,10 @@ def run(self):
else:
self._completed.wait(self.period)
self.counter += 1
self.callback(self.counter)
try:
self.callback(self.counter)
except Exception as e:
self.stop()

if self.timeout is not None:
dt = (time.time() - self._start_time)
@@ -179,7 +179,7 @@ def initialize_dynamic(obj):
def get_plot_frame(map_obj, key_map, cached=False):
"""
Returns an item in a HoloMap or DynamicMap given a mapping key
dimensons and their values.
dimensions and their values.
"""
if map_obj.kdims and len(map_obj.kdims) == 1 and map_obj.kdims[0] == 'Frame':
# Special handling for static plots
@@ -192,6 +192,8 @@ def get_plot_frame(map_obj, key_map, cached=False):
return map_obj[key]
except KeyError:
return None
except StopIteration as e:
raise e
except Exception:
print(traceback.format_exc())
return None

0 comments on commit 39e27ad

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