1

Limite la timeline minifigs/set à 2025

This commit is contained in:
2025-12-02 14:30:29 +01:00
parent c9f1acee4b
commit 1dd713db4a
2 changed files with 13 additions and 4 deletions

View File

@@ -87,11 +87,14 @@ def build_minifigs_per_year(
inventory_minifigs_path: Path,
) -> List[dict]:
"""Calcule le nombre moyen de minifigs par set et par année (filtré vs catalogue)."""
max_year = 2025
filtered_totals: Dict[int, Dict[str, int]] = {}
with filtered_counts_path.open() as csv_file:
reader = csv.DictReader(csv_file)
for row in reader:
year = int(row["year"])
if year > max_year:
continue
current = filtered_totals.get(year)
if current is None:
filtered_totals[year] = {"minifigs": int(row["minifig_count"]), "sets": 1}
@@ -104,6 +107,8 @@ def build_minifigs_per_year(
reader = csv.DictReader(csv_file)
for row in reader:
year = int(row["year"])
if year > max_year:
continue
current = catalog_totals.get(year)
if current is None:
catalog_totals[year] = {"minifigs": global_minifigs.get(row["set_num"], 0), "sets": 1}