Skip to content

Commit

Permalink
Uuid & IncludedSpaceView types are now serializable in python (#5372
Browse files Browse the repository at this point in the history
)

### What

* part of #4167

Steps towards serializable `ViewportBlueprint`. Adjusted structure a
bit: it used to be `IncludedSpaceViews` (plural) it's now
`IncludedSpaceView` (singular) and we store a component array on the
`ViewportBlueprint archetype.
Also, uuid needed some extra love on codegen as well.

### 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 the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5372/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5372/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5372/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5372)
- [Docs
preview](https://rerun.io/preview/67d77ed6fb8d0bcfa952dc6c3d300b713eb6ef77/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/67d77ed6fb8d0bcfa952dc6c3d300b713eb6ef77/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
Wumpf authored Mar 4, 2024
1 parent 29baeb3 commit 236599f
Show file tree
Hide file tree
Showing 46 changed files with 1,174 additions and 726 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/re_types/definitions/rerun/blueprint.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include "./blueprint/components/entity_properties_component.fbs";
include "./blueprint/components/grid_columns.fbs";
include "./blueprint/components/included_contents.fbs";
include "./blueprint/components/included_queries.fbs";
include "./blueprint/components/included_space_views.fbs";
include "./blueprint/components/included_space_view.fbs";
include "./blueprint/components/panel_view.fbs";
include "./blueprint/components/query_expressions.fbs";
include "./blueprint/components/root_container.fbs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ table ViewportBlueprint (
// --- Required ---

/// All of the space-views that belong to the viewport.
space_views: rerun.blueprint.components.IncludedSpaceViews ("attr.rerun.component_required", order: 1000);
space_views: [rerun.blueprint.components.IncludedSpaceView] ("attr.rerun.component_required", order: 1000);

// --- Optional ---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ namespace rerun.blueprint.components;
/// The id of a `SpaceView`.
///
/// Unstable. Used for the ongoing blueprint experimentations.
table IncludedSpaceViews (
table IncludedSpaceView (
"attr.rerun.scope": "blueprint",
"attr.python.aliases": "npt.NDArray[np.uint8], npt.ArrayLike, Sequence[int], bytes",
"attr.rust.derive": "Default",
"attr.rust.override_crate": "re_viewport",
"attr.rust.repr": "transparent"
) {
space_view_ids: [rerun.datatypes.Uuid] (order: 100);
space_view_ids: rerun.datatypes.Uuid (order: 100);
}
6 changes: 3 additions & 3 deletions crates/re_types/definitions/rerun/datatypes/uuid.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace rerun.datatypes;

/// A 16-byte uuid.
struct Uuid (
// TODO(jleibs): Figure out why we can't make this transparent.
// The deserializer barfs on list of fixed-sized-list.
//"attr.arrow.transparent",
"attr.arrow.transparent",
"attr.python.aliases": "npt.NDArray[Any], npt.ArrayLike, Sequence[int], bytes",
"attr.python.array_aliases": "npt.NDArray[Any], npt.ArrayLike, Sequence[Sequence[int]], Sequence[int], Sequence[bytes]",
"attr.rust.derive": "Default, Copy, PartialEq, Eq",
"attr.rust.repr": "transparent"
) {
Expand Down
115 changes: 110 additions & 5 deletions crates/re_types/src/blueprint/components/included_queries.rs

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

Loading

0 comments on commit 236599f

Please sign in to comment.