Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve image_column_updates python example #9065

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/snippets/all/archetypes/image_column_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
indexes=[rr.TimeSequenceColumn("step", times)],
# Reshape the images so `Image` can tell that this is several blobs.
#
# Note that the `Image` consumes arrays of bytes, so if you have a different channel
# datatype than `U8`, you need to make sure that the data is converted to arrays of bytes
# before passing it to `Image`.
columns=rr.Image.columns(buffer=images.reshape(len(times), -1)),
# Note that the `Image` consumes arrays of bytes, so we should ensure that we take a
# uint8 view of it. This way, this also works when working with datatypes other than `U8`.
columns=rr.Image.columns(buffer=images.view(np.uint8).reshape(len(times), -1)),
)
Loading