File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1
- # .PHONY: help clean% check% format% docs% lint test pyright playwright% install% testrail% coverage release
2
-
3
1
# Depend on `FORCE` to ensure the target is always run
4
2
FORCE :
5
3
@@ -82,7 +80,7 @@ PYTEST = $(SITE_PACKAGES)/pytest
82
80
COVERAGE = $(SITE_PACKAGES ) /coverage
83
81
PYRIGHT = $(SITE_PACKAGES ) /pyright
84
82
PLAYWRIGHT = $(SITE_PACKAGES ) /playwright
85
- $(PYTEST ) $(COVERAGE ) $(PYRIGHT ) $(PLAYWRIGHT ) :
83
+ $(RUFF ) $( PYTEST ) $(COVERAGE ) $(PYRIGHT ) $(PLAYWRIGHT ) :
86
84
@$(MAKE ) install-deps
87
85
88
86
Original file line number Diff line number Diff line change 16
16
THRESHOLD_LOW = 0.5
17
17
THRESHOLD_LOW_COLOR = "rgb(193, 0, 0)"
18
18
19
+
20
+ def value_box_theme (score ):
21
+ if score > THRESHOLD_MID :
22
+ return "text-success"
23
+ elif score < THRESHOLD_LOW :
24
+ return "bg-danger"
25
+ else :
26
+ return "text-warning"
27
+
28
+
19
29
# Start a background thread that writes fake data to the SQLite database every second
20
30
scoredata .begin ()
21
31
@@ -195,13 +205,7 @@ def value_boxes():
195
205
ui .value_box (
196
206
model ,
197
207
ui .h2 (score ),
198
- theme = (
199
- "text-success"
200
- if score > THRESHOLD_MID
201
- else "text-warning"
202
- if score > THRESHOLD_LOW
203
- else "bg-danger"
204
- ),
208
+ theme = value_box_theme (score ),
205
209
)
206
210
for model , score in scores_by_model .items ()
207
211
],
You can’t perform that action at this time.
0 commit comments