You've already forked etude_lego_jurassic_world
Trie le graphique de réutilisation des têtes par usage décroissant
This commit is contained in:
@@ -4,12 +4,14 @@ from pathlib import Path
|
||||
|
||||
from lib.rebrickable.head_reuse import aggregate_head_reuse, build_head_presence, load_minifigs_by_set, write_head_reuse
|
||||
from lib.rebrickable.minifigs_by_set import load_parts_catalog, select_head_parts
|
||||
from lib.rebrickable.minifig_character_sets import load_sets
|
||||
|
||||
|
||||
MINIFIGS_BY_SET_PATH = Path("data/intermediate/minifigs_by_set.csv")
|
||||
PARTS_CATALOG_PATH = Path("data/raw/parts.csv")
|
||||
INVENTORIES_PATH = Path("data/raw/inventories.csv")
|
||||
INVENTORY_PARTS_PATH = Path("data/raw/inventory_parts.csv")
|
||||
SETS_ENRICHED_PATH = Path("data/intermediate/sets_enriched.csv")
|
||||
DESTINATION_PATH = Path("data/intermediate/head_reuse.csv")
|
||||
|
||||
|
||||
@@ -18,8 +20,9 @@ def main() -> None:
|
||||
minifigs = load_minifigs_by_set(MINIFIGS_BY_SET_PATH)
|
||||
parts_catalog = load_parts_catalog(PARTS_CATALOG_PATH)
|
||||
head_parts = select_head_parts(parts_catalog)
|
||||
sets_lookup = load_sets(SETS_ENRICHED_PATH)
|
||||
presence = build_head_presence(INVENTORIES_PATH, INVENTORY_PARTS_PATH, head_parts)
|
||||
reuse = aggregate_head_reuse(minifigs, parts_catalog, presence)
|
||||
reuse = aggregate_head_reuse(minifigs, parts_catalog, presence, sets_lookup)
|
||||
write_head_reuse(DESTINATION_PATH, reuse)
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,12 @@ from lib.plots.head_reuse import plot_head_reuse
|
||||
|
||||
HEAD_REUSE_PATH = Path("data/intermediate/head_reuse.csv")
|
||||
DESTINATION_PATH = Path("figures/step33/head_reuse.png")
|
||||
RESOURCES_DIR = Path("figures/rebrickable")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Charge les données d'usage des têtes et produit le graphique associé."""
|
||||
plot_head_reuse(HEAD_REUSE_PATH, DESTINATION_PATH)
|
||||
plot_head_reuse(HEAD_REUSE_PATH, DESTINATION_PATH, resources_dir=RESOURCES_DIR)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user