From fbc510d5b6942a02c508333461fbc04ef10080de Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Mon, 27 Sep 2021 12:12:14 +0200 Subject: [PATCH] Clean up ipystartup (#201) * Clean up ipystartup * Fix flake --- nbsite/cmd.py | 2 +- nbsite/ipystartup.py | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/nbsite/cmd.py b/nbsite/cmd.py index fa7fb6ef..34b74ca9 100644 --- a/nbsite/cmd.py +++ b/nbsite/cmd.py @@ -207,7 +207,7 @@ def generate_rst( paths=_prepare_paths(project_root,examples=examples,doc=doc) print("Project='%s': Converting notebooks at '%s' to rst at '%s'..."%(project_name,paths['examples'],paths['doc'])) - for filename in glob.iglob(os.path.join(paths['examples'],"**","*.ipynb"), recursive=True): + for filename in glob.iglob(os.path.abspath(os.path.join(paths['examples'],"**","*.ipynb")), recursive=True): relpath = os.path.relpath(filename, paths['examples']) # TODO: decide what to do about gallery later if relpath.startswith('gallery'): diff --git a/nbsite/ipystartup.py b/nbsite/ipystartup.py index abc29796..f6704462 100644 --- a/nbsite/ipystartup.py +++ b/nbsite/ipystartup.py @@ -5,15 +5,12 @@ mpl.use('agg') try: - import holoviews.plotting.widgets as hw - hw.NdWidget.export_json=True - hw.NdWidget.json_load_path = './' - hw.NdWidget.json_save_path = './' - del hw + import holoviews.plotting.bokeh # noqa except: pass -import holoviews.plotting.mpl as hmpl -hmpl.MPLPlot.fig_alpha = 0 -del hmpl - +try: + import holoviews.plotting.mpl as hmpl + hmpl.MPLPlot.fig_alpha = 0 +except: + pass