mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
aider: Plot the results using pylab
, importing it at the beginning of the script and modifying the history
function to display an area graph of aider_lines
and total_lines
over time.
# Aider chat conversation: USER: is pylab to plot the results. x-axis is commit number. area graph showing aider_lines and total_lines over time ASSISTANT: To plot the results using `pylab`, we need to: 1. Import `pylab` at the beginning of the script. 2. Modify the `history` function to collect the data and plot it. Here are the *SEARCH/REPLACE* blocks: scripts/blame.py ```python <<<<<<< SEARCH from pathlib import Path ======= from pathlib import Path import pylab as plt >>>>>>> REPLACE ``` scripts/blame.py ```python <<<<<<< SEARCH dump(results) ======= dump(results) # Plotting the results x = [i for i, _, _, _ in results] aider_lines = [aider_lines for _, aider_lines, _, _ in results] total_lines = [total_lines for _, _, total_lines, _ in results] plt.fill_between(x, aider_lines, label='Aider Lines', color='skyblue', alpha=0.5) plt.fill_between(x, total_lines, label='Total Lines', color='lightgreen', alpha=0.5) plt.xlabel('Commit Number') plt.ylabel('Lines of Code') plt.title('Aider Lines and Total Lines Over Time') plt.legend() plt.show() >>>>>>> REPLACE ```
This commit is contained in:
parent
a399b99d49
commit
eff8aea116
1 changed files with 14 additions and 0 deletions
|
@ -4,6 +4,7 @@ import tempfile
|
|||
import sys
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
import pylab as plt
|
||||
from aider.dump import dump
|
||||
|
||||
def get_lines_with_commit_hash(filename, aider_commits, git_dname, verbose=False):
|
||||
|
@ -134,6 +135,19 @@ def history():
|
|||
|
||||
dump(results)
|
||||
|
||||
# Plotting the results
|
||||
x = [i for i, _, _, _ in results]
|
||||
aider_lines = [aider_lines for _, aider_lines, _, _ in results]
|
||||
total_lines = [total_lines for _, _, total_lines, _ in results]
|
||||
|
||||
plt.fill_between(x, aider_lines, label='Aider Lines', color='skyblue', alpha=0.5)
|
||||
plt.fill_between(x, total_lines, label='Total Lines', color='lightgreen', alpha=0.5)
|
||||
plt.xlabel('Commit Number')
|
||||
plt.ylabel('Lines of Code')
|
||||
plt.title('Aider Lines and Total Lines Over Time')
|
||||
plt.legend()
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue