Skip to content

Commit

Permalink
Merge pull request dask#592 from jcrist/profile_notebook
Browse files Browse the repository at this point in the history
Changes to profiler plotting
  • Loading branch information
jcrist committed Aug 15, 2015
2 parents f7183ca + 1753b74 commit 8c7104a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dask/diagnostics/profile_visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from toolz import unique, groupby
import bokeh.plotting as bp
from bokeh.io import _state
from bokeh.palettes import brewer
from bokeh.models import HoverTool

Expand Down Expand Up @@ -78,7 +79,7 @@ def get_colors(palette, funcs):
return [color_lookup[n] for n in funcs]


def visualize(results, dsk, palette='GnBu', file_path="profile.html",
def visualize(results, dsk, palette='GnBu', file_path=None,
show=True, **kwargs):
"""Visualize the results of profiling in a bokeh plot.
Expand All @@ -103,7 +104,9 @@ def visualize(results, dsk, palette='GnBu', file_path="profile.html",
The completed bokeh plot object.
"""

bp.output_file(file_path)
if not _state._notebook:
file_path = file_path or "profile.html"
bp.output_file(file_path)
keys, tasks, starts, ends, ids = zip(*results)

id_group = groupby(itemgetter(4), results)
Expand Down

0 comments on commit 8c7104a

Please sign in to comment.