Skip to content

Commit

Permalink
fix copy-paste shenaniganeries
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Dec 17, 2024
1 parent 73af64c commit 901f8b1
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 94 deletions.
39 changes: 18 additions & 21 deletions tests/python/release_checklist/check_blueprint_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,31 @@ def log_plots() -> None:
cos_of_t = cos(float(t) / 10.0)
rr.log("plots/cos", rr.Scalar(cos_of_t))

rr.send_blueprint(
rrb.Blueprint(
rrb.Grid(
rrb.TextDocumentView(origin="readme", name="Instructions"),
rrb.TimeSeriesView(
name="Plots",
defaults=[rr.components.Color([0, 0, 255])],
overrides={
"plots/cos": [
rrb.VisualizerOverrides("SeriesPoint"),
rr.components.Color([0, 255, 0]),
# TODDO(#6670): This should just be `rr.components.MarkerShape.Cross`
rr.components.MarkerShapeBatch("cross"),
],
},
),
)
)
)


def run(args: Namespace) -> None:
rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4())

log_readme()
log_plots()

rr.send_blueprint(rr.blueprint.Blueprint(auto_layout=True, auto_views=True), make_active=True, make_default=True)
blueprint = rrb.Blueprint(
rrb.Grid(
rrb.TextDocumentView(origin="readme", name="Instructions"),
rrb.TimeSeriesView(
name="Plots",
defaults=[rr.components.Color([0, 0, 255])],
overrides={
"plots/cos": [
rrb.VisualizerOverrides("SeriesPoint"),
rr.components.Color([0, 255, 0]),
# TODDO(#6670): This should just be `rr.components.MarkerShape.Cross`
rr.components.MarkerShapeBatch("cross"),
],
},
),
)
)
rr.send_blueprint(blueprint, make_active=True, make_default=True)


if __name__ == "__main__":
Expand Down
117 changes: 57 additions & 60 deletions tests/python/release_checklist/check_overrides_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ def log_boxes() -> None:
rr.Arrows2D(origins=[[-2.0, 0.0], [0.0, 0.0], [2.0, 0.0]], vectors=[[-2.0, 1.0], [0.0, 2.0], [2.0, 1.0]]),
)


def run(args: Namespace) -> None:
rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4())

log_readme()
log_boxes()

visual_bounds = rrb.VisualBounds2D(x_range=[-5.5, 5.5], y_range=[-3.0, 3.0])
overrides = {
"arrows": [
Expand All @@ -87,70 +94,60 @@ def log_boxes() -> None:
rr.components.TextBatch(["TeenyYellow", "AverageCyan", "GigaPurple"]),
]

rr.send_blueprint(
rrb.Blueprint(
rrb.Grid(
rrb.TextDocumentView(origin="readme", name="Instructions"),
rrb.Vertical(
rrb.Spatial2DView(
name="1) Overrides, logged values & defaults",
visual_bounds=visual_bounds,
overrides=overrides,
defaults=defaults,
),
rrb.Spatial2DView(
name="2) Logged values & defaults",
visual_bounds=visual_bounds,
defaults=defaults,
),
rrb.Spatial2DView(
name="3) Logged values only",
visual_bounds=visual_bounds,
),
blueprint = rrb.Blueprint(
rrb.Grid(
rrb.TextDocumentView(origin="readme", name="Instructions"),
rrb.Vertical(
rrb.Spatial2DView(
name="1) Overrides, logged values & defaults",
visual_bounds=visual_bounds,
overrides=overrides,
defaults=defaults,
),
rrb.Spatial2DView(
name="2) Logged values & defaults",
visual_bounds=visual_bounds,
defaults=defaults,
),
rrb.Spatial2DView(
name="3) Logged values only",
visual_bounds=visual_bounds,
),
),
rrb.Vertical(
rrb.Spatial2DView(
name="What you should get after removing overrides from 1)",
visual_bounds=visual_bounds,
defaults=defaults,
),
rrb.Spatial2DView(
name="What you should get after removing defaults from 2)",
visual_bounds=visual_bounds,
),
rrb.Vertical(
rrb.Spatial2DView(
name="What you should get after removing overrides from 1)",
visual_bounds=visual_bounds,
defaults=defaults,
),
rrb.Spatial2DView(
name="What you should get after removing defaults from 2)",
visual_bounds=visual_bounds,
),
rrb.Spatial2DView(
name="What you should get after adding overrides & defaults to 3)",
visual_bounds=visual_bounds,
overrides={
"arrows": [
rrb.VisualizerOverrides([
rrb.visualizers.Arrows2D,
rrb.visualizers.Points2D,
]),
rr.components.Color([255, 255, 255]),
rr.components.Radius(0.1),
rr.components.Text("Cerberus"),
rr.components.Position2D([0.0, 0.0]),
]
},
),
rrb.Spatial2DView(
name="What you should get after adding overrides & defaults to 3)",
visual_bounds=visual_bounds,
overrides={
"arrows": [
rrb.VisualizerOverrides([
rrb.visualizers.Arrows2D,
rrb.visualizers.Points2D,
]),
rr.components.Color([255, 255, 255]),
rr.components.Radius(0.1),
rr.components.Text("Cerberus"),
rr.components.Position2D([0.0, 0.0]),
]
},
),
grid_columns=3,
column_shares=[1, 1, 1],
),
rrb.BlueprintPanel(state="collapsed"),
rrb.TimePanel(state="collapsed"),
)
grid_columns=3,
column_shares=[1, 1, 1],
),
rrb.BlueprintPanel(state="collapsed"),
rrb.TimePanel(state="collapsed"),
)


def run(args: Namespace) -> None:
rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4())

log_readme()
log_boxes()

rr.send_blueprint(rr.blueprint.Blueprint(auto_layout=True, auto_views=True), make_active=True, make_default=True)
rr.send_blueprint(blueprint, make_active=True, make_default=True)


if __name__ == "__main__":
Expand Down
24 changes: 11 additions & 13 deletions tests/python/release_checklist/check_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,19 @@ def run(args: Namespace) -> None:
static=True, # Static, so it shows up in the "video_time" timeline!
)

rr.send_blueprint(
rrb.Blueprint(
rrb.Grid(
rrb.TextDocumentView(origin="readme", name="Instructions"),
rrb.Spatial3DView(origin="/", name="AV1 frustum", contents="av1"),
rrb.Spatial2DView(origin="av1", name="AV1"),
rrb.Spatial2DView(origin="h264", name="H.264"),
rrb.Spatial2DView(origin="h265", name="H.265"),
rrb.Spatial2DView(origin="vp9", name="VP9"),
),
rrb.TimePanel(state="collapsed"),
)
blueprint = rrb.Blueprint(
rrb.Grid(
rrb.TextDocumentView(origin="readme", name="Instructions"),
rrb.Spatial3DView(origin="/", name="AV1 frustum", contents="av1"),
rrb.Spatial2DView(origin="av1", name="AV1"),
rrb.Spatial2DView(origin="h264", name="H.264"),
rrb.Spatial2DView(origin="h265", name="H.265"),
rrb.Spatial2DView(origin="vp9", name="VP9"),
),
rrb.TimePanel(state="collapsed"),
)

rr.send_blueprint(rr.blueprint.Blueprint(auto_layout=True, auto_views=True), make_active=True, make_default=True)
rr.send_blueprint(blueprint, make_active=True, make_default=True)


if __name__ == "__main__":
Expand Down

0 comments on commit 901f8b1

Please sign in to comment.