This repository serves as a template for code repository associated with an academic paper. You can use this template as a starting point for your code repository when beginning a new project.
This repository follows some specific design principles:
- We use
uvfor package management. - It is expected that code will be abstracted into a package, with functions and classes that can be imported into relevant scripts and notebooks.
- An
artifactsfolder delineates where meaningful paper deliverables (e.g., figures) go. - Plots, scripts, and notebooks are all separated:
- Use
plotsfor scripts that will generateartifacts. - Use
scriptsfor scripts that will conduct relevant analyses or launch jobs. - Use
notebooksfor exploratory notebooks that you need to track. - It is expected that no meaningful results will remain in
notebooks; eventually they should be formalized intoscriptsorplots.
- Use
Click Use this template on GitHub to create a new repository, then clone your new repository:
git clone [email protected]:OWNER/my_paper_repo.git
cd my_paper_repoOr use the GitHub CLI:
gh repo create OWNER/my_paper_repo --template pssachdeva/template_paper_repo --private --clone
cd my_paper_repoEdit pyproject.toml and replace package_name with a short importable name for your project. Rename src/package_name/ to match that name.
This template uses Python 3.12 and uv.
uv syncWhen you add dependencies, add them to pyproject.toml, then update the lockfile:
uv lock
uv syncFor a real paper repo, commit uv.lock so the computational environment can be reproduced. For this template repo, the lockfile does not need to be committed.
src/ contains reusable project code.
notebooks/ contains exploratory notebooks.
plots/ contains scripts that generate plots and figures.
scripts/ contains command-line or one-off workflow scripts.
tests/ contains tests for reusable code.
data/ is for local data files. Its contents are ignored by git.
artifacts/ is for generated outputs such as figures, tables, logs, and model outputs. Its contents are ignored by git.
Put reusable logic in src/, call that logic from notebooks or scripts, and write final plotting code in plots/. Keep raw data in data/ and generated files in artifacts/ unless there is a clear reason to commit a specific output.
Before sharing results, make sure someone else can run:
uv sync
uv run pytestAdd project-specific instructions here as the paper develops: where data comes from, how to regenerate each figure, and how to build the manuscript.