fixing combined_graph

This commit is contained in:
Silen Naihin
2023-08-01 14:35:14 +01:00
parent b2507cd556
commit f195840d35
9 changed files with 20 additions and 8 deletions

View File

@@ -19,7 +19,7 @@ def generate_combined_chart() -> None:
reports_data = get_reports_data(str(all_agents_path))
categories = all_agent_categories(reports_data)
categories = all_agent_categories(reports_data, combined=True)
# 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

@@ -72,6 +72,11 @@ def save_combined_radar_chart(
np.degrees(angles[:-1]), (list(next(iter(categories.values())).keys()))
) # We use the first category to get the keys
highest_score = 7
# Set y-axis limit to 7
ax.set_ylim(top=highest_score)
# Move labels away from the plot
for label in labels:
label.set_position(
@@ -84,8 +89,8 @@ def save_combined_radar_chart(
ax.set_yticks([]) # Remove default yticks
# Manually create gridlines
for y in np.arange(0, norm.vmax + 1, 1):
if y != norm.vmax:
for y in np.arange(0, highest_score + 1, 1):
if y != highest_score:
ax.plot(
angles, [y] * len(angles), color="gray", linewidth=0.5, linestyle=":"
)

View File

@@ -1,7 +1,7 @@
import json
import os
from pathlib import Path
from typing import Any
from typing import Any, Optional
from agbenchmark.reports.processing.get_files import (
get_latest_report_from_agent_directories,
@@ -31,13 +31,17 @@ def get_reports_data(report_path: str) -> dict[str, Any]:
return reports_data
def get_agent_category(report: Report) -> dict[str, Any]:
def get_agent_category(
report: Report, combined: Optional[bool] = None
) -> dict[str, Any]:
categories: dict[str, Any] = {}
def get_highest_category_difficulty(data: Test) -> None:
for category in data.category:
if category == "interface" or category == "iterate":
continue
if combined:
categories.setdefault(category, 0)
if data.metrics.success:
num_dif = STRING_DIFFICULTY_MAP[data.metrics.difficulty]
if num_dif > categories.setdefault(category, 0):
@@ -53,11 +57,13 @@ def get_agent_category(report: Report) -> dict[str, Any]:
return categories
def all_agent_categories(reports_data: dict[str, Any]) -> dict[str, Any]:
def all_agent_categories(
reports_data: dict[str, Any], combined: Optional[bool] = None
) -> dict[str, Any]:
all_categories: dict[str, Any] = {}
for name, report in reports_data.items():
categories = get_agent_category(report)
categories = get_agent_category(report, combined)
all_categories[name] = categories
return all_categories

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

View File

@@ -0,0 +1 @@
{"Auto-GPT": "2023-08-01-12:47", "BabyAGI": "2023-08-01-12:50", "beebot": "2023-08-01-12:48", "gpt-engineer": "2023-08-01-12:47", "mini-agi": "2023-08-01-12:47", "smol-developer": "2023-08-01-12:46"}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB