From 76c7c61bc4c25c2c940ce80da6c827b2370bf34b Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 5 Sep 2019 14:54:45 -0400 Subject: [PATCH 01/12] added minimal test for px --- .../plotly/tests/test_core/test_px/test_px.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/python/plotly/plotly/tests/test_core/test_px/test_px.py diff --git a/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py b/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py new file mode 100644 index 00000000000..2d5ddf5e6f6 --- /dev/null +++ b/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py @@ -0,0 +1,13 @@ +import plotly.express as px +import numpy as np + +def test_scatter(): + iris = px.data.iris() + fig = px.scatter(iris, x="sepal_width", y="sepal_length") + assert fig.data[0].type == 'scatter' + assert np.all(fig.data[0].x == iris.sepal_width) + assert np.all(fig.data[0].y == iris.sepal_length) + # test defaults + assert fig.data[0].mode == 'markers' + + From 6c54ee9f33c724b7aadd4870d3bd6f65ada4019a Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 5 Sep 2019 15:07:41 -0400 Subject: [PATCH 02/12] moved pandas to be a required dependency in tox.ini --- packages/python/plotly/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/plotly/tox.ini b/packages/python/plotly/tox.ini index 4a0a056591b..909b3ee5599 100644 --- a/packages/python/plotly/tox.ini +++ b/packages/python/plotly/tox.ini @@ -59,6 +59,7 @@ deps= pytz==2016.10 retrying==1.3.3 pytest==3.5.1 + pandas==0.19.2 backports.tempfile==1.0 optional: --editable=file:///{toxinidir}/../plotly-geo optional: numpy==1.11.3 @@ -66,7 +67,6 @@ deps= optional: ipywidgets==7.2.0 optional: ipykernel==4.8.2 optional: jupyter==1.0.0 - optional: pandas==0.19.2 optional: scipy==0.18.1 optional: shapely==1.6.4 optional: geopandas==0.3.0 From eaccfbf029795a580176a72081fb269118dd618b Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 5 Sep 2019 15:12:17 -0400 Subject: [PATCH 03/12] make black happy --- .../plotly/plotly/tests/test_core/test_px/test_px.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py b/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py index 2d5ddf5e6f6..001bdb6997a 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py +++ b/packages/python/plotly/plotly/tests/test_core/test_px/test_px.py @@ -1,13 +1,12 @@ import plotly.express as px import numpy as np + def test_scatter(): iris = px.data.iris() fig = px.scatter(iris, x="sepal_width", y="sepal_length") - assert fig.data[0].type == 'scatter' + assert fig.data[0].type == "scatter" assert np.all(fig.data[0].x == iris.sepal_width) assert np.all(fig.data[0].y == iris.sepal_length) # test defaults - assert fig.data[0].mode == 'markers' - - + assert fig.data[0].mode == "markers" From 476e322f194a0e57a2d92d72991f55725d1ab907 Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 5 Sep 2019 15:21:03 -0400 Subject: [PATCH 04/12] try to address pandas installation failure --- packages/python/plotly/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/plotly/tox.ini b/packages/python/plotly/tox.ini index 909b3ee5599..0077b7d2848 100644 --- a/packages/python/plotly/tox.ini +++ b/packages/python/plotly/tox.ini @@ -59,7 +59,7 @@ deps= pytz==2016.10 retrying==1.3.3 pytest==3.5.1 - pandas==0.19.2 + pandas==0.25.1 backports.tempfile==1.0 optional: --editable=file:///{toxinidir}/../plotly-geo optional: numpy==1.11.3 From bcebb929b173896abf400ada9cbdceaeafb93fcc Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 5 Sep 2019 15:43:54 -0400 Subject: [PATCH 05/12] requirements --- packages/python/plotly/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/plotly/tox.ini b/packages/python/plotly/tox.ini index 0077b7d2848..2d0274161ce 100644 --- a/packages/python/plotly/tox.ini +++ b/packages/python/plotly/tox.ini @@ -62,7 +62,7 @@ deps= pandas==0.25.1 backports.tempfile==1.0 optional: --editable=file:///{toxinidir}/../plotly-geo - optional: numpy==1.11.3 + optional: numpy==1.17.1 optional: ipython[all]==5.1.0 optional: ipywidgets==7.2.0 optional: ipykernel==4.8.2 From 936e9eafb9dc530c3441e6cccd9a867fba2074ae Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 5 Sep 2019 16:43:26 -0400 Subject: [PATCH 06/12] requirements --- packages/python/plotly/tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/python/plotly/tox.ini b/packages/python/plotly/tox.ini index 2d0274161ce..df9165f5c79 100644 --- a/packages/python/plotly/tox.ini +++ b/packages/python/plotly/tox.ini @@ -59,10 +59,10 @@ deps= pytz==2016.10 retrying==1.3.3 pytest==3.5.1 - pandas==0.25.1 + pandas==0.24.2 backports.tempfile==1.0 optional: --editable=file:///{toxinidir}/../plotly-geo - optional: numpy==1.17.1 + optional: numpy==1.16.5 optional: ipython[all]==5.1.0 optional: ipywidgets==7.2.0 optional: ipykernel==4.8.2 From c8834af401cf1d422b78cb89bdf7a61dfe0b7719 Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 12 Sep 2019 09:36:58 -0400 Subject: [PATCH 07/12] debugging --- .../plotly/plotly/figure_factory/_ternary_contour.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/python/plotly/plotly/figure_factory/_ternary_contour.py b/packages/python/plotly/plotly/figure_factory/_ternary_contour.py index f45a9fcc135..72b5e8f0c8e 100644 --- a/packages/python/plotly/plotly/figure_factory/_ternary_contour.py +++ b/packages/python/plotly/plotly/figure_factory/_ternary_contour.py @@ -6,7 +6,6 @@ from plotly.graph_objs import graph_objs as go np = optional_imports.get_module("numpy") -sk_measure = optional_imports.get_module("skimage.measure") scipy_interp = optional_imports.get_module("scipy.interpolate") @@ -614,6 +613,12 @@ def create_ternary_contour( """\ The create_ternary_contour figure factory requires the scipy package""" ) + try: + import skimage + print("skimage installed") + except ImportError: + print("skimage not installed") + sk_measure = optional_imports.get_module("skimage.measure") if sk_measure is None: raise ImportError( """\ From 62f53fd9b3061926bd978cef7169200d7d153b95 Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 12 Sep 2019 10:15:19 -0400 Subject: [PATCH 08/12] more debugging --- .../python/plotly/plotly/figure_factory/_ternary_contour.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/python/plotly/plotly/figure_factory/_ternary_contour.py b/packages/python/plotly/plotly/figure_factory/_ternary_contour.py index 72b5e8f0c8e..6471e8f1bfe 100644 --- a/packages/python/plotly/plotly/figure_factory/_ternary_contour.py +++ b/packages/python/plotly/plotly/figure_factory/_ternary_contour.py @@ -614,11 +614,12 @@ def create_ternary_contour( The create_ternary_contour figure factory requires the scipy package""" ) try: - import skimage + import skimage.measure as skm print("skimage installed") except ImportError: print("skimage not installed") sk_measure = optional_imports.get_module("skimage.measure") + print(sk_measure) if sk_measure is None: raise ImportError( """\ From 9fe68f168ac9f9a6cead431d8e74cc20261c70ca Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 12 Sep 2019 11:26:37 -0400 Subject: [PATCH 09/12] still debugging --- .../plotly/plotly/figure_factory/_ternary_contour.py | 12 ++++-------- .../test_figure_factory/test_figure_factory.py | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/python/plotly/plotly/figure_factory/_ternary_contour.py b/packages/python/plotly/plotly/figure_factory/_ternary_contour.py index 6471e8f1bfe..bfe85d9c3f7 100644 --- a/packages/python/plotly/plotly/figure_factory/_ternary_contour.py +++ b/packages/python/plotly/plotly/figure_factory/_ternary_contour.py @@ -8,6 +8,7 @@ np = optional_imports.get_module("numpy") scipy_interp = optional_imports.get_module("scipy.interpolate") +from skimage import measure # -------------------------- Layout ------------------------------ @@ -304,8 +305,8 @@ def _extract_contours(im, values, colors): all_contours1, all_values1, all_areas1, all_colors1 = [], [], [], [] all_contours2, all_values2, all_areas2, all_colors2 = [], [], [], [] for i, val in enumerate(values): - contour_level1 = sk_measure.find_contours(zz_min, val) - contour_level2 = sk_measure.find_contours(zz_max, val) + contour_level1 = measure.find_contours(zz_min, val) + contour_level2 = measure.find_contours(zz_max, val) all_contours1.extend(contour_level1) all_contours2.extend(contour_level2) all_values1.extend([val] * len(contour_level1)) @@ -613,12 +614,7 @@ def create_ternary_contour( """\ The create_ternary_contour figure factory requires the scipy package""" ) - try: - import skimage.measure as skm - print("skimage installed") - except ImportError: - print("skimage not installed") - sk_measure = optional_imports.get_module("skimage.measure") + sk_measure = optional_imports.get_module("skimage") print(sk_measure) if sk_measure is None: raise ImportError( diff --git a/packages/python/plotly/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py b/packages/python/plotly/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py index 2d009798059..a08353a9026 100644 --- a/packages/python/plotly/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py +++ b/packages/python/plotly/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py @@ -15,7 +15,7 @@ shapely = optional_imports.get_module("shapely") shapefile = optional_imports.get_module("shapefile") gp = optional_imports.get_module("geopandas") -sk_measure = optional_imports.get_module("skimage.measure") +sk_measure = optional_imports.get_module("skimage") class TestDistplot(NumpyTestUtilsMixin, TestCaseNoTemplate): From 1b57173b4391509bc7384996652173fd0cb42019 Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 12 Sep 2019 11:34:26 -0400 Subject: [PATCH 10/12] scikit-image version --- packages/python/plotly/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/plotly/tox.ini b/packages/python/plotly/tox.ini index df9165f5c79..37244fc91b9 100644 --- a/packages/python/plotly/tox.ini +++ b/packages/python/plotly/tox.ini @@ -74,7 +74,7 @@ deps= optional: pillow==5.2.0 optional: matplotlib==2.2.3 optional: xarray==0.10.9 - optional: scikit-image==0.13.1 + optional: scikit-image==0.14.5 ; CORE ENVIRONMENTS [testenv:py27-core] From 2439883713e34e3b84d773d831897fe75a9ec4d4 Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 12 Sep 2019 11:39:39 -0400 Subject: [PATCH 11/12] scikit-image version --- packages/python/plotly/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/plotly/tox.ini b/packages/python/plotly/tox.ini index 37244fc91b9..df41b7e1df1 100644 --- a/packages/python/plotly/tox.ini +++ b/packages/python/plotly/tox.ini @@ -74,7 +74,7 @@ deps= optional: pillow==5.2.0 optional: matplotlib==2.2.3 optional: xarray==0.10.9 - optional: scikit-image==0.14.5 + optional: scikit-image==0.14.4 ; CORE ENVIRONMENTS [testenv:py27-core] From e986eb3d2195a50758139a7784a5db9d99b17e28 Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Thu, 12 Sep 2019 12:18:00 -0400 Subject: [PATCH 12/12] removed print message --- packages/python/plotly/plotly/figure_factory/_ternary_contour.py | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/python/plotly/plotly/figure_factory/_ternary_contour.py b/packages/python/plotly/plotly/figure_factory/_ternary_contour.py index bfe85d9c3f7..52c7099bced 100644 --- a/packages/python/plotly/plotly/figure_factory/_ternary_contour.py +++ b/packages/python/plotly/plotly/figure_factory/_ternary_contour.py @@ -615,7 +615,6 @@ def create_ternary_contour( The create_ternary_contour figure factory requires the scipy package""" ) sk_measure = optional_imports.get_module("skimage") - print(sk_measure) if sk_measure is None: raise ImportError( """\