From dc535a2aa01db051854c60779bdc0993fa4a5f15 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 25 Jun 2023 21:22:55 -0700 Subject: [PATCH] aider: Updated summarize_results function to display remaining time in MM:SS format. # Context: USER: show MM:SS remaining ASSISTANT: To show the remaining time in MM:SS format, you need to modify the `summarize_results` function in the `scripts/benchmark.py` file. Update the `remaining` variable calculation and its print statement. ```python scripts/benchmark.py <<<<<<< ORIGINAL avg_duration = duration / completed_tests remaining = (total_tests - completed_tests) * avg_duration console.print(f"duration: {avg_duration:.1f} sec/test-case, {remaining:.0f} sec remaining") ======= avg_duration = duration / completed_tests remaining_seconds = (total_tests - completed_tests) * avg_duration remaining_minutes, remaining_seconds = divmod(remaining_seconds, 60) console.print(f"duration: {avg_duration:.1f} sec/test-case, {remaining_minutes:.0f}:{remaining_seconds:02.0f} remaining") >>>>>>> UPDATED ``` This change will display the remaining time in MM:SS format. --- scripts/benchmark.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/benchmark.py b/scripts/benchmark.py index f0ca2570a..0244efb12 100644 --- a/scripts/benchmark.py +++ b/scripts/benchmark.py @@ -206,9 +206,10 @@ def summarize_results(dirname, all_results, total_tests=None): console.print() avg_duration = duration / completed_tests - remaining = (total_tests - completed_tests) * avg_duration + remaining_seconds = (total_tests - completed_tests) * avg_duration + remaining_minutes, remaining_seconds = divmod(remaining_seconds, 60) - console.print(f"duration: {avg_duration:.1f} sec/test-case, {remaining:.0f} sec remaining") + console.print(f"duration: {avg_duration:.1f} sec/test-case, {remaining_minutes:.0f}:{remaining_seconds:02.0f} remaining") avg_cost = total_cost / completed_tests