Lab Project Overview
AI-Assisted Programming for PhD Researchers
Days 1 and 2 run on a single shared project: a field-study analysis pipeline you inherit, fix, and rebuild across five labs. This page is the map for that project: what it is, how to get it, what you build in each lab, and how to catch up if you fall behind.
The Lab Project
You inherit legacy_analysis.py, one script from a postdoc who has left the group, plus a folder of raw measurements. It runs on nobody’s machine but theirs, mixes units without checking them, and treats missing values as real readings. Over five labs, you turn that inherited mess into a tested, documented, CLI-driven pipeline: a package with a cleaning module, a statistics module, plots, a report, tests, and a command-line entry point.
This arc mirrors real research life more than any toy exercise could. You will inherit code from a labmate, a collaborator, or your own past self; it will not run out of the box; and the fastest way through is not to rewrite everything from scratch but to understand it, fix it in small verified steps, and leave it better documented than you found it. Every convention you practice here (explain before you accept, verify before you trust, small commits that tell a story) is the same discipline you will need on your own data.
Get It
Clone the starter repository:
git clone https://github.com/beyondsimulations/aiprog-lab-starter
cd aiprog-lab-starterA fresh clone lands you on the inherited starting state: the same mess described above, on the main branch. The lab checkpoints are not separate branches; they are git tags (lab-01-done … lab-05-done) that mark the reference end-state after each lab. You will create those states yourself as you work through the labs; the tags exist so you can check your progress or catch up if you fall behind (see below).
The Arc
| Lab | You build | Tag |
|---|---|---|
| Lab 1 | Understanding the inherited script + a project AGENTS.md + the path fix that makes it run |
lab-01-done |
| Lab 2 | A written spec, then the cleaning module (src/pipeline/io.py) |
lab-02-done |
| Lab 3 | Tests and a statistics module | lab-03-done |
| Lab 4 | Plots and a report, plus a CLI you build through structured review | lab-04-done |
| Lab 5 | A verified references list (docs/references.md); the skills and MCP work stays in your own copy |
lab-05-done |
Catching Up
If you fall behind, fetch the tags and reset your main branch to the reference state (safe in this course, because nothing is pushed). The git stash -u step parks everything you have not committed, including files your agent created but never committed: without it the switch refuses to run when one of those files also exists in the reference state. Your parked work is not lost, git stash pop brings it back.
git fetch --tags
git stash -u # park your work (tracked and untracked)
git switch -C main tags/lab-0N-doneReplace 0N with the lab number, for example lab-03-done. Resetting main (rather than checking the tag out on a side branch) matters: later labs compare against and merge into main, so a stale main would misreport diffs and merges. If you only want to compare your work against the reference, don’t reset: run git diff tags/lab-0N-done instead. Catching up is normal. The goal of any lab is not to have written every line yourself; it is to arrive at the next exercise with a working repository and enough understanding to keep going.
Final Architecture
By the end of Lab 5, the repository looks like this (key files; the data folder, README, and lock file are there too):
aiprog-lab-starter/
├── AGENTS.md
├── pyproject.toml
├── src/pipeline/__init__.py
├── src/pipeline/io.py
├── src/pipeline/stats.py
├── src/pipeline/plots.py
├── src/pipeline/report.py
├── src/pipeline/cli.py
├── tests/test_io.py
├── tests/test_stats.py
├── docs/spec-cleaning.md
├── docs/references.md
└── capstone/liter/sample.bib
legacy_analysis.py is gone by Lab 2, replaced by the src/pipeline/ package it was hiding inside. capstone/liter/sample.bib is not part of the pipeline; it is a sample dataset for the Literature Manager capstone option, shipped alongside the rest of the repository.