Skip to content
Snippets Groups Projects
Commit f3f3dd7b authored by gawen.ackerman's avatar gawen.ackerman :robot:
Browse files

REFACTOR : Export file into a folder with file's name

parent cbdcb981
No related branches found
No related tags found
No related merge requests found
SimulationGraph/Simulation-07-04-2025-11-46-11.json_simulation_analysis.png

106 KiB

# Simulation report
**File**: `Simulation-14-04-2025-10-14-58.json`
**Report generation date**: 2025-04-14 10:47:48
**Report generation date**: 2025-04-14 10:58:41
**Seed**: `723505677`
## Resume
......
......@@ -58,7 +58,12 @@ def plot_all_metrics(file_name):
axs[j].axis("off")
plt.tight_layout(rect=[0, 0.03, 1, 0.95])
output_path = os.path.join(OUTPUT_FOLDER_PATH, f"{file_name}_full_analysis.png")
file_base_name = os.path.splitext(file_name)[0]
output_dir = os.path.join(OUTPUT_FOLDER_PATH, file_base_name)
os.makedirs(output_dir, exist_ok=True)
output_path = os.path.join(output_dir, "full_analysis.png")
plt.savefig(output_path)
print(f"Graph saved to: {output_path}")
......
......@@ -108,7 +108,10 @@ def generate_md_report(file_name):
report_lines.extend(format_spawn_list("Collectibles", metadata.get("collectibles", [])))
report_lines.extend(format_spawn_list("Obstacles", metadata.get("obstacles", [])))
output_path = os.path.join(OUTPUT_FOLDER_PATH, f"{file_name}_report.md")
file_base_name = os.path.splitext(file_name)[0]
output_dir = os.path.join(OUTPUT_FOLDER_PATH, file_base_name)
os.makedirs(output_dir, exist_ok=True)
output_path = os.path.join(output_dir, "report.md")
with open(output_path, "w", encoding="utf-8") as f:
f.write("\n".join(report_lines))
......
SimulationGraph/simulation_analysis.png

114 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment