@@ -58,7 +58,7 @@ def df():
58
58
params = [150 ],
59
59
)
60
60
# Convert timestamp to datetime object, which SQLite doesn't support natively
61
- tbl ["timestamp" ] = pd .to_datetime (tbl ["timestamp" ], utc = True )
61
+ tbl ["timestamp" ] = pd .to_datetime (tbl ["timestamp" ], utc = True , format = "ISO8601" )
62
62
# Create a short label for readability
63
63
tbl ["time" ] = tbl ["timestamp" ].dt .strftime ("%H:%M:%S" )
64
64
# Reverse order of rows
@@ -81,10 +81,7 @@ def read_time_period(from_time, to_time):
81
81
82
82
83
83
model_names = ["model_1" , "model_2" , "model_3" , "model_4" ]
84
- model_colors = {
85
- name : color
86
- for name , color in zip (model_names , px .colors .qualitative .D3 [0 : len (model_names )])
87
- }
84
+ model_colors = dict (zip (model_names , px .colors .qualitative .D3 [0 : len (model_names )]))
88
85
89
86
90
87
def app_ui (req ):
@@ -224,7 +221,7 @@ def plot_timeseries():
224
221
filtered_df (),
225
222
x = "time" ,
226
223
y = "score" ,
227
- labels = dict ( score = " accuracy") ,
224
+ labels = { " score" : " accuracy"} ,
228
225
color = "model" ,
229
226
color_discrete_map = model_colors ,
230
227
# The default for render_mode is "auto", which switches between
@@ -238,13 +235,13 @@ def plot_timeseries():
238
235
fig .add_hline (
239
236
THRESHOLD_LOW ,
240
237
line_dash = "dash" ,
241
- line = dict ( color = THRESHOLD_LOW_COLOR , width = 2 ) ,
238
+ line = { " color" : THRESHOLD_LOW_COLOR , " width" : 2 } ,
242
239
opacity = 0.3 ,
243
240
)
244
241
fig .add_hline (
245
242
THRESHOLD_MID ,
246
243
line_dash = "dash" ,
247
- line = dict ( color = THRESHOLD_MID_COLOR , width = 2 ) ,
244
+ line = { " color" : THRESHOLD_MID_COLOR , " width" : 2 } ,
248
245
opacity = 0.3 ,
249
246
)
250
247
@@ -260,7 +257,7 @@ def plot_dist():
260
257
facet_row = "model" ,
261
258
nbins = 20 ,
262
259
x = "score" ,
263
- labels = dict ( score = " accuracy") ,
260
+ labels = { " score" : " accuracy"} ,
264
261
color = "model" ,
265
262
color_discrete_map = model_colors ,
266
263
template = "simple_white" ,
@@ -269,13 +266,13 @@ def plot_dist():
269
266
fig .add_vline (
270
267
THRESHOLD_LOW ,
271
268
line_dash = "dash" ,
272
- line = dict ( color = THRESHOLD_LOW_COLOR , width = 2 ) ,
269
+ line = { " color" : THRESHOLD_LOW_COLOR , " width" : 2 } ,
273
270
opacity = 0.3 ,
274
271
)
275
272
fig .add_vline (
276
273
THRESHOLD_MID ,
277
274
line_dash = "dash" ,
278
- line = dict ( color = THRESHOLD_MID_COLOR , width = 2 ) ,
275
+ line = { " color" : THRESHOLD_MID_COLOR , " width" : 2 } ,
279
276
opacity = 0.3 ,
280
277
)
281
278
0 commit comments