Skip to content

Archetype based overrides & defaults #9209

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

Merged
merged 37 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
987bc6a
Get everything to basically work & demonstrate on plots example
Wumpf Feb 19, 2025
082a342
type annotations for views
Wumpf Feb 19, 2025
24490ea
more annotations, convert all examples to use new defaults/overrides
Wumpf Feb 20, 2025
1d6882a
Merge remote-tracking branch 'origin/main' into andreas/archetype-dri…
Wumpf Mar 6, 2025
321cced
visible time range can now directly be converted to a component batch
Wumpf Mar 6, 2025
d640759
drive by fix: doc link
Wumpf Mar 6, 2025
6b0a31f
Merge remote-tracking branch 'origin/main' into andreas/archetype-dri…
Wumpf Mar 6, 2025
4c266a6
pixi lock.. undo? changes
Wumpf Mar 6, 2025
207a05f
fix broken merge & format
Wumpf Mar 6, 2025
8a6ff7e
fix expected warnings test
Wumpf Mar 6, 2025
847f6f3
improved override type handling
Wumpf Mar 6, 2025
e7d04b3
fix type annotation on views
Wumpf Mar 6, 2025
3cd935d
Fix new use of old overrides, suppress type annotation issue temporarily
Wumpf Mar 6, 2025
5ad8b05
update overrides / defaults in checklists
Wumpf Mar 7, 2025
3a2f8dc
Make visualizer overrides an archetype
Wumpf Mar 7, 2025
8308bf5
Merge remote-tracking branch 'origin/main' into andreas/archetype-dri…
Wumpf Mar 7, 2025
62bcee8
typos
Wumpf Mar 7, 2025
0000924
fixes
Wumpf Mar 7, 2025
71807df
Merge remote-tracking branch 'origin/main' into andreas/archetype-dri…
Wumpf Mar 7, 2025
2b8b1ca
migration guide
Wumpf Mar 7, 2025
d8641f8
fix messed up radii
Wumpf Mar 7, 2025
3b22a2f
Remove visibletimerange archetype workaround
Wumpf Mar 7, 2025
79f6e8e
fix dna example in python
Wumpf Mar 7, 2025
83bece4
typos and lints
Wumpf Mar 7, 2025
b63507a
Merge remote-tracking branch 'origin/main' into andreas/archetype-dri…
Wumpf Mar 10, 2025
9fceac0
fix missed override update in scripts/
Wumpf Mar 10, 2025
d7bb115
fix test compilation
Wumpf Mar 10, 2025
be15022
update plots rrd file
Wumpf Mar 10, 2025
9015d7e
Improved `View(overrides={})` api
abey79 Mar 10, 2025
549dd89
py-fmt
abey79 Mar 10, 2025
c319457
fix incorrect comment in VisualizerOverrides
Wumpf Mar 10, 2025
d35d3fe
various small issues pointed out in review
Wumpf Mar 10, 2025
2f1d62b
fix checklist
Wumpf Mar 10, 2025
efd9297
fix accidentally commented change to VisibleTimeRanges ctor
Wumpf Mar 10, 2025
fe9a6b1
fix cpp formatting issues (how did this happen?)
Wumpf Mar 10, 2025
440fa22
fixup snippets
Wumpf Mar 10, 2025
ce585be
extra overload for VisibletimeRanges and accompanying tests
Wumpf Mar 10, 2025
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
20 changes: 13 additions & 7 deletions crates/build/re_types_builder/src/codegen/python/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ fn init_method(reporter: &Reporter, objects: &Objects, obj: &Object) -> String {
contents: ViewContentsLike = "$origin/**",
name: Utf8Like | None = None,
visible: datatypes.BoolLike | None = None,
defaults: list[Union[AsComponents, ComponentBatchLike]] | None = None,
overrides: dict[EntityPathLike, list[ComponentBatchLike]] | None = None,
defaults: list[AsComponents | Iterable[DescribedComponentBatch]] | None = None,
overrides: dict[EntityPathLike, AsComponents | Iterable[DescribedComponentBatch | AsComponents | Iterable[DescribedComponentBatch]]] | None = None,
"#
.to_owned();

Expand Down Expand Up @@ -130,18 +130,24 @@ Defaults to true if not specified."
),
(
"defaults",
"List of default components or component batches to add to the view. When an archetype
in the view is missing a component included in this set, the value of default will be used
instead of the normal fallback for the visualizer.".to_owned(),
"List of archetypes or (described) component batches to add to the view.
When an archetype in the view is missing a component included in this set,
the value of default will be used instead of the normal fallback for the visualizer.

Note that an archetype's required components typically don't have any effect.
It is recommended to use the archetype's `from_fields` method instead and only specify the fields that you need.".to_owned(),
),
(
"overrides",
"Dictionary of overrides to apply to the view. The key is the path to the entity where the override
should be applied. The value is a list of component or component batches to apply to the entity.
should be applied. The value is a list of archetypes or (described) component batches to apply to the entity.

It is recommended to use the archetype's `from_fields` method instead and only specify the fields that you need.

Important note: the path must be a fully qualified entity path starting at the root. The override paths
do not yet support `$origin` relative paths or glob expressions.
This will be addressed in <https://github.com/rerun-io/rerun/issues/6673>.".to_owned(),)
This will be addressed in <https://github.com/rerun-io/rerun/issues/6673>.
".to_owned(),)
];
for field in &obj.fields {
let doc_content = field.docs.lines_for(reporter, objects, Target::Python);
Expand Down

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace rerun.blueprint.archetypes;

/// Override the visualizers for an entity.
///
/// This archetype is a stop-gap mechanism based on the current implementation details
/// of the visualizer system. It is not intended to be a long-term solution, but provides
/// enough utility to be useful in the short term.
///
/// The long-term solution is likely to be based off: <https://github.com/rerun-io/rerun/issues/6626>
///
/// This can only be used as part of blueprints. It will have no effect if used
/// in a regular entity.
table VisualizerOverrides (
"attr.rerun.scope": "blueprint",
"attr.python.aliases": "str, Sequence[str]"
) {
/// Names of the visualizers that should be active.
ranges: [rerun.blueprint.components.VisualizerOverride] ("attr.rerun.component_required", order: 1000);
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
namespace rerun.blueprint.components;

// ---

/// Override the visualizers for an entity.
///
/// This component is a stop-gap mechanism based on the current implementation details
/// of the visualizer system. It is not intended to be a long-term solution, but provides
/// enough utility to be useful in the short term.
///
/// The long-term solution is likely to be based off: <https://github.com/rerun-io/rerun/issues/6626>
/// Single visualizer override the visualizers for an entity.
///
/// This can only be used as part of blueprints. It will have no effect if used
/// in a regular entity.
table VisualizerOverrides (
/// For details see [archetypes.VisualizerOverrides].
table VisualizerOverride (
"attr.python.aliases": "str, list[str]",
"attr.python.array_aliases": "str",
"attr.rerun.scope": "blueprint",
"attr.rust.derive": "PartialEq, Eq, PartialOrd, Ord, Default",
"attr.rust.repr": "transparent"
) {
/// Names of the visualizers that should be active.
visualizers: rerun.blueprint.datatypes.Utf8List (order: 100);
/// Names of a visualizer that should be active.
visualizer: rerun.datatypes.Utf8 (order: 100);
}

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace rerun.components;

/// Like `Visible`, but for time series.
/// Like [components.Visible], but for time series.
///
/// TODO(#6889): This is a temporary workaround. Right now we can't use `Visible` since it would conflict with the entity-wide visibility state.
/// TODO(#6889): This is a temporary workaround. Right now we can't use [components.Visible] since it would conflict with the entity-wide visibility state.
struct SeriesVisible (
"attr.docs.unreleased", // this component got moved, links changed.
"attr.arrow.transparent",
Expand Down

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

2 changes: 2 additions & 0 deletions crates/store/re_types/src/blueprint/archetypes/mod.rs

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

196 changes: 196 additions & 0 deletions crates/store/re_types/src/blueprint/archetypes/visualizer_overrides.rs

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

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

4 changes: 2 additions & 2 deletions crates/store/re_types/src/blueprint/components/mod.rs

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

Loading
Loading