1

Filtre les pièces techniques et documente l’étape 28

This commit is contained in:
2025-12-02 15:28:22 +01:00
parent 812fd4a862
commit 74f8fa57e1
7 changed files with 109 additions and 13 deletions

View File

@@ -8,10 +8,12 @@ from lib.rebrickable.colors_by_set import (
load_parts,
write_colors_by_set,
)
from lib.rebrickable.color_ignores import load_ignored_part_numbers
PARTS_PATH = Path("data/intermediate/parts_filtered.csv")
COLORS_PATH = Path("data/raw/colors.csv")
PARTS_CATALOG_PATH = Path("data/raw/parts.csv")
DESTINATION_PATH = Path("data/intermediate/colors_by_set.csv")
@@ -19,7 +21,8 @@ def main() -> None:
"""Génère colors_by_set.csv depuis parts_filtered.csv."""
parts = load_parts(PARTS_PATH)
colors_lookup = build_colors_lookup(COLORS_PATH)
aggregated = aggregate_colors_by_set(parts, colors_lookup)
ignored_parts = load_ignored_part_numbers(PARTS_CATALOG_PATH)
aggregated = aggregate_colors_by_set(parts, colors_lookup, ignored_parts=ignored_parts)
write_colors_by_set(DESTINATION_PATH, aggregated)

View File

@@ -7,14 +7,15 @@ from lib.plots.colors_grid import plot_colors_grid
PARTS_PATH = Path("data/intermediate/parts_filtered.csv")
COLORS_PATH = Path("data/raw/colors.csv")
PARTS_CATALOG_PATH = Path("data/raw/parts.csv")
DESTINATION_PATH = Path("figures/step12/colors_grid.png")
MINIFIG_DESTINATION_PATH = Path("figures/step12/colors_grid_minifigs.png")
def main() -> None:
"""Construit les visuels des palettes de couleurs utilisées."""
plot_colors_grid(PARTS_PATH, COLORS_PATH, DESTINATION_PATH, minifig_only=False)
plot_colors_grid(PARTS_PATH, COLORS_PATH, MINIFIG_DESTINATION_PATH, minifig_only=True)
plot_colors_grid(PARTS_PATH, COLORS_PATH, PARTS_CATALOG_PATH, DESTINATION_PATH, minifig_only=False)
plot_colors_grid(PARTS_PATH, COLORS_PATH, PARTS_CATALOG_PATH, MINIFIG_DESTINATION_PATH, minifig_only=True)
if __name__ == "__main__":