Skip to content

Commit 842c44e

Browse files
committed
ModuleNotFoundError -> ImportError
1 parent 0a5e227 commit 842c44e

File tree

6 files changed

+28
-23
lines changed

6 files changed

+28
-23
lines changed

_plotly_utils/basevalidators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,7 @@ class ImageUriValidator(BaseValidator):
15931593

15941594
try:
15951595
_PIL = import_module('PIL')
1596-
except ModuleNotFoundError:
1596+
except ImportError:
15971597
pass
15981598

15991599
def __init__(self, plotly_name, parent_name, **kwargs):

circle.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ machine:
88
PLOTLY_TOX_PYTHON_33: /home/ubuntu/.pyenv/versions/3.3.3/bin/python3.3
99
PLOTLY_TOX_PYTHON_34: /home/ubuntu/.pyenv/versions/3.4.3/bin/python3.4
1010
PLOTLY_TOX_PYTHON_35: /home/ubuntu/.pyenv/versions/3.5.0/bin/python3.5
11+
PLOTLY_TOX_PYTHON_36: /home/ubuntu/.pyenv/versions/3.6.0/bin/python3.6
1112
PLOTLY_JUPYTER_TEST_DIR: /home/ubuntu/${CIRCLE_PROJECT_REPONAME}/plotly/tests/test_optional/test_jupyter
1213

1314
node:

plotly/basewidget.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def save_image(self, filename, image_type=None, scale_factor=2):
226226
# Check whether we have cairosvg available
227227
try:
228228
import_module('cairosvg')
229-
except ModuleNotFoundError:
229+
except ImportError:
230230
raise ImportError('Exporting to {image_type} requires cairosvg'
231231
.format(image_type=image_type))
232232

plotly/figure_factory/_dendrogram.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def __init__(self, X, orientation='bottom', labels=None, colorscale=None,
144144
self.zero_vals.sort()
145145

146146
self.layout = self.set_figure_layout(width, height)
147-
self.data = graph_objs.Data(dd_traces)
147+
self.data = dd_traces
148148

149149
def get_color_dict(self, colorscale):
150150
"""

plotly/figure_factory/_trisurf.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ def trisurf(x, y, z, simplices, show_colorbar, edges_color, scale,
167167
# the triangle sides are not plotted
168168
if plot_edges is False:
169169
if mean_dists_are_numbers and show_colorbar is True:
170-
return graph_objs.Data([triangles, colorbar])
170+
# return graph_objs.Data([triangles, colorbar])
171+
return [triangles, colorbar]
171172
else:
172-
return graph_objs.Data([triangles])
173+
# return graph_objs.Data([triangles])
174+
return [triangles]
173175

174176
# define the lists x_edge, y_edge and z_edge, of x, y, resp z
175177
# coordinates of edge end points for each triangle
@@ -214,9 +216,11 @@ def trisurf(x, y, z, simplices, show_colorbar, edges_color, scale,
214216
)
215217

216218
if mean_dists_are_numbers and show_colorbar is True:
217-
return graph_objs.Data([triangles, lines, colorbar])
219+
# return graph_objs.Data([triangles, lines, colorbar])
220+
return [triangles, lines, colorbar]
218221
else:
219-
return graph_objs.Data([triangles, lines])
222+
# return graph_objs.Data([triangles, lines])
223+
return [triangles, lines]
220224

221225

222226
def create_trisurf(x, y, z, simplices, colormap=None, show_colorbar=True,

plotly/tests/test_optional/test_figure_factory/test_figure_factory.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,11 @@ def test_default_dendrogram(self):
459459
dendro = ff.create_dendrogram(X=X)
460460

461461
expected_dendro = go.Figure(
462-
data=go.Data([
462+
data=[
463463
go.Scatter(
464464
x=np.array([25., 25., 35., 35.]),
465465
y=np.array([0., 1., 1., 0.]),
466-
marker=go.Marker(color='rgb(61,153,112)'),
466+
marker=go.scatter.Marker(color='rgb(61,153,112)'),
467467
mode='lines',
468468
xaxis='x',
469469
yaxis='y',
@@ -473,7 +473,7 @@ def test_default_dendrogram(self):
473473
go.Scatter(
474474
x=np.array([15., 15., 30., 30.]),
475475
y=np.array([0., 2.23606798, 2.23606798, 1.]),
476-
marker=go.Marker(color='rgb(61,153,112)'),
476+
marker=go.scatter.Marker(color='rgb(61,153,112)'),
477477
mode='lines',
478478
xaxis='x',
479479
yaxis='y',
@@ -483,14 +483,14 @@ def test_default_dendrogram(self):
483483
go.Scatter(
484484
x=np.array([5., 5., 22.5, 22.5]),
485485
y=np.array([0., 3.60555128, 3.60555128, 2.23606798]),
486-
marker=go.Marker(color='rgb(0,116,217)'),
486+
marker=go.scatter.Marker(color='rgb(0,116,217)'),
487487
mode='lines',
488488
xaxis='x',
489489
yaxis='y',
490490
hoverinfo='text',
491491
text=None
492492
)
493-
]),
493+
],
494494
layout=go.Layout(
495495
autosize=False,
496496
height=np.inf,
@@ -548,17 +548,17 @@ def test_dendrogram_random_matrix(self):
548548
dendro = ff.create_dendrogram(X, labels=names)
549549

550550
expected_dendro = go.Figure(
551-
data=go.Data([
551+
data=[
552552
go.Scatter(
553-
marker=go.Marker(color='rgb(61,153,112)'),
553+
marker=go.scatter.Marker(color='rgb(61,153,112)'),
554554
mode='lines',
555555
xaxis='x',
556556
yaxis='y',
557557
hoverinfo='text',
558558
text=None
559559
),
560560
go.Scatter(
561-
marker=go.Marker(
561+
marker=go.scatter.Marker(
562562
color='rgb(61,153,112)'
563563
),
564564
mode='lines',
@@ -568,22 +568,22 @@ def test_dendrogram_random_matrix(self):
568568
text=None
569569
),
570570
go.Scatter(
571-
marker=go.Marker(color='rgb(61,153,112)'),
571+
marker=go.scatter.Marker(color='rgb(61,153,112)'),
572572
mode='lines',
573573
xaxis='x',
574574
yaxis='y',
575575
hoverinfo='text',
576576
text=None
577577
),
578578
go.Scatter(
579-
marker=go.Marker(color='rgb(0,116,217)'),
579+
marker=go.scatter.Marker(color='rgb(0,116,217)'),
580580
mode='lines',
581581
xaxis='x',
582582
yaxis='y',
583583
hoverinfo='text',
584584
text=None
585585
)
586-
]),
586+
],
587587
layout=go.Layout(
588588
autosize=False,
589589
height=np.inf,
@@ -706,11 +706,11 @@ def test_dendrogram_colorscale(self):
706706
dendro = ff.create_dendrogram(X, colorscale=greyscale)
707707

708708
expected_dendro = go.Figure(
709-
data=go.Data([
709+
data=[
710710
go.Scatter(
711711
x=np.array([25., 25., 35., 35.]),
712712
y=np.array([0., 1., 1., 0.]),
713-
marker=go.Marker(color='rgb(128,128,128)'),
713+
marker=go.scatter.Marker(color='rgb(128,128,128)'),
714714
mode='lines',
715715
xaxis='x',
716716
yaxis='y',
@@ -720,7 +720,7 @@ def test_dendrogram_colorscale(self):
720720
go.Scatter(
721721
x=np.array([15., 15., 30., 30.]),
722722
y=np.array([0., 2.23606798, 2.23606798, 1.]),
723-
marker=go.Marker(color='rgb(128,128,128)'),
723+
marker=go.scatter.Marker(color='rgb(128,128,128)'),
724724
mode='lines',
725725
xaxis='x',
726726
yaxis='y',
@@ -730,14 +730,14 @@ def test_dendrogram_colorscale(self):
730730
go.Scatter(
731731
x=np.array([5., 5., 22.5, 22.5]),
732732
y=np.array([0., 3.60555128, 3.60555128, 2.23606798]),
733-
marker=go.Marker(color='rgb(0,0,0)'),
733+
marker=go.scatter.Marker(color='rgb(0,0,0)'),
734734
mode='lines',
735735
xaxis='x',
736736
yaxis='y',
737737
hoverinfo='text',
738738
text=None
739739
)
740-
]),
740+
],
741741
layout=go.Layout(
742742
autosize=False,
743743
height=np.inf,

0 commit comments

Comments
 (0)