blob: 2686bcd7fe66bdc8370fa748563b6ac59f8fbae7 [file] [log] [blame]
Lee Mracek3e16a862019-01-24 11:15:36 -05001package(default_visibility = ["//visibility:public"])
2
James Kuszmaul61a971f2020-01-01 15:06:18 -08003load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
4
Lee Mracek3e16a862019-01-24 11:15:36 -05005py_binary(
6 name = "plot_action",
7 srcs = [
James Kuszmaul41fa78a2019-12-14 20:53:14 -08008 "logentry.py",
Austin Schuh8e17be92019-12-24 09:32:11 -08009 "logreader.py",
10 "plot_action.py",
11 "plotter.py",
Lee Mracek3e16a862019-01-24 11:15:36 -050012 ],
13 legacy_create_init = False,
14 restricted_to = ["//tools:k8"],
15 deps = [
16 ":python_init",
James Kuszmaul910f92b2020-01-01 15:30:38 -080017 "@matplotlib_repo//:matplotlib2.7",
Lee Mracek3e16a862019-01-24 11:15:36 -050018 ],
19)
20
21py_library(
22 name = "python_init",
23 srcs = ["__init__.py"],
24 deps = ["//frc971:python_init"],
25)
James Kuszmaul7daef362019-12-31 18:28:17 -080026
27cc_binary(
28 name = "py_log_reader.so",
29 srcs = ["py_log_reader.cc"],
30 linkshared = True,
31 restricted_to = ["//tools:k8"],
32 deps = [
33 "//aos:configuration",
34 "//aos:json_to_flatbuffer",
35 "//aos/events:shm_event_loop",
36 "//aos/events:simulated_event_loop",
37 "//aos/events/logging:logger",
38 "@com_github_google_glog//:glog",
39 "@python_repo//:python3.5_lib",
40 ],
41)
42
43py_test(
44 name = "log_reader_test",
45 srcs = ["log_reader_test.py"],
46 data = [
47 ":py_log_reader.so",
48 "@sample_logfile//file",
49 ],
50 restricted_to = ["//tools:k8"],
51 deps = ["//aos:configuration_fbs_python"],
52)
James Kuszmaul61a971f2020-01-01 15:06:18 -080053
54py_proto_library(
55 name = "plot_config_proto",
56 srcs = ["plot_config.proto"],
57)
58
59py_binary(
60 name = "plot",
61 srcs = ["plot.py"],
62 data = [
63 ":py_log_reader.so",
64 ] + glob(["plot_configs/**"]),
65 restricted_to = ["//tools:k8"],
66 deps = [
67 ":plot_config_proto",
68 ":python_init",
69 "@matplotlib_repo//:matplotlib3",
70 ],
71)
James Kuszmaul469fd4e2020-01-01 15:49:10 -080072
73py_test(
74 name = "plot_test",
75 srcs = ["plot_test.py"],
76 data = [
77 "@sample_logfile//file",
78 ],
79 restricted_to = ["//tools:k8"],
80 deps = [":plot"],
81)