Skip to content

Commit

Permalink
Add a release checklist for overrides, including VisualizerOverrides
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed Aug 27, 2024
1 parent 65d1d12 commit 3205236
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions tests/python/release_checklist/check_blueprint_overrides.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
from __future__ import annotations

import os
from argparse import Namespace
from uuid import uuid4

import rerun as rr
import rerun.blueprint as rrb

README = """\
# Blueprint overrides
This checks that overrides work as expected when sent via blueprint APIs.
Expected behavior:
* The `sin` plot should be a blue line (set via defaults)
* The `cos` plot should be a green points with cross markers (set via overrides)
"""


def log_readme() -> None:
rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), static=True)


def log_plots() -> None:
from math import cos, sin, tau

for t in range(0, int(tau * 2 * 10.0)):
rr.set_time_sequence("frame_nr", t)

sin_of_t = sin(float(t) / 10.0)
rr.log("plots/sin", rr.Scalar(sin_of_t))

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()


if __name__ == "__main__":
import argparse

parser = argparse.ArgumentParser(description="Interactive release checklist")
rr.script_add_args(parser)
args = parser.parse_args()
run(args)

0 comments on commit 3205236

Please sign in to comment.