-
Notifications
You must be signed in to change notification settings - Fork 373
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
Introduce AnyValues as an alternative to extension_components #3561
Conversation
a0af072
to
0053a9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Is this supposed to play nice with datatypes? I tried this and it didn't work:
rr.log(
"any_values",
rr.AnyValues(pts=rr.datatypes.Vec2DBatch([(0, 1), (2, 3), (4, 5)])),
)
Either way, I guess it'd be nice to have a note about it in the docstring.
I hadn't though of doing that, but it's a great idea. No reason not to. |
### What - Builds on top of #3561 With `AnyValues` as a means of quickly creating arbitrary component bundles, it's nice to be able to log these on a single line. I briefly looked into adding `+` to components, but making it guaranteed to play nicely with arbitrary user extension components introduced more risk than I think it gained in clarity. This simply allows `log` to consume any additional unnamed args as extra sets of components which are merged into the logging set. This replaces: ``` rr.log( "extra_values", rr.Points2D([[-1, -1], [-1, 1], [1, -1], [1, 1]]), ext={'confidence': [0.3, 0.4, 0.5, 0.6]} ) ``` With ``` rr.log( "extra_values", rr.Points2D([[-1, -1], [-1, 1], [1, -1], [1, 1]]), rr.AnyValues( confidence=[0.3, 0.4, 0.5, 0.6], ), ) ``` A bit more typing involved, but gets rid of special handling of an ext keyword in a way that paves a much clearer path to users adding their own custom components. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3562) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/3562) - [Docs preview](https://rerun.io/preview/0c41bf3abc4e9bfe1ea4af77a662bf2268e42162/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/0c41bf3abc4e9bfe1ea4af77a662bf2268e42162/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
What
The old
ext=
helper functions didn't match the new object APIs particularly well.This migrates the code to a more object-oriented struct, currently called
AnyValues
.Checklist