Skip to content

Commit 4db5fe4

Browse files
committed
remove pypng dependency
1 parent 7b117dc commit 4db5fe4

File tree

5 files changed

+2342
-8
lines changed

5 files changed

+2342
-8
lines changed

.circleci/create_conda_optional_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ ! -d $HOME/miniconda/envs/circle_optional ]; then
1616
# Create environment
1717
# PYTHON_VERSION=2.7 or 3.5
1818
$HOME/miniconda/bin/conda create -n circle_optional --yes python=$PYTHON_VERSION \
19-
requests nbformat six retrying psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython jupyter ipykernel ipywidgets statsmodels pypng
19+
requests nbformat six retrying psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython jupyter ipykernel ipywidgets statsmodels
2020

2121
# Install orca into environment
2222
$HOME/miniconda/bin/conda install --yes -n circle_optional -c plotly plotly-orca==1.3.1

packages/python/plotly/plotly/express/_imshow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import base64
66
from .imshow_utils import rescale_intensity, _integer_ranges, _integer_types
77
import pandas as pd
8-
import png
8+
from .png import Writer, from_array
99
import numpy as np
1010

1111
try:
@@ -57,10 +57,10 @@ def _array_to_b64str(img, backend="pil", compression=4):
5757
sh = img.shape
5858
if ndim == 3:
5959
img = img.reshape((sh[0], sh[1] * sh[2]))
60-
w = png.Writer(
60+
w = Writer(
6161
sh[1], sh[0], greyscale=(ndim == 2), alpha=alpha, compression=compression
6262
)
63-
img_png = png.from_array(img, mode=mode)
63+
img_png = from_array(img, mode=mode)
6464
prefix = "data:image/png;base64,"
6565
with BytesIO() as stream:
6666
w.write(stream, img_png.rows)

0 commit comments

Comments
 (0)