-
Notifications
You must be signed in to change notification settings - Fork 388
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
End-to-end tagging: Python #8298
End-to-end tagging: Python #8298
Conversation
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
1d4d9b6
to
15f6e4d
Compare
e00694e
to
3e1d785
Compare
a20cd08
to
f201277
Compare
3e1d785
to
fd719d0
Compare
e0bc4ca
to
a59280a
Compare
a59280a
to
9099039
Compare
f2cd070
to
8bd7ff1
Compare
e9be108
to
98a76e4
Compare
8bd7ff1
to
7fe3e87
Compare
7fe3e87
to
56ef384
Compare
@rerun-bot full-check |
Started a full build: https://github.com/rerun-io/rerun/actions/runs/12182603757 |
e0d39ae
to
56ef384
Compare
component_name, archetype_name=archetype_name, archetype_field_name=archetype_field_name | ||
) | ||
|
||
def or_with_overrides(self, *, archetype_name: str | None, archetype_field_name: str | None) -> ComponentDescriptor: |
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.
The exact meaning of this method doesn't feel obvious to me based on the name... esp the fact that the two maybe-override terms act independently.
Do we ever actually need this? Is there an example when we don't just want the unconditional version?
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.
I've already ended up in the situation of re-tagging data that might or might not be tagged as it reaches me.
It's probably not the right solution for it, but the underlying concern of certainly exists...
I expect these APIs will change quite a lot as we learn more about how things go in practice.
|
||
def __init__(self, batch: ComponentBatchLike, descriptor: ComponentDescriptor): | ||
self._batch = batch | ||
self._descriptor = descriptor |
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.
Should this check that the batch.component_descriptor().component_name
matches the descriptor.component_name
?
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.
We haven't set such rules in the other SDKs -- it is technically legal to override the component name if you know what you're doing... for now.
rr.DescribedComponentBatch( | ||
confidences, | ||
confidences.component_descriptor().or_with_overrides( | ||
archetype_name="user.CustomPoints3D", archetype_field_name="confidences" | ||
), | ||
) |
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.
this pattern feels quite verbose, I'd be tempted to do something like:
rr.DescribedComponentBatch( | |
confidences, | |
confidences.component_descriptor().or_with_overrides( | |
archetype_name="user.CustomPoints3D", archetype_field_name="confidences" | |
), | |
) | |
rr.DescribedComponentBatch( | |
confidences, | |
override_archetype="user.CustomPoints3D", | |
override_field="confidences" | |
) |
and move the confidences.component_descriptor().or_with_overrides(... )
to the implementation.
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.
Yeah that was very low-level on purpose -- I don't think end-users should ever see DescribedComponentBatch
directly, even.
See:
@@ -43,6 +43,9 @@ def component_name(self) -> str: | |||
def as_arrow_array(self) -> pa.Array: | |||
return self.data | |||
|
|||
def component_descriptor(self) -> ComponentDescriptor: | |||
return ComponentDescriptor(self.component_name()) |
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.
Shouldn't this always set the archetype since we have it?
return ComponentDescriptor(self.component_name()) | |
return ComponentDescriptor(self.component_name(), archetype_name=self._achetype_name) |
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.
Not yet -- because other SDKs don't and therefore roundtrips would fail.
But yes, for milestone 2 this will be the case, so that our backwards compat plan can work.
7dd6190
to
87ec140
Compare
56ef384
to
77b1f3f
Compare
7d83fd1
to
9591fd0
Compare
This semantically mimics very closely the way things are done in Rust, minus all technical differences due to the differences between both the languages and the SDKs.
For that reason, everything stated in #8304 (comment) basically applies as-is.
Pretty happy about it, I must say.