Skip to content

Reproduce

Nearly every figure and number on this site is generated from a committed run artifact, and every artifact records the exact command that built it. This page makes that checkable: how to set up the project, how to run the pipeline yourself on one block or an entire city, and — for every flagship elsewhere on this site — the precise command behind it, read from each run's own meta.json rather than retyped by hand.

Setup

git clone --recurse-submodules https://github.com/GeoffChurch/REU_Slum_Optimization.git
# (or, if already cloned: git submodule update --init --recursive)

# Install uv: https://docs.astral.sh/uv/getting-started/installation/
uv sync

One block, no whole-city pass

Render one block's access-depth heatmaps (before, and after a road-building method) by targeting it with block_ids — no whole-city pass needed:

Quote the brackets

Keep the quotes around "block_ids=[...]" exactly as shown below — unquoted, the shell tries to glob [...] itself before Hydra ever sees the argument.

uv run python -m reblock.run data=capetown method=clearance eval=kcomplexity \
  "block_ids=[[ZAF.9.3.1_1_44882]]" render.enabled=true

A whole city

Or screen a whole city for dense/deep informal blocks and reblock the worst survivors in one command:

uv run python -m reblock.run data=capetown_full screen=dense_compact method=clearance \
  eval=kcomplexity render.enabled=true flagged_map.enabled=true max_blocks=5

The first capetown_full run downloads and caches the full metro under ~/.cache/reblock (nothing committed); later runs are instant.

Every flagship, exactly as it was built

Each example under examples/ records the exact command that produced it in its own meta.json. The table below reads that field directly and never retypes it — a command that drifted from the artifact it claims to reproduce would show up here as a mismatch, the same defect class as a stale number.

flagship command
method-comparison uv run python -m scripts.gen_example method_comparison
multiblock_depth_density uv run python -m scripts.gen_example depth_density
nairobi/multiblock_depth_density uv run python -m scripts.gen_example depth_density nairobi

The screen bake-off is generated by a different script and carries no meta.json, so it has no row above; its own regeneration command is documented in its README.

How the site itself rebuilds

python3 scripts/gen_site_pages.py
uvx --with mkdocs-material==9.7.7 --with mkdocs-glightbox==0.5.2 mkdocs build --strict

gen_site_pages.py is stdlib-only, so the first command needs nothing but a plain Python interpreter — no reblock import, no third-party packages. The second needs the MkDocs packages pinned above — uvx --with ... fetches them into a throwaway environment for a local run; CI installs the same pinned versions with pip before building. --strict turns a broken link into a build failure rather than a warning.

That is exactly what CI runs on every push to main that touches the site (.github/workflows/deploy-site.yml). Generated pages — this one included — are gitignored and never committed; the repository holds only the run artifacts and the handwritten partials under docs/_partials/ that gen_site_pages.py folds them into.