Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 723dde4

Browse files
committed
pep:8ball:
1 parent 8aea12e commit 723dde4

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

plotly/tests/test_optional/test_opt_tracefactory.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -249,30 +249,27 @@ def test_simple_streamline(self):
249249
class TestDendrogram(TestCase):
250250

251251
def test_default_dendrogram(self):
252-
dendro = tls.FigureFactory.create_dendrogram(X=np.array([[1, 2, 3, 4],
253-
[1, 1, 3, 4],
254-
[1, 2, 1, 4],
255-
[1, 2, 3, 1]]))
252+
X = np.array([[1, 2, 3, 4], [1, 1, 3, 4], [1, 2, 1, 4], [1, 2, 3, 1]])
253+
dendro = tls.FigureFactory.create_dendrogram(X=X)
256254
expected_data = [{'marker': {'color': 'rgb(255,133,27)'},
257255
'mode': 'lines', 'xaxis': 'xs',
258256
'yaxis': 'y',
259-
'y': np.array([0., 1., 1., 0.]),
260-
'x': np.array([25., 25., 35., 35.]),
257+
'y': np.array([0., 1., 1., 0.]),
258+
'x': np.array([25., 25., 35., 35.]),
261259
'type': u'scatter'},
262260
{'marker': {'color': 'rgb(255,133,27)'},
263261
'mode': 'lines',
264262
'xaxis': 'x',
265263
'yaxis': 'y',
266-
'y': np.array([0., 2.23606798,
267-
2.23606798, 1.]),
264+
'y': np.array([0., 2.23606798, 2.23606798, 1.]),
268265
'x': np.array([15., 15., 30., 30.]),
269266
'type': u'scatter'},
270267
{'marker': {'color': 'blue'},
271268
'mode': 'lines',
272269
'xaxis': 'x',
273270
'yaxis': 'y',
274271
'y': np.array([0., 3.60555128,
275-
3.60555128, 2.23606798]),
272+
3.60555128, 2.23606798]),
276273
'x': np.array([5., 5., 22.5, 22.5]),
277274
'type': u'scatter'}]
278275
expected_layout = {'width': '100%',
@@ -291,7 +288,7 @@ def test_default_dendrogram(self):
291288
'rangemode': 'tozero',
292289
'type': 'linear',
293290
'tickvals': np.array([5.0, 15.0,
294-
25.0, 35.0])},
291+
25.0, 35.0])},
295292
'yaxis': {'showticklabels': True,
296293
'ticks': 'outside',
297294
'showgrid': False,
@@ -348,7 +345,9 @@ def test_dendrogram_orientation(self):
348345
dendro_bottom = tls.FigureFactory.create_dendrogram(
349346
X, orientation='bottom')
350347
self.assertEqual(len(dendro_bottom['layout']['xaxis']['ticktext']), 5)
351-
tickvals_bottom = np.array(dendro_bottom['layout']['xaxis']['tickvals'])
348+
tickvals_bottom = np.array(
349+
dendro_bottom['layout']['xaxis']['tickvals']
350+
)
352351
self.assertTrue((tickvals_bottom >= 0).all())
353352

354353
dendro_top = tls.FigureFactory.create_dendrogram(X, orientation='top')
@@ -361,8 +360,8 @@ def test_dendrogram_orientation(self):
361360
[1, 2, 1, 4],
362361
[1, 2, 3, 1]])
363362
greyscale = [
364-
'rgb(0,0,0)', # black
365-
'rgb(05,105,105)', # dim grey
363+
'rgb(0,0,0)', # black
364+
'rgb(05,105,105)', # dim grey
366365
'rgb(128,128,128)', # grey
367366
'rgb(169,169,169)', # dark grey
368367
'rgb(192,192,192)', # silver

plotly/tools.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3272,14 +3272,14 @@ def get_color_dict(self, colorscale):
32723272

32733273
if colorscale is None:
32743274
colorscale = [
3275-
'rgb(0,116,217)', # blue
3275+
'rgb(0,116,217)', # blue
32763276
'rgb(35,205,205)', # cyan
32773277
'rgb(61,153,112)', # green
3278-
'rgb(40,35,35)', # black
3279-
'rgb(133,20,75)', # magenta
3280-
'rgb(255,65,54)', # red
3281-
'rgb(255,255,255)', # white
3282-
'rgb(255,220,0)'] # yellow
3278+
'rgb(40,35,35)', # black
3279+
'rgb(133,20,75)', # magenta
3280+
'rgb(255,65,54)', # red
3281+
'rgb(255,255,255)', # white
3282+
'rgb(255,220,0)'] # yellow
32833283

32843284
for i in range(len(default_colors.keys())):
32853285
k = default_colors.keys()[i]
@@ -3313,8 +3313,8 @@ def set_axis_layout(self, axis_key):
33133313
axis_key_labels = self.yaxis
33143314
if axis_key_labels not in self.layout:
33153315
self.layout[axis_key_labels] = {}
3316-
self.layout[axis_key_labels]['tickvals'] = [zv*self.sign[axis_key]
3317-
for zv in self.zero_vals]
3316+
self.layout[axis_key_labels]['tickvals'] = \
3317+
[zv*self.sign[axis_key] for zv in self.zero_vals]
33183318
self.layout[axis_key_labels]['ticktext'] = self.labels
33193319
self.layout[axis_key_labels]['tickmode'] = 'array'
33203320

0 commit comments

Comments
 (0)