[Python-modules-commits] [python-mplexporter] 61/135: only import plotly if needed

Wolfgang Borgert debacle at moszumanska.debian.org
Tue Sep 23 21:19:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to branch master
in repository python-mplexporter.

commit 828139008fa155991200b1267f57325dcca52ca0
Author: Jake Vanderplas <vanderplas at astro.washington.edu>
Date:   Thu Feb 27 15:27:03 2014 -0800

    only import plotly if needed
---
 mplexporter/renderers/plotly/plotly_renderer.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mplexporter/renderers/plotly/plotly_renderer.py b/mplexporter/renderers/plotly/plotly_renderer.py
index 1f76248..20a8e2a 100644
--- a/mplexporter/renderers/plotly/plotly_renderer.py
+++ b/mplexporter/renderers/plotly/plotly_renderer.py
@@ -3,8 +3,6 @@ Plotly Renderer
 ================
 This is a renderer class to be used with an exporter for rendering plots in Plotly!
 """
-import plotly
-
 from . import plotly_utils
 from .. base import Renderer
 from ... exporter import Exporter
@@ -130,6 +128,7 @@ def fig_to_plotly(fig, username=None, api_key=None, notebook=False):
     """Convert a matplotlib figure to plotly dictionary
 
     """
+    import plotly
     renderer = PlotlyRenderer(username=username, api_key=api_key)
     Exporter(renderer).run(fig)
     py = plotly.plotly(renderer.username, renderer.api_key)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-mplexporter.git



More information about the Python-modules-commits mailing list