Skip to content

Commit

Permalink
fix #39
Browse files Browse the repository at this point in the history
  • Loading branch information
karolzak committed Mar 14, 2022
1 parent 5273ec8 commit b0187d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ipyplot/_img_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _img_to_base64(
Image as base64 string.
""" # NOQA E501
# if statements to convert image to PIL.Image object
if type(image) is np.ndarray:
if isinstance(image, np.ndarray):
if image.dtype in [np.float, np.float32, np.float64]:
# if dtype is float and values range is from 0.0 to 1.0
# we need to normalize it to 0-255 range
Expand Down
3 changes: 3 additions & 0 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
from typing import Sequence

import os
import numpy as np
import pandas as pd
import pytest
Expand Down Expand Up @@ -49,6 +50,8 @@
(LOCAL_URLS_AS_PIL, LABELS[1], LABELS[1]),
(LOCAL_URLS_AS_PIL, LABELS[2], LABELS[2]),
(LOCAL_URLS_AS_PIL, LABELS[3], LABELS[3]),
# test case for abs to rel path convertion
([os.path.abspath(pth) for pth in BASE_LOCAL_URLS], LABELS[1], LABELS[0]),
]


Expand Down

0 comments on commit b0187d9

Please # to comment.