Repository Public Research preview
1# =============================================================================2# SP BOUCHER | ACADEMIC RESEARCH3# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4# =============================================================================5#6# PROJECT METADATA7# -----------------------------------------------------------------------------8# Project : UQO Working Paper 189# File : Makefile10# Repository : https://git.spboucher.ai/wp18_uqo11# Created : 2026-10-2012# Last Modified : 2026-10-2013#14# =============================================================================15# SOFTWARE MAINTAINER & AFFILIATION16# =============================================================================17#18# Maintainer : Simon-Pierre Boucher19# Position : Professor of Finance20# Institution : Université du Québec en Outaouais (UQO)21# Department : Département des sciences administratives22# Website : https://spboucher.ai23# Git : https://git.spboucher.ai24#25# Research Contact : research@spboucher.ai26# Direct Contact : simon@spboucher.ai27# Security/Admin : admin@spboucher.ai28#29# The affiliation is descriptive. It is not an institutional endorsement,30# a license grant or a determination of ownership.31#32# =============================================================================33# COPYRIGHT, AUTHORSHIP & DATA34# =============================================================================35#36# Copyright (c) the author(s) of this work.37# Ownership is not asserted by this notice; see the repository records.38#39# This header identifies the maintainer of the software. Scientific40# authorship of any associated paper is stated in the paper itself and41# is not changed by this notice. Datasets and third-party materials42# remain the property of their respective owners and licensors.43#44# This file is governed by the applicable project license, copyright45# notices, institutional agreements and relevant law.46#47# =============================================================================48# LICENSE & MAINTENANCE49# =============================================================================50#51# License : None specified (no license file in this repository)52# Classification : Public53#54# =============================================================================55# END OF SP BOUCHER SOURCE HEADER56# =============================================================================5758# WP18 — reproducible pipeline. Targets: setup / test / simulate / figures / tables / paper / all / clean59PY ?= .venv/bin/python60PIP ?= .venv/bin/pip61WORKERS ?= 66263.PHONY: all setup test test-fast simulate simulate-force simulate-quick robustness figures tables paper paper-inputs clean clean-results6465# simulate is skipped when results/data/diagnostics.json exists (60-min run); `make clean-results` first to redo it66all: test simulate figures tables paper6768setup:69 python3 -m venv .venv70 $(PIP) install --upgrade pip71 $(PIP) install -r requirements.txt7273test:74 $(PY) -m pytest tests/ -q7576test-fast:77 $(PY) -m pytest tests/ -q -m "not slow"7879# Full run: baseline + all scenario groups + transitions + welfare (about 60 min on 18 cores).80# Skipped if results/data/diagnostics.json is present; `make clean-results` (or `make simulate-force`) reruns it.81simulate:82 @if [ -f results/data/diagnostics.json ]; then \83 echo "simulate: results/data/diagnostics.json present -> skipping the 60-min run (make clean-results to redo)"; \84 else $(MAKE) simulate-force; fi8586simulate-force:87 mkdir -p results/data results/logs results/figures results/tables88 $(PY) -m src.simulation --workers $(WORKERS) 2>&1 | tee results/logs/simulate.log89 $(PY) -m src.robustness9091# Smoke test of the whole pipeline (small panel, subset of scenarios, ~10 min)92simulate-quick:93 mkdir -p results/data results/logs94 $(PY) -m src.simulation --quick --workers $(WORKERS) 2>&1 | tee results/logs/simulate_quick.log95 $(PY) -m src.robustness9697robustness:98 $(PY) -m src.robustness99100figures:101 $(PY) -m src.figures102103tables:104 $(PY) -m src.tables105106# Copy the generated exhibits into paper/ (HARMONISATION: paper/figures, paper/tables are what main.tex includes)107paper-inputs:108 mkdir -p paper/figures paper/tables109 cp results/figures/fig*.pdf paper/figures/110 cp results/tables/*.tex paper/tables/111112paper: paper-inputs113 cd paper && latexmk -pdf main.tex114115clean:116 find . -name "__pycache__" -type d -prune -exec rm -rf {} +117 rm -rf .pytest_cache118 cd paper && latexmk -c 2>/dev/null || true119 cd paper && latexmk -c appendix_proofs_standalone.tex 2>/dev/null || true120 rm -f paper/appendix_proofs_standalone.pdf121122clean-results:123 rm -rf results/data/* results/figures/* results/tables/* results/logs/*124