JSON serialization error
@ayjayt đang làm issue này rồi.
Từ ngày 10/1/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
With Kaleido 1.0.0rc0, running the skimage gallery example below, I see the following error:
File "/home/stefan/envs/py313/lib64/python3.13/site-packages/kaleido/__init__.py", line 129, in to_image
response = await tab.send_command("Runtime.callFunctionOn", params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/stefan/envs/py313/lib64/python3.13/site-packages/choreographer/pipe.py", line 56, in write_json
message = simplejson.dumps(obj, ensure_ascii=False, ignore_nan=True, cls=self.json_encoder)
File "/home/stefan/envs/py313/lib64/python3.13/site-packages/simplejson/__init__.py", line 395, in dumps
**kw).encode(obj)
~~~~~~^^^^^
File "/home/stefan/envs/py313/lib64/python3.13/site-packages/simplejson/encoder.py", line 298, in encode
chunks = self.iterencode(o)
File "/home/stefan/envs/py313/lib64/python3.13/site-packages/simplejson/encoder.py", line 379, in iterencode
return _iterencode(o, 0)
File "/home/stefan/envs/py313/lib64/python3.13/site-packages/choreographer/pipe.py", line 34, in default
return simplejson.JSONEncoder.default(self, obj)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/home/stefan/envs/py313/lib64/python3.13/site-packages/simplejson/encoder.py", line 274, in default
raise TypeError('Object of type %s is not JSON serializable' %
o.__class__.__name__)
TypeError: Object of type uint16 is not JSON serializable
I first picked this up on CI, where the same thing happened.
import plotly.express as px
import plotly.io
plotly.io.renderers.default = "sphinx_gallery_png"
import skimage as ski
data = ski.data.kidney()
n_plane, n_row, n_col, n_chan = data.shape
v_min, v_max = data[:, :, :, 1].min(), data[:, :, :, 1].max()
print(f'range: ({v_min}, {v_max})')
fig1 = px.imshow(
data[n_plane // 2, :, :, 1],
zmin=v_min,
zmax=v_max,
labels={'x': 'col', 'y': 'row', 'color': 'intensity'},
)
plotly.io.show(fig1)
- Ngôn ngữ chính
- Python
- Star
- 504
- Fork
- 65
- Merge trung bình
- 6 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của plotly/kaleido
-
Writing to an existing directory whose name has a dot fails with "Invalid format"Có thể đã có người làm @RaphaelFakhri đã nhận 12 ngày trước. Đang mởbug P3 size: 1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
-
Deterministic Rendering ChallengesCó thể làm lại được @camdecoster đã nhận 67 ngày trước và không có pull request nào đang mở. Đang mởenhancement feature P2 size: 5
-
[FEATURE]: Embed custom fonts into vector exports (no system install)Có thể đã có người làm @camdecoster đã nhận 124 ngày trước. Đang mởenhancement P3 size: 3
-
enhancement feature P3 size: 5
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
GlobalKaleidoServer is not thread-safeCó thể đã có người làm @talleibman đã nhận 249 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Tất cả issue của plotly/kaleido
Issue tương tự
-
DBFS append mode silently overwrites existing filesCó thể đã có người làm @IlyaKhalafi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
fsspec/filesystem_spec#2429 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Retrieval rerank fallback statistics stay zero after provider failureCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
volcengine/OpenViking#7014 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
fedora-copr/copr#4600 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ansys/pydpf-core#3620 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày