Skip to content

Commit

Permalink
Introduce support for querying Archetypes (#2743)
Browse files Browse the repository at this point in the history
### What
The main change here is to introduce a new `ArchetypeView` that uses the
archetype interfaces as an alternative to the historical `EntityView`.

Because EntityViews and legacy type definitions leak through numerous
APIs, this involved forking a number of APIs:
 - `process_archetype_views`
 - `query_archetype_with_history`
 - `query_archetype`
 - `range_archetype`
 - `process_color_arch`
 - `process_radii_arch`
 - `process_annotations_and_keypoints_arch`
 
As we migrate more of our queries to the new APIs, the legacy versions
of these helpers can be incrementally deleted and potentially renamed as
appropriate.

### Future work
This does not yet replicated the `query_tests` and `range_tests` for
Archetype APIs. Part of the reason for this is that we make heavy use of
`DataCell` construction in those tests, but DataCells are still heavily
dependent on the legacy Component APIs.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2743) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/2743)
- [Docs
preview](https://rerun.io/preview/pr%3Ajleibs%2Fhope_queries/docs)
- [Examples
preview](https://rerun.io/preview/pr%3Ajleibs%2Fhope_queries/examples)
  • Loading branch information
jleibs authored Jul 20, 2023
1 parent 395d117 commit 00eeacb
Show file tree
Hide file tree
Showing 25 changed files with 1,469 additions and 80 deletions.
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/re_components/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ serde = ["dep:serde", "half/serde", "re_log_types/serde"]
re_log_types.workspace = true
re_log.workspace = true
re_tracing.workspace = true
re_types.workspace = true

# External
ahash.workspace = true
Expand Down
6 changes: 6 additions & 0 deletions crates/re_components/src/class_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ impl re_log_types::Component for ClassId {
"rerun.class_id".into()
}
}

impl From<re_types::components::ClassId> for ClassId {
fn from(other: re_types::components::ClassId) -> Self {
Self(other.0)
}
}
6 changes: 6 additions & 0 deletions crates/re_components/src/keypoint_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ impl re_log_types::Component for KeypointId {
"rerun.keypoint_id".into()
}
}

impl From<re_types::components::KeypointId> for KeypointId {
fn from(other: re_types::components::KeypointId) -> Self {
Self(other.0)
}
}
1 change: 1 addition & 0 deletions crates/re_log_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ re_format.workspace = true
re_log.workspace = true
re_string_interner.workspace = true
re_tracing.workspace = true
re_types.workspace = true
re_tuid = { workspace = true, features = ["arrow2_convert"] }

# External
Expand Down
6 changes: 6 additions & 0 deletions crates/re_log_types/src/instance_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,9 @@ impl Component for InstanceKey {
"rerun.instance_key".into()
}
}

impl From<re_types::components::InstanceKey> for InstanceKey {
fn from(other: re_types::components::InstanceKey) -> Self {
Self(other.0)
}
}
2 changes: 2 additions & 0 deletions crates/re_query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ re_components = { workspace = true, features = ["arrow_datagen"] }
re_data_store.workspace = true
re_format.workspace = true
re_log_types.workspace = true
re_types.workspace = true
re_log.workspace = true
re_tracing.workspace = true

# External dependencies:
arrow2.workspace = true
backtrace = "0.3"
document-features = "0.2"
itertools = { workspace = true }
thiserror.workspace = true
Expand Down
Loading

1 comment on commit 00eeacb

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.25.

Benchmark suite Current: 00eeacb Previous: 395d117 Ratio
batch_points_arrow/encode_log_msg 90332 ns/iter (± 289) 50449 ns/iter (± 123) 1.79

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.