Skip to content

Commit 1fb11b2

Browse files
authored
remove usages of numpy float, Fixes #50 (#51)
1 parent 5518b7f commit 1fb11b2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ipyplot/_img_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _img_to_base64(
7575
""" # NOQA E501
7676
# if statements to convert image to PIL.Image object
7777
if isinstance(image, np.ndarray):
78-
if image.dtype in [np.float, np.float32, np.float64]:
78+
if image.dtype in [np.float32, np.float64]:
7979
# if dtype is float and values range is from 0.0 to 1.0
8080
# we need to normalize it to 0-255 range
8181
image = image * 255 if image.max() <= 1.0 else image

tests/test_plotting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
(np.asarray(BASE_NP_IMGS), LABELS[1], LABELS[0]),
4646
(np.asarray(BASE_INTERNET_URLS), LABELS[1], LABELS[0]),
4747
(np.asarray(BASE_LOCAL_URLS), LABELS[1], LABELS[0]),
48-
(np.asarray(BASE_NP_IMGS, dtype=np.float) / 255, LABELS[1], LABELS[0]),
48+
(np.asarray(BASE_NP_IMGS, dtype=np.float32) / 255, LABELS[1], LABELS[0]),
4949
(LOCAL_URLS_AS_PIL, LABELS[0], LABELS[0]),
5050
(LOCAL_URLS_AS_PIL, LABELS[1], LABELS[1]),
5151
(LOCAL_URLS_AS_PIL, LABELS[2], LABELS[2]),

0 commit comments

Comments
 (0)