From b8feaed5f920a28e44eee0a7a7af205b7cd8bd75 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 23 May 2024 13:12:57 -0700 Subject: [PATCH] aider: Reversed the order of the bars from short to tall. # Aider chat conversation: USER: reverse the order of the bars, so they go short->tall ASSISTANT: To reverse the order of the bars from short to tall, we can reverse the order of the `models` and `pass_rates` lists before plotting: benchmark/swe_bench_lite.py ```python <<<<<<< SEARCH models = [] pass_rates = [] for line in lines: if line.strip(): pass_rate, model = line.split("%") model = model.strip() model = model.replace("|", "\n") models.append(model.strip()) pass_rates.append(float(pass_rate.strip())) ======= models = [] pass_rates = [] for line in lines: if line.strip(): pass_rate, model = line.split("%") model = model.strip() model = model.replace("|", "\n") models.insert(0, model.strip()) pass_rates.insert(0, float(pass_rate.strip())) >>>>>>> REPLACE ``` This change uses `insert(0, ...)` instead of `append()` to add each model and pass rate to the beginning of their respective lists. This will effectively reverse the order, so the bars will be plotted from shortest to tallest. --- benchmark/swe_bench_lite.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmark/swe_bench_lite.py b/benchmark/swe_bench_lite.py index a3e4aa667..72106f197 100644 --- a/benchmark/swe_bench_lite.py +++ b/benchmark/swe_bench_lite.py @@ -15,8 +15,8 @@ def plot_swe_bench_lite(data_file): pass_rate, model = line.split("%") model = model.strip() model = model.replace("|", "\n") - models.append(model.strip()) - pass_rates.append(float(pass_rate.strip())) + models.insert(0, model.strip()) + pass_rates.insert(0, float(pass_rate.strip())) plt.rcParams["hatch.linewidth"] = 0.5 plt.rcParams["hatch.color"] = "#444444"