@@ -249,30 +249,27 @@ def test_simple_streamline(self):
249
249
class TestDendrogram (TestCase ):
250
250
251
251
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 )
256
254
expected_data = [{'marker' : {'color' : 'rgb(255,133,27)' },
257
255
'mode' : 'lines' , 'xaxis' : 'xs' ,
258
256
'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. ]),
261
259
'type' : u'scatter' },
262
260
{'marker' : {'color' : 'rgb(255,133,27)' },
263
261
'mode' : 'lines' ,
264
262
'xaxis' : 'x' ,
265
263
'yaxis' : 'y' ,
266
- 'y' : np .array ([0. , 2.23606798 ,
267
- 2.23606798 , 1. ]),
264
+ 'y' : np .array ([0. , 2.23606798 , 2.23606798 , 1. ]),
268
265
'x' : np .array ([15. , 15. , 30. , 30. ]),
269
266
'type' : u'scatter' },
270
267
{'marker' : {'color' : 'blue' },
271
268
'mode' : 'lines' ,
272
269
'xaxis' : 'x' ,
273
270
'yaxis' : 'y' ,
274
271
'y' : np .array ([0. , 3.60555128 ,
275
- 3.60555128 , 2.23606798 ]),
272
+ 3.60555128 , 2.23606798 ]),
276
273
'x' : np .array ([5. , 5. , 22.5 , 22.5 ]),
277
274
'type' : u'scatter' }]
278
275
expected_layout = {'width' : '100%' ,
@@ -291,7 +288,7 @@ def test_default_dendrogram(self):
291
288
'rangemode' : 'tozero' ,
292
289
'type' : 'linear' ,
293
290
'tickvals' : np .array ([5.0 , 15.0 ,
294
- 25.0 , 35.0 ])},
291
+ 25.0 , 35.0 ])},
295
292
'yaxis' : {'showticklabels' : True ,
296
293
'ticks' : 'outside' ,
297
294
'showgrid' : False ,
@@ -348,7 +345,9 @@ def test_dendrogram_orientation(self):
348
345
dendro_bottom = tls .FigureFactory .create_dendrogram (
349
346
X , orientation = 'bottom' )
350
347
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
+ )
352
351
self .assertTrue ((tickvals_bottom >= 0 ).all ())
353
352
354
353
dendro_top = tls .FigureFactory .create_dendrogram (X , orientation = 'top' )
@@ -361,8 +360,8 @@ def test_dendrogram_orientation(self):
361
360
[1 , 2 , 1 , 4 ],
362
361
[1 , 2 , 3 , 1 ]])
363
362
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
366
365
'rgb(128,128,128)' , # grey
367
366
'rgb(169,169,169)' , # dark grey
368
367
'rgb(192,192,192)' , # silver
0 commit comments