Skip to content

Commit

Permalink
Load bokeh js from local copies, suppress bokeh specific warnings if …
Browse files Browse the repository at this point in the history
…desired.
  • Loading branch information
grahamrow committed Jun 30, 2017
1 parent d1eeb2d commit f7270b0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions QGL/Plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@
import os.path, uuid, tempfile
import bokeh.plotting as bk
from bokeh.layouts import column
from bokeh.util.warnings import BokehUserWarning
from bokeh.resources import INLINE
import numpy as np

import warnings
from . import config


def output_notebook():
bk.output_notebook()

def output_notebook(local=True, suppress_warnings=True):
if suppress_warnings:
warnings.simplefilter("ignore", BokehUserWarning)
if local:
bk.output_notebook(resources=INLINE)
else:
bk.output_notebook()

def output_file():
bk.output_file(os.path.join(tempfile.gettempdir(), str(uuid.uuid4()) +
Expand Down

0 comments on commit f7270b0

Please sign in to comment.