# WP38 — reproducible pipeline (run from the project root; requires the authorised snapshot in data/raw/, see data/raw/README.md) PY := .venv/bin/python .PHONY: all env ingest clean match validate external features models robust tables figures paper test lit all: ingest clean match validate categories features models robust tables figures paper env: uv venv --python 3.12 .venv && uv pip install --python $(PY) -e . ingest: $(PY) -m src.ingest.load_snapshot external: # re-download public covariates and geography (manifest in data/external/) $(PY) -m src.ingest.external clean: $(PY) -m src.clean.listings && $(PY) -m src.clean.siblings && $(PY) -m src.clean.listings && $(PY) -m src.clean.stores && $(PY) -m src.reports.data_dictionary match: $(PY) -m src.features.match_products categories: # A-002 classifier (needs cached labels in data/processed/; API keys only to regenerate) $(PY) -m src.features.category_model embed && $(PY) -m src.features.category_model train validate: # LLM annotations need OPENAI_API_KEY / ANTHROPIC_API_KEY in .env; labels are kept in data/processed/*.csv (never overwritten) $(PY) -m src.validation.category_audit report && $(PY) -m src.validation.match_validation report && $(PY) -m src.reports.phase2_audit features: $(PY) -m src.features.region_category && $(PY) -m src.features.diversity models: $(PY) -m src.models.h1_raa && $(PY) -m src.models.h2_scale && $(PY) -m src.models.h3_longtail && $(PY) -m src.models.h4_dynamics \ && $(PY) -m src.models.h5_hedonic && $(PY) -m src.models.h7_complexity && $(PY) -m src.models.qdaci && $(PY) -m src.models.summary $${WP38_LABEL:-rule} robust: $(PY) -m src.validation.robustness && $(PY) -m src.validation.external_validation tables figures: $(PY) -m src.reports.make_tables && $(PY) -m src.reports.make_figures paper: cd paper && latexmk -pdf -interaction=nonstopmode main.tex test: $(PY) -m pytest -q lit: $(PY) -m src.literature.verify_refs && $(PY) -m src.literature.make_bib