Skip to content

Publishing Project Code

Samuel Jenness edited this page Oct 12, 2026 · 1 revision

Who this is for: anyone whose paper has been accepted and whose project code needs to become public. Before you start: talk with Sam, and have your project's final renv.lock committed.

When a paper is accepted, we make its code public so readers can reproduce the results. Two things need to be public: the project repo, and the exact version of the model code it used. Publishing the model branch also publishes the base model history it was built on, which is why we talk it through first.

1. Publish the model code

Our usual practice is to push the project's EpiModelHIV-p branch to the public EpiModel/EpiModelHIV repository, which already holds the branches of past projects (for example EventDrivenPrEP), and to tag the commit used for the paper. The two repositories share their history, so the branch can be pushed directly. This needs write access to EpiModel/EpiModelHIV; ask Sam or a repository admin.

Tag the commit recorded for EpiModelHIV in your project's renv.lock (RemoteSha), not just the tip of the branch:

cd ~/git/EpiModelHIV-p
git fetch origin
git tag -a MyProject-JAIDS -m "Model code for Doe et al., JAIDS 2027" <RemoteSha from renv.lock>
git push git@github.com:EpiModel/EpiModelHIV.git origin/MyProject:refs/heads/MyProject MyProject-JAIDS

2. Point the project at the public code

In the project repo, reinstall EpiModelHIV from the public tag and update the lockfile, so that readers can run renv::restore() without access to our private repositories:

renv::install("EpiModel/EpiModelHIV@MyProject-JAIDS")
renv::snapshot()

Check it from a fresh clone of the project in an R session without a GitHub token: renv::restore() should install everything except ARTnetData, which stays private.

3. Make the project repo public

  1. Check that the repo contains no restricted data (ARTnet data and any other data under a data use agreement never go on GitHub) and no tokens or personal paths.
  2. In the README, add the citation of the paper and a short "Software" section naming the EpiModelHIV branch, tag, and commit.
  3. On GitHub, open Settings > General > Danger Zone > Change repository visibility and make the repo public.

4. Optional: archive with a DOI

For a permanent, citable copy, connect the repositories to Zenodo and create a GitHub release; Zenodo archives each release and assigns it a DOI.

Alternative: a separate public repository for the model code

If the model code should live in its own repository, create an empty public repository on GitHub (no README or license), then copy your branch and its history into it:

git clone --single-branch --branch MyProject git@github.com:EpiModel/EpiModelHIV-p.git MyProject-model
cd MyProject-model
git branch -m main
git remote set-url origin git@github.com:EpiModel/MyProject-model.git
git remote set-branches origin '*'
git push -u origin main
git fetch --prune origin

The new repository's main branch contains your branch and all of its history, including the base model commits it was created from, and nothing from other project branches.

Clone this wiki locally