Lee Mracek | 3e16a86 | 2019-01-24 11:15:36 -0500 | [diff] [blame] | 1 | package(default_visibility = ["//visibility:public"]) |
| 2 | |
James Kuszmaul | 61a971f | 2020-01-01 15:06:18 -0800 | [diff] [blame] | 3 | load("@com_google_protobuf//:protobuf.bzl", "py_proto_library") |
| 4 | |
Lee Mracek | 3e16a86 | 2019-01-24 11:15:36 -0500 | [diff] [blame] | 5 | py_binary( |
| 6 | name = "plot_action", |
| 7 | srcs = [ |
James Kuszmaul | 41fa78a | 2019-12-14 20:53:14 -0800 | [diff] [blame] | 8 | "logentry.py", |
Austin Schuh | 8e17be9 | 2019-12-24 09:32:11 -0800 | [diff] [blame] | 9 | "logreader.py", |
| 10 | "plot_action.py", |
| 11 | "plotter.py", |
Lee Mracek | 3e16a86 | 2019-01-24 11:15:36 -0500 | [diff] [blame] | 12 | ], |
| 13 | legacy_create_init = False, |
| 14 | restricted_to = ["//tools:k8"], |
| 15 | deps = [ |
| 16 | ":python_init", |
James Kuszmaul | 910f92b | 2020-01-01 15:30:38 -0800 | [diff] [blame] | 17 | "@matplotlib_repo//:matplotlib2.7", |
Lee Mracek | 3e16a86 | 2019-01-24 11:15:36 -0500 | [diff] [blame] | 18 | ], |
| 19 | ) |
| 20 | |
| 21 | py_library( |
| 22 | name = "python_init", |
| 23 | srcs = ["__init__.py"], |
| 24 | deps = ["//frc971:python_init"], |
| 25 | ) |
James Kuszmaul | 7daef36 | 2019-12-31 18:28:17 -0800 | [diff] [blame] | 26 | |
| 27 | cc_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 | |
| 43 | py_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 Kuszmaul | 61a971f | 2020-01-01 15:06:18 -0800 | [diff] [blame] | 53 | |
| 54 | py_proto_library( |
| 55 | name = "plot_config_proto", |
| 56 | srcs = ["plot_config.proto"], |
| 57 | ) |
| 58 | |
| 59 | py_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 Kuszmaul | 469fd4e | 2020-01-01 15:49:10 -0800 | [diff] [blame] | 72 | |
| 73 | py_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 | ) |