GitHub and Zenodo
This page covers how we structure repositories, and how code and data are archived and cited when a paper is submitted. git and GitHub covers the tools themselves, and Data Management covers where data lives while you are still working.
Repositories and Research Integrity
Repository structure can feel like housekeeping to deal with once the science is done, but it is part of the evidence for a paper. Our stated commitment is that a paper is not ready for peer review if its data and code are not publicly available and documented. A reader who can’t get from your archive to your figures can’t check your work, so the paper isn’t as transparent as it claims to be, and the group’s position on scientific integrity applies to that as much as to the analysis.
In practice, this means setting up the structure in the first week of a project, when it takes a few minutes, instead of reconstructing it during a revision.
Model Repositories and Meta-Repositories
We split a project across two kinds of repository, and the most common mistake is putting everything in one.
A model repository holds a model: code that is reusable, that will outlive this paper, and that someone else might run for a different question. Start from model_repo_template.
A meta-repository holds one paper’s analysis: the workflow that takes a model and some data and produces this paper’s figures and numbers. Start from paper-metarepo-template.
The meta-repository doesn’t contain the model. It refers to a released version of the model by its DOI.
Putting a model inside a paper’s repository causes three problems.
The model becomes hard to reuse: the next project has to either copy it, which creates a second version nobody keeps in sync, or depend on a repository named after an earlier paper.
The paper becomes hard to reproduce: a reader can’t tell which parts of the code are the model and which are this analysis, so they can’t tell what your contribution was.
Both become hard to version: a bug fix in the model turns into a commit in a paper repository that was supposed to stay fixed at submission.
If you’re unsure whether something is a model or an analysis, ask whether the next project would want to use it. If it would, it’s a model.
Starting a Project
Do this in the first week, before there is anything to lose:
- Create the repository from the appropriate template, in the
srikrishnan-laborganization and not in your personal account. Work that lives only under a personal account leaves with that person. - Give it a provisional name, and rename it to
lastname-etal_year_journalonce the paper takes shape. GitHub redirects the old URLs after a rename. - Keep it private for now if you like. It has to be public by submission.
- Fill in the README as you go. The template’s README has sections for the abstract, journal reference, code and data references, dependencies, and reproduction steps, and filling them in at the end means reconstructing everything from memory.
Archiving with Zenodo
GitHub is not an archive. Repositories get renamed, made private, transferred, and deleted, so a bare GitHub URL in a data availability statement will eventually stop working.
Zenodo gives you a DOI and a permanent snapshot. Once you connect it to a repository, every GitHub release is archived automatically:
- Sign in to Zenodo with your GitHub account and turn on archiving for the repository (GitHub’s instructions).
- Create a release on GitHub. Zenodo archives that snapshot and assigns it a DOI.
- Add the DOI badge to the top of the README.
Zenodo gives you two DOIs, and they point to different things:
- the version DOI points to one specific release, which never changes;
- the concept DOI points to the record as a whole, and always resolves to the latest version.
Cite the version DOI in a paper. A reader following your data availability statement has to land on the code that produced your results, and the concept DOI will lead them to whatever the code has become since.
Cite the concept DOI for a resource you expect people to keep using while you keep updating it.
If you cite the concept DOI in a paper by mistake, the link keeps working, so nobody notices that it now points to different code than the paper describes.
Before Submission
Do these steps in order, because each depends on the one before:
- Make both repositories (model and meta) public.
- Release and archive the model first. The meta-repository has to cite a specific version of the model, and that version doesn’t exist until you’ve created the release.
- Archive the input and generated data, including large simulation ensembles and not only the subset the paper used, so that readers can see how the subset was chosen.
- Release and archive the meta-repository, with the model and data DOIs already filled in its README.
- Write the availability statement using those DOIs instead of URLs.
- Ask someone who wasn’t involved to reproduce the analysis from the archive and the README alone, as the paper checklist requires. This is usually how hard-coded absolute paths get caught.
An availability statement should say what is archived, where, and under which DOI. For example:
All code and data required to reproduce this analysis are archived at [DOI]. The [model name] model version used is archived at [DOI]. Input data are available from [source] and archived at [DOI].
Check your target journal’s requirements for this statement, since they vary and some journals require a specific section heading.
Licensing
Every repository needs a license. Code without one isn’t open, whatever the repository’s visibility: without a license, other people have no legal permission to reuse, modify, or redistribute it, and having it on GitHub doesn’t change that.
Selecting Licenses covers the choice. Use a permissive license (MIT, BSD, Apache-2.0) for original code, and match the upstream license when you build on copyleft code.
When Someone Leaves
Repository ownership, releases that haven’t been made yet, and who maintains a model after its author graduates are covered in Leaving the Group. Please read it well before you leave, since these questions are much harder to sort out after the person has gone.