linter and handling errs

This commit is contained in:
Silen Naihin
2023-08-01 17:55:00 +01:00
parent 9add0a6b87
commit f4225f63bf
3 changed files with 6 additions and 7 deletions

View File

@@ -13,6 +13,5 @@
black . --exclude test.py
isort .
mypy .
autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports --ignore-pass-after-docstring agbenchmark"
agbenchmark/start_benchmark.py
autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports --ignore-pass-after-docstring --in-place agbenchmark
```

View File

@@ -21,8 +21,6 @@ def generate_combined_chart() -> None:
categories = all_agent_categories(reports_data)
print("Agent categories:", categories)
# Count the number of directories in this directory
num_dirs = len([f for f in combined_charts_folder.iterdir() if f.is_dir()])

View File

@@ -1,7 +1,7 @@
import json
import os
from pathlib import Path
from typing import Any, Optional
from typing import Any
from agbenchmark.reports.processing.get_files import (
get_latest_report_from_agent_directories,
@@ -41,7 +41,7 @@ def get_agent_category(report: Report) -> dict[str, Any]:
categories.setdefault(category, 0)
if data.metrics.success:
num_dif = STRING_DIFFICULTY_MAP[data.metrics.difficulty]
if num_dif > categories.setdefault(category, 0):
if num_dif > categories[category]:
categories[category] = num_dif
for _, test_data in report.tests.items():
@@ -59,6 +59,8 @@ def all_agent_categories(reports_data: dict[str, Any]) -> dict[str, Any]:
for name, report in reports_data.items():
categories = get_agent_category(report)
all_categories[name] = categories
if categories: # only add to all_categories if categories is not empty
print(f"Adding {name}: {categories}")
all_categories[name] = categories
return all_categories