-
Notifications
You must be signed in to change notification settings - Fork 394
/
Copy pathcheck_static_components_ui.py
74 lines (49 loc) · 2.28 KB
/
check_static_components_ui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from __future__ import annotations
import os
from argparse import Namespace
from uuid import uuid4
import rerun as rr
README = """\
# Static components
In the streams view, check the hover tooltips and selection panel for each `Position2D` components. They should both
display warnings/errors according to the following table:
```plaintext
==========================================================================
COMPONENT FEEDBACK
==========================================================================
static:Position2D -
static_overwrite:Position2D warning (orange): overridden 2 times
hybrid:Position2D error (red): 12 events logged on timelines
==========================================================================
```
"""
def log_readme() -> None:
rr.log("readme", rr.TextDocument(README, media_type=rr.MediaType.MARKDOWN), static=True)
def log_some_views() -> None:
rr.log("static", rr.Points2D([(0, 0), (1, 1), (2, 2)]), static=True)
# override static component
rr.log("static_overwrite", rr.Points2D([(0, 0), (1, 1), (2, 2)]), static=True)
rr.log("static_overwrite", rr.Points2D([(0, 0), (1, 1), (5, 2)]), static=True)
rr.log("static_overwrite", rr.Points2D([(0, 0), (1, 1), (10, 2)]), static=True)
# mixed time-full and static logs
rr.log("hybrid", rr.Points2D([(0, 0), (1, 1), (2, 2)]), static=True)
rr.set_time_seconds("time", 1.0)
rr.log("hybrid", rr.Points2D([(0, 0), (1, 1), (2, 2)]))
rr.set_time_seconds("time", 1.0)
rr.log("hybrid", rr.Points2D([(0, 0), (1, 1), (2, 2)]))
rr.set_time_seconds("time", 1.0)
rr.log("hybrid", rr.Points2D([(0, 0), (1, 1), (2, 2)]))
rr.disable_timeline("time")
rr.set_time_seconds("other_time", 10.0)
rr.log("hybrid", rr.Points2D([(0, 0), (1, 1), (2, 2)]))
def run(args: Namespace) -> None:
rr.script_setup(args, f"{os.path.basename(__file__)}", recording_id=uuid4())
log_readme()
log_some_views()
rr.send_blueprint(rr.blueprint.Blueprint(auto_layout=True, auto_views=True), make_active=True, make_default=True)
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description="Interactive release checklist")
rr.script_add_args(parser)
args = parser.parse_args()
run(args)