diff --git a/tests/python/release_checklist/check_context_menu_add_entity_to_new_space_view.py b/tests/python/release_checklist/check_context_menu_add_entity_to_new_space_view.py index 15407e44c62f..e90604396a0d 100644 --- a/tests/python/release_checklist/check_context_menu_add_entity_to_new_space_view.py +++ b/tests/python/release_checklist/check_context_menu_add_entity_to_new_space_view.py @@ -7,19 +7,19 @@ import numpy as np import rerun as rr +import rerun.blueprint as rrb README = """ # Context Menu - Add entity to new space view -## Blueprint tree +#### Blueprint tree -* Reset the blueprint. -* Expend all space views and data result. +* "Expand all" on the Vertical containers. * Right-click on the `boxes3d` entity and select "Add to new space view" -> "3D". Check a new space view is created _and selected_ with the boxes3d entity and origin set to root. * In each space view, right-click on the leaf entity, and check that "Add to new space view" recommends at least space views of the same kind. * Select both the `boxes3d` entity and the `text_logs` entity. Check no space view is recommended (except Dataframe if enabled). -## Streams tree +#### Streams tree * Right-click on the `bars` entity and check that a Bar Plot space view can successfully be created. """ @@ -29,6 +29,22 @@ def log_readme() -> None: rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), timeless=True) +def blueprint() -> rrb.BlueprintLike: + return rrb.Viewport( + rrb.Horizontal( + rrb.TextDocumentView(origin="readme"), + rrb.Vertical( + rrb.Spatial3DView(origin="/boxes3d"), + rrb.Spatial2DView(origin="/boxes2d"), + rrb.TextLogView(origin="/text_logs"), + rrb.BarChartView(origin="/bars"), + rrb.TensorView(origin="/tensor"), + ), + column_shares=[2, 1], + ) + ) + + def log_some_space_views() -> None: rr.set_time_sequence("frame_nr", 0) @@ -44,7 +60,7 @@ def log_some_space_views() -> None: def run(args: Namespace) -> None: - rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4()) + rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4(), blueprint=blueprint()) log_readme() log_some_space_views() diff --git a/tests/python/release_checklist/check_context_menu_collapse_expand_all.py b/tests/python/release_checklist/check_context_menu_collapse_expand_all.py index c5e74b16a359..141fd1169b52 100644 --- a/tests/python/release_checklist/check_context_menu_collapse_expand_all.py +++ b/tests/python/release_checklist/check_context_menu_collapse_expand_all.py @@ -5,13 +5,13 @@ from uuid import uuid4 import rerun as rr +import rerun.blueprint as rrb README = """ # Context Menu - Add entity to new space view ## Blueprint tree -* Reset the blueprint. * Right-click on Viewport and select "Collapse all". Check everything is collapsed by manually expending everything. * Right-click on Viewport and select "Collapse all" and then "Expend all". Check everything is expanded. @@ -30,17 +30,30 @@ def log_readme() -> None: rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), timeless=True) -def log_some_space_views() -> None: - # TODO(ab): add a deep-ish container hierarchy blueprint for more collapse/expand fun +def blueprint() -> rrb.BlueprintLike: + return rrb.Viewport( + rrb.Horizontal( + rrb.TextDocumentView(origin="readme"), + rrb.Vertical( + rrb.Horizontal( + rrb.Vertical( + rrb.Spatial3DView(origin="/"), + ) + ) + ), + column_shares=[2, 1], + ) + ) - rr.set_time_sequence("frame_nr", 0) +def log_some_space_views() -> None: + rr.set_time_sequence("frame_nr", 0) rr.log("/", rr.Boxes3D(centers=[0, 0, 0], half_sizes=[1, 1, 1])) rr.log("/world/robot/arm/actuator/thing", rr.Boxes3D(centers=[0.5, 0, 0], half_sizes=[0.1, 0.1, 0.1])) def run(args: Namespace) -> None: - rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4()) + rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4(), blueprint=blueprint()) log_readme() log_some_space_views() diff --git a/tests/python/release_checklist/check_context_menu_invalid_sub_container.py b/tests/python/release_checklist/check_context_menu_invalid_sub_container.py index 53b92e31fb8d..d8bf755cd0cb 100644 --- a/tests/python/release_checklist/check_context_menu_invalid_sub_container.py +++ b/tests/python/release_checklist/check_context_menu_invalid_sub_container.py @@ -5,22 +5,14 @@ from uuid import uuid4 import rerun as rr +import rerun.blueprint as rrb README = """ # Context Menu - Invalid sub-container kind -## Preparation -TODO(ab): automate this with blueprints - -- Reset the blueprint -- Add a Horizontal container and a Vertical container in the viewport, and move one space view into each. - - -## Checks - -* Single-select a horizontal container, check that it disallow adding a horizontal container inside it. -* Same for a vertical container. +* Single-select the horizontal container, check that it disallow adding a horizontal container inside it. +* Same for the vertical container. * Single select a space view inside a horizontal container, check that it disallow moving to a new horizontal container. * Same for a space view inside a vertical container. """ @@ -30,6 +22,24 @@ def log_readme() -> None: rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), timeless=True) +def blueprint() -> rrb.BlueprintLike: + return rrb.Viewport( + rrb.Horizontal( + rrb.TextDocumentView(origin="readme"), + rrb.Grid( + rrb.Vertical( + rrb.Spatial3DView(origin="/"), + ), + rrb.Horizontal( + rrb.Spatial2DView(origin="/"), + ), + grid_columns=1, + ), + column_shares=[2, 1], + ) + ) + + def log_some_space_views() -> None: rr.set_time_sequence("frame_nr", 0) @@ -38,7 +48,7 @@ def log_some_space_views() -> None: def run(args: Namespace) -> None: - rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4()) + rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4(), blueprint=blueprint()) log_readme() log_some_space_views() diff --git a/tests/python/release_checklist/check_context_menu_multi_selection.py b/tests/python/release_checklist/check_context_menu_multi_selection.py index 0b7b361fd5c5..e8b5afd22e61 100644 --- a/tests/python/release_checklist/check_context_menu_multi_selection.py +++ b/tests/python/release_checklist/check_context_menu_multi_selection.py @@ -5,69 +5,57 @@ from uuid import uuid4 import rerun as rr +import rerun.blueprint as rrb README = """ # Context Menu - Multi-selection - -## Preparation - -TODO(ab): automate this with blueprints - -- Reset the blueprint -- Add a Horizontal container in the viewport and move both the 2D and 3D space view into it - - -## Checks - For each of the multi-selection below, check the context menu content as per the following table. ```plaintext +========================================================== ITEMS CONTEXT MENU CONTENT - - +========================================================== 2x Space views Hide all Remove + Expand all Collapse all - Move to new Container - -+ Horizontal container Hide all + Move to new Container +---------------------------------------------------------- ++ Vertical container Hide all Remove + Expand all Collapse all - Move to new Container - + Move to new Container +---------------------------------------------------------- + Viewport Hide all + Expand all Collapse all - - - --deselect all-- - - +========================================================== Space view + 'box2d' data result Hide all Remove + Expand all Collapse all - - - --deselect all-- - - +========================================================== 'box2d' data result Hide all -+ 'box3d' entity (streams tree) Expand all ++ 'box3d' entity (streams tree) + Expand all Collapse all - Add to new Space View - + Add to new Space View +---------------------------------------------------------- + some component Hide all + Expand all Collapse all - +========================================================== ``` """ @@ -76,6 +64,19 @@ def log_readme() -> None: rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), timeless=True) +def blueprint() -> rrb.BlueprintLike: + return rrb.Viewport( + rrb.Horizontal( + rrb.TextDocumentView(origin="readme"), + rrb.Vertical( + rrb.Spatial3DView(origin="/"), + rrb.Spatial2DView(origin="/"), + ), + column_shares=[2, 1], + ) + ) + + def log_some_space_views() -> None: rr.set_time_sequence("frame_nr", 0) @@ -84,7 +85,7 @@ def log_some_space_views() -> None: def run(args: Namespace) -> None: - rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4()) + rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4(), blueprint=blueprint()) log_readme() log_some_space_views() diff --git a/tests/python/release_checklist/check_context_menu_single_selection.py b/tests/python/release_checklist/check_context_menu_single_selection.py index 9b11958bb713..a197508638e3 100644 --- a/tests/python/release_checklist/check_context_menu_single_selection.py +++ b/tests/python/release_checklist/check_context_menu_single_selection.py @@ -5,20 +5,12 @@ from uuid import uuid4 import rerun as rr +import rerun.blueprint as rrb README = """ # Context Menu - Single Selection -## Preparation - -TODO(ab): automate this with blueprints - -- Reset the blueprint -- Add a Horizontal container in the viewport and move the 3D space view into it -- Right-click on the viewport and "Expand All" - - -## Streams tree +#### Streams tree - Right-click on various _unselected_ items, and check that: - It becomes selected as the context menu appears. @@ -26,58 +18,64 @@ ```plaintext -ITEM CONTEXT MENU CONTENT - - -'group/' entity Expand all - Collapse all - Add to new Space View - - -Component - +================================================= +ITEM CONTEXT MENU CONTENT +================================================= +'group/' entity Expand all + Collapse all + + Add to new Space View +------------------------------------------------- +Component +================================================= ``` -## Tile Title UI +#### Tile Title UI -- Multi-select the 3D space view and the Horizontal container in the Blueprint tree. +- Multi-select the 3D space view and the Vertical container in the Blueprint tree. - Right-click on the 3D space view tab title: - The selection is set to the space view _only_. - The context menu content is as per the following table. ```plaintext -ITEM CONTEXT MENU CONTENT +================================================= +ITEM CONTEXT MENU CONTENT +================================================= +space view (tab title) Hide + Remove + Expand all + Collapse all -space view (tab title) Hide (or Show, depending on visibility)d - Remove - Expand all - Collapse all - Clone - Move to new Container + Clone + Move to new Container +================================================= ``` -## Container Selection Panel child list +#### Container Selection Panel child list -- Select the Horizontal container. +- Select the Vertical container. - In the selection panel, right-click on the 3D space view, and check that: - The selection remains unchanged. - The context menu content is as per the following table. ```plaintext -ITEM CONTEXT MENU CONTENT +================================================= +ITEM CONTEXT MENU CONTENT +================================================= +space view (child list) Hide + Remove + Expand all + Collapse all -space view (child list) Hide (or Show, depending on visibility) - Remove - Expand all - Collapse all - Clone - Move to new Container + Clone + Move to new Container +================================================= ``` """ @@ -87,6 +85,19 @@ def log_readme() -> None: rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), timeless=True) +def blueprint() -> rrb.BlueprintLike: + return rrb.Viewport( + rrb.Horizontal( + rrb.TextDocumentView(origin="readme"), + rrb.Vertical( + rrb.Spatial3DView(origin="/"), + rrb.Spatial2DView(origin="/"), + ), + column_shares=[2, 1], + ) + ) + + def log_some_space_views() -> None: rr.set_time_sequence("frame_nr", 0) @@ -94,7 +105,7 @@ def log_some_space_views() -> None: def run(args: Namespace) -> None: - rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4()) + rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4(), blueprint=blueprint()) log_readme() log_some_space_views() diff --git a/tests/python/release_checklist/check_context_menu_single_selection_blueprint_tree.py b/tests/python/release_checklist/check_context_menu_single_selection_blueprint_tree.py index 40c1a4e03a80..87c329a2dd76 100644 --- a/tests/python/release_checklist/check_context_menu_single_selection_blueprint_tree.py +++ b/tests/python/release_checklist/check_context_menu_single_selection_blueprint_tree.py @@ -5,64 +5,60 @@ from uuid import uuid4 import rerun as rr +import rerun.blueprint as rrb README = """ # Context Menu - Single Selection in the Blueprint tree -## Preparation - -TODO(ab): automate this with blueprints - -- Reset the blueprint -- Add a Horizontal container in the viewport and move the 3D space view into it - Right-click on the viewport and "Expand All" - - -## Checks - - Right-click on various _unselected_ items, and check that: - It becomes selected as the context menu appears. - The context menu content is as per the following table. ```plaintext -ITEM CONTEXT MENU CONTENT - +================================================================== +ITEM CONTEXT MENU CONTENT +================================================================== +Viewport Expand all + Collapse all -Viewport Expand all - Collapse all - Add Container - Add Space View + Add Container + Add Space View +------------------------------------------------------------------ +Container Hide (or Show, depending on visibility) + Remove + Expand all + Collapse all -Container Hide (or Show, depending on visibility) - Remove - Expand all - Collapse all - Add Container - Add Space View - Move to new Container + Add Container + Add Space View + Move to new Container +------------------------------------------------------------------ +Space View Hide (or Show, depending on visibility) + Remove -Space View Hide (or Show, depending on visibility) - Remove - Expand all - Collapse all - Clone - Move to new Container + Expand all + Collapse all + Clone -'group' Data Result Hide (or Show, depending on visibility) - Remove - Expand all - Collapse all - Add to new Space View + Move to new Container +------------------------------------------------------------------ +'group' Data Result Hide (or Show, depending on visibility) + Remove + Expand all + Collapse all -'boxes3d' Data Result Hide (or Show, depending on visibility) - Remove - Add to new Space View + Add to new Space View +------------------------------------------------------------------ +'boxes3d' Data Result Hide (or Show, depending on visibility) + Remove + Add to new Space View ``` """ @@ -72,6 +68,15 @@ def log_readme() -> None: rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), timeless=True) +def blueprint() -> rrb.BlueprintLike: + return rrb.Viewport( + rrb.Horizontal( + rrb.TextDocumentView(origin="readme"), + rrb.Vertical(rrb.Spatial3DView(origin="/")), + ) + ) + + def log_some_space_views() -> None: rr.set_time_sequence("frame_nr", 0) @@ -79,7 +84,7 @@ def log_some_space_views() -> None: def run(args: Namespace) -> None: - rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4()) + rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4(), blueprint=blueprint()) log_readme() log_some_space_views() diff --git a/tests/python/release_checklist/check_context_menu_suggested_origin.py b/tests/python/release_checklist/check_context_menu_suggested_origin.py index 6e29e336aeb0..33d1bed9b34b 100644 --- a/tests/python/release_checklist/check_context_menu_suggested_origin.py +++ b/tests/python/release_checklist/check_context_menu_suggested_origin.py @@ -7,25 +7,35 @@ import numpy as np import rerun as rr +import rerun.blueprint as rrb README = """ # Context Menu - Test the origin selection heuristics -Right click on each of the following entities and check that for the given space view class, the resulting suggested origin is as expected. +Repeat these steps for each of the following entities and space view class: +- right-click the entity (either in the blueprint or streams tree) +- select "Add to new Space View" and create the space view of the listed class +- check that the created space view has the expected origin +- delete the space view + + +check that for the given space view class, the resulting suggested origin is as expected. ```plaintext +=========================================================== ENTITY CLASS EXPECTED ORIGIN - +----------------------------------------------------------- / 3D / /world 3D /world /world/camera 3D /world /world/camera/image 3D /world /world/camera/keypoint 3D /world - +----------------------------------------------------------- /world 2D /world/camera 2D /world/camera/image 2D /world/camera/image /world/camera/keypoint 2D /world/camera/image +=========================================================== ``` """ @@ -34,13 +44,22 @@ def log_readme() -> None: rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), timeless=True) +def blueprint() -> rrb.BlueprintLike: + return rrb.Viewport( + rrb.Horizontal( + rrb.TextDocumentView(origin="readme"), + rrb.Spatial3DView(origin="/", contents="", name="root entity"), + column_shares=[2, 1], + ) + ) + + def log_some_space_views() -> None: rr.set_time_sequence("frame_nr", 0) rr.log("/", rr.Boxes3D(centers=[0, 0, 0], half_sizes=[1, 1, 1])) rr.log("/world", rr.ViewCoordinates.RIGHT_HAND_Y_DOWN, timeless=True) rr.log( "/world/camera/image", - # rr.Pinhole(fov_y=0.7853982, aspect_ratio=1, camera_xyz=rr.ViewCoordinates.RUB, resolution=[10, 10]), rr.Pinhole( resolution=[10, 10], focal_length=[4, 4], @@ -50,23 +69,18 @@ def log_some_space_views() -> None: rr.log("/world/camera/image", rr.Image(np.random.rand(10, 10, 3))) rr.log("/world/camera/image/keypoint", rr.Points2D(np.random.rand(10, 2) * 10, radii=0.5)) - for i in range(100): - rr.set_time_sequence("frame_nr", i) - angle = 2 * math.pi * i / 100 - - rr.log( - "/world/camera", - rr.Transform3D( - rr.TranslationRotationScale3D( - translation=[math.cos(angle), math.sin(angle), 0], - rotation=rr.RotationAxisAngle(axis=[0, 0, 1], angle=angle), - ) - ), - ) + rr.log( + "/world/camera", + rr.Transform3D( + rr.TranslationRotationScale3D( + rotation=rr.RotationAxisAngle(axis=[0, 0, 1], angle=math.pi / 2), + ) + ), + ) def run(args: Namespace) -> None: - rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4()) + rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4(), blueprint=blueprint()) log_readme() log_some_space_views() diff --git a/tests/python/release_checklist/check_focus.py b/tests/python/release_checklist/check_focus.py index 61b590d64242..bb37018df0d5 100644 --- a/tests/python/release_checklist/check_focus.py +++ b/tests/python/release_checklist/check_focus.py @@ -5,26 +5,15 @@ from uuid import uuid4 import rerun as rr +import rerun.blueprint as rrb README = """ # Focus checks -## Preparation - -TODO(ab): automate this with blueprints -TODO(ab): add lots of stuff via blueprint to make the tree more crowded and check scrolling - -- Reset the blueprint -- Clone the 3D space view such as to have 2 of them. - -## Checks - -- Collapse all in the blueprint tree and the streams view -- Double-click on the box in the first space view - - check corresponding space view expands and scrolls +- Double-click on a box in the first space view + - check ONLY the corresponding space view expands and scrolls - check the streams view expands and scrolls -- Collapse all in the blueprint tree. -- Double-click on the leaf "boxes3d" entity in the streams view, check both space views expand. +- Double-click on the leaf "boxes3d" entity in the streams view, check both space views expand (manual scrolling might be needed). """ @@ -32,9 +21,22 @@ def log_readme() -> None: rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), timeless=True) +def blueprint() -> rrb.BlueprintLike: + return rrb.Viewport( + rrb.Horizontal( + rrb.Tabs(*[rrb.TextDocumentView(origin="readme") for _ in range(100)]), + rrb.Vertical(rrb.Spatial3DView(origin="/", name="SV1"), rrb.Spatial3DView(origin="/", name="SV2")), + column_shares=[1, 2], + ) + ) + + def log_some_space_views() -> None: rr.set_time_sequence("frame_nr", 0) + for i in range(500): + rr.log(f"a_entity_{i}", rr.AnyValues(empty=0)) + rr.log( "/objects/boxes/boxes3d", rr.Boxes3D(centers=[[0, 0, 0], [1, 1.5, 1.15], [3, 2, 1]], half_sizes=[0.5, 1, 0.5] * 3), @@ -42,7 +44,7 @@ def log_some_space_views() -> None: def run(args: Namespace) -> None: - rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4()) + rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4(), blueprint=blueprint()) log_readme() log_some_space_views()