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

Create objects for delegating components #3303

Merged
merged 19 commits into from Sep 13, 2023
Merged

Create objects for delegating components #3303

merged 19 commits into from Sep 13, 2023

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Sep 12, 2023

What

Builds on top of: #3302

One of the items raised by #3268 was wanting to extend a component type. But components previously had no instantiation.

This PR creates Component objects that derive from their baseclass as well as the extension class. These can be used anywhere the datatype could be used instead.

Example with TextLogLevel:

>>> rr2.TextLog(body="Hello", level=rr2.cmp.TextLogLevel.WARN)
rr.TextLog(
  rerun.label<string>(
    ['Hello']
  )
  rerun.components.TextLogLevel<string>(
    ['WARN']
  )
  rerun.colorrgba<uint32>(
    []
  )
)

>>> rr2.TextLog(body="World", level=rr2.cmp.TextLogLevel("my custom level"))
rr.TextLog(
  rerun.label<string>(
    ['World']
  )
  rerun.components.TextLogLevel<string>(
    ['my custom level']
  )
  rerun.colorrgba<uint32>(
    []
  )
)

Checklist

@jleibs jleibs added codegen/idl 🐍 Python API Python logging API labels Sep 12, 2023
@jleibs jleibs marked this pull request as ready for review September 12, 2023 22:39
@jleibs jleibs changed the title Jleibs/component objects Create objects for delegating components Sep 12, 2023
Copy link
Member Author

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/python_ext to main September 13, 2023 13:22
Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

:D

@emilk emilk merged commit 580101e into main Sep 13, 2023
26 checks passed
@emilk emilk deleted the jleibs/component_objects branch September 13, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants