You've already forked etude_lego_jurassic_world
Ajouter l’étape 35 : extraction et collage des autocollants
This commit is contained in:
21
scripts/compute_sticker_parts.py
Normal file
21
scripts/compute_sticker_parts.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""Extrait les planches d'autocollants des sets filtrés."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from lib.rebrickable.sticker_parts import build_sticker_parts, write_sticker_parts
|
||||
|
||||
|
||||
PARTS_FILTERED_PATH = Path("data/intermediate/parts_filtered.csv")
|
||||
PARTS_CATALOG_PATH = Path("data/raw/parts.csv")
|
||||
SETS_PATH = Path("data/intermediate/sets_enriched.csv")
|
||||
DESTINATION_PATH = Path("data/intermediate/sticker_parts.csv")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Construit le CSV des autocollants présents dans les sets filtrés."""
|
||||
stickers = build_sticker_parts(PARTS_FILTERED_PATH, PARTS_CATALOG_PATH, SETS_PATH)
|
||||
write_sticker_parts(DESTINATION_PATH, stickers)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
19
scripts/plot_sticker_sheets.py
Normal file
19
scripts/plot_sticker_sheets.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Assemble les visuels des planches d'autocollants des sets filtrés."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from lib.plots.sticker_sheets import plot_sticker_sheets
|
||||
|
||||
|
||||
STICKER_PARTS_PATH = Path("data/intermediate/sticker_parts.csv")
|
||||
DESTINATION_PATH = Path("figures/step35/sticker_sheets.png")
|
||||
RESOURCES_DIR = Path("figures/rebrickable")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Construit le collage des planches d'autocollants."""
|
||||
plot_sticker_sheets(STICKER_PARTS_PATH, DESTINATION_PATH, resources_dir=RESOURCES_DIR)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user