1

Ajoute le graphique variations vs total par personnage

This commit is contained in:
2025-12-03 21:50:28 +01:00
parent e8cd0d346d
commit ad44796759
6 changed files with 244 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
"""Trace le total de minifigs et leurs variations distinctes par personnage."""
from pathlib import Path
from lib.plots.minifig_characters import plot_character_variations_vs_total
from lib.rebrickable.minifig_characters import (
aggregate_variations_and_totals,
load_minifigs_by_set,
write_character_variations_totals,
)
MINIFIGS_BY_SET_PATH = Path("data/intermediate/minifigs_by_set.csv")
COUNTS_PATH = Path("data/intermediate/minifig_character_variations_totals.csv")
DESTINATION_PATH = Path("figures/step22/minifig_character_variations_totals.png")
EXCLUDED_CHARACTERS = ["Figurant"]
def main() -> None:
"""Construit le comparatif variations/total et trace le graphique associé."""
rows = load_minifigs_by_set(MINIFIGS_BY_SET_PATH)
aggregates = aggregate_variations_and_totals(rows, excluded_characters=EXCLUDED_CHARACTERS)
write_character_variations_totals(COUNTS_PATH, aggregates)
plot_character_variations_vs_total(COUNTS_PATH, DESTINATION_PATH)
if __name__ == "__main__":
main()