Skip to content

Commit

Permalink
pick unique id for cell outputs
Browse files Browse the repository at this point in the history
fixes #16
  • Loading branch information
leifwalsh committed Apr 8, 2018
1 parent d884790 commit f8dc387
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions perfume/perfume.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import collections
import time
import uuid

from bokeh import io as bi
from bokeh import models as bm
Expand Down Expand Up @@ -75,6 +76,7 @@ def __init__(self, names, initial_size, width=900, height=480):
self._plot = None
self._elapsed_rendering_seconds = 0.0
self._describe_widget = ipdisplay.HTML("")
self._display_id = str(uuid.uuid1())

def elapsed_rendering_ratio(self):
elapsed = time.perf_counter() - self._start
Expand Down Expand Up @@ -234,12 +236,14 @@ def update(self, samples):
if self._plot is None:
self._plot = self.initialize_plot(title)
bi.show(self._plot, notebook_handle=True)
ipdisplay.display(self._describe_widget, display_id="describe")
ipdisplay.display(
self._describe_widget, display_id=self._display_id
)
else:
self._plot.title.text = title
bi.push_notebook()
ipdisplay.update_display(
self._describe_widget, display_id="describe"
self._describe_widget, display_id=self._display_id
)
self._elapsed_rendering_seconds += timer.elapsed_seconds()

Expand Down

0 comments on commit f8dc387

Please sign in to comment.