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.
This commit is contained in:
Paul Gauthier 2024-05-23 13:12:57 -07:00
parent bfe91ae191
commit b8feaed5f9

View file

@ -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"