# ============================================================================= # QWHPI — Quebec Weekly Housing Price Index # Author : Simon-Pierre Boucher # Contact : contact@spboucher.ai # File : Makefile # Purpose : One-command targets — pipeline, refresh, api, web, docker, tests. # ============================================================================= PY := python3 ENGINE := engine/scripts .PHONY: pipeline refresh api web up down test lint headers figures paper clean ## Full engine run: audit -> geography -> clean -> baseline -> hierarchical ## -> validation -> canonical dataset (+ DB load when DATABASE_URL is set) pipeline: $(PY) $(ENGINE)/01_profile.py $(PY) $(ENGINE)/02_geography.py $(PY) $(ENGINE)/03_clean.py $(PY) $(ENGINE)/04_baseline.py $(PY) $(ENGINE)/05_hierarchical.py $(PY) $(ENGINE)/06_validation.py $(PY) $(ENGINE)/07_canonical.py $(PY) $(ENGINE)/09_monthly.py $(PY) $(ENGINE)/10_monthly_validation.py $(PY) $(ENGINE)/11_monthly_canonical.py $(PY) -c "import sys; sys.path.insert(0,'engine/src'); from qwhpi.export import load_database; load_database()" ## Incremental refresh (new rows appended to the raw CSV) — monthly headline refresh: $(PY) $(ENGINE)/03_clean.py $(PY) $(ENGINE)/09_monthly.py $(PY) $(ENGINE)/11_monthly_canonical.py $(PY) -c "import sys; sys.path.insert(0,'engine/src'); from qwhpi.export import load_database; load_database()" api: cd api && $(PY) -m uvicorn app.main:app --host 0.0.0.0 --port 8080 web: cd web && npm run build && npm run start up: docker compose up --build -d down: docker compose down test: cd api && $(PY) -m pytest tests -q cd engine && $(PY) -m pytest tests -q headers: $(PY) scripts/check_headers.py figures: $(PY) $(ENGINE)/08_figures.py paper: cd paper && latexmk -pdf -quiet qwhpi.tex || pdflatex qwhpi.tex lint: $(PY) scripts/check_headers.py cd web && npx tsc --noEmit