From b1f1d6d03d76f45869e78fd4025de48a0ac0c151 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Thu, 23 Jan 2025 18:15:38 +0100 Subject: [PATCH] Cleanup mentions of #3381 --- crates/viewer/re_viewport_blueprint/src/container.rs | 7 +++++-- .../detect_and_track_objects/detect_and_track_objects.py | 2 +- rerun_py/rerun_sdk/rerun/_baseclasses.py | 2 -- tests/rust/test_api/src/main.rs | 6 +----- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/crates/viewer/re_viewport_blueprint/src/container.rs b/crates/viewer/re_viewport_blueprint/src/container.rs index f6873eaa7d67..f0611dd23f3f 100644 --- a/crates/viewer/re_viewport_blueprint/src/container.rs +++ b/crates/viewer/re_viewport_blueprint/src/container.rs @@ -7,6 +7,7 @@ use re_log_types::EntityPath; use re_types::blueprint::archetypes as blueprint_archetypes; use re_types::blueprint::components::{ContainerKind, GridColumns}; use re_types::components::Name; +use re_types::Loggable as _; use re_types::{blueprint::components::Visible, Archetype as _}; use re_viewer_context::{ContainerId, Contents, ContentsName, ViewId, ViewerContext}; @@ -202,8 +203,10 @@ impl ContainerBlueprint { if let Some(cols) = grid_columns { arch = arch.with_grid_columns(*cols); } else { - // TODO(#3381): Archetypes should provide a convenience API for this - ctx.save_empty_blueprint_component::(&id.as_entity_path()); + arch.grid_columns = Some(re_types::SerializedComponentBatch::new( + re_types::blueprint::components::ContainerKind::arrow_empty(), + re_types::blueprint::archetypes::ContainerBlueprint::descriptor_container_kind(), + )); } ctx.save_blueprint_archetype(&id.as_entity_path(), &arch); diff --git a/examples/python/detect_and_track_objects/detect_and_track_objects.py b/examples/python/detect_and_track_objects/detect_and_track_objects.py index d9be4f0e7ce6..e609fd731b33 100755 --- a/examples/python/detect_and_track_objects/detect_and_track_objects.py +++ b/examples/python/detect_and_track_objects/detect_and_track_objects.py @@ -213,7 +213,7 @@ def log_tracked(self) -> None: ), ) else: - rr.log(f"video/tracked/{self.tracking_id}", rr.Clear(recursive=False)) # TODO(#3381) + rr.log(f"video/tracked/{self.tracking_id}", rr.Boxes2D.clear_fields()) def update_with_detection(self, detection: Detection, bgr: cv2.typing.MatLike) -> None: self.num_recent_undetected_frames = 0 diff --git a/rerun_py/rerun_sdk/rerun/_baseclasses.py b/rerun_py/rerun_sdk/rerun/_baseclasses.py index efe7b52852ca..1528c85e7699 100644 --- a/rerun_py/rerun_sdk/rerun/_baseclasses.py +++ b/rerun_py/rerun_sdk/rerun/_baseclasses.py @@ -203,8 +203,6 @@ def as_component_batches(self) -> Iterable[ComponentBatchLike]: for fld in fields(type(self)): if "component" in fld.metadata: comp = getattr(self, fld.name) - # TODO(#3381): Depending on what we decide - # to do with optional components, we may need to make this instead call `_empty_pa_array` if comp is not None: descr = ComponentDescriptor( comp.component_descriptor().component_name, diff --git a/tests/rust/test_api/src/main.rs b/tests/rust/test_api/src/main.rs index 421e1a9f8d3c..629eb467cdc5 100644 --- a/tests/rust/test_api/src/main.rs +++ b/tests/rust/test_api/src/main.rs @@ -191,11 +191,7 @@ fn test_rects(rec: &RecordingStream) -> anyhow::Result<()> { // Clear the rectangles by logging an empty set rec.set_time_seconds("sim_time", 3f64); - rec.log( - "rects_test/rects", - // TODO(#3381): Should be &Boxes2D::empty() - &Boxes2D::from_half_sizes(std::iter::empty::()), - )?; + rec.log("rects_test/rects", &Boxes2D::clear_fields())?; Ok(()) }