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 edge-cases and warn on ambiguity for Rgba32 datatype #8054

Merged
merged 4 commits into from
Nov 11, 2024

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Nov 8, 2024

What

The previous offending code:

import rerun as rr

rr.init("rerun_example_colorbad", spawn=True)

point = [[0, 0, 0]]
colors = [0x00FF00FF]  # green

for n in range(30):
    rr.log("points3d", rr.Points3D(positions=point * n, colors=colors * n))

Now works, but produces a warning:

/home/jleibs/colorbad.py:11: RerunWarning: Ambiguous input for colors of length 4. If using 0xRRGGBBAA values, please wrap as np.array with dtype=np.uint32
  rr.log("points3d", rr.Points3D(positions=point * n, colors=colors * n))

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@jleibs jleibs marked this pull request as ready for review November 8, 2024 20:40
@jleibs jleibs added 🐍 Python API Python logging API 🪳 bug Something isn't working include in changelog labels Nov 8, 2024
Copy link

github-actions bot commented Nov 8, 2024

Latest documentation preview deployed successfully.

Result Commit Link
c815abd https://landing-h1195w5ac-rerun.vercel.app/docs

Note: This comment is updated whenever you push a commit.

@jleibs jleibs force-pushed the jleibs/color_handling branch from e6277d7 to 992bc9b Compare November 8, 2024 20:48
@jleibs jleibs merged commit 59c5750 into main Nov 11, 2024
36 of 39 checks passed
@jleibs jleibs deleted the jleibs/color_handling branch November 11, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working include in changelog 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LineStrips3D ignores color if num_strips divisible by four or equals three
2 participants