From b1ec43030b19f3244af07e127c48976b88ec851b Mon Sep 17 00:00:00 2001 From: Chris P Date: Fri, 23 Jan 2015 22:53:15 -0500 Subject: [PATCH 1/3] iplot performance improvement by 4x. Yikes. Every _repr_* method that exists is called on instantiation of a IPython.core.display.HTML subclass. For Plotly, _repr_png, _repr_svg, _repr_jpeg require a call to the image server to generate the image. Combined, the 4 requests can make iplot commands take 4 times as long as usual. We mistakenly thought that the _repr_ commands were only called on demand, e.g. on a call to `nbconvert`. Unfortunately, this removes our support for `nbconvert`. An upcoming PR with cached images should bring this support back. --- plotly/tools.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/plotly/tools.py b/plotly/tools.py index 59b9f5fd03c..85ea9644cec 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1230,34 +1230,3 @@ def __init__(self, url, width, height): def _repr_html_(self): return self.embed_code - - def _repr_svg_(self): - url = self.resource + ".svg" - res = requests.get(url) - if six.PY3: - cont = res.content.decode('utf-8', 'replace') - else: - cont = res.content - return cont - - def _repr_png_(self): - url = self.resource + ".png" - res = requests.get(url) - cont = res.content - return cont - - def _repr_pdf_(self): - url = self.resource + ".pdf" - res = requests.get(url) - cont = res.content - if six.PY3: - cont = res.content.decode('utf-8', 'replace') - else: - cont = res.content - return cont - - def _repr_jpeg_(self): - url = self.resource + ".jpeg" - res = requests.get(url) - cont = res.content - return cont From cce83c6e8db4784ba092c79ae1df492bb77e5ba9 Mon Sep 17 00:00:00 2001 From: Chris P Date: Fri, 23 Jan 2015 22:58:03 -0500 Subject: [PATCH 2/3] bump version 1.6.5 (iplot performance) --- plotly/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/version.py b/plotly/version.py index f3df7f04b75..008e8016fb1 100644 --- a/plotly/version.py +++ b/plotly/version.py @@ -1 +1 @@ -__version__ = '1.6.5' +__version__ = '1.6.6' From 46a03f29b469982e25045b8443e988ce25a73b0d Mon Sep 17 00:00:00 2001 From: Andrew Seier Date: Mon, 26 Jan 2015 11:53:41 -0500 Subject: [PATCH 3/3] =?UTF-8?q?skip=20image=20tests=20(we=E2=80=99re=20rem?= =?UTF-8?q?oving=20these=20methods=20for=20now)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plotly/tests/test_optional/test_ipython/test_embed.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plotly/tests/test_optional/test_ipython/test_embed.py b/plotly/tests/test_optional/test_ipython/test_embed.py index 417f0c9babc..587b3f20a8e 100644 --- a/plotly/tests/test_optional/test_ipython/test_embed.py +++ b/plotly/tests/test_optional/test_ipython/test_embed.py @@ -5,13 +5,14 @@ import threading import six import unittest +from unittest import skip version = six.sys.version_info[:2] # need this for conditional testing # unittest `skipIf` not supported in 2.6 and IPython not supported in 2.6/3.2 if version < (2, 7) or (2, 7) < version < (3, 3): pass else: - + @skip class TestPlotlyDisplay(unittest.TestCase): def setUp(self):