mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
fix: Handle missing attributes in show_stats and empty models
This commit is contained in:
parent
521841b447
commit
bddf6e9017
1 changed files with 13 additions and 4 deletions
|
@ -106,7 +106,11 @@ def show_stats(dirnames, graphs):
|
||||||
f"Warning: {row.dir_name} is incomplete: {row.completed_tests} of {row.total_tests}"
|
f"Warning: {row.dir_name} is incomplete: {row.completed_tests} of {row.total_tests}"
|
||||||
)
|
)
|
||||||
|
|
||||||
kind = (row.model, row.edit_format)
|
try:
|
||||||
|
kind = (row.model, row.edit_format)
|
||||||
|
except AttributeError:
|
||||||
|
return
|
||||||
|
|
||||||
if kind in seen:
|
if kind in seen:
|
||||||
dump(row.dir_name)
|
dump(row.dir_name)
|
||||||
dump(seen[kind])
|
dump(seen[kind])
|
||||||
|
@ -252,6 +256,7 @@ def main(
|
||||||
if languages:
|
if languages:
|
||||||
requested = set(lang.strip().lower() for lang in languages.split(","))
|
requested = set(lang.strip().lower() for lang in languages.split(","))
|
||||||
lang_dirs = [d for d in lang_dirs if d.name.lower() in requested]
|
lang_dirs = [d for d in lang_dirs if d.name.lower() in requested]
|
||||||
|
dump(lang_dirs)
|
||||||
if not lang_dirs:
|
if not lang_dirs:
|
||||||
print(f"No matching language directories found for: {languages}")
|
print(f"No matching language directories found for: {languages}")
|
||||||
return []
|
return []
|
||||||
|
@ -411,6 +416,9 @@ def show_diffs(dirnames):
|
||||||
def load_results(dirname):
|
def load_results(dirname):
|
||||||
dirname = Path(dirname)
|
dirname = Path(dirname)
|
||||||
all_results = []
|
all_results = []
|
||||||
|
# do this ai!
|
||||||
|
# add a --stats-languages switch that takes like java,cpp,python
|
||||||
|
# limit the glob here to those languages followed by /exercises/practice/*/.aider.results.json
|
||||||
for fname in dirname.glob("*/exercises/practice/*/.aider.results.json"):
|
for fname in dirname.glob("*/exercises/practice/*/.aider.results.json"):
|
||||||
try:
|
try:
|
||||||
results = json.loads(fname.read_text())
|
results = json.loads(fname.read_text())
|
||||||
|
@ -539,9 +547,10 @@ def summarize_results(dirname):
|
||||||
show("test_timeouts")
|
show("test_timeouts")
|
||||||
print(f" total_tests: {res.total_tests}")
|
print(f" total_tests: {res.total_tests}")
|
||||||
|
|
||||||
a_model = set(variants["model"]).pop()
|
if variants["model"]:
|
||||||
command = f"aider --model {a_model}"
|
a_model = set(variants["model"]).pop()
|
||||||
print(f" command: {command}")
|
command = f"aider --model {a_model}"
|
||||||
|
print(f" command: {command}")
|
||||||
|
|
||||||
print(f" date: {date}")
|
print(f" date: {date}")
|
||||||
print(" versions:", ",".join(versions))
|
print(" versions:", ",".join(versions))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue