@@ -336,25 +336,25 @@ def get_summary_df(log_folders: list[str], hours: int | None = None) -> tuple[di
336
336
else :
337
337
v ["script_time" ] = None
338
338
339
- exp_gen_time = timedelta ()
340
- coding_time = timedelta ()
341
- running_time = timedelta ()
342
- all_time = timedelta ()
343
339
times_info = load_times_info (Path (lf ) / k )
340
+
341
+ exp_gen_time = coding_time = running_time = timedelta ()
342
+ start_times , end_times = [], []
343
+
344
344
for loop_times in times_info .values ():
345
345
for step_name , step_time in loop_times .items ():
346
- step_duration = step_time ["end_time" ] - step_time ["start_time" ]
346
+ duration = step_time ["end_time" ] - step_time ["start_time" ]
347
+ start_times .append (step_time ["start_time" ])
348
+ end_times .append (step_time ["end_time" ])
349
+
347
350
if step_name == "exp_gen" :
348
- exp_gen_time += step_duration
349
- all_time += step_duration
351
+ exp_gen_time += duration
350
352
elif step_name == "coding" :
351
- coding_time += step_duration
352
- all_time += step_duration
353
+ coding_time += duration
353
354
elif step_name == "running" :
354
- all_time += step_duration
355
- running_time += step_duration
356
- elif step_name in ["feedback" , "record" ]:
357
- all_time += step_duration
355
+ running_time += duration
356
+
357
+ all_time = (max (end_times ) - min (start_times )) if start_times else timedelta ()
358
358
v ["exec_time" ] = str (all_time ).split ("." )[0 ]
359
359
v ["exp_gen_time" ] = str (exp_gen_time ).split ("." )[0 ]
360
360
v ["coding_time" ] = str (coding_time ).split ("." )[0 ]
0 commit comments