@@ -45,17 +45,17 @@ def test_zmax():
45
45
46
46
def test_automatic_zmax_from_dtype ():
47
47
dtypes_dict = {
48
- np .uint8 : 2 ** 8 - 1 ,
49
- np .uint16 : 2 ** 16 - 1 ,
48
+ np .uint8 : 2 ** 8 - 1 ,
49
+ np .uint16 : 2 ** 16 - 1 ,
50
50
np .float : 1 ,
51
- np . bool : 255 ,
51
+ bool : 255 ,
52
52
}
53
53
for key , val in dtypes_dict .items ():
54
54
img = np .array ([0 , 1 ], dtype = key )
55
55
img = np .dstack ((img ,) * 3 )
56
56
fig = px .imshow (img , binary_string = False )
57
57
# For uint8 in "infer" mode we don't pass zmin/zmax unless specified
58
- if key in [np .uint8 , np . bool ]:
58
+ if key in [np .uint8 , bool ]:
59
59
assert fig .data [0 ]["zmax" ] is None
60
60
else :
61
61
assert fig .data [0 ]["zmax" ] == (val , val , val , 255 )
@@ -195,9 +195,7 @@ def test_imshow_xarray_slicethrough():
195
195
196
196
197
197
def test_imshow_labels_and_ranges ():
198
- fig = px .imshow (
199
- [[1 , 2 ], [3 , 4 ], [5 , 6 ]],
200
- )
198
+ fig = px .imshow ([[1 , 2 ], [3 , 4 ], [5 , 6 ]],)
201
199
assert fig .layout .xaxis .title .text is None
202
200
assert fig .layout .yaxis .title .text is None
203
201
assert fig .layout .coloraxis .colorbar .title .text is None
@@ -386,11 +384,7 @@ def test_facet_col(facet_col, binary_string):
386
384
@pytest .mark .parametrize ("binary_string" , [False , True ])
387
385
def test_animation_frame_grayscale (animation_frame , binary_string ):
388
386
img = np .random .randint (255 , size = (10 , 9 , 8 )).astype (np .uint8 )
389
- fig = px .imshow (
390
- img ,
391
- animation_frame = animation_frame ,
392
- binary_string = binary_string ,
393
- )
387
+ fig = px .imshow (img , animation_frame = animation_frame , binary_string = binary_string ,)
394
388
nslices = img .shape [animation_frame ]
395
389
assert len (fig .frames ) == nslices
396
390
@@ -399,11 +393,7 @@ def test_animation_frame_grayscale(animation_frame, binary_string):
399
393
@pytest .mark .parametrize ("binary_string" , [False , True ])
400
394
def test_animation_frame_rgb (animation_frame , binary_string ):
401
395
img = np .random .randint (255 , size = (10 , 9 , 8 , 3 )).astype (np .uint8 )
402
- fig = px .imshow (
403
- img ,
404
- animation_frame = animation_frame ,
405
- binary_string = binary_string ,
406
- )
396
+ fig = px .imshow (img , animation_frame = animation_frame , binary_string = binary_string ,)
407
397
nslices = img .shape [animation_frame ]
408
398
assert len (fig .frames ) == nslices
409
399
0 commit comments