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

Always log the primary component last so it is joined properly #1217

Merged
merged 3 commits into from
Feb 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions crates/re_sdk/src/msg_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,17 @@ impl MsgSender {
pub fn send(self, session: &mut Session) -> Result<(), MsgSenderError> {
let [msg_standard, msg_transforms, msg_splats] = self.into_messages()?;

if let Some(msg_standard) = msg_standard {
session.send(LogMsg::ArrowMsg(msg_standard.try_into()?));
}
if let Some(msg_transforms) = msg_transforms {
session.send(LogMsg::ArrowMsg(msg_transforms.try_into()?));
}
if let Some(msg_splats) = msg_splats {
session.send(LogMsg::ArrowMsg(msg_splats.try_into()?));
}
// Always the primary component last so range-based queries will include the other data. See(#1215)
// Since the primary component can't be splatted it must be in msg_standard
if let Some(msg_standard) = msg_standard {
session.send(LogMsg::ArrowMsg(msg_standard.try_into()?));
}

Ok(())
}
Expand Down
7 changes: 4 additions & 3 deletions rerun_py/rerun_sdk/rerun/log/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ def log_arrow(
if ext:
_add_extension_components(instanced, splats, ext, None)

if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

if splats:
splats["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
7 changes: 4 additions & 3 deletions rerun_py/rerun_sdk/rerun/log/bounding_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ def log_obb(
if ext:
_add_extension_components(instanced, splats, ext, None)

if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

if splats:
splats["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
7 changes: 4 additions & 3 deletions rerun_py/rerun_sdk/rerun/log/extension_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ def log_extension_components(

_add_extension_components(instanced, splats, ext, identifiers_np)

if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

if splats:
splats["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
14 changes: 8 additions & 6 deletions rerun_py/rerun_sdk/rerun/log/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ def log_path(
if ext:
_add_extension_components(instanced, splats, ext, None)

if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

if splats:
splats["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)


def log_line_segments(
entity_path: str,
Expand Down Expand Up @@ -159,9 +160,10 @@ def log_line_segments(
if ext:
_add_extension_components(instanced, splats, ext, None)

if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

if splats:
splats["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
12 changes: 7 additions & 5 deletions rerun_py/rerun_sdk/rerun/log/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,14 @@ def log_point(
if ext:
_add_extension_components(instanced, splats, ext, None)

if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

if splats:
splats["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)


def log_points(
entity_path: str,
Expand Down Expand Up @@ -244,8 +245,9 @@ def log_points(
if ext:
_add_extension_components(comps[0], comps[1], ext, identifiers_np)

bindings.log_arrow_msg(entity_path, components=comps[0], timeless=timeless)

if comps[1]:
comps[1]["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=comps[1], timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
bindings.log_arrow_msg(entity_path, components=comps[0], timeless=timeless)
12 changes: 7 additions & 5 deletions rerun_py/rerun_sdk/rerun/log/rects.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ def log_rect(
if ext:
_add_extension_components(instanced, splats, ext, None)

if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

if splats:
splats["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)


def log_rects(
entity_path: str,
Expand Down Expand Up @@ -190,8 +191,9 @@ def log_rects(
if ext:
_add_extension_components(comps[0], comps[1], ext, identifiers_np)

bindings.log_arrow_msg(entity_path, components=comps[0], timeless=timeless)

if comps[1]:
comps[1]["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=comps[1], timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
bindings.log_arrow_msg(entity_path, components=comps[0], timeless=timeless)
7 changes: 4 additions & 3 deletions rerun_py/rerun_sdk/rerun/log/scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ def log_scalar(
if ext:
_add_extension_components(instanced, splats, ext, None)

if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=False)

if splats:
splats["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=splats, timeless=False)

# Always the primary component last so range-based queries will include the other data. See(#1215)
if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=False)
7 changes: 4 additions & 3 deletions rerun_py/rerun_sdk/rerun/log/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ def _log_tensor(
if ext:
_add_extension_components(instanced, splats, ext, None)

if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

if splats:
splats["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)
7 changes: 4 additions & 3 deletions rerun_py/rerun_sdk/rerun/log/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ def log_text_entry(
if ext:
rerun.log.extension_components._add_extension_components(instanced, splats, ext, None)

if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)

if splats:
splats["rerun.instance_key"] = InstanceArray.splat()
bindings.log_arrow_msg(entity_path, components=splats, timeless=timeless)

# Always the primary component last so range-based queries will include the other data. See(#1215)
if instanced:
bindings.log_arrow_msg(entity_path, components=instanced, timeless=timeless)