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

Remove ext= and allow logging extra component bundles #3562

Merged
merged 4 commits into from
Oct 2, 2023

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Sep 29, 2023

What

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

@jleibs jleibs marked this pull request as ready for review September 29, 2023 18:14
@jleibs jleibs force-pushed the jleibs/extra_logging branch from 7d49d38 to 231b22e Compare September 29, 2023 18:18
@jleibs jleibs added 🐍 Python API Python logging API exclude from changelog PRs with this won't show up in CHANGELOG.md labels Sep 29, 2023
Copy link
Member

@abey79 abey79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

Base automatically changed from jleibs/any_value to main October 2, 2023 17:34
@jleibs jleibs force-pushed the jleibs/extra_logging branch from 231b22e to ba15bf8 Compare October 2, 2023 18:12
@jleibs jleibs merged commit 827f513 into main Oct 2, 2023
30 of 31 checks passed
@jleibs jleibs deleted the jleibs/extra_logging branch October 2, 2023 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants